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

2015-07-19 Thread Bruce Evans

On Sat, 18 Jul 2015, Mark Johnston wrote:


On Sat, Jul 18, 2015 at 08:55:07PM +1000, Bruce Evans wrote:

On Sat, 18 Jul 2015, Mark Johnston wrote:


Log:
 Pass the lock object to lockstat_nsecs() and return immediately if
 LO_NOPROFILE is set. Some timecounter handlers acquire a spin mutex, and
 we don't want to recurse if lockstat probes are enabled.


It is an error to call timecounter code from a low-level place like the
mutex implementation.  This workaround depends on all locks in timecounter
handlers being LO_NOPROFILE, and that breaks profiling of these locks.
...


I noticed that lock_profile (which predates lockstat a bit) does the
exact same thing to avoid recursion. Specifically,
lock_profile_obtain_lock_{success,failed} return immediately if
LO_NOPROFILE is set on the target lock. As you pointed out,
this change breaks profiling of timecounter locks, but the only
timecounter implementation in the tree that currently acquires a lock
during a timer read is i8254.


lock_profile also has another copy of lockstat_nsecs() (spelled
nanoseconds()), with different style bugs.  The style bugs start with
lockstat_nsecs()'s existence and nanoseconds()'s name being too generic.


The other two locks that set MTX_NOPROFILE are the witness lock and the
i386 icu lock. Lock order checking can usually be done without taking
the witness lock, so contention would be unusual, and it would strike
me as strange to profile locking with witness enabled anyway. :)
I'm not sure why i386's icu_lock has profiling disabled; this was done
in r166001, but the commit log doesn't explain the reason.


I didn't know that lock profiling was independent of witness.

I can't see any reason why profiling must be disabled for icu_lock, but
perhaps it should be disabled for efficiency reasons for all low-level
mutexes.

Low-level mutexes now use combinations of MTX_QUIET and MTX_NOWITNESS
with no apparent pattern.  It seems right to log everything and check
everything by default (except witness's lock must not witness itself
recursively), and never hard-code hiding from witness or anything just
for efficiency.  Then if a locking error is found in a console driver
lock (there are many such errors that are not found now), the error
must not be reported on the consoles with the locking error.
MTX_QUIET's name suggests that it controls printing of error messages,
but its documentation is ambiguous: it controls logging and it isn't
clear if that is in-memory (for future use by witness or anything) or
just printing.

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: r285685 - in head: sys/compat/linprocfs sys/compat/linsysfs sys/kern sys/sys usr.sbin/jail

2015-07-19 Thread Marcelo Araujo
Author: araujo (ports committer)
Date: Sun Jul 19 08:52:35 2015
New Revision: 285685
URL: https://svnweb.freebsd.org/changeset/base/285685

Log:
  Add support to the jail framework to be able to mount linsysfs(5) and
  linprocfs(5).
  
  Differential Revision:D2846
  Submitted by: Nikolai Lifanov lifa...@mail.lifanov.com
  Reviewed by:  jamie

Modified:
  head/sys/compat/linprocfs/linprocfs.c
  head/sys/compat/linsysfs/linsysfs.c
  head/sys/kern/kern_jail.c
  head/sys/sys/jail.h
  head/usr.sbin/jail/jail.8

Modified: head/sys/compat/linprocfs/linprocfs.c
==
--- head/sys/compat/linprocfs/linprocfs.c   Sun Jul 19 00:38:19 2015
(r285684)
+++ head/sys/compat/linprocfs/linprocfs.c   Sun Jul 19 08:52:35 2015
(r285685)
@@ -1548,7 +1548,7 @@ linprocfs_uninit(PFS_INIT_ARGS)
return (0);
 }
 
-PSEUDOFS(linprocfs, 1, 0);
+PSEUDOFS(linprocfs, 1, PR_ALLOW_MOUNT_LINPROCFS);
 #if defined(__amd64__)
 MODULE_DEPEND(linprocfs, linux_common, 1, 1, 1);
 #else

Modified: head/sys/compat/linsysfs/linsysfs.c
==
--- head/sys/compat/linsysfs/linsysfs.c Sun Jul 19 00:38:19 2015
(r285684)
+++ head/sys/compat/linsysfs/linsysfs.c Sun Jul 19 08:52:35 2015
(r285685)
@@ -275,7 +275,7 @@ linsysfs_uninit(PFS_INIT_ARGS)
return (0);
 }
 
-PSEUDOFS(linsysfs, 1, 0);
+PSEUDOFS(linsysfs, 1, PR_ALLOW_MOUNT_LINSYSFS);
 #if defined(__amd64__)
 MODULE_DEPEND(linsysfs, linux_common, 1, 1, 1);
 #else

Modified: head/sys/kern/kern_jail.c
==
--- head/sys/kern/kern_jail.c   Sun Jul 19 00:38:19 2015(r285684)
+++ head/sys/kern/kern_jail.c   Sun Jul 19 08:52:35 2015(r285685)
@@ -205,6 +205,8 @@ static char *pr_allow_names[] = {
allow.mount.procfs,
allow.mount.tmpfs,
allow.mount.fdescfs,
+   allow.mount.linprocfs,
+   allow.mount.linsysfs,
 };
 const size_t pr_allow_names_size = sizeof(pr_allow_names);
 
@@ -222,6 +224,8 @@ static char *pr_allow_nonames[] = {
allow.mount.noprocfs,
allow.mount.notmpfs,
allow.mount.nofdescfs,
+   allow.mount.nolinprocfs,
+   allow.mount.nolinsysfs,
 };
 const size_t pr_allow_nonames_size = sizeof(pr_allow_nonames);
 
@@ -4290,6 +4294,14 @@ SYSCTL_PROC(_security_jail, OID_AUTO, mo
 CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE,
 NULL, PR_ALLOW_MOUNT_PROCFS, sysctl_jail_default_allow, I,
 Processes in jail can mount the procfs file system);
+SYSCTL_PROC(_security_jail, OID_AUTO, mount_linprocfs_allowed,
+CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE,
+NULL, PR_ALLOW_MOUNT_LINPROCFS, sysctl_jail_default_allow, I,
+Processes in jail can mount the linprocfs file system);
+SYSCTL_PROC(_security_jail, OID_AUTO, mount_linsysfs_allowed,
+CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE,
+NULL, PR_ALLOW_MOUNT_LINSYSFS, sysctl_jail_default_allow, I,
+Processes in jail can mount the linsysfs file system);
 SYSCTL_PROC(_security_jail, OID_AUTO, mount_tmpfs_allowed,
 CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE,
 NULL, PR_ALLOW_MOUNT_TMPFS, sysctl_jail_default_allow, I,
@@ -4456,6 +4468,10 @@ SYSCTL_JAIL_PARAM(_allow_mount, nullfs, 
 B, Jail may mount the nullfs file system);
 SYSCTL_JAIL_PARAM(_allow_mount, procfs, CTLTYPE_INT | CTLFLAG_RW,
 B, Jail may mount the procfs file system);
+SYSCTL_JAIL_PARAM(_allow_mount, linprocfs, CTLTYPE_INT | CTLFLAG_RW,
+B, Jail may mount the linprocfs file system);
+SYSCTL_JAIL_PARAM(_allow_mount, linsysfs, CTLTYPE_INT | CTLFLAG_RW,
+B, Jail may mount the linsysfs file system);
 SYSCTL_JAIL_PARAM(_allow_mount, tmpfs, CTLTYPE_INT | CTLFLAG_RW,
 B, Jail may mount the tmpfs file system);
 SYSCTL_JAIL_PARAM(_allow_mount, zfs, CTLTYPE_INT | CTLFLAG_RW,

Modified: head/sys/sys/jail.h
==
--- head/sys/sys/jail.h Sun Jul 19 00:38:19 2015(r285684)
+++ head/sys/sys/jail.h Sun Jul 19 08:52:35 2015(r285685)
@@ -230,7 +230,9 @@ struct prison_racct {
 #definePR_ALLOW_MOUNT_PROCFS   0x0400
 #definePR_ALLOW_MOUNT_TMPFS0x0800
 #definePR_ALLOW_MOUNT_FDESCFS  0x1000
-#definePR_ALLOW_ALL0x1fff
+#definePR_ALLOW_MOUNT_LINPROCFS0x2000
+#definePR_ALLOW_MOUNT_LINSYSFS 0x4000
+#definePR_ALLOW_ALL0x7fff
 
 /*
  * OSD methods

Modified: head/usr.sbin/jail/jail.8
==
--- head/usr.sbin/jail/jail.8   Sun Jul 19 00:38:19 2015(r285684)
+++ head/usr.sbin/jail/jail.8   Sun Jul 19 08:52:35 2015(r285685)
@@ -25,7 +25,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd February 25, 2015
+.Dd July 20, 2015
 .Dt JAIL 8
 .Os

Re: svn commit: r285627 - in head/sys: arm/arm arm/at91 arm/cavium/cns11xx arm/samsung/s3c2xx0 arm/xscale/i80321 arm/xscale/i8134x arm/xscale/ixp425 arm/xscale/pxa arm64/arm64 ddb i386/i386 powerpc/bo

2015-07-19 Thread Bjoern A. Zeeb

 On 16 Jul 2015, at 10:46 , Zbigniew Bodek z...@freebsd.org wrote:
 
 Author: zbb
 Date: Thu Jul 16 10:46:52 2015
 New Revision: 285627
 URL: https://svnweb.freebsd.org/changeset/base/285627
 
 Log:
  Fix KSTACK_PAGES issue when the default value was changed in KERNCONF
 
  If KSTACK_PAGES was changed to anything alse than the default,
  the value from param.h was taken instead in some places and
  the value from KENRCONF in some others. This resulted in
  inconsistency which caused corruption in SMP envorinment.
 
  Ensure all places where KSTACK_PAGES are used the opt_kstack_pages.h
  is included.
 
  The file opt_kstack_pages.h could not be included in param.h
  because was breaking the toolchain compilation.
 
  Reviewed by:   kib
  Obtained from: Semihalf
  Sponsored by:  The FreeBSD Foundation
  Differential Revision: https://reviews.freebsd.org/D3094


Broke i386 (and pc98) LINT kernels:

i386 LINT kernel failed, check _.i386.LINT for details
i386 LINT-NOINET6 kernel failed, check _.i386.LINT-NOINET6 for details
i386 LINT-NOINET kernel failed, check _.i386.LINT-NOINET for details
pc98 LINT kernel failed, check _.pc98.LINT for details
i386 LINT-NOIP kernel failed, check _.i386.LINT-NOIP for details
i386 LINT-VIMAGE kernel failed, check _.i386.LINT-VIMAGE for details


--
 stage 3.1: making dependencies
--
In file included from /scratch/tmp/bz/head.svn/sys/i386/i386/locore.s:57:
./assym.s:20:9: warning: 'KSTACK_PAGES' macro redefined [-Wmacro-redefined]
#define KSTACK_PAGES0x3
^
./opt_kstack_pages.h:1:9: note: previous definition is here
#define KSTACK_PAGES 3
^
1 warning generated.
--
 stage 3.2: building everything
--
In file included from /scratch/tmp/bz/head.svn/sys/i386/i386/locore.s:57:
./assym.s:20:9: error: 'KSTACK_PAGES' macro redefined 
[-Werror,-Wmacro-redefined]
#define KSTACK_PAGES0x3
^
./opt_kstack_pages.h:1:9: note: previous definition is here
#define KSTACK_PAGES 3
^
1 error generated.
--- locore.o ---
*** [locore.o] Error code 1

bmake: stopped in /storage/head/obj/i386.i386/scratch/tmp/bz/head.svn/sys/LINT



— 
Bjoern A. Zeeb  Charles Haddon Spurgeon:
Friendship is one of the sweetest joys of life.  Many might have failed
 beneath the bitterness of their trial  had they not found a friend.

___
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: r285686 - head/sys/i386/i386

2015-07-19 Thread Konstantin Belousov
Author: kib
Date: Sun Jul 19 10:45:58 2015
New Revision: 285686
URL: https://svnweb.freebsd.org/changeset/base/285686

Log:
  Revert bit of the r285627, locore.s does not need include of
  opt_kstack_pages.h.  The asm gets the right KSTACK_PAGES from the
  assym.s.
  
  Reported by:  bz
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/i386/i386/locore.s

Modified: head/sys/i386/i386/locore.s
==
--- head/sys/i386/i386/locore.s Sun Jul 19 08:52:35 2015(r285685)
+++ head/sys/i386/i386/locore.s Sun Jul 19 10:45:58 2015(r285686)
@@ -41,7 +41,6 @@
 
 #include opt_bootp.h
 #include opt_compat.h
-#include opt_kstack_pages.h
 #include opt_nfsroot.h
 #include opt_pmap.h
 
___
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: r284162 - head/bin/ls

2015-07-19 Thread Jilles Tjoelker
On Fri, Jun 19, 2015 at 11:54:23PM +0200, Jilles Tjoelker wrote:
 On Mon, Jun 08, 2015 at 07:13:05PM +, Xin LI wrote:
  Author: delphij
  Date: Mon Jun  8 19:13:04 2015
  New Revision: 284162
  URL: https://svnweb.freebsd.org/changeset/base/284162

  Log:
It has been long time that when doing 'ls -G /path/to/a/symlink',
instead of using the color of symbolic link, the color is
determined by the link target. This behavior was quite confusing.

Looking at the file history, it looks like that r203665 intends to
fix this but the issue was never actually fixed.

Fix this by not setting FTS_COMFOLLOW when color is requested like
what was done in r203665.

MFC after:2 weeks

  Modified:
head/bin/ls/ls.c

 Hmm. This makes -G or CLICOLOR env behave like -F in that symlinks are
 no longer followed by default. This at least needs a change in the man
 page to document it, and I'm not sure whether -G should actually modify
 ls's action beyond adding colour.

 For example, in stable/10 doing ls /sys, ls -p /sys and ls -G /sys show
 a directory listing of the kernel source, while ls -F /sys shows just
 the symlink.

 What r203665 fixed was colour, inode number, etc. when -P was given and
 -F/-d/-l were not.

 I'll admit that this -F/-d/-l thing is bizarre but it has grown that way
 historically and I've found ls implementations that deviate from this
 annoying (e.g. on some embedded systems).

What's more, the behaviour even depends on TERM, leading to strange
things like:

$ TERM=dumb CLICOLOR=1 ls /sys
Makefilecrypto  libkern netsmb  sparc64
amd64   ddb mipsnfs sys
arm dev modules nfsclient   teken
arm64   fs  net nfsserver   tools
bootgdb net80211nlm ufs
bsm geomnetgraphofedvm
cam gnu netinet opencrypto  x86
cddli386netinet6pc98xdr
compat  isa netipsecpowerpc xen
confkernnetnatm rpc
contrib kgssapi netpfil security
$ TERM=xterm CLICOLOR=1 ls /sys
/sys
$ 

The bottommost /sys is purple.

-- 
Jilles Tjoelker
___
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: r285687 - head/sys/arm/include

2015-07-19 Thread Andrew Turner
Author: andrew
Date: Sun Jul 19 13:10:47 2015
New Revision: 285687
URL: https://svnweb.freebsd.org/changeset/base/285687

Log:
  Sort the ARM atomic functions to be in alphabetical order.
  
  Sponsored by: ABT Systems Ltd

Modified:
  head/sys/arm/include/atomic-v4.h
  head/sys/arm/include/atomic-v6.h

Modified: head/sys/arm/include/atomic-v4.h
==
--- head/sys/arm/include/atomic-v4.hSun Jul 19 10:45:58 2015
(r285686)
+++ head/sys/arm/include/atomic-v4.hSun Jul 19 13:10:47 2015
(r285687)
@@ -89,15 +89,15 @@ __swp(uint32_t val, volatile uint32_t *p
 #defineARM_HAVE_ATOMIC64
 
 static __inline void
-atomic_set_32(volatile uint32_t *address, uint32_t setmask)
+atomic_add_32(volatile u_int32_t *p, u_int32_t val)
 {
-   __with_interrupts_disabled(*address |= setmask);
+   __with_interrupts_disabled(*p += val);
 }
 
 static __inline void
-atomic_set_64(volatile uint64_t *address, uint64_t setmask)
+atomic_add_64(volatile u_int64_t *p, u_int64_t val)
 {
-   __with_interrupts_disabled(*address |= setmask);
+   __with_interrupts_disabled(*p += val);
 }
 
 static __inline void
@@ -146,29 +146,6 @@ atomic_cmpset_64(volatile u_int64_t *p, 
return (ret);
 }
 
-static __inline void
-atomic_add_32(volatile u_int32_t *p, u_int32_t val)
-{
-   __with_interrupts_disabled(*p += val);
-}
-
-static __inline void
-atomic_add_64(volatile u_int64_t *p, u_int64_t val)
-{
-   __with_interrupts_disabled(*p += val);
-}
-
-static __inline void
-atomic_subtract_32(volatile u_int32_t *p, u_int32_t val)
-{
-   __with_interrupts_disabled(*p -= val);
-}
-
-static __inline void
-atomic_subtract_64(volatile u_int64_t *p, u_int64_t val)
-{
-   __with_interrupts_disabled(*p -= val);
-}
 
 static __inline uint32_t
 atomic_fetchadd_32(volatile uint32_t *p, uint32_t v)
@@ -206,17 +183,41 @@ atomic_load_64(volatile uint64_t *p)
 }
 
 static __inline void
+atomic_set_32(volatile uint32_t *address, uint32_t setmask)
+{
+   __with_interrupts_disabled(*address |= setmask);
+}
+
+static __inline void
+atomic_set_64(volatile uint64_t *address, uint64_t setmask)
+{
+   __with_interrupts_disabled(*address |= setmask);
+}
+
+static __inline void
 atomic_store_64(volatile uint64_t *p, uint64_t value)
 {
__with_interrupts_disabled(*p = value);
 }
 
+static __inline void
+atomic_subtract_32(volatile u_int32_t *p, u_int32_t val)
+{
+   __with_interrupts_disabled(*p -= val);
+}
+
+static __inline void
+atomic_subtract_64(volatile u_int64_t *p, u_int64_t val)
+{
+   __with_interrupts_disabled(*p -= val);
+}
+
 #else /* !_KERNEL */
 
-static __inline u_int32_t
-atomic_cmpset_32(volatile u_int32_t *p, volatile u_int32_t cmpval, volatile 
u_int32_t newval)
+static __inline void
+atomic_add_32(volatile u_int32_t *p, u_int32_t val)
 {
-   register int done, ras_start = ARM_RAS_START;
+   int start, ras_start = ARM_RAS_START;
 
__asm __volatile(1:\n
adr%1, 1b\n
@@ -224,22 +225,19 @@ atomic_cmpset_32(volatile u_int32_t *p, 
adr%1, 2f\n
str%1, [%0, #4]\n
ldr%1, [%2]\n
-   cmp%1, %3\n
-   streq  %4, [%2]\n
+   add%1, %1, %3\n
+   str%1, [%2]\n
2:\n
mov%1, #0\n
str%1, [%0]\n
mov%1, #0x\n
str%1, [%0, #4]\n
-   moveq  %1, #1\n
-   movne  %1, #0\n
-   : +r (ras_start), =r (done)
-   ,+r (p), +r (cmpval), +r (newval) : : cc, memory);
-   return (done);
+   : +r (ras_start), =r (start), +r (p), +r (val)
+   : : memory);
 }
 
 static __inline void
-atomic_add_32(volatile u_int32_t *p, u_int32_t val)
+atomic_clear_32(volatile uint32_t *address, uint32_t clearmask)
 {
int start, ras_start = ARM_RAS_START;
 
@@ -249,21 +247,22 @@ atomic_add_32(volatile u_int32_t *p, u_i
adr%1, 2f\n
str%1, [%0, #4]\n
ldr%1, [%2]\n
-   add%1, %1, %3\n
+   bic%1, %1, %3\n
str%1, [%2]\n
2:\n
mov%1, #0\n
str%1, [%0]\n
mov%1, #0x\n
str%1, [%0, #4]\n
-   : +r (ras_start), =r (start), +r (p), +r (val)
+   : +r (ras_start), =r (start), +r (address), +r (clearmask)
: : memory);
+
 }
 
-static __inline void
-atomic_subtract_32(volatile u_int32_t *p, u_int32_t val)
+static __inline u_int32_t
+atomic_cmpset_32(volatile u_int32_t *p, volatile u_int32_t cmpval, volatile 
u_int32_t newval)
 {
-   int start, ras_start = ARM_RAS_START;
+   register int done, ras_start = ARM_RAS_START;
 
__asm __volatile(1:\n
adr%1, 1b\n
@@ -271,16 +270,42 @@ 

svn commit: r285688 - head

2015-07-19 Thread Mark Murray
Author: markm
Date: Sun Jul 19 14:34:35 2015
New Revision: 285688
URL: https://svnweb.freebsd.org/changeset/base/285688

Log:
  Clean up some trailing whitespace.

Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Sun Jul 19 13:10:47 2015(r285687)
+++ head/UPDATING   Sun Jul 19 14:34:35 2015(r285688)
@@ -87,7 +87,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11
 20150616:
FreeBSD's old make (fmake) has been removed from the system. It is
available as the devel/fmake port or via pkg install fmake.
-   
+
 20150615:
The fix for the issue described in the 20150614 sendmail entry
below has been been committed in revision 284436.  The work
@@ -110,7 +110,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11
this interoperability, sendmail can be configured to use a
2048 bit DH parameter by:
 
-   1. Edit /etc/mail/`hostname`.mc 
+   1. Edit /etc/mail/`hostname`.mc
2. If a setting for confDH_PARAMETERS does not exist or
   exists and is set to a string beginning with '5',
   replace it with '2'.
@@ -223,7 +223,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11
using a local socket.  Users who have already enabled the
local_unbound service should regenerate their configuration
by running service local_unbound setup as root.
-   
+
 20150102:
The GNU texinfo and GNU info pages have been removed.
To be able to view GNU info pages please install texinfo from ports.
@@ -614,7 +614,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11
The GNU Compiler Collection and C++ standard library (libstdc++)
are no longer built by default on platforms where clang is the system
compiler.  You can enable them with the WITH_GCC and WITH_GNUCXX
-   options in src.conf.  
+   options in src.conf.
 
 20130905:
The PROCDESC kernel option is now part of the GENERIC kernel
@@ -968,7 +968,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11
 20120727:
The sparc64 ZFS loader has been changed to no longer try to auto-
detect ZFS providers based on diskN aliases but now requires these
-   to be explicitly listed in the OFW boot-device environment variable. 
+   to be explicitly listed in the OFW boot-device environment variable.
 
 20120712:
The OpenSSL has been upgraded to 1.0.1c.  Any binaries requiring
___
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: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random s

2015-07-19 Thread Simon J. Gerraty
Mark R V Murray ma...@freebsd.org wrote:
  On Thu, Jul 02, 2015 at 11:36:27AM -0700, Simon J. Gerraty wrote:
  Sound like you just need to be able to select a single KLD at boot time?

Mark, do you have an estimate of when loadable modules will be supported
again?

We've been holding off sync'ing from head - which is hardly ideal.

___
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: r285707 - in head: share/man/man4 sys/dev/proto

2015-07-19 Thread Marcel Moolenaar
Author: marcel
Date: Sun Jul 19 23:37:45 2015
New Revision: 285707
URL: https://svnweb.freebsd.org/changeset/base/285707

Log:
  Check the hw.proto.attach environment variable for devices that
  proto(4) should attach to instead of the normal driver.
  
  Document the variable.

Modified:
  head/share/man/man4/proto.4
  head/sys/dev/proto/proto.h
  head/sys/dev/proto/proto_bus_isa.c
  head/sys/dev/proto/proto_bus_pci.c
  head/sys/dev/proto/proto_core.c

Modified: head/share/man/man4/proto.4
==
--- head/share/man/man4/proto.4 Sun Jul 19 22:26:02 2015(r285706)
+++ head/share/man/man4/proto.4 Sun Jul 19 23:37:45 2015(r285707)
@@ -25,7 +25,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd July 3, 2015
+.Dd July 19, 2015
 .Dt PROTO 4
 .Os
 .\
@@ -47,6 +47,12 @@ module at boot time, place the following
 .Bd -literal -offset indent
 proto_load=YES
 .Ed
+.Pp
+To have the driver attach to a device instead of its regular driver,
+mention it in the list of devices assigned to the following loader variable:
+.Bd -ragged -offset indent
+hw.proto.attach=desc[,desc]
+.Ed
 .\
 .Sh DESCRIPTION
 The

Modified: head/sys/dev/proto/proto.h
==
--- head/sys/dev/proto/proto.h  Sun Jul 19 22:26:02 2015(r285706)
+++ head/sys/dev/proto/proto.h  Sun Jul 19 23:37:45 2015(r285707)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2014 Marcel Moolenaar
+ * Copyright (c) 2014, 2015 Marcel Moolenaar
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -61,6 +61,7 @@ extern char proto_driver_name[];
 
 int proto_add_resource(struct proto_softc *, int, int, struct resource *);
 
+int proto_probe(device_t dev, const char *prefix, char ***devnamesp);
 int proto_attach(device_t dev);
 int proto_detach(device_t dev);
 

Modified: head/sys/dev/proto/proto_bus_isa.c
==
--- head/sys/dev/proto/proto_bus_isa.c  Sun Jul 19 22:26:02 2015
(r285706)
+++ head/sys/dev/proto/proto_bus_isa.c  Sun Jul 19 23:37:45 2015
(r285707)
@@ -59,6 +59,9 @@ static driver_t proto_isa_driver = {
sizeof(struct proto_softc),
 };
 
+static char proto_isa_prefix[] = isa;
+static char **proto_isa_devnames;
+
 static int
 proto_isa_probe(device_t dev)
 {
@@ -77,12 +80,12 @@ proto_isa_probe(device_t dev)
return (ENODEV);
 
sb = sbuf_new_auto();
-   sbuf_printf(sb, isa:%#lx, rman_get_start(res));
+   sbuf_printf(sb, %s:%#lx, proto_isa_prefix, rman_get_start(res));
sbuf_finish(sb);
device_set_desc_copy(dev, sbuf_data(sb));
sbuf_delete(sb);
bus_release_resource(dev, type, rid, res);
-   return (BUS_PROBE_HOOVER);
+   return (proto_probe(dev, proto_isa_prefix, proto_isa_devnames));
 }
 
 static int

Modified: head/sys/dev/proto/proto_bus_pci.c
==
--- head/sys/dev/proto/proto_bus_pci.c  Sun Jul 19 22:26:02 2015
(r285706)
+++ head/sys/dev/proto/proto_bus_pci.c  Sun Jul 19 23:37:45 2015
(r285707)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2014 Marcel Moolenaar
+ * Copyright (c) 2014, 2015 Marcel Moolenaar
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -59,6 +59,9 @@ static driver_t proto_pci_driver = {
sizeof(struct proto_softc),
 };
 
+static char proto_pci_prefix[] = pci;
+static char **proto_pci_devnames;
+
 static int
 proto_pci_probe(device_t dev)
 {
@@ -68,12 +71,12 @@ proto_pci_probe(device_t dev)
return (ENXIO);
 
sb = sbuf_new_auto();
-   sbuf_printf(sb, pci%d:%d:%d:%d, pci_get_domain(dev),
+   sbuf_printf(sb, %s%d:%d:%d:%d, proto_pci_prefix, pci_get_domain(dev),
pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev));
sbuf_finish(sb);
device_set_desc_copy(dev, sbuf_data(sb));
sbuf_delete(sb);
-   return (BUS_PROBE_HOOVER);
+   return (proto_probe(dev, proto_pci_prefix, proto_pci_devnames));
 }
 
 static int

Modified: head/sys/dev/proto/proto_core.c
==
--- head/sys/dev/proto/proto_core.c Sun Jul 19 22:26:02 2015
(r285706)
+++ head/sys/dev/proto/proto_core.c Sun Jul 19 23:37:45 2015
(r285707)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2014 Marcel Moolenaar
+ * Copyright (c) 2014, 2015 Marcel Moolenaar
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -120,6 +120,62 @@ proto_intr(void *arg)
 #endif
 
 int
+proto_probe(device_t dev, const char *prefix, char ***devnamesp)
+{
+   char **devnames = *devnamesp;
+   const char *dn, *ep, *ev;
+   size_t pfxlen;
+   int idx, names;
+
+   if (devnames == NULL) {
+  

svn commit: r285708 - head/usr.bin/netstat

2015-07-19 Thread Mark Johnston
Author: markj
Date: Mon Jul 20 02:38:51 2015
New Revision: 285708
URL: https://svnweb.freebsd.org/changeset/base/285708

Log:
  Fix some libxo format string errors in the pfkey stats code.
  
  PR:   201700

Modified:
  head/usr.bin/netstat/pfkey.c

Modified: head/usr.bin/netstat/pfkey.c
==
--- head/usr.bin/netstat/pfkey.cSun Jul 19 23:37:45 2015
(r285707)
+++ head/usr.bin/netstat/pfkey.cMon Jul 20 02:38:51 2015
(r285708)
@@ -128,7 +128,7 @@ pfkey_stats(u_long off, const char *name
xo_emit(m, (uintmax_t)pfkeystat.f, plural(pfkeystat.f))
 
/* userland - kernel */
-   p(out_total, \t{:sent-requests//%ju} 
+   p(out_total, \t{:sent-requests/%ju} 
{N:/request%s sent from userland}\n);
p(out_bytes, \t{:sent-bytes/%ju} 
{N:/byte%s sent from userland}\n);
@@ -165,7 +165,7 @@ pfkey_stats(u_long off, const char *name
{N:/message%s with duplicate extension}\n);
p(out_invexttype, \t{:dropped-bad-extension/%ju} 
{N:/message%s with invalid extension type}\n);
-   p(out_invsatype, \t:dropped-bad-sa-type/%ju} 
+   p(out_invsatype, \t{:dropped-bad-sa-type/%ju} 
{N:/message%s with invalid sa type}\n);
p(out_invaddr, \t{:dropped-bad-address-extension/%ju} 
{N:/message%s with invalid address extension}\n);
___
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: r285702 - in head: . lib/libarchive

2015-07-19 Thread Baptiste Daroussin
Author: bapt
Date: Sun Jul 19 21:31:52 2015
New Revision: 285702
URL: https://svnweb.freebsd.org/changeset/base/285702

Log:
  Drop libarchive.pc
  
  We want to ensure we always use libarchive from ports in the ports tree.
  It simplifies ports maintainance and anyway libarchive.pc was not reflecting 
the
  different way libarchive can be built in base

Deleted:
  head/lib/libarchive/libarchive.pc
Modified:
  head/ObsoleteFiles.inc
  head/lib/libarchive/Makefile

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Sun Jul 19 19:23:38 2015(r285701)
+++ head/ObsoleteFiles.inc  Sun Jul 19 21:31:52 2015(r285702)
@@ -38,6 +38,8 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20150719: Remove libarchive.pc
+OLD_FILES+=usr/libdata/pkgconfig/libarchive.pc
 # 20150705: Rename DTrace provider man pages.
 OLD_FILES+=usr/share/man/man4/dtrace-io.4.gz
 OLD_FILES+=usr/share/man/man4/dtrace-ip.4.gz

Modified: head/lib/libarchive/Makefile
==
--- head/lib/libarchive/MakefileSun Jul 19 19:23:38 2015
(r285701)
+++ head/lib/libarchive/MakefileSun Jul 19 21:31:52 2015
(r285702)
@@ -37,12 +37,6 @@ CFLAGS+= -DPPMD_32BIT
 .endif
 NO_WCAST_ALIGN.clang=
 
-.ifndef COMPAT_32BIT
-beforeinstall:
-   ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
-   ${.CURDIR}/libarchive.pc ${DESTDIR}${LIBDATADIR}/pkgconfig
-.endif
-
 .PATH: ${LIBARCHIVEDIR}/libarchive
 
 # Headers to be installed in /usr/include
___
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: r285705 - head/sys/kern

2015-07-19 Thread Kirk McKusick
Author: mckusick
Date: Sun Jul 19 22:25:16 2015
New Revision: 285705
URL: https://svnweb.freebsd.org/changeset/base/285705

Log:
  Restructure code for readability improvement. No functional change.
  
  Reviewed by: kib

Modified:
  head/sys/kern/kern_intr.c

Modified: head/sys/kern/kern_intr.c
==
--- head/sys/kern/kern_intr.c   Sun Jul 19 22:24:33 2015(r285704)
+++ head/sys/kern/kern_intr.c   Sun Jul 19 22:25:16 2015(r285705)
@@ -1231,17 +1231,14 @@ intr_event_execute_handlers(struct proc 
 * For software interrupt threads, we only execute
 * handlers that have their need flag set.  Hardware
 * interrupt threads always invoke all of their handlers.
+*
+* ih_need can only be 0 or 1.  Failed cmpset below
+* means that there is no request to execute handlers,
+* so a retry of the cmpset is not needed.
 */
-   if ((ie-ie_flags  IE_SOFT) != 0) {
-   /*
-* ih_need can only be 0 or 1.  Failed cmpset
-* below means that there is no request to
-* execute handlers, so a retry of the cmpset
-* is not needed.
-*/
-   if (atomic_cmpset_int(ih-ih_need, 1, 0) == 0)
-   continue;
-   }
+   if ((ie-ie_flags  IE_SOFT) != 0 
+   atomic_cmpset_int(ih-ih_need, 1, 0) == 0)
+   continue;
 
/* Execute this handler. */
CTR6(KTR_INTR, %s: pid %d exec %p(%p) for %s flg=%x,
___
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: r285704 - in head: cddl/contrib/opensolaris/cmd/lockstat sys/kern sys/sys

2015-07-19 Thread Mark Johnston
Author: markj
Date: Sun Jul 19 22:24:33 2015
New Revision: 285704
URL: https://svnweb.freebsd.org/changeset/base/285704

Log:
  Consistently use a reader/writer flag for lockstat probes in rwlock(9) and
  sx(9), rather than using the probe function name to determine whether a
  given lock is a read lock or a write lock. Update lockstat(1) accordingly.

Modified:
  head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c
  head/sys/kern/kern_lockstat.c
  head/sys/kern/kern_rwlock.c
  head/sys/kern/kern_sx.c
  head/sys/sys/lockstat.h
  head/sys/sys/rwlock.h
  head/sys/sys/sx.h

Modified: head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c
==
--- head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c   Sun Jul 19 
22:14:09 2015(r285703)
+++ head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c   Sun Jul 19 
22:24:33 2015(r285704)
@@ -196,17 +196,17 @@ static ls_event_info_t g_event_info[LS_M
lockstat:::spin-release, NULL,
lockstat:::spin-acquire },
{ 'H',  Lock, R/W writer hold,  nsec,
-   lockstat::rw_wunlock:rw-release, NULL,
-   lockstat::rw_wlock:rw-acquire },
+   lockstat:::rw-release, arg1 == 0,
+   lockstat:::rw-acquire },
{ 'H',  Lock, R/W reader hold,  nsec,
-   lockstat::rw_runlock:rw-release, NULL,
-   lockstat::rw_rlock:rw-acquire },
+   lockstat:::rw-release, arg1 == 1,
+   lockstat:::rw-acquire },
{ 'H',  Lock, SX shared hold,   nsec,
-   lockstat::sx_sunlock:sx-release, NULL,
-   lockstat::sx_slock:sx-acquire },
+   lockstat:::sx-release, arg1 == 0,
+   lockstat:::sx-acquire },
{ 'H',  Lock, SX exclusive hold,nsec,
-   lockstat::sx_xunlock:sx-release, NULL,
-   lockstat::sx_xlock:sx-acquire },
+   lockstat:::sx-release, arg1 == 1,
+   lockstat:::sx-acquire },
{ 'H',  Lock, Unknown event (type 38),  units },
{ 'H',  Lock, Unknown event (type 39),  units },
{ 'H',  Lock, Unknown event (type 40),  units },

Modified: head/sys/kern/kern_lockstat.c
==
--- head/sys/kern/kern_lockstat.c   Sun Jul 19 22:14:09 2015
(r285703)
+++ head/sys/kern/kern_lockstat.c   Sun Jul 19 22:24:33 2015
(r285704)
@@ -43,16 +43,16 @@ SDT_PROBE_DEFINE1(lockstat, , , spin__ac
 SDT_PROBE_DEFINE1(lockstat, , , spin__release, struct mtx *);
 SDT_PROBE_DEFINE2(lockstat, , , spin__spin, struct mtx *, uint64_t);
 
-SDT_PROBE_DEFINE1(lockstat, , , rw__acquire, struct rwlock *);
-SDT_PROBE_DEFINE1(lockstat, , , rw__release, struct rwlock *);
+SDT_PROBE_DEFINE2(lockstat, , , rw__acquire, struct rwlock *, int);
+SDT_PROBE_DEFINE2(lockstat, , , rw__release, struct rwlock *, int);
 SDT_PROBE_DEFINE5(lockstat, , , rw__block, struct rwlock *, uint64_t, 
int,
 int, int);
 SDT_PROBE_DEFINE2(lockstat, , , rw__spin, struct rwlock *, uint64_t);
 SDT_PROBE_DEFINE1(lockstat, , , rw__upgrade, struct rwlock *);
 SDT_PROBE_DEFINE1(lockstat, , , rw__downgrade, struct rwlock *);
 
-SDT_PROBE_DEFINE1(lockstat, , , sx__acquire, struct sx *);
-SDT_PROBE_DEFINE1(lockstat, , , sx__release, struct sx *);
+SDT_PROBE_DEFINE2(lockstat, , , sx__acquire, struct sx *, int);
+SDT_PROBE_DEFINE2(lockstat, , , sx__release, struct sx *, int);
 SDT_PROBE_DEFINE5(lockstat, , , sx__block, struct sx *, uint64_t, int,
 int, int);
 SDT_PROBE_DEFINE2(lockstat, , , sx__spin, struct sx *, uint64_t);

Modified: head/sys/kern/kern_rwlock.c
==
--- head/sys/kern/kern_rwlock.c Sun Jul 19 22:14:09 2015(r285703)
+++ head/sys/kern/kern_rwlock.c Sun Jul 19 22:24:33 2015(r285704)
@@ -301,8 +301,8 @@ __rw_try_wlock(volatile uintptr_t *c, co
WITNESS_LOCK(rw-lock_object, LOP_EXCLUSIVE | LOP_TRYLOCK,
file, line);
if (!rw_recursed(rw))
-   LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(rw__acquire,
-   rw, 0, 0, file, line);
+   LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(rw__acquire,
+   rw, 0, 0, file, line, LOCKSTAT_WRITER);
curthread-td_locks++;
}
return (rval);
@@ -561,8 +561,8 @@ __rw_rlock(volatile uintptr_t *c, const 
 * however.  turnstiles don't like owners changing between calls to
 * turnstile_wait() currently.
 */
-   LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(rw__acquire, rw, contested,
-   waittime, file, line);
+   LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(rw__acquire, rw, contested,
+   waittime, file, line, LOCKSTAT_READER);
LOCK_LOG_LOCK(RLOCK, rw-lock_object, 

svn commit: r285706 - head/sys/kern

2015-07-19 Thread Mark Johnston
Author: markj
Date: Sun Jul 19 22:26:02 2015
New Revision: 285706
URL: https://svnweb.freebsd.org/changeset/base/285706

Log:
  Don't increment the spin count until after the first attempt to acquire a
  rwlock read lock. Otherwise the lockstat:::rw-spin probe will fire
  spuriously.
  
  MFC after:1 week

Modified:
  head/sys/kern/kern_rwlock.c

Modified: head/sys/kern/kern_rwlock.c
==
--- head/sys/kern/kern_rwlock.c Sun Jul 19 22:25:16 2015(r285705)
+++ head/sys/kern/kern_rwlock.c Sun Jul 19 22:26:02 2015(r285706)
@@ -382,9 +382,6 @@ __rw_rlock(volatile uintptr_t *c, const 
state = rw-rw_lock;
 #endif
for (;;) {
-#ifdef KDTRACE_HOOKS
-   spin_cnt++;
-#endif
/*
 * Handle the easy case.  If no other thread has a write
 * lock, then try to bump up the count of read locks.  Note
@@ -413,6 +410,9 @@ __rw_rlock(volatile uintptr_t *c, const 
}
continue;
}
+#ifdef KDTRACE_HOOKS
+   spin_cnt++;
+#endif
 #ifdef HWPMC_HOOKS
PMC_SOFT_CALL( , , lock, failed);
 #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


Re: svn commit: r284198 - head/bin/ls

2015-07-19 Thread Craig Rodrigues
On Sat, Jun 13, 2015 at 9:29 PM, Steve Kargl 
s...@troutmask.apl.washington.edu wrote:

 On Sat, Jun 13, 2015 at 05:40:59PM -0700, Craig Rodrigues wrote:
  On Sat, Jun 13, 2015 at 5:26 PM, Steve Kargl 
  s...@troutmask.apl.washington.edu wrote:
  
   Given the horrid state of the manpages, which I showed
   in March, one can only wonder about the internals of
   the libxo itself.
  
 
  Are you talking about this comment you made?
 
 https://lists.freebsd.org/pipermail/freebsd-current/2015-March/054899.html
 
  I can't make heads or tails of what you wrote, other than you seemed very
  angry.
 

 I wasn't very angry.  I'm simply pointing out that the libxo
 manpages, which should document what libxo is/does, are
 horrible documentation.  If the quality of the manpages
 matches the quality of library, and the brokeness that
 we have been witnesses bears this out, should be questioned.

 % cd src/contrib/libxo/libxo
 % grep Nd *.3 | grep formatted
 xo_attr.3:.Nd emit formatted output based on format string and arguments
 xo_create.3:.Nd emit formatted output based on format string and arguments
 xo_emit.3:.Nd emit formatted output based on format string and arguments
 xo_finish.3:.Nd emit formatted output based on format string and arguments
 xo_flush.3:.Nd emit formatted output based on format string and arguments
 xo_open_list.3:.Nd emit formatted output based on format string and
 arguments
 xo_set_allocator.3:.Nd emit formatted output based on format string and
 arguments
 xo_set_flags.3:.Nd emit formatted output based on format string and
 arguments
 xo_set_info.3:.Nd emit formatted output based on format string and
 arguments
 xo_set_style.3:.Nd emit formatted output based on format string and
 arguments
 xo_set_writer.3:.Nd emit formatted output based on format string and
 arguments

 Do you really believe that the Nd entries for these manpages are
 correct?


I opened this bug report against libxo:

https://github.com/Juniper/libxo/issues/43

Phil Shafer fixed it and closed that bug report out.  Hopefully
these fixes will make it into FreeBSD after the next libxo import.

--
Craig
___
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: r285703 - in head/sys: amd64/conf arm/conf cddl/dev/lockstat cddl/dev/sdt conf i386/conf kern modules/dtrace modules/dtrace/dtraceall modules/dtrace/lockstat powerpc/conf sys

2015-07-19 Thread Mark Johnston
Author: markj
Date: Sun Jul 19 22:14:09 2015
New Revision: 285703
URL: https://svnweb.freebsd.org/changeset/base/285703

Log:
  Implement the lockstat provider using SDT(9) instead of the custom provider
  in lockstat.ko. This means that lockstat probes now have typed arguments and
  will utilize SDT probe hot-patching support when it arrives.
  
  Reviewed by:  gnn
  Differential Revision:https://reviews.freebsd.org/D2993

Deleted:
  head/sys/cddl/dev/lockstat/
  head/sys/modules/dtrace/lockstat/
Modified:
  head/sys/amd64/conf/NOTES
  head/sys/arm/conf/BEAGLEBONE
  head/sys/arm/conf/NOTES
  head/sys/cddl/dev/sdt/sdt.c
  head/sys/conf/files
  head/sys/i386/conf/NOTES
  head/sys/kern/kern_lockstat.c
  head/sys/kern/kern_mutex.c
  head/sys/kern/kern_rwlock.c
  head/sys/kern/kern_sx.c
  head/sys/modules/dtrace/Makefile
  head/sys/modules/dtrace/Makefile.inc
  head/sys/modules/dtrace/dtraceall/dtraceall.c
  head/sys/powerpc/conf/NOTES
  head/sys/sys/lockstat.h
  head/sys/sys/mutex.h
  head/sys/sys/rwlock.h
  head/sys/sys/sx.h

Modified: head/sys/amd64/conf/NOTES
==
--- head/sys/amd64/conf/NOTES   Sun Jul 19 21:31:52 2015(r285702)
+++ head/sys/amd64/conf/NOTES   Sun Jul 19 22:14:09 2015(r285703)
@@ -22,7 +22,6 @@ options   KDTRACE_HOOKS
 #devicedtrace
 
 # DTrace modules
-#devicedtrace_lockstat
 #devicedtrace_profile
 #devicedtrace_sdt
 #devicedtrace_fbt

Modified: head/sys/arm/conf/BEAGLEBONE
==
--- head/sys/arm/conf/BEAGLEBONESun Jul 19 21:31:52 2015
(r285702)
+++ head/sys/arm/conf/BEAGLEBONESun Jul 19 22:14:09 2015
(r285703)
@@ -32,7 +32,7 @@ makeoptions   MODULES_EXTRA=dtb/am335x
 optionsKDTRACE_HOOKS   # Kernel DTrace hooks
 optionsDDB_CTF # all architectures - kernel ELF linker 
loads CTF data
 makeoptionsWITH_CTF=1
-makeoptionsMODULES_EXTRA+=opensolaris dtrace dtrace/lockstat 
dtrace/profile dtrace/fbt
+makeoptionsMODULES_EXTRA+=opensolaris dtrace dtrace/profile dtrace/fbt
 
 optionsHZ=100
 optionsSCHED_4BSD  # 4BSD scheduler

Modified: head/sys/arm/conf/NOTES
==
--- head/sys/arm/conf/NOTES Sun Jul 19 21:31:52 2015(r285702)
+++ head/sys/arm/conf/NOTES Sun Jul 19 22:14:09 2015(r285703)
@@ -98,7 +98,6 @@ options   KDTRACE_HOOKS
 #devicedtrace
 
 # DTrace modules
-#devicedtrace_lockstat
 #devicedtrace_profile
 #devicedtrace_sdt
 #devicedtrace_fbt

Modified: head/sys/cddl/dev/sdt/sdt.c
==
--- head/sys/cddl/dev/sdt/sdt.c Sun Jul 19 21:31:52 2015(r285702)
+++ head/sys/cddl/dev/sdt/sdt.c Sun Jul 19 22:14:09 2015(r285703)
@@ -50,6 +50,7 @@
 #include sys/linker.h
 #include sys/linker_set.h
 #include sys/lock.h
+#include sys/lockstat.h
 #include sys/malloc.h
 #include sys/module.h
 #include sys/mutex.h
@@ -197,6 +198,8 @@ sdt_enable(void *arg __unused, dtrace_id
 
probe-id = id;
probe-sdtp_lf-nenabled++;
+   if (strcmp(probe-prov-name, lockstat) == 0)
+   lockstat_enabled++;
 }
 
 static void
@@ -206,6 +209,8 @@ sdt_disable(void *arg __unused, dtrace_i
 
KASSERT(probe-sdtp_lf-nenabled  0, (no probes enabled));
 
+   if (strcmp(probe-prov-name, lockstat) == 0)
+   lockstat_enabled--;
probe-id = 0;
probe-sdtp_lf-nenabled--;
 }

Modified: head/sys/conf/files
==
--- head/sys/conf/files Sun Jul 19 21:31:52 2015(r285702)
+++ head/sys/conf/files Sun Jul 19 22:14:09 2015(r285703)
@@ -246,7 +246,6 @@ cddl/contrib/opensolaris/uts/common/zmod
 cddl/contrib/opensolaris/uts/common/dtrace/dtrace.coptional dtrace 
compile-with ${DTRACE_C} \
warning kernel 
contains CDDL licensed DTRACE
 cddl/dev/dtmalloc/dtmalloc.c   optional dtmalloc| dtraceall 
compile-with ${CDDL_C}
-cddl/dev/lockstat/lockstat.c   optional dtrace_lockstat | dtraceall 
compile-with ${CDDL_C}
 cddl/dev/profile/profile.c optional dtrace_profile  | dtraceall 
compile-with ${CDDL_C}
 cddl/dev/sdt/sdt.c optional dtrace_sdt  | dtraceall 
compile-with ${CDDL_C}
 cddl/dev/fbt/fbt.c optional dtrace_fbt  | dtraceall 
compile-with ${FBT_C}

Modified: head/sys/i386/conf/NOTES
==
--- head/sys/i386/conf/NOTESSun Jul 19 21:31:52 2015(r285702)
+++ 

Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random s

2015-07-19 Thread Simon J. Gerraty
  Mark, do you have an estimate of when loadable modules will be supported
  again?
 
 About a week, I’d say.

Thanks!  Will keep an eye out.
___
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: r285700 - head/sys/dev/random

2015-07-19 Thread Mark Murray
Author: markm
Date: Sun Jul 19 18:07:35 2015
New Revision: 285700
URL: https://svnweb.freebsd.org/changeset/base/285700

Log:
  Fix some untidy logic. I committed the wrong local fix; please pass the 
pointy hat.
  
  Approved by:so (/dev/random blanket)

Modified:
  head/sys/dev/random/randomdev.c

Modified: head/sys/dev/random/randomdev.c
==
--- head/sys/dev/random/randomdev.c Sun Jul 19 18:07:25 2015
(r285699)
+++ head/sys/dev/random/randomdev.c Sun Jul 19 18:07:35 2015
(r285700)
@@ -183,7 +183,7 @@ read_random_uio(struct uio *uio, bool no
printf(random: %s unblock wait\n, __func__);
spamcount = (spamcount + 1)%100;
error = tsleep(random_alg_context, PCATCH, randseed, hz/10);
-   if ((error == ERESTART | error == EINTR))
+   if (error == ERESTART || error == EINTR)
break;
}
if (error == 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


svn commit: r285698 - head/sys/dev/netmap

2015-07-19 Thread Luigi Rizzo
Author: luigi
Date: Sun Jul 19 18:06:30 2015
New Revision: 285698
URL: https://svnweb.freebsd.org/changeset/base/285698

Log:
  properly destroy persistent vale ports

Modified:
  head/sys/dev/netmap/netmap_vale.c

Modified: head/sys/dev/netmap/netmap_vale.c
==
--- head/sys/dev/netmap/netmap_vale.c   Sun Jul 19 18:05:49 2015
(r285697)
+++ head/sys/dev/netmap/netmap_vale.c   Sun Jul 19 18:06:30 2015
(r285698)
@@ -506,17 +506,6 @@ netmap_vp_dtor(struct netmap_adapter *na
}
 }
 
-/* nm_dtor callback for persistent VALE ports */
-static void
-netmap_persist_vp_dtor(struct netmap_adapter *na)
-{
-   struct ifnet *ifp = na-ifp;
-
-   netmap_vp_dtor(na);
-   na-ifp = NULL;
-   nm_vi_detach(ifp);
-}
-
 /* remove a persistent VALE port from the system */
 static int
 nm_vi_destroy(const char *name)
@@ -546,6 +535,7 @@ nm_vi_destroy(const char *name)
 */
if_rele(ifp);
netmap_detach(ifp);
+   nm_vi_detach(ifp);
return 0;
 
 err:
@@ -587,7 +577,6 @@ nm_vi_create(struct nmreq *nmr)
}
/* persist-specific routines */
vpna-up.nm_bdg_ctl = netmap_vp_bdg_ctl;
-   vpna-up.nm_dtor = netmap_persist_vp_dtor;
netmap_adapter_get(vpna-up);
NMG_UNLOCK();
D(created %s, ifp-if_xname);
@@ -1823,6 +1812,11 @@ netmap_vp_create(struct nmreq *nmr, stru
D(max frame size %u, vpna-mfs);
 
na-na_flags |= NAF_BDG_MAYSLEEP;
+   /* persistent VALE ports look like hw devices
+* with a native netmap adapter
+*/
+   if (ifp)
+   na-na_flags |= NAF_NATIVE;
na-nm_txsync = netmap_vp_txsync;
na-nm_rxsync = netmap_vp_rxsync;
na-nm_register = netmap_vp_reg;
___
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: r285699 - head/sys/dev/netmap

2015-07-19 Thread Luigi Rizzo
Author: luigi
Date: Sun Jul 19 18:07:25 2015
New Revision: 285699
URL: https://svnweb.freebsd.org/changeset/base/285699

Log:
  add a use count so the netmap module cannot be unloaded while in use.

Modified:
  head/sys/dev/netmap/netmap.c
  head/sys/dev/netmap/netmap_freebsd.c
  head/sys/dev/netmap/netmap_kern.h

Modified: head/sys/dev/netmap/netmap.c
==
--- head/sys/dev/netmap/netmap.cSun Jul 19 18:06:30 2015
(r285698)
+++ head/sys/dev/netmap/netmap.cSun Jul 19 18:07:25 2015
(r285699)
@@ -542,6 +542,7 @@ SYSCTL_INT(_dev_netmap, OID_AUTO, generi
 SYSCTL_INT(_dev_netmap, OID_AUTO, generic_rings, CTLFLAG_RW, 
netmap_generic_rings, 0 , );
 
 NMG_LOCK_T netmap_global_lock;
+int netmap_use_count = 0; /* number of active netmap instances */
 
 /*
  * mark the ring as stopped, and run through the locks
@@ -975,11 +976,11 @@ netmap_dtor_locked(struct netmap_priv_d 
 {
struct netmap_adapter *na = priv-np_na;
 
-   /* number of active mmaps on this fd (FreeBSD only) */
+   /* number of active references to this fd */
if (--priv-np_refs  0) {
return 0;
}
-
+   netmap_use_count--;
if (!na) {
return 1; //XXX is it correct?
}

Modified: head/sys/dev/netmap/netmap_freebsd.c
==
--- head/sys/dev/netmap/netmap_freebsd.cSun Jul 19 18:06:30 2015
(r285698)
+++ head/sys/dev/netmap/netmap_freebsd.cSun Jul 19 18:07:25 2015
(r285699)
@@ -642,6 +642,10 @@ netmap_open(struct cdev *dev, int oflags
error = devfs_set_cdevpriv(priv, netmap_dtor);
if (error) {
free(priv, M_DEVBUF);
+   } else {
+   NMG_LOCK();
+   netmap_use_count++;
+   NMG_UNLOCK();
}
return error;
 }
@@ -827,6 +831,16 @@ netmap_loader(__unused struct module *mo
break;
 
case MOD_UNLOAD:
+   /*
+* if some one is still using netmap,
+* then the module can not be unloaded.
+*/
+   if (netmap_use_count) {
+   D(netmap module can not be unloaded - 
netmap_use_count: %d,
+   netmap_use_count);
+   error = EBUSY;
+   break;
+   }
netmap_fini();
break;
 

Modified: head/sys/dev/netmap/netmap_kern.h
==
--- head/sys/dev/netmap/netmap_kern.h   Sun Jul 19 18:06:30 2015
(r285698)
+++ head/sys/dev/netmap/netmap_kern.h   Sun Jul 19 18:07:25 2015
(r285699)
@@ -1247,6 +1247,7 @@ extern int netmap_txsync_retry;
 extern int netmap_generic_mit;
 extern int netmap_generic_ringsize;
 extern int netmap_generic_rings;
+extern int netmap_use_count;
 
 /*
  * NA returns a pointer to the struct netmap adapter from the ifp,
___
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: r285695 - head/sys/dev/netmap

2015-07-19 Thread Luigi Rizzo
Author: luigi
Date: Sun Jul 19 17:54:42 2015
New Revision: 285695
URL: https://svnweb.freebsd.org/changeset/base/285695

Log:
  small documentation update

Modified:
  head/sys/dev/netmap/netmap_kern.h

Modified: head/sys/dev/netmap/netmap_kern.h
==
--- head/sys/dev/netmap/netmap_kern.h   Sun Jul 19 16:55:47 2015
(r285694)
+++ head/sys/dev/netmap/netmap_kern.h   Sun Jul 19 17:54:42 2015
(r285695)
@@ -503,8 +503,9 @@ struct netmap_adapter {
 * that cannot be changed
 */
 #define NAF_NATIVE  16  /* the adapter is native.
-* Virtual ports (vale, pipe, monitor...)
-* should never use this flag.
+* Virtual ports (non persistent vale ports,
+* pipes, monitors...) should never use
+* this flag.
 */
 #defineNAF_NETMAP_ON   32  /* netmap is active (either native or
 * emulated). Where possible (e.g. FreeBSD)
@@ -1483,7 +1484,7 @@ PNMB(struct netmap_adapter *na, struct n
  *
  * np_refs counts the number of references to the structure: one for the fd,
  * plus (on FreeBSD) one for each active mmap which we track ourselves
- * (they are not unmapped on close(), unlike linux).
+ * (linux automatically tracks them, but FreeBSD does not).
  * np_refs is protected by NMG_LOCK.
  *
  * Read access to the structure is lock free, because ni_nifp once set
___
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: r285697 - head/sys/dev/netmap

2015-07-19 Thread Luigi Rizzo
Author: luigi
Date: Sun Jul 19 18:05:49 2015
New Revision: 285697
URL: https://svnweb.freebsd.org/changeset/base/285697

Log:
  do not free NULL if pipe allocation fails

Modified:
  head/sys/dev/netmap/netmap_pipe.c

Modified: head/sys/dev/netmap/netmap_pipe.c
==
--- head/sys/dev/netmap/netmap_pipe.c   Sun Jul 19 18:04:51 2015
(r285696)
+++ head/sys/dev/netmap/netmap_pipe.c   Sun Jul 19 18:05:49 2015
(r285697)
@@ -616,7 +616,7 @@ netmap_get_pipe_na(struct nmreq *nmr, st
sna = malloc(sizeof(*mna), M_DEVBUF, M_NOWAIT | M_ZERO);
if (sna == NULL) {
error = ENOMEM;
-   goto free_mna;
+   goto unregister_mna;
}
/* most fields are the same, copy from master and then fix */
*sna = *mna;
@@ -666,6 +666,8 @@ found:
 
 free_sna:
free(sna, M_DEVBUF);
+unregister_mna:
+   netmap_pipe_remove(pna, mna);
 free_mna:
free(mna, M_DEVBUF);
 put_out:
___
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: r285690 - head/sys/dev/random

2015-07-19 Thread Mark Murray
Author: markm
Date: Sun Jul 19 16:05:23 2015
New Revision: 285690
URL: https://svnweb.freebsd.org/changeset/base/285690

Log:
  Optimise the buffer-size calculation. It was possible to get one block too 
many.
  
  Approved by:  so (/dev/random blanket)

Modified:
  head/sys/dev/random/randomdev.c

Modified: head/sys/dev/random/randomdev.c
==
--- head/sys/dev/random/randomdev.c Sun Jul 19 15:44:51 2015
(r285689)
+++ head/sys/dev/random/randomdev.c Sun Jul 19 16:05:23 2015
(r285690)
@@ -64,6 +64,9 @@ __FBSDID($FreeBSD$);
 
 #defineRANDOM_UNIT 0
 
+/* Return the largest number = x that is a multiple of m */
+#define CEIL_TO_MULTIPLE(x, m) x) + (m) - 1)/(m))*(m))
+
 static d_read_t randomdev_read;
 static d_write_t randomdev_write;
 static d_poll_t randomdev_poll;
@@ -191,15 +194,15 @@ read_random_uio(struct uio *uio, bool no
 * which is what the underlying generator is expecting.
 * See the random_buf size requirements in the 
Yarrow/Fortuna code.
 */
-   read_len += RANDOM_BLOCKSIZE;
-   read_len -= read_len % RANDOM_BLOCKSIZE;
+   read_len = CEIL_TO_MULTIPLE(read_len, RANDOM_BLOCKSIZE);
+   /* Work in chunks page-sized or less */
read_len = MIN(read_len, PAGE_SIZE);
random_alg_context.ra_read(random_buf, read_len);
c = MIN(uio-uio_resid, read_len);
error = uiomove(random_buf, c, uio);
total_read += c;
}
-   if (total_read != uio-uio_resid  (error == ERESTART || error 
== EINTR) )
+   if (total_read != uio-uio_resid  (error == ERESTART || error 
== EINTR))
/* Return partial read, not error. */
error = 0;
}
@@ -217,7 +220,7 @@ read_random_uio(struct uio *uio, bool no
 u_int
 read_random(void *random_buf, u_int len)
 {
-   u_int read_len, total_read, c;
+   u_int read_len;
uint8_t local_buf[len + RANDOM_BLOCKSIZE];
 
KASSERT(random_buf != NULL, (No suitable random buffer in %s, 
__func__));
@@ -228,22 +231,16 @@ read_random(void *random_buf, u_int len)
/* XXX: FIX!! Next line as an atomic operation? */
read_rate += (len + sizeof(uint32_t))/sizeof(uint32_t);
 #endif
-   read_len = len;
-   /*
-* Belt-and-braces.
-* Round up the read length to a crypto block size multiple,
-* which is what the underlying generator is expecting.
-*/
-   read_len += RANDOM_BLOCKSIZE;
-   read_len -= read_len % RANDOM_BLOCKSIZE;
-   total_read = 0;
-   while (read_len) {
-   c = MIN(read_len, PAGE_SIZE);
-   random_alg_context.ra_read(local_buf[total_read], c);
-   read_len -= c;
-   total_read += c;
+   if (len  0) {
+   /*
+* Belt-and-braces.
+* Round up the read length to a crypto block size 
multiple,
+* which is what the underlying generator is expecting.
+*/
+   read_len = CEIL_TO_MULTIPLE(len, RANDOM_BLOCKSIZE);
+   random_alg_context.ra_read(local_buf, read_len);
+   memcpy(random_buf, local_buf, len);
}
-   memcpy(random_buf, local_buf, len);
} else
len = 0;
return (len);
___
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: r285692 - head/sys/dev/random

2015-07-19 Thread Mark Murray
Author: markm
Date: Sun Jul 19 16:05:30 2015
New Revision: 285692
URL: https://svnweb.freebsd.org/changeset/base/285692

Log:
  Fix the read blocking so that it is interruptable and slow down the rate of 
console warning spamming while blocked.
  
  Approved by:  so (/dev/random blanket)

Modified:
  head/sys/dev/random/randomdev.c

Modified: head/sys/dev/random/randomdev.c
==
--- head/sys/dev/random/randomdev.c Sun Jul 19 16:05:26 2015
(r285691)
+++ head/sys/dev/random/randomdev.c Sun Jul 19 16:05:30 2015
(r285692)
@@ -163,22 +163,28 @@ int
 read_random_uio(struct uio *uio, bool nonblock)
 {
uint8_t *random_buf;
-   int error;
+   int error, spamcount;
ssize_t read_len, total_read, c;
 
random_buf = malloc(PAGE_SIZE, M_ENTROPY, M_WAITOK);
random_alg_context.ra_pre_read();
-   /* (Un)Blocking logic */
error = 0;
+   spamcount = 0;
+   /* (Un)Blocking logic */
while (!random_alg_context.ra_seeded()) {
if (nonblock) {
error = EWOULDBLOCK;
break;
}
-   tsleep(random_alg_context, 0, randseed, hz/10);
/* keep tapping away at the pre-read until we seed/unblock. */
random_alg_context.ra_pre_read();
-   printf(random: %s unblock wait\n, __func__);
+   /* Only bother the console every 10 seconds or so */
+   if (spamcount == 0)
+   printf(random: %s unblock wait\n, __func__);
+   spamcount = (spamcount + 1)%100;
+   error = tsleep(random_alg_context, PCATCH, randseed, hz/10);
+   if ((error == ERESTART | error == EINTR))
+   break;
}
if (error == 0) {
 #if !defined(RANDOM_DUMMY)
___
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: r285693 - head/sys/dev/random

2015-07-19 Thread Mark Murray
Author: markm
Date: Sun Jul 19 16:05:34 2015
New Revision: 285693
URL: https://svnweb.freebsd.org/changeset/base/285693

Log:
  Remove out-of-date comments.
  
  Approved by:so (/dev/random blanket)

Modified:
  head/sys/dev/random/fortuna.c
  head/sys/dev/random/yarrow.c

Modified: head/sys/dev/random/fortuna.c
==
--- head/sys/dev/random/fortuna.c   Sun Jul 19 16:05:30 2015
(r285692)
+++ head/sys/dev/random/fortuna.c   Sun Jul 19 16:05:34 2015
(r285693)
@@ -133,7 +133,6 @@ static void random_fortuna_deinit_alg(vo
 
 static void random_fortuna_reseed_internal(uint32_t *entropy_data, u_int 
blockcount);
 
-/* Interface to Adaptors system */
 struct random_algorithm random_alg_context = {
.ra_ident = Fortuna,
.ra_init_alg = random_fortuna_init_alg,

Modified: head/sys/dev/random/yarrow.c
==
--- head/sys/dev/random/yarrow.cSun Jul 19 16:05:30 2015
(r285692)
+++ head/sys/dev/random/yarrow.cSun Jul 19 16:05:34 2015
(r285693)
@@ -117,7 +117,6 @@ static void random_yarrow_deinit_alg(voi
 
 static void random_yarrow_reseed_internal(u_int);
 
-/* Interface to Adaptors system */
 struct random_algorithm random_alg_context = {
.ra_ident = Yarrow,
.ra_init_alg = random_yarrow_init_alg,
___
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: r285691 - head/sys/conf

2015-07-19 Thread Mark Murray
Author: markm
Date: Sun Jul 19 16:05:26 2015
New Revision: 285691
URL: https://svnweb.freebsd.org/changeset/base/285691

Log:
  Clarify the intent of the RANDOM_* options.
  
  Approved by:  so (/dev/random blanket)

Modified:
  head/sys/conf/NOTES

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Sun Jul 19 16:05:23 2015(r285690)
+++ head/sys/conf/NOTES Sun Jul 19 16:05:26 2015(r285691)
@@ -2982,8 +2982,10 @@ options  MAXFILES=999
 # Random number generator
 # Only ONE of the below two may be used; they are mutually exclusive.
 # If neither is present, then the Fortuna algorithm is used.
-optionsRANDOM_YARROW   # Yarrow CSPRNG (Default)
-optionsRANDOM_DEBUG# Debugging messages
+optionsRANDOM_YARROW   # Yarrow CSPRNG (old default)
+#options   RANDOM_DUMMY# Dummy CSPRNG that always blocks
+# For developers.
+optionsRANDOM_DEBUG# Extra debugging messages
 
 # Module to enable execution of application via emulators like QEMU
 options IMAGACT_BINMISC
___
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: r285692 - head/sys/dev/random

2015-07-19 Thread Konstantin Belousov
On Sun, Jul 19, 2015 at 04:05:31PM +, Mark Murray wrote:
 Author: markm
 Date: Sun Jul 19 16:05:30 2015
 New Revision: 285692
 URL: https://svnweb.freebsd.org/changeset/base/285692
 
 Log:
   Fix the read blocking so that it is interruptable and slow down the rate of 
 console warning spamming while blocked.
   
   Approved by:so (/dev/random blanket)
 
 Modified:
   head/sys/dev/random/randomdev.c
 
 Modified: head/sys/dev/random/randomdev.c
 ==
 --- head/sys/dev/random/randomdev.c   Sun Jul 19 16:05:26 2015
 (r285691)
 +++ head/sys/dev/random/randomdev.c   Sun Jul 19 16:05:30 2015
 (r285692)
 @@ -163,22 +163,28 @@ int
  read_random_uio(struct uio *uio, bool nonblock)
  {
   uint8_t *random_buf;
 - int error;
 + int error, spamcount;
   ssize_t read_len, total_read, c;
  
   random_buf = malloc(PAGE_SIZE, M_ENTROPY, M_WAITOK);
   random_alg_context.ra_pre_read();
 - /* (Un)Blocking logic */
   error = 0;
 + spamcount = 0;
 + /* (Un)Blocking logic */
   while (!random_alg_context.ra_seeded()) {
   if (nonblock) {
   error = EWOULDBLOCK;
   break;
   }
 - tsleep(random_alg_context, 0, randseed, hz/10);
   /* keep tapping away at the pre-read until we seed/unblock. */
   random_alg_context.ra_pre_read();
 - printf(random: %s unblock wait\n, __func__);
 + /* Only bother the console every 10 seconds or so */
 + if (spamcount == 0)
 + printf(random: %s unblock wait\n, __func__);
 + spamcount = (spamcount + 1)%100;
Is ppsratecheck() not suitable for this due to use of  1 sec period ?

 + error = tsleep(random_alg_context, PCATCH, randseed, hz/10);
 + if ((error == ERESTART | error == EINTR))
This is probably still valid, but I wonder if you mean || there.
Then you could also remove extra ().

 + break;
   }
   if (error == 0) {
  #if !defined(RANDOM_DUMMY)

All your commits are breaking all style(9) rules.  It would be nice to keep
the style at least for the files where you added random harvesting and which
are already mostly style compliant.  E.g., what about wrapping lines at
position somewhere between 72 and 80 ?
___
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: r285696 - head/sys/dev/netmap

2015-07-19 Thread Luigi Rizzo
Author: luigi
Date: Sun Jul 19 18:04:51 2015
New Revision: 285696
URL: https://svnweb.freebsd.org/changeset/base/285696

Log:
  release a reference when stopping a monitor

Modified:
  head/sys/dev/netmap/netmap_monitor.c

Modified: head/sys/dev/netmap/netmap_monitor.c
==
--- head/sys/dev/netmap/netmap_monitor.cSun Jul 19 17:54:42 2015
(r285695)
+++ head/sys/dev/netmap/netmap_monitor.cSun Jul 19 18:04:51 2015
(r285696)
@@ -326,6 +326,7 @@ netmap_monitor_stop(struct netmap_adapte
struct netmap_monitor_adapter *mna =
(struct netmap_monitor_adapter 
*)mkring-na;
/* forget about this adapter */
+   netmap_adapter_put(mna-priv.np_na);
mna-priv.np_na = NULL;
}
}
___
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: r285701 - head/usr.sbin/ntp

2015-07-19 Thread Xin LI
Author: delphij
Date: Sun Jul 19 19:23:38 2015
New Revision: 285701
URL: https://svnweb.freebsd.org/changeset/base/285701

Log:
  Use fixed date/time (the time choosen was the time the import was done on
  -HEAD) in libntp so we can make reproducible build.
  
  PR:   bin/201661
  Reviewed by:  gjb, cy, roberto
  MFC after:3 days
  Differential Revision:https://reviews.freebsd.org/D3122

Modified:
  head/usr.sbin/ntp/config.h

Modified: head/usr.sbin/ntp/config.h
==
--- head/usr.sbin/ntp/config.h  Sun Jul 19 18:07:35 2015(r285700)
+++ head/usr.sbin/ntp/config.h  Sun Jul 19 19:23:38 2015(r285701)
@@ -1782,3 +1782,8 @@ typedef union mpinfou {
# endif
#endif  /* !defined(_KERNEL)  !defined(PARSESTREAM) */

+/*
+ * FreeBSD specific: Explicitly specify date/time for reproducible build.
+ */
+#defineMKREPRO_DATE Jul 04 2015
+#defineMKREPRO_TIME 15:42:16
___
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: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random s

2015-07-19 Thread Mark R V Murray

 On 19 Jul 2015, at 20:40, Simon J. Gerraty s...@juniper.net wrote:
 
 Mark R V Murray ma...@freebsd.org wrote:
 On Thu, Jul 02, 2015 at 11:36:27AM -0700, Simon J. Gerraty wrote:
 Sound like you just need to be able to select a single KLD at boot time?
 
 Mark, do you have an estimate of when loadable modules will be supported
 again?

About a week, I’d say.

 We've been holding off sync'ing from head - which is hardly ideal.

Apologies. I will expedite.

M
-- 
Mark R V Murray

___
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: r285689 - head/sys/arm/include

2015-07-19 Thread Andrew Turner
Author: andrew
Date: Sun Jul 19 15:44:51 2015
New Revision: 285689
URL: https://svnweb.freebsd.org/changeset/base/285689

Log:
  Clean up the style of the armv6 atomic code.
  
  Sponsored by: ABT Systems Ltd

Modified:
  head/sys/arm/include/atomic-v6.h

Modified: head/sys/arm/include/atomic-v6.h
==
--- head/sys/arm/include/atomic-v6.hSun Jul 19 14:34:35 2015
(r285688)
+++ head/sys/arm/include/atomic-v6.hSun Jul 19 15:44:51 2015
(r285689)
@@ -97,14 +97,15 @@ atomic_add_32(volatile uint32_t *p, uint
 {
uint32_t tmp = 0, tmp2 = 0;
 
-   __asm __volatile(1: ldrex %0, [%2]\n
-   add %0, %0, %3\n
-   strex %1, %0, [%2]\n
-   cmp %1, #0\n
-   it ne\n
-   bne1b\n
-   : =r (tmp), +r (tmp2)
-   ,+r (p), +r (val) : : cc, memory);
+   __asm __volatile(
+   1: ldrex   %0, [%2]\n
+  add %0, %0, %3  \n
+  strex   %1, %0, [%2]\n
+  cmp %1, #0  \n
+  it  ne  \n
+  bne 1b  \n
+   : =r (tmp), +r (tmp2)
+   ,+r (p), +r (val) : : cc, memory);
 }
 
 static __inline void
@@ -114,19 +115,19 @@ atomic_add_64(volatile uint64_t *p, uint
uint32_t exflag;
 
__asm __volatile(
-   1:  \n
-  ldrexd   %Q[tmp], %R[tmp], [%[ptr]]\n
-  adds %Q[tmp], %Q[val]\n
-  adc  %R[tmp], %R[tmp], %R[val]\n
-  strexd   %[exf], %Q[tmp], %R[tmp], [%[ptr]]\n
-  teq  %[exf], #0\n
-  it ne\n
-  bne  1b\n
-   :   [exf]=r  (exflag), 
-   [tmp]=r  (tmp)
-   :   [ptr]r(p), 
-   [val]r(val)
-   :   cc, memory);
+   1: \n
+  ldrexd  %Q[tmp], %R[tmp], [%[ptr]]  \n
+  adds%Q[tmp], %Q[val]\n
+  adc %R[tmp], %R[tmp], %R[val]   \n
+  strexd  %[exf], %Q[tmp], %R[tmp], [%[ptr]]  \n
+  teq %[exf], #0  \n
+  it  ne  \n
+  bne 1b  \n
+   : [exf] =r (exflag),
+ [tmp] =r (tmp)
+   : [ptr] r   (p),
+ [val] r   (val)
+   : cc, memory);
 }
 
 static __inline void
@@ -145,14 +146,15 @@ atomic_clear_32(volatile uint32_t *addre
 {
uint32_t tmp = 0, tmp2 = 0;
 
-   __asm __volatile(1: ldrex %0, [%2]\n
-   bic %0, %0, %3\n
-   strex %1, %0, [%2]\n
-   cmp %1, #0\n
-   it ne\n
-   bne1b\n
-  : =r (tmp), +r (tmp2)
-  ,+r (address), +r (setmask) : : cc, memory);
+   __asm __volatile(
+   1: ldrex   %0, [%2]\n
+  bic %0, %0, %3  \n
+  strex   %1, %0, [%2]\n
+  cmp %1, #0  \n
+  it  ne  \n
+  bne 1b  \n
+   : =r (tmp), +r (tmp2), +r (address), +r (setmask)
+   : : cc, memory);
 }
 
 static __inline void
@@ -162,19 +164,19 @@ atomic_clear_64(volatile uint64_t *p, ui
uint32_t exflag;
 
__asm __volatile(
-   1:  \n
-  ldrexd   %Q[tmp], %R[tmp], [%[ptr]]\n
-  bic  %Q[tmp], %Q[val]\n
-  bic  %R[tmp], %R[val]\n
-  strexd   %[exf], %Q[tmp], %R[tmp], [%[ptr]]\n
-  teq  %[exf], #0\n
-  it ne\n
-  bne  1b\n
-   :   [exf]=r  (exflag), 
-   [tmp]=r  (tmp)
-   :   [ptr]r(p), 
-   [val]r(val)
-   :   cc, memory);
+   1: \n
+  ldrexd  %Q[tmp], %R[tmp], [%[ptr]]  \n
+  bic %Q[tmp], %Q[val]\n
+  bic %R[tmp], %R[val]\n
+  strexd  %[exf], %Q[tmp], %R[tmp], [%[ptr]]  \n
+  teq %[exf], #0  \n
+  it  ne  \n
+  bne 1b  \n
+   : [exf] =r (exflag),
+ [tmp] =r (tmp)
+   : [ptr] r   (p),
+ [val] r   (val)
+   : cc, 

svn commit: r285694 - head/sys/arm/include

2015-07-19 Thread Andrew Turner
Author: andrew
Date: Sun Jul 19 16:55:47 2015
New Revision: 285694
URL: https://svnweb.freebsd.org/changeset/base/285694

Log:
  Fix atomic_store_64, it should write the value passed in, not the value
  read by the load.
  
  Pointy Hat:   andrew

Modified:
  head/sys/arm/include/atomic-v6.h

Modified: head/sys/arm/include/atomic-v6.h
==
--- head/sys/arm/include/atomic-v6.hSun Jul 19 16:05:34 2015
(r285693)
+++ head/sys/arm/include/atomic-v6.hSun Jul 19 16:55:47 2015
(r285694)
@@ -558,7 +558,7 @@ atomic_store_64(volatile uint64_t *p, ui
__asm __volatile(
1: \n
   ldrexd  %Q[tmp], %R[tmp], [%[ptr]]  \n
-  strexd  %[exf], %Q[tmp], %R[tmp], [%[ptr]]  \n
+  strexd  %[exf], %Q[val], %R[val], [%[ptr]]  \n
   teq %[exf], #0  \n
   it  ne  \n
   bne 1b  \n
___
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: r285692 - head/sys/dev/random

2015-07-19 Thread Mark R V Murray

 On 19 Jul 2015, at 18:02, Konstantin Belousov kostik...@gmail.com wrote:
 
 -printf(random: %s unblock wait\n, __func__);
 +/* Only bother the console every 10 seconds or so */
 +if (spamcount == 0)
 +printf(random: %s unblock wait\n, __func__);
 +spamcount = (spamcount + 1)%100;
 Is ppsratecheck() not suitable for this due to use of  1 sec period ?

Oooh! Very probably, thank you.

 +error = tsleep(random_alg_context, PCATCH, randseed, hz/10);
 +if ((error == ERESTART | error == EINTR))
 This is probably still valid, but I wonder if you mean || there.
 Then you could also remove extra ().

Oh, nuts. Got the wrong patch. Thank you.

 All your commits are breaking all style(9) rules.  It would be nice to keep
 the style at least for the files where you added random harvesting and which
 are already mostly style compliant.  E.g., what about wrapping lines at
 position somewhere between 72 and 80 ?

I’ll look, thanks!

M
-- 
Mark R V Murray

___
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: r285709 - head/sys/sys

2015-07-19 Thread Mark Johnston
Author: markj
Date: Mon Jul 20 04:41:25 2015
New Revision: 285709
URL: https://svnweb.freebsd.org/changeset/base/285709

Log:
  Declare lockstat_enabled even when KDTRACE_HOOKS is not defined.
  
  Reported by:  bz
  X-MFC-With:   r285704

Modified:
  head/sys/sys/lockstat.h

Modified: head/sys/sys/lockstat.h
==
--- head/sys/sys/lockstat.h Mon Jul 20 02:38:51 2015(r285708)
+++ head/sys/sys/lockstat.h Mon Jul 20 04:41:25 2015(r285709)
@@ -68,6 +68,8 @@ SDT_PROBE_DECLARE(lockstat, , , thread__
 #defineLOCKSTAT_WRITER 0
 #defineLOCKSTAT_READER 1
 
+extern int lockstat_enabled;
+
 #ifdef KDTRACE_HOOKS
 
 #defineLOCKSTAT_RECORD0(probe, lp) 
\
@@ -105,8 +107,6 @@ SDT_PROBE_DECLARE(lockstat, , , thread__
LOCKSTAT_RECORD1(probe, lp, a); \
 } while (0)
 
-extern int lockstat_enabled;
-
 struct lock_object;
 uint64_t lockstat_nsecs(struct lock_object *);
 
___
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: r285704 - in head: cddl/contrib/opensolaris/cmd/lockstat sys/kern sys/sys

2015-07-19 Thread Bjoern A. Zeeb

 On 19 Jul 2015, at 22:24 , Mark Johnston ma...@freebsd.org wrote:
 
 Author: markj
 Date: Sun Jul 19 22:24:33 2015
 New Revision: 285704
 URL: https://svnweb.freebsd.org/changeset/base/285704
 
 Log:
  Consistently use a reader/writer flag for lockstat probes in rwlock(9) and
  sx(9), rather than using the probe function name to determine whether a
  given lock is a read lock or a write lock. Update lockstat(1) accordingly.
 
 Modified:
  head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c
  head/sys/kern/kern_lockstat.c
  head/sys/kern/kern_rwlock.c
  head/sys/kern/kern_sx.c
  head/sys/sys/lockstat.h
  head/sys/sys/rwlock.h
  head/sys/sys/sx.h


I see PC98 LINT kernels failing:

/scratch/tmp/bz/head.svn/sys/cddl/dev/sdt/sdt.c:202:3: error: use of undeclared 
identifier 'lockstat_enabled'
lockstat_enabled++;
^
/scratch/tmp/bz/head.svn/sys/cddl/dev/sdt/sdt.c:213:3: error: use of undeclared 
identifier 'lockstat_enabled'
lockstat_enabled--;
^





— 
Bjoern A. Zeeb  Charles Haddon Spurgeon:
Friendship is one of the sweetest joys of life.  Many might have failed
 beneath the bitterness of their trial  had they not found a friend.

___
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: r285704 - in head: cddl/contrib/opensolaris/cmd/lockstat sys/kern sys/sys

2015-07-19 Thread Mark Johnston
On Mon, Jul 20, 2015 at 03:55:55AM +, Bjoern A. Zeeb wrote:
 
  On 19 Jul 2015, at 22:24 , Mark Johnston ma...@freebsd.org wrote:
  
  Author: markj
  Date: Sun Jul 19 22:24:33 2015
  New Revision: 285704
  URL: https://svnweb.freebsd.org/changeset/base/285704
  
  Log:
   Consistently use a reader/writer flag for lockstat probes in rwlock(9) and
   sx(9), rather than using the probe function name to determine whether a
   given lock is a read lock or a write lock. Update lockstat(1) accordingly.
  
  Modified:
   head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c
   head/sys/kern/kern_lockstat.c
   head/sys/kern/kern_rwlock.c
   head/sys/kern/kern_sx.c
   head/sys/sys/lockstat.h
   head/sys/sys/rwlock.h
   head/sys/sys/sx.h
 
 
 I see PC98 LINT kernels failing:
 
 /scratch/tmp/bz/head.svn/sys/cddl/dev/sdt/sdt.c:202:3: error: use of 
 undeclared identifier 'lockstat_enabled'
 lockstat_enabled++;
 ^
 /scratch/tmp/bz/head.svn/sys/cddl/dev/sdt/sdt.c:213:3: error: use of 
 undeclared identifier 'lockstat_enabled'
 lockstat_enabled--;
 ^

Sorry about that - fixed in r285709.

-Mark
___
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