svn commit: r276054 - head/sys/vm

2014-12-22 Thread Gleb Smirnoff
Author: glebius
Date: Mon Dec 22 08:59:44 2014
New Revision: 276054
URL: https://svnweb.freebsd.org/changeset/base/276054

Log:
  Document flags of vm_page allocation functions.
  
  Reviewed by:  alc

Modified:
  head/sys/vm/vm_page.h

Modified: head/sys/vm/vm_page.h
==
--- head/sys/vm/vm_page.h   Mon Dec 22 04:54:57 2014(r276053)
+++ head/sys/vm/vm_page.h   Mon Dec 22 08:59:44 2014(r276054)
@@ -376,22 +376,35 @@ extern long first_page;   /* first physi
 
 vm_page_t PHYS_TO_VM_PAGE(vm_paddr_t pa);
 
-/* page allocation classes: */
+/*
+ * Page allocation parameters for vm_page for the functions
+ * vm_page_alloc(), vm_page_grab(), vm_page_alloc_contig() and
+ * vm_page_alloc_freelist().  Some functions support only a subset
+ * of the flags, and ignore others, see the flags legend.
+ *
+ * Bits 0 - 1 define class.
+ * Bits 2 - 15 dedicated for flags.
+ * Legend:
+ * (a) - vm_page_alloc() supports the flag.
+ * (c) - vm_page_alloc_contig() supports the flag.
+ * (f) - vm_page_alloc_freelist() supports the flag.
+ * (g) - vm_page_grab() supports the flag.
+ * Bits above 15 define the count of additional pages that the caller
+ * intends to allocate.
+ */
 #define VM_ALLOC_NORMAL0
 #define VM_ALLOC_INTERRUPT 1
 #define VM_ALLOC_SYSTEM2
 #defineVM_ALLOC_CLASS_MASK 3
-/* page allocation flags: */
-#defineVM_ALLOC_WIRED  0x0020  /* non pageable */
-#defineVM_ALLOC_ZERO   0x0040  /* Try to obtain a zeroed page 
*/
-#defineVM_ALLOC_NOOBJ  0x0100  /* No associated object */
-#defineVM_ALLOC_NOBUSY 0x0200  /* Do not busy the page */
-#defineVM_ALLOC_IFCACHED   0x0400  /* Fail if the page is not 
cached */
-#defineVM_ALLOC_IFNOTCACHED0x0800  /* Fail if the page is cached */
-#defineVM_ALLOC_IGN_SBUSY  0x1000  /* vm_page_grab() only */
-#defineVM_ALLOC_NODUMP 0x2000  /* don't include in dump */
-#defineVM_ALLOC_SBUSY  0x4000  /* Shared busy the page */
-
+#defineVM_ALLOC_WIRED  0x0020  /* (acfg) Allocate non pageable 
page */
+#defineVM_ALLOC_ZERO   0x0040  /* (acfg) Try to obtain a 
zeroed page */
+#defineVM_ALLOC_NOOBJ  0x0100  /* (acg) No associated object */
+#defineVM_ALLOC_NOBUSY 0x0200  /* (acg) Do not busy the page */
+#defineVM_ALLOC_IFCACHED   0x0400  /* (ag) Fail if page is not 
cached */
+#defineVM_ALLOC_IFNOTCACHED0x0800  /* (ag) Fail if page is cached 
*/
+#defineVM_ALLOC_IGN_SBUSY  0x1000  /* (g) Ignore shared busy flag 
*/
+#defineVM_ALLOC_NODUMP 0x2000  /* (ag) don't include in dump */
+#defineVM_ALLOC_SBUSY  0x4000  /* (acg) Shared busy the page */
 #defineVM_ALLOC_COUNT_SHIFT16
 #defineVM_ALLOC_COUNT(count)   ((count)  VM_ALLOC_COUNT_SHIFT)
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r276055 - head/sys/vm

2014-12-22 Thread Gleb Smirnoff
Author: glebius
Date: Mon Dec 22 09:00:47 2014
New Revision: 276055
URL: https://svnweb.freebsd.org/changeset/base/276055

Log:
  Do not clear flag that vm_page_alloc() doesn't support.
  
  Submitted by: kib

Modified:
  head/sys/vm/vm_page.c

Modified: head/sys/vm/vm_page.c
==
--- head/sys/vm/vm_page.c   Mon Dec 22 08:59:44 2014(r276054)
+++ head/sys/vm/vm_page.c   Mon Dec 22 09:00:47 2014(r276055)
@@ -2736,7 +2736,7 @@ retrylookup:
return (m);
}
}
-   m = vm_page_alloc(object, pindex, allocflags  ~VM_ALLOC_IGN_SBUSY);
+   m = vm_page_alloc(object, pindex, allocflags);
if (m == NULL) {
VM_OBJECT_WUNLOCK(object);
VM_WAIT;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r276056 - head/sys/vm

2014-12-22 Thread Gleb Smirnoff
Author: glebius
Date: Mon Dec 22 09:02:21 2014
New Revision: 276056
URL: https://svnweb.freebsd.org/changeset/base/276056

Log:
  Add flag VM_ALLOC_NOWAIT for vm_page_grab() that prevents sleeping and
  allows the function to fail.
  
  Reviewed by:  kib, alc
  Sponsored by: Nginx, Inc.

Modified:
  head/sys/vm/vm_page.c
  head/sys/vm/vm_page.h

Modified: head/sys/vm/vm_page.c
==
--- head/sys/vm/vm_page.c   Mon Dec 22 09:00:47 2014(r276055)
+++ head/sys/vm/vm_page.c   Mon Dec 22 09:02:21 2014(r276056)
@@ -2711,6 +2711,8 @@ retrylookup:
sleep = (allocflags  VM_ALLOC_IGN_SBUSY) != 0 ?
vm_page_xbusied(m) : vm_page_busied(m);
if (sleep) {
+   if ((allocflags  VM_ALLOC_NOWAIT) != 0)
+   return (NULL); 
/*
 * Reference the page before unlocking and
 * sleeping so that the page daemon is less
@@ -2738,6 +2740,8 @@ retrylookup:
}
m = vm_page_alloc(object, pindex, allocflags);
if (m == NULL) {
+   if ((allocflags  VM_ALLOC_NOWAIT) != 0)
+   return (NULL);
VM_OBJECT_WUNLOCK(object);
VM_WAIT;
VM_OBJECT_WLOCK(object);

Modified: head/sys/vm/vm_page.h
==
--- head/sys/vm/vm_page.h   Mon Dec 22 09:00:47 2014(r276055)
+++ head/sys/vm/vm_page.h   Mon Dec 22 09:02:21 2014(r276056)
@@ -405,6 +405,7 @@ vm_page_t PHYS_TO_VM_PAGE(vm_paddr_t pa)
 #defineVM_ALLOC_IGN_SBUSY  0x1000  /* (g) Ignore shared busy flag 
*/
 #defineVM_ALLOC_NODUMP 0x2000  /* (ag) don't include in dump */
 #defineVM_ALLOC_SBUSY  0x4000  /* (acg) Shared busy the page */
+#defineVM_ALLOC_NOWAIT 0x8000  /* (g) Do not sleep, return 
NULL */
 #defineVM_ALLOC_COUNT_SHIFT16
 #defineVM_ALLOC_COUNT(count)   ((count)  VM_ALLOC_COUNT_SHIFT)
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r275971 - vendor/ntp/4.2.8

2014-12-22 Thread Tijl Coosemans
On Sat, 20 Dec 2014 22:56:07 + (UTC) Cy Schubert c...@freebsd.org wrote:
 Author: cy
 Date: Sat Dec 20 22:56:06 2014
 New Revision: 275971
 URL: https://svnweb.freebsd.org/changeset/base/275971
 
 Log:
   Tag ntp-4.2.8.
   
   Reviewed by:roberto
   Security:   VUXML: 4033d826-87dd-11e4-9079-3c970e169bc2
   Security:   http://www.kb.cert.org/vuls/id/852879
   Security:   CVE-2014-9293
   SecurityCVE-2014-9294
   SecurityCVE-2014-9295
   SecurityCVE-2014-9296
 
 Added:
   vendor/ntp/4.2.8/
  - copied from r275970, vendor/ntp/dist/
 

Why hasn't this been merged to head yet?
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r276008 - in head/sys: kern sys

2014-12-22 Thread John Baldwin
On Sunday, December 21, 2014 11:21:17 am Andriy Gapon wrote:
 On 21/12/2014 17:14, Konstantin Belousov wrote:
  On Sun, Dec 21, 2014 at 04:45:28PM +0200, Andriy Gapon wrote:
  On 21/12/2014 16:41, Konstantin Belousov wrote:
  Or, are you asking why caching of the name could be needed for
  core dump files at all ?
 
  Sort of. Why VN_OPEN_NAMECACHE is useful in the case of core dumps?
  What does it make better?
  The vn_fullpath() mostly works for the core files after the change,
  comparing with the non-working state at all before.
  
 
 Ah, vn_fullpath(). Thank you.

Is there something specific to core dumps that makes vn_fullpath() more
useful to have working before a process tries to open the core?  (As
compared to other newly-created files)

-- 
John Baldwin
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r275819 - in head/lib/msun: ld128 ld80 src

2014-12-22 Thread Ed Schouten
Hey Steve,

2014-12-19 0:59 GMT+01:00 Steve Kargl s...@troutmask.apl.washington.edu:
 My only hope now is that Ed will fix the comment he inserted into
 math_private.h to properly note that the functions formerly known
 as cpack[fl] were written years before the C11 macros CMPLX[FL]
 existed.

Sure thing!

Just to make sure the phrasing is done properly, would you be willing
to come up with a diff? I'll push it in if you like.

Thanks,
-- 
Ed Schouten e...@80386.nl
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r276058 - head/sys/kern

2014-12-22 Thread Gleb Smirnoff
Author: glebius
Date: Mon Dec 22 15:39:24 2014
New Revision: 276058
URL: https://svnweb.freebsd.org/changeset/base/276058

Log:
  In sbappend*() family of functions clear M_PROTO flags of incoming
  mbufs. sbappendstream() already does this in m_demote().
  
  PR:   196174
  Sponsored by: Nginx, Inc.

Modified:
  head/sys/kern/uipc_sockbuf.c

Modified: head/sys/kern/uipc_sockbuf.c
==
--- head/sys/kern/uipc_sockbuf.cMon Dec 22 09:21:41 2014
(r276057)
+++ head/sys/kern/uipc_sockbuf.cMon Dec 22 15:39:24 2014
(r276058)
@@ -579,7 +579,7 @@ sbappend_locked(struct sockbuf *sb, stru
 
if (m == 0)
return;
-
+   m_clrprotoflags(m);
SBLASTRECORDCHK(sb);
n = sb-sb_mb;
if (n) {
@@ -732,6 +732,7 @@ sbappendrecord_locked(struct sockbuf *sb
 
if (m0 == 0)
return;
+   m_clrprotoflags(m0);
/*
 * Put the first mbuf on the queue.  Note this permits zero length
 * records.
@@ -777,6 +778,8 @@ sbappendaddr_locked_internal(struct sock
return (0);
m-m_len = asa-sa_len;
bcopy(asa, mtod(m, caddr_t), asa-sa_len);
+   if (m0)
+   m_clrprotoflags(m0);
if (ctrl_last)
ctrl_last-m_next = m0; /* concatenate data to control */
else
@@ -872,6 +875,7 @@ sbappendcontrol_locked(struct sockbuf *s
 
if (space  sbspace(sb))
return (0);
+   m_clrprotoflags(m0);
n-m_next = m0; /* concatenate data to control */
 
SBLASTRECORDCHK(sb);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r276059 - head/sys/arm/ti

2014-12-22 Thread Luiz Otavio O Souza
Author: loos
Date: Mon Dec 22 16:12:55 2014
New Revision: 276059
URL: https://svnweb.freebsd.org/changeset/base/276059

Log:
  Simplify the use of locks where possible, remove the locking when it is not
  required.
  
  Simplify the code a little bit.
  
  Reviewed by:  andrew (previous version)

Modified:
  head/sys/arm/ti/ti_gpio.c

Modified: head/sys/arm/ti/ti_gpio.c
==
--- head/sys/arm/ti/ti_gpio.c   Mon Dec 22 15:39:24 2014(r276058)
+++ head/sys/arm/ti/ti_gpio.c   Mon Dec 22 16:12:55 2014(r276059)
@@ -290,7 +290,7 @@ ti_gpio_intr_clr(struct ti_gpio_softc *s
  *
  *
  * LOCKING:
- * Internally locks the context
+ * No locking required, returns static data.
  *
  * RETURNS:
  * Returns 0 on success otherwise an error code
@@ -302,8 +302,6 @@ ti_gpio_pin_max(device_t dev, int *maxpi
unsigned int i;
unsigned int banks = 0;
 
-   TI_GPIO_LOCK(sc);
-
/* Calculate how many valid banks we have and then multiply that by 32 
to
 * give use the total number of pins.
 */
@@ -314,8 +312,6 @@ ti_gpio_pin_max(device_t dev, int *maxpi
 
*maxpin = (banks * PINS_PER_BANK) - 1;
 
-   TI_GPIO_UNLOCK(sc);
-
return (0);
 }
 
@@ -332,7 +328,7 @@ ti_gpio_pin_max(device_t dev, int *maxpi
  *   - GPIO_PIN_PULLDOWN
  *
  * LOCKING:
- * Internally locks the context
+ * No locking required, returns static data.
  *
  * RETURNS:
  * Returns 0 on success otherwise an error code
@@ -343,19 +339,13 @@ ti_gpio_pin_getcaps(device_t dev, uint32
struct ti_gpio_softc *sc = device_get_softc(dev);
uint32_t bank = (pin / PINS_PER_BANK);
 
-   TI_GPIO_LOCK(sc);
-
/* Sanity check the pin number is valid */
-   if ((bank = ti_max_gpio_banks()) || (sc-sc_mem_res[bank] == NULL)) {
-   TI_GPIO_UNLOCK(sc);
+   if ((bank = ti_max_gpio_banks()) || (sc-sc_mem_res[bank] == NULL))
return (EINVAL);
-   }
 
-   *caps = (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT |GPIO_PIN_PULLUP |
+   *caps = (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | GPIO_PIN_PULLUP |
GPIO_PIN_PULLDOWN);
 
-   TI_GPIO_UNLOCK(sc);
-
return (0);
 }
 
@@ -381,17 +371,13 @@ ti_gpio_pin_getflags(device_t dev, uint3
struct ti_gpio_softc *sc = device_get_softc(dev);
uint32_t bank = (pin / PINS_PER_BANK);
 
-   TI_GPIO_LOCK(sc);
-
/* Sanity check the pin number is valid */
-   if ((bank = ti_max_gpio_banks()) || (sc-sc_mem_res[bank] == NULL)) {
-   TI_GPIO_UNLOCK(sc);
+   if ((bank = ti_max_gpio_banks()) || (sc-sc_mem_res[bank] == NULL))
return (EINVAL);
-   }
 
/* Get the current pin state */
+   TI_GPIO_LOCK(sc);
TI_GPIO_GET_FLAGS(dev, pin, flags);
-
TI_GPIO_UNLOCK(sc);
 
return (0);
@@ -407,7 +393,7 @@ ti_gpio_pin_getflags(device_t dev, uint3
  * of the pin.
  *
  * LOCKING:
- * Internally locks the context
+ * No locking required, returns static data.
  *
  * RETURNS:
  * Returns 0 on success otherwise an error code
@@ -418,20 +404,14 @@ ti_gpio_pin_getname(device_t dev, uint32
struct ti_gpio_softc *sc = device_get_softc(dev);
uint32_t bank = (pin / PINS_PER_BANK);
 
-   TI_GPIO_LOCK(sc);
-
/* Sanity check the pin number is valid */
-   if ((bank = ti_max_gpio_banks()) || (sc-sc_mem_res[bank] == NULL)) {
-   TI_GPIO_UNLOCK(sc);
+   if ((bank = ti_max_gpio_banks()) || (sc-sc_mem_res[bank] == NULL))
return (EINVAL);
-   }
 
/* Set a very simple name */
snprintf(name, GPIOMAXNAME, gpio_%u, pin);
name[GPIOMAXNAME - 1] = '\0';
 
-   TI_GPIO_UNLOCK(sc);
-
return (0);
 }
 
@@ -460,30 +440,26 @@ ti_gpio_pin_setflags(device_t dev, uint3
struct ti_gpio_softc *sc = device_get_softc(dev);
uint32_t bank = (pin / PINS_PER_BANK);
uint32_t mask = (1UL  (pin % PINS_PER_BANK));
-   uint32_t reg_val;
-
-   TI_GPIO_LOCK(sc);
+   uint32_t oe;
 
/* Sanity check the pin number is valid */
-   if ((bank = ti_max_gpio_banks()) || (sc-sc_mem_res[bank] == NULL)) {
-   TI_GPIO_UNLOCK(sc);
+   if ((bank = ti_max_gpio_banks()) || (sc-sc_mem_res[bank] == NULL))
return (EINVAL);
-   }
 
/* Set the GPIO mode and state */
+   TI_GPIO_LOCK(sc);
if (TI_GPIO_SET_FLAGS(dev, pin, flags) != 0) {
TI_GPIO_UNLOCK(sc);
return (EINVAL);
}
 
/* If configuring as an output set the output enable bit */
-   reg_val = ti_gpio_read_4(sc, bank, TI_GPIO_OE);
+   oe = ti_gpio_read_4(sc, bank, TI_GPIO_OE);
if (flags  GPIO_PIN_INPUT)
-   reg_val |= mask;
+   oe |= mask;
else
-   reg_val = ~mask;
-   ti_gpio_write_4(sc, bank, 

svn commit: r276060 - head/sys/arm/ti

2014-12-22 Thread Luiz Otavio O Souza
Author: loos
Date: Mon Dec 22 16:29:15 2014
New Revision: 276060
URL: https://svnweb.freebsd.org/changeset/base/276060

Log:
  Remove some leftovers from OMAP3 support.

Modified:
  head/sys/arm/ti/ti_gpio.c

Modified: head/sys/arm/ti/ti_gpio.c
==
--- head/sys/arm/ti/ti_gpio.c   Mon Dec 22 16:12:55 2014(r276059)
+++ head/sys/arm/ti/ti_gpio.c   Mon Dec 22 16:29:15 2014(r276060)
@@ -69,10 +69,13 @@ __FBSDID($FreeBSD$);
 #include gpio_if.h
 #include ti_gpio_if.h
 
+#if !defined(SOC_OMAP4)  !defined(SOC_TI_AM335X)
+#error Unknown SoC
+#endif
+
 /* Register definitions */
 #defineTI_GPIO_REVISION0x
 #defineTI_GPIO_SYSCONFIG   0x0010
-#if defined(SOC_OMAP4) || defined(SOC_TI_AM335X)
 #defineTI_GPIO_IRQSTATUS_RAW_0 0x0024
 #defineTI_GPIO_IRQSTATUS_RAW_1 0x0028
 #defineTI_GPIO_IRQSTATUS_0 0x002C
@@ -103,9 +106,6 @@ __FBSDID($FreeBSD$);
 #defineTI_GPIO_SETWKUENA   0x0184
 #defineTI_GPIO_CLEARDATAOUT0x0190
 #defineTI_GPIO_SETDATAOUT  0x0194
-#else
-#error Unknown SoC
-#endif
 
 /* Other SoC Specific definitions */
 #defineOMAP4_MAX_GPIO_BANKS6
@@ -273,13 +273,8 @@ ti_gpio_intr_clr(struct ti_gpio_softc *s
 {
 
/* We clear both set of registers. */
-#if defined(SOC_OMAP4) || defined(SOC_TI_AM335X)
ti_gpio_write_4(sc, bank, TI_GPIO_IRQSTATUS_CLR_0, mask);
ti_gpio_write_4(sc, bank, TI_GPIO_IRQSTATUS_CLR_1, mask);
-#else
-   ti_gpio_write_4(sc, bank, TI_GPIO_CLEARIRQENABLE1, mask);
-   ti_gpio_write_4(sc, bank, TI_GPIO_CLEARIRQENABLE2, mask);
-#endif
 }
 
 /**
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r276061 - head/contrib/elftoolchain/elfcopy

2014-12-22 Thread Ed Maste
Author: emaste
Date: Mon Dec 22 16:31:09 2014
New Revision: 276061
URL: https://svnweb.freebsd.org/changeset/base/276061

Log:
  Set up default shstrtab entries at shstrtab initialization
  
  Instead of waiting until the addition of the first non-default entry.
  This fixes a segfault when strip(1) is asked to remove every section from
  an object file.
  
  Upstream elftoolchain ticket 463
  
  Reviewed by:  imp
  Sponsored by: The FreeBSD Foundation
  Differential Revision: https://reviews.freebsd.org/D1341

Modified:
  head/contrib/elftoolchain/elfcopy/sections.c

Modified: head/contrib/elftoolchain/elfcopy/sections.c
==
--- head/contrib/elftoolchain/elfcopy/sections.cMon Dec 22 16:29:15 
2014(r276060)
+++ head/contrib/elftoolchain/elfcopy/sections.cMon Dec 22 16:31:09 
2014(r276061)
@@ -1139,12 +1139,6 @@ add_to_shstrtab(struct elfcopy *ecp, con
struct section *s;
 
s = ecp-shstrtab;
-   if (s-buf == NULL) {
-   insert_to_strtab(s, );
-   insert_to_strtab(s, .symtab);
-   insert_to_strtab(s, .strtab);
-   insert_to_strtab(s, .shstrtab);
-   }
insert_to_strtab(s, name);
 }
 
@@ -1206,6 +1200,11 @@ init_shstrtab(struct elfcopy *ecp)
s-loadable = 0;
s-type = SHT_STRTAB;
s-vma = 0;
+
+   insert_to_strtab(s, );
+   insert_to_strtab(s, .symtab);
+   insert_to_strtab(s, .strtab);
+   insert_to_strtab(s, .shstrtab);
 }
 
 void
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r276062 - in head/contrib/elftoolchain: common readelf

2014-12-22 Thread Ed Maste
Author: emaste
Date: Mon Dec 22 16:34:59 2014
New Revision: 276062
URL: https://svnweb.freebsd.org/changeset/base/276062

Log:
  Add AArch64 machine time and relocations for readelf
  
  Reviewed by:  andrew
  Sponsored by: The FreeBSD Foundation
  Differential Revision: https://reviews.freebsd.org/D1333

Modified:
  head/contrib/elftoolchain/common/elfdefinitions.h
  head/contrib/elftoolchain/readelf/readelf.c

Modified: head/contrib/elftoolchain/common/elfdefinitions.h
==
--- head/contrib/elftoolchain/common/elfdefinitions.h   Mon Dec 22 16:31:09 
2014(r276061)
+++ head/contrib/elftoolchain/common/elfdefinitions.h   Mon Dec 22 16:34:59 
2014(r276062)
@@ -770,6 +770,8 @@ _ELF_DEFINE_EM(EM_ETPU, 178,
Freescale Extended Time Processing Unit)  \
 _ELF_DEFINE_EM(EM_SLE9X,179,   \
Infineon Technologies SLE9X core) \
+_ELF_DEFINE_EM(EM_AARCH64,  183,   \
+   AArch64 (64-bit ARM)) \
 _ELF_DEFINE_EM(EM_AVR32,185,   \
Atmel Corporation 32-bit microprocessor family)   \
 _ELF_DEFINE_EM(EM_STM8, 186,   \

Modified: head/contrib/elftoolchain/readelf/readelf.c
==
--- head/contrib/elftoolchain/readelf/readelf.c Mon Dec 22 16:31:09 2014
(r276061)
+++ head/contrib/elftoolchain/readelf/readelf.c Mon Dec 22 16:34:59 2014
(r276062)
@@ -487,6 +487,7 @@ elf_machine(unsigned int mach)
case EM_SEP: return Sharp embedded microprocessor;
case EM_ARCA: return Arca RISC Microprocessor;
case EM_UNICORE: return Microprocessor series from PKU-Unity Ltd;
+   case EM_AARCH64: return AArch64;
default:
snprintf(s_mach, sizeof(s_mach), unknown: %#x, mach);
return (s_mach);
@@ -1041,6 +1042,67 @@ r_type(unsigned int mach, unsigned int t
case 37: return R_386_TLS_TPOFF32;
default: return ;
}
+   case EM_AARCH64:
+   switch(type) {
+   case 0: return R_AARCH64_NONE;
+   case 257: return R_AARCH64_ABS64;
+   case 258: return R_AARCH64_ABS32;
+   case 259: return R_AARCH64_ABS16;
+   case 260: return R_AARCH64_PREL64;
+   case 261: return R_AARCH64_PREL32;
+   case 262: return R_AARCH64_PREL16;
+   case 263: return R_AARCH64_MOVW_UABS_G0;
+   case 264: return R_AARCH64_MOVW_UABS_G0_NC;
+   case 265: return R_AARCH64_MOVW_UABS_G1;
+   case 266: return R_AARCH64_MOVW_UABS_G1_NC;
+   case 267: return R_AARCH64_MOVW_UABS_G2;
+   case 268: return R_AARCH64_MOVW_UABS_G2_NC;
+   case 269: return R_AARCH64_MOVW_UABS_G3;
+   case 270: return R_AARCH64_MOVW_SABS_G0;
+   case 271: return R_AARCH64_MOVW_SABS_G1;
+   case 272: return R_AARCH64_MOVW_SABS_G2;
+   case 273: return R_AARCH64_LD_PREL_LO19;
+   case 274: return R_AARCH64_ADR_PREL_LO21;
+   case 275: return R_AARCH64_ADR_PREL_PG_HI21;
+   case 276: return R_AARCH64_ADR_PREL_PG_HI21_NC;
+   case 277: return R_AARCH64_ADD_ABS_LO12_NC;
+   case 278: return R_AARCH64_LDST8_ABS_LO12_NC;
+   case 279: return R_AARCH64_TSTBR14;
+   case 280: return R_AARCH64_CONDBR19;
+   case 282: return R_AARCH64_JUMP26;
+   case 283: return R_AARCH64_CALL26;
+   case 284: return R_AARCH64_LDST16_ABS_LO12_NC;
+   case 285: return R_AARCH64_LDST32_ABS_LO12_NC;
+   case 286: return R_AARCH64_LDST64_ABS_LO12_NC;
+   case 287: return R_AARCH64_MOVW_PREL_G0;
+   case 288: return R_AARCH64_MOVW_PREL_G0_NC;
+   case 289: return R_AARCH64_MOVW_PREL_G1;
+   case 290: return R_AARCH64_MOVW_PREL_G1_NC;
+   case 291: return R_AARCH64_MOVW_PREL_G2;
+   case 292: return R_AARCH64_MOVW_PREL_G2_NC;
+   case 293: return R_AARCH64_MOVW_PREL_G3;
+   case 299: return R_AARCH64_LDST128_ABS_LO12_NC;
+   case 300: return R_AARCH64_MOVW_GOTOFF_G0;
+   case 301: return R_AARCH64_MOVW_GOTOFF_G0_NC;
+   case 302: return R_AARCH64_MOVW_GOTOFF_G1;
+   case 303: return R_AARCH64_MOVW_GOTOFF_G1_NC;
+   case 304: return R_AARCH64_MOVW_GOTOFF_G2;
+   case 305: return R_AARCH64_MOVW_GOTOFF_G2_NC;
+   case 306: return R_AARCH64_MOVW_GOTOFF_G3;
+   case 307: return R_AARCH64_GOTREL64;
+   case 308: 

svn commit: r276063 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2014-12-22 Thread Steven Hartland
Author: smh
Date: Mon Dec 22 16:38:29 2014
New Revision: 276063
URL: https://svnweb.freebsd.org/changeset/base/276063

Log:
  Standardise on illumos for #ifdef's in zvol.c
  
  Also correct as per style(9) on the use of #ifdef comments.
  
  This is a no-op change as pre-cursor to a full cleanup and merge with
  upstream zvol changes.
  
  Sponsored by: Multiplay

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c  Mon Dec 22 
16:34:59 2014(r276062)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c  Mon Dec 22 
16:38:29 2014(r276063)
@@ -214,7 +214,7 @@ static void zvol_geom_worker(void *arg);
 static void
 zvol_size_changed(zvol_state_t *zv)
 {
-#ifdef sun
+#ifdef illumos
dev_t dev = makedevice(maj, min);
 
VERIFY(ddi_prop_update_int64(dev, zfs_dip,
@@ -225,7 +225,7 @@ zvol_size_changed(zvol_state_t *zv)
/* Notify specfs to invalidate the cached size */
spec_size_invalidate(dev, VBLK);
spec_size_invalidate(dev, VCHR);
-#else  /* !sun */
+#else  /* !illumos */
if (zv-zv_volmode == ZFS_VOLMODE_GEOM) {
struct g_provider *pp;
 
@@ -236,7 +236,7 @@ zvol_size_changed(zvol_state_t *zv)
g_resize_provider(pp, zv-zv_volsize);
g_topology_unlock();
}
-#endif /* !sun */
+#endif /* illumos */
 }
 
 int
@@ -517,7 +517,7 @@ zil_replay_func_t *zvol_replay_vector[TX
zvol_replay_err,/* TX_WRITE2 */
 };
 
-#ifdef sun
+#ifdef illumos
 int
 zvol_name2minor(const char *name, minor_t *minor)
 {
@@ -530,7 +530,7 @@ zvol_name2minor(const char *name, minor_
mutex_exit(spa_namespace_lock);
return (zv ? 0 : -1);
 }
-#endif /* sun */
+#endif /* illumos */
 
 /*
  * Create a minor node (plus a whole lot more) for the specified volume.
@@ -565,7 +565,7 @@ zvol_create_minor(const char *name)
return (error);
}
 
-#ifdef sun
+#ifdef illumos
if ((minor = zfsdev_minor_alloc()) == 0) {
dmu_objset_disown(os, FTAG);
mutex_exit(spa_namespace_lock);
@@ -604,7 +604,7 @@ zvol_create_minor(const char *name)
zs = ddi_get_soft_state(zfsdev_state, minor);
zs-zss_type = ZSST_ZVOL;
zv = zs-zss_data = kmem_zalloc(sizeof (zvol_state_t), KM_SLEEP);
-#else  /* !sun */
+#else  /* !illumos */
 
zv = kmem_zalloc(sizeof(*zv), KM_SLEEP);
zv-zv_state = 0;
@@ -651,7 +651,7 @@ zvol_create_minor(const char *name)
dev-si_drv2 = zv;
}
LIST_INSERT_HEAD(all_zvols, zv, zv_links);
-#endif /* !sun */
+#endif /* illumos */
 
(void) strlcpy(zv-zv_name, name, MAXPATHLEN);
zv-zv_min_bs = DEV_BSHIFT;
@@ -681,7 +681,7 @@ zvol_create_minor(const char *name)
 
mutex_exit(spa_namespace_lock);
 
-#ifndef sun
+#ifndef illumos
if (zv-zv_volmode == ZFS_VOLMODE_GEOM) {
zvol_geom_run(zv);
g_topology_unlock();
@@ -700,7 +700,7 @@ zvol_create_minor(const char *name)
 static int
 zvol_remove_zv(zvol_state_t *zv)
 {
-#ifdef sun
+#ifdef illumos
minor_t minor = zv-zv_minor;
 #endif
 
@@ -710,7 +710,7 @@ zvol_remove_zv(zvol_state_t *zv)
 
ZFS_LOG(1, ZVOL %s destroyed., zv-zv_name);
 
-#ifdef sun
+#ifdef illumos
(void) snprintf(nmbuf, sizeof (nmbuf), %u,raw, minor);
ddi_remove_minor_node(zfs_dip, nmbuf);
 #else
@@ -721,7 +721,7 @@ zvol_remove_zv(zvol_state_t *zv)
g_topology_unlock();
} else if (zv-zv_volmode == ZFS_VOLMODE_DEV)
destroy_dev(zv-zv_dev);
-#endif /* sun */
+#endif
 
avl_destroy(zv-zv_znode.z_range_avl);
mutex_destroy(zv-zv_znode.z_range_lock);
@@ -809,7 +809,7 @@ zvol_last_close(zvol_state_t *zv)
zv-zv_objset = NULL;
 }
 
-#ifdef sun
+#ifdef illumos
 int
 zvol_prealloc(zvol_state_t *zv)
 {
@@ -848,7 +848,7 @@ zvol_prealloc(zvol_state_t *zv)
 
return (0);
 }
-#endif /* sun */
+#endif /* illumos */
 
 static int
 zvol_update_volsize(objset_t *os, uint64_t volsize)
@@ -955,7 +955,7 @@ zvol_set_volsize(const char *name, major
}
}
 
-#ifdef sun
+#ifdef illumos
/*
 * Generate a LUN expansion event.
 */
@@ -976,7 +976,7 @@ zvol_set_volsize(const char *name, major
nvlist_free(attr);
kmem_free(physpath, MAXPATHLEN);
}
-#endif /* sun */
+#endif /* illumos */
 
 out:
dmu_objset_rele(os, FTAG);
@@ -1260,7 +1260,7 @@ zvol_log_write(zvol_state_t *zv, dmu_tx_
}
 }
 
-#ifdef sun
+#ifdef illumos
 static int
 zvol_dumpio_vdev(vdev_t *vd, void *addr, uint64_t offset, uint64_t origoffset,
 uint64_t size, boolean_t doread, boolean_t isdump)
@@ -1353,7 +1353,7 @@ zvol_dumpio(zvol_state_t *zv, void *addr
 
  

svn commit: r276064 - in head/sys/dev/vt/hw: efifb vga

2014-12-22 Thread Roger Pau Monné
Author: royger
Date: Mon Dec 22 16:46:07 2014
New Revision: 276064
URL: https://svnweb.freebsd.org/changeset/base/276064

Log:
  vt: register the memory regions used by the vt drivers
  
  Current VT drivers don't register the memory regions they use with the
  nexus. This patch makes vt_vga and vt_efifb register the memory regions they
  use.
  
  This is needed (at least) for Xen support, since the FreeBSD kernel will try
  to use the holes in the memory map to map memory from other domains and
  setup it's grant table.
  
  Sponsored by: Citrix Systems RD
  Reported by:  sbruno
  Tested by:emaste
  Reviewed by:  ray
  PR:   195537
  Differential Revision:https://reviews.freebsd.org/D1291

Modified:
  head/sys/dev/vt/hw/efifb/efifb.c
  head/sys/dev/vt/hw/vga/vt_vga.c

Modified: head/sys/dev/vt/hw/efifb/efifb.c
==
--- head/sys/dev/vt/hw/efifb/efifb.cMon Dec 22 16:38:29 2014
(r276063)
+++ head/sys/dev/vt/hw/efifb/efifb.cMon Dec 22 16:46:07 2014
(r276064)
@@ -37,6 +37,9 @@ __FBSDID($FreeBSD$);
 #include sys/kernel.h
 #include sys/fbio.h
 #include sys/linker.h
+#include sys/bus.h
+#include sys/module.h
+#include sys/rman.h
 
 #include opt_platform.h
 
@@ -179,3 +182,53 @@ vt_efifb_remap(void *xinfo)
info-fb_size, VM_MEMATTR_WRITE_COMBINING);
 }
 
+/* Dummy NewBus functions to reserve the resources used by the efifb driver */
+static void
+vtefifb_identify(driver_t *driver, device_t parent)
+{
+
+   if (local_info.fb_pbase == 0 || local_info.fb_size == 0)
+   return;
+
+   if (BUS_ADD_CHILD(parent, 0, driver-name, 0) == NULL)
+   panic(Unable to attach vt_efifb console);
+}
+
+static int
+vtefifb_probe(device_t dev)
+{
+
+   device_set_desc(dev, vt_efifb driver);
+   return (BUS_PROBE_NOWILDCARD);
+}
+
+static int
+vtefifb_attach(device_t dev)
+{
+   struct resource *pseudo_phys_res;
+   int res_id;
+
+   res_id = 0;
+   pseudo_phys_res = bus_alloc_resource(dev, SYS_RES_MEMORY,
+   res_id, local_info.fb_pbase,
+   local_info.fb_pbase + local_info.fb_size,
+   local_info.fb_size, RF_ACTIVE);
+   if (pseudo_phys_res == NULL)
+   panic(Unable to reserve vt_efifb memory);
+   return (0);
+}
+
+/* Private Device Attachment Data  
---*/
+static device_method_t vtefifb_methods[] = {
+   /* Device interface */
+   DEVMETHOD(device_identify,  vtefifb_identify),
+   DEVMETHOD(device_probe, vtefifb_probe),
+   DEVMETHOD(device_attach,vtefifb_attach),
+
+   DEVMETHOD_END
+};
+
+DEFINE_CLASS_0(vtefifb, vtefifb_driver, vtefifb_methods, 0);
+devclass_t vtefifb_devclass;
+
+DRIVER_MODULE(vtefifb, nexus, vtefifb_driver, vtefifb_devclass, NULL, NULL);

Modified: head/sys/dev/vt/hw/vga/vt_vga.c
==
--- head/sys/dev/vt/hw/vga/vt_vga.c Mon Dec 22 16:38:29 2014
(r276063)
+++ head/sys/dev/vt/hw/vga/vt_vga.c Mon Dec 22 16:46:07 2014
(r276064)
@@ -36,6 +36,9 @@ __FBSDID($FreeBSD$);
 #include sys/param.h
 #include sys/kernel.h
 #include sys/systm.h
+#include sys/bus.h
+#include sys/module.h
+#include sys/rman.h
 
 #include dev/vt/vt.h
 #include dev/vt/hw/vga/vt_vga_reg.h
@@ -56,6 +59,7 @@ struct vga_softc {
bus_space_handle_t   vga_reg_handle;
int  vga_wmode;
term_color_t vga_curfg, vga_curbg;
+   boolean_tvga_enabled;
 };
 
 /* Convenience macros. */
@@ -1228,6 +1232,7 @@ vga_init(struct vt_device *vd)
vd-vd_height = VT_VGA_HEIGHT;
}
vga_initialize(vd, textmode);
+   sc-vga_enabled = true;
 
return (CN_INTERNAL);
 }
@@ -1241,3 +1246,53 @@ vga_postswitch(struct vt_device *vd)
/* Ask vt(9) to update chars on visible area. */
vd-vd_flags |= VDF_INVALID;
 }
+
+/* Dummy NewBus functions to reserve the resources used by the vt_vga driver */
+static void
+vtvga_identify(driver_t *driver, device_t parent)
+{
+
+   if (!vga_conssoftc.vga_enabled)
+   return;
+
+   if (BUS_ADD_CHILD(parent, 0, driver-name, 0) == NULL)
+   panic(Unable to attach vt_vga console);
+}
+
+static int
+vtvga_probe(device_t dev)
+{
+
+   device_set_desc(dev, vt_vga driver);
+   return (BUS_PROBE_NOWILDCARD);
+}
+
+static int
+vtvga_attach(device_t dev)
+{
+   struct resource *pseudo_phys_res;
+   int res_id;
+
+   res_id = 0;
+   pseudo_phys_res = bus_alloc_resource(dev, SYS_RES_MEMORY,
+   res_id, VGA_MEM_BASE, VGA_MEM_BASE + VGA_MEM_SIZE,
+   VGA_MEM_SIZE, RF_ACTIVE);
+   if (pseudo_phys_res == NULL)
+   panic(Unable to reserve vt_vga memory);
+   return (0);
+}
+
+/* Private 

svn commit: r276065 - head/sys/dev/ipmi

2014-12-22 Thread John Baldwin
Author: jhb
Date: Mon Dec 22 16:53:04 2014
New Revision: 276065
URL: https://svnweb.freebsd.org/changeset/base/276065

Log:
  Explicitly treat timeouts when waiting for IBF or OBF to change state as an
  error.  This fixes occasional hangs in the IPMI kcs thread when using
  ipmitool locally.
  
  MFC after:1 week

Modified:
  head/sys/dev/ipmi/ipmi_kcs.c

Modified: head/sys/dev/ipmi/ipmi_kcs.c
==
--- head/sys/dev/ipmi/ipmi_kcs.cMon Dec 22 16:46:07 2014
(r276064)
+++ head/sys/dev/ipmi/ipmi_kcs.cMon Dec 22 16:53:04 2014
(r276065)
@@ -184,6 +184,8 @@ kcs_start_write(struct ipmi_softc *sc)
for (retry = 0; retry  10; retry++) {
/* Wait for IBF = 0 */
status = kcs_wait_for_ibf(sc, 0);
+   if (status  KCS_STATUS_IBF)
+   return (0);
 
/* Clear OBF */
kcs_clear_obf(sc, status);
@@ -193,6 +195,9 @@ kcs_start_write(struct ipmi_softc *sc)
 
/* Wait for IBF = 0 */
status = kcs_wait_for_ibf(sc, 0);
+   if (status  KCS_STATUS_IBF)
+   return (0);
+
if (KCS_STATUS_STATE(status) == KCS_STATUS_STATE_WRITE)
break;
DELAY(100);
@@ -222,6 +227,8 @@ kcs_write_byte(struct ipmi_softc *sc, u_
 
/* Wait for IBF = 0 */
status = kcs_wait_for_ibf(sc, 0);
+   if (status  KCS_STATUS_IBF)
+   return (0);
 
if (KCS_STATUS_STATE(status) != KCS_STATUS_STATE_WRITE)
return (0);
@@ -244,6 +251,8 @@ kcs_write_last_byte(struct ipmi_softc *s
 
/* Wait for IBF = 0 */
status = kcs_wait_for_ibf(sc, 0);
+   if (status  KCS_STATUS_IBF)
+   return (0);
 
if (KCS_STATUS_STATE(status) != KCS_STATUS_STATE_WRITE)
/* error state */
@@ -274,6 +283,8 @@ kcs_read_byte(struct ipmi_softc *sc, u_c
 
/* Wait for OBF = 1 */
status = kcs_wait_for_obf(sc, 1);
+   if ((status  KCS_STATUS_OBF) == 0)
+   return (0);
 
/* Read Data_out */
*data = INB(sc, KCS_DATA);
@@ -288,6 +299,8 @@ kcs_read_byte(struct ipmi_softc *sc, u_c
 
/* Wait for OBF = 1*/
status = kcs_wait_for_obf(sc, 1);
+   if ((status  KCS_STATUS_OBF) == 0)
+   return (0);
 
/* Read Dummy */
dummy = INB(sc, KCS_DATA);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r276066 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2014-12-22 Thread Steven Hartland
Author: smh
Date: Mon Dec 22 17:04:51 2014
New Revision: 276066
URL: https://svnweb.freebsd.org/changeset/base/276066

Log:
  Refactor zvol locking to minimise diff with upstream
  
  Use #define zfsdev_state_lock spa_namespace_lock instead of replacing all
  zfsdev_state_lock with spa_namespace_lock to minimise changes from upstream.
  
  Differential Revision:D1302
  MFC after:1 month
  X-MFC-Withr276063
  Sponsored by: Multiplay

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c  Mon Dec 22 
16:53:04 2014(r276065)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c  Mon Dec 22 
17:04:51 2014(r276066)
@@ -110,11 +110,20 @@ static char *zvol_tag = zvol_tag;
 #defineZVOL_DUMPSIZE   dumpsize
 
 /*
- * The spa_namespace_lock protects the zfsdev_state structure from being
- * modified while it's being used, e.g. an open that comes in before a
- * create finishes.  It also protects temporary opens of the dataset so that,
+ * This lock protects the zfsdev_state structure from being modified
+ * while it's being used, e.g. an open that comes in before a create
+ * finishes.  It also protects temporary opens of the dataset so that,
  * e.g., an open doesn't get a spurious EBUSY.
  */
+#ifdef illumos
+kmutex_t zfsdev_state_lock;
+#else
+/*
+ * In FreeBSD we've replaced the upstream zfsdev_state_lock with the
+ * spa_namespace_lock in the ZVOL code.
+ */
+#define zfsdev_state_lock spa_namespace_lock
+#endif
 static uint32_t zvol_minors;
 
 SYSCTL_DECL(_vfs_zfs);
@@ -294,7 +303,7 @@ zvol_minor_lookup(const char *name)
 {
zvol_state_t *zv;
 
-   ASSERT(MUTEX_HELD(spa_namespace_lock));
+   ASSERT(MUTEX_HELD(zfsdev_state_lock));
 
LIST_FOREACH(zv, all_zvols, zv_links) {
if (strcmp(zv-zv_name, name) == 0)
@@ -523,11 +532,11 @@ zvol_name2minor(const char *name, minor_
 {
zvol_state_t *zv;
 
-   mutex_enter(spa_namespace_lock);
+   mutex_enter(zfsdev_state_lock);
zv = zvol_minor_lookup(name);
if (minor  zv)
*minor = zv-zv_minor;
-   mutex_exit(spa_namespace_lock);
+   mutex_exit(zfsdev_state_lock);
return (zv ? 0 : -1);
 }
 #endif /* illumos */
@@ -550,10 +559,10 @@ zvol_create_minor(const char *name)
 
ZFS_LOG(1, Creating ZVOL %s..., name);
 
-   mutex_enter(spa_namespace_lock);
+   mutex_enter(zfsdev_state_lock);
 
if (zvol_minor_lookup(name) != NULL) {
-   mutex_exit(spa_namespace_lock);
+   mutex_exit(zfsdev_state_lock);
return (SET_ERROR(EEXIST));
}
 
@@ -561,20 +570,20 @@ zvol_create_minor(const char *name)
error = dmu_objset_own(name, DMU_OST_ZVOL, B_TRUE, FTAG, os);
 
if (error) {
-   mutex_exit(spa_namespace_lock);
+   mutex_exit(zfsdev_state_lock);
return (error);
}
 
 #ifdef illumos
if ((minor = zfsdev_minor_alloc()) == 0) {
dmu_objset_disown(os, FTAG);
-   mutex_exit(spa_namespace_lock);
+   mutex_exit(zfsdev_state_lock);
return (SET_ERROR(ENXIO));
}
 
if (ddi_soft_state_zalloc(zfsdev_state, minor) != DDI_SUCCESS) {
dmu_objset_disown(os, FTAG);
-   mutex_exit(spa_namespace_lock);
+   mutex_exit(zfsdev_state_lock);
return (SET_ERROR(EAGAIN));
}
(void) ddi_prop_update_string(minor, zfs_dip, ZVOL_PROP_NAME,
@@ -586,7 +595,7 @@ zvol_create_minor(const char *name)
minor, DDI_PSEUDO, 0) == DDI_FAILURE) {
ddi_soft_state_free(zfsdev_state, minor);
dmu_objset_disown(os, FTAG);
-   mutex_exit(spa_namespace_lock);
+   mutex_exit(zfsdev_state_lock);
return (SET_ERROR(EAGAIN));
}
 
@@ -597,7 +606,7 @@ zvol_create_minor(const char *name)
ddi_remove_minor_node(zfs_dip, chrbuf);
ddi_soft_state_free(zfsdev_state, minor);
dmu_objset_disown(os, FTAG);
-   mutex_exit(spa_namespace_lock);
+   mutex_exit(zfsdev_state_lock);
return (SET_ERROR(EAGAIN));
}
 
@@ -612,7 +621,7 @@ zvol_create_minor(const char *name)
if (error) {
kmem_free(zv, sizeof(*zv));
dmu_objset_disown(os, zvol_tag);
-   mutex_exit(spa_namespace_lock);
+   mutex_exit(zfsdev_state_lock);
return (error);
}
error = dsl_prop_get_integer(name,
@@ -643,7 +652,7 @@ zvol_create_minor(const char *name)
0640, %s/%s, ZVOL_DRIVER, name) != 0) {
kmem_free(zv, sizeof(*zv));
 

Re: svn commit: r276008 - in head/sys: kern sys

2014-12-22 Thread Konstantin Belousov
On Mon, Dec 22, 2014 at 09:40:02AM -0500, John Baldwin wrote:
 On Sunday, December 21, 2014 11:21:17 am Andriy Gapon wrote:
  On 21/12/2014 17:14, Konstantin Belousov wrote:
   On Sun, Dec 21, 2014 at 04:45:28PM +0200, Andriy Gapon wrote:
   On 21/12/2014 16:41, Konstantin Belousov wrote:
   Or, are you asking why caching of the name could be needed for
   core dump files at all ?
  
   Sort of. Why VN_OPEN_NAMECACHE is useful in the case of core dumps?
   What does it make better?
   The vn_fullpath() mostly works for the core files after the change,
   comparing with the non-working state at all before.
   
  
  Ah, vn_fullpath(). Thank you.
 
 Is there something specific to core dumps that makes vn_fullpath() more
 useful to have working before a process tries to open the core?  (As
 compared to other newly-created files)

See other Rui' reply in the thread.  It was done by his request.

Basically, we cannot enable caching for CREATE, since operations like
extracting large archive, would flush the cache.  Doing it rarely
and when needed is acceptable.  The explained use case seems to
be warranted.

___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r276067 - stable/10/sys/net

2014-12-22 Thread Andrey V. Elsukov
Author: ae
Date: Mon Dec 22 17:32:13 2014
New Revision: 276067
URL: https://svnweb.freebsd.org/changeset/base/276067

Log:
  MFC r258167:
ANSIfy function defintions.

Modified:
  stable/10/sys/net/if_gif.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/net/if_gif.c
==
--- stable/10/sys/net/if_gif.c  Mon Dec 22 17:04:51 2014(r276066)
+++ stable/10/sys/net/if_gif.c  Mon Dec 22 17:32:13 2014(r276067)
@@ -152,10 +152,7 @@ static const u_char etherbroadcastaddr[E
 #endif
 
 static int
-gif_clone_create(ifc, unit, params)
-   struct if_clone *ifc;
-   int unit;
-   caddr_t params;
+gif_clone_create(struct if_clone *ifc, int unit, caddr_t params)
 {
struct gif_softc *sc;
 
@@ -199,8 +196,7 @@ gif_clone_create(ifc, unit, params)
 }
 
 static void
-gif_clone_destroy(ifp)
-   struct ifnet *ifp;
+gif_clone_destroy(struct ifnet *ifp)
 {
 #if defined(INET) || defined(INET6)
int err;
@@ -246,10 +242,7 @@ VNET_SYSINIT(vnet_gif_init, SI_SUB_PSEUD
 NULL);
 
 static int
-gifmodevent(mod, type, data)
-   module_t mod;
-   int type;
-   void *data;
+gifmodevent(module_t mod, int type, void *data)
 {
 
switch (type) {
@@ -279,11 +272,7 @@ DECLARE_MODULE(if_gif, gif_mod, SI_SUB_P
 MODULE_VERSION(if_gif, 1);
 
 int
-gif_encapcheck(m, off, proto, arg)
-   const struct mbuf *m;
-   int off;
-   int proto;
-   void *arg;
+gif_encapcheck(const struct mbuf *m, int off, int proto, void *arg)
 {
struct ip ip;
struct gif_softc *sc;
@@ -528,10 +517,7 @@ gif_output(struct ifnet *ifp, struct mbu
 }
 
 void
-gif_input(m, af, ifp)
-   struct mbuf *m;
-   int af;
-   struct ifnet *ifp;
+gif_input(struct mbuf *m, int af, struct ifnet *ifp)
 {
int isr, n;
struct gif_softc *sc;
@@ -669,10 +655,7 @@ gif_input(m, af, ifp)
 
 /* XXX how should we handle IPv6 scope on SIOC[GS]IFPHYADDR? */
 int
-gif_ioctl(ifp, cmd, data)
-   struct ifnet *ifp;
-   u_long cmd;
-   caddr_t data;
+gif_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
 {
struct gif_softc *sc  = ifp-if_softc;
struct ifreq *ifr = (struct ifreq*)data;
@@ -949,10 +932,7 @@ gif_ioctl(ifp, cmd, data)
  * a mutex.
  */
 int
-gif_set_tunnel(ifp, src, dst)
-   struct ifnet *ifp;
-   struct sockaddr *src;
-   struct sockaddr *dst;
+gif_set_tunnel(struct ifnet *ifp, struct sockaddr *src, struct sockaddr *dst)
 {
struct gif_softc *sc = ifp-if_softc;
struct gif_softc *sc2;
@@ -1058,8 +1038,7 @@ gif_set_tunnel(ifp, src, dst)
 }
 
 void
-gif_delete_tunnel(ifp)
-   struct ifnet *ifp;
+gif_delete_tunnel(struct ifnet *ifp)
 {
struct gif_softc *sc = ifp-if_softc;
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r276068 - stable/10/sys/net

2014-12-22 Thread Andrey V. Elsukov
Author: ae
Date: Mon Dec 22 17:54:26 2014
New Revision: 276068
URL: https://svnweb.freebsd.org/changeset/base/276068

Log:
  MFC r271917 by hrs:
Virtualize interface cloner for gif(4).  This fixes a panic when destroying
a vnet jail which has a gif(4) interface.

Modified:
  stable/10/sys/net/if_gif.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/net/if_gif.c
==
--- stable/10/sys/net/if_gif.c  Mon Dec 22 17:32:13 2014(r276067)
+++ stable/10/sys/net/if_gif.c  Mon Dec 22 17:54:26 2014(r276068)
@@ -91,13 +91,20 @@
 static const char gifname[] = gif;
 
 /*
- * gif_mtx protects the global gif_softc_list.
+ * gif_mtx protects a per-vnet gif_softc_list.
  */
-static struct mtx gif_mtx;
+static VNET_DEFINE(struct mtx, gif_mtx);
+#defineV_gif_mtx   VNET(gif_mtx)
 static MALLOC_DEFINE(M_GIF, gif, Generic Tunnel Interface);
 static VNET_DEFINE(LIST_HEAD(, gif_softc), gif_softc_list);
 #defineV_gif_softc_listVNET(gif_softc_list)
 
+#defineGIF_LIST_LOCK_INIT(x)   mtx_init(V_gif_mtx, gif_mtx, 
\
+   NULL, MTX_DEF)
+#defineGIF_LIST_LOCK_DESTROY(x)mtx_destroy(V_gif_mtx)
+#defineGIF_LIST_LOCK(x)mtx_lock(V_gif_mtx)
+#defineGIF_LIST_UNLOCK(x)  mtx_unlock(V_gif_mtx)
+
 void   (*ng_gif_input_p)(struct ifnet *ifp, struct mbuf **mp, int af);
 void   (*ng_gif_input_orphan_p)(struct ifnet *ifp, struct mbuf *m, int af);
 void   (*ng_gif_attach_p)(struct ifnet *ifp);
@@ -106,7 +113,8 @@ void(*ng_gif_detach_p)(struct ifnet *if
 static voidgif_start(struct ifnet *);
 static int gif_clone_create(struct if_clone *, int, caddr_t);
 static voidgif_clone_destroy(struct ifnet *);
-static struct if_clone *gif_cloner;
+static VNET_DEFINE(struct if_clone *, gif_cloner);
+#defineV_gif_clonerVNET(gif_cloner)
 
 static int gifmodevent(module_t, int, void *);
 
@@ -188,9 +196,9 @@ gif_clone_create(struct if_clone *ifc, i
if (ng_gif_attach_p != NULL)
(*ng_gif_attach_p)(GIF2IFP(sc));
 
-   mtx_lock(gif_mtx);
+   GIF_LIST_LOCK();
LIST_INSERT_HEAD(V_gif_softc_list, sc, gif_list);
-   mtx_unlock(gif_mtx);
+   GIF_LIST_UNLOCK();
 
return (0);
 }
@@ -203,9 +211,9 @@ gif_clone_destroy(struct ifnet *ifp)
 #endif
struct gif_softc *sc = ifp-if_softc;
 
-   mtx_lock(gif_mtx);
+   GIF_LIST_LOCK();
LIST_REMOVE(sc, gif_list);
-   mtx_unlock(gif_mtx);
+   GIF_LIST_UNLOCK();
 
gif_delete_tunnel(ifp);
 #ifdef INET6
@@ -237,9 +245,22 @@ vnet_gif_init(const void *unused __unuse
 {
 
LIST_INIT(V_gif_softc_list);
+   GIF_LIST_LOCK_INIT();
+   V_gif_cloner = if_clone_simple(gifname, gif_clone_create,
+   gif_clone_destroy, 0);
+}
+VNET_SYSINIT(vnet_gif_init, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY,
+vnet_gif_init, NULL);
+
+static void
+vnet_gif_uninit(const void *unused __unused)
+{
+
+   if_clone_detach(V_gif_cloner);
+   GIF_LIST_LOCK_DESTROY();
 }
-VNET_SYSINIT(vnet_gif_init, SI_SUB_PSEUDO, SI_ORDER_MIDDLE, vnet_gif_init,
-NULL);
+VNET_SYSUNINIT(vnet_gif_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY,
+vnet_gif_uninit, NULL);
 
 static int
 gifmodevent(module_t mod, int type, void *data)
@@ -247,19 +268,12 @@ gifmodevent(module_t mod, int type, void
 
switch (type) {
case MOD_LOAD:
-   mtx_init(gif_mtx, gif_mtx, NULL, MTX_DEF);
-   gif_cloner = if_clone_simple(gifname, gif_clone_create,
-   gif_clone_destroy, 0);
-   break;
-
case MOD_UNLOAD:
-   if_clone_detach(gif_cloner);
-   mtx_destroy(gif_mtx);
break;
default:
-   return EOPNOTSUPP;
+   return (EOPNOTSUPP);
}
-   return 0;
+   return (0);
 }
 
 static moduledata_t gif_mod = {
@@ -363,7 +377,7 @@ gif_start(struct ifnet *ifp)
 #endif
 #ifdef INET6
if (sc-gif_psrc-sa_family == AF_INET6) 
-   m-m_pkthdr.len -= GIF_HDR_LEN6;
+   m-m_pkthdr.len -= GIF_HDR_LEN6;
 #endif
 #endif
/* 
@@ -372,6 +386,7 @@ gif_start(struct ifnet *ifp)
 */
af = m-m_pkthdr.csum_data;

+   /* override to IPPROTO_ETHERIP for bridged traffic */
if (ifp-if_bridge)
af = AF_LINK;
 
@@ -380,7 +395,6 @@ gif_start(struct ifnet *ifp)
 
 /*  Done by IFQ_HANDOFF */
 /* ifp-if_obytes += m-m_pkthdr.len;*/
-   /* override to IPPROTO_ETHERIP for bridged traffic */
 
M_SETFIB(m, sc-gif_fibnum);
/* inner AF-specific encapsulation */
@@ -939,7 +953,7 @@ gif_set_tunnel(struct ifnet *ifp, struct
struct 

Re: svn commit: r276008 - in head/sys: kern sys

2014-12-22 Thread Rui Paulo
On Dec 22, 2014, at 06:40, John Baldwin j...@freebsd.org wrote:
 Is there something specific to core dumps that makes vn_fullpath() more
 useful to have working before a process tries to open the core?  (As
 compared to other newly-created files)

Yes: the ability to provide the full path to userland when a core dump file is 
generated.

--
Rui Paulo



___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r276069 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys

2014-12-22 Thread Steven Hartland
Author: smh
Date: Mon Dec 22 18:39:38 2014
New Revision: 276069
URL: https://svnweb.freebsd.org/changeset/base/276069

Log:
  Fix panic when resizing ZFS zvol's
  
  Resizing a ZFS ZVOL with debug enabled would result in a panic due to
  recursion on dp_config_rwlock.
  
  The upstream change 3464 zfs synctask code needs restructuring changed
  zvol_set_volsize to avoid the recursion on dp_config_rwlock, but this was
  missed when originally merged in by r248571 due to significant differences
  in our codebases in this area.
  
  These changes also relied on bring in changes from upstream:
  3557 dumpvp_size is not updated correctly when a dump zvol's size is
  changed, which where also not present.
  
  In order to help prevent future issues in this area a direct comparison
  and diff minimisation from current upstream version (b515258) of zvol.c.
  
  Differential Revision:https://reviews.freebsd.org/D1302
  MFC after:1 month
  X-MFC-With:   r276063  r276066
  Sponsored by: Multiplay

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zvol.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zvol.h
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zvol.h  Mon Dec 
22 17:54:26 2014(r276068)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zvol.h  Mon Dec 
22 18:39:38 2014(r276069)
@@ -43,7 +43,7 @@ extern void zvol_create_cb(objset_t *os,
 extern int zvol_create_minor(const char *);
 extern int zvol_remove_minor(const char *);
 extern void zvol_remove_minors(const char *);
-extern int zvol_set_volsize(const char *, major_t, uint64_t);
+extern int zvol_set_volsize(const char *, uint64_t);
 
 #ifdef sun
 extern int zvol_open(dev_t *devp, int flag, int otyp, cred_t *cr);

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Mon Dec 
22 17:54:26 2014(r276068)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Mon Dec 
22 18:39:38 2014(r276069)
@@ -2482,8 +2482,7 @@ zfs_prop_set_special(const char *dsname,
err = dsl_dataset_set_refreservation(dsname, source, intval);
break;
case ZFS_PROP_VOLSIZE:
-   err = zvol_set_volsize(dsname, ddi_driver_major(zfs_dip),
-   intval);
+   err = zvol_set_volsize(dsname, intval);
break;
case ZFS_PROP_VERSION:
{

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c  Mon Dec 22 
17:54:26 2014(r276068)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c  Mon Dec 22 
18:39:38 2014(r276069)
@@ -97,6 +97,7 @@
 
 #include zfs_namecheck.h
 
+#ifndef illumos
 struct g_class zfs_zvol_class = {
.name = ZFS::ZVOL,
.version = G_VERSION,
@@ -104,6 +105,7 @@ struct g_class zfs_zvol_class = {
 
 DECLARE_GEOM_CLASS(zfs_zvol_class, zfs_zvol);
 
+#endif
 void *zfsdev_state;
 static char *zvol_tag = zvol_tag;
 
@@ -126,12 +128,14 @@ kmutex_t zfsdev_state_lock;
 #endif
 static uint32_t zvol_minors;
 
+#ifndef illumos
 SYSCTL_DECL(_vfs_zfs);
 SYSCTL_NODE(_vfs_zfs, OID_AUTO, vol, CTLFLAG_RW, 0, ZFS VOLUME);
 static int volmode = ZFS_VOLMODE_GEOM;
 SYSCTL_INT(_vfs_zfs_vol, OID_AUTO, mode, CTLFLAG_RWTUN, volmode, 0,
 Expose as GEOM providers (1), device files (2) or neither);
 
+#endif
 typedef struct zvol_extent {
list_node_t ze_node;
dva_t   ze_dva; /* dva associated with this extent */
@@ -142,28 +146,40 @@ typedef struct zvol_extent {
  * The in-core state of each volume.
  */
 typedef struct zvol_state {
+#ifndef illumos
LIST_ENTRY(zvol_state)  zv_links;
+#endif
charzv_name[MAXPATHLEN]; /* pool/dd name */
uint64_tzv_volsize; /* amount of space we advertise */
uint64_tzv_volblocksize; /* volume block size */
+#ifdef illumos
+   minor_t zv_minor;   /* minor number */
+#else
struct cdev *zv_dev;/* non-GEOM device */
struct g_provider *zv_provider; /* GEOM provider */
+#endif
uint8_t zv_min_bs;  /* minimum addressable block shift */
uint8_t zv_flags;   /* readonly, dumpified, etc. */
objset_t*zv_objset; /* objset handle */
+#ifdef illumos
+   uint32_tzv_open_count[OTYPCNT]; /* open counts */
+#endif
uint32_tzv_total_opens; /* total open count */
zilog_t  

svn commit: r276070 - in stable/10/sys: amd64/amd64 amd64/include conf i386/i386 i386/include pc98/pc98 x86/x86

2014-12-22 Thread John Baldwin
Author: jhb
Date: Mon Dec 22 18:40:59 2014
New Revision: 276070
URL: https://svnweb.freebsd.org/changeset/base/276070

Log:
  MFC 260557,271076,271077,271082,271083,271098:
  - Remove spaces from boot messages when we print the CPU ID/Family/Stepping
  - Move prototypes for various functions into out of C files and into
machine/md_var.h.
  - Reduce diffs between i386 and amd64 initcpu.c and identcpu.c files.
  - Move blacklists of broken TSCs out of the printcpuinfo() function
and into the TSC probe routine.
  - Merge the amd64 and i386 identcpu.c into a single x86 implementation.

Added:
  stable/10/sys/x86/x86/identcpu.c
 - copied unchanged from r271098, head/sys/x86/x86/identcpu.c
Deleted:
  stable/10/sys/amd64/amd64/identcpu.c
  stable/10/sys/i386/i386/identcpu.c
Modified:
  stable/10/sys/amd64/amd64/machdep.c
  stable/10/sys/amd64/include/md_var.h
  stable/10/sys/conf/files.amd64
  stable/10/sys/conf/files.i386
  stable/10/sys/conf/files.pc98
  stable/10/sys/i386/i386/initcpu.c
  stable/10/sys/i386/i386/machdep.c
  stable/10/sys/i386/i386/trap.c
  stable/10/sys/i386/include/md_var.h
  stable/10/sys/pc98/pc98/machdep.c
  stable/10/sys/x86/x86/tsc.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/amd64/amd64/machdep.c
==
--- stable/10/sys/amd64/amd64/machdep.c Mon Dec 22 18:39:38 2014
(r276069)
+++ stable/10/sys/amd64/amd64/machdep.c Mon Dec 22 18:40:59 2014
(r276070)
@@ -153,10 +153,6 @@ CTASSERT(offsetof(struct pcpu, pc_curthr
 
 extern u_int64_t hammer_time(u_int64_t, u_int64_t);
 
-extern void printcpuinfo(void);/* XXX header file */
-extern void identify_cpu(void);
-extern void panicifcpuunsupported(void);
-
 #defineCS_SECURE(cs)   (ISPL(cs) == SEL_UPL)
 #defineEFL_SECURE(ef, oef) ef) ^ (oef))  ~PSL_USERCHANGE) == 
0)
 

Modified: stable/10/sys/amd64/include/md_var.h
==
--- stable/10/sys/amd64/include/md_var.hMon Dec 22 18:39:38 2014
(r276069)
+++ stable/10/sys/amd64/include/md_var.hMon Dec 22 18:40:59 2014
(r276070)
@@ -105,14 +105,17 @@ void  fsbase_load_fault(void) __asm(__STR
 void   gsbase_load_fault(void) __asm(__STRING(gsbase_load_fault));
 void   dump_add_page(vm_paddr_t);
 void   dump_drop_page(vm_paddr_t);
+void   identify_cpu(void);
 void   initializecpu(void);
 void   initializecpucache(void);
 void   fillw(int /*u_short*/ pat, void *base, size_t cnt);
 void   fpstate_drop(struct thread *td);
 intis_physical_memory(vm_paddr_t addr);
 intisa_nmi(int cd);
+void   panicifcpuunsupported(void);
 void   pagecopy(void *from, void *to);
 void   pagezero(void *addr);
+void   printcpuinfo(void);
 void   setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int ist);
 intuser_dbreg_trap(void);
 void   minidumpsys(struct dumperinfo *);

Modified: stable/10/sys/conf/files.amd64
==
--- stable/10/sys/conf/files.amd64  Mon Dec 22 18:39:38 2014
(r276069)
+++ stable/10/sys/conf/files.amd64  Mon Dec 22 18:40:59 2014
(r276070)
@@ -114,7 +114,6 @@ amd64/amd64/elf_machdep.c   standard
 amd64/amd64/exception.Sstandard
 amd64/amd64/fpu.c  standard
 amd64/amd64/gdb_machdep.c  optionalgdb
-amd64/amd64/identcpu.c standard
 amd64/amd64/in_cksum.c optionalinet | inet6
 amd64/amd64/initcpu.c  standard
 amd64/amd64/io.c   optionalio
@@ -578,6 +577,7 @@ x86/x86/busdma_bounce.c standard
 x86/x86/busdma_machdep.c   standard
 x86/x86/dump_machdep.c standard
 x86/x86/fdt_machdep.c  optionalfdt
+x86/x86/identcpu.c standard
 x86/x86/intr_machdep.c standard
 x86/x86/io_apic.c  standard
 x86/x86/legacy.c   standard

Modified: stable/10/sys/conf/files.i386
==
--- stable/10/sys/conf/files.i386   Mon Dec 22 18:39:38 2014
(r276069)
+++ stable/10/sys/conf/files.i386   Mon Dec 22 18:40:59 2014
(r276070)
@@ -460,7 +460,6 @@ i386/xen/exception.soptional xen
 i386/i386/gdb_machdep.coptional gdb
 i386/i386/geode.c  optional cpu_geode
 i386/i386/i686_mem.c   optional mem
-i386/i386/identcpu.c   standard
 i386/i386/in_cksum.c   optional inet | inet6
 i386/i386/initcpu.cstandard
 i386/i386/io.c optional io
@@ -594,6 +593,7 @@ x86/x86/busdma_bounce.c standard
 x86/x86/busdma_machdep.c   standard
 x86/x86/dump_machdep.c standard
 x86/x86/fdt_machdep.c  optional fdt
+x86/x86/identcpu.c standard
 x86/x86/intr_machdep.c standard
 

Re: svn commit: r276008 - in head/sys: kern sys

2014-12-22 Thread Adrian Chadd
On 22 December 2014 at 09:28, Konstantin Belousov kostik...@gmail.com wrote:
 On Mon, Dec 22, 2014 at 09:40:02AM -0500, John Baldwin wrote:
 On Sunday, December 21, 2014 11:21:17 am Andriy Gapon wrote:
  On 21/12/2014 17:14, Konstantin Belousov wrote:
   On Sun, Dec 21, 2014 at 04:45:28PM +0200, Andriy Gapon wrote:
   On 21/12/2014 16:41, Konstantin Belousov wrote:
   Or, are you asking why caching of the name could be needed for
   core dump files at all ?
  
   Sort of. Why VN_OPEN_NAMECACHE is useful in the case of core dumps?
   What does it make better?
   The vn_fullpath() mostly works for the core files after the change,
   comparing with the non-working state at all before.
  
 
  Ah, vn_fullpath(). Thank you.

 Is there something specific to core dumps that makes vn_fullpath() more
 useful to have working before a process tries to open the core?  (As
 compared to other newly-created files)

 See other Rui' reply in the thread.  It was done by his request.

 Basically, we cannot enable caching for CREATE, since operations like
 extracting large archive, would flush the cache.  Doing it rarely
 and when needed is acceptable.  The explained use case seems to
 be warranted.

.. 2c, sounds like having an ARC style replacement policy for
namecache entries would be useful.

(I mean the policy as described in the ARC paper, not the ZFS
implementation as a block cache.)

-adrian
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r276071 - in head/contrib/ntp: ntpd util

2014-12-22 Thread Xin LI
Author: delphij
Date: Mon Dec 22 18:54:55 2014
New Revision: 276071
URL: https://svnweb.freebsd.org/changeset/base/276071

Log:
  Fix multiple ntp vulnerabilities.
  
  Reviewed by:  roberto (earlier revision), philip
  Security: CVE-2014-9293, CVE-2014-9294
  Security: CVE-2014-9295, CVE-2014-9296
  Security: FreeBSD-SA-14:31.ntp
  
  Differential Revision: https://reviews.freebsd.org/D1343

Modified:
  head/contrib/ntp/ntpd/ntp_config.c
  head/contrib/ntp/ntpd/ntp_control.c
  head/contrib/ntp/ntpd/ntp_crypto.c
  head/contrib/ntp/ntpd/ntp_proto.c
  head/contrib/ntp/util/ntp-keygen.c

Modified: head/contrib/ntp/ntpd/ntp_config.c
==
--- head/contrib/ntp/ntpd/ntp_config.c  Mon Dec 22 18:40:59 2014
(r276070)
+++ head/contrib/ntp/ntpd/ntp_config.c  Mon Dec 22 18:54:55 2014
(r276071)
@@ -1887,7 +1887,7 @@ getconfig(
 
for (i = 0; i  8; i++)
for (j = 1; j  100; ++j) {
-   rankey[i] = (char) (ntp_random()  0xff);
+   rankey[i] = (char) (arc4random()  0xff);
if (rankey[i] != 0) break;
}
rankey[8] = 0;

Modified: head/contrib/ntp/ntpd/ntp_control.c
==
--- head/contrib/ntp/ntpd/ntp_control.c Mon Dec 22 18:40:59 2014
(r276070)
+++ head/contrib/ntp/ntpd/ntp_control.c Mon Dec 22 18:54:55 2014
(r276071)
@@ -24,6 +24,10 @@
 #include netinet/in.h
 #include arpa/inet.h
 
+#ifndef MIN
+#define MIN(a, b) (((a) = (b)) ? (a) : (b))
+#endif
+
 /*
  * Structure to hold request procedure information
  */
@@ -893,6 +897,7 @@ ctl_putdata(
)
 {
int overhead;
+   unsigned int currentlen;
 
overhead = 0;
if (!bin) {
@@ -916,12 +921,22 @@ ctl_putdata(
/*
 * Save room for trailing junk
 */
-   if (dlen + overhead + datapt  dataend) {
+   while (dlen + overhead + datapt  dataend) {
/*
 * Not enough room in this one, flush it out.
 */
+   currentlen = MIN(dlen, dataend - datapt);
+
+   memcpy(datapt, dp, currentlen);
+
+   datapt += currentlen;
+   dp += currentlen;
+   dlen -= currentlen;
+   datalinelen += currentlen;
+
ctl_flushpkt(CTL_MORE);
}
+
memmove((char *)datapt, dp, (unsigned)dlen);
datapt += dlen;
datalinelen += dlen;

Modified: head/contrib/ntp/ntpd/ntp_crypto.c
==
--- head/contrib/ntp/ntpd/ntp_crypto.c  Mon Dec 22 18:40:59 2014
(r276070)
+++ head/contrib/ntp/ntpd/ntp_crypto.c  Mon Dec 22 18:54:55 2014
(r276071)
@@ -864,12 +864,24 @@ crypto_recv(
 * errors.
 */
if (vallen == (u_int) EVP_PKEY_size(host_pkey)) {
-   RSA_private_decrypt(vallen,
+   u_int32 *cookiebuf = malloc(
+   RSA_size(host_pkey-pkey.rsa));
+   if (cookiebuf == NULL) {
+   rval = XEVNT_CKY;
+   break;
+   }
+   if (RSA_private_decrypt(vallen,
(u_char *)ep-pkt,
-   (u_char *)temp32,
+   (u_char *)cookiebuf,
host_pkey-pkey.rsa,
-   RSA_PKCS1_OAEP_PADDING);
-   cookie = ntohl(temp32);
+   RSA_PKCS1_OAEP_PADDING) != 4) {
+   rval = XEVNT_CKY;
+   free(cookiebuf);
+   break;
+   } else {
+   cookie = ntohl(*cookiebuf);
+   free(cookiebuf);
+   }
} else {
rval = XEVNT_CKY;
break;
@@ -3914,7 +3926,7 @@ crypto_setup(void)
rand_file);
exit (-1);
}
-   get_systime(seed);
+   arc4random_buf(seed, sizeof(l_fp));
RAND_seed(seed, sizeof(l_fp));
RAND_write_file(rand_file);
OpenSSL_add_all_algorithms();

Modified: head/contrib/ntp/ntpd/ntp_proto.c
==
--- head/contrib/ntp/ntpd/ntp_proto.c   Mon Dec 22 18:40:59 2014
(r276070)
+++ head/contrib/ntp/ntpd/ntp_proto.c   Mon Dec 22 18:54:55 

svn commit: r276072 - in stable/10/contrib/ntp: ntpd util

2014-12-22 Thread Xin LI
Author: delphij
Date: Mon Dec 22 19:07:16 2014
New Revision: 276072
URL: https://svnweb.freebsd.org/changeset/base/276072

Log:
  MFC r276071:
  
  Fix multiple ntp vulnerabilities.
  
  Reviewed by:  roberto (earlier revision), philip
  Security: CVE-2014-9293, CVE-2014-9294
  Security: CVE-2014-9295, CVE-2014-9296
  Security: FreeBSD-SA-14:31.ntp

Modified:
  stable/10/contrib/ntp/ntpd/ntp_config.c
  stable/10/contrib/ntp/ntpd/ntp_control.c
  stable/10/contrib/ntp/ntpd/ntp_crypto.c
  stable/10/contrib/ntp/ntpd/ntp_proto.c
  stable/10/contrib/ntp/util/ntp-keygen.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/contrib/ntp/ntpd/ntp_config.c
==
--- stable/10/contrib/ntp/ntpd/ntp_config.c Mon Dec 22 18:54:55 2014
(r276071)
+++ stable/10/contrib/ntp/ntpd/ntp_config.c Mon Dec 22 19:07:16 2014
(r276072)
@@ -1887,7 +1887,7 @@ getconfig(
 
for (i = 0; i  8; i++)
for (j = 1; j  100; ++j) {
-   rankey[i] = (char) (ntp_random()  0xff);
+   rankey[i] = (char) (arc4random()  0xff);
if (rankey[i] != 0) break;
}
rankey[8] = 0;

Modified: stable/10/contrib/ntp/ntpd/ntp_control.c
==
--- stable/10/contrib/ntp/ntpd/ntp_control.cMon Dec 22 18:54:55 2014
(r276071)
+++ stable/10/contrib/ntp/ntpd/ntp_control.cMon Dec 22 19:07:16 2014
(r276072)
@@ -24,6 +24,10 @@
 #include netinet/in.h
 #include arpa/inet.h
 
+#ifndef MIN
+#define MIN(a, b) (((a) = (b)) ? (a) : (b))
+#endif
+
 /*
  * Structure to hold request procedure information
  */
@@ -893,6 +897,7 @@ ctl_putdata(
)
 {
int overhead;
+   unsigned int currentlen;
 
overhead = 0;
if (!bin) {
@@ -916,12 +921,22 @@ ctl_putdata(
/*
 * Save room for trailing junk
 */
-   if (dlen + overhead + datapt  dataend) {
+   while (dlen + overhead + datapt  dataend) {
/*
 * Not enough room in this one, flush it out.
 */
+   currentlen = MIN(dlen, dataend - datapt);
+
+   memcpy(datapt, dp, currentlen);
+
+   datapt += currentlen;
+   dp += currentlen;
+   dlen -= currentlen;
+   datalinelen += currentlen;
+
ctl_flushpkt(CTL_MORE);
}
+
memmove((char *)datapt, dp, (unsigned)dlen);
datapt += dlen;
datalinelen += dlen;

Modified: stable/10/contrib/ntp/ntpd/ntp_crypto.c
==
--- stable/10/contrib/ntp/ntpd/ntp_crypto.c Mon Dec 22 18:54:55 2014
(r276071)
+++ stable/10/contrib/ntp/ntpd/ntp_crypto.c Mon Dec 22 19:07:16 2014
(r276072)
@@ -864,12 +864,24 @@ crypto_recv(
 * errors.
 */
if (vallen == (u_int) EVP_PKEY_size(host_pkey)) {
-   RSA_private_decrypt(vallen,
+   u_int32 *cookiebuf = malloc(
+   RSA_size(host_pkey-pkey.rsa));
+   if (cookiebuf == NULL) {
+   rval = XEVNT_CKY;
+   break;
+   }
+   if (RSA_private_decrypt(vallen,
(u_char *)ep-pkt,
-   (u_char *)temp32,
+   (u_char *)cookiebuf,
host_pkey-pkey.rsa,
-   RSA_PKCS1_OAEP_PADDING);
-   cookie = ntohl(temp32);
+   RSA_PKCS1_OAEP_PADDING) != 4) {
+   rval = XEVNT_CKY;
+   free(cookiebuf);
+   break;
+   } else {
+   cookie = ntohl(*cookiebuf);
+   free(cookiebuf);
+   }
} else {
rval = XEVNT_CKY;
break;
@@ -3914,7 +3926,7 @@ crypto_setup(void)
rand_file);
exit (-1);
}
-   get_systime(seed);
+   arc4random_buf(seed, sizeof(l_fp));
RAND_seed(seed, sizeof(l_fp));
RAND_write_file(rand_file);
OpenSSL_add_all_algorithms();

Modified: stable/10/contrib/ntp/ntpd/ntp_proto.c
==
--- 

svn commit: r276073 - in stable: 8/contrib/ntp/ntpd 8/contrib/ntp/util 9/contrib/ntp/ntpd 9/contrib/ntp/util

2014-12-22 Thread Xin LI
Author: delphij
Date: Mon Dec 22 19:08:09 2014
New Revision: 276073
URL: https://svnweb.freebsd.org/changeset/base/276073

Log:
  MFC r276071:
  
  Fix multiple ntp vulnerabilities.
  
  Reviewed by:  roberto (earlier revision), philip
  Security: CVE-2014-9293, CVE-2014-9294
  Security: CVE-2014-9295, CVE-2014-9296
  Security: FreeBSD-SA-14:31.ntp

Modified:
  stable/8/contrib/ntp/ntpd/ntp_config.c
  stable/8/contrib/ntp/ntpd/ntp_control.c
  stable/8/contrib/ntp/ntpd/ntp_crypto.c
  stable/8/contrib/ntp/ntpd/ntp_proto.c
  stable/8/contrib/ntp/util/ntp-keygen.c
Directory Properties:
  stable/8/contrib/ntp/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/9/contrib/ntp/ntpd/ntp_config.c
  stable/9/contrib/ntp/ntpd/ntp_control.c
  stable/9/contrib/ntp/ntpd/ntp_crypto.c
  stable/9/contrib/ntp/ntpd/ntp_proto.c
  stable/9/contrib/ntp/util/ntp-keygen.c
Directory Properties:
  stable/9/contrib/ntp/   (props changed)

Modified: stable/8/contrib/ntp/ntpd/ntp_config.c
==
--- stable/8/contrib/ntp/ntpd/ntp_config.c  Mon Dec 22 19:07:16 2014
(r276072)
+++ stable/8/contrib/ntp/ntpd/ntp_config.c  Mon Dec 22 19:08:09 2014
(r276073)
@@ -1887,7 +1887,7 @@ getconfig(
 
for (i = 0; i  8; i++)
for (j = 1; j  100; ++j) {
-   rankey[i] = (char) (ntp_random()  0xff);
+   rankey[i] = (char) (arc4random()  0xff);
if (rankey[i] != 0) break;
}
rankey[8] = 0;

Modified: stable/8/contrib/ntp/ntpd/ntp_control.c
==
--- stable/8/contrib/ntp/ntpd/ntp_control.c Mon Dec 22 19:07:16 2014
(r276072)
+++ stable/8/contrib/ntp/ntpd/ntp_control.c Mon Dec 22 19:08:09 2014
(r276073)
@@ -24,6 +24,10 @@
 #include netinet/in.h
 #include arpa/inet.h
 
+#ifndef MIN
+#define MIN(a, b) (((a) = (b)) ? (a) : (b))
+#endif
+
 /*
  * Structure to hold request procedure information
  */
@@ -893,6 +897,7 @@ ctl_putdata(
)
 {
int overhead;
+   unsigned int currentlen;
 
overhead = 0;
if (!bin) {
@@ -916,12 +921,22 @@ ctl_putdata(
/*
 * Save room for trailing junk
 */
-   if (dlen + overhead + datapt  dataend) {
+   while (dlen + overhead + datapt  dataend) {
/*
 * Not enough room in this one, flush it out.
 */
+   currentlen = MIN(dlen, dataend - datapt);
+
+   memcpy(datapt, dp, currentlen);
+
+   datapt += currentlen;
+   dp += currentlen;
+   dlen -= currentlen;
+   datalinelen += currentlen;
+
ctl_flushpkt(CTL_MORE);
}
+
memmove((char *)datapt, dp, (unsigned)dlen);
datapt += dlen;
datalinelen += dlen;

Modified: stable/8/contrib/ntp/ntpd/ntp_crypto.c
==
--- stable/8/contrib/ntp/ntpd/ntp_crypto.c  Mon Dec 22 19:07:16 2014
(r276072)
+++ stable/8/contrib/ntp/ntpd/ntp_crypto.c  Mon Dec 22 19:08:09 2014
(r276073)
@@ -864,12 +864,24 @@ crypto_recv(
 * errors.
 */
if (vallen == (u_int) EVP_PKEY_size(host_pkey)) {
-   RSA_private_decrypt(vallen,
+   u_int32 *cookiebuf = malloc(
+   RSA_size(host_pkey-pkey.rsa));
+   if (cookiebuf == NULL) {
+   rval = XEVNT_CKY;
+   break;
+   }
+   if (RSA_private_decrypt(vallen,
(u_char *)ep-pkt,
-   (u_char *)temp32,
+   (u_char *)cookiebuf,
host_pkey-pkey.rsa,
-   RSA_PKCS1_OAEP_PADDING);
-   cookie = ntohl(temp32);
+   RSA_PKCS1_OAEP_PADDING) != 4) {
+   rval = XEVNT_CKY;
+   free(cookiebuf);
+   break;
+   } else {
+   cookie = ntohl(*cookiebuf);
+   free(cookiebuf);
+   }
} else {
rval = XEVNT_CKY;
break;
@@ -3914,7 +3926,7 @@ crypto_setup(void)
rand_file);
exit (-1);
}
-   

svn commit: r276073 - in stable: 8/contrib/ntp/ntpd 8/contrib/ntp/util 9/contrib/ntp/ntpd 9/contrib/ntp/util

2014-12-22 Thread Xin LI
Author: delphij
Date: Mon Dec 22 19:08:09 2014
New Revision: 276073
URL: https://svnweb.freebsd.org/changeset/base/276073

Log:
  MFC r276071:
  
  Fix multiple ntp vulnerabilities.
  
  Reviewed by:  roberto (earlier revision), philip
  Security: CVE-2014-9293, CVE-2014-9294
  Security: CVE-2014-9295, CVE-2014-9296
  Security: FreeBSD-SA-14:31.ntp

Modified:
  stable/9/contrib/ntp/ntpd/ntp_config.c
  stable/9/contrib/ntp/ntpd/ntp_control.c
  stable/9/contrib/ntp/ntpd/ntp_crypto.c
  stable/9/contrib/ntp/ntpd/ntp_proto.c
  stable/9/contrib/ntp/util/ntp-keygen.c
Directory Properties:
  stable/9/contrib/ntp/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/8/contrib/ntp/ntpd/ntp_config.c
  stable/8/contrib/ntp/ntpd/ntp_control.c
  stable/8/contrib/ntp/ntpd/ntp_crypto.c
  stable/8/contrib/ntp/ntpd/ntp_proto.c
  stable/8/contrib/ntp/util/ntp-keygen.c
Directory Properties:
  stable/8/contrib/ntp/   (props changed)

Modified: stable/9/contrib/ntp/ntpd/ntp_config.c
==
--- stable/9/contrib/ntp/ntpd/ntp_config.c  Mon Dec 22 19:07:16 2014
(r276072)
+++ stable/9/contrib/ntp/ntpd/ntp_config.c  Mon Dec 22 19:08:09 2014
(r276073)
@@ -1887,7 +1887,7 @@ getconfig(
 
for (i = 0; i  8; i++)
for (j = 1; j  100; ++j) {
-   rankey[i] = (char) (ntp_random()  0xff);
+   rankey[i] = (char) (arc4random()  0xff);
if (rankey[i] != 0) break;
}
rankey[8] = 0;

Modified: stable/9/contrib/ntp/ntpd/ntp_control.c
==
--- stable/9/contrib/ntp/ntpd/ntp_control.c Mon Dec 22 19:07:16 2014
(r276072)
+++ stable/9/contrib/ntp/ntpd/ntp_control.c Mon Dec 22 19:08:09 2014
(r276073)
@@ -24,6 +24,10 @@
 #include netinet/in.h
 #include arpa/inet.h
 
+#ifndef MIN
+#define MIN(a, b) (((a) = (b)) ? (a) : (b))
+#endif
+
 /*
  * Structure to hold request procedure information
  */
@@ -893,6 +897,7 @@ ctl_putdata(
)
 {
int overhead;
+   unsigned int currentlen;
 
overhead = 0;
if (!bin) {
@@ -916,12 +921,22 @@ ctl_putdata(
/*
 * Save room for trailing junk
 */
-   if (dlen + overhead + datapt  dataend) {
+   while (dlen + overhead + datapt  dataend) {
/*
 * Not enough room in this one, flush it out.
 */
+   currentlen = MIN(dlen, dataend - datapt);
+
+   memcpy(datapt, dp, currentlen);
+
+   datapt += currentlen;
+   dp += currentlen;
+   dlen -= currentlen;
+   datalinelen += currentlen;
+
ctl_flushpkt(CTL_MORE);
}
+
memmove((char *)datapt, dp, (unsigned)dlen);
datapt += dlen;
datalinelen += dlen;

Modified: stable/9/contrib/ntp/ntpd/ntp_crypto.c
==
--- stable/9/contrib/ntp/ntpd/ntp_crypto.c  Mon Dec 22 19:07:16 2014
(r276072)
+++ stable/9/contrib/ntp/ntpd/ntp_crypto.c  Mon Dec 22 19:08:09 2014
(r276073)
@@ -864,12 +864,24 @@ crypto_recv(
 * errors.
 */
if (vallen == (u_int) EVP_PKEY_size(host_pkey)) {
-   RSA_private_decrypt(vallen,
+   u_int32 *cookiebuf = malloc(
+   RSA_size(host_pkey-pkey.rsa));
+   if (cookiebuf == NULL) {
+   rval = XEVNT_CKY;
+   break;
+   }
+   if (RSA_private_decrypt(vallen,
(u_char *)ep-pkt,
-   (u_char *)temp32,
+   (u_char *)cookiebuf,
host_pkey-pkey.rsa,
-   RSA_PKCS1_OAEP_PADDING);
-   cookie = ntohl(temp32);
+   RSA_PKCS1_OAEP_PADDING) != 4) {
+   rval = XEVNT_CKY;
+   free(cookiebuf);
+   break;
+   } else {
+   cookie = ntohl(*cookiebuf);
+   free(cookiebuf);
+   }
} else {
rval = XEVNT_CKY;
break;
@@ -3914,7 +3926,7 @@ crypto_setup(void)
rand_file);
exit (-1);
}
-   

svn commit: r276075 - head/sys/conf

2014-12-22 Thread Warner Losh
Author: imp
Date: Mon Dec 22 19:10:21 2014
New Revision: 276075
URL: https://svnweb.freebsd.org/changeset/base/276075

Log:
  Don't require ${SYSDIR}/../COPYRIGHT to exist. Fall back to the
  current date if we can't find it.
  
  MFC After: 2 weeks

Modified:
  head/sys/conf/newvers.sh

Modified: head/sys/conf/newvers.sh
==
--- head/sys/conf/newvers.shMon Dec 22 19:10:11 2014(r276074)
+++ head/sys/conf/newvers.shMon Dec 22 19:10:21 2014(r276075)
@@ -52,7 +52,11 @@ else
 fi
 
 b=share/examples/etc/bsd-style-copyright
-year=$(sed -Ee '/^Copyright .* The FreeBSD Project/!d;s/^.*1992-([0-9]*) 
.*$/\1/g' ${SYSDIR}/../COPYRIGHT)
+if [ -r ${SYSDIR}/../COPYRIGHT ]; then
+   year=$(sed -Ee '/^Copyright .* The FreeBSD 
Project/!d;s/^.*1992-([0-9]*) .*$/\1/g' ${SYSDIR}/../COPYRIGHT)
+else
+   year=$(date +%Y)
+fi
 # look for copyright template
 for bsd_copyright in ../$b ../../$b ../../../$b /usr/src/$b /usr/$b
 do
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r276074 - head/sys/boot/i386/libi386

2014-12-22 Thread Warner Losh
Author: imp
Date: Mon Dec 22 19:10:11 2014
New Revision: 276074
URL: https://svnweb.freebsd.org/changeset/base/276074

Log:
  Make this compile when TERM_EMU is not defined.

Modified:
  head/sys/boot/i386/libi386/spinconsole.c

Modified: head/sys/boot/i386/libi386/spinconsole.c
==
--- head/sys/boot/i386/libi386/spinconsole.cMon Dec 22 19:08:09 2014
(r276073)
+++ head/sys/boot/i386/libi386/spinconsole.cMon Dec 22 19:10:11 2014
(r276074)
@@ -86,9 +86,11 @@ spinc_putchar(int c)
if (now  (lasttime + 1))
return;
lasttime = now;
+#ifdef TERM_EMU
get_pos(curx, cury);
if (curx  0)
curs_move(curx, cury, curx - 1, cury);
+#endif
vidc_biosputchar((char)tw_chars);
tw_chars = (tw_chars  8) | ((tw_chars  (unsigned long)0xFF)  24);
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r276076 - in stable/10/sys: amd64/amd64 i386/i386 i386/include i386/xen pc98/pc98 x86/x86

2014-12-22 Thread John Baldwin
Author: jhb
Date: Mon Dec 22 19:53:55 2014
New Revision: 276076
URL: https://svnweb.freebsd.org/changeset/base/276076

Log:
  MFC 271405,271408,271409,272658:
  MFamd64: Use initializecpu() to set various model-specific registers on
  AP startup and AP resume (it was already used for BSP startup and BSP
  resume).

Modified:
  stable/10/sys/amd64/amd64/mp_machdep.c
  stable/10/sys/i386/i386/initcpu.c
  stable/10/sys/i386/i386/machdep.c
  stable/10/sys/i386/i386/mp_machdep.c
  stable/10/sys/i386/include/md_var.h
  stable/10/sys/i386/xen/mp_machdep.c
  stable/10/sys/pc98/pc98/machdep.c
  stable/10/sys/x86/x86/identcpu.c
  stable/10/sys/x86/x86/local_apic.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/amd64/amd64/mp_machdep.c
==
--- stable/10/sys/amd64/amd64/mp_machdep.c  Mon Dec 22 19:10:21 2014
(r276075)
+++ stable/10/sys/amd64/amd64/mp_machdep.c  Mon Dec 22 19:53:55 2014
(r276076)
@@ -723,7 +723,7 @@ init_secondary(void)
/* set up CPU registers and state */
cpu_setregs();
 
-   /* set up SSE/NX registers */
+   /* set up SSE/NX */
initializecpu();
 
/* set up FPU state on the AP */

Modified: stable/10/sys/i386/i386/initcpu.c
==
--- stable/10/sys/i386/i386/initcpu.c   Mon Dec 22 19:10:21 2014
(r276075)
+++ stable/10/sys/i386/i386/initcpu.c   Mon Dec 22 19:53:55 2014
(r276076)
@@ -59,6 +59,12 @@ static void init_i486_on_386(void);
 static void init_6x86(void);
 #endif /* I486_CPU */
 
+#if defined(I586_CPU)  defined(CPU_WT_ALLOC)
+static voidenable_K5_wt_alloc(void);
+static voidenable_K6_wt_alloc(void);
+static voidenable_K6_2_wt_alloc(void);
+#endif
+
 #ifdef I686_CPU
 static voidinit_6x86MX(void);
 static voidinit_ppro(void);
@@ -451,7 +457,7 @@ init_winchip(void)
fcr = ~(1ULL  11);
 
/*
-* Additioanlly, set EBRPRED, E2MMX and EAMD3D for WinChip 2 and 3.
+* Additionally, set EBRPRED, E2MMX and EAMD3D for WinChip 2 and 3.
 */
if (CPUID_TO_MODEL(cpu_id) = 8)
fcr |= (1  12) | (1  19) | (1  20);
@@ -527,6 +533,8 @@ init_6x86MX(void)
intr_restore(saveintr);
 }
 
+static int ppro_apic_used = -1;
+
 static void
 init_ppro(void)
 {
@@ -535,9 +543,29 @@ init_ppro(void)
/*
 * Local APIC should be disabled if it is not going to be used.
 */
-   apicbase = rdmsr(MSR_APICBASE);
-   apicbase = ~APICBASE_ENABLED;
-   wrmsr(MSR_APICBASE, apicbase);
+   if (ppro_apic_used != 1) {
+   apicbase = rdmsr(MSR_APICBASE);
+   apicbase = ~APICBASE_ENABLED;
+   wrmsr(MSR_APICBASE, apicbase);
+   ppro_apic_used = 0;
+   }
+}
+
+/*
+ * If the local APIC is going to be used after being disabled above,
+ * re-enable it and don't disable it in the future.
+ */
+void
+ppro_reenable_apic(void)
+{
+   u_int64_t   apicbase;
+
+   if (ppro_apic_used == 0) {
+   apicbase = rdmsr(MSR_APICBASE);
+   apicbase |= APICBASE_ENABLED;
+   wrmsr(MSR_APICBASE, apicbase);
+   ppro_apic_used = 1;
+   }
 }
 
 /*
@@ -646,20 +674,6 @@ init_transmeta(void)
 }
 #endif
 
-/*
- * Initialize CR4 (Control register 4) to enable SSE instructions.
- */
-void
-enable_sse(void)
-{
-#if defined(CPU_ENABLE_SSE)
-   if ((cpu_feature  CPUID_XMM)  (cpu_feature  CPUID_FXSR)) {
-   load_cr4(rcr4() | CR4_FXSR | CR4_XMM);
-   cpu_fxsr = hw_instruction_sse = 1;
-   }
-#endif
-}
-
 extern int elf32_nxstack;
 
 void
@@ -692,6 +706,27 @@ initializecpu(void)
 #ifdef I586_CPU
case CPU_586:
switch (cpu_vendor_id) {
+   case CPU_VENDOR_AMD:
+#ifdef CPU_WT_ALLOC
+   if (((cpu_id  0x0f0)  0) 
+   ((cpu_id  0x0f0)  0x60) 
+   ((cpu_id  0x00f)  3))
+   enable_K5_wt_alloc();
+   else if (((cpu_id  0x0f0)  0x80) ||
+   (((cpu_id  0x0f0) == 0x80) 
+   (cpu_id  0x00f)  0x07))
+   enable_K6_2_wt_alloc();
+   else if ((cpu_id  0x0f0)  0x50)
+   enable_K6_wt_alloc();
+#endif
+   if ((cpu_id  0xf0) == 0xa0)
+   /*
+* Make sure the TSC runs through
+* suspension, otherwise we can't use
+* it as timecounter
+*/
+   wrmsr(0x1900, rdmsr(0x1900) | 0x20ULL);
+   break;
case CPU_VENDOR_CENTAUR:
init_winchip();
   

Re: svn commit: r276065 - head/sys/dev/ipmi

2014-12-22 Thread John Baldwin
On Monday, December 22, 2014 11:53:05 am John Baldwin wrote:
 Author: jhb
 Date: Mon Dec 22 16:53:04 2014
 New Revision: 276065
 URL: https://svnweb.freebsd.org/changeset/base/276065
 
 Log:
   Explicitly treat timeouts when waiting for IBF or OBF to change state as an
   error.  This fixes occasional hangs in the IPMI kcs thread when using
   ipmitool locally.

In particular, the ipmi0: kcs thread would run at 100% CPU.  With this fix in
place I know see a KCS error reported in dmesg and the driver recovers allowing
future requests to complete ok.

-- 
John Baldwin
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r276008 - in head/sys: kern sys

2014-12-22 Thread John Baldwin
On Monday, December 22, 2014 1:29:38 pm Rui Paulo wrote:
 On Dec 22, 2014, at 06:40, John Baldwin j...@freebsd.org wrote:
  Is there something specific to core dumps that makes vn_fullpath() more
  useful to have working before a process tries to open the core?  (As
  compared to other newly-created files)
 
 Yes: the ability to provide the full path to userland when a core dump file 
is generated.

Can you be more specific?  Are we printing the path on the console after
destroying the generated path?  Is it being written into a note in the core
itself (but only having the vnode of the core file available and not the 
generated path)?

-- 
John Baldwin
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r276077 - in vendor/elftoolchain/dist: . ar brandelf common elfcopy libdwarf libelf libelftc mk nm readelf strings test/ar test/ar/plugin test/elfcopy test/elfcopy/plugin test/elfcopy/t...

2014-12-22 Thread Ed Maste
Author: emaste
Date: Mon Dec 22 20:32:23 2014
New Revision: 276077
URL: https://svnweb.freebsd.org/changeset/base/276077

Log:
  Import elftoolchain rev 3130
  
  From svn.code.sf.net/p/elftoolchain/code/trunk

Added:
  vendor/elftoolchain/dist/ar/os.Linux.mk   (contents, props changed)
  vendor/elftoolchain/dist/libdwarf/dwarf_attroffset.3   (contents, props 
changed)
  vendor/elftoolchain/dist/libdwarf/dwarf_get_die_infotypes_flag.3   (contents, 
props changed)
  vendor/elftoolchain/dist/libdwarf/dwarf_get_section_max_offsets.3   
(contents, props changed)
  vendor/elftoolchain/dist/libdwarf/dwarf_next_types_section.3   (contents, 
props changed)
  vendor/elftoolchain/dist/libdwarf/dwarf_sections.c   (contents, props changed)
  vendor/elftoolchain/dist/mk/elftoolchain.tetbase.mk   (contents, props 
changed)
  vendor/elftoolchain/dist/test/elfcopy/tc/strip-empty-1/
  vendor/elftoolchain/dist/test/elfcopy/tc/strip-empty-1/in/
  
vendor/elftoolchain/dist/test/elfcopy/tc/strip-empty-1/in/strip-empty-1.in.shar
  vendor/elftoolchain/dist/test/elfcopy/tc/strip-empty-1/out/
  
vendor/elftoolchain/dist/test/elfcopy/tc/strip-empty-1/out/strip-empty-1.out.shar
  vendor/elftoolchain/dist/test/elfcopy/tc/strip-empty-1/strip-empty-1.err
  vendor/elftoolchain/dist/test/elfcopy/tc/strip-empty-1/strip-empty-1.eval
  vendor/elftoolchain/dist/test/elfcopy/tc/strip-empty-1/strip-empty-1.out
  vendor/elftoolchain/dist/test/elfcopy/tc/strip-empty-1/strip-empty-1.sh   
(contents, props changed)
  vendor/elftoolchain/dist/test/libdwarf/ts/common/die_traverse2.c   (contents, 
props changed)
  vendor/elftoolchain/dist/test/libdwarf/ts/common/object/ld_symver.o-64-g1.gz  
 (contents, props changed)
  
vendor/elftoolchain/dist/test/libdwarf/ts/dwarf_attrlist/ld_symver.o-64-g1.xml.gz
   (contents, props changed)
  
vendor/elftoolchain/dist/test/libdwarf/ts/dwarf_die_query/ld_symver.o-64-g1.xml.gz
   (contents, props changed)
  vendor/elftoolchain/dist/test/libdwarf/ts/dwarf_form/ld_symver.o-64-g1.xml.gz 
  (contents, props changed)
  
vendor/elftoolchain/dist/test/libdwarf/ts/dwarf_next_cu_header/ld_symver.o-64-g1.xml.gz
   (contents, props changed)
Modified:
  vendor/elftoolchain/dist/INSTALL
  vendor/elftoolchain/dist/Makefile
  vendor/elftoolchain/dist/ar/Makefile
  vendor/elftoolchain/dist/ar/acpyacc.y
  vendor/elftoolchain/dist/ar/read.c
  vendor/elftoolchain/dist/ar/write.c
  vendor/elftoolchain/dist/brandelf/brandelf.1
  vendor/elftoolchain/dist/brandelf/brandelf.c
  vendor/elftoolchain/dist/common/Makefile
  vendor/elftoolchain/dist/common/elfdefinitions.h
  vendor/elftoolchain/dist/elfcopy/archive.c
  vendor/elftoolchain/dist/elfcopy/main.c
  vendor/elftoolchain/dist/elfcopy/sections.c
  vendor/elftoolchain/dist/elfcopy/segments.c
  vendor/elftoolchain/dist/elfcopy/symbols.c
  vendor/elftoolchain/dist/libdwarf/Makefile
  vendor/elftoolchain/dist/libdwarf/Version.map
  vendor/elftoolchain/dist/libdwarf/_libdwarf.h
  vendor/elftoolchain/dist/libdwarf/dwarf.3
  vendor/elftoolchain/dist/libdwarf/dwarf.h
  vendor/elftoolchain/dist/libdwarf/dwarf_attr.3
  vendor/elftoolchain/dist/libdwarf/dwarf_attr.c
  vendor/elftoolchain/dist/libdwarf/dwarf_attrval.c
  vendor/elftoolchain/dist/libdwarf/dwarf_attrval_signed.3
  vendor/elftoolchain/dist/libdwarf/dwarf_child.3
  vendor/elftoolchain/dist/libdwarf/dwarf_cu.c
  vendor/elftoolchain/dist/libdwarf/dwarf_die.c
  vendor/elftoolchain/dist/libdwarf/dwarf_dieoffset.3
  vendor/elftoolchain/dist/libdwarf/dwarf_dump.c
  vendor/elftoolchain/dist/libdwarf/dwarf_errmsg.c
  vendor/elftoolchain/dist/libdwarf/dwarf_frame.c
  vendor/elftoolchain/dist/libdwarf/dwarf_highpc.3
  vendor/elftoolchain/dist/libdwarf/dwarf_lineno.c
  vendor/elftoolchain/dist/libdwarf/dwarf_loclist.c
  vendor/elftoolchain/dist/libdwarf/dwarf_loclist_from_expr.3
  vendor/elftoolchain/dist/libdwarf/dwarf_next_cu_header.3
  vendor/elftoolchain/dist/libdwarf/dwarf_ranges.c
  vendor/elftoolchain/dist/libdwarf/libdwarf.h
  vendor/elftoolchain/dist/libdwarf/libdwarf_arange.c
  vendor/elftoolchain/dist/libdwarf/libdwarf_attr.c
  vendor/elftoolchain/dist/libdwarf/libdwarf_die.c
  vendor/elftoolchain/dist/libdwarf/libdwarf_frame.c
  vendor/elftoolchain/dist/libdwarf/libdwarf_info.c
  vendor/elftoolchain/dist/libdwarf/libdwarf_init.c
  vendor/elftoolchain/dist/libdwarf/libdwarf_lineno.c
  vendor/elftoolchain/dist/libdwarf/libdwarf_loc.c
  vendor/elftoolchain/dist/libdwarf/libdwarf_loclist.c
  vendor/elftoolchain/dist/libdwarf/libdwarf_nametbl.c
  vendor/elftoolchain/dist/libdwarf/libdwarf_sections.c
  vendor/elftoolchain/dist/libelf/_libelf.h
  vendor/elftoolchain/dist/libelf/_libelf_ar.h
  vendor/elftoolchain/dist/libelf/elf.3
  vendor/elftoolchain/dist/libelf/elf_data.c
  vendor/elftoolchain/dist/libelf/elf_errmsg.c
  vendor/elftoolchain/dist/libelf/elf_flag.c
  vendor/elftoolchain/dist/libelf/elf_memory.c
  vendor/elftoolchain/dist/libelf/elf_next.c
  vendor/elftoolchain/dist/libelf/elf_open.c
  

svn commit: r276078 - vendor/elftoolchain/elftoolchain-r3130

2014-12-22 Thread Ed Maste
Author: emaste
Date: Mon Dec 22 20:33:40 2014
New Revision: 276078
URL: https://svnweb.freebsd.org/changeset/base/276078

Log:
  Tag elftoolchain r3130

Added:
  vendor/elftoolchain/elftoolchain-r3130/
 - copied from r276077, vendor/elftoolchain/dist/
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r276079 - head/lib/libstand

2014-12-22 Thread Ian Lepore
Author: ian
Date: Mon Dec 22 20:42:36 2014
New Revision: 276079
URL: https://svnweb.freebsd.org/changeset/base/276079

Log:
  Add a divisor parameter to twiddle() so that callers can request that output
  only happen on every Nth call.  Update the existing twiddle() calls done in
  various IO loops to roughly reflect the relative IO sizes.  That is, tftp
  and nfs call twiddle() on every 1K block, ufs on every filesystem block,
  so the network calls now use a much larger divisor than disk IO calls.
  
  Also add a new twiddle_divisor() function that allows an application to set
  a global divisor that is applied on top of the per-call divisors.  Nothing
  calls this yet, but loader(8) will be using it to further throttle the
  cursor for slow serial consoles.

Modified:
  head/lib/libstand/cd9660.c
  head/lib/libstand/ext2fs.c
  head/lib/libstand/nandfs.c
  head/lib/libstand/nfs.c
  head/lib/libstand/read.c
  head/lib/libstand/stand.h
  head/lib/libstand/tftp.c
  head/lib/libstand/twiddle.c
  head/lib/libstand/ufs.c
  head/lib/libstand/write.c

Modified: head/lib/libstand/cd9660.c
==
--- head/lib/libstand/cd9660.c  Mon Dec 22 20:33:40 2014(r276078)
+++ head/lib/libstand/cd9660.c  Mon Dec 22 20:42:36 2014(r276079)
@@ -281,7 +281,7 @@ cd9660_open(const char *path, struct ope
buf = malloc(buf_size = ISO_DEFAULT_BLOCK_SIZE);
vd = buf;
for (bno = 16;; bno++) {
-   twiddle();
+   twiddle(1);
rc = f-f_dev-dv_strategy(f-f_devdata, F_READ, cdb2devb(bno),
   ISO_DEFAULT_BLOCK_SIZE, buf, read);
if (rc)
@@ -314,7 +314,7 @@ cd9660_open(const char *path, struct ope
 
while (off  dsize) {
if ((off % ISO_DEFAULT_BLOCK_SIZE) == 0) {
-   twiddle();
+   twiddle(1);
rc = f-f_dev-dv_strategy
(f-f_devdata, F_READ,
 cdb2devb(bno + boff),
@@ -374,7 +374,7 @@ cd9660_open(const char *path, struct ope
 
/* Check for Rock Ridge since we didn't in the loop above. */
bno = isonum_733(rec.extent) + isonum_711(rec.ext_attr_length);
-   twiddle();
+   twiddle(1);
rc = f-f_dev-dv_strategy(f-f_devdata, F_READ, cdb2devb(bno),
ISO_DEFAULT_BLOCK_SIZE, buf, read);
if (rc)
@@ -431,7 +431,7 @@ buf_read_file(struct open_file *f, char 
if (fp-f_buf == (char *)0)
fp-f_buf = malloc(ISO_DEFAULT_BLOCK_SIZE);
 
-   twiddle();
+   twiddle(16);
rc = f-f_dev-dv_strategy(f-f_devdata, F_READ,
cdb2devb(blkno), ISO_DEFAULT_BLOCK_SIZE, fp-f_buf, read);
if (rc)

Modified: head/lib/libstand/ext2fs.c
==
--- head/lib/libstand/ext2fs.c  Mon Dec 22 20:33:40 2014(r276078)
+++ head/lib/libstand/ext2fs.c  Mon Dec 22 20:42:36 2014(r276079)
@@ -353,7 +353,7 @@ ext2fs_open(const char *upath, struct op
/* allocate space and read super block */
fs = (struct ext2fs *)malloc(sizeof(*fs));
fp-f_fs = fs;
-   twiddle();
+   twiddle(1);
error = (f-f_dev-dv_strategy)(f-f_devdata, F_READ,
EXT2_SBLOCK, EXT2_SBSIZE, (char *)fs, buf_size);
if (error)
@@ -395,7 +395,7 @@ ext2fs_open(const char *upath, struct op
len = blkgrps * fs-fs_bsize;
 
fp-f_bg = malloc(len);
-   twiddle();
+   twiddle(1);
error = (f-f_dev-dv_strategy)(f-f_devdata, F_READ,
EXT2_SBLOCK + EXT2_SBSIZE / DEV_BSIZE, len,
(char *)fp-f_bg, buf_size);
@@ -507,7 +507,7 @@ ext2fs_open(const char *upath, struct op
if (error)
goto out;

-   twiddle();
+   twiddle(1);
error = (f-f_dev-dv_strategy)(f-f_devdata,
F_READ, fsb_to_db(fs, disk_block),
fs-fs_bsize, buf, buf_size);
@@ -568,7 +568,7 @@ read_inode(ino_t inumber, struct open_fi
 * Read inode and save it.
 */
buf = malloc(fs-fs_bsize);
-   twiddle();
+   twiddle(1);
error = (f-f_dev-dv_strategy)(f-f_devdata, F_READ,
ino_to_db(fs, fp-f_bg, inumber), fs-fs_bsize, buf, rsize);
if (error)
@@ -665,7 +665,7 @@ block_map(struct open_file *f, daddr_t f
if (fp-f_blk[level] == (char *)0)
fp-f_blk[level] =
malloc(fs-fs_bsize);
-

svn commit: r276080 - in stable/10/sys/i386: i386 include linux svr4

2014-12-22 Thread John Baldwin
Author: jhb
Date: Mon Dec 22 20:53:45 2014
New Revision: 276080
URL: https://svnweb.freebsd.org/changeset/base/276080

Log:
  MFC 273991:
  MFamd64: Move extern declaration of _ucodesel and _udatasel to
  machine/md_var.h

Modified:
  stable/10/sys/i386/i386/vm_machdep.c
  stable/10/sys/i386/include/md_var.h
  stable/10/sys/i386/linux/linux_sysvec.c
  stable/10/sys/i386/svr4/svr4_machdep.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/i386/i386/vm_machdep.c
==
--- stable/10/sys/i386/i386/vm_machdep.cMon Dec 22 20:42:36 2014
(r276079)
+++ stable/10/sys/i386/i386/vm_machdep.cMon Dec 22 20:53:45 2014
(r276080)
@@ -150,8 +150,6 @@ static u_intsf_buf_alloc_want;
  */
 static struct mtx sf_buf_lock;
 
-extern int _ucodesel, _udatasel;
-
 /*
  * Finish a fork operation, with process p2 nearly set up.
  * Copy and update the pcb, set up the stack so that the child

Modified: stable/10/sys/i386/include/md_var.h
==
--- stable/10/sys/i386/include/md_var.h Mon Dec 22 20:42:36 2014
(r276079)
+++ stable/10/sys/i386/include/md_var.h Mon Dec 22 20:53:45 2014
(r276080)
@@ -76,6 +76,8 @@ externint szosigcode;
 extern uint32_t *vm_page_dump;
 extern int vm_page_dump_size;
 extern int workaround_erratum383;
+extern int _udatasel;
+extern int _ucodesel;
 
 typedef void alias_for_inthand_t(u_int cs, u_int ef, u_int esp, u_int ss);
 struct thread;

Modified: stable/10/sys/i386/linux/linux_sysvec.c
==
--- stable/10/sys/i386/linux/linux_sysvec.c Mon Dec 22 20:42:36 2014
(r276079)
+++ stable/10/sys/i386/linux/linux_sysvec.c Mon Dec 22 20:53:45 2014
(r276080)
@@ -400,7 +400,6 @@ linux_copyout_strings(struct image_param
 
 
 
-extern int _ucodesel, _udatasel;
 extern unsigned long linux_sznonrtsigcode;
 
 static void

Modified: stable/10/sys/i386/svr4/svr4_machdep.c
==
--- stable/10/sys/i386/svr4/svr4_machdep.c  Mon Dec 22 20:42:36 2014
(r276079)
+++ stable/10/sys/i386/svr4/svr4_machdep.c  Mon Dec 22 20:53:45 2014
(r276080)
@@ -65,7 +65,6 @@ __FBSDID($FreeBSD$);
 
 extern int svr4_szsigcode;
 extern char svr4_sigcode[];
-extern int _udatasel, _ucodesel;
 
 static void svr4_getsiginfo(union svr4_siginfo *, int, u_long, caddr_t);
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r276081 - in stable/10: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/cmd/zstreamdump cddl/contrib/openso...

2014-12-22 Thread Xin LI
Author: delphij
Date: Mon Dec 22 20:58:51 2014
New Revision: 276081
URL: https://svnweb.freebsd.org/changeset/base/276081

Log:
  MFC r274337,r274673,274681,r275515:
  
  ZFS large block support.  The default recordsize remains at 128KB.
  
  A new tunable/sysctl variable, vfs.zfs.max_recordsize is added to
  allow adjusting the permitted maximum record size, or
  zfs_max_recordsize, with a default of 1MB.  ZFS will not allow
  setting recordsize greater than zfs_max_recordsize as a safety
  belt, because larger recordsize means greater read and write
  latency and more memory usage.
  
  Please note that booting from datasets that have recordsize greater
  than 128KB is not supported (but it's Okay to enable the feature on
  the pool).
  
  Limited safety belt is provided for mounted root filesystem but use
  caution when using a larger value.
  
  Illumos issue:
  5027 zfs large block support

Modified:
  stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c
  stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8
  stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
  stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7
  stable/10/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c
  stable/10/cddl/contrib/opensolaris/cmd/ztest/ztest.c
  stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h
  stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
  stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
  stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c
  stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h
  stable/10/sys/boot/zfs/zfsimpl.c
  stable/10/sys/cddl/boot/zfs/zfsimpl.h
  stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c
  stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h
  stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c
  stable/10/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_send.h
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_impl.h
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil_impl.h
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c
==
--- stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.cMon Dec 22 20:53:45 
2014(r276080)

svn commit: r276082 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2014-12-22 Thread Xin LI
Author: delphij
Date: Mon Dec 22 21:06:26 2014
New Revision: 276082
URL: https://svnweb.freebsd.org/changeset/base/276082

Log:
  MFC r275530:
  
  Use %d instead of %u for error number.  This way we see ERESTART as -1
  not 4294967295 when doing DTrace.

Modified:
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c
==
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Dec 
22 20:58:51 2014(r276081)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Dec 
22 21:06:26 2014(r276082)
@@ -1492,7 +1492,7 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t *
}
if (scn-scn_visited_this_txg) {
zfs_dbgmsg(freed %llu blocks in %llums from 
-   free_bpobj/bptree txg %llu; err=%u,
+   free_bpobj/bptree txg %llu; err=%d,
(longlong_t)scn-scn_visited_this_txg,
(longlong_t)
NSEC2MSEC(gethrtime() - scn-scn_sync_start_time),
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r276083 - head/etc

2014-12-22 Thread Dmitry Morozovsky
Author: marck (doc committer)
Date: Mon Dec 22 21:26:49 2014
New Revision: 276083
URL: https://svnweb.freebsd.org/changeset/base/276083

Log:
  Add VAMI (VMware Appliance Management Interface) port.
  
  Reviewed by:  eadler
  MFC after:2 weeks

Modified:
  head/etc/services

Modified: head/etc/services
==
--- head/etc/services   Mon Dec 22 21:06:26 2014(r276082)
+++ head/etc/services   Mon Dec 22 21:26:49 2014(r276083)
@@ -2345,6 +2345,8 @@ mdns  5353/tcp   #Multicast DNS
 mdns   5353/udp   #Multicast DNS
 postgresql 5432/tcp   #PostgreSQL Database
 postgresql 5432/udp   #PostgreSQL Database
+vami   5480/tcp   #VMware Appliance Management Interface, HTTPS-like
+vami   5480/udp   #VMware Appliance Management Interface, HTTPS-like
 rplay  /udp
 amqp   5672/sctp  #AMQP
 amqp   5672/tcp   #AMQP
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r276084 - in stable/10/sys: amd64/amd64 i386/i386 i386/include i386/isa i386/linux x86/acpica

2014-12-22 Thread John Baldwin
Author: jhb
Date: Mon Dec 22 21:32:39 2014
New Revision: 276084
URL: https://svnweb.freebsd.org/changeset/base/276084

Log:
  MFC 273988,273989,273995,274057:
  MFamd64: Add support for extended FPU states on i386.  This includes
  support for AVX on i386.

Modified:
  stable/10/sys/amd64/amd64/genassym.c
  stable/10/sys/amd64/amd64/sys_machdep.c
  stable/10/sys/amd64/amd64/vm_machdep.c
  stable/10/sys/i386/i386/genassym.c
  stable/10/sys/i386/i386/initcpu.c
  stable/10/sys/i386/i386/locore.s
  stable/10/sys/i386/i386/machdep.c
  stable/10/sys/i386/i386/mp_machdep.c
  stable/10/sys/i386/i386/ptrace_machdep.c
  stable/10/sys/i386/i386/sys_machdep.c
  stable/10/sys/i386/i386/trap.c
  stable/10/sys/i386/i386/vm_machdep.c
  stable/10/sys/i386/include/cpufunc.h
  stable/10/sys/i386/include/md_var.h
  stable/10/sys/i386/include/npx.h
  stable/10/sys/i386/include/pcb.h
  stable/10/sys/i386/isa/npx.c
  stable/10/sys/i386/linux/linux_ptrace.c
  stable/10/sys/x86/acpica/acpi_wakeup.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/amd64/amd64/genassym.c
==
--- stable/10/sys/amd64/amd64/genassym.cMon Dec 22 21:26:49 2014
(r276083)
+++ stable/10/sys/amd64/amd64/genassym.cMon Dec 22 21:32:39 2014
(r276084)
@@ -156,8 +156,6 @@ ASSYM(PCB_ONFAULT, offsetof(struct pcb, 
 ASSYM(PCB_GS32SD, offsetof(struct pcb, pcb_gs32sd));
 ASSYM(PCB_TSSP, offsetof(struct pcb, pcb_tssp));
 ASSYM(PCB_SAVEFPU, offsetof(struct pcb, pcb_save));
-ASSYM(PCB_SAVEFPU_SIZE, sizeof(struct savefpu));
-ASSYM(PCB_USERFPU, sizeof(struct pcb));
 ASSYM(PCB_EFER, offsetof(struct pcb, pcb_efer));
 ASSYM(PCB_STAR, offsetof(struct pcb, pcb_star));
 ASSYM(PCB_LSTAR, offsetof(struct pcb, pcb_lstar));

Modified: stable/10/sys/amd64/amd64/sys_machdep.c
==
--- stable/10/sys/amd64/amd64/sys_machdep.c Mon Dec 22 21:26:49 2014
(r276083)
+++ stable/10/sys/amd64/amd64/sys_machdep.c Mon Dec 22 21:32:39 2014
(r276084)
@@ -320,7 +320,7 @@ sysarch(td, uap)
fpugetregs(td);
error = copyout((char *)(get_pcb_user_save_td(td) + 1),
a64xfpu.addr, a64xfpu.len);
-   return (error);
+   break;
 
default:
error = EINVAL;

Modified: stable/10/sys/amd64/amd64/vm_machdep.c
==
--- stable/10/sys/amd64/amd64/vm_machdep.c  Mon Dec 22 21:26:49 2014
(r276083)
+++ stable/10/sys/amd64/amd64/vm_machdep.c  Mon Dec 22 21:32:39 2014
(r276084)
@@ -127,7 +127,7 @@ get_pcb_td(struct thread *td)
 void *
 alloc_fpusave(int flags)
 {
-   struct pcb *res;
+   void *res;
struct savefpu_ymm *sf;
 
res = malloc(cpu_max_ext_state_size, M_DEVBUF, flags);

Modified: stable/10/sys/i386/i386/genassym.c
==
--- stable/10/sys/i386/i386/genassym.c  Mon Dec 22 21:26:49 2014
(r276083)
+++ stable/10/sys/i386/i386/genassym.c  Mon Dec 22 21:32:39 2014
(r276084)
@@ -144,7 +144,6 @@ ASSYM(PCB_DR2, offsetof(struct pcb, pcb_
 ASSYM(PCB_DR3, offsetof(struct pcb, pcb_dr3));
 ASSYM(PCB_DR6, offsetof(struct pcb, pcb_dr6));
 ASSYM(PCB_DR7, offsetof(struct pcb, pcb_dr7));
-ASSYM(PCB_USERFPU, offsetof(struct pcb, pcb_user_save));
 ASSYM(PCB_PSL, offsetof(struct pcb, pcb_psl));
 ASSYM(PCB_DBREGS, PCB_DBREGS);
 ASSYM(PCB_EXT, offsetof(struct pcb, pcb_ext));
@@ -154,7 +153,6 @@ ASSYM(PCB_GSD, offsetof(struct pcb, pcb_
 ASSYM(PCB_VM86, offsetof(struct pcb, pcb_vm86));
 ASSYM(PCB_FLAGS, offsetof(struct pcb, pcb_flags));
 ASSYM(PCB_SAVEFPU, offsetof(struct pcb, pcb_save));
-ASSYM(PCB_SAVEFPU_SIZE, sizeof(union savefpu));
 ASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault));
 
 ASSYM(PCB_SIZE, sizeof(struct pcb));

Modified: stable/10/sys/i386/i386/initcpu.c
==
--- stable/10/sys/i386/i386/initcpu.c   Mon Dec 22 21:26:49 2014
(r276083)
+++ stable/10/sys/i386/i386/initcpu.c   Mon Dec 22 21:32:39 2014
(r276084)
@@ -102,6 +102,7 @@ u_int   cpu_mxcsr_mask; /* Valid bits in 
 #endif
 u_int  cpu_clflush_line_size = 32;
 u_int  cpu_stdext_feature;
+u_int  cpu_max_ext_state_size;
 u_int  cpu_mon_mwait_flags;/* MONITOR/MWAIT flags (CPUID.05H.ECX) */
 u_int  cpu_mon_min_size;   /* MONITOR minimum range size, bytes */
 u_int  cpu_mon_max_size;   /* MONITOR minimum range size, bytes */

Modified: stable/10/sys/i386/i386/locore.s
==
--- stable/10/sys/i386/i386/locore.sMon Dec 22 21:26:49 2014
(r276083)
+++ stable/10/sys/i386/i386/locore.sMon Dec 22 21:32:39 2014
(r276084)
@@ -302,17 +302,14 @@ 

svn commit: r276085 - stable/10/sys/i386/i386

2014-12-22 Thread John Baldwin
Author: jhb
Date: Mon Dec 22 21:46:35 2014
New Revision: 276085
URL: https://svnweb.freebsd.org/changeset/base/276085

Log:
  MFC 275035:
  MFamd64: Check for invalid flags in the machine context in sigreturn()
  and setcontext().

Modified:
  stable/10/sys/i386/i386/machdep.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/i386/i386/machdep.c
==
--- stable/10/sys/i386/i386/machdep.c   Mon Dec 22 21:32:39 2014
(r276084)
+++ stable/10/sys/i386/i386/machdep.c   Mon Dec 22 21:46:35 2014
(r276085)
@@ -1043,6 +1043,11 @@ sys_sigreturn(td, uap)
if (error != 0)
return (error);
ucp = uc;
+   if ((ucp-uc_mcontext.mc_flags  ~_MC_FLAG_MASK) != 0) {
+   uprintf(pid %d (%s): sigreturn mc_flags %x\n, p-p_pid,
+   td-td_name, ucp-uc_mcontext.mc_flags);
+   return (EINVAL);
+   }
regs = td-td_frame;
eflags = ucp-uc_mcontext.mc_eflags;
if (eflags  PSL_VM) {
@@ -3540,7 +3545,8 @@ set_mcontext(struct thread *td, const mc
int eflags, ret;
 
tp = td-td_frame;
-   if (mcp-mc_len != sizeof(*mcp))
+   if (mcp-mc_len != sizeof(*mcp) ||
+   (mcp-mc_flags  ~_MC_FLAG_MASK) != 0)
return (EINVAL);
eflags = (mcp-mc_eflags  PSL_USERCHANGE) |
(tp-tf_eflags  ~PSL_USERCHANGE);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r276086 - head/usr.sbin/freebsd-update

2014-12-22 Thread Colin Percival
Author: cperciva
Date: Mon Dec 22 21:52:37 2014
New Revision: 276086
URL: https://svnweb.freebsd.org/changeset/base/276086

Log:
  Strip trailing / characters from paths in not present index entries, not
  just directory entries.
  
  Prior to this commit, if / was added as part of a security update (how? In
  the most recent case, because lib32 was accidentally omitted and was then
  re-added, and every installer distribution set gets its own paths) then
  the code which was supposed to filter out updates to deleted parts of the
  base system (if someone decides to delete / then we shouldn't re-create it
  for them) would instead get confused and decided that while / should exist,
  // should not exist and needs to be removed.
  
  This fixes the bug which caused freebsd-update to want to delete / (which is
  harmless, since `rm /` fails, but scary nonetheless).  A workaround is being
  applied to the update bits in order to avoid triggering the bug on unpatched
  systems.
  
  PR:   196055, 196091, 196147

Modified:
  head/usr.sbin/freebsd-update/freebsd-update.sh

Modified: head/usr.sbin/freebsd-update/freebsd-update.sh
==
--- head/usr.sbin/freebsd-update/freebsd-update.sh  Mon Dec 22 21:46:35 
2014(r276085)
+++ head/usr.sbin/freebsd-update/freebsd-update.sh  Mon Dec 22 21:52:37 
2014(r276086)
@@ -1395,6 +1395,7 @@ fetch_filter_metadata () {
# matter, since we add a leading / when we use paths later.
cut -f 3- -d '|' $1 |
sed -e 's,/|d|,|d|,' |
+   sed -e 's,/|-|,|-|,' |
sort -u  $1.tmp
 
# Figure out which lines to ignore and remove them.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r276087 - in head/sys/boot: common forth

2014-12-22 Thread Ian Lepore
Author: ian
Date: Mon Dec 22 22:07:22 2014
New Revision: 276087
URL: https://svnweb.freebsd.org/changeset/base/276087

Log:
  Add a new loader(8) variable, twiddle_divisor, allowing control over the
  output frequency of the twiddle IO progress indicator.  The default
  value is 1.  For larger values N, the next stage of the animation is only
  output on every Nth call to the output routine.  A sufficiently large N
  effectively disables the animation completely.

Modified:
  head/sys/boot/common/console.c
  head/sys/boot/common/loader.8
  head/sys/boot/forth/loader.conf

Modified: head/sys/boot/common/console.c
==
--- head/sys/boot/common/console.c  Mon Dec 22 21:52:37 2014
(r276086)
+++ head/sys/boot/common/console.c  Mon Dec 22 22:07:22 2014
(r276087)
@@ -39,6 +39,7 @@ static intcons_set(struct env_var *ev, 
 static int cons_find(const char *name);
 static int cons_check(const char *string);
 static voidcons_change(const char *string);
+static int twiddle_set(struct env_var *ev, int flags, const void *value);
 
 /*
  * Detect possible console(s) to use.  If preferred console(s) have been
@@ -52,6 +53,9 @@ cons_probe(void) 
 intactive;
 char   *prefconsole;
 
+/* We want a callback to install the new value when this var changes. */
+env_setenv(twiddle_divisor, EV_VOLATILE, 1, twiddle_set, env_nounset);
+
 /* Do all console probes */
 for (cons = 0; consoles[cons] != NULL; cons++) {
consoles[cons]-c_flags = 0;
@@ -232,3 +236,28 @@ cons_change(const char *string)
 
 free(dup);
 }
+
+/*
+ * Change the twiddle divisor.
+ *
+ * The user can set the twiddle_divisor variable to directly control how fast
+ * the progress twiddle spins, useful for folks with slow serial consoles.  The
+ * code to monitor changes to the variable and propagate them to the twiddle
+ * routines has to live somewhere.  Twiddling is console-related so it's here.
+ */
+static int
+twiddle_set(struct env_var *ev, int flags, const void *value)
+{
+u_long tdiv;
+char * eptr;
+
+tdiv = strtoul(value, eptr, 0);
+if (*(const char *)value == 0 || *eptr != 0) {
+   printf(invalid twiddle_divisor '%s'\n, (const char *)value);
+   return (CMD_ERROR);
+}
+twiddle_divisor((u_int)tdiv);
+env_setenv(ev-ev_name, flags | EV_NOHOOK, value, NULL, NULL);
+
+return(CMD_OK);
+}

Modified: head/sys/boot/common/loader.8
==
--- head/sys/boot/common/loader.8   Mon Dec 22 21:52:37 2014
(r276086)
+++ head/sys/boot/common/loader.8   Mon Dec 22 22:07:22 2014
(r276087)
@@ -24,7 +24,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd October 1, 2013
+.Dd December 22, 2014
 .Dt LOADER 8
 .Os
 .Sh NAME
@@ -670,6 +670,12 @@ Overrides the compile-time set value of
 .Dv TCBHASHSIZE
 or the preset default of 512.
 Must be a power of 2.
+.It Va twiddle_divisor
+Throttles the output of the `twiddle' I/O progress indicator displayed
+while loading the kernel and modules.
+This is useful on slow serial consoles where the time spent waiting for
+these characters to be written can add up to many seconds.
+The default is 1 (full speed); a value of 2 spins half as fast, and so on.
 .It Va vm.kmem_size
 Sets the size of kernel memory (bytes).
 This overrides the value determined when the kernel was compiled.

Modified: head/sys/boot/forth/loader.conf
==
--- head/sys/boot/forth/loader.conf Mon Dec 22 21:52:37 2014
(r276086)
+++ head/sys/boot/forth/loader.conf Mon Dec 22 22:07:22 2014
(r276087)
@@ -75,6 +75,7 @@ module_path=/boot/modules   # Set the mo
# the block size is set to 512.  If the value
# is out of range (  8 ||  9008 ) an error is
# returned.
+#twiddle_divisor=1   # 1 means slow down the progress indicator.
 
 
 ##
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r276088 - stable/10/usr.sbin/freebsd-update

2014-12-22 Thread Dag-Erling Smørgrav
Author: des
Date: Mon Dec 22 22:11:39 2014
New Revision: 276088
URL: https://svnweb.freebsd.org/changeset/base/276088

Log:
  Strip trailing / characters from paths in not present index entries.
  
  Errata:   FreeBSD-EN-14:13.freebsd-update
  Approved by:  so@

Modified:
  stable/10/usr.sbin/freebsd-update/freebsd-update.sh

Modified: stable/10/usr.sbin/freebsd-update/freebsd-update.sh
==
--- stable/10/usr.sbin/freebsd-update/freebsd-update.sh Mon Dec 22 22:07:22 
2014(r276087)
+++ stable/10/usr.sbin/freebsd-update/freebsd-update.sh Mon Dec 22 22:11:39 
2014(r276088)
@@ -1387,6 +1387,7 @@ fetch_filter_metadata () {
# matter, since we add a leading / when we use paths later.
cut -f 3- -d '|' $1 |
sed -e 's,/|d|,|d|,' |
+   sed -e 's,/|-|,|-|,' |
sort -u  $1.tmp
 
# Figure out which lines to ignore and remove them.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r276089 - stable/8/usr.sbin/freebsd-update

2014-12-22 Thread Dag-Erling Smørgrav
Author: des
Date: Mon Dec 22 22:11:45 2014
New Revision: 276089
URL: https://svnweb.freebsd.org/changeset/base/276089

Log:
  Strip trailing / characters from paths in not present index entries.
  
  Errata:   FreeBSD-EN-14:13.freebsd-update
  Approved by:  so@

Modified:
  stable/8/usr.sbin/freebsd-update/freebsd-update.sh

Modified: stable/8/usr.sbin/freebsd-update/freebsd-update.sh
==
--- stable/8/usr.sbin/freebsd-update/freebsd-update.sh  Mon Dec 22 22:11:39 
2014(r276088)
+++ stable/8/usr.sbin/freebsd-update/freebsd-update.sh  Mon Dec 22 22:11:45 
2014(r276089)
@@ -1372,6 +1372,7 @@ fetch_filter_metadata () {
# matter, since we add a leading / when we use paths later.
cut -f 3- -d '|' $1 |
sed -e 's,/|d|,|d|,' |
+   sed -e 's,/|-|,|-|,' |
sort -u  $1.tmp
 
# Figure out which lines to ignore and remove them.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r276090 - stable/9/usr.sbin/freebsd-update

2014-12-22 Thread Dag-Erling Smørgrav
Author: des
Date: Mon Dec 22 22:11:50 2014
New Revision: 276090
URL: https://svnweb.freebsd.org/changeset/base/276090

Log:
  Strip trailing / characters from paths in not present index entries.
  
  Errata:   FreeBSD-EN-14:13.freebsd-update
  Approved by:  so@

Modified:
  stable/9/usr.sbin/freebsd-update/freebsd-update.sh

Modified: stable/9/usr.sbin/freebsd-update/freebsd-update.sh
==
--- stable/9/usr.sbin/freebsd-update/freebsd-update.sh  Mon Dec 22 22:11:45 
2014(r276089)
+++ stable/9/usr.sbin/freebsd-update/freebsd-update.sh  Mon Dec 22 22:11:50 
2014(r276090)
@@ -1387,6 +1387,7 @@ fetch_filter_metadata () {
# matter, since we add a leading / when we use paths later.
cut -f 3- -d '|' $1 |
sed -e 's,/|d|,|d|,' |
+   sed -e 's,/|-|,|-|,' |
sort -u  $1.tmp
 
# Figure out which lines to ignore and remove them.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r276091 - vendor/ntp/dist

2014-12-22 Thread Ollivier Robert
Author: roberto
Date: Mon Dec 22 22:14:20 2014
New Revision: 276091
URL: https://svnweb.freebsd.org/changeset/base/276091

Log:
  Add back these files deleted by the previous vendor import.
  
  Next commit will remove some files from this tree in order to avoid merging
  them into head as they were never merged before.
  
  Forgotten by: cy

Added:
  vendor/ntp/dist/FREEBSD-Xlist
  vendor/ntp/dist/FREEBSD-upgrade

Added: vendor/ntp/dist/FREEBSD-Xlist
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ vendor/ntp/dist/FREEBSD-Xlist   Mon Dec 22 22:14:20 2014
(r276091)
@@ -0,0 +1,2 @@
+*ports
+*html/pic

Added: vendor/ntp/dist/FREEBSD-upgrade
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ vendor/ntp/dist/FREEBSD-upgrade Mon Dec 22 22:14:20 2014
(r276091)
@@ -0,0 +1,55 @@
+# ex:ts=8
+#
+# $FreeBSD$
+
+NTP 4.2.8
+originals can be found on http://www.ntp.org/downloads.html
+
+Import
+--
+
+For the import of NTP the following files were removed:
+
+ports/* NT files
+html/pic/*  GIF files
+html/build/hints/solaris.xtra.4095849 Trigger merge conflict script
+
+The stripped down version was created using FREEBSD-Xlist during
+extraction:
+
+tar -X FREEBSD-Xlist -xvzf ntp-4.2.8.tar.gz
+mv ntp-4.2.8 4.2.8
+
+Imported by:
+See procedure on
+https://www.freebsd.org/doc/en_US.ISO8859-1/articles/committers-guide/subversion-primer.html
+
+Updating usr.sbin/ntp
+-
+
+./configure --disable-all-clocks --enable-NMEA --enable-ONCORE
+--enable-RAWDCF --with-crypto --disable-debugging
+--enable-LOCAL-CLOCK --with-sntp --with-arlib --prefix=/usr
+
+config.h was generated by running configure and excluding almost all clock
+drivers (what is included is DCF77 -- what I use --, NMEA, Motorola OnCORE
+and local clocks).
+
+The file is then edited to edit the value of NO_PARENB_IGNPAR because we
+need to set no parity on the serial port (needed for DCF77). All clock
+drivers are then disabled (some of them are included by default by ntpd).
+
+Note that there are two #ifdef to support other architectures (WRT to long
+size and endianness). They'll need to be redone for each upgrade to the
+vendor branch to keep config.h in sync.
+
+ntpd/ntp_control.c is now the only file that is different from the vendor
+branch for unsigned char/int fixes and removal of a DoS.
+
+Documentation in /usr/share/doc/ntp is generated from the HTML files with
+lynx (without the GIF files of course).
+
+A patch to fix IPV6_MULTICAST_LOOP was committed to head as r222444 and
+filed as http://bugs.ntp.org/show_bug.cgi?id=1936.  Check if still needed
+or re-apply on update.
+
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r276092 - in vendor/ntp/dist: html/pic ports

2014-12-22 Thread Ollivier Robert
Author: roberto
Date: Mon Dec 22 22:15:31 2014
New Revision: 276092
URL: https://svnweb.freebsd.org/changeset/base/276092

Log:
  Remove files that should not be merged into head when updating ntp.

Deleted:
  vendor/ntp/dist/html/pic/
  vendor/ntp/dist/ports/
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r276093 - vendor/ntp/dist/ntpd

2014-12-22 Thread Ollivier Robert
Author: roberto
Date: Mon Dec 22 22:22:10 2014
New Revision: 276093
URL: https://svnweb.freebsd.org/changeset/base/276093

Log:
  Add the two patches from the port in net/ntp/files to fix compilation
  issues with vendor code. r375210  r375215.

Modified:
  vendor/ntp/dist/ntpd/ntp_io.c
  vendor/ntp/dist/ntpd/refclock_mx4200.c

Modified: vendor/ntp/dist/ntpd/ntp_io.c
==
--- vendor/ntp/dist/ntpd/ntp_io.c   Mon Dec 22 22:15:31 2014
(r276092)
+++ vendor/ntp/dist/ntpd/ntp_io.c   Mon Dec 22 22:22:10 2014
(r276093)
@@ -3454,15 +3454,15 @@ read_network_packet(
if (AF_INET6 == itf-family) {
DPRINTF(1, (Got an IPv6 packet, from %s (%d) to %s (%d)\n,
stoa(rb-recv_srcadr),
-   IN6_IS_ADDR_LOOPBACK(rb-recv_srcadr),
+   IN6_IS_ADDR_LOOPBACK(rb-recv_srcadr.sa6.sin6_addr),
stoa(itf-sin),
-   !IN6_IS_ADDR_LOOPBACK(itf-sin)
+   !IN6_IS_ADDR_LOOPBACK(itf-sin.sa6.sin6_addr)
));
}
 
if (   AF_INET6 == itf-family
-IN6_IS_ADDR_LOOPBACK(rb-recv_srcadr)
-!IN6_IS_ADDR_LOOPBACK(itf-sin)
+IN6_IS_ADDR_LOOPBACK(rb-recv_srcadr.sa6.sin6_addr)
+!IN6_IS_ADDR_LOOPBACK(itf-sin.sa6.sin6_addr)
   ) {
packets_dropped++;
DPRINTF(1, (DROPPING that packet\n));

Modified: vendor/ntp/dist/ntpd/refclock_mx4200.c
==
--- vendor/ntp/dist/ntpd/refclock_mx4200.c  Mon Dec 22 22:15:31 2014
(r276092)
+++ vendor/ntp/dist/ntpd/refclock_mx4200.c  Mon Dec 22 22:22:10 2014
(r276093)
@@ -1572,7 +1572,7 @@ mx4200_debug(struct peer *peer, char *fm
 * Print debug message to stdout
 * In the future, we may want to get get more creative...
 */
-   mvprintf(fmt, ap);
+   vprintf(fmt, ap);
 
va_end(ap);
}
@@ -1613,11 +1613,11 @@ mx4200_send(peer, fmt, va_alist)
 
cp = buf;
*cp++ = '$';
-   n = VSNPRINTF((cp, sizeof(buf) - 1, fmt, ap));
+   n = vsnprintf(cp, sizeof(buf) - 1, fmt, ap);
ck = mx4200_cksum(cp, n);
cp += n;
++n;
-   n += SNPRINTF((cp, sizeof(buf) - n - 5, *%02X\r\n, ck));
+   n += snprintf(cp, sizeof(buf) - n - 5, *%02X\r\n, ck);
 
m = write(pp-io.fd, buf, (unsigned)n);
if (m  0)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r276095 - head/usr.sbin/freebsd-update

2014-12-22 Thread Dag-Erling Smørgrav
Author: des
Date: Mon Dec 22 23:03:18 2014
New Revision: 276095
URL: https://svnweb.freebsd.org/changeset/base/276095

Log:
  Use RCS tag instead of $FreeBSD$ tag, since svn will obediently
  expand the latter.
  
  MFC after:3 days

Modified:
  head/usr.sbin/freebsd-update/freebsd-update.sh

Modified: head/usr.sbin/freebsd-update/freebsd-update.sh
==
--- head/usr.sbin/freebsd-update/freebsd-update.sh  Mon Dec 22 22:29:48 
2014(r276094)
+++ head/usr.sbin/freebsd-update/freebsd-update.sh  Mon Dec 22 23:03:18 
2014(r276095)
@@ -2264,7 +2264,7 @@ upgrade_oldall_to_oldnew () {
 }
 
 # Helper for upgrade_merge: Return zero true iff the two files differ only
-# in the contents of their $FreeBSD$ tags.
+# in the contents of their RCS tags.
 samef () {
X=`sed -E 's/\\$FreeBSD.*\\$/\$FreeBSD\$/'  $1 | ${SHA256}`
Y=`sed -E 's/\\$FreeBSD.*\\$/\$FreeBSD\$/'  $2 | ${SHA256}`
@@ -2360,7 +2360,7 @@ upgrade_merge () {
# Ask the user to handle any files which didn't merge.
while read F; do
# If the installed file differs from the version in
-   # the old release only due to $FreeBSD$ tag expansion
+   # the old release only due to RCS tag expansion
# then just use the version in the new release.
if samef merge/old/${F} merge/${OLDRELNUM}/${F}; then
cp merge/${RELNUM}/${F} merge/new/${F}
@@ -2382,14 +2382,14 @@ manually...
# of merging files.
while read F; do
# Skip files which haven't changed except possibly
-   # in their $FreeBSD$ tags.
+   # in their RCS tags.
if [ -f merge/old/${F} ]  [ -f merge/new/${F} ] 
samef merge/old/${F} merge/new/${F}; then
continue
fi
 
# Skip files where the installed file differs from
-   # the old file only due to $FreeBSD$ tags.
+   # the old file only due to RCS tags.
if [ -f merge/old/${F} ] 
[ -f merge/${OLDRELNUM}/${F} ] 
samef merge/old/${F} merge/${OLDRELNUM}/${F}; then
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r276096 - in head/sys: arm/conf conf fs/nfs fs/nfsclient modules modules/dtrace modules/dtrace/dtnfsclient modules/dtrace/dtraceall modules/nfs_common modules/nfsclient modules/nfsserve...

2014-12-22 Thread Rick Macklem
Author: rmacklem
Date: Tue Dec 23 00:47:46 2014
New Revision: 276096
URL: https://svnweb.freebsd.org/changeset/base/276096

Log:
  Remove the old NFS client and server from head,
  which means that the NFSCLIENT and NFSSERVER
  kernel options will no longer work. This commit
  only removes the kernel components. Removal of
  unused code in the user utilities will be done
  later. This commit does not include an addition
  to UPDATING, but that will be committed in a
  few minutes.
  
  Discussed on: freebsd-fs

Deleted:
  head/sys/modules/dtrace/dtnfsclient/
  head/sys/modules/nfs_common/
  head/sys/modules/nfsclient/
  head/sys/modules/nfsserver/
  head/sys/nfs/nfs_common.c
  head/sys/nfsclient/nfs_bio.c
  head/sys/nfsclient/nfs_kdtrace.c
  head/sys/nfsclient/nfs_krpc.c
  head/sys/nfsclient/nfs_nfsiod.c
  head/sys/nfsclient/nfs_node.c
  head/sys/nfsclient/nfs_subs.c
  head/sys/nfsclient/nfs_vfsops.c
  head/sys/nfsclient/nfs_vnops.c
  head/sys/nfsserver/nfs_fha_old.c
  head/sys/nfsserver/nfs_serv.c
  head/sys/nfsserver/nfs_srvkrpc.c
  head/sys/nfsserver/nfs_srvsubs.c
Modified:
  head/sys/arm/conf/DOCKSTAR
  head/sys/arm/conf/DREAMPLUG-1001
  head/sys/arm/conf/EA3250
  head/sys/conf/NOTES
  head/sys/conf/files
  head/sys/conf/options
  head/sys/fs/nfs/nfs_commonkrpc.c
  head/sys/fs/nfsclient/nfs_clnode.c
  head/sys/fs/nfsclient/nfs_clport.c
  head/sys/fs/nfsclient/nfs_clvfsops.c
  head/sys/modules/Makefile
  head/sys/modules/dtrace/Makefile
  head/sys/modules/dtrace/dtraceall/dtraceall.c
  head/sys/nfs/bootp_subr.c
  head/sys/sys/param.h

Modified: head/sys/arm/conf/DOCKSTAR
==
--- head/sys/arm/conf/DOCKSTAR  Mon Dec 22 23:03:18 2014(r276095)
+++ head/sys/arm/conf/DOCKSTAR  Tue Dec 23 00:47:46 2014(r276096)
@@ -154,7 +154,7 @@ options INVARIANT_SUPPORT   # Extra sanit
 # Enable these options for nfs root configured via BOOTP.
 optionsNFSCL   # Network Filesystem Client
 optionsNFSLOCKD# Network Lock Manager
-#options   NFS_ROOT# NFS usable as /, requires NFSCLIENT
+#options   NFS_ROOT# NFS usable as /, requires NFSCL
 #options   BOOTP
 #options   BOOTP_NFSROOT
 #options   BOOTP_NFSV3

Modified: head/sys/arm/conf/DREAMPLUG-1001
==
--- head/sys/arm/conf/DREAMPLUG-1001Mon Dec 22 23:03:18 2014
(r276095)
+++ head/sys/arm/conf/DREAMPLUG-1001Tue Dec 23 00:47:46 2014
(r276096)
@@ -162,7 +162,7 @@ options INVARIANT_SUPPORT   # Extra sanit
 # Enable these options for nfs root configured via BOOTP.
 optionsNFSCL   # Network Filesystem Client
 optionsNFSLOCKD# Network Lock Manager
-#options   NFS_ROOT# NFS usable as /, requires NFSCLIENT
+#options   NFS_ROOT# NFS usable as /, requires NFSCL
 #options   BOOTP
 #options   BOOTP_NFSROOT
 #options   BOOTP_NFSV3

Modified: head/sys/arm/conf/EA3250
==
--- head/sys/arm/conf/EA3250Mon Dec 22 23:03:18 2014(r276095)
+++ head/sys/arm/conf/EA3250Tue Dec 23 00:47:46 2014(r276096)
@@ -19,7 +19,7 @@ options   INET6   # IPv6 communications p
 optionsFFS # Berkeley Fast Filesystem
 optionsNFSCL   # Network Filesystem Client
 optionsNFSLOCKD# Network Lock Manager
-optionsNFS_ROOT# NFS usable as /, requires NFSCLIENT
+optionsNFS_ROOT# NFS usable as /, requires NFSCL
 optionsGEOM_PART_BSD   # BSD partition scheme
 optionsGEOM_PART_MBR   # MBR partition scheme
 optionsTMPFS   # Efficient memory filesystem

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Mon Dec 22 23:03:18 2014(r276095)
+++ head/sys/conf/NOTES Tue Dec 23 00:47:46 2014(r276096)
@@ -1019,7 +1019,7 @@ options   DUMMYNET
 
 # One of these is mandatory:
 optionsFFS #Fast filesystem
-optionsNFSCLIENT   #Network File System client
+optionsNFSCL   #Network File System client
 
 # The rest are optional:
 optionsAUTOFS  #Automounter filesystem
@@ -1027,7 +1027,6 @@ options   CD9660  #ISO 9660 filesystem
 optionsFDESCFS #File descriptor filesystem
 optionsFUSE#FUSE support module
 optionsMSDOSFS #MS DOS File System (FAT, FAT32)
-optionsNFSSERVER   #Network File System server
 optionsNFSLOCKD#Network Lock Manager
 

svn commit: r276097 - head

2014-12-22 Thread Rick Macklem
Author: rmacklem
Date: Tue Dec 23 01:32:18 2014
New Revision: 276097
URL: https://svnweb.freebsd.org/changeset/base/276097

Log:
  Add an UPDATING entry for r276096, which removed the kernel
  sources for the old NFS client and server.

Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Tue Dec 23 00:47:46 2014(r276096)
+++ head/UPDATING   Tue Dec 23 01:32:18 2014(r276097)
@@ -31,6 +31,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11
disable the most expensive debugging functionality run
ln -s 'abort:false,junk:false' /etc/malloc.conf.)
 
+20141222:
+   The old NFS client and server (kernel options NFSCLIENT, NFSSERVER)
+   kernel sources have been removed. The .h files remain, since some
+   utilities include them. This will need to be fixed later.
+   If mount -t oldnfs ... is attempted, it will fail.
+   If the -o option on mountd(8), nfsd(8) or nfsstat(1) is used,
+   the utilities will report errors.
+
 20141121:
The handling of LOCAL_LIB_DIRS has been altered to skip addition of
directories to top level SUBDIR variable when their parent
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r276098 - in head/sys/amd64: include vmm vmm/amd vmm/intel

2014-12-22 Thread Neel Natu
Author: neel
Date: Tue Dec 23 02:14:49 2014
New Revision: 276098
URL: https://svnweb.freebsd.org/changeset/base/276098

Log:
  Allow ktr(4) tracing of all guest exceptions via the tunable
  hw.vmm.trace_guest_exceptions.  To enable this feature set the tunable
  to 1 before loading vmm.ko.
  
  Tracing the guest exceptions can be useful when debugging guest triple faults.
  
  Note that there is a performance impact when exception tracing is enabled
  since every exception will now trigger a VM-exit.
  
  Also, handle machine check exceptions that happen during guest execution
  by vectoring to the host's machine check handler via int $18.
  
  Discussed with:   grehan
  MFC after:2 weeks

Modified:
  head/sys/amd64/include/vmm.h
  head/sys/amd64/vmm/amd/svm.c
  head/sys/amd64/vmm/intel/vmcs.c
  head/sys/amd64/vmm/intel/vmcs.h
  head/sys/amd64/vmm/intel/vmx.c
  head/sys/amd64/vmm/vmm.c

Modified: head/sys/amd64/include/vmm.h
==
--- head/sys/amd64/include/vmm.hTue Dec 23 01:32:18 2014
(r276097)
+++ head/sys/amd64/include/vmm.hTue Dec 23 02:14:49 2014
(r276098)
@@ -358,6 +358,8 @@ void vm_copyin(struct vm *vm, int vcpuid
 void *kaddr, size_t len);
 void vm_copyout(struct vm *vm, int vcpuid, const void *kaddr,
 struct vm_copyinfo *copyinfo, size_t len);
+
+int vcpu_trace_exceptions(struct vm *vm, int vcpuid);
 #endif /* KERNEL */
 
 #defineVM_MAXCPU   16  /* maximum virtual cpus 
*/

Modified: head/sys/amd64/vmm/amd/svm.c
==
--- head/sys/amd64/vmm/amd/svm.cTue Dec 23 01:32:18 2014
(r276097)
+++ head/sys/amd64/vmm/amd/svm.cTue Dec 23 02:14:49 2014
(r276098)
@@ -46,6 +46,7 @@ __FBSDID($FreeBSD$);
 #include machine/specialreg.h
 #include machine/smp.h
 #include machine/vmm.h
+#include machine/vmm_dev.h
 #include machine/vmm_instruction_emul.h
 
 #include vmm_lapic.h
@@ -429,8 +430,24 @@ vmcb_init(struct svm_softc *sc, int vcpu
svm_enable_intercept(sc, vcpu, VMCB_CR_INTCPT, mask);
}
 
-   /* Intercept Machine Check exceptions. */
-   svm_enable_intercept(sc, vcpu, VMCB_EXC_INTCPT, BIT(IDT_MC));
+
+   /*
+* Intercept everything when tracing guest exceptions otherwise
+* just intercept machine check exception.
+*/
+   if (vcpu_trace_exceptions(sc-vm, vcpu)) {
+   for (n = 0; n  32; n++) {
+   /*
+* Skip unimplemented vectors in the exception bitmap.
+*/
+   if (n == 2 || n == 9) {
+   continue;
+   }
+   svm_enable_intercept(sc, vcpu, VMCB_EXC_INTCPT, BIT(n));
+   }
+   } else {
+   svm_enable_intercept(sc, vcpu, VMCB_EXC_INTCPT, BIT(IDT_MC));
+   }
 
/* Intercept various events (for e.g. I/O, MSR and CPUID accesses) */
svm_enable_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_IO);
@@ -1176,9 +1193,10 @@ svm_vmexit(struct svm_softc *svm_sc, int
struct vmcb_state *state;
struct vmcb_ctrl *ctrl;
struct svm_regctx *ctx;
+   struct vm_exception exception;
uint64_t code, info1, info2, val;
uint32_t eax, ecx, edx;
-   int handled;
+   int error, errcode_valid, handled, idtvec, reflect;
bool retu;
 
ctx = svm_get_guest_regctx(svm_sc, vcpu);
@@ -1237,8 +1255,78 @@ svm_vmexit(struct svm_softc *svm_sc, int
case VMCB_EXIT_NMI: /* external NMI */
handled = 1;
break;
-   case VMCB_EXIT_MC:  /* machine check */
+   case 0x40 ... 0x5F:
vmm_stat_incr(svm_sc-vm, vcpu, VMEXIT_EXCEPTION, 1);
+   reflect = 1;
+   idtvec = code - 0x40;
+   switch (idtvec) {
+   case IDT_MC:
+   /*
+* Call the machine check handler by hand. Also don't
+* reflect the machine check back into the guest.
+*/
+   reflect = 0;
+   VCPU_CTR0(svm_sc-vm, vcpu, Vectoring to MCE handler);
+   __asm __volatile(int $18);
+   break;
+   case IDT_PF:
+   error = svm_setreg(svm_sc, vcpu, VM_REG_GUEST_CR2,
+   info2);
+   KASSERT(error == 0, (%s: error %d updating cr2,
+   __func__, error));
+   /* fallthru */
+   case IDT_NP:
+   case IDT_SS:
+   case IDT_GP:
+   case IDT_AC:
+   case IDT_TS:
+   errcode_valid = 1;
+   break;
+
+   case 

Re: svn commit: r276008 - in head/sys: kern sys

2014-12-22 Thread Rui Paulo
On Dec 22, 2014, at 11:17, John Baldwin j...@freebsd.org wrote:
 
 On Monday, December 22, 2014 1:29:38 pm Rui Paulo wrote:
 On Dec 22, 2014, at 06:40, John Baldwin j...@freebsd.org wrote:
 Is there something specific to core dumps that makes vn_fullpath() more
 useful to have working before a process tries to open the core?  (As
 compared to other newly-created files)
 
 Yes: the ability to provide the full path to userland when a core dump file 
 is generated.
 
 Can you be more specific?  Are we printing the path on the console after
 destroying the generated path?  Is it being written into a note in the core
 itself (but only having the vnode of the core file available and not the 
 generated path)?

No.  I have some code that calls devctl_notify() when a core dump is generated 
which is useful for running an automated debugging session.  We use this at 
work and I'll see if I can upstream it.  What Konstantin fixed was the 
generation of the cache entry in the corefile_open() routine.  This lets me 
call vn_fullpath() after vn_close() with a high probability that it will work 
whereas, in the past, it was never in the cache, so vn_fullpath() would always 
fail.

--
Rui Paulo



___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r276099 - stable/10/usr.bin/sed

2014-12-22 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Dec 23 02:46:00 2014
New Revision: 276099
URL: https://svnweb.freebsd.org/changeset/base/276099

Log:
  MFC   r275838;
  sed: Bounds check the file path used in the 'w' command.
  
  Modified version of a diff from Sebastien Marie to prevent a crash found
  with the afl fuzzer.
  
  Obtained from:OpenBSD (CVS Rev. 1.37)

Modified:
  stable/10/usr.bin/sed/compile.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.bin/sed/compile.c
==
--- stable/10/usr.bin/sed/compile.c Tue Dec 23 02:14:49 2014
(r276098)
+++ stable/10/usr.bin/sed/compile.c Tue Dec 23 02:46:00 2014
(r276099)
@@ -558,7 +558,7 @@ compile_flags(char *p, struct s_subst *s
 {
int gn; /* True if we have seen g or n */
unsigned long nval;
-   char wfile[_POSIX2_LINE_MAX + 1], *q;
+   char wfile[_POSIX2_LINE_MAX + 1], *q, *eq;
 
s-n = 1;   /* Default */
s-p = 0;
@@ -611,9 +611,12 @@ compile_flags(char *p, struct s_subst *s
 #endif
EATSPACE();
q = wfile;
+   eq = wfile + sizeof(wfile) - 1;
while (*p) {
if (*p == '\n')
break;
+   if (q = eq)
+   err(1, wfile too long);
*q++ = *p++;
}
*q = '\0';
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r276100 - stable/9/usr.bin/sed

2014-12-22 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Dec 23 02:47:14 2014
New Revision: 276100
URL: https://svnweb.freebsd.org/changeset/base/276100

Log:
  MFC   r275838;
  sed: Bounds check the file path used in the 'w' command.
  
  Modified version of a diff from Sebastien Marie to prevent a crash found
  with the afl fuzzer.
  
  Obtained from:OpenBSD (CVS Rev. 1.37)

Modified:
  stable/9/usr.bin/sed/compile.c
Directory Properties:
  stable/9/usr.bin/sed/   (props changed)

Modified: stable/9/usr.bin/sed/compile.c
==
--- stable/9/usr.bin/sed/compile.c  Tue Dec 23 02:46:00 2014
(r276099)
+++ stable/9/usr.bin/sed/compile.c  Tue Dec 23 02:47:14 2014
(r276100)
@@ -558,7 +558,7 @@ compile_flags(char *p, struct s_subst *s
 {
int gn; /* True if we have seen g or n */
unsigned long nval;
-   char wfile[_POSIX2_LINE_MAX + 1], *q;
+   char wfile[_POSIX2_LINE_MAX + 1], *q, *eq;
 
s-n = 1;   /* Default */
s-p = 0;
@@ -611,9 +611,12 @@ compile_flags(char *p, struct s_subst *s
 #endif
EATSPACE();
q = wfile;
+   eq = wfile + sizeof(wfile) - 1;
while (*p) {
if (*p == '\n')
break;
+   if (q = eq)
+   err(1, wfile too long);
*q++ = *p++;
}
*q = '\0';
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r276101 - head/sys/boot/fdt/dts/arm

2014-12-22 Thread Rui Paulo
Author: rpaulo
Date: Tue Dec 23 03:00:18 2014
New Revision: 276101
URL: https://svnweb.freebsd.org/changeset/base/276101

Log:
  Temporarily disable the cpus directive until I figure out what's wrong.

Modified:
  head/sys/boot/fdt/dts/arm/rpi.dts

Modified: head/sys/boot/fdt/dts/arm/rpi.dts
==
--- head/sys/boot/fdt/dts/arm/rpi.dts   Tue Dec 23 02:47:14 2014
(r276100)
+++ head/sys/boot/fdt/dts/arm/rpi.dts   Tue Dec 23 03:00:18 2014
(r276101)
@@ -35,6 +35,7 @@
 
memreserve = 0x0800 0x0800;   /* Set by VideoCore */
 
+   /*
cpus {
#address-cells = 1;
#size-cells = 0;
@@ -45,6 +46,7 @@
clock-frequency = 7;  /* 700MHz */
};
};
+   */
 
memory {
device_type = memory;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r276102 - stable/10/sys/fs/ext2fs

2014-12-22 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Dec 23 03:24:16 2014
New Revision: 276102
URL: https://svnweb.freebsd.org/changeset/base/276102

Log:
  MFC   r274437;
  
  ifdef ext2_print_inode which is not really used.
  
  ext2_print_inode was nice to have for initial development work but
  is not really used anymore. #ifdef it under a new EXT2FS_DEBUG knob
  so that we don't spend time compiling it.

Modified:
  stable/10/sys/fs/ext2fs/ext2_extern.h
  stable/10/sys/fs/ext2fs/ext2_inode_cnv.c
  stable/10/sys/fs/ext2fs/ext2_vfsops.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/fs/ext2fs/ext2_extern.h
==
--- stable/10/sys/fs/ext2fs/ext2_extern.h   Tue Dec 23 03:00:18 2014
(r276101)
+++ stable/10/sys/fs/ext2fs/ext2_extern.h   Tue Dec 23 03:24:16 2014
(r276102)
@@ -74,7 +74,9 @@ int   ext2_vfree(struct vnode *, ino_t, in
 intext2_vinit(struct mount *, struct vop_vector *, struct vnode **vpp);
 intext2_lookup(struct vop_cachedlookup_args *);
 intext2_readdir(struct vop_readdir_args *);
+#ifdef EXT2FS_DEBUG
 void   ext2_print_inode(struct inode *);
+#endif
 intext2_direnter(struct inode *, 
struct vnode *, struct componentname *);
 intext2_dirremove(struct vnode *, struct componentname *);

Modified: stable/10/sys/fs/ext2fs/ext2_inode_cnv.c
==
--- stable/10/sys/fs/ext2fs/ext2_inode_cnv.cTue Dec 23 03:00:18 2014
(r276101)
+++ stable/10/sys/fs/ext2fs/ext2_inode_cnv.cTue Dec 23 03:24:16 2014
(r276102)
@@ -41,6 +41,7 @@
 #define XTIME_TO_NSEC(x)   ((x  EXT3_NSEC_MASK)  2)
 #define NSEC_TO_XTIME(t)   (le32toh(t  2)  EXT3_NSEC_MASK)
 
+#ifdef EXT2FS_DEBUG
 void
 ext2_print_inode(struct inode *in)
 {
@@ -75,6 +76,7 @@ ext2_print_inode(struct inode *in)
ep-e_len, ep-e_start_lo, ep-e_start_hi);
printf(\n);
 }
+#endif /* EXT2FS_DEBUG */
 
 /*
  * raw ext2 inode to inode

Modified: stable/10/sys/fs/ext2fs/ext2_vfsops.c
==
--- stable/10/sys/fs/ext2fs/ext2_vfsops.c   Tue Dec 23 03:00:18 2014
(r276101)
+++ stable/10/sys/fs/ext2fs/ext2_vfsops.c   Tue Dec 23 03:24:16 2014
(r276102)
@@ -974,9 +974,9 @@ ext2_vget(struct mount *mp, ino_t ino, i
for (i = used_blocks; i  EXT2_NDIR_BLOCKS; i++)
ip-i_db[i] = 0;
}
-/*
+#ifdef EXT2FS_DEBUG
ext2_print_inode(ip);
-*/
+#endif
bqrelse(bp);
 
/*
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r276103 - stable/9/sys/fs/ext2fs

2014-12-22 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Dec 23 03:25:20 2014
New Revision: 276103
URL: https://svnweb.freebsd.org/changeset/base/276103

Log:
  MFC   r274437;
  
  ifdef ext2_print_inode which is not really used.
  
  ext2_print_inode was nice to have for initial development work but
  is not really used anymore. #ifdef it under a new EXT2FS_DEBUG knob
  so that we don't spend time compiling it.

Modified:
  stable/9/sys/fs/ext2fs/ext2_extern.h
  stable/9/sys/fs/ext2fs/ext2_inode_cnv.c
  stable/9/sys/fs/ext2fs/ext2_vfsops.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/fs/   (props changed)

Modified: stable/9/sys/fs/ext2fs/ext2_extern.h
==
--- stable/9/sys/fs/ext2fs/ext2_extern.hTue Dec 23 03:24:16 2014
(r276102)
+++ stable/9/sys/fs/ext2fs/ext2_extern.hTue Dec 23 03:25:20 2014
(r276103)
@@ -74,7 +74,9 @@ int   ext2_vfree(struct vnode *, ino_t, in
 intext2_vinit(struct mount *, struct vop_vector *, struct vnode **vpp);
 intext2_lookup(struct vop_cachedlookup_args *);
 intext2_readdir(struct vop_readdir_args *);
+#ifdef EXT2FS_DEBUG
 void   ext2_print_inode(struct inode *);
+#endif
 intext2_direnter(struct inode *, 
struct vnode *, struct componentname *);
 intext2_dirremove(struct vnode *, struct componentname *);

Modified: stable/9/sys/fs/ext2fs/ext2_inode_cnv.c
==
--- stable/9/sys/fs/ext2fs/ext2_inode_cnv.c Tue Dec 23 03:24:16 2014
(r276102)
+++ stable/9/sys/fs/ext2fs/ext2_inode_cnv.c Tue Dec 23 03:25:20 2014
(r276103)
@@ -41,6 +41,7 @@
 #define XTIME_TO_NSEC(x)   ((x  EXT3_NSEC_MASK)  2)
 #define NSEC_TO_XTIME(t)   (le32toh(t  2)  EXT3_NSEC_MASK)
 
+#ifdef EXT2FS_DEBUG
 void
 ext2_print_inode(struct inode *in)
 {
@@ -75,6 +76,7 @@ ext2_print_inode(struct inode *in)
ep-e_len, ep-e_start_lo, ep-e_start_hi);
printf(\n);
 }
+#endif /* EXT2FS_DEBUG */
 
 /*
  * raw ext2 inode to inode

Modified: stable/9/sys/fs/ext2fs/ext2_vfsops.c
==
--- stable/9/sys/fs/ext2fs/ext2_vfsops.cTue Dec 23 03:24:16 2014
(r276102)
+++ stable/9/sys/fs/ext2fs/ext2_vfsops.cTue Dec 23 03:25:20 2014
(r276103)
@@ -983,9 +983,9 @@ ext2_vget(struct mount *mp, ino_t ino, i
for (i = used_blocks; i  EXT2_NDIR_BLOCKS; i++)
ip-i_db[i] = 0;
}
-/*
+#ifdef EXT2FS_DEBUG
ext2_print_inode(ip);
-*/
+#endif
bqrelse(bp);
 
/*
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r276106 - head/sys/dev/mmc

2014-12-22 Thread Warner Losh
Author: imp
Date: Tue Dec 23 05:50:53 2014
New Revision: 276106
URL: https://svnweb.freebsd.org/changeset/base/276106

Log:
  Always select the card before we do the 4.x specific stuff and
  deselect it after setting the block size. This is a similar bug that
  was fixed elsewhere, but not here. This makes sure that we leave the
  card deselected at the end of the loop, and we don't send any commands
  to the card without it selected.
  
  Reviewed by: ian@

Modified:
  head/sys/dev/mmc/mmc.c

Modified: head/sys/dev/mmc/mmc.c
==
--- head/sys/dev/mmc/mmc.c  Tue Dec 23 05:37:09 2014(r276105)
+++ head/sys/dev/mmc/mmc.c  Tue Dec 23 05:50:53 2014(r276106)
@@ -1446,10 +1446,10 @@ mmc_discover_cards(struct mmc_softc *sc)
break;
}
 
+   mmc_select_card(sc, ivar-rca);
+
/* Only MMC = 4.x cards support EXT_CSD. */
if (ivar-csd.spec_vers = 4) {
-   /* Card must be selected to fetch EXT_CSD. */
-   mmc_select_card(sc, ivar-rca);
mmc_send_ext_csd(sc, ivar-raw_ext_csd);
/* Handle extended capacity from EXT_CSD */
sec_count = ivar-raw_ext_csd[EXT_CSD_SEC_CNT] +
@@ -1479,7 +1479,6 @@ mmc_discover_cards(struct mmc_softc *sc)
mmc_switch(sc, EXT_CSD_CMD_SET_NORMAL,
EXT_CSD_ERASE_GRP_DEF, 1);
}
-   mmc_select_card(sc, 0);
} else {
ivar-bus_width = bus_width_1;
ivar-timing = bus_timing_normal;
@@ -1506,6 +1505,7 @@ mmc_discover_cards(struct mmc_softc *sc)
child = device_add_child(sc-dev, NULL, -1);
device_set_ivars(child, ivar);
}
+   mmc_select_card(sc, 0);
}
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r276008 - in head/sys: kern sys

2014-12-22 Thread Andriy Gapon
On 23/12/2014 04:39, Rui Paulo wrote:
 On Dec 22, 2014, at 11:17, John Baldwin j...@freebsd.org wrote:

 On Monday, December 22, 2014 1:29:38 pm Rui Paulo wrote:
 On Dec 22, 2014, at 06:40, John Baldwin j...@freebsd.org wrote:
 Is there something specific to core dumps that makes vn_fullpath() more
 useful to have working before a process tries to open the core?  (As
 compared to other newly-created files)

 Yes: the ability to provide the full path to userland when a core dump file 
 is generated.

 Can you be more specific?  Are we printing the path on the console after
 destroying the generated path?  Is it being written into a note in the core
 itself (but only having the vnode of the core file available and not the 
 generated path)?
 
 No.  I have some code that calls devctl_notify() when a core dump is 
 generated which is useful for running an automated debugging session.  We use 
 this at work and I'll see if I can upstream it.  What Konstantin fixed was 
 the generation of the cache entry in the corefile_open() routine.  This lets 
 me call vn_fullpath() after vn_close() with a high probability that it will 
 work whereas, in the past, it was never in the cache, so vn_fullpath() would 
 always fail.

What is not entirely clear to me is why we need to recover the path from the
vnode if we, obviously, have the path even before we have the vnode.


-- 
Andriy Gapon
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r276008 - in head/sys: kern sys

2014-12-22 Thread Rui Paulo
On Dec 22, 2014, at 23:03, Andriy Gapon a...@freebsd.org wrote:
 
 On 23/12/2014 04:39, Rui Paulo wrote:
 On Dec 22, 2014, at 11:17, John Baldwin j...@freebsd.org wrote:
 
 On Monday, December 22, 2014 1:29:38 pm Rui Paulo wrote:
 On Dec 22, 2014, at 06:40, John Baldwin j...@freebsd.org wrote:
 Is there something specific to core dumps that makes vn_fullpath() more
 useful to have working before a process tries to open the core?  (As
 compared to other newly-created files)
 
 Yes: the ability to provide the full path to userland when a core dump 
 file 
 is generated.
 
 Can you be more specific?  Are we printing the path on the console after
 destroying the generated path?  Is it being written into a note in the core
 itself (but only having the vnode of the core file available and not the 
 generated path)?
 
 No.  I have some code that calls devctl_notify() when a core dump is 
 generated which is useful for running an automated debugging session.  We 
 use this at work and I'll see if I can upstream it.  What Konstantin fixed 
 was the generation of the cache entry in the corefile_open() routine.  This 
 lets me call vn_fullpath() after vn_close() with a high probability that it 
 will work whereas, in the past, it was never in the cache, so vn_fullpath() 
 would always fail.
 
 What is not entirely clear to me is why we need to recover the path from the
 vnode if we, obviously, have the path even before we have the vnode.

Using the default setting for core files, it's based on the CWD of the process. 
 If you're using a different kern.corefile setting, it's different.  You will 
also need to account for the %N format string (check the code for indexpos).  
Given that this is far from being a hot path, it's much easier to just do a 
vn_fullpath() on the vnode than to deal with all the other details. 

--
Rui Paulo



___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org