Re: svn commit: r278433 - in head: . contrib/xz contrib/xz/src/common contrib/xz/src/liblzma contrib/xz/src/liblzma/api contrib/xz/src/liblzma/api/lzma contrib/xz/src/liblzma/check contrib/xz/src/libl

2015-02-09 Thread Rui Paulo
On Feb 8, 2015, at 22:20, Rui Paulo  wrote:
> 
> Author: rpaulo
> Date: Mon Feb  9 06:20:34 2015
> New Revision: 278433
> URL: https://svnweb.freebsd.org/changeset/base/278433
> 
> Log:
>  Merge xz 5.2.0.
> 
>  This brings support for multi-threaded compression.  This brings close
>  N times faster compression where N is the number of CPU cores.
>  Because of this, liblzma now depends on libthr.

For those that want to try it, this patch adds support to multi-threaded 
compression when using lzma in libarchive:

https://people.freebsd.org/~rpaulo/libarchive-lzma-mt.diff

It uses all the available CPU cores by default.

--
Rui Paulo



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


Re: svn commit: r278431 - head/sys/contrib/vchiq/interface/vchiq_arm

2015-02-09 Thread Konstantin Belousov
On Mon, Feb 09, 2015 at 05:00:49PM +1100, Bruce Evans wrote:
> On Mon, 9 Feb 2015, Oleksandr Tymoshenko wrote:
> 
> > Log:
> >  Do not mark shared structures as __packed, it leads to race condition
> >
> >  If structure packed as __packed clang (and probably gcc) generates
> >  code that loads word fields (e.g. tx_pos)  byte-by-byte and if it's
> >  modified by VideoCore in the same time as ARM loads the value result
> >  is going to be mixed combination of bytes from previous value and
> >  new one.
> 
> Most uses of __packed are bugs.  It gives pessimizations as well as
> non-atomic accesses for sub-object accesses.
> 
> I think the full bugs only occur when arch has strict alignment
> requirements and the alignment of the __packed objects is not known.
> This means that only lesser bugs occur on x86 (unless you enable
> alignment checking, but this arguably breaks the ABI).  The compiler
> just generates possibly-misaligned full-width accesses if the arch
> doesn't have strict alignment requirements.  Often the acceses turn
> out to be aligned at runtime.  Otherwise, the hardware does them
> atomically, with a smaller efficiency penalty than split accesses.

On x86 unaligned access is non-atomic.  This was very visible on
Core2 CPUs where DPCPU code mishandled the alignment, resulting in
the mutexes from the per-cpu areas breaking badly.

Modern CPUs should not lock several cache lines simultaneously either.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r278442 - head/sys/sys

2015-02-09 Thread Xin LI
Author: delphij
Date: Mon Feb  9 09:17:00 2015
New Revision: 278442
URL: https://svnweb.freebsd.org/changeset/base/278442

Log:
  Chase r278433: bump __FreeBSD_version for xz 5.2.0 which adds multi-thread
  capability to liblzma.

Modified:
  head/sys/sys/param.h

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hMon Feb  9 09:14:22 2015(r278441)
+++ head/sys/sys/param.hMon Feb  9 09:17:00 2015(r278442)
@@ -58,7 +58,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1100058  /* Master, propagated to newvers */
+#define __FreeBSD_version 1100059  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r278431 - head/sys/contrib/vchiq/interface/vchiq_arm

2015-02-09 Thread Bruce Evans

On Mon, 9 Feb 2015, Konstantin Belousov wrote:


On Mon, Feb 09, 2015 at 05:00:49PM +1100, Bruce Evans wrote:

On Mon, 9 Feb 2015, Oleksandr Tymoshenko wrote:
...
I think the full bugs only occur when arch has strict alignment
requirements and the alignment of the __packed objects is not known.
This means that only lesser bugs occur on x86 (unless you enable
alignment checking, but this arguably breaks the ABI).  The compiler
just generates possibly-misaligned full-width accesses if the arch
doesn't have strict alignment requirements.  Often the acceses turn
out to be aligned at runtime.  Otherwise, the hardware does them
atomically, with a smaller efficiency penalty than split accesses.


On x86 unaligned access is non-atomic.  This was very visible on
Core2 CPUs where DPCPU code mishandled the alignment, resulting in
the mutexes from the per-cpu areas breaking badly.

Modern CPUs should not lock several cache lines simultaneously either.


Interesting.  I thought that this was relatively easy to handle in
hardware and required for compatibility, so hardware did it.

This gives a reason other than efficiency to enable alignment checking
so as to find all places that do misaligned accesses.  I last tried this
more than 20 years ago.  Compilers mostly generated aligned accesses.
One exception was for copying small (sub)structs.  Inlining of the copy
assumed maximal alignment or no alignment traps.  Library functions are
more of a problem.  FreeBSD amd64 and i386 memcpy also assume this.
Similarly for the MD mem* in the kernel.  Mostly things are suitably
aligned, so it is the correct optimization to not do extra work to align.

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


svn commit: r278445 - head/release

2015-02-09 Thread Glen Barber
Author: gjb
Date: Mon Feb  9 09:56:21 2015
New Revision: 278445
URL: https://svnweb.freebsd.org/changeset/base/278445

Log:
  Define FREEBSD_VERSION in release/Makefile, derived
  from sys/sys/param.h.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/release/Makefile

Modified: head/release/Makefile
==
--- head/release/Makefile   Mon Feb  9 09:45:58 2015(r278444)
+++ head/release/Makefile   Mon Feb  9 09:56:21 2015(r278445)
@@ -54,6 +54,10 @@ TARGET_ARCH= ${TARGET}
 IMAKE= ${MAKE} TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}
 DISTDIR=   dist
 
+# Get the __FreeBSD_version for the build
+FREEBSD_VERSION!=  awk '/^\#define __FreeBSD_version/ {print $$3}' \
+   ${.CURDIR}/../sys/sys/param.h
+
 # Define OSRELEASE by using newvars.sh
 .if !defined(OSRELEASE) || empty(OSRELEASE)
 .for _V in TYPE BRANCH REVISION
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r278431 - head/sys/contrib/vchiq/interface/vchiq_arm

2015-02-09 Thread Konstantin Belousov
On Mon, Feb 09, 2015 at 08:51:02PM +1100, Bruce Evans wrote:
> On Mon, 9 Feb 2015, Konstantin Belousov wrote:
> 
> > On Mon, Feb 09, 2015 at 05:00:49PM +1100, Bruce Evans wrote:
> >> On Mon, 9 Feb 2015, Oleksandr Tymoshenko wrote:
> >> ...
> >> I think the full bugs only occur when arch has strict alignment
> >> requirements and the alignment of the __packed objects is not known.
> >> This means that only lesser bugs occur on x86 (unless you enable
> >> alignment checking, but this arguably breaks the ABI).  The compiler
> >> just generates possibly-misaligned full-width accesses if the arch
> >> doesn't have strict alignment requirements.  Often the acceses turn
> >> out to be aligned at runtime.  Otherwise, the hardware does them
> >> atomically, with a smaller efficiency penalty than split accesses.
> >
> > On x86 unaligned access is non-atomic.  This was very visible on
> > Core2 CPUs where DPCPU code mishandled the alignment, resulting in
> > the mutexes from the per-cpu areas breaking badly.
> >
> > Modern CPUs should not lock several cache lines simultaneously either.
> 
> Interesting.  I thought that this was relatively easy to handle in
> hardware and required for compatibility, so hardware did it.
Trying to lock to cache lines easily results in deadlock.
FWIW, multi-socket Intel platforms are already deadlock-prone due
to the cache, and have some facilities to debug this.

> 
> This gives a reason other than efficiency to enable alignment checking
> so as to find all places that do misaligned accesses.  I last tried this
> more than 20 years ago.  Compilers mostly generated aligned accesses.
> One exception was for copying small (sub)structs.  Inlining of the copy
> assumed maximal alignment or no alignment traps.  Library functions are
> more of a problem.  FreeBSD amd64 and i386 memcpy also assume this.
> Similarly for the MD mem* in the kernel.  Mostly things are suitably
> aligned, so it is the correct optimization to not do extra work to align.

I also did experiments with preloadable dso which sets EFLAGS.AC bit.
Last time I tried, it broke in the very early libc initialization code,
due to unaligned access generated by compiler, as you described. This
was with in-tree gcc. Tried with the clang-compiled world, I got SIGBUS
due to unaligned access in ld-elf.so.1.

AC does not work in ring 0, and Intel re-purposed the bit for kernel
recently for 'security' theater.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r278449 - head/release

2015-02-09 Thread Glen Barber
Author: gjb
Date: Mon Feb  9 10:42:27 2015
New Revision: 278449
URL: https://svnweb.freebsd.org/changeset/base/278449

Log:
  Enable multi-threaded xz(1) compression, after r278433.
  Allow multi-threaded xz(1) to be turned off by specifying
  NO_XZTHREADS, and allow number of threads to be overridden
  by specifying XZ_THREADS=N.
  
  MFC after:1 week
  X-MFC-needs:  r278433
  Sponsored by: The FreeBSD Foundation

Modified:
  head/release/Makefile
  head/release/Makefile.vm

Modified: head/release/Makefile
==
--- head/release/Makefile   Mon Feb  9 10:38:52 2015(r278448)
+++ head/release/Makefile   Mon Feb  9 10:42:27 2015(r278449)
@@ -33,6 +33,9 @@
 #  with xz(1) (extremely time consuming)
 #  WITH_CLOUDWARE: if set, build cloud hosting disk images with the release
 #  TARGET/TARGET_ARCH: architecture of built release
+#  XZ_FLAGS: Additional arguments to pass to xz(1)
+#  XZ_THREADS: Number of xz(1) threads to use
+#  NO_XZTHREADS: Disable multi-threaded xz(1) compression
 #
 
 WORLDDIR?= ${.CURDIR}/..
@@ -40,6 +43,8 @@ PORTSDIR?=/usr/ports
 DOCDIR?=   /usr/doc
 RELNOTES_LANG?= en_US.ISO8859-1
 XZCMD?=/usr/bin/xz
+XZ_FLAGS?=
+XZ_THREADS?=
 
 .if !defined(TARGET) || empty(TARGET)
 TARGET=${MACHINE}
@@ -58,6 +63,15 @@ DISTDIR= dist
 FREEBSD_VERSION!=  awk '/^\#define __FreeBSD_version/ {print $$3}' \
${.CURDIR}/../sys/sys/param.h
 
+.if !defined(NO_XZTHREADS) && empty(XZ_THREADS)
+XZ_THREADS=0
+.else
+XZ_THREADS=${XZ_THREADS}
+.endif
+.if !empty(XZ_THREADS)
+XZ_FLAGS+= -T ${XZ_THREADS}
+.endif
+
 # Define OSRELEASE by using newvars.sh
 .if !defined(OSRELEASE) || empty(OSRELEASE)
 .for _V in TYPE BRANCH REVISION
@@ -299,7 +313,7 @@ release-install:
 .for I in ${IMAGES}
cp -p ${I} ${DESTDIR}/${OSRELEASE}-${I}
 . if defined(WITH_COMPRESSED_IMAGES) && !empty(WITH_COMPRESSED_IMAGES)
-   ${XZCMD} -k ${DESTDIR}/${OSRELEASE}-${I}
+   ${XZCMD} ${XZ_FLAGS} -k ${DESTDIR}/${OSRELEASE}-${I}
 . endif
 .endfor
cd ${DESTDIR} && sha256 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.SHA256

Modified: head/release/Makefile.vm
==
--- head/release/Makefile.vmMon Feb  9 10:38:52 2015(r278448)
+++ head/release/Makefile.vmMon Feb  9 10:42:27 2015(r278449)
@@ -101,7 +101,7 @@ vm-install:
 # the DESTDIR.
 .  for FORMAT in ${VMFORMATS}
# Don't keep the originals.  There is a copy in ${.OBJDIR} if needed.
-   ${XZCMD} ${DESTDIR}/vmimages/${OSRELEASE}.${FORMAT}
+   ${XZCMD} ${XZ_FLAGS} ${DESTDIR}/vmimages/${OSRELEASE}.${FORMAT}
 .  endfor
 . endif
cd ${DESTDIR}/vmimages && sha256 ${OSRELEASE}* > \
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r278450 - head/release

2015-02-09 Thread Glen Barber
Author: gjb
Date: Mon Feb  9 10:46:39 2015
New Revision: 278450
URL: https://svnweb.freebsd.org/changeset/base/278450

Log:
  Revert r278445.
  
  I was going to use __FreeBSD_version to determine if
  xz(1) should be multi-threaded by default, but doing
  this will cause problems if/when the changes are merged
  from head.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/release/Makefile

Modified: head/release/Makefile
==
--- head/release/Makefile   Mon Feb  9 10:42:27 2015(r278449)
+++ head/release/Makefile   Mon Feb  9 10:46:39 2015(r278450)
@@ -59,10 +59,6 @@ TARGET_ARCH= ${TARGET}
 IMAKE= ${MAKE} TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}
 DISTDIR=   dist
 
-# Get the __FreeBSD_version for the build
-FREEBSD_VERSION!=  awk '/^\#define __FreeBSD_version/ {print $$3}' \
-   ${.CURDIR}/../sys/sys/param.h
-
 .if !defined(NO_XZTHREADS) && empty(XZ_THREADS)
 XZ_THREADS=0
 .else
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r278452 - head/sys/powerpc/pseries

2015-02-09 Thread Bjoern A. Zeeb
Author: bz
Date: Mon Feb  9 11:34:45 2015
New Revision: 278452
URL: https://svnweb.freebsd.org/changeset/base/278452

Log:
  Properly hide a variable under #ifdef as it is only used inside the
  specific #ifdef block otherwise leaving an unused variable and breaking
  other kernel builds.

Modified:
  head/sys/powerpc/pseries/platform_chrp.c

Modified: head/sys/powerpc/pseries/platform_chrp.c
==
--- head/sys/powerpc/pseries/platform_chrp.cMon Feb  9 11:11:17 2015
(r278451)
+++ head/sys/powerpc/pseries/platform_chrp.cMon Feb  9 11:34:45 2015
(r278452)
@@ -124,9 +124,9 @@ chrp_probe(platform_t plat)
 static int
 chrp_attach(platform_t plat)
 {
+#ifdef __powerpc64__
int i;
 
-#ifdef __powerpc64__
/* XXX: check for /rtas/ibm,hypertas-functions? */
if (!(mfmsr() & PSL_HV)) {
struct mem_region *phys, *avail;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r278433 - in head: . contrib/xz contrib/xz/src/common contrib/xz/src/liblzma contrib/xz/src/liblzma/api contrib/xz/src/liblzma/api/lzma contrib/xz/src/liblzma/check contrib/xz/src/libl

2015-02-09 Thread Glen Barber
On Mon, Feb 09, 2015 at 06:20:35AM +, Rui Paulo wrote:
> Author: rpaulo
> Date: Mon Feb  9 06:20:34 2015
> New Revision: 278433
> URL: https://svnweb.freebsd.org/changeset/base/278433
> 
> Log:
>   Merge xz 5.2.0.
>   
>   This brings support for multi-threaded compression.  This brings close
>   N times faster compression where N is the number of CPU cores.
>   Because of this, liblzma now depends on libthr.
>   

This is fantastic, thank you for doing this update.

FWIW, compressing VM images (some sparse files, some not) would take
upwards of 45 minutes, which after this update, just takes a few
minutes.

 root@releng2:/R2/vmimages # time xz -T 0 -k FreeBSD-11.0-CURRENT-amd64.qcow2 \
 time xz -T 0 -k FreeBSD-11.0-CURRENT-amd64.raw; \
 time xz -T 0 -k FreeBSD-11.0-CURRENT-amd64.vhd; \
 time xz -T 0 -k FreeBSD-11.0-CURRENT-amd64.vmdk
 1027.602u 40.376s 1:09.57 1535.1%   81+192k 0+19774io 0pf+0w
 1032.978u 38.823s 1:08.17 1572.2%   81+192k 0+19696io 0pf+0w
 1033.908u 38.593s 1:11.70 1495.8%   81+192k 0+19729io 0pf+0w
 1091.749u 42.371s 1:04.27 1764.6%   81+192k 0+19751io 0pf+0w

Glen



pgpaJ5_WSDD4i.pgp
Description: PGP signature


Re: svn commit: r278433 - in head: . contrib/xz contrib/xz/src/common contrib/xz/src/liblzma contrib/xz/src/liblzma/api contrib/xz/src/liblzma/api/lzma contrib/xz/src/liblzma/check contrib/xz/src/libl

2015-02-09 Thread Glen Barber
On Mon, Feb 09, 2015 at 12:25:40PM +, Glen Barber wrote:
> On Mon, Feb 09, 2015 at 06:20:35AM +, Rui Paulo wrote:
> > Author: rpaulo
> > Date: Mon Feb  9 06:20:34 2015
> > New Revision: 278433
> > URL: https://svnweb.freebsd.org/changeset/base/278433
> > 
> > Log:
> >   Merge xz 5.2.0.
> >   
> >   This brings support for multi-threaded compression.  This brings close
> >   N times faster compression where N is the number of CPU cores.
> >   Because of this, liblzma now depends on libthr.
> >   
> 
> This is fantastic, thank you for doing this update.
> 
> FWIW, compressing VM images (some sparse files, some not) would take
> upwards of 45 minutes, which after this update, just takes a few
> minutes.
> 
>  root@releng2:/R2/vmimages # time xz -T 0 -k FreeBSD-11.0-CURRENT-amd64.qcow2 
> \
>  time xz -T 0 -k FreeBSD-11.0-CURRENT-amd64.raw; \
>  time xz -T 0 -k FreeBSD-11.0-CURRENT-amd64.vhd; \
>  time xz -T 0 -k FreeBSD-11.0-CURRENT-amd64.vmdk
>  1027.602u 40.376s 1:09.57 1535.1%   81+192k 0+19774io 0pf+0w
>  1032.978u 38.823s 1:08.17 1572.2%   81+192k 0+19696io 0pf+0w
>  1033.908u 38.593s 1:11.70 1495.8%   81+192k 0+19729io 0pf+0w
>  1091.749u 42.371s 1:04.27 1764.6%   81+192k 0+19751io 0pf+0w
> 

I meant to include that this is on a 48-core machine.

Glen



pgpylR87ITctf.pgp
Description: PGP signature


Re: svn commit: r278433 - in head: . contrib/xz contrib/xz/src/common contrib/xz/src/liblzma contrib/xz/src/liblzma/api contrib/xz/src/liblzma/api/lzma contrib/xz/src/liblzma/check contrib/xz/src/libl

2015-02-09 Thread Dmitry Morozovsky
Glen,

On Mon, 9 Feb 2015, Glen Barber wrote:

> > > Log:
> > >   Merge xz 5.2.0.
> > >   
> > >   This brings support for multi-threaded compression.  This brings close
> > >   N times faster compression where N is the number of CPU cores.
> > >   Because of this, liblzma now depends on libthr.
> > 
> > This is fantastic, thank you for doing this update.
> > 
> > FWIW, compressing VM images (some sparse files, some not) would take
> > upwards of 45 minutes, which after this update, just takes a few
> > minutes.
> > 
> >  root@releng2:/R2/vmimages # time xz -T 0 -k 
> > FreeBSD-11.0-CURRENT-amd64.qcow2 \
> >  time xz -T 0 -k FreeBSD-11.0-CURRENT-amd64.raw; \
> >  time xz -T 0 -k FreeBSD-11.0-CURRENT-amd64.vhd; \
> >  time xz -T 0 -k FreeBSD-11.0-CURRENT-amd64.vmdk
> >  1027.602u 40.376s 1:09.57 1535.1%   81+192k 0+19774io 0pf+0w
> >  1032.978u 38.823s 1:08.17 1572.2%   81+192k 0+19696io 0pf+0w
> >  1033.908u 38.593s 1:11.70 1495.8%   81+192k 0+19729io 0pf+0w
> >  1091.749u 42.371s 1:04.27 1764.6%   81+192k 0+19751io 0pf+0w
> > 
> 
> I meant to include that this is on a 48-core machine.

Hm, I can't beleive you didn't use pxz ;)

Anyway, having this in base, and not depending on external tool, is 
amazingly great.

BTW, Rui, did you some comparative tests with pxz?

-- 
Sincerely,
D.Marck [DM5020, MCK-RIPE, DM3-RIPN]
[ FreeBSD committer: ma...@freebsd.org ]

*** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- ma...@rinet.ru ***

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


svn commit: r278456 - head/sys/powerpc/pseries

2015-02-09 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Mon Feb  9 15:58:27 2015
New Revision: 278456
URL: https://svnweb.freebsd.org/changeset/base/278456

Log:
  Mark invalid page table entries correctly for PMAP as well as for the
  hypervisor. This prevents an infinite loop where processes with evicted
  pages would page fault forever when PMAP decided the evicted pages on
  which the process was faulting was actually present and did not need to
  be restored.
  
  Found while building LLVM with make -j32.
  
  Sponsored by: FreeBSD Foundation

Modified:
  head/sys/powerpc/pseries/mmu_phyp.c

Modified: head/sys/powerpc/pseries/mmu_phyp.c
==
--- head/sys/powerpc/pseries/mmu_phyp.c Mon Feb  9 13:41:29 2015
(r278455)
+++ head/sys/powerpc/pseries/mmu_phyp.c Mon Feb  9 15:58:27 2015
(r278456)
@@ -240,6 +240,7 @@ mphyp_pte_unset(mmu_t mmu, uintptr_t slo
uint64_t junk;
int err;
 
+   pvo_pt->pte_hi &= ~LPTE_VALID;
err = phyp_pft_hcall(H_REMOVE, 1UL << 31, slot,
pvo_pt->pte_hi & LPTE_AVPN_MASK, 0, &pte.pte_hi, &pte.pte_lo,
&junk);
@@ -265,6 +266,7 @@ mphyp_pte_change(mmu_t mmu, uintptr_t sl
 
/* XXX: optimization using H_PROTECT for common case? */
mphyp_pte_unset(mmu, slot, pvo_pt, vpn);
+   pvo_pt->pte_hi |= LPTE_VALID;
result = phyp_pft_hcall(H_ENTER, H_EXACT, slot, pvo_pt->pte_hi,
pvo_pt->pte_lo, &index, &evicted.pte_lo, &junk);
if (result != H_SUCCESS)
@@ -286,7 +288,7 @@ mphyp_pte_spillable_ident(u_int ptegidx,
phyp_pft_hcall(H_READ, 0, slot, 0, 0, &pt.pte_hi, &pt.pte_lo,
&junk);

-   if (pt.pte_hi & LPTE_SWBITS)
+   if (pt.pte_hi & LPTE_WIRED)
continue;
 
/* This is a candidate, so remember it */
@@ -391,7 +393,7 @@ mphyp_pte_insert(mmu_t mmu, u_int ptegid
}
}
 
-   KASSERT(pvo->pvo_pte.lpte.pte_hi == evicted.pte_hi,
+   KASSERT((pvo->pvo_pte.lpte.pte_hi | LPTE_VALID) == evicted.pte_hi,
   ("Unable to find PVO for spilled PTE"));
 
/*
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r278452 - head/sys/powerpc/pseries

2015-02-09 Thread Nathan Whitehorn

Thank you  -- sorry for missing this!
-Nathan

On 02/09/15 03:34, Bjoern A. Zeeb wrote:

Author: bz
Date: Mon Feb  9 11:34:45 2015
New Revision: 278452
URL: https://svnweb.freebsd.org/changeset/base/278452

Log:
   Properly hide a variable under #ifdef as it is only used inside the
   specific #ifdef block otherwise leaving an unused variable and breaking
   other kernel builds.

Modified:
   head/sys/powerpc/pseries/platform_chrp.c

Modified: head/sys/powerpc/pseries/platform_chrp.c
==
--- head/sys/powerpc/pseries/platform_chrp.cMon Feb  9 11:11:17 2015
(r278451)
+++ head/sys/powerpc/pseries/platform_chrp.cMon Feb  9 11:34:45 2015
(r278452)
@@ -124,9 +124,9 @@ chrp_probe(platform_t plat)
  static int
  chrp_attach(platform_t plat)
  {
+#ifdef __powerpc64__
int i;
  
-#ifdef __powerpc64__

/* XXX: check for /rtas/ibm,hypertas-functions? */
if (!(mfmsr() & PSL_HV)) {
struct mem_region *phys, *avail;



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


svn commit: r278460 - head/sys/conf

2015-02-09 Thread Warner Losh
Author: imp
Date: Mon Feb  9 16:04:08 2015
New Revision: 278460
URL: https://svnweb.freebsd.org/changeset/base/278460

Log:
  We need to create /boot/dtb since some use cases don't create a full
  root with BSD.root.mtree, so it often times will not exist. Rather
  than force the latter for an installkernel, just create the directory
  with a comment about why.
  
  Submitted by: Guy Yur

Modified:
  head/sys/conf/dtb.mk

Modified: head/sys/conf/dtb.mk
==
--- head/sys/conf/dtb.mkMon Feb  9 16:04:01 2015(r278459)
+++ head/sys/conf/dtb.mkMon Feb  9 16:04:08 2015(r278460)
@@ -67,6 +67,10 @@ CLEANFILES+=${_dts:R:S/$/.dtb/}
 realinstall: _dtbinstall
 .ORDER: beforeinstall _kmodinstall
 _dtbinstall:
+# Need to create this because installkernel doens't invoke mtree with 
BSD.root.mtree
+# to make sure the tree is setup properly. This may break ownership of 
${DTBDIR}
+# for no-root build.
+   mkdir -p ${DESTDIR}${DTBDIR}
 .for _dtb in ${DTB}
${INSTALL} -o ${DTBOWN} -g ${DTBGRP} -m ${DTBMODE} \
${_INSTALLFLAGS} ${_dtb} ${DESTDIR}${DTBDIR}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r278459 - head/sys/conf

2015-02-09 Thread Warner Losh
Author: imp
Date: Mon Feb  9 16:04:01 2015
New Revision: 278459
URL: https://svnweb.freebsd.org/changeset/base/278459

Log:
  Make sure that we define DTB{OWN,GRP,MODE} so install works.
  
  Submitted by: Guy Yur

Modified:
  head/sys/conf/dtb.mk

Modified: head/sys/conf/dtb.mk
==
--- head/sys/conf/dtb.mkMon Feb  9 16:03:59 2015(r278458)
+++ head/sys/conf/dtb.mkMon Feb  9 16:04:01 2015(r278459)
@@ -46,6 +46,9 @@ SYSDIR=   ${_dir}
 .PATH: ${SYSDIR}/gnu/dts/${MACHINE} ${SYSDIR}/boot/fdt/dts/${MACHINE}
 
 DTBDIR?=/boot/dtb
+DTBOWN?=root
+DTBGRP?=wheel
+DTBMODE?=444
 DTB=${DTS:R:S/$/.dtb/}
 
 all: ${DTB}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r278457 - in head: share/mk sys/conf

2015-02-09 Thread Warner Losh
Author: imp
Date: Mon Feb  9 16:03:55 2015
New Revision: 278457
URL: https://svnweb.freebsd.org/changeset/base/278457

Log:
  Enforce that MK_foo options shall be either "yes" or "no" and nothing
  else.

Modified:
  head/share/mk/bsd.mkopt.mk
  head/sys/conf/kern.opts.mk

Modified: head/share/mk/bsd.mkopt.mk
==
--- head/share/mk/bsd.mkopt.mk  Mon Feb  9 15:58:27 2015(r278456)
+++ head/share/mk/bsd.mkopt.mk  Mon Feb  9 16:03:55 2015(r278457)
@@ -33,7 +33,11 @@ MK_${var}:=  no
 .else
 MK_${var}:=yes
 .endif
+.else
+.if ${MK_${var}} != "yes" && ${MK_${var}} != "no"
+.error "Illegal value for MK_${var}: ${MK_${var}}"
 .endif
+.endif # !defined(MK_${var})
 .endfor
 .undef __DEFAULT_YES_OPTIONS
 
@@ -47,6 +51,10 @@ MK_${var}:=  yes
 .else
 MK_${var}:=no
 .endif
+.else
+.if ${MK_${var}} != "yes" && ${MK_${var}} != "no"
+.error "Illegal value for MK_${var}: ${MK_${var}}"
 .endif
+.endif # !defined(MK_${var})
 .endfor
 .undef __DEFAULT_NO_OPTIONS

Modified: head/sys/conf/kern.opts.mk
==
--- head/sys/conf/kern.opts.mk  Mon Feb  9 15:58:27 2015(r278456)
+++ head/sys/conf/kern.opts.mk  Mon Feb  9 16:03:55 2015(r278457)
@@ -58,7 +58,11 @@ MK_${var}:=  no
 .else
 MK_${var}:=yes
 .endif
+.else
+.if ${MK_${var}} != "yes" && ${MK_${var}} != "no"
+.error "Illegal value for MK_${var}: ${MK_${var}}"
 .endif
+.endif # !defined(MK_${var})
 .endfor
 .undef __DEFAULT_YES_OPTIONS
 
@@ -70,7 +74,11 @@ MK_${var}:=  yes
 .else
 MK_${var}:=no
 .endif
+.else
+.if ${MK_${var}} != "yes" && ${MK_${var}} != "no"
+.error "Illegal value for MK_${var}: ${MK_${var}}"
 .endif
+.endif # !defined(MK_${var})
 .endfor
 .undef __DEFAULT_NO_OPTIONS
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r278458 - head/sys/conf

2015-02-09 Thread Warner Losh
Author: imp
Date: Mon Feb  9 16:03:59 2015
New Revision: 278458
URL: https://svnweb.freebsd.org/changeset/base/278458

Log:
  Pass MODULES_EXTRA to the modules build. While I'm here, also always
  pass WITHOUT_MODULES down. There's no need to make this conditional.
  
  Submitted by: Guy Yur

Modified:
  head/sys/conf/kern.pre.mk

Modified: head/sys/conf/kern.pre.mk
==
--- head/sys/conf/kern.pre.mk   Mon Feb  9 16:03:55 2015(r278457)
+++ head/sys/conf/kern.pre.mk   Mon Feb  9 16:03:59 2015(r278458)
@@ -186,15 +186,13 @@ SYSTEM_DEP+= ${LDSCRIPT}
 MKMODULESENV+= MAKEOBJDIRPREFIX=${.OBJDIR}/modules KMODDIR=${KODIR}
 MKMODULESENV+= MACHINE_CPUARCH=${MACHINE_CPUARCH}
 MKMODULESENV+= MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH}
+MKMODULESENV+= MODULES_EXTRA=${MODULES_EXTRA} 
WITHOUT_MODULES=${WITHOUT_MODULES}
 .if (${KERN_IDENT} == LINT)
 MKMODULESENV+= ALL_MODULES=LINT
 .endif
 .if defined(MODULES_OVERRIDE)
 MKMODULESENV+= MODULES_OVERRIDE="${MODULES_OVERRIDE}"
 .endif
-.if defined(WITHOUT_MODULES)
-MKMODULESENV+= WITHOUT_MODULES="${WITHOUT_MODULES}"
-.endif
 .if defined(DEBUG)
 MKMODULESENV+= DEBUG_FLAGS="${DEBUG}"
 .endif
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r278461 - head/sys/conf

2015-02-09 Thread Warner Losh
Author: imp
Date: Mon Feb  9 16:10:30 2015
New Revision: 278461
URL: https://svnweb.freebsd.org/changeset/base/278461

Log:
  Fix typo.
  
  Submitted by: jhb@

Modified:
  head/sys/conf/dtb.mk

Modified: head/sys/conf/dtb.mk
==
--- head/sys/conf/dtb.mkMon Feb  9 16:04:08 2015(r278460)
+++ head/sys/conf/dtb.mkMon Feb  9 16:10:30 2015(r278461)
@@ -67,7 +67,7 @@ CLEANFILES+=${_dts:R:S/$/.dtb/}
 realinstall: _dtbinstall
 .ORDER: beforeinstall _kmodinstall
 _dtbinstall:
-# Need to create this because installkernel doens't invoke mtree with 
BSD.root.mtree
+# Need to create this because installkernel doesn't invoke mtree with 
BSD.root.mtree
 # to make sure the tree is setup properly. This may break ownership of 
${DTBDIR}
 # for no-root build.
mkdir -p ${DESTDIR}${DTBDIR}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r278433 - in head: . contrib/xz contrib/xz/src/common contrib/xz/src/liblzma contrib/xz/src/liblzma/api contrib/xz/src/liblzma/api/lzma contrib/xz/src/liblzma/check contrib/xz/src/libl

2015-02-09 Thread John Baldwin
On Monday, February 09, 2015 06:20:35 AM Rui Paulo wrote:
> Author: rpaulo
> Date: Mon Feb  9 06:20:34 2015
> New Revision: 278433
> URL: https://svnweb.freebsd.org/changeset/base/278433
> 
> Log:
>   Merge xz 5.2.0.
> 
>   This brings support for multi-threaded compression.  This brings close
>   N times faster compression where N is the number of CPU cores.
>   Because of this, liblzma now depends on libthr.
> 
>   Soon libarchive will be modified to use the new lzma API.
> 
>   Thanks to antoine@ for the exp-run.

It looks like this uses hw.ncpu to determine the number of cores.  Can you 
make this cpuset friendly by querying the current process's CPU mask and 
counting the cores it contains instead?

Somethign like:

cpuset_t set;

cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, &set, sizeof(set));

(I have a CPU_COUNT() macro I should commit that will then let you do:)

ncpus = CPU_COUNT(&set);

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


Re: svn commit: r278460 - head/sys/conf

2015-02-09 Thread Brooks Davis
On Mon, Feb 09, 2015 at 04:04:09PM +, Warner Losh wrote:
> Author: imp
> Date: Mon Feb  9 16:04:08 2015
> New Revision: 278460
> URL: https://svnweb.freebsd.org/changeset/base/278460
> 
> Log:
>   We need to create /boot/dtb since some use cases don't create a full
>   root with BSD.root.mtree, so it often times will not exist. Rather
>   than force the latter for an installkernel, just create the directory
>   with a comment about why.
>   
>   Submitted by: Guy Yur
> 
> Modified:
>   head/sys/conf/dtb.mk
> 
> Modified: head/sys/conf/dtb.mk
> ==
> --- head/sys/conf/dtb.mk  Mon Feb  9 16:04:01 2015(r278459)
> +++ head/sys/conf/dtb.mk  Mon Feb  9 16:04:08 2015(r278460)
> @@ -67,6 +67,10 @@ CLEANFILES+=${_dts:R:S/$/.dtb/}
>  realinstall: _dtbinstall
>  .ORDER: beforeinstall _kmodinstall
>  _dtbinstall:
> +# Need to create this because installkernel doens't invoke mtree with 
> BSD.root.mtree
> +# to make sure the tree is setup properly. This may break ownership of 
> ${DTBDIR}
> +# for no-root build.
> + mkdir -p ${DESTDIR}${DTBDIR}

You could use -d avoid the ownership issue in the no-root case, but then you'll 
end up
with duplicate ${DTBDIR} entries if you have run installworld.  Conditional 
creation
might be the least bad solution.  i.e.:

test -d ${DESTDIR}${DTBDIR} || ${INSTALL} -d -u root -g wheel 
${DESTDIR}${DTBDIR}

-- Brooks


pgpFdZlPqBCLT.pgp
Description: PGP signature


svn commit: r278462 - in head: share/mk sys/conf

2015-02-09 Thread Warner Losh
Author: imp
Date: Mon Feb  9 16:21:49 2015
New Revision: 278462
URL: https://svnweb.freebsd.org/changeset/base/278462

Log:
  Move these definitions to bsd.own.mk along side the kernel directory /
  user defines. Make this work with WITH_INSTALL_AS_USER as well.
  
  Noticed by: ian@

Modified:
  head/share/mk/bsd.own.mk
  head/sys/conf/dtb.mk

Modified: head/share/mk/bsd.own.mk
==
--- head/share/mk/bsd.own.mkMon Feb  9 16:10:30 2015(r278461)
+++ head/share/mk/bsd.own.mkMon Feb  9 16:21:49 2015(r278462)
@@ -141,7 +141,7 @@ _uid!=  id -u
 USER!= id -un
 .endif
 _gid!= id -gn
-.for x in BIN CONF DOC INFO KMOD LIB MAN NLS SHARE
+.for x in BIN CONF DOC DTB INFO KMOD LIB MAN NLS SHARE
 $xOWN= ${USER}
 $xGRP= ${_gid}
 .endfor
@@ -164,6 +164,10 @@ KMODDIR?=  /boot/kernel
 KMODOWN?=  ${BINOWN}
 KMODGRP?=  ${BINGRP}
 KMODMODE?= ${BINMODE}
+DTBDIR?=   /boot/dtb
+DTBOWN?=   root
+DTBGRP?=   wheel
+DTBMODE?=  444
 
 LIBDIR?=   /usr/lib
 LIBCOMPATDIR?= /usr/lib/compat

Modified: head/sys/conf/dtb.mk
==
--- head/sys/conf/dtb.mkMon Feb  9 16:10:30 2015(r278461)
+++ head/sys/conf/dtb.mkMon Feb  9 16:21:49 2015(r278462)
@@ -45,10 +45,6 @@ SYSDIR=  ${_dir}
 
 .PATH: ${SYSDIR}/gnu/dts/${MACHINE} ${SYSDIR}/boot/fdt/dts/${MACHINE}
 
-DTBDIR?=/boot/dtb
-DTBOWN?=root
-DTBGRP?=wheel
-DTBMODE?=444
 DTB=${DTS:R:S/$/.dtb/}
 
 all: ${DTB}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r278463 - head/sys/conf

2015-02-09 Thread Warner Losh
Author: imp
Date: Mon Feb  9 16:29:44 2015
New Revision: 278463
URL: https://svnweb.freebsd.org/changeset/base/278463

Log:
  Prefer install over mkdir to create the directory. Add test to ensure
  the directory doesn't exist before creating it. This makes the NO_ROOT
  case actually work.
  
  Suggested by: brooks@

Modified:
  head/sys/conf/dtb.mk

Modified: head/sys/conf/dtb.mk
==
--- head/sys/conf/dtb.mkMon Feb  9 16:21:49 2015(r278462)
+++ head/sys/conf/dtb.mkMon Feb  9 16:29:44 2015(r278463)
@@ -64,9 +64,9 @@ realinstall: _dtbinstall
 .ORDER: beforeinstall _kmodinstall
 _dtbinstall:
 # Need to create this because installkernel doesn't invoke mtree with 
BSD.root.mtree
-# to make sure the tree is setup properly. This may break ownership of 
${DTBDIR}
-# for no-root build.
-   mkdir -p ${DESTDIR}${DTBDIR}
+# to make sure the tree is setup properly. We don't recreate it to avoid 
duplicate
+# entries in the NO_ROOT case.
+   test -d ${DESTDIR}${DTBDIR} || ${INSTALL} -d -o ${DTBOWN} -g ${DTBGRP} 
${DESTDIR}${DTBDIR}
 .for _dtb in ${DTB}
${INSTALL} -o ${DTBOWN} -g ${DTBGRP} -m ${DTBMODE} \
${_INSTALLFLAGS} ${_dtb} ${DESTDIR}${DTBDIR}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r278433 - in head: . contrib/xz contrib/xz/src/common contrib/xz/src/liblzma contrib/xz/src/liblzma/api contrib/xz/src/liblzma/api/lzma contrib/xz/src/liblzma/check contrib/xz/src/libl

2015-02-09 Thread Rui Paulo
On Feb 9, 2015, at 08:16, John Baldwin  wrote:
> 
> On Monday, February 09, 2015 06:20:35 AM Rui Paulo wrote:
>> Author: rpaulo
>> Date: Mon Feb  9 06:20:34 2015
>> New Revision: 278433
>> URL: https://svnweb.freebsd.org/changeset/base/278433
>> 
>> Log:
>>  Merge xz 5.2.0.
>> 
>>  This brings support for multi-threaded compression.  This brings close
>>  N times faster compression where N is the number of CPU cores.
>>  Because of this, liblzma now depends on libthr.
>> 
>>  Soon libarchive will be modified to use the new lzma API.
>> 
>>  Thanks to antoine@ for the exp-run.
> 
> It looks like this uses hw.ncpu to determine the number of cores.  Can you 
> make this cpuset friendly by querying the current process's CPU mask and 
> counting the cores it contains instead?
> 
> Somethign like:
> 
>cpuset_t set;
> 
>cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, &set, sizeof(set));
> 
> (I have a CPU_COUNT() macro I should commit that will then let you do:)
> 
>ncpus = CPU_COUNT(&set);

Yes, makes sense.  I'll wait for CPU_COUNT().

--
Rui Paulo



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


Re: svn commit: r278450 - head/release

2015-02-09 Thread Rui Paulo
On Feb 9, 2015, at 02:46, Glen Barber  wrote:
> 
> Author: gjb
> Date: Mon Feb  9 10:46:39 2015
> New Revision: 278450
> URL: https://svnweb.freebsd.org/changeset/base/278450
> 
> Log:
>  Revert r278445.
> 
>  I was going to use __FreeBSD_version to determine if
>  xz(1) should be multi-threaded by default, but doing
>  this will cause problems if/when the changes are merged
>  from head.

You can do "nm -D liblzma" and check for lzma_stream_encoder_mt.  Or you could 
check if xz(1) has threading support via xz -h (ugly).

--
Rui Paulo



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


Re: svn commit: r278433 - in head: . contrib/xz contrib/xz/src/common contrib/xz/src/liblzma contrib/xz/src/liblzma/api contrib/xz/src/liblzma/api/lzma contrib/xz/src/liblzma/check contrib/xz/src/libl

2015-02-09 Thread Rui Paulo
On Feb 9, 2015, at 05:08, Dmitry Morozovsky  wrote:
> BTW, Rui, did you some comparative tests with pxz?

No, I didn't, but now it should be easy for you to try! :-)

--
Rui Paulo



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


Re: svn commit: r278450 - head/release

2015-02-09 Thread Adrian Chadd
... this is why we should have some kind of version identifier in each
tool, or capability lists. Otherwise lulz will ensue like this.



-adrian

On 9 February 2015 at 08:44, Rui Paulo  wrote:
> On Feb 9, 2015, at 02:46, Glen Barber  wrote:
>>
>> Author: gjb
>> Date: Mon Feb  9 10:46:39 2015
>> New Revision: 278450
>> URL: https://svnweb.freebsd.org/changeset/base/278450
>>
>> Log:
>>  Revert r278445.
>>
>>  I was going to use __FreeBSD_version to determine if
>>  xz(1) should be multi-threaded by default, but doing
>>  this will cause problems if/when the changes are merged
>>  from head.
>
> You can do "nm -D liblzma" and check for lzma_stream_encoder_mt.  Or you 
> could check if xz(1) has threading support via xz -h (ugly).
>
> --
> Rui Paulo
>
>
>
>
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r278464 - in head/usr.sbin/bsdconfig: console includes share timezone/share usermgmt/share

2015-02-09 Thread Devin Teske
Author: dteske
Date: Mon Feb  9 17:18:10 2015
New Revision: 278464
URL: https://svnweb.freebsd.org/changeset/base/278464

Log:
  Replace the only instance of sed(1) in bsdconfig(8) with awk(1).
  
  MFC after:3 days

Modified:
  head/usr.sbin/bsdconfig/console/INDEX
  head/usr.sbin/bsdconfig/includes/INDEX
  head/usr.sbin/bsdconfig/share/keymap.subr
  head/usr.sbin/bsdconfig/timezone/share/continents.subr
  head/usr.sbin/bsdconfig/timezone/share/countries.subr
  head/usr.sbin/bsdconfig/usermgmt/share/user.subr

Modified: head/usr.sbin/bsdconfig/console/INDEX
==
--- head/usr.sbin/bsdconfig/console/INDEX   Mon Feb  9 16:29:44 2015
(r278463)
+++ head/usr.sbin/bsdconfig/console/INDEX   Mon Feb  9 17:18:10 2015
(r278464)
@@ -46,6 +46,13 @@ menu_help="Customize system console beha
 # can be i18n'ed but `command' is the name of a script.
 #
 menu_selection="console|console"
+menu_selection="vt_font|font"
+menu_selection="vt_keymap|keymap"
+menu_selection="vt_repeat|repeat"
+menu_selection="vt_saver|saver"
+menu_selection="vt_screenmap|screenmap"
+menu_selection="vt_ttys|ttys"
+# For backward compatibility
 menu_selection="syscons_font|font"
 menu_selection="syscons_keymap|keymap"
 menu_selection="syscons_repeat|repeat"

Modified: head/usr.sbin/bsdconfig/includes/INDEX
==
--- head/usr.sbin/bsdconfig/includes/INDEX  Mon Feb  9 16:29:44 2015
(r278463)
+++ head/usr.sbin/bsdconfig/includes/INDEX  Mon Feb  9 17:18:10 2015
(r278464)
@@ -45,6 +45,7 @@ menu_help=""
 # can be i18n'ed but `command' is the name of a script.
 #
 menu_selection="includes|includes"
+menu_selection="api|includes"
 
 #
 #  Items below this line do NOT need i18n translation 

Modified: head/usr.sbin/bsdconfig/share/keymap.subr
==
--- head/usr.sbin/bsdconfig/share/keymap.subr   Mon Feb  9 16:29:44 2015
(r278463)
+++ head/usr.sbin/bsdconfig/share/keymap.subr   Mon Feb  9 17:18:10 2015
(r278464)
@@ -219,7 +219,7 @@ f_keymap_get_all()
echo -n "$k "
# NOTE: Translate '8x8' to '8x08' before sending to
# sort(1) so that things work out as we might expect.
-   debug= keymap_$k get desc | sed -e 's/8x8/8x08/g'
+   debug= keymap_$k get desc | awk 'gsub(/8x8/,"8x08")||1'
done | sort -k2 | awk '{
printf "%s%s", (started ? " " : ""), $1; started = 1
}'

Modified: head/usr.sbin/bsdconfig/timezone/share/continents.subr
==
--- head/usr.sbin/bsdconfig/timezone/share/continents.subr  Mon Feb  9 
16:29:44 2015(r278463)
+++ head/usr.sbin/bsdconfig/timezone/share/continents.subr  Mon Feb  9 
17:18:10 2015(r278464)
@@ -1,6 +1,6 @@
 if [ ! "$_TIMEZONE_CONTINENTS_SUBR" ]; then _TIMEZONE_CONTINENTS_SUBR=1
 #
-# Copyright (c) 2011-2012 Devin Teske
+# Copyright (c) 2011-2014 Devin Teske
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -87,7 +87,7 @@ export continent_utc_title
 
  FUNCTIONS
 
-# f_continent $cont $property
+# f_continent $cont $property [$var_to_set]
 #
 # Returns a single property of a given continent. Available properties are:
 #
@@ -102,37 +102,60 @@ export continent_utc_title
 #  (which appears after continent selection).
 #  menu_list   Menu-list of regions for this continent.
 #
+# If $var_to_set is missing or NULL, the value of $var_to_get is printed to
+# standard output for capturing in a sub-shell (which is less-recommended
+# because of performance degredation; for example, when called in a loop).
+#
 f_continent()
 {
-   local cont="$1" property="$2"
-   eval echo \"\${continent_${cont}_$property}\"
+   f_getvar "continent_${1}_$2" $3
 }
 
-# f_find_continent $title
+# f_find_continent $title [$var_to_set]
 #
 # Returns continent identifier given continent title.
 #
+# If $var_to_set is missing or NULL, the value of $var_to_get is printed to
+# standard output for capturing in a sub-shell (which is less-recommended
+# because of performance degredation; for example, when called in a loop).
+#
 f_find_continent()
 {
-   local cont
-   for cont in $CONTINENTS; do
-   if [ "$1" = "$( f_continent $cont title )" ]; then
-   echo "$cont"
+   local __cont __title
+   for __cont in $CONTINENTS; do
+   f_continent $__cont title __title
+   if [ "$1" = "$__title" ]; then
+   if [ "$2" ]; then
+   setvar "$2" $__cont
+

svn commit: r278465 - in head/usr.sbin/bsdconfig: console includes share timezone/share usermgmt/share

2015-02-09 Thread Devin Teske
Author: dteske
Date: Mon Feb  9 17:22:54 2015
New Revision: 278465
URL: https://svnweb.freebsd.org/changeset/base/278465

Log:
  Revert SVN r278464 -- fingers were in perforce mode (premature
  commit of future stuffs not yet ready).

Modified:
  head/usr.sbin/bsdconfig/console/INDEX
  head/usr.sbin/bsdconfig/includes/INDEX
  head/usr.sbin/bsdconfig/share/keymap.subr
  head/usr.sbin/bsdconfig/timezone/share/continents.subr
  head/usr.sbin/bsdconfig/timezone/share/countries.subr
  head/usr.sbin/bsdconfig/usermgmt/share/user.subr

Modified: head/usr.sbin/bsdconfig/console/INDEX
==
--- head/usr.sbin/bsdconfig/console/INDEX   Mon Feb  9 17:18:10 2015
(r278464)
+++ head/usr.sbin/bsdconfig/console/INDEX   Mon Feb  9 17:22:54 2015
(r278465)
@@ -46,13 +46,6 @@ menu_help="Customize system console beha
 # can be i18n'ed but `command' is the name of a script.
 #
 menu_selection="console|console"
-menu_selection="vt_font|font"
-menu_selection="vt_keymap|keymap"
-menu_selection="vt_repeat|repeat"
-menu_selection="vt_saver|saver"
-menu_selection="vt_screenmap|screenmap"
-menu_selection="vt_ttys|ttys"
-# For backward compatibility
 menu_selection="syscons_font|font"
 menu_selection="syscons_keymap|keymap"
 menu_selection="syscons_repeat|repeat"

Modified: head/usr.sbin/bsdconfig/includes/INDEX
==
--- head/usr.sbin/bsdconfig/includes/INDEX  Mon Feb  9 17:18:10 2015
(r278464)
+++ head/usr.sbin/bsdconfig/includes/INDEX  Mon Feb  9 17:22:54 2015
(r278465)
@@ -45,7 +45,6 @@ menu_help=""
 # can be i18n'ed but `command' is the name of a script.
 #
 menu_selection="includes|includes"
-menu_selection="api|includes"
 
 #
 #  Items below this line do NOT need i18n translation 

Modified: head/usr.sbin/bsdconfig/share/keymap.subr
==
--- head/usr.sbin/bsdconfig/share/keymap.subr   Mon Feb  9 17:18:10 2015
(r278464)
+++ head/usr.sbin/bsdconfig/share/keymap.subr   Mon Feb  9 17:22:54 2015
(r278465)
@@ -219,7 +219,7 @@ f_keymap_get_all()
echo -n "$k "
# NOTE: Translate '8x8' to '8x08' before sending to
# sort(1) so that things work out as we might expect.
-   debug= keymap_$k get desc | awk 'gsub(/8x8/,"8x08")||1'
+   debug= keymap_$k get desc | sed -e 's/8x8/8x08/g'
done | sort -k2 | awk '{
printf "%s%s", (started ? " " : ""), $1; started = 1
}'

Modified: head/usr.sbin/bsdconfig/timezone/share/continents.subr
==
--- head/usr.sbin/bsdconfig/timezone/share/continents.subr  Mon Feb  9 
17:18:10 2015(r278464)
+++ head/usr.sbin/bsdconfig/timezone/share/continents.subr  Mon Feb  9 
17:22:54 2015(r278465)
@@ -1,6 +1,6 @@
 if [ ! "$_TIMEZONE_CONTINENTS_SUBR" ]; then _TIMEZONE_CONTINENTS_SUBR=1
 #
-# Copyright (c) 2011-2014 Devin Teske
+# Copyright (c) 2011-2012 Devin Teske
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -87,7 +87,7 @@ export continent_utc_title
 
  FUNCTIONS
 
-# f_continent $cont $property [$var_to_set]
+# f_continent $cont $property
 #
 # Returns a single property of a given continent. Available properties are:
 #
@@ -102,60 +102,37 @@ export continent_utc_title
 #  (which appears after continent selection).
 #  menu_list   Menu-list of regions for this continent.
 #
-# If $var_to_set is missing or NULL, the value of $var_to_get is printed to
-# standard output for capturing in a sub-shell (which is less-recommended
-# because of performance degredation; for example, when called in a loop).
-#
 f_continent()
 {
-   f_getvar "continent_${1}_$2" $3
+   local cont="$1" property="$2"
+   eval echo \"\${continent_${cont}_$property}\"
 }
 
-# f_find_continent $title [$var_to_set]
+# f_find_continent $title
 #
 # Returns continent identifier given continent title.
 #
-# If $var_to_set is missing or NULL, the value of $var_to_get is printed to
-# standard output for capturing in a sub-shell (which is less-recommended
-# because of performance degredation; for example, when called in a loop).
-#
 f_find_continent()
 {
-   local __cont __title
-   for __cont in $CONTINENTS; do
-   f_continent $__cont title __title
-   if [ "$1" = "$__title" ]; then
-   if [ "$2" ]; then
-   setvar "$2" $__cont
-   else
-   echo "$__cont"
-   fi
+   local cont
+   for cont in $CONTINE

Re: svn commit: r278450 - head/release

2015-02-09 Thread Rui Paulo
On Feb 9, 2015, at 08:50, Adrian Chadd  wrote:
> 
> ... this is why we should have some kind of version identifier in each
> tool, or capability lists. Otherwise lulz will ensue like this.

Well, we have: xz --version will output a version string that should be easy to 
parse.


--
Rui Paulo



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


svn commit: r278466 - head/etc/rc.d

2015-02-09 Thread Garrett Cooper
Author: ngie
Date: Mon Feb  9 17:53:16 2015
New Revision: 278466
URL: https://svnweb.freebsd.org/changeset/base/278466

Log:
  Remove explicit routing/sendmail rc.d inclusion in FILES
  
  Reported by: Guy Yur 
  MFC after: 14 days
  X-MFC with: r278249
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/etc/rc.d/Makefile

Modified: head/etc/rc.d/Makefile
==
--- head/etc/rc.d/Makefile  Mon Feb  9 17:22:54 2015(r278465)
+++ head/etc/rc.d/Makefile  Mon Feb  9 17:53:16 2015(r278466)
@@ -99,7 +99,6 @@ FILES=DAEMON \
rfcomm_pppd_server \
root \
route6d \
-   routed \
routing \
rpcbind \
rtadvd \
@@ -107,7 +106,6 @@ FILES=  DAEMON \
savecore \
sdpd \
securelevel \
-   sendmail \
serial \
sppp \
${_sshd} \
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r278433 - in head: . contrib/xz contrib/xz/src/common contrib/xz/src/liblzma contrib/xz/src/liblzma/api contrib/xz/src/liblzma/api/lzma contrib/xz/src/liblzma/check contrib/xz/src/libl

2015-02-09 Thread Dmitry Morozovsky
Rui,

On Mon, 9 Feb 2015, Rui Paulo wrote:

> No, I didn't, but now it should be easy for you to try! :-)

Unfortunately, the most powerful machine @myhands is 2*8core 

root@briareus:~# sysctl hw.model
hw.model: Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz
root@briareus:~# sysctl hw.ncpu
hw.ncpu: 16

and even this one is mostly loaded with $JOB ;)

I'll try comparing with my home fileserver, which is on 

marck@hamster:~> sysctl hw.model
hw.model: Intel(R) Core(TM) i5-3570 CPU @ 3.40GHz
marck@hamster:~> sysctl hw.ncpu
hw.ncpu: 4

and load is rather moderate, especially if I stop smbd ;)


-- 
Sincerely,
D.Marck [DM5020, MCK-RIPE, DM3-RIPN]
[ FreeBSD committer: ma...@freebsd.org ]

*** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- ma...@rinet.ru ***

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


svn commit: r278467 - head/usr.sbin/bsdconfig/share

2015-02-09 Thread Devin Teske
Author: dteske
Date: Mon Feb  9 19:16:19 2015
New Revision: 278467
URL: https://svnweb.freebsd.org/changeset/base/278467

Log:
  Replace the only instance of sed(1) in bsdconfig(8) with awk(1).
  
  MFC after:3 days

Modified:
  head/usr.sbin/bsdconfig/share/keymap.subr

Modified: head/usr.sbin/bsdconfig/share/keymap.subr
==
--- head/usr.sbin/bsdconfig/share/keymap.subr   Mon Feb  9 17:53:16 2015
(r278466)
+++ head/usr.sbin/bsdconfig/share/keymap.subr   Mon Feb  9 19:16:19 2015
(r278467)
@@ -219,7 +219,7 @@ f_keymap_get_all()
echo -n "$k "
# NOTE: Translate '8x8' to '8x08' before sending to
# sort(1) so that things work out as we might expect.
-   debug= keymap_$k get desc | sed -e 's/8x8/8x08/g'
+   debug= keymap_$k get desc | awk 'gsub(/8x8/,"8x08")||1'
done | sort -k2 | awk '{
printf "%s%s", (started ? " " : ""), $1; started = 1
}'
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r278468 - head/contrib/xz

2015-02-09 Thread Rui Paulo
Author: rpaulo
Date: Mon Feb  9 19:19:13 2015
New Revision: 278468
URL: https://svnweb.freebsd.org/changeset/base/278468

Log:
  Add a few more instructions to xz/FREEBSD-upgrade.

Modified:
  head/contrib/xz/FREEBSD-upgrade

Modified: head/contrib/xz/FREEBSD-upgrade
==
--- head/contrib/xz/FREEBSD-upgrade Mon Feb  9 19:16:19 2015
(r278467)
+++ head/contrib/xz/FREEBSD-upgrade Mon Feb  9 19:19:13 2015
(r278468)
@@ -16,6 +16,9 @@ sh -c 'for F in `cat FREEBSD-Xlist | gre
 
 You may check if there are any new files that we don't need.
 
+You should run ``configure'' to make sure you use a more recent
+config.h.  Running ``make check'' in the xz source tree is also useful.
+
 The instructions for importing new release and merging to HEAD can be found
 at FreeBSD wiki:
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r278469 - in head/sys: kern sys

2015-02-09 Thread Randall Stewart
Author: rrs
Date: Mon Feb  9 19:19:44 2015
New Revision: 278469
URL: https://svnweb.freebsd.org/changeset/base/278469

Log:
  This fixes two conditions that can incur when migration
  is being done in the callout code and harmonizes the macro
  use.:
  1) The callout_active() will lie. Basically if a migration
 is occuring and the callout is about to expire and the
 migration has been deferred, the callout_active will no
 longer return true until after the migration. This confuses
 and breaks callers that are doing callout_init(&c, 1); such
 as TCP.
  2) The migration code had a bug in it where when migrating, if
 a two calls to callout_reset came in and they both collided with
 the callout on the wheel about to run, then the second call to
 callout_reset would corrupt the list the callout wheel uses
 putting the callout thread into a endless loop.
  3) Per imp, I have fixed all the macro occurance in the code that
 were for the most part being ignored.
  
  Phabricator D1711 and looked at by lstewart and jhb and sbruno.
  Reviewed by:  kostikbel, imp, adrian, hselasky
  MFC after:3 days
  Sponsored by: Netflix Inc.

Modified:
  head/sys/kern/kern_timeout.c
  head/sys/sys/callout.h

Modified: head/sys/kern/kern_timeout.c
==
--- head/sys/kern/kern_timeout.cMon Feb  9 19:19:13 2015
(r278468)
+++ head/sys/kern/kern_timeout.cMon Feb  9 19:19:44 2015
(r278469)
@@ -166,26 +166,16 @@ struct callout_cpu {
charcc_ktr_event_name[20];
 };
 
-#definecc_exec_currcc_exec_entity[0].cc_curr
-#definecc_exec_nextcc_exec_entity[0].cc_next
-#definecc_exec_cancel  cc_exec_entity[0].cc_cancel
-#definecc_exec_waiting cc_exec_entity[0].cc_waiting
-#definecc_exec_curr_dircc_exec_entity[1].cc_curr
-#definecc_exec_next_dircc_exec_entity[1].cc_next
-#definecc_exec_cancel_dir  cc_exec_entity[1].cc_cancel
-#definecc_exec_waiting_dir cc_exec_entity[1].cc_waiting
-
+#definecc_exec_curr(cc, dir)   cc->cc_exec_entity[dir].cc_curr
+#definecc_exec_next(cc, dir)   cc->cc_exec_entity[dir].cc_next
+#definecc_exec_cancel(cc, dir) 
cc->cc_exec_entity[dir].cc_cancel
+#definecc_exec_waiting(cc, dir)
cc->cc_exec_entity[dir].cc_waiting
 #ifdef SMP
-#definecc_migration_func   cc_exec_entity[0].ce_migration_func
-#definecc_migration_argcc_exec_entity[0].ce_migration_arg
-#definecc_migration_cpucc_exec_entity[0].ce_migration_cpu
-#definecc_migration_time   cc_exec_entity[0].ce_migration_time
-#definecc_migration_prec   cc_exec_entity[0].ce_migration_prec
-#definecc_migration_func_dir   cc_exec_entity[1].ce_migration_func
-#definecc_migration_arg_dircc_exec_entity[1].ce_migration_arg
-#definecc_migration_cpu_dircc_exec_entity[1].ce_migration_cpu
-#definecc_migration_time_dir   cc_exec_entity[1].ce_migration_time
-#definecc_migration_prec_dir   cc_exec_entity[1].ce_migration_prec
+#definecc_migration_func(cc, dir)  
cc->cc_exec_entity[dir].ce_migration_func
+#definecc_migration_arg(cc, dir)   
cc->cc_exec_entity[dir].ce_migration_arg
+#definecc_migration_cpu(cc, dir)   
cc->cc_exec_entity[dir].ce_migration_cpu
+#definecc_migration_time(cc, dir)  
cc->cc_exec_entity[dir].ce_migration_time
+#definecc_migration_prec(cc, dir)  
cc->cc_exec_entity[dir].ce_migration_prec
 
 struct callout_cpu cc_cpu[MAXCPU];
 #defineCPUBLOCKMAXCPU
@@ -235,16 +225,16 @@ static void
 cc_cce_cleanup(struct callout_cpu *cc, int direct)
 {
 
-   cc->cc_exec_entity[direct].cc_curr = NULL;
-   cc->cc_exec_entity[direct].cc_next = NULL;
-   cc->cc_exec_entity[direct].cc_cancel = false;
-   cc->cc_exec_entity[direct].cc_waiting = false;
+   cc_exec_curr(cc, direct) = NULL;
+   cc_exec_next(cc, direct) = NULL;
+   cc_exec_cancel(cc, direct) = false;
+   cc_exec_waiting(cc, direct) = false;
 #ifdef SMP
-   cc->cc_exec_entity[direct].ce_migration_cpu = CPUBLOCK;
-   cc->cc_exec_entity[direct].ce_migration_time = 0;
-   cc->cc_exec_entity[direct].ce_migration_prec = 0;
-   cc->cc_exec_entity[direct].ce_migration_func = NULL;
-   cc->cc_exec_entity[direct].ce_migration_arg = NULL;
+   cc_migration_cpu(cc, direct) = CPUBLOCK;
+   cc_migration_time(cc, direct) = 0;
+   cc_migration_prec(cc, direct) = 0;
+   cc_migration_func(cc, direct) = NULL;
+   cc_migration_arg(cc, direct) = NULL;
 #endif
 }
 
@@ -256,7 +246,7 @@ cc_cce_migrating(struct callout_cpu *cc,
 {
 
 #ifdef SMP
-   return (cc->cc_exec_entity[direct].ce_migration_cpu != CPUBLOCK);
+   return (cc_migr

svn commit: r278471 - head/sys/powerpc/pseries

2015-02-09 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Mon Feb  9 19:21:54 2015
New Revision: 278471
URL: https://svnweb.freebsd.org/changeset/base/278471

Log:
  Distribute interrupts across multiple CPUs in SMP configurations instead of 
sending them
  all to CPU 0.

Modified:
  head/sys/powerpc/pseries/xics.c

Modified: head/sys/powerpc/pseries/xics.c
==
--- head/sys/powerpc/pseries/xics.c Mon Feb  9 19:20:59 2015
(r278470)
+++ head/sys/powerpc/pseries/xics.c Mon Feb  9 19:21:54 2015
(r278471)
@@ -197,13 +197,25 @@ xicp_bind(device_t dev, u_int irq, cpuse
 {
struct xicp_softc *sc = device_get_softc(dev);
cell_t status, cpu;
+   int ncpus, i;
 
/*
-* This doesn't appear to actually support affinity groups, so just
-* use the first CPU.
+* This doesn't appear to actually support affinity groups, so pick a
+* random CPU.
 */
CPU_FOREACH(cpu)
-   if (CPU_ISSET(cpu, &cpumask)) break;
+   if (CPU_ISSET(cpu, &cpumask)) ncpus++;
+
+   i = mftb() % ncpus;
+   ncpus = 0;
+   CPU_FOREACH(cpu) {
+   if (!CPU_ISSET(cpu, &cpumask))
+   continue;
+   if (ncpus == i)
+   break;
+   ncpus++;
+   }
+   
 
rtas_call_method(sc->ibm_set_xive, 3, 1, irq, cpu, XICP_PRIORITY,
&status);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r278470 - head/usr.sbin/bsdconfig/includes

2015-02-09 Thread Devin Teske
Author: dteske
Date: Mon Feb  9 19:20:59 2015
New Revision: 278470
URL: https://svnweb.freebsd.org/changeset/base/278470

Log:
  Add new alias "bsdconfig api" (same as "bsdconfig includes")
  NB: My fingers like typing "api" a lot more than "includes"
  
  MFC after:3 days

Modified:
  head/usr.sbin/bsdconfig/includes/INDEX

Modified: head/usr.sbin/bsdconfig/includes/INDEX
==
--- head/usr.sbin/bsdconfig/includes/INDEX  Mon Feb  9 19:19:44 2015
(r278469)
+++ head/usr.sbin/bsdconfig/includes/INDEX  Mon Feb  9 19:20:59 2015
(r278470)
@@ -45,6 +45,7 @@ menu_help=""
 # can be i18n'ed but `command' is the name of a script.
 #
 menu_selection="includes|includes"
+menu_selection="api|includes"
 
 #
 #  Items below this line do NOT need i18n translation 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r278467 - head/usr.sbin/bsdconfig/share

2015-02-09 Thread Baptiste Daroussin
On Mon, Feb 09, 2015 at 07:16:19PM +, Devin Teske wrote:
> Author: dteske
> Date: Mon Feb  9 19:16:19 2015
> New Revision: 278467
> URL: https://svnweb.freebsd.org/changeset/base/278467
> 
> Log:
>   Replace the only instance of sed(1) in bsdconfig(8) with awk(1).
>   
>   MFC after:  3 days
> 
> Modified:
>   head/usr.sbin/bsdconfig/share/keymap.subr
> 
> Modified: head/usr.sbin/bsdconfig/share/keymap.subr
> ==
> --- head/usr.sbin/bsdconfig/share/keymap.subr Mon Feb  9 17:53:16 2015
> (r278466)
> +++ head/usr.sbin/bsdconfig/share/keymap.subr Mon Feb  9 19:16:19 2015
> (r278467)
> @@ -219,7 +219,7 @@ f_keymap_get_all()
>   echo -n "$k "
>   # NOTE: Translate '8x8' to '8x08' before sending to
>   # sort(1) so that things work out as we might expect.
> - debug= keymap_$k get desc | sed -e 's/8x8/8x08/g'
> + debug= keymap_$k get desc | awk 'gsub(/8x8/,"8x08")||1'
>   done | sort -k2 | awk '{
>   printf "%s%s", (started ? " " : ""), $1; started = 1
>   }'

Out of curiosity what is the point of preferring awk over sed? the awk binary
being larger and depending on 2 libraries versus sed only depending on one?

Best regards,
Bapt


pgpc6vY4O35OO.pgp
Description: PGP signature


svn commit: r278472 - in head/sys: netinet netinet6

2015-02-09 Thread Randall Stewart
Author: rrs
Date: Mon Feb  9 19:28:11 2015
New Revision: 278472
URL: https://svnweb.freebsd.org/changeset/base/278472

Log:
  This fixes a bug in the way that the LLE timers for nd6
  and arp were being used. They basically would pass in the
  mutex to the callout_init. Because they used this method
  to the callout system, it was possible to "stop" the callout.
  When flushing the table and you stopped the running callout, the
  callout_stop code would return 1 indicating that it was going
  to stop the callout (that was about to run on the callout_wheel blocked
  by the function calling the stop). Now when 1 was returned, it would
  lower the reference count one extra time for the stopped timer, then
  a few lines later delete the memory. Of course the callout_wheel was
  stuck in the lock code and would then crash since it was accessing
  freed memory. By using callout_init(c, 1) we always get a 0 back
  and the reference counting bug does not rear its head. We do have
  to make a few adjustments to the callouts themselves though to make
  sure it does the proper thing if rescheduled as well as gets the lock.
  
  Commented upon by hiren and sbruno
  See Phabricator D1777 for more details.
  
  Commented upon by hiren and sbruno
  Reviewed by:  adrian, jhb and bz
  Sponsored by: Netflix Inc.

Modified:
  head/sys/netinet/if_ether.c
  head/sys/netinet/in.c
  head/sys/netinet6/in6.c
  head/sys/netinet6/nd6.c

Modified: head/sys/netinet/if_ether.c
==
--- head/sys/netinet/if_ether.c Mon Feb  9 19:21:54 2015(r278471)
+++ head/sys/netinet/if_ether.c Mon Feb  9 19:28:11 2015(r278472)
@@ -166,10 +166,28 @@ arptimer(void *arg)
struct ifnet *ifp;
 
if (lle->la_flags & LLE_STATIC) {
-   LLE_WUNLOCK(lle);
return;
}
-
+   LLE_WLOCK(lle);
+   if (callout_pending(&lle->la_timer)) {
+   /*
+* Here we are a bit odd here in the treatment of 
+* active/pending. If the pending bit is set, it got
+* rescheduled before I ran. The active
+* bit we ignore, since if it was stopped
+* in ll_tablefree() and was currently running
+* it would have return 0 so the code would
+* not have deleted it since the callout could
+* not be stopped so we want to go through
+* with the delete here now. If the callout
+* was restarted, the pending bit will be back on and
+* we just want to bail since the callout_reset would
+* return 1 and our reference would have been removed
+* by arpresolve() below.
+*/
+   LLE_WUNLOCK(lle);
+   return;
+   }
ifp = lle->lle_tbl->llt_ifp;
CURVNET_SET(ifp->if_vnet);
 

Modified: head/sys/netinet/in.c
==
--- head/sys/netinet/in.c   Mon Feb  9 19:21:54 2015(r278471)
+++ head/sys/netinet/in.c   Mon Feb  9 19:28:11 2015(r278472)
@@ -962,8 +962,7 @@ in_lltable_new(const struct sockaddr *l3
lle->base.lle_refcnt = 1;
lle->base.lle_free = in_lltable_free;
LLE_LOCK_INIT(&lle->base);
-   callout_init_rw(&lle->base.la_timer, &lle->base.lle_lock,
-   CALLOUT_RETURNUNLOCKED);
+   callout_init(&lle->base.la_timer, 1);
 
return (&lle->base);
 }

Modified: head/sys/netinet6/in6.c
==
--- head/sys/netinet6/in6.c Mon Feb  9 19:21:54 2015(r278471)
+++ head/sys/netinet6/in6.c Mon Feb  9 19:28:11 2015(r278472)
@@ -2047,8 +2047,7 @@ in6_lltable_new(const struct sockaddr *l
lle->base.lle_refcnt = 1;
lle->base.lle_free = in6_lltable_free;
LLE_LOCK_INIT(&lle->base);
-   callout_init_rw(&lle->base.ln_timer_ch, &lle->base.lle_lock,
-   CALLOUT_RETURNUNLOCKED);
+   callout_init(&lle->base.ln_timer_ch, 1);
 
return (&lle->base);
 }

Modified: head/sys/netinet6/nd6.c
==
--- head/sys/netinet6/nd6.c Mon Feb  9 19:21:54 2015(r278471)
+++ head/sys/netinet6/nd6.c Mon Feb  9 19:28:11 2015(r278472)
@@ -473,9 +473,28 @@ nd6_llinfo_timer(void *arg)
 
KASSERT(arg != NULL, ("%s: arg NULL", __func__));
ln = (struct llentry *)arg;
-   LLE_WLOCK_ASSERT(ln);
+   LLE_WLOCK(ln);
+   if (callout_pending(&ln->la_timer)) {
+   /*
+* Here we are a bit odd here in the treatment of 
+* active/pending. If the pending bit is set, it got
+* rescheduled before I ran. The active
+* bit we ignore, since if it was stopped
+* in ll_tablefree

Re: svn commit: r278467 - head/usr.sbin/bsdconfig/share

2015-02-09 Thread Devin Teske
sed was an odd-man out.

awk is used almost 200 times, and sed only once.

Consider it the removal of an unnecessary dependency.

If there were similar cases of a utility only being used once,
I would probably do the same thing (e.g., if “tr” was used only
once, I might convert it to “awk”).

I’m very big on minimizing dependencies because I use this
stuff in embedded situations.

Yeah, the sed binary is smaller… but it just didn’t make much
sense to me to use sed only once when awk would do just fine
(considering awk is a hard-and-fast dependency with almost
200+ occurrences).
— 
Devin

P.S. Sorry for top-posting.


> On Feb 9, 2015, at 11:24 AM, Baptiste Daroussin  wrote:
> 
> On Mon, Feb 09, 2015 at 07:16:19PM +, Devin Teske wrote:
>> Author: dteske
>> Date: Mon Feb  9 19:16:19 2015
>> New Revision: 278467
>> URL: https://svnweb.freebsd.org/changeset/base/278467
>> 
>> Log:
>>  Replace the only instance of sed(1) in bsdconfig(8) with awk(1).
>> 
>>  MFC after:  3 days
>> 
>> Modified:
>>  head/usr.sbin/bsdconfig/share/keymap.subr
>> 
>> Modified: head/usr.sbin/bsdconfig/share/keymap.subr
>> ==
>> --- head/usr.sbin/bsdconfig/share/keymap.subrMon Feb  9 17:53:16 
>> 2015(r278466)
>> +++ head/usr.sbin/bsdconfig/share/keymap.subrMon Feb  9 19:16:19 
>> 2015(r278467)
>> @@ -219,7 +219,7 @@ f_keymap_get_all()
>>  echo -n "$k "
>>  # NOTE: Translate '8x8' to '8x08' before sending to
>>  # sort(1) so that things work out as we might expect.
>> -debug= keymap_$k get desc | sed -e 's/8x8/8x08/g'
>> +debug= keymap_$k get desc | awk 'gsub(/8x8/,"8x08")||1'
>>  done | sort -k2 | awk '{
>>  printf "%s%s", (started ? " " : ""), $1; started = 1
>>  }'
> 
> Out of curiosity what is the point of preferring awk over sed? the awk binary
> being larger and depending on 2 libraries versus sed only depending on one?
> 
> Best regards,
> Bapt

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

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

2015-02-09 Thread hiren panchasara
On 02/09/15 at 07:19P, Randall Stewart wrote:
> Author: rrs
> Date: Mon Feb  9 19:19:44 2015
> New Revision: 278469
> URL: https://svnweb.freebsd.org/changeset/base/278469
> 
> Log:
>   This fixes two conditions that can incur when migration
>   is being done in the callout code and harmonizes the macro
>   use.:
>   1) The callout_active() will lie. Basically if a migration
>  is occuring and the callout is about to expire and the
>  migration has been deferred, the callout_active will no
>  longer return true until after the migration. This confuses
>  and breaks callers that are doing callout_init(&c, 1); such
>  as TCP.
>   2) The migration code had a bug in it where when migrating, if
>  a two calls to callout_reset came in and they both collided with
>  the callout on the wheel about to run, then the second call to
>  callout_reset would corrupt the list the callout wheel uses
>  putting the callout thread into a endless loop.
>   3) Per imp, I have fixed all the macro occurance in the code that
>  were for the most part being ignored.
>   
>   Phabricator D1711 and looked at by lstewart and jhb and sbruno.
>   Reviewed by:kostikbel, imp, adrian, hselasky
>   MFC after:  3 days
>   Sponsored by:   Netflix Inc.

Thanks Randall for the fix.

For future reference, correct way to specify phabric review is:
Differential Revision: https://reviews.freebsd.org/D1711 

This triggers changes to the review on phabricator with reference to this
commit.

Cheers,
Hiren


pgppw2oAeink4.pgp
Description: PGP signature


Re: svn commit: r278472 - in head/sys: netinet netinet6

2015-02-09 Thread hiren panchasara
On 02/09/15 at 07:28P, Randall Stewart wrote:
> Author: rrs
> Date: Mon Feb  9 19:28:11 2015
> New Revision: 278472
> URL: https://svnweb.freebsd.org/changeset/base/278472
> 
> Log:
>   This fixes a bug in the way that the LLE timers for nd6
>   and arp were being used. They basically would pass in the
>   mutex to the callout_init. Because they used this method
>   to the callout system, it was possible to "stop" the callout.
>   When flushing the table and you stopped the running callout, the
>   callout_stop code would return 1 indicating that it was going
>   to stop the callout (that was about to run on the callout_wheel blocked
>   by the function calling the stop). Now when 1 was returned, it would
>   lower the reference count one extra time for the stopped timer, then
>   a few lines later delete the memory. Of course the callout_wheel was
>   stuck in the lock code and would then crash since it was accessing
>   freed memory. By using callout_init(c, 1) we always get a 0 back
>   and the reference counting bug does not rear its head. We do have
>   to make a few adjustments to the callouts themselves though to make
>   sure it does the proper thing if rescheduled as well as gets the lock.
>   
>   Commented upon by hiren and sbruno
>   See Phabricator D1777 for more details.
>   
>   Commented upon by hiren and sbruno
>   Reviewed by:adrian, jhb and bz
>   Sponsored by:   Netflix Inc.

Thanks for the fix, Randall.

When do you plan to MFC this? It'd be nice to have this MFC'd along with
D1711 changes so that we do not see panics reported in the review.

Cheers,
Hiren


pgpQTxx38Z6J_.pgp
Description: PGP signature


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

2015-02-09 Thread John Baldwin
On Monday, February 09, 2015 07:19:45 PM Randall Stewart wrote:
> Author: rrs
> Date: Mon Feb  9 19:19:44 2015
> New Revision: 278469
> URL: https://svnweb.freebsd.org/changeset/base/278469
> 
> Log:
>   This fixes two conditions that can incur when migration
>   is being done in the callout code and harmonizes the macro
>   use.:
>   1) The callout_active() will lie. Basically if a migration
>  is occuring and the callout is about to expire and the
>  migration has been deferred, the callout_active will no
>  longer return true until after the migration. This confuses
>  and breaks callers that are doing callout_init(&c, 1); such
>  as TCP.
>   2) The migration code had a bug in it where when migrating, if
>  a two calls to callout_reset came in and they both collided with
>  the callout on the wheel about to run, then the second call to
>  callout_reset would corrupt the list the callout wheel uses
>  putting the callout thread into a endless loop.
>   3) Per imp, I have fixed all the macro occurance in the code that
>  were for the most part being ignored.
> 
>   Phabricator D1711 and looked at by lstewart and jhb and sbruno.
>   Reviewed by:kostikbel, imp, adrian, hselasky
>   MFC after:  3 days
>   Sponsored by:   Netflix Inc.

Thank you guys for working together to fix the migration race in a way
that lets CALLOUT_MPSAFE timers use multiple CPUs still.

I do think that callout_drain_async() would also be useful to add.

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


Re: svn commit: r278472 - in head/sys: netinet netinet6

2015-02-09 Thread John Baldwin
On Monday, February 09, 2015 07:28:12 PM Randall Stewart wrote:
> Author: rrs
> Date: Mon Feb  9 19:28:11 2015
> New Revision: 278472
> URL: https://svnweb.freebsd.org/changeset/base/278472
> 
> Log:
>   This fixes a bug in the way that the LLE timers for nd6
>   and arp were being used. They basically would pass in the
>   mutex to the callout_init. Because they used this method
>   to the callout system, it was possible to "stop" the callout.
>   When flushing the table and you stopped the running callout, the
>   callout_stop code would return 1 indicating that it was going
>   to stop the callout (that was about to run on the callout_wheel blocked
>   by the function calling the stop). Now when 1 was returned, it would
>   lower the reference count one extra time for the stopped timer, then
>   a few lines later delete the memory. Of course the callout_wheel was
>   stuck in the lock code and would then crash since it was accessing
>   freed memory. By using callout_init(c, 1) we always get a 0 back
>   and the reference counting bug does not rear its head. We do have
>   to make a few adjustments to the callouts themselves though to make
>   sure it does the proper thing if rescheduled as well as gets the lock.
> 
>   Commented upon by hiren and sbruno
>   See Phabricator D1777 for more details.
> 
>   Commented upon by hiren and sbruno
>   Reviewed by:adrian, jhb and bz
>   Sponsored by:   Netflix Inc.

Eh, I looked at it, but I really, really don't like it.  I think 
callout_init_*() should be preferred to CALLOUT_MPSAFE whenever possible as it 
is less race-prone.  I think this should probably be fixed by adding Hans' 
callout_drain_async() instead, though this is fine as a temporary workaround.

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


Re: svn commit: r278472 - in head/sys: netinet netinet6

2015-02-09 Thread Peter Holm
On Mon, Feb 09, 2015 at 07:28:12PM +, Randall Stewart wrote:
> Author: rrs
> Date: Mon Feb  9 19:28:11 2015
> New Revision: 278472
> URL: https://svnweb.freebsd.org/changeset/base/278472
> 
> Log:
>   This fixes a bug in the way that the LLE timers for nd6
>   and arp were being used. They basically would pass in the
>   mutex to the callout_init. Because they used this method
>   to the callout system, it was possible to "stop" the callout.
>   When flushing the table and you stopped the running callout, the
>   callout_stop code would return 1 indicating that it was going
>   to stop the callout (that was about to run on the callout_wheel blocked
>   by the function calling the stop). Now when 1 was returned, it would
>   lower the reference count one extra time for the stopped timer, then
>   a few lines later delete the memory. Of course the callout_wheel was
>   stuck in the lock code and would then crash since it was accessing
>   freed memory. By using callout_init(c, 1) we always get a 0 back
>   and the reference counting bug does not rear its head. We do have
>   to make a few adjustments to the callouts themselves though to make
>   sure it does the proper thing if rescheduled as well as gets the lock.
>   
>   Commented upon by hiren and sbruno
>   See Phabricator D1777 for more details.
>   
>   Commented upon by hiren and sbruno
>   Reviewed by:adrian, jhb and bz
>   Sponsored by:   Netflix Inc.
> 
> Modified:
>   head/sys/netinet/if_ether.c
>   head/sys/netinet/in.c
>   head/sys/netinet6/in6.c
>   head/sys/netinet6/nd6.c
> 

Could this be yours?

db:0:pho> bt
Tracing pid 9629 tid 100639 td 0xf8011cce14a0
in6_lltable_lookup() at in6_lltable_lookup+0x11a/frame
0xfe081e426200
nd6_output() at nd6_output+0x15d/frame 0xfe081e426290
ip6_output() at ip6_output+0x2128/frame 0xfe081e426790
tcp_output() at tcp_output+0x2dae/frame 0xfe081e426c30
tcp_usr_send() at tcp_usr_send+0x2fe/frame 0xfe081e426cb0
sosend_generic() at sosend_generic+0x414/frame 0xfe081e426d60
clnt_vc_call() at clnt_vc_call+0x477/frame 0xfe081e426ec0
clnt_reconnect_call() at clnt_reconnect_call+0x46c/frame
0xfe081e426f70
newnfs_request() at newnfs_request+0x9ba/frame 0xfe081e4270d0
nfscl_request() at nfscl_request+0x72/frame 0xfe081e427120
nfsrpc_lookup() at nfsrpc_lookup+0x213/frame 0xfe081e4272a0
nfs_lookup() at nfs_lookup+0x467/frame 0xfe081e4275c0
VOP_LOOKUP_APV() at VOP_LOOKUP_APV+0x10f/frame 0xfe081e4275f0
lookup() at lookup+0x5d5/frame 0xfe081e427680
namei() at namei+0x536/frame 0xfe081e427740
kern_statat() at kern_statat+0xae/frame 0xfe081e427900
sys_fstatat() at sys_fstatat+0x2c/frame 0xfe081e4279a0
amd64_syscall() at amd64_syscall+0x29c/frame 0xfe081e427ab0

http://people.freebsd.org/~pho/stress/log/rrs003.txt

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


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

2015-02-09 Thread NGie Cooper
On Mon, Feb 9, 2015 at 12:19 PM, hiren panchasara
 wrote:

...

> Thanks Randall for the fix.
>
> For future reference, correct way to specify phabric review is:
> Differential Revision: https://reviews.freebsd.org/D1711
>
> This triggers changes to the review on phabricator with reference to this
> commit.

This should be documented in the Committer's Guide:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=197500
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r278473 - in head/sys: amd64/amd64 amd64/include amd64/vmm contrib/dev/acpica/include i386/i386 i386/include x86/acpica x86/include x86/x86 x86/xen

2015-02-09 Thread Konstantin Belousov
Author: kib
Date: Mon Feb  9 21:00:56 2015
New Revision: 278473
URL: https://svnweb.freebsd.org/changeset/base/278473

Log:
  Add x2APIC support.  Enable it by default if CPU is capable.  The
  hw.x2apic_enable tunable allows disabling it from the loader prompt.
  
  To closely repeat effects of the uncached memory ops when accessing
  registers in the xAPIC mode, the x2APIC writes to MSRs are preceeded
  by mfence, except for the EOI notifications.  This is probably too
  strict, only ICR writes to send IPI require serialization to ensure
  that other CPUs see the previous actions when IPI is delivered.  This
  may be changed later.
  
  In vmm justreturn IPI handler, call doreti_iret instead of doing iretd
  inline, to handle corner conditions.
  
  Note that the patch only switches LAPICs into x2APIC mode. It does not
  enables FreeBSD to support > 255 CPUs, which requires parsing x2APIC
  MADT entries and doing interrupts remapping, but is the required step
  on the way.
  
  Reviewed by:  neel
  Tested by:pho (real hardware), neel (on bhyve)
  Discussed with:   jhb, grehan
  Sponsored by: The FreeBSD Foundation
  MFC after:2 months

Modified:
  head/sys/amd64/amd64/apic_vector.S
  head/sys/amd64/amd64/genassym.c
  head/sys/amd64/amd64/mp_machdep.c
  head/sys/amd64/include/cpufunc.h
  head/sys/amd64/vmm/vmm_support.S
  head/sys/contrib/dev/acpica/include/actbl2.h
  head/sys/i386/i386/apic_vector.s
  head/sys/i386/i386/genassym.c
  head/sys/i386/i386/mp_machdep.c
  head/sys/i386/include/cpufunc.h
  head/sys/x86/acpica/madt.c
  head/sys/x86/include/apicreg.h
  head/sys/x86/include/apicvar.h
  head/sys/x86/include/specialreg.h
  head/sys/x86/x86/io_apic.c
  head/sys/x86/x86/local_apic.c
  head/sys/x86/xen/xen_apic.c

Modified: head/sys/amd64/amd64/apic_vector.S
==
--- head/sys/amd64/amd64/apic_vector.S  Mon Feb  9 19:28:11 2015
(r278472)
+++ head/sys/amd64/amd64/apic_vector.S  Mon Feb  9 21:00:56 2015
(r278473)
@@ -39,6 +39,7 @@
 #include "opt_smp.h"
 
 #include 
+#include 
 #include 
 
 #include "assym.s"
@@ -49,6 +50,22 @@
 #define LK
 #endif
 
+   .text
+   SUPERALIGN_TEXT
+   /* End Of Interrupt to APIC */
+as_lapic_eoi:
+   cmpl$0,x2apic_mode
+   jne 1f
+   movqlapic_map,%rax
+   movl$0,LA_EOI(%rax)
+   ret
+1:
+   movl$MSR_APIC_EOI,%ecx
+   xorl%eax,%eax
+   xorl%edx,%edx
+   wrmsr
+   ret
+
 /*
  * I/O Interrupt Entry Point.  Rather than having one entry point for
  * each interrupt source, we use one entry point for each 32-bit word
@@ -62,15 +79,22 @@
 IDTVEC(vec_name) ; \
PUSH_FRAME ;\
FAKE_MCOUNT(TF_RIP(%rsp)) ; \
-   movqlapic, %rdx ;   /* pointer to local APIC */ \
+   cmpl$0,x2apic_mode ;\
+   je  1f ;\
+   movl$(MSR_APIC_ISR0 + index),%ecx ; \
+   rdmsr ; \
+   jmp 2f ;\
+1: ;   \
+   movqlapic_map, %rdx ;   /* pointer to local APIC */ \
movlLA_ISR + 16 * (index)(%rdx), %eax ; /* load ISR */  \
+2: ;   \
bsrl%eax, %eax ;/* index of highest set bit in ISR */   \
-   jz  1f ;\
+   jz  3f ;\
addl$(32 * index),%eax ;\
movq%rsp, %rsi  ;   \
movl%eax, %edi ;/* pass the IRQ */  \
calllapic_handle_intr ; \
-1: ;   \
+3: ;   \
MEXITCOUNT ;\
jmp doreti
 
@@ -160,8 +184,7 @@ IDTVEC(xen_intr_upcall)
 
SUPERALIGN_TEXT
 invltlb_ret:
-   movqlapic, %rax
-   movl$0, LA_EOI(%rax)/* End Of Interrupt to APIC */
+   callas_lapic_eoi
POP_FRAME
jmp doreti_iret
 
@@ -228,8 +251,7 @@ IDTVEC(invlcache)
 IDTVEC(ipi_intr_bitmap_handler)
PUSH_FRAME
 
-   movqlapic, %rdx
-   movl$0, LA_EOI(%rdx)/* End Of Interrupt to APIC */
+   callas_lapic_eoi

FAKE_MCOUNT(TF_RIP(%rsp))
 
@@ -245,8 +267,7 @@ IDTVEC(ipi_intr_bitma

svn commit: r278474 - head/sys/sys

2015-02-09 Thread John Baldwin
Author: jhb
Date: Mon Feb  9 21:03:23 2015
New Revision: 278474
URL: https://svnweb.freebsd.org/changeset/base/278474

Log:
  Use __builtin_popcnt() to implement a BIT_COUNT() operation for bitsets and
  use this to implement CPU_COUNT() to count the number of CPUs in a cpuset.
  
  MFC after:2 weeks

Modified:
  head/sys/sys/bitset.h
  head/sys/sys/cpuset.h

Modified: head/sys/sys/bitset.h
==
--- head/sys/sys/bitset.h   Mon Feb  9 21:00:56 2015(r278473)
+++ head/sys/sys/bitset.h   Mon Feb  9 21:03:23 2015(r278474)
@@ -176,4 +176,14 @@
__bit;  \
 })
 
+#defineBIT_COUNT(_s, p) __extension__ ({   
\
+   __size_t __i;   \
+   int __count;\
+   \
+   __count = 0;\
+   for (__i = 0; __i < __bitset_words((_s)); __i++)\
+   __count += __builtin_popcount((p)->__bits[__i]);\
+   __count;\
+})
+   
 #endif /* !_SYS_BITSET_H_ */

Modified: head/sys/sys/cpuset.h
==
--- head/sys/sys/cpuset.h   Mon Feb  9 21:00:56 2015(r278473)
+++ head/sys/sys/cpuset.h   Mon Feb  9 21:03:23 2015(r278474)
@@ -60,6 +60,7 @@
 #defineCPU_OR_ATOMIC(d, s) BIT_OR_ATOMIC(CPU_SETSIZE, d, s)
 #defineCPU_COPY_STORE_REL(f, t)BIT_COPY_STORE_REL(CPU_SETSIZE, 
f, t)
 #defineCPU_FFS(p)  BIT_FFS(CPU_SETSIZE, p)
+#defineCPU_COUNT(p)BIT_COUNT(CPU_SETSIZE, p)
 
 /*
  * Valid cpulevel_t values.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r278475 - head/usr.sbin/pw/tests

2015-02-09 Thread Brad Davis
Author: brd (doc committer)
Date: Mon Feb  9 21:15:52 2015
New Revision: 278475
URL: https://svnweb.freebsd.org/changeset/base/278475

Log:
  Add tests for `pw usernext'.
  
  PR:   197120
  Submitted by: Robert O'Neil 
  Approved by:  will

Added:
  head/usr.sbin/pw/tests/pw_usernext.sh   (contents, props changed)
Modified:
  head/usr.sbin/pw/tests/Makefile

Modified: head/usr.sbin/pw/tests/Makefile
==
--- head/usr.sbin/pw/tests/Makefile Mon Feb  9 21:03:23 2015
(r278474)
+++ head/usr.sbin/pw/tests/Makefile Mon Feb  9 21:15:52 2015
(r278475)
@@ -11,7 +11,8 @@ ATF_TESTS_SH= pw_etcdir \
pw_groupmod \
pw_useradd \
pw_userdel \
-   pw_usermod
+   pw_usermod \
+   pw_usernext
 
 .for tp in ${ATF_TESTS_SH}
 TEST_METADATA.${tp}+=  required_user="root"

Added: head/usr.sbin/pw/tests/pw_usernext.sh
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.sbin/pw/tests/pw_usernext.sh   Mon Feb  9 21:15:52 2015
(r278475)
@@ -0,0 +1,42 @@
+# $FreeBSD$
+
+# Import helper functions
+. $(atf_get_srcdir)/helper_functions.shin
+
+# Test usernext after adding a random number of new users.
+atf_test_case usernext
+usernext_body() {
+   populate_etc_skel
+
+   var0=1
+   LIMIT=`jot -r 1 2 10`
+   while [ "$var0" -lt "$LIMIT" ]
+   do
+   atf_check -s exit:0 ${PW} useradd test$var0
+   var0=`expr $var0 + 1`
+   done
+   atf_check -s exit:0 -o match:"100${LIMIT}:100${LIMIT}" \
+   ${PW} usernext
+}
+
+# Test usernext when multiple users are added to the same group so 
+# that group id doesn't increment at the same pace as new users.
+atf_test_case usernext_assigned_group
+usernext_assigned_group_body() {
+   populate_etc_skel
+
+   var0=1
+   LIMIT=`jot -r 1 2 10`
+   while [ "$var0" -lt "$LIMIT" ]
+   do
+   atf_check -s exit:0 ${PW} useradd -n test$var0 -g 0
+   var0=`expr $var0 + 1`
+   done
+   atf_check -s exit:0 -o match:"100${LIMIT}:1001}" \
+   ${PW} usernext
+}
+
+atf_init_test_cases() {
+   atf_add_test_case usernext
+   atf_add_test_case usernext_assigned_group
+}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r278474 - head/sys/sys

2015-02-09 Thread Jung-uk Kim
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On 02/09/2015 16:03, John Baldwin wrote:
> Author: jhb Date: Mon Feb  9 21:03:23 2015 New Revision: 278474 
> URL: https://svnweb.freebsd.org/changeset/base/278474
> 
> Log: Use __builtin_popcnt() to implement a BIT_COUNT() operation
> for bitsets and use this to implement CPU_COUNT() to count the
> number of CPUs in a cpuset.
...

This is wrong.  __builtin_popcountl() must be used here.
__builtin_popcount() is for *int*.

Jung-uk Kim
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQEcBAEBCAAGBQJU2SUTAAoJEHyflib82/FGb3oH/1va9V2zWD+fxz9jzvZzT8ka
yqt9dOVpmpztpJ0XtiwCVp42hEtwvjRWefV4Qn7XntNezhF5l4N0BCLN+XmsHhdD
eoDCtQKuop+sQM64gqVgQSYBU8oho05mMmvMhIe3zf818X84pr1T6WEHbc+bgXh5
RGOPNRyau7nFldIjWfdwkyUFpiztHkxL94odFU6P6bDiCrfpngyiuOgi7vHf0QTX
Ml+9eR1AbCOx69Ntccj35++TqCWY2HKwxdlWXn7D/AXIBwWguzUS3wKOg8Oyd42k
3lPpHU4WYYERtHIY/P1LsPrQV/eB/rEoLTL5RccvEyHDl025QdSAXKwH8ij8Tvk=
=HAEQ
-END PGP SIGNATURE-
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r278474 - head/sys/sys

2015-02-09 Thread John Baldwin
On Monday, February 09, 2015 09:03:24 PM John Baldwin wrote:
> Author: jhb
> Date: Mon Feb  9 21:03:23 2015
> New Revision: 278474
> URL: https://svnweb.freebsd.org/changeset/base/278474
> 
> Log:
>   Use __builtin_popcnt() to implement a BIT_COUNT() operation for bitsets
> and use this to implement CPU_COUNT() to count the number of CPUs in a
> cpuset.
> 
>   MFC after:  2 weeks

Yes, __builtin_popcnt() works with GCC 4.2.  It should also allow the compiler 
to DTRT in userland uses of this if -msse4.2 is enabled.

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


svn commit: r278476 - head/sys/sys

2015-02-09 Thread John Baldwin
Author: jhb
Date: Mon Feb  9 21:39:18 2015
New Revision: 278476
URL: https://svnweb.freebsd.org/changeset/base/278476

Log:
  Use __builtin_popcountl() instead of __builtin_popcount().
  
  Submitted by: jkim

Modified:
  head/sys/sys/bitset.h

Modified: head/sys/sys/bitset.h
==
--- head/sys/sys/bitset.h   Mon Feb  9 21:15:52 2015(r278475)
+++ head/sys/sys/bitset.h   Mon Feb  9 21:39:18 2015(r278476)
@@ -182,7 +182,7 @@
\
__count = 0;\
for (__i = 0; __i < __bitset_words((_s)); __i++)\
-   __count += __builtin_popcount((p)->__bits[__i]);\
+   __count += __builtin_popcountl((p)->__bits[__i]);   \
__count;\
 })

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


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

2015-02-09 Thread randall

John:

See below..

On 2/9/15 3:09 PM, John Baldwin wrote:

On Monday, February 09, 2015 07:19:45 PM Randall Stewart wrote:

Author: rrs
Date: Mon Feb  9 19:19:44 2015
New Revision: 278469
URL: https://svnweb.freebsd.org/changeset/base/278469

Log:
   This fixes two conditions that can incur when migration
   is being done in the callout code and harmonizes the macro
   use.:
   1) The callout_active() will lie. Basically if a migration
  is occuring and the callout is about to expire and the
  migration has been deferred, the callout_active will no
  longer return true until after the migration. This confuses
  and breaks callers that are doing callout_init(&c, 1); such
  as TCP.
   2) The migration code had a bug in it where when migrating, if
  a two calls to callout_reset came in and they both collided with
  the callout on the wheel about to run, then the second call to
  callout_reset would corrupt the list the callout wheel uses
  putting the callout thread into a endless loop.
   3) Per imp, I have fixed all the macro occurance in the code that
  were for the most part being ignored.

   Phabricator D1711 and looked at by lstewart and jhb and sbruno.
   Reviewed by: kostikbel, imp, adrian, hselasky
   MFC after:   3 days
   Sponsored by:Netflix Inc.

Thank you guys for working together to fix the migration race in a way
that lets CALLOUT_MPSAFE timers use multiple CPUs still.


Your very much welcome.. it was a fun bug to track down :-)



I do think that callout_drain_async() would also be useful to add.


Well, I have been thinking about this, and I do think it will be easy to 
add though
I did not want to further pollute the commit with new features. I will 
see about working

on it here in the next few weeks :-)

R




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


Re: svn commit: r278472 - in head/sys: netinet netinet6

2015-02-09 Thread Bjoern A. Zeeb

> On 09 Feb 2015, at 19:28 , Randall Stewart  wrote:
> 
> Author: rrs
> Date: Mon Feb  9 19:28:11 2015
> New Revision: 278472
> URL: https://svnweb.freebsd.org/changeset/base/278472
> 
> Log:
>  This fixes a bug in the way that the LLE timers for nd6
>  and arp were being used. They basically would pass in the
>  mutex to the callout_init. Because they used this method
>  to the callout system, it was possible to "stop" the callout.
>  When flushing the table and you stopped the running callout, the
>  callout_stop code would return 1 indicating that it was going
>  to stop the callout (that was about to run on the callout_wheel blocked
>  by the function calling the stop). Now when 1 was returned, it would
>  lower the reference count one extra time for the stopped timer, then
>  a few lines later delete the memory. Of course the callout_wheel was
>  stuck in the lock code and would then crash since it was accessing
>  freed memory. By using callout_init(c, 1) we always get a 0 back
>  and the reference counting bug does not rear its head. We do have
>  to make a few adjustments to the callouts themselves though to make
>  sure it does the proper thing if rescheduled as well as gets the lock.
> 
>  Commented upon by hiren and sbruno
>  See Phabricator D1777 for more details.
> 
>  Commented upon by hiren and sbruno
>  Reviewed by: adrian, jhb and bz

I have not reviewed this;  as a matter of fact you are aware that I still 
wanted to do that.


>  Sponsored by:Netflix Inc.
> 
> Modified:
>  head/sys/netinet/if_ether.c
>  head/sys/netinet/in.c
>  head/sys/netinet6/in6.c
>  head/sys/netinet6/nd6.c
> 
> Modified: head/sys/netinet/if_ether.c
> ==
> --- head/sys/netinet/if_ether.c   Mon Feb  9 19:21:54 2015
> (r278471)
> +++ head/sys/netinet/if_ether.c   Mon Feb  9 19:28:11 2015
> (r278472)
> @@ -166,10 +166,28 @@ arptimer(void *arg)
>   struct ifnet *ifp;
> 
>   if (lle->la_flags & LLE_STATIC) {
> - LLE_WUNLOCK(lle);
>   return;
>   }
> -
> + LLE_WLOCK(lle);
> + if (callout_pending(&lle->la_timer)) {
> + /*
> +  * Here we are a bit odd here in the treatment of 
> +  * active/pending. If the pending bit is set, it got
> +  * rescheduled before I ran. The active
> +  * bit we ignore, since if it was stopped
> +  * in ll_tablefree() and was currently running
> +  * it would have return 0 so the code would
> +  * not have deleted it since the callout could
> +  * not be stopped so we want to go through
> +  * with the delete here now. If the callout
> +  * was restarted, the pending bit will be back on and
> +  * we just want to bail since the callout_reset would
> +  * return 1 and our reference would have been removed
> +  * by arpresolve() below.
> +  */
> + LLE_WUNLOCK(lle);
> + return;
> + }
>   ifp = lle->lle_tbl->llt_ifp;
>   CURVNET_SET(ifp->if_vnet);
> 
> 
> Modified: head/sys/netinet/in.c
> ==
> --- head/sys/netinet/in.c Mon Feb  9 19:21:54 2015(r278471)
> +++ head/sys/netinet/in.c Mon Feb  9 19:28:11 2015(r278472)
> @@ -962,8 +962,7 @@ in_lltable_new(const struct sockaddr *l3
>   lle->base.lle_refcnt = 1;
>   lle->base.lle_free = in_lltable_free;
>   LLE_LOCK_INIT(&lle->base);
> - callout_init_rw(&lle->base.la_timer, &lle->base.lle_lock,
> - CALLOUT_RETURNUNLOCKED);
> + callout_init(&lle->base.la_timer, 1);
> 
>   return (&lle->base);
> }
> 
> Modified: head/sys/netinet6/in6.c
> ==
> --- head/sys/netinet6/in6.c   Mon Feb  9 19:21:54 2015(r278471)
> +++ head/sys/netinet6/in6.c   Mon Feb  9 19:28:11 2015(r278472)
> @@ -2047,8 +2047,7 @@ in6_lltable_new(const struct sockaddr *l
>   lle->base.lle_refcnt = 1;
>   lle->base.lle_free = in6_lltable_free;
>   LLE_LOCK_INIT(&lle->base);
> - callout_init_rw(&lle->base.ln_timer_ch, &lle->base.lle_lock,
> - CALLOUT_RETURNUNLOCKED);
> + callout_init(&lle->base.ln_timer_ch, 1);
> 
>   return (&lle->base);
> }
> 
> Modified: head/sys/netinet6/nd6.c
> ==
> --- head/sys/netinet6/nd6.c   Mon Feb  9 19:21:54 2015(r278471)
> +++ head/sys/netinet6/nd6.c   Mon Feb  9 19:28:11 2015(r278472)
> @@ -473,9 +473,28 @@ nd6_llinfo_timer(void *arg)
> 
>   KASSERT(arg != NULL, ("%s: arg NULL", __func__));
>   ln = (struct llentry *)arg;
> - LLE_WLOCK_ASSERT(ln);
> + LLE_WLOCK(ln);
> + if (callout_pending(&ln->la_timer)) {
> + /*
> +  * He

Re: svn commit: r278472 - in head/sys: netinet netinet6

2015-02-09 Thread randall


On 2/9/15 3:11 PM, John Baldwin wrote:

Eh, I looked at it, but I really, really don't like it.  I think
callout_init_*() should be preferred to CALLOUT_MPSAFE whenever possible as it
is less race-prone.  I think this should probably be fixed by adding Hans'
callout_drain_async() instead, though this is fine as a temporary workaround.


I know you did not like it, and I think in principle I agree with you that
a new callout_drain_async() needs to be introduced to the KPI for callout.

That all being said in this one case, I do think the right immediate fix 
(until
thats ready) was to make it MPSAFE like I did. In this particular 
instance init'ing
with the lock was exactly the wrong thing to do with the reference 
counting that

was going on.

Yes, we need to get the drain_async.. but that will take more time and 
more poking
at the callout system to make sure its solid before we start switching 
things to use it.

And this I think was panic'ing a *lot* of systems..

R




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


svn commit: r278477 - head/sys/dev/usb/controller

2015-02-09 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Feb  9 21:47:12 2015
New Revision: 278477
URL: https://svnweb.freebsd.org/changeset/base/278477

Log:
  Fix DMA address casts. Regression issue after r278279.
  
  MFC after:3 days

Modified:
  head/sys/dev/usb/controller/xhci.c

Modified: head/sys/dev/usb/controller/xhci.c
==
--- head/sys/dev/usb/controller/xhci.c  Mon Feb  9 21:39:18 2015
(r278476)
+++ head/sys/dev/usb/controller/xhci.c  Mon Feb  9 21:47:12 2015
(r278477)
@@ -492,7 +492,7 @@ xhci_start_controller(struct xhci_softc 
XWRITE4(sc, runt, XHCI_ERDP_LO(0), (uint32_t)addr);
XWRITE4(sc, runt, XHCI_ERDP_HI(0), (uint32_t)(addr >> 32));
 
-   addr = (uint64_t)buf_res.physaddr;
+   addr = buf_res.physaddr;
 
DPRINTF("ERSTBA(0)=0x%016llx\n", (unsigned long long)addr);
 
@@ -1114,7 +1114,7 @@ xhci_interrupt_poll(struct xhci_softc *s
 * register.
 */
 
-   addr = (uint32_t)buf_res.physaddr;
+   addr = buf_res.physaddr;
addr += (uintptr_t)&((struct xhci_hw_root *)0)->hwr_events[i];
 
/* try to clear busy bit */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r278472 - in head/sys: netinet netinet6

2015-02-09 Thread randall

Hiren:

I hope that later this week I can MFC these things in. I would like to 
see them
sync down to 10 Stable so we can get it out in our next Firmware release 
as well. We
have seen a *lot* of strange panics and I am thinking some of it may be 
related

to these two fixes.

I will send you an email when I get ready to MFC it.

Best wishes

R

>Thanks for the fix, Randall. When do you plan to MFC this? It'd be 
nice to have this MFC'd along with D1711 changes so that we do not see 
panics reported in the review. Cheers, Hiren


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


Re: svn commit: r278474 - head/sys/sys

2015-02-09 Thread Jung-uk Kim
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On 02/09/2015 16:08, John Baldwin wrote:
> On Monday, February 09, 2015 09:03:24 PM John Baldwin wrote:
>> Author: jhb Date: Mon Feb  9 21:03:23 2015 New Revision: 278474 
>> URL: https://svnweb.freebsd.org/changeset/base/278474
>> 
>> Log: Use __builtin_popcnt() to implement a BIT_COUNT() operation 
>> for bitsets and use this to implement CPU_COUNT() to count the 
>> number of CPUs in a cpuset.
>> 
>> MFC after:   2 weeks
> 
> Yes, __builtin_popcnt() works with GCC 4.2.  It should also allow 
> the compiler to DTRT in userland uses of this if -msse4.2 is 
> enabled.

Back in 2012, when I submitted a similar patch, bde noted
__builtin_popcount*() cannot be used with GCC 4.2 for *kernel* because
it emits a library call.

http://docs.freebsd.org/cgi/mid.cgi?20121116171923.L1135

FYI...

Jung-uk Kim
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQEcBAEBCAAGBQJU2SzhAAoJEHyflib82/FGzgoH/2mfCZTX6J84MYpfuJV5dnLQ
97Itozifc8qBNDCOIQ1PZNgxPed9U8Ma0o3Rntfl5X2VeAIc/c5JJhvQITUdhnn7
fyW5FcpvJGpHLcUWlTMT5CrZgmDswi6h1jIsbD6AKoIVNGau5kPhpn4LF7f19YU0
0Vm8L96gGrxjJb3SWdRC4znP1ezTCw3rUEyk2oPZBn69zoat1vBcV7WtathStcBg
noIEydo6C5e4EC5SKbTi29aNd1KGafRIukkC8+jnZNCc8nYEVsUEX5SarKYmmpec
NTSLfboTJ5YXZGsvIgGzld0Z/Hn54v8O0hhG1QO4kWh3wN40NVgNL0vkeiveqwE=
=WDqA
-END PGP SIGNATURE-
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r278474 - head/sys/sys

2015-02-09 Thread Jung-uk Kim
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On 02/09/2015 16:55, Jung-uk Kim wrote:
> On 02/09/2015 16:08, John Baldwin wrote:
>> On Monday, February 09, 2015 09:03:24 PM John Baldwin wrote:
>>> Author: jhb Date: Mon Feb  9 21:03:23 2015 New Revision:
>>> 278474 URL: https://svnweb.freebsd.org/changeset/base/278474
>>> 
>>> Log: Use __builtin_popcnt() to implement a BIT_COUNT() 
>>> operation for bitsets and use this to implement CPU_COUNT() to 
>>> count the number of CPUs in a cpuset.
>>> 
>>> MFC after:  2 weeks
> 
>> Yes, __builtin_popcnt() works with GCC 4.2.  It should also
>> allow the compiler to DTRT in userland uses of this if -msse4.2
>> is enabled.
> 
> Back in 2012, when I submitted a similar patch, bde noted 
> __builtin_popcount*() cannot be used with GCC 4.2 for *kernel* 
> because it emits a library call.
> 
> http://docs.freebsd.org/cgi/mid.cgi?20121116171923.L1135

BTW, __POPCNT__ macro may be used to detect availability of POPCNT
instruction when compiled with Clang.

Jung-uk Kim
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQEcBAEBCAAGBQJU2S9NAAoJEHyflib82/FGy+kH/20SFWEXK5lSfWxYMvxMp46W
ZjOFW46ZefkUHiDLgPcED4oZd4cmX/KNXns3YSO5lwL4JeFsO+mzTKpmV7llPV22
y1/xHChk3Z3BJwq3lzGZmVeT4Cw2T6Mf4f1PCqfMkijDDsVrkEYBeko+QW3gpGjZ
BrjH8EmFLDZ78rmPP/Nsbm8HZNEI89NOGBYEw615kA5ibuZZ0L2T6ybcipysDaxe
fYpBcIhm58erXIrlNtYeSX6YyZPHMPJBACjkyPEKk8L7eKYR27++VKZGas8flEze
5x/5n9TftKwei2rHXhuogNqClACsLIBkM6a/Y/PNBMDOQ+0OEu6uDr0a63log00=
=zY2U
-END PGP SIGNATURE-
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r278474 - head/sys/sys

2015-02-09 Thread John Baldwin
On Monday, February 09, 2015 04:55:52 PM Jung-uk Kim wrote:
> On 02/09/2015 16:08, John Baldwin wrote:
> > On Monday, February 09, 2015 09:03:24 PM John Baldwin wrote:
> >> Author: jhb Date: Mon Feb  9 21:03:23 2015 New Revision: 278474
> >> URL: https://svnweb.freebsd.org/changeset/base/278474
> >> 
> >> Log: Use __builtin_popcnt() to implement a BIT_COUNT() operation
> >> for bitsets and use this to implement CPU_COUNT() to count the
> >> number of CPUs in a cpuset.
> >> 
> >> MFC after: 2 weeks
> > 
> > Yes, __builtin_popcnt() works with GCC 4.2.  It should also allow
> > the compiler to DTRT in userland uses of this if -msse4.2 is
> > enabled.
> 
> Back in 2012, when I submitted a similar patch, bde noted
> __builtin_popcount*() cannot be used with GCC 4.2 for *kernel* because
> it emits a library call.
> 
> http://docs.freebsd.org/cgi/mid.cgi?20121116171923.L1135
> 
> FYI...

Weird, I though I built a kernel with this in a tree that uses it in the 
igb(4) driver.  We need a CPU_COUNT() no matter what, but if this emits a 
library call under GCC I will need to add the call.  We could also adopt your 
bitcount header, though I think it is more consistent to keep the loop in 
BIT_COUNT() and use something that emulates popcountl() rather than directly 
using bitcount() in BIT_COUNT() (primarily because the rest of sys/bitset.h is 
structured that way: explicit loops in sys/bitset.h itself).

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


Re: svn commit: r278474 - head/sys/sys

2015-02-09 Thread Jung-uk Kim
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On 02/09/2015 17:12, John Baldwin wrote:
> On Monday, February 09, 2015 04:55:52 PM Jung-uk Kim wrote:
>> On 02/09/2015 16:08, John Baldwin wrote:
>>> On Monday, February 09, 2015 09:03:24 PM John Baldwin wrote:
 Author: jhb Date: Mon Feb  9 21:03:23 2015 New Revision:
 278474 URL: https://svnweb.freebsd.org/changeset/base/278474
 
 Log: Use __builtin_popcnt() to implement a BIT_COUNT()
 operation for bitsets and use this to implement CPU_COUNT()
 to count the number of CPUs in a cpuset.
 
 MFC after: 2 weeks
>>> 
>>> Yes, __builtin_popcnt() works with GCC 4.2.  It should also
>>> allow the compiler to DTRT in userland uses of this if -msse4.2
>>> is enabled.
>> 
>> Back in 2012, when I submitted a similar patch, bde noted 
>> __builtin_popcount*() cannot be used with GCC 4.2 for *kernel*
>> because it emits a library call.
>> 
>> http://docs.freebsd.org/cgi/mid.cgi?20121116171923.L1135
>> 
>> FYI...
> 
> Weird, I though I built a kernel with this in a tree that uses it
> in the igb(4) driver.  We need a CPU_COUNT() no matter what, but if
> this emits a library call under GCC I will need to add the call.
> We could also adopt your bitcount header, though I think it is more
> consistent to keep the loop in BIT_COUNT() and use something that
> emulates popcountl() rather than directly using bitcount() in
> BIT_COUNT() (primarily because the rest of sys/bitset.h is 
> structured that way: explicit loops in sys/bitset.h itself).

I think you should back it out for now and move the discussion to arch
or hackers.  I gave it up at the time but you may have better luck. :-)

FYI, the following was the last version of my patch at the time.

https://people.freebsd.org/~jkim/bitcount5.diff

Jung-uk Kim
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQEcBAEBCAAGBQJU2TRdAAoJEHyflib82/FGUK8H/jnrTqxqw6k5mK2hL3jslBuK
yAQKlfCV+pq3jJm6Ixqxk9vszZUwAMw02mPhxkHEPAB4vzZnnhH18u5cOrB1r7MA
NFTva6UKoo5F00GO0yKyK9rGaHXxuoSGjdntEckYJuFxZ8Zh9K1dYIRXGW42f55c
JEK9aU8uVtFTov8RF0pVGDqiezWJRGlTrftDwq8tUHfv8pJG2p0Z9rfLYsP1DTx2
fMcb7iz6IIQKO2aUYytXv8UdqkA2VtwOGrqC0nLTL4RF5bC5i61WHRJYxNWJ5+sV
XQx9cXutkNIIj7IHIw2kpyvx0ynZGIN/jwpBy0d58aq3jv2wQhzk/F1ID51guNk=
=uINd
-END PGP SIGNATURE-
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r278478 - head/sys/sys

2015-02-09 Thread Rui Paulo
Author: rpaulo
Date: Mon Feb  9 23:04:30 2015
New Revision: 278478
URL: https://svnweb.freebsd.org/changeset/base/278478

Log:
  Add the ability to print a vendor copyright in dmesg.

Modified:
  head/sys/sys/copyright.h

Modified: head/sys/sys/copyright.h
==
--- head/sys/sys/copyright.hMon Feb  9 21:47:12 2015(r278477)
+++ head/sys/sys/copyright.hMon Feb  9 23:04:30 2015(r278478)
@@ -28,6 +28,10 @@
 
 /* Copyrights macros  */
 
+/* Add a FreeBSD vendor copyright here */
+#defineCOPYRIGHT_Vendor \
+   ""
+
 /* FreeBSD */
 #define COPYRIGHT_FreeBSD \
"Copyright (c) 1992-2015 The FreeBSD Project.\n"
@@ -48,5 +52,6 @@
 #define COPYRIGHT_PC98
 #endif
 
-char copyright[] = COPYRIGHT_FreeBSD COPYRIGHT_PC98 COPYRIGHT_UCB;
+char copyright[] = COPYRIGHT_Vendor COPYRIGHT_FreeBSD COPYRIGHT_PC98 \
+COPYRIGHT_UCB;
 char trademark[] = TRADEMARK_Foundation;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r278474 - head/sys/sys

2015-02-09 Thread John Baldwin
On Monday, February 09, 2015 05:27:45 PM Jung-uk Kim wrote:
> On 02/09/2015 17:12, John Baldwin wrote:
> > On Monday, February 09, 2015 04:55:52 PM Jung-uk Kim wrote:
> >> On 02/09/2015 16:08, John Baldwin wrote:
> >>> On Monday, February 09, 2015 09:03:24 PM John Baldwin wrote:
>  Author: jhb Date: Mon Feb  9 21:03:23 2015 New Revision:
>  278474 URL: https://svnweb.freebsd.org/changeset/base/278474
>  
>  Log: Use __builtin_popcnt() to implement a BIT_COUNT()
>  operation for bitsets and use this to implement CPU_COUNT()
>  to count the number of CPUs in a cpuset.
>  
>  MFC after:   2 weeks
> >>> 
> >>> Yes, __builtin_popcnt() works with GCC 4.2.  It should also
> >>> allow the compiler to DTRT in userland uses of this if -msse4.2
> >>> is enabled.
> >> 
> >> Back in 2012, when I submitted a similar patch, bde noted
> >> __builtin_popcount*() cannot be used with GCC 4.2 for *kernel*
> >> because it emits a library call.
> >> 
> >> http://docs.freebsd.org/cgi/mid.cgi?20121116171923.L1135
> >> 
> >> FYI...
> > 
> > Weird, I though I built a kernel with this in a tree that uses it
> > in the igb(4) driver.  We need a CPU_COUNT() no matter what, but if
> > this emits a library call under GCC I will need to add the call.
> > We could also adopt your bitcount header, though I think it is more
> > consistent to keep the loop in BIT_COUNT() and use something that
> > emulates popcountl() rather than directly using bitcount() in
> > BIT_COUNT() (primarily because the rest of sys/bitset.h is
> > structured that way: explicit loops in sys/bitset.h itself).
> 
> I think you should back it out for now and move the discussion to arch
> or hackers.  I gave it up at the time but you may have better luck. :-)
> 
> FYI, the following was the last version of my patch at the time.
> 
> https://people.freebsd.org/~jkim/bitcount5.diff

I could also just make it userland only for now?  Rui wants to use it in
userland.  However, I can back it out if that is preferred.  To be honest,
I'm not sure how valuable it is at this point to expend a lot of effort to
support GCC older than 3.4 (i.e. the non-builtin popcount approach).

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


svn commit: r278479 - in head: etc sys/kern

2015-02-09 Thread Rui Paulo
Author: rpaulo
Date: Mon Feb  9 23:13:50 2015
New Revision: 278479
URL: https://svnweb.freebsd.org/changeset/base/278479

Log:
  Notify devd(8) when a process crashed.
  
  This change implements a notification (via devctl) to userland when
  the kernel produces coredumps after a process has crashed.
  devd can then run a specific command to produce a human readable crash
  report.  The command is most usually a helper that runs gdb/lldb
  commands on the file/coredump pair.  It's possible to use this
  functionality for implementing automatic generation of crash reports.
  
  devd(8) will be notified of the full path of the binary that crashed and
  the full path of the coredump file.

Modified:
  head/etc/devd.conf
  head/sys/kern/kern_sig.c

Modified: head/etc/devd.conf
==
--- head/etc/devd.conf  Mon Feb  9 23:04:30 2015(r278478)
+++ head/etc/devd.conf  Mon Feb  9 23:13:50 2015(r278479)
@@ -325,4 +325,16 @@ notify 100 {
action "/usr/sbin/automount -c";
 };
 
+# Handle userland coredumps.
+# This commented out handler makes it possible to run an
+# automated debugging session after the core dump is generated.
+# Replace action with a proper coredump handler, but be aware that
+# it will run with elevated privileges.
+notify 10 {
+   match "system"  "kernel";
+   match "subsystem"   "signal";
+   match "type""coredump";
+   action "logger $comm $core";
+};
+
 */

Modified: head/sys/kern/kern_sig.c
==
--- head/sys/kern/kern_sig.cMon Feb  9 23:04:30 2015(r278478)
+++ head/sys/kern/kern_sig.cMon Feb  9 23:13:50 2015(r278479)
@@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -3237,6 +3238,9 @@ coredump(struct thread *td)
void *rl_cookie;
off_t limit;
int compress;
+   char *data = NULL;
+   size_t len;
+   char *fullpath, *freepath = NULL;
 
 #ifdef COMPRESS_USER_CORES
compress = compress_user_cores;
@@ -3322,9 +3326,36 @@ close:
error1 = vn_close(vp, FWRITE, cred, td);
if (error == 0)
error = error1;
+   else
+   goto out;
+   /*
+* Notify the userland helper that a process triggered a core dump.
+* This allows the helper to run an automated debugging session.
+*/
+   len = MAXPATHLEN * 2 + 5 /* comm= */ + 5 /* core= */ + 1;
+   data = malloc(len, M_TEMP, M_NOWAIT);
+   if (data == NULL)
+   goto out;
+   if (vn_fullpath_global(td, p->p_textvp, &fullpath, &freepath) != 0)
+   goto out;
+   snprintf(data, len, "comm=%s", fullpath);
+   if (freepath != NULL) {
+   free(freepath, M_TEMP);
+   freepath = NULL;
+   }
+   if (vn_fullpath_global(td, vp, &fullpath, &freepath) != 0)
+   goto out;
+   snprintf(data, len, "%s core=%s", data, fullpath);
+   devctl_notify("kernel", "signal", "coredump", data);
+   free(name, M_TEMP);
+out:
 #ifdef AUDIT
audit_proc_coredump(td, name, error);
 #endif
+   if (freepath != NULL)
+   free(freepath, M_TEMP);
+   if (data != NULL)
+   free(data, M_TEMP);
free(name, M_TEMP);
return (error);
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r278479 - in head: etc sys/kern

2015-02-09 Thread Benjamin Kaduk
On Mon, Feb 9, 2015 at 6:13 PM, Rui Paulo  wrote:

> Author: rpaulo
> Date: Mon Feb  9 23:13:50 2015
> New Revision: 278479
> URL: https://svnweb.freebsd.org/changeset/base/278479
>
> Log:
>   Notify devd(8) when a process crashed.
>
>   This change implements a notification (via devctl) to userland when
>   the kernel produces coredumps after a process has crashed.
>   devd can then run a specific command to produce a human readable crash
>   report.  The command is most usually a helper that runs gdb/lldb
>   commands on the file/coredump pair.  It's possible to use this
>   functionality for implementing automatic generation of crash reports.
>
>   devd(8) will be notified of the full path of the binary that crashed and
>   the full path of the coredump file.
>

What advantage does putting this in devd have over a standalone daemon for
crash reporting?  Is it just the ease of implementation to leverage the
existing infrastructure?

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


Re: svn commit: r278474 - head/sys/sys

2015-02-09 Thread Jung-uk Kim
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On 02/09/2015 18:08, John Baldwin wrote:
> On Monday, February 09, 2015 05:27:45 PM Jung-uk Kim wrote:
>> On 02/09/2015 17:12, John Baldwin wrote:
>>> On Monday, February 09, 2015 04:55:52 PM Jung-uk Kim wrote:
 On 02/09/2015 16:08, John Baldwin wrote:
> On Monday, February 09, 2015 09:03:24 PM John Baldwin
> wrote:
>> Author: jhb Date: Mon Feb  9 21:03:23 2015 New Revision: 
>> 278474 URL:
>> https://svnweb.freebsd.org/changeset/base/278474
>> 
>> Log: Use __builtin_popcnt() to implement a BIT_COUNT() 
>> operation for bitsets and use this to implement
>> CPU_COUNT() to count the number of CPUs in a cpuset.
>> 
>> MFC after:   2 weeks
> 
> Yes, __builtin_popcnt() works with GCC 4.2.  It should
> also allow the compiler to DTRT in userland uses of this if
> -msse4.2 is enabled.
 
 Back in 2012, when I submitted a similar patch, bde noted 
 __builtin_popcount*() cannot be used with GCC 4.2 for
 *kernel* because it emits a library call.
 
 http://docs.freebsd.org/cgi/mid.cgi?20121116171923.L1135
 
 FYI...
>>> 
>>> Weird, I though I built a kernel with this in a tree that uses
>>> it in the igb(4) driver.  We need a CPU_COUNT() no matter what,
>>> but if this emits a library call under GCC I will need to add
>>> the call. We could also adopt your bitcount header, though I
>>> think it is more consistent to keep the loop in BIT_COUNT() and
>>> use something that emulates popcountl() rather than directly
>>> using bitcount() in BIT_COUNT() (primarily because the rest of
>>> sys/bitset.h is structured that way: explicit loops in
>>> sys/bitset.h itself).
>> 
>> I think you should back it out for now and move the discussion to
>> arch or hackers.  I gave it up at the time but you may have
>> better luck. :-)
>> 
>> FYI, the following was the last version of my patch at the time.
>> 
>> https://people.freebsd.org/~jkim/bitcount5.diff
> 
> I could also just make it userland only for now?  Rui wants to use
> it in userland.  However, I can back it out if that is preferred.

I am fine with "#if defined(__clang__) || !define(_KERNEL)" case.

> To be honest, I'm not sure how valuable it is at this point to
> expend a lot of effort to support GCC older than 3.4 (i.e. the
> non-builtin popcount approach).

No, I don't care about GCC 3.x any more.

Jung-uk Kim
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQEcBAEBCAAGBQJU2UALAAoJEHyflib82/FGy8wH/jviXO8fcvprc1y4DGkc87rD
ylBjoHimjsDt6Wr9MixYNZKbTXhd4BIgQVvFphgCshGjBbmkvII9DH/OleSTa/p8
/YJk87dZHE336An+GkXGTshESvLHw3l8hACR5FcussDLswJArBcDMuzbIW9Q7ASY
dJsWTajP3r4rBqAtQQGxAmNfIvWC6iUP7mELSIoP8vBbUfO4HVZZWh7u5gqXxXnk
dDX4kc7XuGweOtMydIY8bYiQYWb+IqMjnCEuucpJ4yktj3kUr8v9To+xAW6AmX7V
OZQjMRzFbVKHPB6gs5fSaNZBD/D6MUpeDAXRQCy52xQB7vCQE1UNrR850upvxxY=
=NARs
-END PGP SIGNATURE-
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r278474 - head/sys/sys

2015-02-09 Thread Rui Paulo

On Feb 09, 2015, at 03:17 PM, Jung-uk Kim  wrote:
I am fine with "#if defined(__clang__) || !define(_KERNEL)" case.
 
Works for me.  Note, however, that I'm fixing the original problem in the xz 
repository first.  CPU_COUNT() will only be used by xz after we import 5.2.1.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Re: svn commit: r278479 - in head: etc sys/kern

2015-02-09 Thread Rui Paulo

On Feb 09, 2015, at 03:16 PM, Benjamin Kaduk  wrote:

On Mon, Feb 9, 2015 at 6:13 PM, Rui Paulo  wrote:
Author: rpaulo
Date: Mon Feb  9 23:13:50 2015
New Revision: 278479
URL: https://svnweb.freebsd.org/changeset/base/278479

Log:
  Notify devd(8) when a process crashed.

  This change implements a notification (via devctl) to userland when
  the kernel produces coredumps after a process has crashed.
  devd can then run a specific command to produce a human readable crash
  report.  The command is most usually a helper that runs gdb/lldb
  commands on the file/coredump pair.  It's possible to use this
  functionality for implementing automatic generation of crash reports.

  devd(8) will be notified of the full path of the binary that crashed and
  the full path of the coredump file.

What advantage does putting this in devd have over a standalone daemon for 
crash reporting?  Is it just the ease of implementation to leverage the 
existing infrastructure?
 
Well, I want to automatically inspect all the programs that crashed in a given 
system.  I don't see how you can do that with a standalone daemon.  Or maybe I 
didn't understand what you meant.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Re: svn commit: r278479 - in head: etc sys/kern

2015-02-09 Thread Konstantin Belousov
On Mon, Feb 09, 2015 at 11:13:51PM +, Rui Paulo wrote:
> Author: rpaulo
> Date: Mon Feb  9 23:13:50 2015
> New Revision: 278479
> URL: https://svnweb.freebsd.org/changeset/base/278479
> 
> Log:
>   Notify devd(8) when a process crashed.
>   
>   This change implements a notification (via devctl) to userland when
>   the kernel produces coredumps after a process has crashed.
>   devd can then run a specific command to produce a human readable crash
>   report.  The command is most usually a helper that runs gdb/lldb
>   commands on the file/coredump pair.  It's possible to use this
>   functionality for implementing automatic generation of crash reports.
>   
>   devd(8) will be notified of the full path of the binary that crashed and
>   the full path of the coredump file.
Arguably, there should be a knob, probably sysctl, to turn the
functionality off. I definitely do not want this on crash boxes used for
userspace debugging.  Even despite the example handler is inactive.

> 
> Modified:
>   head/etc/devd.conf
>   head/sys/kern/kern_sig.c
> 
> Modified: head/etc/devd.conf
> ==
> --- head/etc/devd.confMon Feb  9 23:04:30 2015(r278478)
> +++ head/etc/devd.confMon Feb  9 23:13:50 2015(r278479)
> @@ -325,4 +325,16 @@ notify 100 {
>   action "/usr/sbin/automount -c";
>  };
>  
> +# Handle userland coredumps.
> +# This commented out handler makes it possible to run an
> +# automated debugging session after the core dump is generated.
> +# Replace action with a proper coredump handler, but be aware that
> +# it will run with elevated privileges.
> +notify 10 {
> + match "system"  "kernel";
> + match "subsystem"   "signal";
> + match "type""coredump";
> + action "logger $comm $core";
> +};
> +
>  */
> 
> Modified: head/sys/kern/kern_sig.c
> ==
> --- head/sys/kern/kern_sig.c  Mon Feb  9 23:04:30 2015(r278478)
> +++ head/sys/kern/kern_sig.c  Mon Feb  9 23:13:50 2015(r278479)
> @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$");
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -3237,6 +3238,9 @@ coredump(struct thread *td)
>   void *rl_cookie;
>   off_t limit;
>   int compress;
> + char *data = NULL;
> + size_t len;
> + char *fullpath, *freepath = NULL;
>  
>  #ifdef COMPRESS_USER_CORES
>   compress = compress_user_cores;
> @@ -3322,9 +3326,36 @@ close:
>   error1 = vn_close(vp, FWRITE, cred, td);
>   if (error == 0)
>   error = error1;
> + else
> + goto out;
> + /*
> +  * Notify the userland helper that a process triggered a core dump.
> +  * This allows the helper to run an automated debugging session.
> +  */
> + len = MAXPATHLEN * 2 + 5 /* comm= */ + 5 /* core= */ + 1;
It is much cleaner to use static const char arrays for the names,
and use sizeof() - 1 instead of hard-coding commented constants.

> + data = malloc(len, M_TEMP, M_NOWAIT);
Why is this allocation M_NOWAIT ?

> + if (data == NULL)
> + goto out;
> + if (vn_fullpath_global(td, p->p_textvp, &fullpath, &freepath) != 0)
> + goto out;
> + snprintf(data, len, "comm=%s", fullpath);
> + if (freepath != NULL) {
> + free(freepath, M_TEMP);
Checks for NULL pointer before free(9) are redundant.

> + freepath = NULL;
> + }
> + if (vn_fullpath_global(td, vp, &fullpath, &freepath) != 0)
> + goto out;
> + snprintf(data, len, "%s core=%s", data, fullpath);
This is weird, and highly depends on the implementation details, supplying
the same string as target and source.  IMO strcat(9) is enough there.

> + devctl_notify("kernel", "signal", "coredump", data);
> + free(name, M_TEMP);
> +out:
>  #ifdef AUDIT
>   audit_proc_coredump(td, name, error);
>  #endif
> + if (freepath != NULL)
> + free(freepath, M_TEMP);
> + if (data != NULL)
> + free(data, M_TEMP);
>   free(name, M_TEMP);
>   return (error);
>  }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r278479 - in head: etc sys/kern

2015-02-09 Thread Benjamin Kaduk
On Mon, Feb 9, 2015 at 6:22 PM, Rui Paulo  wrote:

> On Feb 09, 2015, at 03:16 PM, Benjamin Kaduk  wrote:
>
>
> What advantage does putting this in devd have over a standalone daemon for
> crash reporting?  Is it just the ease of implementation to leverage the
> existing infrastructure?
>
>
> Well, I want to automatically inspect all the programs that crashed in a
> given system.  I don't see how you can do that with a standalone daemon.
> Or maybe I didn't understand what you meant.
>

I think you have misunderstood what I was trying to ask.

We could in principle write a new daemon, call it crash-reporterd for now,
and have the kernel notify that daemon whenever any program on the system
crashes.  But writing the infrastructure to support that would be a bunch
of work, and we already have devd set up to get notifications from the
kernel, so it is much faster to implement crash reporting in devd, even
though crashes in software have nothing to do with device changes.

The question boils down to: is the time saved by implementing it this way
worth the tradeoff of architectural purity.

I don't have an opinion myself, I just want to make sure the question is
considered.

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


Re: svn commit: r278478 - head/sys/sys

2015-02-09 Thread John-Mark Gurney
Rui Paulo wrote this message on Mon, Feb 09, 2015 at 23:04 +:
> Author: rpaulo
> Date: Mon Feb  9 23:04:30 2015
> New Revision: 278478
> URL: https://svnweb.freebsd.org/changeset/base/278478
> 
> Log:
>   Add the ability to print a vendor copyright in dmesg.

Should we change this into a linker set so that any module can
add their own vendor copyright w/o having to modify this again?

-- 
  John-Mark Gurney  Voice: +1 415 225 5579

 "All that I will do, has been done, All that I have, has not."
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r278479 - in head: etc sys/kern

2015-02-09 Thread Ian Lepore
On Mon, 2015-02-09 at 18:29 -0500, Benjamin Kaduk wrote:
> On Mon, Feb 9, 2015 at 6:22 PM, Rui Paulo  wrote:
> 
> > On Feb 09, 2015, at 03:16 PM, Benjamin Kaduk  wrote:
> >
> >
> > What advantage does putting this in devd have over a standalone daemon for
> > crash reporting?  Is it just the ease of implementation to leverage the
> > existing infrastructure?
> >
> >
> > Well, I want to automatically inspect all the programs that crashed in a
> > given system.  I don't see how you can do that with a standalone daemon.
> > Or maybe I didn't understand what you meant.
> >
> 
> I think you have misunderstood what I was trying to ask.
> 
> We could in principle write a new daemon, call it crash-reporterd for now,
> and have the kernel notify that daemon whenever any program on the system
> crashes.  But writing the infrastructure to support that would be a bunch
> of work, and we already have devd set up to get notifications from the
> kernel, so it is much faster to implement crash reporting in devd, even
> though crashes in software have nothing to do with device changes.
> 
> The question boils down to: is the time saved by implementing it this way
> worth the tradeoff of architectural purity.
> 
> I don't have an opinion myself, I just want to make sure the question is
> considered.
> 
> -Ben

Truth be told, it kind of bugs me.  I think adding this to devctl and
devd is inappropriate without also renaming those components to reflect
their new role, and rewriting the manpages to reflect what they actually
do now.

If you ponder for a moment what the new role seems to be (generic
notification to userland of events happening in the kernel), you end up
with names like "keventd" and that makes you wonder whether a new type
of knote for kevent, listened for by a new crashd app, would be better.

-- Ian


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


Re: svn commit: r278450 - head/release

2015-02-09 Thread Nikolai Lifanov

On 2015-02-09 05:46, Glen Barber wrote:

Author: gjb
Date: Mon Feb  9 10:46:39 2015
New Revision: 278450
URL: https://svnweb.freebsd.org/changeset/base/278450

Log:
  Revert r278445.

  I was going to use __FreeBSD_version to determine if
  xz(1) should be multi-threaded by default, but doing
  this will cause problems if/when the changes are merged
  from head.

  Sponsored by: The FreeBSD Foundation

Modified:
  head/release/Makefile

Modified: head/release/Makefile



Can you just X-MFC this with xz 5.2.0 import?
You can then refer to xz in OBJDIR to get this to work on older 
releases.


- Nikolai Lifanov

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


Re: svn commit: r278450 - head/release

2015-02-09 Thread Glen Barber
On Mon, Feb 09, 2015 at 05:47:10PM -0500, Nikolai Lifanov wrote:
> On 2015-02-09 05:46, Glen Barber wrote:
> >Author: gjb
> >Date: Mon Feb  9 10:46:39 2015
> >New Revision: 278450
> >URL: https://svnweb.freebsd.org/changeset/base/278450
> >
> >Log:
> >  Revert r278445.
> >
> >  I was going to use __FreeBSD_version to determine if
> >  xz(1) should be multi-threaded by default, but doing
> >  this will cause problems if/when the changes are merged
> >  from head.
> >
> >  Sponsored by:  The FreeBSD Foundation
> >
> >Modified:
> >  head/release/Makefile
> >
> >Modified: head/release/Makefile
> >
> 
> Can you just X-MFC this with xz 5.2.0 import?
> You can then refer to xz in OBJDIR to get this to work on older releases.
> 

That is the intent, but not this commit.

The problem is the Makefile would contain things like:

 .if (${FREEBSD_VERSION} >= 1100059) || ((${FREEBSD_VERSION < 110 \
&& ${FREEBSD_VERSION} >= 1000555)) [...].

and other varying levels of ridiculousness.

It's bad enough we have to do this in the ports tree.  I certainly do
not intend to implement this behavior in the src tree.

With regards to the OBJDIR, actual releases (not always snapshots) are
always built from the same major FreeBSD version or higher.  Meaning,
code/features that exist in releng/10.1 are available already in
stable/10 at the time.

In this particular case, I care less about snapshot builds and more
about the release builds, which in this particular case, we are far off
in the future enough that it is guaranteed the feature needed will be
available.

Glen



pgpUCi6YuGymp.pgp
Description: PGP signature


svn commit: r278480 - head/etc/rc.d

2015-02-09 Thread Jamie Gritton
Author: jamie
Date: Tue Feb 10 00:48:51 2015
New Revision: 278480
URL: https://svnweb.freebsd.org/changeset/base/278480

Log:
  Un-revert the r278323 again - whatever Jenkins/kyua is up it, it has
  nothing to do with this.

Modified:
  head/etc/rc.d/jail

Modified: head/etc/rc.d/jail
==
--- head/etc/rc.d/jail  Mon Feb  9 23:13:50 2015(r278479)
+++ head/etc/rc.d/jail  Tue Feb 10 00:48:51 2015(r278480)
@@ -233,8 +233,7 @@ parse_options()
fi
eval : \${jail_${_j}_procfs_enable:=${jail_procfs_enable:-NO}}
if checkyesno jail_${_j}_procfs_enable; then
-   echo "  mount += " \
-   "\"procfs ${_rootdir%/}/proc procfs rw 0 0\";"
+   echo "  mount.procfs;"
fi
 
eval : \${jail_${_j}_mount_enable:=${jail_mount_enable:-NO}}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r278481 - in head/sys/powerpc: aim include

2015-02-09 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Tue Feb 10 00:55:42 2015
New Revision: 278481
URL: https://svnweb.freebsd.org/changeset/base/278481

Log:
  Set thread priorities on multithreaded CPUs so that threads holding a
  spinlock are high-priority and threads waiting for a spinlock are set to
  low priority.

Modified:
  head/sys/powerpc/aim/machdep.c
  head/sys/powerpc/include/cpu.h

Modified: head/sys/powerpc/aim/machdep.c
==
--- head/sys/powerpc/aim/machdep.c  Tue Feb 10 00:48:51 2015
(r278480)
+++ head/sys/powerpc/aim/machdep.c  Tue Feb 10 00:55:42 2015
(r278481)
@@ -750,6 +750,7 @@ spinlock_enter(void)
 
td = curthread;
if (td->td_md.md_spinlock_count == 0) {
+   __asm __volatile("or 2,2,2"); /* Set high thread priority */
msr = intr_disable();
td->td_md.md_spinlock_count = 1;
td->td_md.md_saved_msr = msr;
@@ -768,8 +769,10 @@ spinlock_exit(void)
critical_exit();
msr = td->td_md.md_saved_msr;
td->td_md.md_spinlock_count--;
-   if (td->td_md.md_spinlock_count == 0)
+   if (td->td_md.md_spinlock_count == 0) {
intr_restore(msr);
+   __asm __volatile("or 6,6,6"); /* Set normal thread priority */
+   }
 }
 
 int db_trap_glue(struct trapframe *);  /* Called from trap_subr.S */

Modified: head/sys/powerpc/include/cpu.h
==
--- head/sys/powerpc/include/cpu.h  Tue Feb 10 00:48:51 2015
(r278480)
+++ head/sys/powerpc/include/cpu.h  Tue Feb 10 00:55:42 2015
(r278481)
@@ -88,7 +88,7 @@ get_cyclecount(void)
 }
 
 #definecpu_getstack(td)((td)->td_frame->fixreg[1])
-#definecpu_spinwait()  /* nothing */
+#definecpu_spinwait()  __asm __volatile("or 27,27,27") /* 
yield */
 
 extern char btext[];
 extern char etext[];
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r278482 - head/sys/powerpc/pseries

2015-02-09 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Tue Feb 10 00:57:26 2015
New Revision: 278482
URL: https://svnweb.freebsd.org/changeset/base/278482

Log:
  Add error reporting to interrupt CPU binding.

Modified:
  head/sys/powerpc/pseries/xics.c

Modified: head/sys/powerpc/pseries/xics.c
==
--- head/sys/powerpc/pseries/xics.c Tue Feb 10 00:55:42 2015
(r278481)
+++ head/sys/powerpc/pseries/xics.c Tue Feb 10 00:57:26 2015
(r278482)
@@ -197,12 +197,13 @@ xicp_bind(device_t dev, u_int irq, cpuse
 {
struct xicp_softc *sc = device_get_softc(dev);
cell_t status, cpu;
-   int ncpus, i;
+   int ncpus, i, error;
 
/*
 * This doesn't appear to actually support affinity groups, so pick a
 * random CPU.
 */
+   ncpus = 0;
CPU_FOREACH(cpu)
if (CPU_ISSET(cpu, &cpumask)) ncpus++;
 
@@ -217,8 +218,10 @@ xicp_bind(device_t dev, u_int irq, cpuse
}

 
-   rtas_call_method(sc->ibm_set_xive, 3, 1, irq, cpu, XICP_PRIORITY,
-   &status);
+   error = rtas_call_method(sc->ibm_set_xive, 3, 1, irq, cpu,
+   XICP_PRIORITY, &status);
+   if (error < 0)
+   panic("Cannot bind interrupt %d to CPU %d", irq, cpu);
 }
 
 static void
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r278483 - head/usr.sbin/bsdconfig/networking/share

2015-02-09 Thread Devin Teske
Author: dteske
Date: Tue Feb 10 01:02:02 2015
New Revision: 278483
URL: https://svnweb.freebsd.org/changeset/base/278483

Log:
  Comments.
  
  MFC after:3 days

Modified:
  head/usr.sbin/bsdconfig/networking/share/device.subr

Modified: head/usr.sbin/bsdconfig/networking/share/device.subr
==
--- head/usr.sbin/bsdconfig/networking/share/device.subrTue Feb 10 
00:57:26 2015(r278482)
+++ head/usr.sbin/bsdconfig/networking/share/device.subrTue Feb 10 
01:02:02 2015(r278483)
@@ -207,7 +207,7 @@ f_dialog_menu_netdev_edit()
'3 $msg_ipaddr4'   '$ipaddr'
'4 $msg_netmask'   '$netmask'
'5 $msg_options'   '$options'
-   "
+   " # END-QUOTE
eval f_dialog_menu_size height width rows \
\"\$DIALOG_TITLE\" \
\"\$DIALOG_BACKTITLE\" \
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r278485 - in head/sys/dev/cxgbe: . common

2015-02-09 Thread Navdeep Parhar
Author: np
Date: Tue Feb 10 01:16:43 2015
New Revision: 278485
URL: https://svnweb.freebsd.org/changeset/base/278485

Log:
  cxgbe(4): allow the SET_FILTER_MODE ioctl to change the mode when it's
  safe to do so.
  
  MFC after:1 month

Modified:
  head/sys/dev/cxgbe/common/t4_hw.c
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/common/t4_hw.c
==
--- head/sys/dev/cxgbe/common/t4_hw.c   Tue Feb 10 01:05:51 2015
(r278484)
+++ head/sys/dev/cxgbe/common/t4_hw.c   Tue Feb 10 01:16:43 2015
(r278485)
@@ -3111,6 +3111,31 @@ void t4_write_rss_pf_mask(struct adapter
  &pfmask, 1, A_TP_RSS_PF_MSK);
 }
 
+static void refresh_vlan_pri_map(struct adapter *adap)
+{
+
+t4_read_indirect(adap, A_TP_PIO_ADDR, A_TP_PIO_DATA,
+ &adap->params.tp.vlan_pri_map, 1,
+ A_TP_VLAN_PRI_MAP);
+
+   /*
+* Now that we have TP_VLAN_PRI_MAP cached, we can calculate the field
+* shift positions of several elements of the Compressed Filter Tuple
+* for this adapter which we need frequently ...
+*/
+   adap->params.tp.vlan_shift = t4_filter_field_shift(adap, F_VLAN);
+   adap->params.tp.vnic_shift = t4_filter_field_shift(adap, F_VNIC_ID);
+   adap->params.tp.port_shift = t4_filter_field_shift(adap, F_PORT);
+   adap->params.tp.protocol_shift = t4_filter_field_shift(adap, 
F_PROTOCOL);
+
+   /*
+* If TP_INGRESS_CONFIG.VNID == 0, then TP_VLAN_PRI_MAP.VNIC_ID
+* represents the presense of an Outer VLAN instead of a VNIC ID.
+*/
+   if ((adap->params.tp.ingress_config & F_VNIC) == 0)
+   adap->params.tp.vnic_shift = -1;
+}
+
 /**
  * t4_set_filter_mode - configure the optional components of filter tuples
  * @adap: the adapter
@@ -3134,6 +3159,8 @@ int t4_set_filter_mode(struct adapter *a
return -EINVAL;
t4_write_indirect(adap, A_TP_PIO_ADDR, A_TP_PIO_DATA, &mode_map, 1,
  A_TP_VLAN_PRI_MAP);
+   refresh_vlan_pri_map(adap);
+
return 0;
 }
 
@@ -5618,33 +5645,10 @@ int __devinit t4_init_tp_params(struct a
for (chan = 0; chan < NCHAN; chan++)
adap->params.tp.tx_modq[chan] = chan;
 
-   /*
-* Cache the adapter's Compressed Filter Mode and global Incress
-* Configuration.
-*/
-t4_read_indirect(adap, A_TP_PIO_ADDR, A_TP_PIO_DATA,
- &adap->params.tp.vlan_pri_map, 1,
- A_TP_VLAN_PRI_MAP);
t4_read_indirect(adap, A_TP_PIO_ADDR, A_TP_PIO_DATA,
 &adap->params.tp.ingress_config, 1,
 A_TP_INGRESS_CONFIG);
-
-   /*
-* Now that we have TP_VLAN_PRI_MAP cached, we can calculate the field
-* shift positions of several elements of the Compressed Filter Tuple
-* for this adapter which we need frequently ...
-*/
-   adap->params.tp.vlan_shift = t4_filter_field_shift(adap, F_VLAN);
-   adap->params.tp.vnic_shift = t4_filter_field_shift(adap, F_VNIC_ID);
-   adap->params.tp.port_shift = t4_filter_field_shift(adap, F_PORT);
-   adap->params.tp.protocol_shift = t4_filter_field_shift(adap, 
F_PROTOCOL);
-
-   /*
-* If TP_INGRESS_CONFIG.VNID == 0, then TP_VLAN_PRI_MAP.VNIC_ID
-* represents the presense of an Outer VLAN instead of a VNIC ID.
-*/
-   if ((adap->params.tp.ingress_config & F_VNIC) == 0)
-   adap->params.tp.vnic_shift = -1;
+   refresh_vlan_pri_map(adap);
 
return 0;
 }

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cTue Feb 10 01:05:51 2015
(r278484)
+++ head/sys/dev/cxgbe/t4_main.cTue Feb 10 01:16:43 2015
(r278485)
@@ -7116,10 +7116,9 @@ get_filter_mode(struct adapter *sc, uint
log(LOG_WARNING, "%s: cached filter mode out of sync %x %x.\n",
device_get_nameunit(sc->dev), sc->params.tp.vlan_pri_map,
fconf);
-   sc->params.tp.vlan_pri_map = fconf;
}
 
-   *mode = fconf_to_mode(sc->params.tp.vlan_pri_map);
+   *mode = fconf_to_mode(fconf);
 
end_synchronized_op(sc, LOCK_HELD);
return (0);
@@ -7150,14 +7149,7 @@ set_filter_mode(struct adapter *sc, uint
}
 #endif
 
-#ifdef notyet
rc = -t4_set_filter_mode(sc, fconf);
-   if (rc == 0)
-   sc->filter_mode = fconf;
-#else
-   rc = ENOTSUP;
-#endif
-
 done:
end_synchronized_op(sc, LOCK_HELD);
return (rc);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r278323 - in head: etc/rc.d usr.sbin/jail

2015-02-09 Thread NGie Cooper
On Sat, Feb 7, 2015 at 12:10 AM, Konstantin Belousov
 wrote:
> On Fri, Feb 06, 2015 at 09:23:47PM -0800, Garrett Cooper wrote:
>> pgrep uses /proc to determine whether or not a process is running. If it?s 
>> not properly mounted or the jail isn?t started properly, that could cause 
>> the issues seen here. I know because I?ve tried running these tests before 
>> in an attempt to fix them, and this was one of the things I ran into.
>>
> pgrep does not use /proc.

You're right. I'm not sure where I got it in my mind that that was the
case, but this wasn't it..
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r278486 - head

2015-02-09 Thread Glen Barber
Author: gjb
Date: Tue Feb 10 01:35:26 2015
New Revision: 278486
URL: https://svnweb.freebsd.org/changeset/base/278486

Log:
  Exclude 'tests' from DEBUG_DISTRIBUTIONS.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Tue Feb 10 01:16:43 2015(r278485)
+++ head/Makefile.inc1  Tue Feb 10 01:35:26 2015(r278486)
@@ -823,7 +823,7 @@ EXTRA_DISTRIBUTIONS+=   tests
 
 DEBUG_DISTRIBUTIONS=
 .if ${MK_DEBUG_FILES} != "no"
-DEBUG_DISTRIBUTIONS+=  base ${EXTRA_DISTRIBUTIONS:S,doc,,}
+DEBUG_DISTRIBUTIONS+=  base ${EXTRA_DISTRIBUTIONS:S,doc,,:S,tests,,}
 .endif
 
 MTREE_MAGIC?=  mtree 2.0
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r278478 - head/sys/sys

2015-02-09 Thread Julian Elischer

On 2/10/15 8:02 AM, John-Mark Gurney wrote:

Rui Paulo wrote this message on Mon, Feb 09, 2015 at 23:04 +:

Author: rpaulo
Date: Mon Feb  9 23:04:30 2015
New Revision: 278478
URL: https://svnweb.freebsd.org/changeset/base/278478

Log:
   Add the ability to print a vendor copyright in dmesg.

Should we change this into a linker set so that any module can
add their own vendor copyright w/o having to modify this again?


that is not a stupid idea..
or we could add a copyright element to the sample sysinit code and 
provide a linked list of things to print out.
(a copyright API.. call it from SYINIT, if it's early it queues it.. 
if you are already booted it prints it right away)


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


Re: svn commit: r278479 - in head: etc sys/kern

2015-02-09 Thread Rui Paulo
On Feb 9, 2015, at 15:29, Benjamin Kaduk  wrote:
> The question boils down to: is the time saved by implementing it this way 
> worth the tradeoff of architectural purity.

Yes, that was a tradeoff.

--
Rui Paulo



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


Re: svn commit: r278433 - in head: . contrib/xz contrib/xz/src/common contrib/xz/src/liblzma contrib/xz/src/liblzma/api contrib/xz/src/liblzma/api/lzma contrib/xz/src/liblzma/check contrib/xz/src/libl

2015-02-09 Thread Glen Barber
On Mon, Feb 09, 2015 at 04:08:00PM +0300, Dmitry Morozovsky wrote:
> > > FWIW, compressing VM images (some sparse files, some not) would take
> > > upwards of 45 minutes, which after this update, just takes a few
> > > minutes.
> > > 
> > >  root@releng2:/R2/vmimages # time xz -T 0 -k 
> > > FreeBSD-11.0-CURRENT-amd64.qcow2 \
> > >  time xz -T 0 -k FreeBSD-11.0-CURRENT-amd64.raw; \
> > >  time xz -T 0 -k FreeBSD-11.0-CURRENT-amd64.vhd; \
> > >  time xz -T 0 -k FreeBSD-11.0-CURRENT-amd64.vmdk
> > >  1027.602u 40.376s 1:09.57 1535.1%   81+192k 0+19774io 0pf+0w
> > >  1032.978u 38.823s 1:08.17 1572.2%   81+192k 0+19696io 0pf+0w
> > >  1033.908u 38.593s 1:11.70 1495.8%   81+192k 0+19729io 0pf+0w
> > >  1091.749u 42.371s 1:04.27 1764.6%   81+192k 0+19751io 0pf+0w
> > > 
> > 
> > I meant to include that this is on a 48-core machine.
> 
> Hm, I can't beleive you didn't use pxz ;)
> 

For RE purposes, using base system utilities supersedes utilities
available elsewhere.

In my initial tests with pxz, there was an, albeit somewhat predictable,
increase in resulting file size as the number of threads increased,
while xz in base with the latest update produces output files within
+/-1024Kb difference of the unthreaded version.

For RE side, there was no real gain in using pxz over xz, because the
sacrifice was the output file size.  I do not care so much about the
time taken to compress the files.  I *do* care about the resulting file
size, since I (personally) want to be sure that the end user can
download the smallest possible file.

I was unsure what to expect with the xz(1) update in this regard, and
was surprised to see a non-visible difference in the resulting file.

> Anyway, having this in base, and not depending on external tool, is 
> amazingly great.
> 
> BTW, Rui, did you some comparative tests with pxz?
> 

As stated above, pxz (last I tested) produces incrementally larger files
as the thread count increases.  From what I have seen so far, the latest
xz update does not.

Glen



pgpo0e8Cv_86o.pgp
Description: PGP signature


Re: svn commit: r278478 - head/sys/sys

2015-02-09 Thread Rui Paulo
On Feb 9, 2015, at 16:02, John-Mark Gurney  wrote:
> 
> Rui Paulo wrote this message on Mon, Feb 09, 2015 at 23:04 +:
>> Author: rpaulo
>> Date: Mon Feb  9 23:04:30 2015
>> New Revision: 278478
>> URL: https://svnweb.freebsd.org/changeset/base/278478
>> 
>> Log:
>>  Add the ability to print a vendor copyright in dmesg.
> 
> Should we change this into a linker set so that any module can
> add their own vendor copyright w/o having to modify this again?

So you want a copyright module?  That seems a bit overkill.  :-)

An API like Julian mentioned seems like a better idea, but it's not trivial to 
implement if you want the Copyright to be the first thing to be printed.

--
Rui Paulo



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


Re: svn commit: r278479 - in head: etc sys/kern

2015-02-09 Thread Rui Paulo
On Feb 9, 2015, at 15:28, Konstantin Belousov  wrote:
> Arguably, there should be a knob, probably sysctl, to turn the
> functionality off. I definitely do not want this on crash boxes used for
> userspace debugging.  Even despite the example handler is inactive.

OK, I can provide a sysctl knob.

>> +len = MAXPATHLEN * 2 + 5 /* comm= */ + 5 /* core= */ + 1;
> It is much cleaner to use static const char arrays for the names,
> and use sizeof() - 1 instead of hard-coding commented constants.

OK.  I was trying to avoid allocating >2k on the stack.

>> +data = malloc(len, M_TEMP, M_NOWAIT);
> Why is this allocation M_NOWAIT ?

That should be M_WAITOK.

>> +freepath = NULL;
>> +}
>> +if (vn_fullpath_global(td, vp, &fullpath, &freepath) != 0)
>> +goto out;
>> +snprintf(data, len, "%s core=%s", data, fullpath);
> This is weird, and highly depends on the implementation details, supplying
> the same string as target and source.  IMO strcat(9) is enough there.

OK, I'll change it to strcat.

--
Rui Paulo



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


Re: svn commit: r278478 - head/sys/sys

2015-02-09 Thread Ian Lepore
On Mon, 2015-02-09 at 16:02 -0800, John-Mark Gurney wrote:
> Rui Paulo wrote this message on Mon, Feb 09, 2015 at 23:04 +:
> > Author: rpaulo
> > Date: Mon Feb  9 23:04:30 2015
> > New Revision: 278478
> > URL: https://svnweb.freebsd.org/changeset/base/278478
> > 
> > Log:
> >   Add the ability to print a vendor copyright in dmesg.
> 
> Should we change this into a linker set so that any module can
> add their own vendor copyright w/o having to modify this again?
> 

As long as that doesn't result in a boot-time cacaphony of voices
disclaiming responsibility for being in Bill Paul's head.

-- Ian


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


Re: svn commit: r278479 - in head: etc sys/kern

2015-02-09 Thread Mateusz Guzik
On Mon, Feb 09, 2015 at 11:13:51PM +, Rui Paulo wrote:
> +notify 10 {
> + match "system"  "kernel";
> + match "subsystem"   "signal";
> + match "type""coredump";
> + action "logger $comm $core";
> +};
> +
>  */
> 
[..]
> + if (vn_fullpath_global(td, p->p_textvp, &fullpath, &freepath) != 0)
> + goto out;
> + snprintf(data, len, "comm=%s", fullpath);

I cannot test it right now, but it looks like immediate privilege
escalation.

Path is not sanitized in any way and devd passes it to 'sh -c'.

So a file named "a.out; /bin/id; meh" or so should result in execution
of aforementioned /bin/id.

Another note is that currently devctl is record oriented, but this may
change at some point and free form userspace text could be used to forge
new events.

As such is trongly suggest we sanitize this somehow. Maybe a base64 or
something.

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


Re: svn commit: r278323 - in head: etc/rc.d usr.sbin/jail

2015-02-09 Thread James Gritton

On 2015-02-06 22:23, Garrett Cooper wrote:

On Feb 6, 2015, at 18:38, James Gritton  wrote:

On 2015-02-06 19:23, Garrett Cooper wrote:
I think you broke the Jenkins tests runs, and potentially jail 
support

in some edgecases:
https://jenkins.freebsd.org/job/FreeBSD_HEAD-tests2/651/


Where do I go from here?  There error you refer to certainly seems 
jail-related, which leads me to guess at something disconnected 
between the matching rc.d/jail and jail(8) change (i.e. using the new 
rc file with the old jail program).  But that's really just a wild 
guess.  Is there somewhere I look for more information?  For example, 
where does Jenkins actually do its thing?


Sorry for being so stupid in this - Jenkins has only been on the very 
edge of my awareness until now.


I honestly don’t think it’s Jenkins because Jenkins runs in bhyve. I
think you accidentally broke option handling in the jail configuration
(please see my other reply about added “break;” statements).

...

You can verify your changes by doing:

% (cd /usr/tests/bin/pkill; sudo kyua test)


After some testing and looking around, I've decided the problem 
definitely isn't in rc.d where I thought it might be.  I've also decided 
it's probably not in my patch either.


I've run this kyua test on a 10 system (don't have current handy for 
such things at the moment), and sometimes I would see a failure and 
sometimes I wouldn't.  This was whether I was using the new or old jail 
code.  Later in the day, when the box was less loaded, it seemed to 
always pass.  Looking at the pkill-j_test script, I see jails being 
created with sleep commands both inside and outside the jail around its 
creation.  I'm guessing this script is very sensitive to timing issues 
that could be cause by (among other things) system load.  The jail 
commands in this script were also very simple, with the only parameters 
used being: path, name, ip4.addr, and command.  This isn't some kind of 
esoteric exercising of the jail(8) options, and I would expect if it 
works at one time it would work at another.  I've "hand-run" these 
particular jail commands and couldn't get them to fail (and the actual 
content of the jail(8) changes were tests already).


I looked at the freebsd-current (I think) list where the Jenkins errors 
are posted, and it's true it started failing the pkill-j test at the 
time I made my change.  But it's also true that it had failed that test 
once the day before my change, and then started passing it again.  This 
particular test just seems to be fragile.


So I don't have anywhere else to go with this.  I'm going to assume 
jail(8) isn't the problem here.


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

svn commit: r278488 - head/usr.sbin/bsdconfig/usermgmt/share

2015-02-09 Thread Devin Teske
Author: dteske
Date: Tue Feb 10 02:53:26 2015
New Revision: 278488
URL: https://svnweb.freebsd.org/changeset/base/278488

Log:
  Whitespace.
  
  MFC after:3 days

Modified:
  head/usr.sbin/bsdconfig/usermgmt/share/user.subr

Modified: head/usr.sbin/bsdconfig/usermgmt/share/user.subr
==
--- head/usr.sbin/bsdconfig/usermgmt/share/user.subrTue Feb 10 02:02:24 
2015(r278487)
+++ head/usr.sbin/bsdconfig/usermgmt/share/user.subrTue Feb 10 02:53:26 
2015(r278488)
@@ -830,8 +830,7 @@ f_user_delete()
f_eval_catch $funcname \
pw '%s -H 0' "$cmd"
else
-   f_eval_catch $funcname \
-   pw '%s -h -' "$cmd"
+   f_eval_catch $funcname pw '%s -h -' "$cmd"
fi
fi
fi
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r278489 - in head/usr.sbin/bsdconfig/timezone: . share

2015-02-09 Thread Devin Teske
Author: dteske
Date: Tue Feb 10 02:55:10 2015
New Revision: 278489
URL: https://svnweb.freebsd.org/changeset/base/278489

Log:
  Eliminate sub-shells where possible for performance.
  
  MFC after:7 days

Modified:
  head/usr.sbin/bsdconfig/timezone/share/continents.subr
  head/usr.sbin/bsdconfig/timezone/share/countries.subr
  head/usr.sbin/bsdconfig/timezone/timezone

Modified: head/usr.sbin/bsdconfig/timezone/share/continents.subr
==
--- head/usr.sbin/bsdconfig/timezone/share/continents.subr  Tue Feb 10 
02:53:26 2015(r278488)
+++ head/usr.sbin/bsdconfig/timezone/share/continents.subr  Tue Feb 10 
02:55:10 2015(r278489)
@@ -1,6 +1,6 @@
 if [ ! "$_TIMEZONE_CONTINENTS_SUBR" ]; then _TIMEZONE_CONTINENTS_SUBR=1
 #
-# Copyright (c) 2011-2012 Devin Teske
+# Copyright (c) 2011-2015 Devin Teske
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -87,7 +87,7 @@ export continent_utc_title
 
  FUNCTIONS
 
-# f_continent $cont $property
+# f_continent $cont $property [$var_to_set]
 #
 # Returns a single property of a given continent. Available properties are:
 #
@@ -102,37 +102,60 @@ export continent_utc_title
 #  (which appears after continent selection).
 #  menu_list   Menu-list of regions for this continent.
 #
+# If $var_to_set is missing or NULL, the value of $var_to_get is printed to
+# standard output for capturing in a sub-shell (which is less-recommended
+# because of performance degredation; for example, when called in a loop).
+#
 f_continent()
 {
-   local cont="$1" property="$2"
-   eval echo \"\${continent_${cont}_$property}\"
+   f_getvar "continent_${1}_$2" $3
 }
 
-# f_find_continent $title
+# f_find_continent $title [$var_to_set]
 #
 # Returns continent identifier given continent title.
 #
+# If $var_to_set is missing or NULL, the value of $var_to_get is printed to
+# standard output for capturing in a sub-shell (which is less-recommended
+# because of performance degredation; for example, when called in a loop).
+#
 f_find_continent()
 {
-   local cont
-   for cont in $CONTINENTS; do
-   if [ "$1" = "$( f_continent $cont title )" ]; then
-   echo "$cont"
+   local __cont __title
+   for __cont in $CONTINENTS; do
+   f_continent $__cont title __title
+   if [ "$1" = "$__title" ]; then
+   if [ "$2" ]; then
+   setvar "$2" $__cont
+   else
+   echo "$__cont"
+   fi
return $SUCCESS
fi
done
return $FAILURE
 }
 
-# f_OCEANP $cont
+# f_OCEANP $cont [$var_to_set]
 #
 # Returns "1" if the first argument is an ocean, otherwise NULL.
 #
+# If $var_to_set is missing or NULL, the value of $var_to_get is printed to
+# standard output for capturing in a sub-shell (which is less-recommended
+# because of performance degredation; for example, when called in a loop).
+#
 f_OCEANP()
 {
case "$1" in
arctic|atlantic|indian|pacific)
-   echo 1
+   if [ "$2" ]; then
+   setvar "$2" 1
+   else
+   echo 1
+   fi
+   ;;
+   *)
+   [ "$2" ] && setvar "$2" ""
esac
 }
 

Modified: head/usr.sbin/bsdconfig/timezone/share/countries.subr
==
--- head/usr.sbin/bsdconfig/timezone/share/countries.subr   Tue Feb 10 
02:53:26 2015(r278488)
+++ head/usr.sbin/bsdconfig/timezone/share/countries.subr   Tue Feb 10 
02:55:10 2015(r278489)
@@ -1,6 +1,6 @@
 if [ ! "$_TIMEZONE_COUNTRIES_SUBR" ]; then _TIMEZONE_COUNTRIES_SUBR=1
 #
-# Copyright (c) 2011-2012 Devin Teske
+# Copyright (c) 2011-2015 Devin Teske
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -25,8 +25,10 @@ if [ ! "$_TIMEZONE_COUNTRIES_SUBR" ]; th
 # SUCH DAMAGE.
 #
 # $FreeBSD$
+#
+ FUNCTIONS
 
-# f_country $code $property
+# f_country $code $property [$var_to_set]
 #
 # Returns a single property of a given country. Available properties are:
 #
@@ -44,10 +46,13 @@ if [ ! "$_TIMEZONE_COUNTRIES_SUBR" ]; th
 #  descr_N  Like name, but for the Nth zone when the country has
 #   multiple zones (nzones > 0)
 #
+# If $var_to_set is missing or NULL, the value of $var_to_get is printed to
+# standard output for capturing in a sub-shell (which is less-recommended
+# because of performance degredation; for example, when called in a loop).
+#
 f_country()
 {
-   local code="$1" property="$2"
-   eval echo \"\${country_${code}_$property

Re: svn commit: r278479 - in head: etc sys/kern

2015-02-09 Thread Rui Paulo
On Feb 9, 2015, at 18:43, Mateusz Guzik  wrote:
> 
> On Mon, Feb 09, 2015 at 11:13:51PM +, Rui Paulo wrote:
>> +notify 10 {
>> +match "system"  "kernel";
>> +match "subsystem"   "signal";
>> +match "type""coredump";
>> +action "logger $comm $core";
>> +};
>> +
>> */
>> 
> [..]
>> +if (vn_fullpath_global(td, p->p_textvp, &fullpath, &freepath) != 0)
>> +goto out;
>> +snprintf(data, len, "comm=%s", fullpath);
> 
> I cannot test it right now, but it looks like immediate privilege
> escalation.
> 
> Path is not sanitized in any way and devd passes it to 'sh -c'.
> 
> So a file named "a.out; /bin/id; meh" or so should result in execution
> of aforementioned /bin/id.

Well, you can't have a file name with "/" but you're right.

> Another note is that currently devctl is record oriented, but this may
> change at some point and free form userspace text could be used to forge
> new events.
> 
> As such is trongly suggest we sanitize this somehow. Maybe a base64 or
> something.

I was trying hard to avoid this issue in unpublished my crash helper, but I 
forgot that devd runs execl("sh -c", );  :-(

It might just be easier to inspect the path names and allow only 
[a-z][A-Z][0-9] and '/' before sending the devctl message.

--
Rui Paulo



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


svn commit: r278490 - head/usr.sbin/bsdconfig/share

2015-02-09 Thread Devin Teske
Author: dteske
Date: Tue Feb 10 03:12:11 2015
New Revision: 278490
URL: https://svnweb.freebsd.org/changeset/base/278490

Log:
  Add bsdconfig api functions f_dialog_pause()/f_dialog_pause_no_cancel()

Modified:
  head/usr.sbin/bsdconfig/share/dialog.subr

Modified: head/usr.sbin/bsdconfig/share/dialog.subr
==
--- head/usr.sbin/bsdconfig/share/dialog.subr   Tue Feb 10 02:55:10 2015
(r278489)
+++ head/usr.sbin/bsdconfig/share/dialog.subr   Tue Feb 10 03:12:11 2015
(r278490)
@@ -1580,6 +1580,56 @@ f_xdialog_info()
-1 # timeout of -1 means abort when EOF on stdin
 }
 
+ PAUSE FUNCTIONS
+
+# f_dialog_pause $msg_text $duration [$hline]
+#
+# Display a message in a widget with a progress bar that runs backward for
+# $duration seconds.
+#
+f_dialog_pause()
+{
+   local pause_text="$1" duration="$2" hline="$3" height width
+   f_isinteger "$duration" || return $FAILURE
+   f_dialog_buttonbox_size height width \
+   "$DIALOG_TITLE" "$DIALOG_BACKTITLE" "$pause_text" "$hline"
+   if [ "$USE_XDIALOG" ]; then
+   $DIALOG \
+   --title "$DIALOG_TITLE" \
+   --backtitle "$DIALOG_BACKTITLE" \
+   --ok-label "$msg_skip"  \
+   --cancel-label "$msg_cancel"\
+   ${noCancel:+--no-cancel}\
+   --timeout "$duration"   \
+   --yesno "$pause_text"   \
+   $height $width
+   else
+   [ $duration -gt 0 ] && duration=$(( $duration - 1 ))
+   [ $duration -gt 1 ] && duration=$(( $duration - 1 ))
+   height=$(( $height + 3 )) # Add height for progress bar
+   $DIALOG \
+   --title "$DIALOG_TITLE" \
+   --backtitle "$DIALOG_BACKTITLE" \
+   --hline "$hline"\
+   --ok-label "$msg_skip"  \
+   --cancel-label "$msg_cancel"\
+   ${noCancel:+--no-cancel}\
+   --pause "$pause_text"   \
+   $height $width "$duration"
+   fi
+}
+
+# f_dialog_pause_no_cancel $msg_text $duration [$hline]
+#
+# Display a message in a widget with a progress bar that runs backward for
+# $duration seconds. No cancel button is provided. Always returns success.
+#
+f_dialog_pause_no_cancel()
+{
+   noCancel=1 f_dialog_pause "$@"
+   return $SUCCESS
+}
+
  MSGBOX FUNCTIONS
 
 # f_dialog_msgbox $msg_text [$hline]
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r278479 - in head: etc sys/kern

2015-02-09 Thread Don Lewis
On 10 Feb, Mateusz Guzik wrote:
> On Mon, Feb 09, 2015 at 11:13:51PM +, Rui Paulo wrote:
>> +notify 10 {
>> +match "system"  "kernel";
>> +match "subsystem"   "signal";
>> +match "type""coredump";
>> +action "logger $comm $core";
>> +};
>> +
>>  */
>> 
> [..]
>> +if (vn_fullpath_global(td, p->p_textvp, &fullpath, &freepath) != 0)
>> +goto out;
>> +snprintf(data, len, "comm=%s", fullpath);
> 
> I cannot test it right now, but it looks like immediate privilege
> escalation.
> 
> Path is not sanitized in any way and devd passes it to 'sh -c'.
> 
> So a file named "a.out; /bin/id; meh" or so should result in execution
> of aforementioned /bin/id.

Then there is the issue of a user-generated core file being fed into the
crash analyzer, possibly exploiting bugs in the latter.

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


Re: svn commit: r278479 - in head: etc sys/kern

2015-02-09 Thread Rui Paulo
On Feb 9, 2015, at 19:11, Don Lewis  wrote:
> 
> On 10 Feb, Mateusz Guzik wrote:
>> On Mon, Feb 09, 2015 at 11:13:51PM +, Rui Paulo wrote:
>>> +notify 10 {
>>> +   match "system"  "kernel";
>>> +   match "subsystem"   "signal";
>>> +   match "type""coredump";
>>> +   action "logger $comm $core";
>>> +};
>>> +
>>> */
>>> 
>> [..]
>>> +   if (vn_fullpath_global(td, p->p_textvp, &fullpath, &freepath) != 0)
>>> +   goto out;
>>> +   snprintf(data, len, "comm=%s", fullpath);
>> 
>> I cannot test it right now, but it looks like immediate privilege
>> escalation.
>> 
>> Path is not sanitized in any way and devd passes it to 'sh -c'.
>> 
>> So a file named "a.out; /bin/id; meh" or so should result in execution
>> of aforementioned /bin/id.
> 
> Then there is the issue of a user-generated core file being fed into the
> crash analyzer, possibly exploiting bugs in the latter.

That's why there's a warning in devd.conf: devd will run the helper as root, so 
a proper written helper has to drop the privileges very early or be invoked by 
devd with lower privileges.  My helper just drops privileges to match the 
UID/GID of the generated core file before doing anything else.

--
Rui Paulo



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


Re: svn commit: r278479 - in head: etc sys/kern

2015-02-09 Thread Don Lewis
On  9 Feb, Don Lewis wrote:
> On 10 Feb, Mateusz Guzik wrote:
>> On Mon, Feb 09, 2015 at 11:13:51PM +, Rui Paulo wrote:
>>> +notify 10 {
>>> +   match "system"  "kernel";
>>> +   match "subsystem"   "signal";
>>> +   match "type""coredump";
>>> +   action "logger $comm $core";
>>> +};
>>> +
>>>  */
>>> 
>> [..]
>>> +   if (vn_fullpath_global(td, p->p_textvp, &fullpath, &freepath) != 0)
>>> +   goto out;
>>> +   snprintf(data, len, "comm=%s", fullpath);
>> 
>> I cannot test it right now, but it looks like immediate privilege
>> escalation.
>> 
>> Path is not sanitized in any way and devd passes it to 'sh -c'.
>> 
>> So a file named "a.out; /bin/id; meh" or so should result in execution
>> of aforementioned /bin/id.
> 
> Then there is the issue of a user-generated core file being fed into the
> crash analyzer, possibly exploiting bugs in the latter.

Or worse, the contents of the executable, in particular the debug info,
could also be an attack vector.

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


svn commit: r278491 - head/usr.sbin/bsdconfig/share

2015-02-09 Thread Devin Teske
Author: dteske
Date: Tue Feb 10 03:15:54 2015
New Revision: 278491
URL: https://svnweb.freebsd.org/changeset/base/278491

Log:
  Add bsdconfig api function f_dialog_menutag2help()

Modified:
  head/usr.sbin/bsdconfig/share/dialog.subr

Modified: head/usr.sbin/bsdconfig/share/dialog.subr
==
--- head/usr.sbin/bsdconfig/share/dialog.subr   Tue Feb 10 03:12:11 2015
(r278490)
+++ head/usr.sbin/bsdconfig/share/dialog.subr   Tue Feb 10 03:15:54 2015
(r278491)
@@ -2116,6 +2116,39 @@ f_dialog_menutag2index_with_help()
return $FAILURE
 }
 
+# f_dialog_menutag2help $tag_chosen $tag1 $item1 $help1 $tag2 $item2 $help2 ...
+#
+# To use the `--menu' option of dialog(1) with the `--item-help' option, you
+# must pass an ordered list of tag/item/help triplets on the command-line. When
+# the user selects a menu option the tag for that item is printed to stderr.
+#
+# This function allows you to dereference the tag chosen by the user back into
+# the help associated with said tag (item is discarded/ignored).
+#
+# Pass the tag chosen by the user as the first argument, followed by the
+# ordered list of tag/item/help triplets (HINT: use the same tag/item/help list
+# as was passed to dialog(1) for consistency).
+#
+# If the tag cannot be found, NULL is returned.
+#
+f_dialog_menutag2help()
+{
+   local tag="$1" tagn help
+   shift 1 # tag
+
+   while [ $# -gt 0 ]; do
+   tagn="$1"
+   help="$3"
+   shift 3 # tagn/item/help
+
+   if [ "$tag" = "$tagn" ]; then
+   echo "$help"
+   return $SUCCESS
+   fi
+   done
+   return $FAILURE
+}
+
  INIT FUNCTIONS
 
 # f_dialog_init
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r278492 - head/usr.sbin/bsdconfig/console

2015-02-09 Thread Devin Teske
Author: dteske
Date: Tue Feb 10 03:17:51 2015
New Revision: 278492
URL: https://svnweb.freebsd.org/changeset/base/278492

Log:
  Add "vt_"* aliases to bsdconfig console entries.
  NB: "syscons_"* kept for backward compatibility

Modified:
  head/usr.sbin/bsdconfig/console/INDEX

Modified: head/usr.sbin/bsdconfig/console/INDEX
==
--- head/usr.sbin/bsdconfig/console/INDEX   Tue Feb 10 03:15:54 2015
(r278491)
+++ head/usr.sbin/bsdconfig/console/INDEX   Tue Feb 10 03:17:51 2015
(r278492)
@@ -46,6 +46,13 @@ menu_help="Customize system console beha
 # can be i18n'ed but `command' is the name of a script.
 #
 menu_selection="console|console"
+menu_selection="vt_font|font"
+menu_selection="vt_keymap|keymap"
+menu_selection="vt_repeat|repeat"
+menu_selection="vt_saver|saver"
+menu_selection="vt_screenmap|screenmap"
+menu_selection="vt_ttys|ttys"
+# For backward compatibility
 menu_selection="syscons_font|font"
 menu_selection="syscons_keymap|keymap"
 menu_selection="syscons_repeat|repeat"
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r278493 - in head/usr.sbin/bsdconfig: console includes networking/share share usermgmt/share

2015-02-09 Thread Devin Teske
Author: dteske
Date: Tue Feb 10 03:34:42 2015
New Revision: 278493
URL: https://svnweb.freebsd.org/changeset/base/278493

Log:
  Update copyrights.

Modified:
  head/usr.sbin/bsdconfig/console/INDEX
  head/usr.sbin/bsdconfig/includes/INDEX
  head/usr.sbin/bsdconfig/networking/share/device.subr
  head/usr.sbin/bsdconfig/share/dialog.subr
  head/usr.sbin/bsdconfig/share/keymap.subr
  head/usr.sbin/bsdconfig/usermgmt/share/user.subr

Modified: head/usr.sbin/bsdconfig/console/INDEX
==
--- head/usr.sbin/bsdconfig/console/INDEX   Tue Feb 10 03:17:51 2015
(r278492)
+++ head/usr.sbin/bsdconfig/console/INDEX   Tue Feb 10 03:34:42 2015
(r278493)
@@ -1,5 +1,5 @@
 # Copyright (c) 2012 Ron McDowell
-# Copyright (c) 2012 Devin Teske
+# Copyright (c) 2012-2015 Devin Teske
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without

Modified: head/usr.sbin/bsdconfig/includes/INDEX
==
--- head/usr.sbin/bsdconfig/includes/INDEX  Tue Feb 10 03:17:51 2015
(r278492)
+++ head/usr.sbin/bsdconfig/includes/INDEX  Tue Feb 10 03:34:42 2015
(r278493)
@@ -1,4 +1,4 @@
-# Copyright (c) 2013 Devin Teske
+# Copyright (c) 2013-2015 Devin Teske
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without

Modified: head/usr.sbin/bsdconfig/networking/share/device.subr
==
--- head/usr.sbin/bsdconfig/networking/share/device.subrTue Feb 10 
03:17:51 2015(r278492)
+++ head/usr.sbin/bsdconfig/networking/share/device.subrTue Feb 10 
03:34:42 2015(r278493)
@@ -1,6 +1,6 @@
 if [ ! "$_NETWORKING_DEVICE_SUBR" ]; then _NETWORKING_DEVICE_SUBR=1
 #
-# Copyright (c) 2006-2013 Devin Teske
+# Copyright (c) 2006-2015 Devin Teske
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without

Modified: head/usr.sbin/bsdconfig/share/dialog.subr
==
--- head/usr.sbin/bsdconfig/share/dialog.subr   Tue Feb 10 03:17:51 2015
(r278492)
+++ head/usr.sbin/bsdconfig/share/dialog.subr   Tue Feb 10 03:34:42 2015
(r278493)
@@ -1,6 +1,6 @@
 if [ ! "$_DIALOG_SUBR" ]; then _DIALOG_SUBR=1
 #
-# Copyright (c) 2006-2014 Devin Teske
+# Copyright (c) 2006-2015 Devin Teske
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without

Modified: head/usr.sbin/bsdconfig/share/keymap.subr
==
--- head/usr.sbin/bsdconfig/share/keymap.subr   Tue Feb 10 03:17:51 2015
(r278492)
+++ head/usr.sbin/bsdconfig/share/keymap.subr   Tue Feb 10 03:34:42 2015
(r278493)
@@ -1,6 +1,6 @@
 if [ ! "$_KEYMAP_SUBR" ]; then _KEYMAP_SUBR=1
 #
-# Copyright (c) 2013 Devin Teske
+# Copyright (c) 2013-2015 Devin Teske
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without

Modified: head/usr.sbin/bsdconfig/usermgmt/share/user.subr
==
--- head/usr.sbin/bsdconfig/usermgmt/share/user.subrTue Feb 10 03:17:51 
2015(r278492)
+++ head/usr.sbin/bsdconfig/usermgmt/share/user.subrTue Feb 10 03:34:42 
2015(r278493)
@@ -1,7 +1,7 @@
 if [ ! "$_USERMGMT_USER_SUBR" ]; then _USERMGMT_USER_SUBR=1
 #
 # Copyright (c) 2012 Ron McDowell
-# Copyright (c) 2012-2014 Devin Teske
+# Copyright (c) 2012-2015 Devin Teske
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r278486 - head

2015-02-09 Thread NGie Cooper
On Mon, Feb 9, 2015 at 5:35 PM, Glen Barber  wrote:
> Author: gjb
> Date: Tue Feb 10 01:35:26 2015
> New Revision: 278486
> URL: https://svnweb.freebsd.org/changeset/base/278486
>
> Log:
>   Exclude 'tests' from DEBUG_DISTRIBUTIONS.
>
>   Sponsored by: The FreeBSD Foundation
>
> Modified:
>   head/Makefile.inc1

Hi,
Were the tests distribution debug files really blowing up the install size?
Thanks!
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


  1   2   >