Re: svn commit: r263755 - head/sys/kern

2014-03-28 Thread David Xu

On 2014/03/28 06:31, Don Lewis wrote:

On 27 Mar, Konstantin Belousov wrote:

On Thu, Mar 27, 2014 at 04:05:12PM +0100, Mateusz Guzik wrote:

On Thu, Mar 27, 2014 at 03:58:19PM +0100, Mateusz Guzik wrote:

On Thu, Mar 27, 2014 at 04:46:57PM +0800, David Xu wrote:

On 2014/03/27 16:37, Mateusz Guzik wrote:

On Thu, Mar 27, 2014 at 03:45:17PM +0800, David Xu wrote:

I think the async process pointer can be cleared when a process exits
by registering an event handler. please see attached patch.



Sure, but I'm not very fond of this solution.

This is a rather obscure bug you wont hit unless you explicitly try,
and even then you need root privs by default.


OK, but I don't like the bug exists in kernel. It is not obscure for me,
I can run shutdown now command, and insert a device, and then the
kernel will write garbage data into freed memory space.



Not sure what you mean. devd does not use this feature, and even if it
did async_proc is cleared on close, which happens while signal delivery
is still legal.

That said, you are not going to encounter this bug unless you code
something up to specifically trigger it.

fwiw, I think we could axe this feature if there was no way to fix it
without introducing a check for every process.


As such writing a callback function which will be executed for all exiting
processes seems unjustified for me.

Ideally we would get some mechanism which would allow to register
callbacks for events related to given entity. Then it could be used to
provide a call this function when process p exits, amongst other things.



Yes, but the callback itself is cheap enough and is not worth to be
per-entity entry.



There is other code in the kernel which would benefit from such
functionality - dev/syscons/scmouse, dev/vt/vt_core.c, aio and possibly
more.

As such I think this is worth pursuing.



We can hack around this one the way the other code is doing - apart from
from proc pointer you store pid and then compare result of pfind(pid).

This is still buggy as both proc and pid pointer can be recycled and end
up being the same (but you have an entrirely new process).

However, then in absolutely worst cae you send SIGIO to incorrect
process, always an existing process so no more corruption.

Would you be ok with such hack for the time being?


Isn't p_sigiolist and fsetown(9) already provide the neccessary registration
and cleanup on the process exit ?  The KPI might require some generalization,
but I think that the mechanism itself is enough.


That's the correct mechanism, but it's not being used here.

Something like the following untested patch should do the trick:

Index: sys/kern/subr_bus.c
===
--- sys/kern/subr_bus.c (revision 263289)
+++ sys/kern/subr_bus.c (working copy)
@@ -402,7 +402,7 @@
struct cv cv;
struct selinfo sel;
struct devq devq;
-   struct proc *async_proc;
+   struct sigio *sigio;
  } devsoftc;

  static struct cdev *devctl_dev;
@@ -425,7 +425,7 @@
/* move to init */
devsoftc.inuse = 1;
devsoftc.nonblock = 0;
-   devsoftc.async_proc = NULL;
+   funsetown(devsoftc.sigio);
return (0);
  }

@@ -436,7 +436,7 @@
mtx_lock(devsoftc.mtx);
cv_broadcast(devsoftc.cv);
mtx_unlock(devsoftc.mtx);
-   devsoftc.async_proc = NULL;
+   funsetown(devsoftc.sigio);
return (0);
  }

@@ -492,9 +492,8 @@
return (0);
case FIOASYNC:
if (*(int*)data)
-   devsoftc.async_proc = td-td_proc;
-   else
-   devsoftc.async_proc = NULL;
+   return (fsetown(td-td_proc-p_pid, devsoftc.sigio));
+   funsetown(devsoftc.sigio);
return (0);

/* (un)Support for other fcntl() calls. */
@@ -546,7 +545,6 @@
  devctl_queue_data_f(char *data, int flags)
  {
struct dev_event_info *n1 = NULL, *n2 = NULL;
-   struct proc *p;

if (strlen(data) == 0)
goto out;
@@ -576,12 +574,8 @@
cv_broadcast(devsoftc.cv);
mtx_unlock(devsoftc.mtx);
selwakeup(devsoftc.sel);
-   p = devsoftc.async_proc;
-   if (p != NULL) {
-   PROC_LOCK(p);
-   kern_psignal(p, SIGIO);
-   PROC_UNLOCK(p);
-   }
+   if (devsoftc.sigio != NULL)
+   pgsigio(devsoftc.sigio, SIGIO, 0);
return;
  out:
/*



I have tweaked it a bit, is this okay ?

# HG changeset patch
# Parent 53b614ff2cae108f27e4475989d3a86997017268

diff -r 53b614ff2cae sys/kern/subr_bus.c
--- a/sys/kern/subr_bus.c   Thu Mar 27 10:03:50 2014 +0800
+++ b/sys/kern/subr_bus.c   Fri Mar 28 14:22:29 2014 +0800
@@ -391,11 +391,12 @@
int inuse;
int nonblock;
int queued;
+   int async;
struct mtx mtx;
struct cv cv;
struct selinfo sel;
struct devq 

Re: svn commit: r263346 - in head: etc/mtree tools/build/mk tools/regression/usr.bin/make usr.bin/make usr.bin/make/tests usr.bin/make/tests/archives/fmt_44bsd usr.bin/make/tests/archives/fmt_44bsd_mo

2014-03-28 Thread Julio Merino
On Wed, Mar 26, 2014 at 12:25 AM, Dag-Erling Smørgrav d...@des.no wrote:
 Julio Merino j...@freebsd.org writes:
 Log:
   Migrate tools/regression/usr.bin/make/ to the new tests layout.

   Note that these tests are for fmake, not bmake, and thus they are not
   installed nor run when bmake is selected (the default).  Yes, I have
   wasted a *ton* of time on moving tests for no real reason other than
   ensuring they are not left behind.

   But maybe, just maybe, it was not work in vain: the majority of these
   tests also work with bmake and the few that don't may point at broken
   stuff.  For example, the tests for the archive feature do not work
   with bmake, but bmake's manpage and source tree seem to imply that they
   should.  So... to be investigated later; need to poke sjg@.

 This, or a subsequent but related commit, broke the WITHOUT_BMAKE build:

Apologies for not having gotten to this yet. Will try to deal with it
during the weekend or next week when I'm back home. (Still traveling
after AsiaBSDCon and been focusing on fixing some other issues in the
testing cluster.)

In the meantime: could someone enlighten me as to why !bmake is still supported?

Thanks!
___
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: r263869 - stable/10/sys/dev/amdtemp

2014-03-28 Thread Christian Brueffer
Author: brueffer
Date: Fri Mar 28 08:55:34 2014
New Revision: 263869
URL: http://svnweb.freebsd.org/changeset/base/263869

Log:
  MFC: r263169
  
  Add support for AMD Family 16h (Kabini) sensor devices.
  
  PR:   186587
  Submitted by: David Rufino david.rufino at gmail.com

Modified:
  stable/10/sys/dev/amdtemp/amdtemp.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/amdtemp/amdtemp.c
==
--- stable/10/sys/dev/amdtemp/amdtemp.c Fri Mar 28 08:23:39 2014
(r263868)
+++ stable/10/sys/dev/amdtemp/amdtemp.c Fri Mar 28 08:55:34 2014
(r263869)
@@ -79,6 +79,7 @@ struct amdtemp_softc {
 #defineDEVICEID_AMD_MISC12 0x1403
 #defineDEVICEID_AMD_MISC14 0x1703
 #defineDEVICEID_AMD_MISC15 0x1603
+#defineDEVICEID_AMD_MISC16 0x1533
 
 static struct amdtemp_product {
uint16_tamdtemp_vendorid;
@@ -90,6 +91,7 @@ static struct amdtemp_product {
{ VENDORID_AMD, DEVICEID_AMD_MISC12 },
{ VENDORID_AMD, DEVICEID_AMD_MISC14 },
{ VENDORID_AMD, DEVICEID_AMD_MISC15 },
+   { VENDORID_AMD, DEVICEID_AMD_MISC16 },
{ 0, 0 }
 };
 
@@ -204,6 +206,7 @@ amdtemp_probe(device_t dev)
case 0x12:
case 0x14:
case 0x15:
+   case 0x16:
break;
default:
return (ENXIO);
@@ -327,6 +330,7 @@ amdtemp_attach(device_t dev)
case 0x12:
case 0x14:
case 0x15:
+   case 0x16:
/*
 * There is only one sensor per package.
 */
___
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: r263870 - stable/9/sys/dev/amdtemp

2014-03-28 Thread Christian Brueffer
Author: brueffer
Date: Fri Mar 28 08:58:51 2014
New Revision: 263870
URL: http://svnweb.freebsd.org/changeset/base/263870

Log:
  MFC: r263169
  
  Add support for AMD Family 16h (Kabini) sensor devices.
  
  PR: 186587
  Submitted by:   David Rufino david.rufino at gmail.com

Modified:
  stable/9/sys/dev/amdtemp/amdtemp.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/amdtemp/amdtemp.c
==
--- stable/9/sys/dev/amdtemp/amdtemp.c  Fri Mar 28 08:55:34 2014
(r263869)
+++ stable/9/sys/dev/amdtemp/amdtemp.c  Fri Mar 28 08:58:51 2014
(r263870)
@@ -76,6 +76,7 @@ struct amdtemp_softc {
 #defineDEVICEID_AMD_MISC0F 0x1103
 #defineDEVICEID_AMD_MISC10 0x1203
 #defineDEVICEID_AMD_MISC11 0x1303
+#defineDEVICEID_AMD_MISC16 0x1533
 
 static struct amdtemp_product {
uint16_tamdtemp_vendorid;
@@ -84,6 +85,7 @@ static struct amdtemp_product {
{ VENDORID_AMD, DEVICEID_AMD_MISC0F },
{ VENDORID_AMD, DEVICEID_AMD_MISC10 },
{ VENDORID_AMD, DEVICEID_AMD_MISC11 },
+   { VENDORID_AMD, DEVICEID_AMD_MISC16 },
{ 0, 0 }
 };
 
@@ -189,6 +191,7 @@ amdtemp_probe(device_t dev)
break;
case 0x10:
case 0x11:
+   case 0x16:
break;
default:
return (ENXIO);
@@ -274,6 +277,7 @@ amdtemp_attach(device_t dev)
break;
case 0x10:
case 0x11:
+   case 0x16:
/*
 * There is only one sensor per package.
 */
___
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: r263872 - head/sys/ia64/ia64

2014-03-28 Thread Ed Maste
Author: emaste
Date: Fri Mar 28 11:46:54 2014
New Revision: 263872
URL: http://svnweb.freebsd.org/changeset/base/263872

Log:
  Fix missed efi.h header change in r263815
  
  Pointy hat to:emaste

Modified:
  head/sys/ia64/ia64/mem.c

Modified: head/sys/ia64/ia64/mem.c
==
--- head/sys/ia64/ia64/mem.cFri Mar 28 10:06:14 2014(r263871)
+++ head/sys/ia64/ia64/mem.cFri Mar 28 11:46:54 2014(r263872)
@@ -45,13 +45,13 @@ __FBSDID($FreeBSD$);
 
 #include sys/param.h
 #include sys/conf.h
+#include sys/efi.h
 #include sys/fcntl.h
 #include sys/kernel.h
 #include sys/malloc.h
 #include sys/memrange.h
 #include sys/systm.h
 #include sys/uio.h
-#include machine/efi.h
 
 #include vm/vm.h
 #include vm/pmap.h
___
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: r263873 - head/sys/conf

2014-03-28 Thread Aleksandr Rybalko
Author: ray
Date: Fri Mar 28 12:50:39 2014
New Revision: 263873
URL: http://svnweb.freebsd.org/changeset/base/263873

Log:
  Enable to build UEFI framebuffer driver for vt(4).
  It can be enabled by device vt_efifb in kernel config.
  
  Requested by: emaste
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==
--- head/sys/conf/files Fri Mar 28 11:46:54 2014(r263872)
+++ head/sys/conf/files Fri Mar 28 12:50:39 2014(r263873)
@@ -2471,6 +2471,7 @@ dev/vr/if_vr.coptional vr pci
 dev/vt/colors/vt_termcolors.c  optional vt
 dev/vt/font/vt_font_default.c  optional vt
 dev/vt/font/vt_mouse_cursor.c  optional vt
+dev/vt/hw/efifb/efifb.coptional vt_efifb
 dev/vt/hw/fb/vt_fb.c   optional vt
 dev/vt/hw/vga/vga.coptional vt vt_vga
 dev/vt/logo/logo_freebsd.c optional vt splash
___
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: r263875 - in stable/10/sys: amd64/amd64 amd64/include kern sys vm

2014-03-28 Thread Konstantin Belousov
Author: kib
Date: Fri Mar 28 15:38:38 2014
New Revision: 263875
URL: http://svnweb.freebsd.org/changeset/base/263875

Log:
  MFC r263475:
  Fix two issues with /dev/mem access on amd64, both causing kernel page
  faults.
  
  First, for accesses to direct map region should check for the limit by
  which direct map is instantiated.
  
  Second, for accesses to the kernel map, use a new thread private flag
  TDP_DEVMEMIO, which instructs vm_fault() to return error when fault
  happens on the MAP_ENTRY_NOFAULT entry, instead of panicing.
  
  MFC r263498:
  Add change forgotten in r263475.  Make dmaplimit accessible outside
  amd64/pmap.c.

Modified:
  stable/10/sys/amd64/amd64/mem.c
  stable/10/sys/amd64/amd64/pmap.c
  stable/10/sys/amd64/amd64/trap.c
  stable/10/sys/amd64/include/pmap.h
  stable/10/sys/kern/subr_trap.c
  stable/10/sys/sys/proc.h
  stable/10/sys/vm/vm_fault.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/amd64/amd64/mem.c
==
--- stable/10/sys/amd64/amd64/mem.c Fri Mar 28 15:09:35 2014
(r263874)
+++ stable/10/sys/amd64/amd64/mem.c Fri Mar 28 15:38:38 2014
(r263875)
@@ -76,14 +76,16 @@ MALLOC_DEFINE(M_MEMDESC, memdesc, mem
 int
 memrw(struct cdev *dev, struct uio *uio, int flags)
 {
-   int o;
-   u_long c = 0, v;
struct iovec *iov;
-   int error = 0;
+   u_long c, v;
+   int error, o, sflags;
vm_offset_t addr, eaddr;
 
GIANT_REQUIRED;
 
+   error = 0;
+   c = 0;
+   sflags = curthread_pflags_set(TDP_DEVMEMIO);
while (uio-uio_resid  0  error == 0) {
iov = uio-uio_iov;
if (iov-iov_len == 0) {
@@ -98,7 +100,15 @@ memrw(struct cdev *dev, struct uio *uio,
 kmemphys:
o = v  PAGE_MASK;
c = min(uio-uio_resid, (u_int)(PAGE_SIZE - o));
-   error = uiomove((void *)PHYS_TO_DMAP(v), (int)c, uio);
+   v = PHYS_TO_DMAP(v);
+   if (v  DMAP_MIN_ADDRESS ||
+   (v  DMAP_MIN_ADDRESS + dmaplimit 
+   v = DMAP_MAX_ADDRESS) ||
+   pmap_kextract(v) == 0) {
+   error = EFAULT;
+   goto ret;
+   }
+   error = uiomove((void *)v, (int)c, uio);
continue;
}
else if (dev2unit(dev) == CDEV_MINOR_KMEM) {
@@ -119,22 +129,30 @@ kmemphys:
addr = trunc_page(v);
eaddr = round_page(v + c);
 
-   if (addr  VM_MIN_KERNEL_ADDRESS)
-   return (EFAULT);
-   for (; addr  eaddr; addr += PAGE_SIZE) 
-   if (pmap_extract(kernel_pmap, addr) == 0)
-   return (EFAULT);
-
+   if (addr  VM_MIN_KERNEL_ADDRESS) {
+   error = EFAULT;
+   goto ret;
+   }
+   for (; addr  eaddr; addr += PAGE_SIZE) {
+   if (pmap_extract(kernel_pmap, addr) == 0) {
+   error = EFAULT;
+   goto ret;
+   }
+   }
if (!kernacc((caddr_t)(long)v, c,
uio-uio_rw == UIO_READ ? 
-   VM_PROT_READ : VM_PROT_WRITE))
-   return (EFAULT);
+   VM_PROT_READ : VM_PROT_WRITE)) {
+   error = EFAULT;
+   goto ret;
+   }
 
error = uiomove((caddr_t)(long)v, (int)c, uio);
continue;
}
/* else panic! */
}
+ret:
+   curthread_pflags_restore(sflags);
return (error);
 }
 

Modified: stable/10/sys/amd64/amd64/pmap.c
==
--- stable/10/sys/amd64/amd64/pmap.cFri Mar 28 15:09:35 2014
(r263874)
+++ stable/10/sys/amd64/amd64/pmap.cFri Mar 28 15:38:38 2014
(r263875)
@@ -321,7 +321,7 @@ SYSCTL_INT(_machdep, OID_AUTO, nkpt, CTL
 Number of kernel page table pages allocated on bootup);
 
 static int ndmpdp;
-static vm_paddr_t dmaplimit;
+vm_paddr_t dmaplimit;
 vm_offset_t kernel_vm_end = VM_MIN_KERNEL_ADDRESS;
 pt_entry_t pg_nx;
 

Modified: stable/10/sys/amd64/amd64/trap.c
==
--- stable/10/sys/amd64/amd64/trap.cFri Mar 28 15:09:35 2014
(r263874)
+++ stable/10/sys/amd64/amd64/trap.cFri Mar 28 15:38:38 2014
(r263875)
@@ -788,6 

svn commit: r263876 - in stable/9/sys: amd64/amd64 amd64/include kern sys vm

2014-03-28 Thread Konstantin Belousov
Author: kib
Date: Fri Mar 28 15:38:54 2014
New Revision: 263876
URL: http://svnweb.freebsd.org/changeset/base/263876

Log:
  MFC r263475:
  Fix two issues with /dev/mem access on amd64, both causing kernel page
  faults.
  
  First, for accesses to direct map region should check for the limit by
  which direct map is instantiated.
  
  Second, for accesses to the kernel map, use a new thread private flag
  TDP_DEVMEMIO, which instructs vm_fault() to return error when fault
  happens on the MAP_ENTRY_NOFAULT entry, instead of panicing.
  
  MFC r263498:
  Add change forgotten in r263475.  Make dmaplimit accessible outside
  amd64/pmap.c.

Modified:
  stable/9/sys/amd64/amd64/mem.c
  stable/9/sys/amd64/amd64/pmap.c
  stable/9/sys/amd64/amd64/trap.c
  stable/9/sys/amd64/include/pmap.h
  stable/9/sys/kern/subr_trap.c
  stable/9/sys/sys/proc.h
  stable/9/sys/vm/vm_fault.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/sys/   (props changed)

Modified: stable/9/sys/amd64/amd64/mem.c
==
--- stable/9/sys/amd64/amd64/mem.c  Fri Mar 28 15:38:38 2014
(r263875)
+++ stable/9/sys/amd64/amd64/mem.c  Fri Mar 28 15:38:54 2014
(r263876)
@@ -76,14 +76,16 @@ MALLOC_DEFINE(M_MEMDESC, memdesc, mem
 int
 memrw(struct cdev *dev, struct uio *uio, int flags)
 {
-   int o;
-   u_long c = 0, v;
struct iovec *iov;
-   int error = 0;
+   u_long c, v;
+   int error, o, sflags;
vm_offset_t addr, eaddr;
 
GIANT_REQUIRED;
 
+   error = 0;
+   c = 0;
+   sflags = curthread_pflags_set(TDP_DEVMEMIO);
while (uio-uio_resid  0  error == 0) {
iov = uio-uio_iov;
if (iov-iov_len == 0) {
@@ -98,7 +100,15 @@ memrw(struct cdev *dev, struct uio *uio,
 kmemphys:
o = v  PAGE_MASK;
c = min(uio-uio_resid, (u_int)(PAGE_SIZE - o));
-   error = uiomove((void *)PHYS_TO_DMAP(v), (int)c, uio);
+   v = PHYS_TO_DMAP(v);
+   if (v  DMAP_MIN_ADDRESS ||
+   (v  DMAP_MIN_ADDRESS + dmaplimit 
+   v = DMAP_MAX_ADDRESS) ||
+   pmap_kextract(v) == 0) {
+   error = EFAULT;
+   goto ret;
+   }
+   error = uiomove((void *)v, (int)c, uio);
continue;
}
else if (dev2unit(dev) == CDEV_MINOR_KMEM) {
@@ -119,22 +129,30 @@ kmemphys:
addr = trunc_page(v);
eaddr = round_page(v + c);
 
-   if (addr  VM_MIN_KERNEL_ADDRESS)
-   return (EFAULT);
-   for (; addr  eaddr; addr += PAGE_SIZE) 
-   if (pmap_extract(kernel_pmap, addr) == 0)
-   return (EFAULT);
-
+   if (addr  VM_MIN_KERNEL_ADDRESS) {
+   error = EFAULT;
+   goto ret;
+   }
+   for (; addr  eaddr; addr += PAGE_SIZE) {
+   if (pmap_extract(kernel_pmap, addr) == 0) {
+   error = EFAULT;
+   goto ret;
+   }
+   }
if (!kernacc((caddr_t)(long)v, c,
uio-uio_rw == UIO_READ ? 
-   VM_PROT_READ : VM_PROT_WRITE))
-   return (EFAULT);
+   VM_PROT_READ : VM_PROT_WRITE)) {
+   error = EFAULT;
+   goto ret;
+   }
 
error = uiomove((caddr_t)(long)v, (int)c, uio);
continue;
}
/* else panic! */
}
+ret:
+   curthread_pflags_restore(sflags);
return (error);
 }
 

Modified: stable/9/sys/amd64/amd64/pmap.c
==
--- stable/9/sys/amd64/amd64/pmap.c Fri Mar 28 15:38:38 2014
(r263875)
+++ stable/9/sys/amd64/amd64/pmap.c Fri Mar 28 15:38:54 2014
(r263876)
@@ -210,7 +210,7 @@ vm_offset_t virtual_avail;  /* VA of firs
 vm_offset_t virtual_end;   /* VA of last avail page (end of kernel AS) */
 
 static int ndmpdp;
-static vm_paddr_t dmaplimit;
+vm_paddr_t dmaplimit;
 vm_offset_t kernel_vm_end = VM_MIN_KERNEL_ADDRESS;
 pt_entry_t pg_nx;
 

Modified: stable/9/sys/amd64/amd64/trap.c
==
--- stable/9/sys/amd64/amd64/trap.c Fri Mar 28 15:38:38 2014
(r263875)
+++ stable/9/sys/amd64/amd64/trap.c 

svn commit: r263877 - stable/9/cddl/contrib/opensolaris/lib/libuutil/common

2014-03-28 Thread Alan Somers
Author: asomers
Date: Fri Mar 28 15:41:04 2014
New Revision: 263877
URL: http://svnweb.freebsd.org/changeset/base/263877

Log:
  MFC r262912
  
  cddl/contrib/opensolaris/lib/libuutil/common/uu_avl.c
Fix a memory leak in uu_avl_pool_create: pthread_mutex_init without
a corresponding pthread_mutex_destroy.  It shows up, among other
places, when doing zfs list

Modified:
  stable/9/cddl/contrib/opensolaris/lib/libuutil/common/uu_avl.c
Directory Properties:
  stable/9/   (props changed)
  stable/9/cddl/   (props changed)
  stable/9/cddl/contrib/   (props changed)
  stable/9/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/cddl/contrib/opensolaris/lib/libuutil/common/uu_avl.c
==
--- stable/9/cddl/contrib/opensolaris/lib/libuutil/common/uu_avl.c  Fri Mar 
28 15:38:54 2014(r263876)
+++ stable/9/cddl/contrib/opensolaris/lib/libuutil/common/uu_avl.c  Fri Mar 
28 15:41:04 2014(r263877)
@@ -128,6 +128,7 @@ uu_avl_pool_destroy(uu_avl_pool_t *pp)
pp-uap_next-uap_prev = pp-uap_prev;
pp-uap_prev-uap_next = pp-uap_next;
(void) pthread_mutex_unlock(uu_apool_list_lock);
+   (void) pthread_mutex_destroy(pp-uap_lock);
pp-uap_prev = NULL;
pp-uap_next = NULL;
uu_free(pp);
___
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: r263755 - head/sys/kern

2014-03-28 Thread Don Lewis
On 28 Mar, David Xu wrote:
 On 2014/03/28 06:31, Don Lewis wrote:
 On 27 Mar, Konstantin Belousov wrote:
 On Thu, Mar 27, 2014 at 04:05:12PM +0100, Mateusz Guzik wrote:
 On Thu, Mar 27, 2014 at 03:58:19PM +0100, Mateusz Guzik wrote:
 On Thu, Mar 27, 2014 at 04:46:57PM +0800, David Xu wrote:
 On 2014/03/27 16:37, Mateusz Guzik wrote:
 On Thu, Mar 27, 2014 at 03:45:17PM +0800, David Xu wrote:
 I think the async process pointer can be cleared when a process exits
 by registering an event handler. please see attached patch.


 Sure, but I'm not very fond of this solution.

 This is a rather obscure bug you wont hit unless you explicitly try,
 and even then you need root privs by default.

 OK, but I don't like the bug exists in kernel. It is not obscure for me,
 I can run shutdown now command, and insert a device, and then the
 kernel will write garbage data into freed memory space.


 Not sure what you mean. devd does not use this feature, and even if it
 did async_proc is cleared on close, which happens while signal delivery
 is still legal.

 That said, you are not going to encounter this bug unless you code
 something up to specifically trigger it.

 fwiw, I think we could axe this feature if there was no way to fix it
 without introducing a check for every process.

 As such writing a callback function which will be executed for all 
 exiting
 processes seems unjustified for me.

 Ideally we would get some mechanism which would allow to register
 callbacks for events related to given entity. Then it could be used to
 provide a call this function when process p exits, amongst other 
 things.


 Yes, but the callback itself is cheap enough and is not worth to be
 per-entity entry.


 There is other code in the kernel which would benefit from such
 functionality - dev/syscons/scmouse, dev/vt/vt_core.c, aio and possibly
 more.

 As such I think this is worth pursuing.


 We can hack around this one the way the other code is doing - apart from
 from proc pointer you store pid and then compare result of pfind(pid).

 This is still buggy as both proc and pid pointer can be recycled and end
 up being the same (but you have an entrirely new process).

 However, then in absolutely worst cae you send SIGIO to incorrect
 process, always an existing process so no more corruption.

 Would you be ok with such hack for the time being?

 Isn't p_sigiolist and fsetown(9) already provide the neccessary registration
 and cleanup on the process exit ?  The KPI might require some 
 generalization,
 but I think that the mechanism itself is enough.

 That's the correct mechanism, but it's not being used here.

 Something like the following untested patch should do the trick:

 Index: sys/kern/subr_bus.c
 ===
 --- sys/kern/subr_bus.c  (revision 263289)
 +++ sys/kern/subr_bus.c  (working copy)
 @@ -402,7 +402,7 @@
  struct cv cv;
  struct selinfo sel;
  struct devq devq;
 -struct proc *async_proc;
 +struct sigio *sigio;
   } devsoftc;

   static struct cdev *devctl_dev;
 @@ -425,7 +425,7 @@
  /* move to init */
  devsoftc.inuse = 1;
  devsoftc.nonblock = 0;
 -devsoftc.async_proc = NULL;
 +funsetown(devsoftc.sigio);
  return (0);
   }

 @@ -436,7 +436,7 @@
  mtx_lock(devsoftc.mtx);
  cv_broadcast(devsoftc.cv);
  mtx_unlock(devsoftc.mtx);
 -devsoftc.async_proc = NULL;
 +funsetown(devsoftc.sigio);
  return (0);
   }

 @@ -492,9 +492,8 @@
  return (0);
  case FIOASYNC:
  if (*(int*)data)
 -devsoftc.async_proc = td-td_proc;
 -else
 -devsoftc.async_proc = NULL;
 +return (fsetown(td-td_proc-p_pid, devsoftc.sigio));
 +funsetown(devsoftc.sigio);
  return (0);

  /* (un)Support for other fcntl() calls. */
 @@ -546,7 +545,6 @@
   devctl_queue_data_f(char *data, int flags)
   {
  struct dev_event_info *n1 = NULL, *n2 = NULL;
 -struct proc *p;

  if (strlen(data) == 0)
  goto out;
 @@ -576,12 +574,8 @@
  cv_broadcast(devsoftc.cv);
  mtx_unlock(devsoftc.mtx);
  selwakeup(devsoftc.sel);
 -p = devsoftc.async_proc;
 -if (p != NULL) {
 -PROC_LOCK(p);
 -kern_psignal(p, SIGIO);
 -PROC_UNLOCK(p);
 -}
 +if (devsoftc.sigio != NULL)
 +pgsigio(devsoftc.sigio, SIGIO, 0);
  return;
   out:
  /*


 I have tweaked it a bit, is this okay ?
 
 # HG changeset patch
 # Parent 53b614ff2cae108f27e4475989d3a86997017268
 
 diff -r 53b614ff2cae sys/kern/subr_bus.c
 --- a/sys/kern/subr_bus.c Thu Mar 27 10:03:50 2014 +0800
 +++ b/sys/kern/subr_bus.c Fri Mar 28 14:22:29 2014 +0800
 @@ -391,11 +391,12 @@
   int inuse;
   int nonblock;
   int queued;
 + int async;
   struct mtx mtx;
   struct cv cv;
   struct selinfo sel;
   struct devq 

svn commit: r263881 - head

2014-03-28 Thread Warner Losh
Author: imp
Date: Fri Mar 28 16:31:12 2014
New Revision: 263881
URL: http://svnweb.freebsd.org/changeset/base/263881

Log:
  Only set XDDESTDIR if it wasn't already set to allow people to
  override it.

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Fri Mar 28 16:27:48 2014(r263880)
+++ head/Makefile.inc1  Fri Mar 28 16:31:12 2014(r263881)
@@ -1899,7 +1899,7 @@ CD2ENV=${CDENV} CC=${CC} ${CD2CFLAGS} 
 CDTMP= ${MAKEOBJDIRPREFIX}/${XDDIR}/${.CURDIR}/tmp
 CDMAKE=${CDENV} PATH=${CDTMP}/usr/bin:${PATH} ${MAKE} ${NOFUN}
 CD2MAKE=${CD2ENV} PATH=${CDTMP}/usr/bin:${XDDESTDIR}/usr/bin:${PATH} ${MAKE} 
${NOFUN}
-XDDESTDIR=${DESTDIR}/${XDTP}
+XDDESTDIR?=${DESTDIR}/${XDTP}
 .if !defined(OSREL)
 OSREL!= uname -r | sed -e 's/[-(].*//'
 .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: r263880 - stable/10/sbin/devd

2014-03-28 Thread Alan Somers
Author: asomers
Date: Fri Mar 28 16:27:48 2014
New Revision: 263880
URL: http://svnweb.freebsd.org/changeset/base/263880

Log:
  MFC r262914
  
  sbin/devd/devd.8
  sbin/devd/devd.cc
Add a -q flag to devd that will suppress syslog logging at
LOG_NOTICE or below.

Modified:
  stable/10/sbin/devd/devd.8
  stable/10/sbin/devd/devd.cc
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sbin/devd/devd.8
==
--- stable/10/sbin/devd/devd.8  Fri Mar 28 16:11:20 2014(r263879)
+++ stable/10/sbin/devd/devd.8  Fri Mar 28 16:27:48 2014(r263880)
@@ -33,7 +33,7 @@
 .Nd device state change daemon
 .Sh SYNOPSIS
 .Nm
-.Op Fl dn
+.Op Fl dnq
 .Op Fl f Ar file
 .Op Fl l Ar num
 .Sh DESCRIPTION
@@ -63,6 +63,8 @@ The default connection limit is 10.
 .It Fl n
 Do not process all pending events before becoming a daemon.
 Instead, call daemon right away.
+.It Fl q
+Quiet mode.  Only log messages at priority LOG_WARNING or above.
 .El
 .Sh IMPLEMENTATION NOTES
 The

Modified: stable/10/sbin/devd/devd.cc
==
--- stable/10/sbin/devd/devd.cc Fri Mar 28 16:11:20 2014(r263879)
+++ stable/10/sbin/devd/devd.cc Fri Mar 28 16:27:48 2014(r263880)
@@ -129,8 +129,9 @@ static const char detach = '-';
 
 static struct pidfh *pfh;
 
-int dflag;
-int nflag;
+static int no_daemon = 0;
+static int daemonize_quick = 0;
+static int quiet_mode = 0;
 static unsigned total_events = 0;
 static volatile sig_atomic_t got_siginfo = 0;
 static volatile sig_atomic_t romeo_must_die = 0;
@@ -291,7 +292,7 @@ match::do_match(config c)
 * can consume excessive amounts of systime inside of connect().  Only
 * log when we're in -d mode.
 */
-   if (dflag) {
+   if (no_daemon) {
devdlog(LOG_DEBUG, Testing %s=%s against %s, invert=%d\n,
_var.c_str(), value.c_str(), _re.c_str(), _inv);
}
@@ -401,7 +402,7 @@ var_list::set_variable(const string var
 * can consume excessive amounts of systime inside of connect().  Only
 * log when we're in -d mode.
 */
-   if (dflag)
+   if (no_daemon)
devdlog(LOG_DEBUG, setting %s=%s\n, var.c_str(), val.c_str());
_vars[var] = val;
 }
@@ -945,7 +946,7 @@ event_loop(void)
accepting = 1;
max_fd = max(fd, server_fd) + 1;
while (!romeo_must_die) {
-   if (!once  !dflag  !nflag) {
+   if (!once  !no_daemon  !daemonize_quick) {
// Check to see if we have any events pending.
tv.tv_sec = 0;
tv.tv_usec = 0;
@@ -1139,9 +1140,9 @@ devdlog(int priority, const char* fmt, .
va_list argp;
 
va_start(argp, fmt);
-   if (dflag)
+   if (no_daemon)
vfprintf(stderr, fmt, argp);
-   else
+   else if ((! quiet_mode) || (priority = LOG_WARNING))
vsyslog(priority, fmt, argp);
va_end(argp);
 }
@@ -1149,7 +1150,7 @@ devdlog(int priority, const char* fmt, .
 static void
 usage()
 {
-   fprintf(stderr, usage: %s [-dn] [-l connlimit] [-f file]\n,
+   fprintf(stderr, usage: %s [-dnq] [-l connlimit] [-f file]\n,
getprogname());
exit(1);
 }
@@ -1179,10 +1180,10 @@ main(int argc, char **argv)
int ch;
 
check_devd_enabled();
-   while ((ch = getopt(argc, argv, df:l:n)) != -1) {
+   while ((ch = getopt(argc, argv, df:l:nq)) != -1) {
switch (ch) {
case 'd':
-   dflag++;
+   no_daemon = 1;
break;
case 'f':
configfile = optarg;
@@ -1191,7 +1192,10 @@ main(int argc, char **argv)
max_clients = MAX(1, strtoul(optarg, NULL, 0));
break;
case 'n':
-   nflag++;
+   daemonize_quick = 1;
+   break;
+   case 'q':
+   quiet_mode = 1;
break;
default:
usage();
@@ -1199,7 +1203,7 @@ main(int argc, char **argv)
}
 
cfg.parse();
-   if (!dflag  nflag) {
+   if (!no_daemon  daemonize_quick) {
cfg.open_pidfile();
daemon(0, 0);
cfg.write_pidfile();
___
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: r263879 - head/usr.bin/kdump

2014-03-28 Thread Bryan Drewery
Author: bdrewery
Date: Fri Mar 28 16:11:20 2014
New Revision: 263879
URL: http://svnweb.freebsd.org/changeset/base/263879

Log:
  Add `-S' to display syscall numbers in the output as well.
  
  This is useful for debugging compat modules.
  
  Sponsored by: EMC / Isilon Storage Division
  Obtained from:Isilon OneFS (based on work by Jeff Hughes)
  MFC after:2 weeks

Modified:
  head/usr.bin/kdump/kdump.1
  head/usr.bin/kdump/kdump.c

Modified: head/usr.bin/kdump/kdump.1
==
--- head/usr.bin/kdump/kdump.1  Fri Mar 28 16:07:27 2014(r263878)
+++ head/usr.bin/kdump/kdump.1  Fri Mar 28 16:11:20 2014(r263879)
@@ -28,7 +28,7 @@
 .\@(#)kdump.1 8.1 (Berkeley) 6/6/93
 .\ $FreeBSD$
 .\
-.Dd June 4, 2012
+.Dd March 28, 2014
 .Dt KDUMP 1
 .Os
 .Sh NAME
@@ -36,7 +36,7 @@
 .Nd display kernel trace data
 .Sh SYNOPSIS
 .Nm
-.Op Fl dEnlHRsTA
+.Op Fl dEnlHRSsTA
 .Op Fl f Ar trfile
 .Op Fl m Ar maxdata
 .Op Fl p Ar pid
@@ -95,6 +95,8 @@ Display relative timestamps (time since 
 .It Fl r
 When decoding STRU records, display structure members such as UIDs,
 GIDs, dates etc. symbolically instead of numerically.
+.It Fl S
+Display system call numbers.
 .It Fl s
 Suppress display of I/O data.
 .It Fl T

Modified: head/usr.bin/kdump/kdump.c
==
--- head/usr.bin/kdump/kdump.c  Fri Mar 28 16:07:27 2014(r263878)
+++ head/usr.bin/kdump/kdump.c  Fri Mar 28 16:11:20 2014(r263879)
@@ -123,7 +123,7 @@ void ioctlname(unsigned long, int);
 #defineTIMESTAMP_RELATIVE  0x4
 
 int timestamp, decimal, fancy = 1, suppressdata, tail, threads, maxdata,
-resolv = 0, abiflag = 0;
+resolv = 0, abiflag = 0, syscallno = 0;
 const char *tracefile = DEF_TRACEFILE;
 struct ktr_header ktr_header;
 
@@ -261,7 +261,7 @@ main(int argc, char *argv[])
 
timestamp = TIMESTAMP_NONE;
 
-   while ((ch = getopt(argc,argv,f:dElm:np:AHRrsTt:)) != -1)
+   while ((ch = getopt(argc,argv,f:dElm:np:AHRrSsTt:)) != -1)
switch (ch) {
case 'A':
abiflag = 1;
@@ -287,6 +287,9 @@ main(int argc, char *argv[])
case 'r':
resolv = 1;
break;
+   case 'S':
+   syscallno = 1;
+   break;
case 's':
suppressdata = 1;
break;
@@ -678,8 +681,11 @@ ktrsyscall(struct ktr_syscall *ktr, u_in
if ((flags != 0  ((flags  SV_ABI_MASK) != SV_ABI_FREEBSD)) ||
(ktr-ktr_code = nsyscalls || ktr-ktr_code  0))
printf([%d], ktr-ktr_code);
-   else
+   else {
printf(%s, syscallnames[ktr-ktr_code]);
+   if (syscallno)
+   printf([%d], ktr-ktr_code);
+   }
ip = ktr-ktr_args[0];
if (narg) {
char c = '(';
@@ -1271,8 +1277,12 @@ ktrsysret(struct ktr_sysret *ktr, u_int 
if ((flags != 0  ((flags  SV_ABI_MASK) != SV_ABI_FREEBSD)) ||
(code = nsyscalls || code  0))
printf([%d] , code);
-   else
-   printf(%s , syscallnames[code]);
+   else {
+   printf(%s, syscallnames[code]);
+   if (syscallno)
+   printf([%d], code);
+   printf( );
+   }
 
if (error == 0) {
if (fancy) {
@@ -1910,8 +1920,11 @@ linux_ktrsyscall(struct ktr_syscall *ktr
 
if (ktr-ktr_code = nlinux_syscalls || ktr-ktr_code  0)
printf([%d], ktr-ktr_code);
-   else
+   else {
printf(%s, linux_syscallnames[ktr-ktr_code]);
+   if (syscallno)
+   printf([%d], ktr-ktr_code);
+   }
ip = ktr-ktr_args[0];
if (narg) {
char c = '(';
@@ -1931,8 +1944,12 @@ linux_ktrsysret(struct ktr_sysret *ktr)
 
if (code = nlinux_syscalls || code  0)
printf([%d] , code);
-   else
-   printf(%s , linux_syscallnames[code]);
+   else {
+   printf(%s, linux_syscallnames[code]);
+   if (syscallno)
+   printf([%d], code);
+   printf( );
+   }
 
if (error == 0) {
if (fancy) {
@@ -1965,7 +1982,7 @@ linux_ktrsysret(struct ktr_sysret *ktr)
 void
 usage(void)
 {
-   fprintf(stderr, usage: kdump [-dEnlHRrsTA] [-f trfile] 
+   fprintf(stderr, usage: kdump [-dEnlHRrSsTA] [-f trfile] 
[-m maxdata] [-p pid] [-t trstr]\n);
exit(1);
 }
___
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: r263878 - head/sys/amd64/amd64

2014-03-28 Thread Ed Maste
On 28 March 2014 12:07, Konstantin Belousov k...@freebsd.org wrote:
 Author: kib
 Date: Fri Mar 28 16:07:27 2014
 New Revision: 263878
 URL: http://svnweb.freebsd.org/changeset/base/263878

 Log:
   Several fixes for the PCID implementation:

I'd like to revert r262765 (where I disabled it by default) to get
broader testing on this; do you see any reason I should wait instead?

-Ed
___
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: r263874 - stable/10/cddl/contrib/opensolaris/lib/libuutil/common

2014-03-28 Thread Alan Somers
Author: asomers
Date: Fri Mar 28 15:09:35 2014
New Revision: 263874
URL: http://svnweb.freebsd.org/changeset/base/263874

Log:
  MFC r262912
  
  cddl/contrib/opensolaris/lib/libuutil/common/uu_avl.c
Fix a memory leak in uu_avl_pool_create: pthread_mutex_init without
a corresponding pthread_mutex_destroy.  It shows up, among other
places, when doing zfs list.

Modified:
  stable/10/cddl/contrib/opensolaris/lib/libuutil/common/uu_avl.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/cddl/contrib/opensolaris/lib/libuutil/common/uu_avl.c
==
--- stable/10/cddl/contrib/opensolaris/lib/libuutil/common/uu_avl.c Fri Mar 
28 12:50:39 2014(r263873)
+++ stable/10/cddl/contrib/opensolaris/lib/libuutil/common/uu_avl.c Fri Mar 
28 15:09:35 2014(r263874)
@@ -128,6 +128,7 @@ uu_avl_pool_destroy(uu_avl_pool_t *pp)
pp-uap_next-uap_prev = pp-uap_prev;
pp-uap_prev-uap_next = pp-uap_next;
(void) pthread_mutex_unlock(uu_apool_list_lock);
+   (void) pthread_mutex_destroy(pp-uap_lock);
pp-uap_prev = NULL;
pp-uap_next = NULL;
uu_free(pp);
___
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: r263878 - head/sys/amd64/amd64

2014-03-28 Thread Konstantin Belousov
On Fri, Mar 28, 2014 at 01:23:06PM -0400, Ed Maste wrote:
 On 28 March 2014 12:07, Konstantin Belousov k...@freebsd.org wrote:
  Author: kib
  Date: Fri Mar 28 16:07:27 2014
  New Revision: 263878
  URL: http://svnweb.freebsd.org/changeset/base/263878
 
  Log:
Several fixes for the PCID implementation:
 
 I'd like to revert r262765 (where I disabled it by default) to get
 broader testing on this; do you see any reason I should wait instead?

I am on edge there.

From one side, enabling PCID degrades the pgbench (?) by 10% at least
on many-cores machines. This is understandable, since committed
implementation keeps track of the cpus which has translation information
cached for the given pmap, and invalidation IPIs must be broadcasted to
the whole set of the cpus. The set is larger than the set of cpus for
which the pmap is active, so the overhead from TLB shootdown is larger.

On the other side, on the desktop-class hw, i.e. 4 cores/8 threads,
there is no significant degradation, AFAIR.  And, in microbenchmarks,
the context switch latency is improved up to 2 times regardless of the
machine class.

So I initially delayed disabling the PCID, after the pgbench results
were published, but now I similarly do now want much to change the
defaults back to enabled.

Might be, do it in HEAD only ?


pgpDlNxXLTm1p.pgp
Description: PGP signature


svn commit: r263878 - head/sys/amd64/amd64

2014-03-28 Thread Konstantin Belousov
Author: kib
Date: Fri Mar 28 16:07:27 2014
New Revision: 263878
URL: http://svnweb.freebsd.org/changeset/base/263878

Log:
  Several fixes for the PCID implementation:
  
  - When clearing a bit for a cpuid in pmap-pm_save, ensure that the
cpuid is not set in pm_active.  The pm_save indicates which CPUs may
have cached translations for given PCID, which implies that a CPU
executing with the given pmap active have the translations
cached. [1]
  
  - In smp_masked_invltlb(), pass pmap to smp_targeted_tlb_shootdown(). [1]
  
  - In invlrng_handler(), check for the special values of pcid (0 and
-1) and do corresponding global or total invalidations before
checking for performing PCID-specific range invalidation with
INVPCID_ADDR. [2]
  
  - In invltlb_pcid_handler(), do not read %cr3 unless needed. [2]
  
  - Do minor style tweaks. [2]
  
  Submitted by: Henrik Gulbrandsen hen...@gulbra.net [1]
  Other parts sponsored by: The FreeBSD Foundation [2]
  Tested by:Henrik Gulbrandsen, pho
  MFC after:1 week

Modified:
  head/sys/amd64/amd64/mp_machdep.c
  head/sys/amd64/amd64/pmap.c

Modified: head/sys/amd64/amd64/mp_machdep.c
==
--- head/sys/amd64/amd64/mp_machdep.c   Fri Mar 28 15:41:04 2014
(r263877)
+++ head/sys/amd64/amd64/mp_machdep.c   Fri Mar 28 16:07:27 2014
(r263878)
@@ -1257,7 +1257,7 @@ smp_masked_invltlb(cpuset_t mask, pmap_t
 {
 
if (smp_started) {
-   smp_targeted_tlb_shootdown(mask, IPI_INVLTLB, NULL, 0, 0);
+   smp_targeted_tlb_shootdown(mask, IPI_INVLTLB, pmap, 0, 0);
 #ifdef COUNT_XINVLTLB_HITS
ipi_masked_global++;
 #endif
@@ -1517,6 +1517,7 @@ void
 invltlb_pcid_handler(void)
 {
uint64_t cr3;
+   u_int cpuid;
 #ifdef COUNT_XINVLTLB_HITS
xhits_gbl[PCPU_GET(cpuid)]++;
 #endif /* COUNT_XINVLTLB_HITS */
@@ -1524,14 +1525,13 @@ invltlb_pcid_handler(void)
(*ipi_invltlb_counts[PCPU_GET(cpuid)])++;
 #endif /* COUNT_IPIS */
 
-   cr3 = rcr3();
if (smp_tlb_invpcid.pcid != (uint64_t)-1 
smp_tlb_invpcid.pcid != 0) {
-
if (invpcid_works) {
invpcid(smp_tlb_invpcid, INVPCID_CTX);
} else {
/* Otherwise reload %cr3 twice. */
+   cr3 = rcr3();
if (cr3 != pcid_cr3) {
load_cr3(pcid_cr3);
cr3 |= CR3_PCID_SAVE;
@@ -1541,8 +1541,11 @@ invltlb_pcid_handler(void)
} else {
invltlb_globpcid();
}
-   if (smp_tlb_pmap != NULL)
-   CPU_CLR_ATOMIC(PCPU_GET(cpuid), smp_tlb_pmap-pm_save);
+   if (smp_tlb_pmap != NULL) {
+   cpuid = PCPU_GET(cpuid);
+   if (!CPU_ISSET(cpuid, smp_tlb_pmap-pm_active))
+   CPU_CLR_ATOMIC(cpuid, smp_tlb_pmap-pm_save);
+   }
 
atomic_add_int(smp_tlb_wait, 1);
 }
@@ -1608,7 +1611,10 @@ invlpg_range(vm_offset_t start, vm_offse
 void
 invlrng_handler(void)
 {
+   struct invpcid_descr d;
vm_offset_t addr;
+   uint64_t cr3;
+   u_int cpuid;
 #ifdef COUNT_XINVLTLB_HITS
xhits_rng[PCPU_GET(cpuid)]++;
 #endif /* COUNT_XINVLTLB_HITS */
@@ -1618,15 +1624,7 @@ invlrng_handler(void)
 
addr = smp_tlb_invpcid.addr;
if (pmap_pcid_enabled) {
-   if (invpcid_works) {
-   struct invpcid_descr d;
-
-   d = smp_tlb_invpcid;
-   do {
-   invpcid(d, INVPCID_ADDR);
-   d.addr += PAGE_SIZE;
-   } while (d.addr  smp_tlb_addr2);
-   } else if (smp_tlb_invpcid.pcid == 0) {
+   if (smp_tlb_invpcid.pcid == 0) {
/*
 * kernel pmap - use invlpg to invalidate
 * global mapping.
@@ -1635,12 +1633,18 @@ invlrng_handler(void)
} else if (smp_tlb_invpcid.pcid == (uint64_t)-1) {
invltlb_globpcid();
if (smp_tlb_pmap != NULL) {
-   CPU_CLR_ATOMIC(PCPU_GET(cpuid),
-   smp_tlb_pmap-pm_save);
+   cpuid = PCPU_GET(cpuid);
+   if (!CPU_ISSET(cpuid, smp_tlb_pmap-pm_active))
+   CPU_CLR_ATOMIC(cpuid,
+   smp_tlb_pmap-pm_save);
}
+   } else if (invpcid_works) {
+   d = smp_tlb_invpcid;
+   do {
+   invpcid(d, INVPCID_ADDR);
+   d.addr += PAGE_SIZE;
+   } while (d.addr = smp_tlb_addr2);
} else {
-   uint64_t cr3;

svn commit: r263882 - in stable/10/share: examples/etc mk

2014-03-28 Thread Jung-uk Kim
Author: jkim
Date: Fri Mar 28 20:12:30 2014
New Revision: 263882
URL: http://svnweb.freebsd.org/changeset/base/263882

Log:
  MFC:  r263435
  
  Add new CPUTYPEs supported by Clang 3.4.

Modified:
  stable/10/share/examples/etc/make.conf
  stable/10/share/mk/bsd.cpu.mk
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/share/examples/etc/make.conf
==
--- stable/10/share/examples/etc/make.conf  Fri Mar 28 16:31:12 2014
(r263881)
+++ stable/10/share/examples/etc/make.conf  Fri Mar 28 20:12:30 2014
(r263882)
@@ -45,8 +45,8 @@
 #  if omitted), ultrasparc3
 # Additionally the following CPU types are recognized by clang:
 #   Intel x86 architecture (for both amd64 and i386):
-#   (AMD CPUs) bdver2, bdver1, btver2, btver1
-#   (Intel CPUs)   core-avx2, core-avx-i, corei7-avx, corei7, atom
+#   (AMD CPUs) bdver3, bdver2, bdver1, btver2, btver1
+#   (Intel CPUs)   slm, core-avx2, core-avx-i, corei7-avx, corei7, atom
 #
 # (?= allows to buildworld for a different CPUTYPE.)
 #

Modified: stable/10/share/mk/bsd.cpu.mk
==
--- stable/10/share/mk/bsd.cpu.mk   Fri Mar 28 16:31:12 2014
(r263881)
+++ stable/10/share/mk/bsd.cpu.mk   Fri Mar 28 20:12:30 2014
(r263882)
@@ -142,7 +142,8 @@ _CPUCFLAGS = -mcpu=ultrasparc3
 # presence of a CPU feature.
 
 . if ${MACHINE_CPUARCH} == i386
-.  if ${CPUTYPE} == bdver2 || ${CPUTYPE} == bdver1
+.  if ${CPUTYPE} == bdver3 || ${CPUTYPE} == bdver2 || \
+${CPUTYPE} == bdver1
 MACHINE_CPU = xop avx sse42 sse41 ssse3 sse4a sse3 sse2 sse mmx k6 k5 i586
 .  elif ${CPUTYPE} == btver2
 MACHINE_CPU = avx sse42 sse41 ssse3 sse4a sse3 sse2 sse mmx k6 k5 i586
@@ -170,7 +171,7 @@ MACHINE_CPU = k5 i586
 MACHINE_CPU = avx2 avx sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586
 .  elif ${CPUTYPE} == core-avx-i || ${CPUTYPE} == corei7-avx
 MACHINE_CPU = avx sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586
-.  elif ${CPUTYPE} == corei7
+.  elif ${CPUTYPE} == slm || ${CPUTYPE} == corei7
 MACHINE_CPU = sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586
 .  elif ${CPUTYPE} == penryn
 MACHINE_CPU = sse41 ssse3 sse3 sse2 sse i686 mmx i586
@@ -204,7 +205,8 @@ MACHINE_CPU = mmx
 .  endif
 MACHINE_CPU += i486
 . elif ${MACHINE_CPUARCH} == amd64
-.  if ${CPUTYPE} == bdver2 || ${CPUTYPE} == bdver1
+.  if ${CPUTYPE} == bdver3 || ${CPUTYPE} == bdver2 || \
+${CPUTYPE} == bdver1
 MACHINE_CPU = xop avx sse42 sse41 ssse3 sse4a sse3
 .  elif ${CPUTYPE} == btver2
 MACHINE_CPU = avx sse42 sse41 ssse3 sse4a sse3
@@ -222,7 +224,7 @@ MACHINE_CPU = k8 3dnow
 MACHINE_CPU = avx2 avx sse42 sse41 ssse3 sse3
 .  elif ${CPUTYPE} == core-avx-i || ${CPUTYPE} == corei7-avx
 MACHINE_CPU = avx sse42 sse41 ssse3 sse3
-.  elif ${CPUTYPE} == corei7
+.  elif ${CPUTYPE} == slm || ${CPUTYPE} == corei7
 MACHINE_CPU = sse42 sse41 ssse3 sse3
 .  elif ${CPUTYPE} == penryn
 MACHINE_CPU = sse41 ssse3 sse3
___
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: r263885 - in head/sys/dev/vt: . hw/vga

2014-03-28 Thread Aleksandr Rybalko
Author: ray
Date: Fri Mar 28 22:04:27 2014
New Revision: 263885
URL: http://svnweb.freebsd.org/changeset/base/263885

Log:
  o Add new vd_driver method to do bitblt with mask, named vd_maskbitbltchr.
  o Move vd_bitbltchr vga's driver method to vd_maskbitbltchr.
  o Implement new vd_bitbltchr method for vga driver. (It do single write for 8
pixels, have to be a bit faster).
  
  MFC after:7 days
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/dev/vt/hw/vga/vga.c
  head/sys/dev/vt/vt.h
  head/sys/dev/vt/vt_core.c

Modified: head/sys/dev/vt/hw/vga/vga.c
==
--- head/sys/dev/vt/hw/vga/vga.cFri Mar 28 21:25:19 2014
(r263884)
+++ head/sys/dev/vt/hw/vga/vga.cFri Mar 28 22:04:27 2014
(r263885)
@@ -74,6 +74,7 @@ struct vga_softc {
 static vd_init_t   vga_init;
 static vd_blank_t  vga_blank;
 static vd_bitbltchr_t  vga_bitbltchr;
+static vd_maskbitbltchr_t vga_maskbitbltchr;
 static vd_drawrect_t   vga_drawrect;
 static vd_setpixel_t   vga_setpixel;
 static vd_putchar_tvga_putchar;
@@ -83,6 +84,7 @@ static const struct vt_driver vt_vga_dri
.vd_init= vga_init,
.vd_blank   = vga_blank,
.vd_bitbltchr   = vga_bitbltchr,
+   .vd_maskbitbltchr = vga_maskbitbltchr,
.vd_drawrect= vga_drawrect,
.vd_setpixel= vga_setpixel,
.vd_putchar = vga_putchar,
@@ -204,6 +206,34 @@ vga_bitbltchr(struct vt_device *vd, cons
 int bpl, vt_axis_t top, vt_axis_t left, unsigned int width,
 unsigned int height, term_color_t fg, term_color_t bg)
 {
+   u_long dst, ldst;
+   int w;
+
+   /* Don't try to put off screen pixels */
+   if (((left + width)  VT_VGA_WIDTH) || ((top + height) 
+   VT_VGA_HEIGHT))
+   return;
+
+   dst = (VT_VGA_WIDTH * top + left) / 8;
+
+   for (; height  0; height--) {
+   ldst = dst;
+   for (w = width; w  0; w -= 8) {
+   vga_bitblt_put(vd, ldst, fg, *src);
+   vga_bitblt_put(vd, ldst, bg, ~*src);
+   ldst++;
+   src++;
+   }
+   dst += VT_VGA_WIDTH / 8;
+   }
+}
+
+/* Bitblt with mask support. Slow. */
+static void
+vga_maskbitbltchr(struct vt_device *vd, const uint8_t *src, const uint8_t 
*mask,
+int bpl, vt_axis_t top, vt_axis_t left, unsigned int width,
+unsigned int height, term_color_t fg, term_color_t bg)
+{
struct vga_softc *sc = vd-vd_softc;
u_long dst;
uint8_t shift;

Modified: head/sys/dev/vt/vt.h
==
--- head/sys/dev/vt/vt.hFri Mar 28 21:25:19 2014(r263884)
+++ head/sys/dev/vt/vt.hFri Mar 28 22:04:27 2014(r263885)
@@ -282,6 +282,9 @@ typedef void vd_blank_t(struct vt_device
 typedef void vd_bitbltchr_t(struct vt_device *vd, const uint8_t *src,
 const uint8_t *mask, int bpl, vt_axis_t top, vt_axis_t left,
 unsigned int width, unsigned int height, term_color_t fg, term_color_t bg);
+typedef void vd_maskbitbltchr_t(struct vt_device *vd, const uint8_t *src,
+const uint8_t *mask, int bpl, vt_axis_t top, vt_axis_t left,
+unsigned int width, unsigned int height, term_color_t fg, term_color_t bg);
 typedef void vd_putchar_t(struct vt_device *vd, term_char_t,
 vt_axis_t top, vt_axis_t left, term_color_t fg, term_color_t bg);
 typedef int vd_fb_ioctl_t(struct vt_device *, u_long, caddr_t, struct thread 
*);
@@ -298,6 +301,7 @@ struct vt_driver {
/* Drawing. */
vd_blank_t  *vd_blank;
vd_bitbltchr_t  *vd_bitbltchr;
+   vd_maskbitbltchr_t *vd_maskbitbltchr;
vd_drawrect_t   *vd_drawrect;
vd_setpixel_t   *vd_setpixel;
 

Modified: head/sys/dev/vt/vt_core.c
==
--- head/sys/dev/vt/vt_core.c   Fri Mar 28 21:25:19 2014(r263884)
+++ head/sys/dev/vt/vt_core.c   Fri Mar 28 22:04:27 2014(r263885)
@@ -775,7 +775,7 @@ vt_flush(struct vt_device *vd)
if ((vd-vd_my + m-h)  (size.tp_row * vf-vf_height))
h = (size.tp_row * vf-vf_height) - vd-vd_my - 1;
 
-   vd-vd_driver-vd_bitbltchr(vd, m-map, m-mask, bpl,
+   vd-vd_driver-vd_maskbitbltchr(vd, m-map, m-mask, bpl,
vd-vd_offset.tp_row + vd-vd_my,
vd-vd_offset.tp_col + vd-vd_mx,
w, h, TC_WHITE, TC_BLACK);
@@ -1930,6 +1930,8 @@ vt_allocate(struct vt_driver *drv, void 
printf(%s: Replace existing VT driver.\n, __func__);
}
vd = main_vd;
+   if (drv-vd_maskbitbltchr == NULL)
+   drv-vd_maskbitbltchr = drv-vd_bitbltchr;
 
/* Stop vt_flush periodic task. */
if (vd-vd_curwindow != NULL)

svn commit: r263886 - vendor/illumos/dist/cmd/zfs

2014-03-28 Thread Xin LI
Author: delphij
Date: Fri Mar 28 22:44:01 2014
New Revision: 263886
URL: http://svnweb.freebsd.org/changeset/base/263886

Log:
  4573 ZFS snapshot alias
  
  illumos/illumos-gate@7dbbcd8300f0241d3ec9686f2a0a06107c1b90cb

Modified:
  vendor/illumos/dist/cmd/zfs/zfs_main.c

Modified: vendor/illumos/dist/cmd/zfs/zfs_main.c
==
--- vendor/illumos/dist/cmd/zfs/zfs_main.c  Fri Mar 28 22:04:27 2014
(r263885)
+++ vendor/illumos/dist/cmd/zfs/zfs_main.c  Fri Mar 28 22:44:01 2014
(r263886)
@@ -3052,7 +3052,7 @@ zfs_do_list(int argc, char **argv)
flags = ~ZFS_ITER_PROP_LISTSNAPS;
while (*optarg != '\0') {
static char *type_subopts[] = { filesystem,
-   volume, snapshot, bookmark,
+   volume, snapshot, snap, bookmark,
all, NULL };
 
switch (getsubopt(optarg, type_subopts,
@@ -3064,12 +3064,13 @@ zfs_do_list(int argc, char **argv)
types |= ZFS_TYPE_VOLUME;
break;
case 2:
+   case 3:
types |= ZFS_TYPE_SNAPSHOT;
break;
-   case 3:
+   case 4:
types |= ZFS_TYPE_BOOKMARK;
break;
-   case 4:
+   case 5:
types = ZFS_TYPE_DATASET |
ZFS_TYPE_BOOKMARK;
break;
@@ -6775,6 +6776,12 @@ main(int argc, char **argv)
cmdname = receive;
 
/*
+* The 'snap' command is an alias for 'snapshot'
+*/
+   if (strcmp(cmdname, snap) == 0)
+   cmdname = snapshot;
+
+   /*
 * Special case '-?'
 */
if (strcmp(cmdname, -?) == 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: r263887 - in vendor/illumos/dist: cmd/zpool lib/libzfs/common man/man1m

2014-03-28 Thread Xin LI
Author: delphij
Date: Fri Mar 28 22:46:55 2014
New Revision: 263887
URL: http://svnweb.freebsd.org/changeset/base/263887

Log:
  3993 zpool(1M) and zfs(1M) should support -p for list and get
  4700 zpool get doesn't support -H or -o options
  
  illumos/illumos-gate@c58b352673e88983cd2b8a388a8c7625f35e2f18

Modified:
  vendor/illumos/dist/cmd/zpool/zpool_main.c
  vendor/illumos/dist/lib/libzfs/common/libzfs.h
  vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c
  vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c
  vendor/illumos/dist/man/man1m/zpool.1m

Modified: vendor/illumos/dist/cmd/zpool/zpool_main.c
==
--- vendor/illumos/dist/cmd/zpool/zpool_main.c  Fri Mar 28 22:44:01 2014
(r263886)
+++ vendor/illumos/dist/cmd/zpool/zpool_main.c  Fri Mar 28 22:46:55 2014
(r263887)
@@ -227,7 +227,7 @@ get_usage(zpool_help_t idx) {
return (gettext(\tiostat [-v] [-T d|u] [pool] ... [interval 
[count]]\n));
case HELP_LIST:
-   return (gettext(\tlist [-H] [-o property[,...]] 
+   return (gettext(\tlist [-Hp] [-o property[,...]] 
[-T d|u] [pool] ... [interval [count]]\n));
case HELP_OFFLINE:
return (gettext(\toffline [-t] pool device ...\n));
@@ -250,8 +250,8 @@ get_usage(zpool_help_t idx) {
\tupgrade -v\n
\tupgrade [-V version] -a | pool ...\n));
case HELP_GET:
-   return (gettext(\tget \all\ | property[,...] 
-   pool ...\n));
+   return (gettext(\tget [-Hp] [-o \all\ | field[,...]] 
+   \all\ | property[,...] pool ...\n));
case HELP_SET:
return (gettext(\tset property=value pool \n));
case HELP_SPLIT:
@@ -2619,6 +2619,7 @@ typedef struct list_cbdata {
int cb_namewidth;
boolean_t   cb_scripted;
zprop_list_t*cb_proplist;
+   boolean_t   cb_literal;
 } list_cbdata_t;
 
 /*
@@ -2714,7 +2715,7 @@ print_pool(zpool_handle_t *zhp, list_cbd
zpool_get_prop_int(zhp, pl-pl_prop, NULL) == 0)
propstr = -;
else if (zpool_get_prop(zhp, pl-pl_prop, property,
-   sizeof (property), NULL) != 0)
+   sizeof (property), NULL, cb-cb_literal) != 0)
propstr = -;
else
propstr = property;
@@ -2865,12 +2866,13 @@ list_callback(zpool_handle_t *zhp, void 
 }
 
 /*
- * zpool list [-H] [-o prop[,prop]*] [-T d|u] [pool] ... [interval [count]]
+ * zpool list [-Hp] [-o prop[,prop]*] [-T d|u] [pool] ... [interval [count]]
  *
  * -H  Scripted mode.  Don't display headers, and separate properties
  * by a single tab.
  * -o  List of properties to display.  Defaults to
  * name,size,allocated,free,capacity,health,altroot
+ * -p  Diplay values in parsable (exact) format.
  * -T  Display a timestamp in date(1) or Unix format
  *
  * List all pools in the system, whether or not they're healthy.  Output space
@@ -2891,7 +2893,7 @@ zpool_do_list(int argc, char **argv)
boolean_t first = B_TRUE;
 
/* check options */
-   while ((c = getopt(argc, argv, :Ho:T:v)) != -1) {
+   while ((c = getopt(argc, argv, :Ho:pT:v)) != -1) {
switch (c) {
case 'H':
cb.cb_scripted = B_TRUE;
@@ -2899,6 +2901,9 @@ zpool_do_list(int argc, char **argv)
case 'o':
props = optarg;
break;
+   case 'p':
+   cb.cb_literal = B_TRUE;
+   break;
case 'T':
get_timestamp_arg(*optarg);
break;
@@ -4977,7 +4982,7 @@ get_callback(zpool_handle_t *zhp, void *
}
} else {
if (zpool_get_prop(zhp, pl-pl_prop, value,
-   sizeof (value), srctype) != 0)
+   sizeof (value), srctype, cbp-cb_literal) != 0)
continue;
 
zprop_print_one_property(zpool_get_name(zhp), cbp,
@@ -4988,20 +4993,32 @@ get_callback(zpool_handle_t *zhp, void *
return (0);
 }
 
+/*
+ * zpool get [-Hp] [-o all | field[,...]] all | property[,...] pool ...
+ *
+ * -H  Scripted mode.  Don't display headers, and separate properties
+ * by a single tab.
+ * -o  List of columns to display.  Defaults to
+ * name,property,value,source.
+ * -p  Diplay values in parsable (exact) format.
+ *
+ * Get properties of pools in the system. Output space statistics
+ * for each one as well as other attributes.
+ */
 int
 

svn commit: r263888 - head/cddl/contrib/opensolaris

2014-03-28 Thread Xin LI
Author: delphij
Date: Fri Mar 28 22:49:10 2014
New Revision: 263888
URL: http://svnweb.freebsd.org/changeset/base/263888

Log:
  Dummy MFV r263886:
  
  4573 ZFS snapshot alias

Modified:
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)
___
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: r263889 - in head/cddl/contrib/opensolaris: cmd/zpool lib/libzfs/common

2014-03-28 Thread Xin LI
Author: delphij
Date: Fri Mar 28 23:12:00 2014
New Revision: 263889
URL: http://svnweb.freebsd.org/changeset/base/263889

Log:
  MFV r263887:
  
  3993 zpool(1M) and zfs(1M) should support -p for list and get
  4700 zpool get doesn't support -H or -o options
  
  MFC after:2 weeks

Modified:
  head/cddl/contrib/opensolaris/cmd/zpool/zpool.8
  head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)
  head/cddl/contrib/opensolaris/lib/libzfs/   (props changed)

Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8
==
--- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Fri Mar 28 22:49:10 
2014(r263888)
+++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Fri Mar 28 23:12:00 
2014(r263889)
@@ -1,5 +1,6 @@
 '\ te
 .\ Copyright (c) 2012, Martin Matuska m...@freebsd.org.
+.\ Copyright (c) 2013-2014, Xin Li delp...@freebsd.org.
 .\ All Rights Reserved.
 .\
 .\ The contents of this file are subject to the terms of the
@@ -25,7 +26,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd March 20, 2014
+.Dd March 28, 2014
 .Dt ZPOOL 8
 .Os
 .Sh NAME
@@ -70,6 +71,8 @@
 .Ar pool ...
 .Nm
 .Cm get
+.Op Fl Hp
+.Op Fl o Ar field Ns Op , Ns Ar ...
 .Ar all | property Ns Op , Ns Ar ...
 .Ar pool ...
 .Nm
@@ -120,7 +123,7 @@
 .Ar device
 .Nm
 .Cm list
-.Op Fl H
+.Op Fl Hpv
 .Op Fl o Ar property Ns Op , Ns Ar ...
 .Op Fl T Cm d Ns | Ns Cm u
 .Op Ar pool
@@ -1018,6 +1021,8 @@ is currently being used. This may lead t
 .It Xo
 .Nm
 .Cm get
+.Op Fl Hp
+.Op Fl o Ar field Ns Op , Ns Ar ...
 .Ar all | property Ns Op , Ns Ar ...
 .Ar pool ...
 .Xc
@@ -1036,6 +1041,19 @@ the following fields:
 See the
 .Qq Sx Properties
 section for more information on the available pool properties.
+.Pp
+.It Fl H
+Scripted mode. Do not display headers, and separate fields by a single tab
+instead of arbitrary space.
+.It Fl p
+Display numbers in parsable (exact) values.
+.It Fl o Ar field
+A comma-separated list of columns to display.
+.Sy name Ns , Ns
+.Sy property Ns , Ns
+.Sy value Ns , Ns
+.Sy source
+is the default value.
 .It Xo
 .Nm
 .Cm history
@@ -1335,7 +1353,7 @@ Treat exported or foreign devices as ina
 .It Xo
 .Nm
 .Cm list
-.Op Fl Hv
+.Op Fl Hpv
 .Op Fl o Ar property Ns Op , Ns Ar ...
 .Op Fl T Cm d Ns | Ns Cm u
 .Op Ar pool
@@ -1371,6 +1389,8 @@ for unixtime
 .It Fl H
 Scripted mode. Do not display headers, and separate fields by a single tab
 instead of arbitrary space.
+.It Fl p
+Display numbers in parsable (exact) values.
 .It Fl v
 Show more detailed information.
 .It Fl o Ar property Ns Op , Ns Ar ...

Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
==
--- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.cFri Mar 28 
22:49:10 2014(r263888)
+++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.cFri Mar 28 
23:12:00 2014(r263889)
@@ -236,7 +236,7 @@ get_usage(zpool_help_t idx) {
case HELP_LABELCLEAR:
return (gettext(\tlabelclear [-f] vdev\n));
case HELP_LIST:
-   return (gettext(\tlist [-Hv] [-o property[,...]] 
+   return (gettext(\tlist [-Hpv] [-o property[,...]] 
[-T d|u] [pool] ... [interval [count]]\n));
case HELP_OFFLINE:
return (gettext(\toffline [-t] pool device ...\n));
@@ -258,8 +258,8 @@ get_usage(zpool_help_t idx) {
return (gettext(\tupgrade [-v]\n
\tupgrade [-V version] -a | pool ...\n));
case HELP_GET:
-   return (gettext(\tget \all\ | property[,...] 
-   pool ...\n));
+   return (gettext(\tget [-Hp] [-o \all\ | field[,...]] 
+   \all\ | property[,...] pool ...\n));
case HELP_SET:
return (gettext(\tset property=value pool \n));
case HELP_SPLIT:
@@ -2765,6 +2765,7 @@ typedef struct list_cbdata {
int cb_namewidth;
boolean_t   cb_scripted;
zprop_list_t*cb_proplist;
+   boolean_t   cb_literal;
 } list_cbdata_t;
 
 /*
@@ -2860,7 +2861,7 @@ print_pool(zpool_handle_t *zhp, list_cbd
zpool_get_prop_int(zhp, pl-pl_prop, NULL) == 0)
propstr = -;
else if (zpool_get_prop(zhp, pl-pl_prop, property,
-   sizeof (property), NULL) != 0)
+   sizeof (property), NULL, cb-cb_literal) != 0)
propstr = -;
else
propstr = property;
@@ -3011,12 +3012,13 @@ list_callback(zpool_handle_t *zhp, 

svn commit: r263890 - head/tools/tools/nanobsd

2014-03-28 Thread Warner Losh
Author: imp
Date: Fri Mar 28 23:20:56 2014
New Revision: 263890
URL: http://svnweb.freebsd.org/changeset/base/263890

Log:
  Dump default media size to 1GB to reflect a fatter environment and
  larger base media.
  
  Submitted by: Michael Dexter

Modified:
  head/tools/tools/nanobsd/nanobsd.sh

Modified: head/tools/tools/nanobsd/nanobsd.sh
==
--- head/tools/tools/nanobsd/nanobsd.sh Fri Mar 28 23:12:00 2014
(r263889)
+++ head/tools/tools/nanobsd/nanobsd.sh Fri Mar 28 23:20:56 2014
(r263890)
@@ -92,7 +92,7 @@ NANO_NEWFS=-b 4096 -f 512 -i 8192 -U
 NANO_DRIVE=ad0
 
 # Target media size in 512 bytes sectors
-NANO_MEDIASIZE=150
+NANO_MEDIASIZE=200
 
 # Number of code images on media (1 or 2)
 NANO_IMAGES=2
___
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: r263891 - head/contrib/llvm/tools/clang/lib/Driver

2014-03-28 Thread Dimitry Andric
Author: dim
Date: Sat Mar 29 00:25:27 2014
New Revision: 263891
URL: http://svnweb.freebsd.org/changeset/base/263891

Log:
  Make clang default to DWARF2 debug info format for FreeBSD 10.x and
  earlier.  For head, this commit does not change anything, but it is
  purely meant to be MFC'd.
  
  MFC after:3 days

Modified:
  head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp

Modified: head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp
==
--- head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp  Fri Mar 28 23:20:56 
2014(r263890)
+++ head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp  Sat Mar 29 00:25:27 
2014(r263891)
@@ -2635,8 +2635,10 @@ void Clang::ConstructJob(Compilation C,
   CmdArgs.push_back(-gdwarf-4);
 else if (!A-getOption().matches(options::OPT_g0) 
  !A-getOption().matches(options::OPT_ggdb0)) {
-  // Default is dwarf-2 for darwin.
-  if (getToolChain().getTriple().isOSDarwin())
+  // Default is dwarf-2 for darwin and FreeBSD = 10.
+  const llvm::Triple Triple = getToolChain().getTriple();
+  if (Triple.isOSDarwin() || (Triple.getOS() == llvm::Triple::FreeBSD 
+  Triple.getOSMajorVersion() = 10))
 CmdArgs.push_back(-gdwarf-2);
   else
 CmdArgs.push_back(-g);
___
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: r263892 - head/contrib/llvm/patches

2014-03-28 Thread Dimitry Andric
Author: dim
Date: Sat Mar 29 00:48:50 2014
New Revision: 263892
URL: http://svnweb.freebsd.org/changeset/base/263892

Log:
  Add the llvm/clang patch for r263891.

Added:
  head/contrib/llvm/patches/patch-r263891-dwarf2-freebsd10.diff

Added: head/contrib/llvm/patches/patch-r263891-dwarf2-freebsd10.diff
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/contrib/llvm/patches/patch-r263891-dwarf2-freebsd10.diff   Sat Mar 
29 00:48:50 2014(r263892)
@@ -0,0 +1,22 @@
+This patch makes clang default to DWARF2 debug info format for FreeBSD
+10.x and earlier.
+
+Introduced here: http://svnweb.freebsd.org/changeset/base/263891
+
+Index: tools/clang/lib/Driver/Tools.cpp
+===
+--- tools/clang/lib/Driver/Tools.cpp
 tools/clang/lib/Driver/Tools.cpp
+@@ -2628,8 +2628,10 @@ void Clang::ConstructJob(Compilation C, const Job
+   CmdArgs.push_back(-gdwarf-4);
+ else if (!A-getOption().matches(options::OPT_g0) 
+  !A-getOption().matches(options::OPT_ggdb0)) {
+-  // Default is dwarf-2 for darwin.
+-  if (getToolChain().getTriple().isOSDarwin())
++  // Default is dwarf-2 for darwin and FreeBSD = 10.
++  const llvm::Triple Triple = getToolChain().getTriple();
++  if (Triple.isOSDarwin() || (Triple.getOS() == llvm::Triple::FreeBSD 
++  Triple.getOSMajorVersion() = 10))
+ CmdArgs.push_back(-gdwarf-2);
+   else
+ CmdArgs.push_back(-g);
___
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: r263755 - head/sys/kern

2014-03-28 Thread Mateusz Guzik
On Fri, Mar 28, 2014 at 09:13:20AM -0700, Don Lewis wrote:
 On 28 Mar, David Xu wrote:
  I have tweaked it a bit, is this okay ?
  
  # HG changeset patch
  # Parent 53b614ff2cae108f27e4475989d3a86997017268
  
  diff -r 53b614ff2cae sys/kern/subr_bus.c
  --- a/sys/kern/subr_bus.c   Thu Mar 27 10:03:50 2014 +0800
  +++ b/sys/kern/subr_bus.c   Fri Mar 28 14:22:29 2014 +0800
  @@ -391,11 +391,12 @@
  int inuse;
  int nonblock;
  int queued;
  +   int async;
  struct mtx mtx;
  struct cv cv;
  struct selinfo sel;
  struct devq devq;
  -   struct proc *async_proc;
  +   struct sigio *sigio;
} devsoftc;
  
static struct cdev *devctl_dev;
  @@ -422,7 +423,8 @@
  /* move to init */
  devsoftc.inuse = 1;
  devsoftc.nonblock = 0;
  -   devsoftc.async_proc = NULL;
  +   devsoftc.async = 0;
  +   devsoftc.sigio = NULL;
  mtx_unlock(devsoftc.mtx);
  return (0);
}
  @@ -433,8 +435,9 @@
  
  mtx_lock(devsoftc.mtx);
  devsoftc.inuse = 0;
  -   devsoftc.async_proc = NULL;
  +   devsoftc.async = 0;
  cv_broadcast(devsoftc.cv);
  +   funsetown(devsoftc.sigio);
  mtx_unlock(devsoftc.mtx);
  return (0);
}
  @@ -490,33 +493,21 @@
  devsoftc.nonblock = 0;
  return (0);
  case FIOASYNC:
  -   /*
  -* FIXME:
  -* Since this is a simple assignment there is no guarantee that
  -* devsoftc.async_proc consumers will get a valid pointer.
  -*
  -* Example scenario where things break (processes A and B):
  -* 1. A opens devctl
  -* 2. A sends fd to B
  -* 3. B sets itself as async_proc
  -* 4. B exits
  -*
  -* However, normally this requires root privileges and the only
  -* in-tree consumer does not behave in a dangerous way so the
  -* issue is not critical.
  -*/
  if (*(int*)data)
  -   devsoftc.async_proc = td-td_proc;
  +   devsoftc.async = 1;
  else
  -   devsoftc.async_proc = NULL;
  +   devsoftc.async = 0;
  +   return (0);
  +   case FIOSETOWN:
  +   return fsetown(*(int *)data, devsoftc.sigio);
  +   case FIOGETOWN:
  +   *(int *)data = fgetown(devsoftc.sigio);
  return (0);
  
  /* (un)Support for other fcntl() calls. */
  case FIOCLEX:
  case FIONCLEX:
  case FIONREAD:
  -   case FIOSETOWN:
  -   case FIOGETOWN:
  default:
  break;
  }
  @@ -560,7 +551,6 @@
devctl_queue_data_f(char *data, int flags)
{
  struct dev_event_info *n1 = NULL, *n2 = NULL;
  -   struct proc *p;
  
  if (strlen(data) == 0)
  goto out;
  @@ -590,13 +580,8 @@
  cv_broadcast(devsoftc.cv);
  mtx_unlock(devsoftc.mtx);
  selwakeup(devsoftc.sel);
  -   /* XXX see a comment in devioctl */
  -   p = devsoftc.async_proc;
  -   if (p != NULL) {
  -   PROC_LOCK(p);
  -   kern_psignal(p, SIGIO);
  -   PROC_UNLOCK(p);
  -   }
  +   if (devsoftc.async  devsoftc.sigio != NULL)
  +   pgsigio(devsoftc.sigio, SIGIO, 0);
  return;
out:
  /*
  
  
 
 That makes it work more like the other users of fsetown(), which is
 probably a good thing.  The downside is that two syscalls are needed to
 activate it, which I was trying to avoid that with my patch.  I noticed
 that logopen() in subr_log.c unconditionally calls fsetown(), which
 would avoid the need for an extra syscall.  That also avoids the direct
 manipulation of the pointer in your patch, which makes me nervous about
 the possibility of a leak.
 
 I wonder if FIOASYNC should fail if
   td-td_proc != devsoftc.sigio.sio_proc
 (or the equivalent for other instances) to prevent a process from
 maniuplating the async flag for a device owned by another process.  I
 think this check would need to be wrapped in SIGIO_LOCK()/SIGIO_UNLOCK()
 to be safe.
 

But this patch would mean that current consumers (if any) would break -
just calling FIOASYNC would not result in receiving SIGIO.

Original patch by Don seems to work fine though, but I'm unsure about
one thing (present in this patch as well):

There is one devsoftc.sigio instance and one can get multiple processes
with devctl fd. Is it safe from kernel perspective to have multiple
processes call fsetown(*(int *)data, devsoftc.sigio)?

-- 
Mateusz Guzik mjguzik gmail.com
___
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: r263755 - head/sys/kern

2014-03-28 Thread David Xu


On 2014/03/29 00:13, Don Lewis wrote:

On 28 Mar, David Xu wrote:

On 2014/03/28 06:31, Don Lewis wrote:

On 27 Mar, Konstantin Belousov wrote:

On Thu, Mar 27, 2014 at 04:05:12PM +0100, Mateusz Guzik wrote:

On Thu, Mar 27, 2014 at 03:58:19PM +0100, Mateusz Guzik wrote:

On Thu, Mar 27, 2014 at 04:46:57PM +0800, David Xu wrote:

On 2014/03/27 16:37, Mateusz Guzik wrote:

On Thu, Mar 27, 2014 at 03:45:17PM +0800, David Xu wrote:

I think the async process pointer can be cleared when a process exits
by registering an event handler. please see attached patch.


Sure, but I'm not very fond of this solution.

This is a rather obscure bug you wont hit unless you explicitly try,
and even then you need root privs by default.


OK, but I don't like the bug exists in kernel. It is not obscure for me,
I can run shutdown now command, and insert a device, and then the
kernel will write garbage data into freed memory space.


Not sure what you mean. devd does not use this feature, and even if it
did async_proc is cleared on close, which happens while signal delivery
is still legal.

That said, you are not going to encounter this bug unless you code
something up to specifically trigger it.

fwiw, I think we could axe this feature if there was no way to fix it
without introducing a check for every process.


As such writing a callback function which will be executed for all exiting
processes seems unjustified for me.

Ideally we would get some mechanism which would allow to register
callbacks for events related to given entity. Then it could be used to
provide a call this function when process p exits, amongst other things.


Yes, but the callback itself is cheap enough and is not worth to be
per-entity entry.


There is other code in the kernel which would benefit from such
functionality - dev/syscons/scmouse, dev/vt/vt_core.c, aio and possibly
more.

As such I think this is worth pursuing.


We can hack around this one the way the other code is doing - apart from
from proc pointer you store pid and then compare result of pfind(pid).

This is still buggy as both proc and pid pointer can be recycled and end
up being the same (but you have an entrirely new process).

However, then in absolutely worst cae you send SIGIO to incorrect
process, always an existing process so no more corruption.

Would you be ok with such hack for the time being?

Isn't p_sigiolist and fsetown(9) already provide the neccessary registration
and cleanup on the process exit ?  The KPI might require some generalization,
but I think that the mechanism itself is enough.

That's the correct mechanism, but it's not being used here.

Something like the following untested patch should do the trick:

Index: sys/kern/subr_bus.c
===
--- sys/kern/subr_bus.c (revision 263289)
+++ sys/kern/subr_bus.c (working copy)
@@ -402,7 +402,7 @@
struct cv cv;
struct selinfo sel;
struct devq devq;
-   struct proc *async_proc;
+   struct sigio *sigio;
   } devsoftc;

   static struct cdev *devctl_dev;
@@ -425,7 +425,7 @@
/* move to init */
devsoftc.inuse = 1;
devsoftc.nonblock = 0;
-   devsoftc.async_proc = NULL;
+   funsetown(devsoftc.sigio);
return (0);
   }

@@ -436,7 +436,7 @@
mtx_lock(devsoftc.mtx);
cv_broadcast(devsoftc.cv);
mtx_unlock(devsoftc.mtx);
-   devsoftc.async_proc = NULL;
+   funsetown(devsoftc.sigio);
return (0);
   }

@@ -492,9 +492,8 @@
return (0);
case FIOASYNC:
if (*(int*)data)
-   devsoftc.async_proc = td-td_proc;
-   else
-   devsoftc.async_proc = NULL;
+   return (fsetown(td-td_proc-p_pid, devsoftc.sigio));
+   funsetown(devsoftc.sigio);
return (0);

/* (un)Support for other fcntl() calls. */
@@ -546,7 +545,6 @@
   devctl_queue_data_f(char *data, int flags)
   {
struct dev_event_info *n1 = NULL, *n2 = NULL;
-   struct proc *p;

if (strlen(data) == 0)
goto out;
@@ -576,12 +574,8 @@
cv_broadcast(devsoftc.cv);
mtx_unlock(devsoftc.mtx);
selwakeup(devsoftc.sel);
-   p = devsoftc.async_proc;
-   if (p != NULL) {
-   PROC_LOCK(p);
-   kern_psignal(p, SIGIO);
-   PROC_UNLOCK(p);
-   }
+   if (devsoftc.sigio != NULL)
+   pgsigio(devsoftc.sigio, SIGIO, 0);
return;
   out:
/*



I have tweaked it a bit, is this okay ?

# HG changeset patch
# Parent 53b614ff2cae108f27e4475989d3a86997017268

diff -r 53b614ff2cae sys/kern/subr_bus.c
--- a/sys/kern/subr_bus.c   Thu Mar 27 10:03:50 2014 +0800
+++ b/sys/kern/subr_bus.c   Fri Mar 28 14:22:29 2014 +0800
@@ -391,11 +391,12 @@
int inuse;
int nonblock;
int queued;
+   int async;
struct mtx mtx;
  

Re: svn commit: r263755 - head/sys/kern

2014-03-28 Thread David Xu


On 2014/03/29 10:56, Mateusz Guzik wrote:

On Fri, Mar 28, 2014 at 09:13:20AM -0700, Don Lewis wrote:

On 28 Mar, David Xu wrote:

I have tweaked it a bit, is this okay ?

# HG changeset patch
# Parent 53b614ff2cae108f27e4475989d3a86997017268

diff -r 53b614ff2cae sys/kern/subr_bus.c
--- a/sys/kern/subr_bus.c   Thu Mar 27 10:03:50 2014 +0800
+++ b/sys/kern/subr_bus.c   Fri Mar 28 14:22:29 2014 +0800
@@ -391,11 +391,12 @@
int inuse;
int nonblock;
int queued;
+   int async;
struct mtx mtx;
struct cv cv;
struct selinfo sel;
struct devq devq;
-   struct proc *async_proc;
+   struct sigio *sigio;
   } devsoftc;

   static struct cdev *devctl_dev;
@@ -422,7 +423,8 @@
/* move to init */
devsoftc.inuse = 1;
devsoftc.nonblock = 0;
-   devsoftc.async_proc = NULL;
+   devsoftc.async = 0;
+   devsoftc.sigio = NULL;
mtx_unlock(devsoftc.mtx);
return (0);
   }
@@ -433,8 +435,9 @@

mtx_lock(devsoftc.mtx);
devsoftc.inuse = 0;
-   devsoftc.async_proc = NULL;
+   devsoftc.async = 0;
cv_broadcast(devsoftc.cv);
+   funsetown(devsoftc.sigio);
mtx_unlock(devsoftc.mtx);
return (0);
   }
@@ -490,33 +493,21 @@
devsoftc.nonblock = 0;
return (0);
case FIOASYNC:
-   /*
-* FIXME:
-* Since this is a simple assignment there is no guarantee that
-* devsoftc.async_proc consumers will get a valid pointer.
-*
-* Example scenario where things break (processes A and B):
-* 1. A opens devctl
-* 2. A sends fd to B
-* 3. B sets itself as async_proc
-* 4. B exits
-*
-* However, normally this requires root privileges and the only
-* in-tree consumer does not behave in a dangerous way so the
-* issue is not critical.
-*/
if (*(int*)data)
-   devsoftc.async_proc = td-td_proc;
+   devsoftc.async = 1;
else
-   devsoftc.async_proc = NULL;
+   devsoftc.async = 0;
+   return (0);
+   case FIOSETOWN:
+   return fsetown(*(int *)data, devsoftc.sigio);
+   case FIOGETOWN:
+   *(int *)data = fgetown(devsoftc.sigio);
return (0);

/* (un)Support for other fcntl() calls. */
case FIOCLEX:
case FIONCLEX:
case FIONREAD:
-   case FIOSETOWN:
-   case FIOGETOWN:
default:
break;
}
@@ -560,7 +551,6 @@
   devctl_queue_data_f(char *data, int flags)
   {
struct dev_event_info *n1 = NULL, *n2 = NULL;
-   struct proc *p;

if (strlen(data) == 0)
goto out;
@@ -590,13 +580,8 @@
cv_broadcast(devsoftc.cv);
mtx_unlock(devsoftc.mtx);
selwakeup(devsoftc.sel);
-   /* XXX see a comment in devioctl */
-   p = devsoftc.async_proc;
-   if (p != NULL) {
-   PROC_LOCK(p);
-   kern_psignal(p, SIGIO);
-   PROC_UNLOCK(p);
-   }
+   if (devsoftc.async  devsoftc.sigio != NULL)
+   pgsigio(devsoftc.sigio, SIGIO, 0);
return;
   out:
/*



That makes it work more like the other users of fsetown(), which is
probably a good thing.  The downside is that two syscalls are needed to
activate it, which I was trying to avoid that with my patch.  I noticed
that logopen() in subr_log.c unconditionally calls fsetown(), which
would avoid the need for an extra syscall.  That also avoids the direct
manipulation of the pointer in your patch, which makes me nervous about
the possibility of a leak.

I wonder if FIOASYNC should fail if
td-td_proc != devsoftc.sigio.sio_proc
(or the equivalent for other instances) to prevent a process from
maniuplating the async flag for a device owned by another process.  I
think this check would need to be wrapped in SIGIO_LOCK()/SIGIO_UNLOCK()
to be safe.


But this patch would mean that current consumers (if any) would break -
just calling FIOASYNC would not result in receiving SIGIO.

The old behavior is inconsistent with other piece of code in the kernel and
may be incompatible with POSIX.


Original patch by Don seems to work fine though, but I'm unsure about
one thing (present in this patch as well):

There is one devsoftc.sigio instance and one can get multiple processes
with devctl fd. Is it safe from kernel perspective to have multiple
processes call fsetown(*(int *)data, devsoftc.sigio)?



There is an inuse variable guarding this problem, you can not open it
multiple times, you can only do it in the forked process which inherited
the fd. if you don't trust the child process, you can close it before

Re: svn commit: r263755 - head/sys/kern

2014-03-28 Thread Mateusz Guzik
On Sat, Mar 29, 2014 at 11:09:34AM +0800, David Xu wrote:
 On 2014/03/29 10:56, Mateusz Guzik wrote:
 But this patch would mean that current consumers (if any) would break -
 just calling FIOASYNC would not result in receiving SIGIO.
 The old behavior is inconsistent with other piece of code in the kernel and
 may be incompatible with POSIX.
 

Oh, I didn't know that. Unsure what to do in this case.

 Original patch by Don seems to work fine though, but I'm unsure about
 one thing (present in this patch as well):
 
 There is one devsoftc.sigio instance and one can get multiple processes
 with devctl fd. Is it safe from kernel perspective to have multiple
 processes call fsetown(*(int *)data, devsoftc.sigio)?
 
 
 There is an inuse variable guarding this problem, you can not open it
 multiple times, you can only do it in the forked process which inherited
 the fd. if you don't trust the child process, you can close it before
 executing real code in the child process.
 

This does not answer my question.

I can easily imagine devctl extended in the future so that there are
per-jail instances (could be handy to monitor e.g. vnet related events
like link changes).

If fsetown handling like this is insecure this would bite us in that
scenario (and few others). In short, if we can avoid giving another way
to corrupt stuff in the kernel to userspace, we should.

-- 
Mateusz Guzik mjguzik gmail.com
___
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: r263755 - head/sys/kern

2014-03-28 Thread David Xu


On 2014/03/29 11:25, Mateusz Guzik wrote:

On Sat, Mar 29, 2014 at 11:09:34AM +0800, David Xu wrote:

On 2014/03/29 10:56, Mateusz Guzik wrote:

But this patch would mean that current consumers (if any) would break -
just calling FIOASYNC would not result in receiving SIGIO.

The old behavior is inconsistent with other piece of code in the kernel and
may be incompatible with POSIX.


Oh, I didn't know that. Unsure what to do in this case.


Original patch by Don seems to work fine though, but I'm unsure about
one thing (present in this patch as well):

There is one devsoftc.sigio instance and one can get multiple processes
with devctl fd. Is it safe from kernel perspective to have multiple
processes call fsetown(*(int *)data, devsoftc.sigio)?


There is an inuse variable guarding this problem, you can not open it
multiple times, you can only do it in the forked process which inherited
the fd. if you don't trust the child process, you can close it before
executing real code in the child process.


This does not answer my question.

I can easily imagine devctl extended in the future so that there are
per-jail instances (could be handy to monitor e.g. vnet related events
like link changes).

If fsetown handling like this is insecure this would bite us in that
scenario (and few others). In short, if we can avoid giving another way
to corrupt stuff in the kernel to userspace, we should.


I can not see what you said, where is the security problem with fsetown ?
if you have per-jail instance of devsoftc, they all are operating on their
own instance. but I don't think this patch should address jail now, there
are many things are not jail ready.





___
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: r263899 - vendor/tzdata/dist

2014-03-28 Thread Edwin Groothuis
Author: edwin
Date: Sat Mar 29 04:10:13 2014
New Revision: 263899
URL: http://svnweb.freebsd.org/changeset/base/263899

Log:
  Vendor import of tzdata 2014b
  
  - Update antartica.
  - Comments about historical data for Hawaii.
  - Update details for Crimea on 30 March
  - Move location data Simferopol.
  
  Obtained from:ftp://ftp.iana.org/tz/releases/

Modified:
  vendor/tzdata/dist/africa
  vendor/tzdata/dist/antarctica
  vendor/tzdata/dist/australasia
  vendor/tzdata/dist/europe
  vendor/tzdata/dist/zone.tab

Modified: vendor/tzdata/dist/africa
==
--- vendor/tzdata/dist/africa   Sat Mar 29 04:05:57 2014(r263898)
+++ vendor/tzdata/dist/africa   Sat Mar 29 04:10:13 2014(r263899)
@@ -868,7 +868,10 @@ Zone   Indian/Mayotte  3:00:56 -   LMT 1911 J
 # Another source (specifying the time for start and end in the decree):
 # http://www.lemag.ma/Heure-d-ete-au-Maroc-jusqu-au-27-octobre_a75620.html
 
-# From Paul Eggert (2013-10-03):
+# From Sebastien Willemijns (2014-03-18):
+# 
http://www.afriquinfos.com/articles/2014/3/18/maroc-heure-dete-avancez-tous-horloges-247891.asp
+
+# From Paul Eggert (2014-03-19):
 # To estimate what the Moroccan government will do in future years,
 # transition dates for 2014 through 2038 were determined by running
 # the following program under GNU Emacs 24.3:

Modified: vendor/tzdata/dist/antarctica
==
--- vendor/tzdata/dist/antarctica   Sat Mar 29 04:05:57 2014
(r263898)
+++ vendor/tzdata/dist/antarctica   Sat Mar 29 04:10:13 2014
(r263899)
@@ -230,24 +230,41 @@ Zone Antarctica/Syowa 0   -   zzz 1957 
Jan 2
 # year-round base
 # Scott Base, Ross Island, since 1957-01.
 # See Pacific/Auckland.
-#
-# These rules for New Zealand are stolen from the 'australasia' file.
-# Rule NAMEFROMTO  TYPEIN  ON  AT  SAVELETTER/S
-Rule   NZAQ1974only-   Nov  3  2:00s   1:00D
-Rule   NZAQ19751988-   Oct lastSun 2:00s   1:00D
-Rule   NZAQ1989only-   Oct  8  2:00s   1:00D
-Rule   NZAQ19902006-   Oct Sun=1  2:00s   1:00D
-Rule   NZAQ1975only-   Feb 23  2:00s   0   S
-Rule   NZAQ19761989-   Mar Sun=1  2:00s   0   S
-Rule   NZAQ19902007-   Mar Sun=15 2:00s   0   S
-Rule   NZAQ2007max -   Sep lastSun 2:00s   1:00D
-Rule   NZAQ2008max -   Apr Sun=1  2:00s   0   S
 
 # Norway - territories
 # Bouvet (never inhabited)
 #
 # claims
 # Peter I Island (never inhabited)
+#
+# year-round base
+# Troll, Queen Maud Land, -720041+0023206, since 2005-02-12
+#
+# From Paul-Inge Flakstad (2014-03-10):
+# I recently had a long dialog about this with the developer of timegenie.com.
+# In the absence of specific dates, he decided to choose some likely ones:
+#   GMT +1 - From March 1 to the last Sunday in March
+#   GMT +2 - From the last Sunday in March until the last Sunday in October
+#   GMT +1 - From the last Sunday in October until November 7
+#   GMT +0 - From November 7 until March 1
+# The dates for switching to and from UTC+0 will probably not be absolutely
+# correct, but they should be quite close to the actual dates.
+#
+# From Paul Eggert (2014-03-21):
+# The CET-switching Troll rules require zic from tzcode 2014b or later, so as
+# suggested by Bengt-Inge Larsson comment them out for now, and approximate
+# with only UTC and CEST.  Uncomment them when 2014b is more prevalent.
+#
+# Rule NAMEFROMTO  TYPEIN  ON  AT  SAVELETTER/S
+#Rule  Troll   2005max -   Mar  1  1:00u   1:00CET
+Rule   Troll   2005max -   Mar lastSun 1:00u   2:00CEST
+#Rule  Troll   2005max -   Oct lastSun 1:00u   1:00CET
+#Rule  Troll   2004max -   Nov  7  1:00u   0:00UTC
+# Remove the following line when uncommenting the above '#Rule' lines.
+Rule   Troll   2004max -   Oct lastSun 1:00u   0:00UTC
+# Zone NAMEGMTOFF  RULES   FORMAT  [UNTIL]
+Zone Antarctica/Troll  0   -   zzz 2005 Feb 12
+   0:00Troll   %s
 
 # Poland - year-round base
 # Arctowski, King George Island, -620945-0582745, since 1977

Modified: vendor/tzdata/dist/australasia
==
--- vendor/tzdata/dist/australasia  Sat Mar 29 04:05:57 2014
(r263898)
+++ vendor/tzdata/dist/australasia  Sat Mar 29 04:10:13 2014
(r263899)
@@ -763,14 +763,29 @@ Zone Pacific/Funafuti 11:56:52 -  LMT 190
 
 # Johnston
 #
-# From Paul Eggert (2013-09-03):
+# From Paul Eggert (2014-03-11):
+# Sometimes Johnston kept Hawaii 

svn commit: r263900 - vendor/tzdata/tzdata2014b

2014-03-28 Thread Edwin Groothuis
Author: edwin
Date: Sat Mar 29 04:12:34 2014
New Revision: 263900
URL: http://svnweb.freebsd.org/changeset/base/263900

Log:
  Tag of tzdata2014b

Added:
  vendor/tzdata/tzdata2014b/
 - copied from r263899, vendor/tzdata/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


Re: svn commit: r263755 - head/sys/kern

2014-03-28 Thread Mateusz Guzik
On Sat, Mar 29, 2014 at 11:52:09AM +0800, David Xu wrote:
 If fsetown handling like this is insecure this would bite us in that
 scenario (and few others). In short, if we can avoid giving another way
 to corrupt stuff in the kernel to userspace, we should.
 
 I can not see what you said, where is the security problem with fsetown ?
 if you have per-jail instance of devsoftc, they all are operating on their
 own instance. but I don't think this patch should address jail now, there
 are many things are not jail ready.
 

I asked if multpiple concurrent calls to fsetown(.., pointer) could
result in some corruption in the kernel - if they could, we would have a
problem in the future.

I decided to read the code once more and fsetown seems to be safe in
this regard after all and with that in mind the patch looks good to me.

This thread is too long already, so I'm stepping down on this one in
case there are some futher concerns.

-- 
Mateusz Guzik mjguzik gmail.com
___
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: r263901 - head/contrib/tzdata

2014-03-28 Thread Edwin Groothuis
Author: edwin
Date: Sat Mar 29 04:15:11 2014
New Revision: 263901
URL: http://svnweb.freebsd.org/changeset/base/263901

Log:
  MFV for 263899, tzdata2014b
  
  - Update antartica.
  - Comments about historical data for Hawaii.
  - Update details for Crimea on 30 March
  - Move location data Simferopol.

Modified:
  head/contrib/tzdata/africa
  head/contrib/tzdata/antarctica
  head/contrib/tzdata/australasia
  head/contrib/tzdata/europe
  head/contrib/tzdata/zone.tab
Directory Properties:
  head/contrib/tzdata/   (props changed)

Modified: head/contrib/tzdata/africa
==
--- head/contrib/tzdata/africa  Sat Mar 29 04:12:34 2014(r263900)
+++ head/contrib/tzdata/africa  Sat Mar 29 04:15:11 2014(r263901)
@@ -868,7 +868,10 @@ Zone   Indian/Mayotte  3:00:56 -   LMT 1911 J
 # Another source (specifying the time for start and end in the decree):
 # http://www.lemag.ma/Heure-d-ete-au-Maroc-jusqu-au-27-octobre_a75620.html
 
-# From Paul Eggert (2013-10-03):
+# From Sebastien Willemijns (2014-03-18):
+# 
http://www.afriquinfos.com/articles/2014/3/18/maroc-heure-dete-avancez-tous-horloges-247891.asp
+
+# From Paul Eggert (2014-03-19):
 # To estimate what the Moroccan government will do in future years,
 # transition dates for 2014 through 2038 were determined by running
 # the following program under GNU Emacs 24.3:

Modified: head/contrib/tzdata/antarctica
==
--- head/contrib/tzdata/antarctica  Sat Mar 29 04:12:34 2014
(r263900)
+++ head/contrib/tzdata/antarctica  Sat Mar 29 04:15:11 2014
(r263901)
@@ -230,24 +230,41 @@ Zone Antarctica/Syowa 0   -   zzz 1957 
Jan 2
 # year-round base
 # Scott Base, Ross Island, since 1957-01.
 # See Pacific/Auckland.
-#
-# These rules for New Zealand are stolen from the 'australasia' file.
-# Rule NAMEFROMTO  TYPEIN  ON  AT  SAVELETTER/S
-Rule   NZAQ1974only-   Nov  3  2:00s   1:00D
-Rule   NZAQ19751988-   Oct lastSun 2:00s   1:00D
-Rule   NZAQ1989only-   Oct  8  2:00s   1:00D
-Rule   NZAQ19902006-   Oct Sun=1  2:00s   1:00D
-Rule   NZAQ1975only-   Feb 23  2:00s   0   S
-Rule   NZAQ19761989-   Mar Sun=1  2:00s   0   S
-Rule   NZAQ19902007-   Mar Sun=15 2:00s   0   S
-Rule   NZAQ2007max -   Sep lastSun 2:00s   1:00D
-Rule   NZAQ2008max -   Apr Sun=1  2:00s   0   S
 
 # Norway - territories
 # Bouvet (never inhabited)
 #
 # claims
 # Peter I Island (never inhabited)
+#
+# year-round base
+# Troll, Queen Maud Land, -720041+0023206, since 2005-02-12
+#
+# From Paul-Inge Flakstad (2014-03-10):
+# I recently had a long dialog about this with the developer of timegenie.com.
+# In the absence of specific dates, he decided to choose some likely ones:
+#   GMT +1 - From March 1 to the last Sunday in March
+#   GMT +2 - From the last Sunday in March until the last Sunday in October
+#   GMT +1 - From the last Sunday in October until November 7
+#   GMT +0 - From November 7 until March 1
+# The dates for switching to and from UTC+0 will probably not be absolutely
+# correct, but they should be quite close to the actual dates.
+#
+# From Paul Eggert (2014-03-21):
+# The CET-switching Troll rules require zic from tzcode 2014b or later, so as
+# suggested by Bengt-Inge Larsson comment them out for now, and approximate
+# with only UTC and CEST.  Uncomment them when 2014b is more prevalent.
+#
+# Rule NAMEFROMTO  TYPEIN  ON  AT  SAVELETTER/S
+#Rule  Troll   2005max -   Mar  1  1:00u   1:00CET
+Rule   Troll   2005max -   Mar lastSun 1:00u   2:00CEST
+#Rule  Troll   2005max -   Oct lastSun 1:00u   1:00CET
+#Rule  Troll   2004max -   Nov  7  1:00u   0:00UTC
+# Remove the following line when uncommenting the above '#Rule' lines.
+Rule   Troll   2004max -   Oct lastSun 1:00u   0:00UTC
+# Zone NAMEGMTOFF  RULES   FORMAT  [UNTIL]
+Zone Antarctica/Troll  0   -   zzz 2005 Feb 12
+   0:00Troll   %s
 
 # Poland - year-round base
 # Arctowski, King George Island, -620945-0582745, since 1977

Modified: head/contrib/tzdata/australasia
==
--- head/contrib/tzdata/australasia Sat Mar 29 04:12:34 2014
(r263900)
+++ head/contrib/tzdata/australasia Sat Mar 29 04:15:11 2014
(r263901)
@@ -763,14 +763,29 @@ Zone Pacific/Funafuti 11:56:52 -  LMT 190
 
 # Johnston
 #
-# From Paul Eggert (2013-09-03):
+# From Paul Eggert (2014-03-11):
+# Sometimes Johnston kept 

svn commit: r263902 - stable/6/share/zoneinfo

2014-03-28 Thread Edwin Groothuis
Author: edwin
Date: Sat Mar 29 04:17:46 2014
New Revision: 263902
URL: http://svnweb.freebsd.org/changeset/base/263902

Log:
  MFC of 263901, tzdata2014b
  
   - Update antartica.
   - Comments about historical data for Hawaii.
   - Update details for Crimea on 30 March
   - Move location data Simferopol.

Modified:
  stable/6/share/zoneinfo/africa
  stable/6/share/zoneinfo/antarctica
  stable/6/share/zoneinfo/australasia
  stable/6/share/zoneinfo/europe
  stable/6/share/zoneinfo/zone.tab
Directory Properties:
  stable/6/share/zoneinfo/   (props changed)

Modified: stable/6/share/zoneinfo/africa
==
--- stable/6/share/zoneinfo/africa  Sat Mar 29 04:15:11 2014
(r263901)
+++ stable/6/share/zoneinfo/africa  Sat Mar 29 04:17:46 2014
(r263902)
@@ -868,7 +868,10 @@ Zone   Indian/Mayotte  3:00:56 -   LMT 1911 J
 # Another source (specifying the time for start and end in the decree):
 # http://www.lemag.ma/Heure-d-ete-au-Maroc-jusqu-au-27-octobre_a75620.html
 
-# From Paul Eggert (2013-10-03):
+# From Sebastien Willemijns (2014-03-18):
+# 
http://www.afriquinfos.com/articles/2014/3/18/maroc-heure-dete-avancez-tous-horloges-247891.asp
+
+# From Paul Eggert (2014-03-19):
 # To estimate what the Moroccan government will do in future years,
 # transition dates for 2014 through 2038 were determined by running
 # the following program under GNU Emacs 24.3:

Modified: stable/6/share/zoneinfo/antarctica
==
--- stable/6/share/zoneinfo/antarctica  Sat Mar 29 04:15:11 2014
(r263901)
+++ stable/6/share/zoneinfo/antarctica  Sat Mar 29 04:17:46 2014
(r263902)
@@ -230,24 +230,41 @@ Zone Antarctica/Syowa 0   -   zzz 1957 
Jan 2
 # year-round base
 # Scott Base, Ross Island, since 1957-01.
 # See Pacific/Auckland.
-#
-# These rules for New Zealand are stolen from the 'australasia' file.
-# Rule NAMEFROMTO  TYPEIN  ON  AT  SAVELETTER/S
-Rule   NZAQ1974only-   Nov  3  2:00s   1:00D
-Rule   NZAQ19751988-   Oct lastSun 2:00s   1:00D
-Rule   NZAQ1989only-   Oct  8  2:00s   1:00D
-Rule   NZAQ19902006-   Oct Sun=1  2:00s   1:00D
-Rule   NZAQ1975only-   Feb 23  2:00s   0   S
-Rule   NZAQ19761989-   Mar Sun=1  2:00s   0   S
-Rule   NZAQ19902007-   Mar Sun=15 2:00s   0   S
-Rule   NZAQ2007max -   Sep lastSun 2:00s   1:00D
-Rule   NZAQ2008max -   Apr Sun=1  2:00s   0   S
 
 # Norway - territories
 # Bouvet (never inhabited)
 #
 # claims
 # Peter I Island (never inhabited)
+#
+# year-round base
+# Troll, Queen Maud Land, -720041+0023206, since 2005-02-12
+#
+# From Paul-Inge Flakstad (2014-03-10):
+# I recently had a long dialog about this with the developer of timegenie.com.
+# In the absence of specific dates, he decided to choose some likely ones:
+#   GMT +1 - From March 1 to the last Sunday in March
+#   GMT +2 - From the last Sunday in March until the last Sunday in October
+#   GMT +1 - From the last Sunday in October until November 7
+#   GMT +0 - From November 7 until March 1
+# The dates for switching to and from UTC+0 will probably not be absolutely
+# correct, but they should be quite close to the actual dates.
+#
+# From Paul Eggert (2014-03-21):
+# The CET-switching Troll rules require zic from tzcode 2014b or later, so as
+# suggested by Bengt-Inge Larsson comment them out for now, and approximate
+# with only UTC and CEST.  Uncomment them when 2014b is more prevalent.
+#
+# Rule NAMEFROMTO  TYPEIN  ON  AT  SAVELETTER/S
+#Rule  Troll   2005max -   Mar  1  1:00u   1:00CET
+Rule   Troll   2005max -   Mar lastSun 1:00u   2:00CEST
+#Rule  Troll   2005max -   Oct lastSun 1:00u   1:00CET
+#Rule  Troll   2004max -   Nov  7  1:00u   0:00UTC
+# Remove the following line when uncommenting the above '#Rule' lines.
+Rule   Troll   2004max -   Oct lastSun 1:00u   0:00UTC
+# Zone NAMEGMTOFF  RULES   FORMAT  [UNTIL]
+Zone Antarctica/Troll  0   -   zzz 2005 Feb 12
+   0:00Troll   %s
 
 # Poland - year-round base
 # Arctowski, King George Island, -620945-0582745, since 1977

Modified: stable/6/share/zoneinfo/australasia
==
--- stable/6/share/zoneinfo/australasia Sat Mar 29 04:15:11 2014
(r263901)
+++ stable/6/share/zoneinfo/australasia Sat Mar 29 04:17:46 2014
(r263902)
@@ -763,14 +763,29 @@ Zone Pacific/Funafuti 11:56:52 -  LMT 190
 
 # Johnston
 #
-# From Paul Eggert (2013-09-03):
+# 

svn commit: r263903 - stable/7/share/zoneinfo

2014-03-28 Thread Edwin Groothuis
Author: edwin
Date: Sat Mar 29 04:19:48 2014
New Revision: 263903
URL: http://svnweb.freebsd.org/changeset/base/263903

Log:
  MFC of 263901, tzdata2014b
  
   - Update antartica.
   - Comments about historical data for Hawaii.
   - Update details for Crimea on 30 March
   - Move location data Simferopol.

Modified:
  stable/7/share/zoneinfo/africa
  stable/7/share/zoneinfo/antarctica
  stable/7/share/zoneinfo/australasia
  stable/7/share/zoneinfo/europe
  stable/7/share/zoneinfo/zone.tab
Directory Properties:
  stable/7/share/zoneinfo/   (props changed)

Modified: stable/7/share/zoneinfo/africa
==
--- stable/7/share/zoneinfo/africa  Sat Mar 29 04:17:46 2014
(r263902)
+++ stable/7/share/zoneinfo/africa  Sat Mar 29 04:19:48 2014
(r263903)
@@ -868,7 +868,10 @@ Zone   Indian/Mayotte  3:00:56 -   LMT 1911 J
 # Another source (specifying the time for start and end in the decree):
 # http://www.lemag.ma/Heure-d-ete-au-Maroc-jusqu-au-27-octobre_a75620.html
 
-# From Paul Eggert (2013-10-03):
+# From Sebastien Willemijns (2014-03-18):
+# 
http://www.afriquinfos.com/articles/2014/3/18/maroc-heure-dete-avancez-tous-horloges-247891.asp
+
+# From Paul Eggert (2014-03-19):
 # To estimate what the Moroccan government will do in future years,
 # transition dates for 2014 through 2038 were determined by running
 # the following program under GNU Emacs 24.3:

Modified: stable/7/share/zoneinfo/antarctica
==
--- stable/7/share/zoneinfo/antarctica  Sat Mar 29 04:17:46 2014
(r263902)
+++ stable/7/share/zoneinfo/antarctica  Sat Mar 29 04:19:48 2014
(r263903)
@@ -230,24 +230,41 @@ Zone Antarctica/Syowa 0   -   zzz 1957 
Jan 2
 # year-round base
 # Scott Base, Ross Island, since 1957-01.
 # See Pacific/Auckland.
-#
-# These rules for New Zealand are stolen from the 'australasia' file.
-# Rule NAMEFROMTO  TYPEIN  ON  AT  SAVELETTER/S
-Rule   NZAQ1974only-   Nov  3  2:00s   1:00D
-Rule   NZAQ19751988-   Oct lastSun 2:00s   1:00D
-Rule   NZAQ1989only-   Oct  8  2:00s   1:00D
-Rule   NZAQ19902006-   Oct Sun=1  2:00s   1:00D
-Rule   NZAQ1975only-   Feb 23  2:00s   0   S
-Rule   NZAQ19761989-   Mar Sun=1  2:00s   0   S
-Rule   NZAQ19902007-   Mar Sun=15 2:00s   0   S
-Rule   NZAQ2007max -   Sep lastSun 2:00s   1:00D
-Rule   NZAQ2008max -   Apr Sun=1  2:00s   0   S
 
 # Norway - territories
 # Bouvet (never inhabited)
 #
 # claims
 # Peter I Island (never inhabited)
+#
+# year-round base
+# Troll, Queen Maud Land, -720041+0023206, since 2005-02-12
+#
+# From Paul-Inge Flakstad (2014-03-10):
+# I recently had a long dialog about this with the developer of timegenie.com.
+# In the absence of specific dates, he decided to choose some likely ones:
+#   GMT +1 - From March 1 to the last Sunday in March
+#   GMT +2 - From the last Sunday in March until the last Sunday in October
+#   GMT +1 - From the last Sunday in October until November 7
+#   GMT +0 - From November 7 until March 1
+# The dates for switching to and from UTC+0 will probably not be absolutely
+# correct, but they should be quite close to the actual dates.
+#
+# From Paul Eggert (2014-03-21):
+# The CET-switching Troll rules require zic from tzcode 2014b or later, so as
+# suggested by Bengt-Inge Larsson comment them out for now, and approximate
+# with only UTC and CEST.  Uncomment them when 2014b is more prevalent.
+#
+# Rule NAMEFROMTO  TYPEIN  ON  AT  SAVELETTER/S
+#Rule  Troll   2005max -   Mar  1  1:00u   1:00CET
+Rule   Troll   2005max -   Mar lastSun 1:00u   2:00CEST
+#Rule  Troll   2005max -   Oct lastSun 1:00u   1:00CET
+#Rule  Troll   2004max -   Nov  7  1:00u   0:00UTC
+# Remove the following line when uncommenting the above '#Rule' lines.
+Rule   Troll   2004max -   Oct lastSun 1:00u   0:00UTC
+# Zone NAMEGMTOFF  RULES   FORMAT  [UNTIL]
+Zone Antarctica/Troll  0   -   zzz 2005 Feb 12
+   0:00Troll   %s
 
 # Poland - year-round base
 # Arctowski, King George Island, -620945-0582745, since 1977

Modified: stable/7/share/zoneinfo/australasia
==
--- stable/7/share/zoneinfo/australasia Sat Mar 29 04:17:46 2014
(r263902)
+++ stable/7/share/zoneinfo/australasia Sat Mar 29 04:19:48 2014
(r263903)
@@ -763,14 +763,29 @@ Zone Pacific/Funafuti 11:56:52 -  LMT 190
 
 # Johnston
 #
-# From Paul Eggert (2013-09-03):
+# 

svn commit: r263904 - stable/8/share/zoneinfo

2014-03-28 Thread Edwin Groothuis
Author: edwin
Date: Sat Mar 29 04:20:55 2014
New Revision: 263904
URL: http://svnweb.freebsd.org/changeset/base/263904

Log:
  MFC of 263901, tzdata2014b
  
   - Update antartica.
   - Comments about historical data for Hawaii.
   - Update details for Crimea on 30 March
   - Move location data Simferopol.

Modified:
  stable/8/share/zoneinfo/africa
  stable/8/share/zoneinfo/antarctica
  stable/8/share/zoneinfo/australasia
  stable/8/share/zoneinfo/europe
  stable/8/share/zoneinfo/zone.tab
Directory Properties:
  stable/8/share/zoneinfo/   (props changed)

Modified: stable/8/share/zoneinfo/africa
==
--- stable/8/share/zoneinfo/africa  Sat Mar 29 04:19:48 2014
(r263903)
+++ stable/8/share/zoneinfo/africa  Sat Mar 29 04:20:55 2014
(r263904)
@@ -868,7 +868,10 @@ Zone   Indian/Mayotte  3:00:56 -   LMT 1911 J
 # Another source (specifying the time for start and end in the decree):
 # http://www.lemag.ma/Heure-d-ete-au-Maroc-jusqu-au-27-octobre_a75620.html
 
-# From Paul Eggert (2013-10-03):
+# From Sebastien Willemijns (2014-03-18):
+# 
http://www.afriquinfos.com/articles/2014/3/18/maroc-heure-dete-avancez-tous-horloges-247891.asp
+
+# From Paul Eggert (2014-03-19):
 # To estimate what the Moroccan government will do in future years,
 # transition dates for 2014 through 2038 were determined by running
 # the following program under GNU Emacs 24.3:

Modified: stable/8/share/zoneinfo/antarctica
==
--- stable/8/share/zoneinfo/antarctica  Sat Mar 29 04:19:48 2014
(r263903)
+++ stable/8/share/zoneinfo/antarctica  Sat Mar 29 04:20:55 2014
(r263904)
@@ -230,24 +230,41 @@ Zone Antarctica/Syowa 0   -   zzz 1957 
Jan 2
 # year-round base
 # Scott Base, Ross Island, since 1957-01.
 # See Pacific/Auckland.
-#
-# These rules for New Zealand are stolen from the 'australasia' file.
-# Rule NAMEFROMTO  TYPEIN  ON  AT  SAVELETTER/S
-Rule   NZAQ1974only-   Nov  3  2:00s   1:00D
-Rule   NZAQ19751988-   Oct lastSun 2:00s   1:00D
-Rule   NZAQ1989only-   Oct  8  2:00s   1:00D
-Rule   NZAQ19902006-   Oct Sun=1  2:00s   1:00D
-Rule   NZAQ1975only-   Feb 23  2:00s   0   S
-Rule   NZAQ19761989-   Mar Sun=1  2:00s   0   S
-Rule   NZAQ19902007-   Mar Sun=15 2:00s   0   S
-Rule   NZAQ2007max -   Sep lastSun 2:00s   1:00D
-Rule   NZAQ2008max -   Apr Sun=1  2:00s   0   S
 
 # Norway - territories
 # Bouvet (never inhabited)
 #
 # claims
 # Peter I Island (never inhabited)
+#
+# year-round base
+# Troll, Queen Maud Land, -720041+0023206, since 2005-02-12
+#
+# From Paul-Inge Flakstad (2014-03-10):
+# I recently had a long dialog about this with the developer of timegenie.com.
+# In the absence of specific dates, he decided to choose some likely ones:
+#   GMT +1 - From March 1 to the last Sunday in March
+#   GMT +2 - From the last Sunday in March until the last Sunday in October
+#   GMT +1 - From the last Sunday in October until November 7
+#   GMT +0 - From November 7 until March 1
+# The dates for switching to and from UTC+0 will probably not be absolutely
+# correct, but they should be quite close to the actual dates.
+#
+# From Paul Eggert (2014-03-21):
+# The CET-switching Troll rules require zic from tzcode 2014b or later, so as
+# suggested by Bengt-Inge Larsson comment them out for now, and approximate
+# with only UTC and CEST.  Uncomment them when 2014b is more prevalent.
+#
+# Rule NAMEFROMTO  TYPEIN  ON  AT  SAVELETTER/S
+#Rule  Troll   2005max -   Mar  1  1:00u   1:00CET
+Rule   Troll   2005max -   Mar lastSun 1:00u   2:00CEST
+#Rule  Troll   2005max -   Oct lastSun 1:00u   1:00CET
+#Rule  Troll   2004max -   Nov  7  1:00u   0:00UTC
+# Remove the following line when uncommenting the above '#Rule' lines.
+Rule   Troll   2004max -   Oct lastSun 1:00u   0:00UTC
+# Zone NAMEGMTOFF  RULES   FORMAT  [UNTIL]
+Zone Antarctica/Troll  0   -   zzz 2005 Feb 12
+   0:00Troll   %s
 
 # Poland - year-round base
 # Arctowski, King George Island, -620945-0582745, since 1977

Modified: stable/8/share/zoneinfo/australasia
==
--- stable/8/share/zoneinfo/australasia Sat Mar 29 04:19:48 2014
(r263903)
+++ stable/8/share/zoneinfo/australasia Sat Mar 29 04:20:55 2014
(r263904)
@@ -763,14 +763,29 @@ Zone Pacific/Funafuti 11:56:52 -  LMT 190
 
 # Johnston
 #
-# From Paul Eggert (2013-09-03):
+# 

svn commit: r263905 - stable/9/contrib/tzdata

2014-03-28 Thread Edwin Groothuis
Author: edwin
Date: Sat Mar 29 04:25:04 2014
New Revision: 263905
URL: http://svnweb.freebsd.org/changeset/base/263905

Log:
  MFC of 263901, tzdata2014b
  
   - Update antartica.
   - Comments about historical data for Hawaii.
   - Update details for Crimea on 30 March
   - Move location data Simferopol.

Modified:
  stable/9/contrib/tzdata/africa
  stable/9/contrib/tzdata/antarctica
  stable/9/contrib/tzdata/australasia
  stable/9/contrib/tzdata/europe
  stable/9/contrib/tzdata/zone.tab
Directory Properties:
  stable/9/contrib/tzdata/   (props changed)

Modified: stable/9/contrib/tzdata/africa
==
--- stable/9/contrib/tzdata/africa  Sat Mar 29 04:20:55 2014
(r263904)
+++ stable/9/contrib/tzdata/africa  Sat Mar 29 04:25:04 2014
(r263905)
@@ -868,7 +868,10 @@ Zone   Indian/Mayotte  3:00:56 -   LMT 1911 J
 # Another source (specifying the time for start and end in the decree):
 # http://www.lemag.ma/Heure-d-ete-au-Maroc-jusqu-au-27-octobre_a75620.html
 
-# From Paul Eggert (2013-10-03):
+# From Sebastien Willemijns (2014-03-18):
+# 
http://www.afriquinfos.com/articles/2014/3/18/maroc-heure-dete-avancez-tous-horloges-247891.asp
+
+# From Paul Eggert (2014-03-19):
 # To estimate what the Moroccan government will do in future years,
 # transition dates for 2014 through 2038 were determined by running
 # the following program under GNU Emacs 24.3:

Modified: stable/9/contrib/tzdata/antarctica
==
--- stable/9/contrib/tzdata/antarctica  Sat Mar 29 04:20:55 2014
(r263904)
+++ stable/9/contrib/tzdata/antarctica  Sat Mar 29 04:25:04 2014
(r263905)
@@ -230,24 +230,41 @@ Zone Antarctica/Syowa 0   -   zzz 1957 
Jan 2
 # year-round base
 # Scott Base, Ross Island, since 1957-01.
 # See Pacific/Auckland.
-#
-# These rules for New Zealand are stolen from the 'australasia' file.
-# Rule NAMEFROMTO  TYPEIN  ON  AT  SAVELETTER/S
-Rule   NZAQ1974only-   Nov  3  2:00s   1:00D
-Rule   NZAQ19751988-   Oct lastSun 2:00s   1:00D
-Rule   NZAQ1989only-   Oct  8  2:00s   1:00D
-Rule   NZAQ19902006-   Oct Sun=1  2:00s   1:00D
-Rule   NZAQ1975only-   Feb 23  2:00s   0   S
-Rule   NZAQ19761989-   Mar Sun=1  2:00s   0   S
-Rule   NZAQ19902007-   Mar Sun=15 2:00s   0   S
-Rule   NZAQ2007max -   Sep lastSun 2:00s   1:00D
-Rule   NZAQ2008max -   Apr Sun=1  2:00s   0   S
 
 # Norway - territories
 # Bouvet (never inhabited)
 #
 # claims
 # Peter I Island (never inhabited)
+#
+# year-round base
+# Troll, Queen Maud Land, -720041+0023206, since 2005-02-12
+#
+# From Paul-Inge Flakstad (2014-03-10):
+# I recently had a long dialog about this with the developer of timegenie.com.
+# In the absence of specific dates, he decided to choose some likely ones:
+#   GMT +1 - From March 1 to the last Sunday in March
+#   GMT +2 - From the last Sunday in March until the last Sunday in October
+#   GMT +1 - From the last Sunday in October until November 7
+#   GMT +0 - From November 7 until March 1
+# The dates for switching to and from UTC+0 will probably not be absolutely
+# correct, but they should be quite close to the actual dates.
+#
+# From Paul Eggert (2014-03-21):
+# The CET-switching Troll rules require zic from tzcode 2014b or later, so as
+# suggested by Bengt-Inge Larsson comment them out for now, and approximate
+# with only UTC and CEST.  Uncomment them when 2014b is more prevalent.
+#
+# Rule NAMEFROMTO  TYPEIN  ON  AT  SAVELETTER/S
+#Rule  Troll   2005max -   Mar  1  1:00u   1:00CET
+Rule   Troll   2005max -   Mar lastSun 1:00u   2:00CEST
+#Rule  Troll   2005max -   Oct lastSun 1:00u   1:00CET
+#Rule  Troll   2004max -   Nov  7  1:00u   0:00UTC
+# Remove the following line when uncommenting the above '#Rule' lines.
+Rule   Troll   2004max -   Oct lastSun 1:00u   0:00UTC
+# Zone NAMEGMTOFF  RULES   FORMAT  [UNTIL]
+Zone Antarctica/Troll  0   -   zzz 2005 Feb 12
+   0:00Troll   %s
 
 # Poland - year-round base
 # Arctowski, King George Island, -620945-0582745, since 1977

Modified: stable/9/contrib/tzdata/australasia
==
--- stable/9/contrib/tzdata/australasia Sat Mar 29 04:20:55 2014
(r263904)
+++ stable/9/contrib/tzdata/australasia Sat Mar 29 04:25:04 2014
(r263905)
@@ -763,14 +763,29 @@ Zone Pacific/Funafuti 11:56:52 -  LMT 190
 
 # Johnston
 #
-# From Paul Eggert (2013-09-03):
+# 

Re: svn commit: r263755 - head/sys/kern

2014-03-28 Thread David Xu


On 2014/03/29 12:14, Mateusz Guzik wrote:
I asked if multpiple concurrent calls to fsetown(.., pointer) could 
result in some corruption in the kernel - if they could, we would have 
a problem in the future. I decided to read the code once more and 
fsetown seems to be safe in this regard after all and with that in 
mind the patch looks good to me. This thread is too long already, so 
I'm stepping down on this one in case there are some futher concerns. 

This thread is really long, but things must be clarified, so it was not
long enough. :-)
Previously I supposed you had read the fsetown code, if not, I was wrong,
lol.

___
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: r263906 - stable/10/contrib/tzdata

2014-03-28 Thread Edwin Groothuis
Author: edwin
Date: Sat Mar 29 04:44:24 2014
New Revision: 263906
URL: http://svnweb.freebsd.org/changeset/base/263906

Log:
  MFC of 263901, tzdata2014b
  
   - Update antartica.
   - Comments about historical data for Hawaii.
   - Update details for Crimea on 30 March
   - Move location data Simferopol.

Modified:
  stable/10/contrib/tzdata/africa
  stable/10/contrib/tzdata/antarctica
  stable/10/contrib/tzdata/australasia
  stable/10/contrib/tzdata/europe
  stable/10/contrib/tzdata/zone.tab
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/contrib/tzdata/africa
==
--- stable/10/contrib/tzdata/africa Sat Mar 29 04:25:04 2014
(r263905)
+++ stable/10/contrib/tzdata/africa Sat Mar 29 04:44:24 2014
(r263906)
@@ -868,7 +868,10 @@ Zone   Indian/Mayotte  3:00:56 -   LMT 1911 J
 # Another source (specifying the time for start and end in the decree):
 # http://www.lemag.ma/Heure-d-ete-au-Maroc-jusqu-au-27-octobre_a75620.html
 
-# From Paul Eggert (2013-10-03):
+# From Sebastien Willemijns (2014-03-18):
+# 
http://www.afriquinfos.com/articles/2014/3/18/maroc-heure-dete-avancez-tous-horloges-247891.asp
+
+# From Paul Eggert (2014-03-19):
 # To estimate what the Moroccan government will do in future years,
 # transition dates for 2014 through 2038 were determined by running
 # the following program under GNU Emacs 24.3:

Modified: stable/10/contrib/tzdata/antarctica
==
--- stable/10/contrib/tzdata/antarctica Sat Mar 29 04:25:04 2014
(r263905)
+++ stable/10/contrib/tzdata/antarctica Sat Mar 29 04:44:24 2014
(r263906)
@@ -230,24 +230,41 @@ Zone Antarctica/Syowa 0   -   zzz 1957 
Jan 2
 # year-round base
 # Scott Base, Ross Island, since 1957-01.
 # See Pacific/Auckland.
-#
-# These rules for New Zealand are stolen from the 'australasia' file.
-# Rule NAMEFROMTO  TYPEIN  ON  AT  SAVELETTER/S
-Rule   NZAQ1974only-   Nov  3  2:00s   1:00D
-Rule   NZAQ19751988-   Oct lastSun 2:00s   1:00D
-Rule   NZAQ1989only-   Oct  8  2:00s   1:00D
-Rule   NZAQ19902006-   Oct Sun=1  2:00s   1:00D
-Rule   NZAQ1975only-   Feb 23  2:00s   0   S
-Rule   NZAQ19761989-   Mar Sun=1  2:00s   0   S
-Rule   NZAQ19902007-   Mar Sun=15 2:00s   0   S
-Rule   NZAQ2007max -   Sep lastSun 2:00s   1:00D
-Rule   NZAQ2008max -   Apr Sun=1  2:00s   0   S
 
 # Norway - territories
 # Bouvet (never inhabited)
 #
 # claims
 # Peter I Island (never inhabited)
+#
+# year-round base
+# Troll, Queen Maud Land, -720041+0023206, since 2005-02-12
+#
+# From Paul-Inge Flakstad (2014-03-10):
+# I recently had a long dialog about this with the developer of timegenie.com.
+# In the absence of specific dates, he decided to choose some likely ones:
+#   GMT +1 - From March 1 to the last Sunday in March
+#   GMT +2 - From the last Sunday in March until the last Sunday in October
+#   GMT +1 - From the last Sunday in October until November 7
+#   GMT +0 - From November 7 until March 1
+# The dates for switching to and from UTC+0 will probably not be absolutely
+# correct, but they should be quite close to the actual dates.
+#
+# From Paul Eggert (2014-03-21):
+# The CET-switching Troll rules require zic from tzcode 2014b or later, so as
+# suggested by Bengt-Inge Larsson comment them out for now, and approximate
+# with only UTC and CEST.  Uncomment them when 2014b is more prevalent.
+#
+# Rule NAMEFROMTO  TYPEIN  ON  AT  SAVELETTER/S
+#Rule  Troll   2005max -   Mar  1  1:00u   1:00CET
+Rule   Troll   2005max -   Mar lastSun 1:00u   2:00CEST
+#Rule  Troll   2005max -   Oct lastSun 1:00u   1:00CET
+#Rule  Troll   2004max -   Nov  7  1:00u   0:00UTC
+# Remove the following line when uncommenting the above '#Rule' lines.
+Rule   Troll   2004max -   Oct lastSun 1:00u   0:00UTC
+# Zone NAMEGMTOFF  RULES   FORMAT  [UNTIL]
+Zone Antarctica/Troll  0   -   zzz 2005 Feb 12
+   0:00Troll   %s
 
 # Poland - year-round base
 # Arctowski, King George Island, -620945-0582745, since 1977

Modified: stable/10/contrib/tzdata/australasia
==
--- stable/10/contrib/tzdata/australasiaSat Mar 29 04:25:04 2014
(r263905)
+++ stable/10/contrib/tzdata/australasiaSat Mar 29 04:44:24 2014
(r263906)
@@ -763,14 +763,29 @@ Zone Pacific/Funafuti 11:56:52 -  LMT 190
 
 # Johnston
 #
-# From Paul Eggert