svn commit: r313274 - head/sys/kern

2017-02-04 Thread Mateusz Guzik
Author: mjg
Date: Sun Feb  5 06:51:45 2017
New Revision: 313274
URL: https://svnweb.freebsd.org/changeset/base/313274

Log:
  sx: add witness support missed in r313272

Modified:
  head/sys/kern/kern_sx.c

Modified: head/sys/kern/kern_sx.c
==
--- head/sys/kern/kern_sx.c Sun Feb  5 05:36:51 2017(r313273)
+++ head/sys/kern/kern_sx.c Sun Feb  5 06:51:45 2017(r313274)
@@ -833,6 +833,12 @@ _sx_slock(struct sx *sx, int opts, const
 #elif defined(KDTRACE_HOOKS)
lock_delay_arg_init(, NULL);
 #endif
+   KASSERT(kdb_active != 0 || !TD_IS_IDLETHREAD(curthread),
+   ("sx_slock() by idle thread %p on sx %s @ %s:%d",
+   curthread, sx->lock_object.lo_name, file, line));
+   KASSERT(sx->sx_lock != SX_LOCK_DESTROYED,
+   ("sx_slock() of destroyed sx @ %s:%d", file, line));
+   WITNESS_CHECKORDER(>lock_object, LOP_NEWORDER, file, line, NULL);
 #ifdef KDTRACE_HOOKS
all_time -= lockstat_nsecs(>lock_object);
 #endif
@@ -1000,9 +1006,13 @@ _sx_slock(struct sx *sx, int opts, const
LOCKSTAT_READER, (state & SX_LOCK_SHARED) == 0,
(state & SX_LOCK_SHARED) == 0 ? 0 : SX_SHARERS(state));
 #endif
-   if (error == 0)
+   if (error == 0) {
LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(sx__acquire, sx,
contested, waittime, file, line, LOCKSTAT_READER);
+   LOCK_LOG_LOCK("SLOCK", >lock_object, 0, 0, file, line);
+   WITNESS_LOCK(>lock_object, 0, file, line);
+   TD_LOCKS_INC(curthread);
+   }
GIANT_RESTORE();
return (error);
 }
@@ -1016,6 +1026,11 @@ _sx_sunlock(struct sx *sx, const char *f
if (SCHEDULER_STOPPED())
return;
 
+   KASSERT(sx->sx_lock != SX_LOCK_DESTROYED,
+   ("sx_sunlock() of destroyed sx @ %s:%d", file, line));
+   _sx_assert(sx, SA_SLOCKED, file, line);
+   WITNESS_UNLOCK(>lock_object, 0, file, line);
+   LOCK_LOG_LOCK("SUNLOCK", >lock_object, 0, 0, file, line);
LOCKSTAT_PROFILE_RELEASE_RWLOCK(sx__release, sx, LOCKSTAT_READER);
x = SX_READ_VALUE(sx);
for (;;) {
@@ -1091,6 +1106,7 @@ _sx_sunlock(struct sx *sx, const char *f
kick_proc0();
break;
}
+   TD_LOCKS_DEC(curthread);
 }
 
 #ifdef INVARIANT_SUPPORT
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313273 - head/sbin/kldload

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sun Feb  5 05:36:51 2017
New Revision: 313273
URL: https://svnweb.freebsd.org/changeset/base/313273

Log:
  style(9) cleanup
  
  - Delete trailing whitespace
  - Fix alignment/variable sorting
  - Delete single-line enclosing braces
  
  MFC after:1 week
  Sponsored by: Dell EMC Isilon

Modified:
  head/sbin/kldload/kldload.c

Modified: head/sbin/kldload/kldload.c
==
--- head/sbin/kldload/kldload.c Sun Feb  5 05:20:29 2017(r313272)
+++ head/sbin/kldload/kldload.c Sun Feb  5 05:36:51 2017(r313273)
@@ -41,9 +41,6 @@ __FBSDID("$FreeBSD$");
 
 #definePATHCTL "kern.module_path"
 
-static int path_check(const char *, int);
-static voidusage(void);
-
 /*
  * Check to see if the requested module is specified as a filename with no
  * path.  If so and if a file by the same name exists in the module path,
@@ -52,43 +49,37 @@ static void usage(void);
 static int
 path_check(const char *kldname, int quiet)
 {
-   int mib[5], found;
-   size_t  miblen, pathlen;
-   charkldpath[MAXPATHLEN];
char*path, *tmppath, *element;
struct  stat sb;
+   int mib[5];
+   charkldpath[MAXPATHLEN];
+   size_t  miblen, pathlen;
dev_t   dev;
ino_t   ino;
+   int found;
 
-   if (strchr(kldname, '/') != NULL) {
+   if (strchr(kldname, '/') != NULL)
return (0);
-   }
-   if (strstr(kldname, ".ko") == NULL) {
+   if (strstr(kldname, ".ko") == NULL)
return (0);
-   }
-   if (stat(kldname, ) != 0) {
+   if (stat(kldname, ) != 0)
return (0);
-   }
 
found = 0;
dev = sb.st_dev;
ino = sb.st_ino;
 
miblen = nitems(mib);
-   if (sysctlnametomib(PATHCTL, mib, ) != 0) {
+   if (sysctlnametomib(PATHCTL, mib, ) != 0)
err(1, "sysctlnametomib(%s)", PATHCTL);
-   }
-   if (sysctl(mib, miblen, NULL, , NULL, 0) == -1) {
+   if (sysctl(mib, miblen, NULL, , NULL, 0) == -1)
err(1, "getting path: sysctl(%s) - size only", PATHCTL);
-   }
path = malloc(pathlen + 1);
-   if (path == NULL) {
+   if (path == NULL)
err(1, "allocating %lu bytes for the path",
(unsigned long)pathlen + 1);
-   }
-   if (sysctl(mib, miblen, path, , NULL, 0) == -1) {
+   if (sysctl(mib, miblen, path, , NULL, 0) == -1)
err(1, "getting path: sysctl(%s)", PATHCTL);
-   }
tmppath = path;
 
while ((element = strsep(, ";")) != NULL) {
@@ -97,39 +88,36 @@ path_check(const char *kldname, int quie
strlcat(kldpath, "/", MAXPATHLEN);
}
strlcat(kldpath, kldname, MAXPATHLEN);
-   
-   if (stat(kldpath, ) == -1) {
+
+   if (stat(kldpath, ) == -1)
continue;
-   }   
 
found = 1;
 
if (sb.st_dev != dev || sb.st_ino != ino) {
-   if (!quiet) {
+   if (!quiet)
warnx("%s will be loaded from %s, not the "
"current directory", kldname, element);
-   }
break;
-   } else if (sb.st_dev == dev && sb.st_ino == ino) {
+   } else if (sb.st_dev == dev && sb.st_ino == ino)
break;
-   }
}
 
free(path);
-   
+
if (!found) {
-   if (!quiet) {
+   if (!quiet)
warnx("%s is not in the module path", kldname);
-   }
return (-1);
}
-   
+
return (0);
 }
 
 static void
 usage(void)
 {
+
fprintf(stderr, "usage: kldload [-nqv] file ...\n");
exit(1);
 }
@@ -138,17 +126,17 @@ int
 main(int argc, char** argv)
 {
int c;
+   int check_loaded;
int errors;
int fileid;
-   int verbose;
int quiet;
-   int check_loaded;
+   int verbose;
 
errors = 0;
verbose = 0;
quiet = 0;
check_loaded = 0;
-
+
while ((c = getopt(argc, argv, "nqv")) != -1) {
switch (c) {
case 'q':
@@ -204,9 +192,8 @@ main(int argc, char** argv)
printf("Loaded %s, id=%d\n", argv[0],
fileid);
}
-   } else {
+   } else
errors++;
-   }
argv++;
}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2017-02-04 Thread Mateusz Guzik
Author: mjg
Date: Sun Feb  5 05:20:29 2017
New Revision: 313272
URL: https://svnweb.freebsd.org/changeset/base/313272

Log:
  sx: uninline slock/sunlock
  
  Shared locking routines explicitly read the value and test it. If the
  change attempt fails, they fall back to a regular function which would
  retry in a loop.
  
  The problem is that with many concurrent readers the risk of failure is pretty
  high and even the value returned by fcmpset is very likely going to be stale
  by the time the loop in the fallback routine is reached.
  
  Uninline said primitives. It gives a throughput increase when doing concurrent
  slocks/sunlocks with 80 hardware threads from ~50 mln/s to ~56 mln/s.
  
  Interestingly, rwlock primitives are already not inlined.

Modified:
  head/sys/kern/kern_sx.c
  head/sys/sys/sx.h

Modified: head/sys/kern/kern_sx.c
==
--- head/sys/kern/kern_sx.c Sun Feb  5 04:54:20 2017(r313271)
+++ head/sys/kern/kern_sx.c Sun Feb  5 05:20:29 2017(r313272)
@@ -276,29 +276,6 @@ sx_destroy(struct sx *sx)
 }
 
 int
-_sx_slock(struct sx *sx, int opts, const char *file, int line)
-{
-   int error = 0;
-
-   if (SCHEDULER_STOPPED())
-   return (0);
-   KASSERT(kdb_active != 0 || !TD_IS_IDLETHREAD(curthread),
-   ("sx_slock() by idle thread %p on sx %s @ %s:%d",
-   curthread, sx->lock_object.lo_name, file, line));
-   KASSERT(sx->sx_lock != SX_LOCK_DESTROYED,
-   ("sx_slock() of destroyed sx @ %s:%d", file, line));
-   WITNESS_CHECKORDER(>lock_object, LOP_NEWORDER, file, line, NULL);
-   error = __sx_slock(sx, opts, file, line);
-   if (!error) {
-   LOCK_LOG_LOCK("SLOCK", >lock_object, 0, 0, file, line);
-   WITNESS_LOCK(>lock_object, 0, file, line);
-   TD_LOCKS_INC(curthread);
-   }
-
-   return (error);
-}
-
-int
 sx_try_slock_(struct sx *sx, const char *file, int line)
 {
uintptr_t x;
@@ -391,21 +368,6 @@ sx_try_xlock_(struct sx *sx, const char 
 }
 
 void
-_sx_sunlock(struct sx *sx, const char *file, int line)
-{
-
-   if (SCHEDULER_STOPPED())
-   return;
-   KASSERT(sx->sx_lock != SX_LOCK_DESTROYED,
-   ("sx_sunlock() of destroyed sx @ %s:%d", file, line));
-   _sx_assert(sx, SA_SLOCKED, file, line);
-   WITNESS_UNLOCK(>lock_object, 0, file, line);
-   LOCK_LOG_LOCK("SUNLOCK", >lock_object, 0, 0, file, line);
-   __sx_sunlock(sx, file, line);
-   TD_LOCKS_DEC(curthread);
-}
-
-void
 _sx_xunlock(struct sx *sx, const char *file, int line)
 {
 
@@ -840,14 +802,8 @@ _sx_xunlock_hard(struct sx *sx, uintptr_
kick_proc0();
 }
 
-/*
- * This function represents the so-called 'hard case' for sx_slock
- * operation.  All 'easy case' failures are redirected to this.  Note
- * that ideally this would be a static function, but it needs to be
- * accessible from at least sx.h.
- */
 int
-_sx_slock_hard(struct sx *sx, int opts, const char *file, int line)
+_sx_slock(struct sx *sx, int opts, const char *file, int line)
 {
GIANT_DECLARE;
 #ifdef ADAPTIVE_SX
@@ -1051,14 +1007,8 @@ _sx_slock_hard(struct sx *sx, int opts, 
return (error);
 }
 
-/*
- * This function represents the so-called 'hard case' for sx_sunlock
- * operation.  All 'easy case' failures are redirected to this.  Note
- * that ideally this would be a static function, but it needs to be
- * accessible from at least sx.h.
- */
 void
-_sx_sunlock_hard(struct sx *sx, const char *file, int line)
+_sx_sunlock(struct sx *sx, const char *file, int line)
 {
uintptr_t x;
int wakeup_swapper;
@@ -1066,6 +1016,7 @@ _sx_sunlock_hard(struct sx *sx, const ch
if (SCHEDULER_STOPPED())
return;
 
+   LOCKSTAT_PROFILE_RELEASE_RWLOCK(sx__release, sx, LOCKSTAT_READER);
x = SX_READ_VALUE(sx);
for (;;) {
/*

Modified: head/sys/sys/sx.h
==
--- head/sys/sys/sx.h   Sun Feb  5 04:54:20 2017(r313271)
+++ head/sys/sys/sx.h   Sun Feb  5 05:20:29 2017(r313272)
@@ -111,10 +111,8 @@ void   _sx_sunlock(struct sx *sx, const ch
 void   _sx_xunlock(struct sx *sx, const char *file, int line);
 int_sx_xlock_hard(struct sx *sx, uintptr_t v, uintptr_t tid, int opts,
const char *file, int line);
-int_sx_slock_hard(struct sx *sx, int opts, const char *file, int line);
 void   _sx_xunlock_hard(struct sx *sx, uintptr_t tid, const char *file, int
line);
-void   _sx_sunlock_hard(struct sx *sx, const char *file, int line);
 #if defined(INVARIANTS) || defined(INVARIANT_SUPPORT)
 void   _sx_assert(const struct sx *sx, int what, const char *file, int line);
 #endif
@@ -179,41 +177,6 @@ __sx_xunlock(struct sx *sx, struct threa
_sx_xunlock_hard(sx, tid, file, line);
 }
 
-/* Acquire a shared 

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

2017-02-04 Thread Mateusz Guzik
Author: mjg
Date: Sun Feb  5 04:54:20 2017
New Revision: 313271
URL: https://svnweb.freebsd.org/changeset/base/313271

Log:
  sx: switch to fcmpset
  
  Discussed with:   jhb
  Tested by:pho (previous version)

Modified:
  head/sys/kern/kern_sx.c
  head/sys/sys/sx.h

Modified: head/sys/kern/kern_sx.c
==
--- head/sys/kern/kern_sx.c Sun Feb  5 04:53:13 2017(r313270)
+++ head/sys/kern/kern_sx.c Sun Feb  5 04:54:20 2017(r313271)
@@ -530,15 +530,14 @@ sx_downgrade_(struct sx *sx, const char 
  * accessible from at least sx.h.
  */
 int
-_sx_xlock_hard(struct sx *sx, uintptr_t tid, int opts, const char *file,
-int line)
+_sx_xlock_hard(struct sx *sx, uintptr_t x, uintptr_t tid, int opts,
+const char *file, int line)
 {
GIANT_DECLARE;
 #ifdef ADAPTIVE_SX
volatile struct thread *owner;
u_int i, spintries = 0;
 #endif
-   uintptr_t x;
 #ifdef LOCK_PROFILING
uint64_t waittime = 0;
int contested = 0;
@@ -563,8 +562,6 @@ _sx_xlock_hard(struct sx *sx, uintptr_t 
lock_delay_arg_init(, NULL);
 #endif
 
-   x = SX_READ_VALUE(sx);
-
/* If we already hold an exclusive lock, then recurse. */
if (__predict_false(lv_sx_owner(x) == (struct thread *)tid)) {
KASSERT((sx->lock_object.lo_flags & LO_RECURSABLE) != 0,
@@ -587,9 +584,8 @@ _sx_xlock_hard(struct sx *sx, uintptr_t 
 #endif
for (;;) {
if (x == SX_LOCK_UNLOCKED) {
-   if (atomic_cmpset_acq_ptr(>sx_lock, x, tid))
+   if (atomic_fcmpset_acq_ptr(>sx_lock, , tid))
break;
-   x = SX_READ_VALUE(sx);
continue;
}
 #ifdef KDTRACE_HOOKS
@@ -902,7 +898,7 @@ _sx_slock_hard(struct sx *sx, int opts, 
 */
if (x & SX_LOCK_SHARED) {
MPASS(!(x & SX_LOCK_SHARED_WAITERS));
-   if (atomic_cmpset_acq_ptr(>sx_lock, x,
+   if (atomic_fcmpset_acq_ptr(>sx_lock, ,
x + SX_ONE_SHARER)) {
if (LOCK_LOG_TEST(>lock_object, 0))
CTR4(KTR_LOCK,
@@ -911,7 +907,6 @@ _sx_slock_hard(struct sx *sx, int opts, 
(void *)(x + SX_ONE_SHARER));
break;
}
-   x = SX_READ_VALUE(sx);
continue;
}
 #ifdef KDTRACE_HOOKS
@@ -1085,7 +1080,7 @@ _sx_sunlock_hard(struct sx *sx, const ch
 * so, just drop one and return.
 */
if (SX_SHARERS(x) > 1) {
-   if (atomic_cmpset_rel_ptr(>sx_lock, x,
+   if (atomic_fcmpset_rel_ptr(>sx_lock, ,
x - SX_ONE_SHARER)) {
if (LOCK_LOG_TEST(>lock_object, 0))
CTR4(KTR_LOCK,
@@ -1094,8 +1089,6 @@ _sx_sunlock_hard(struct sx *sx, const ch
(void *)(x - SX_ONE_SHARER));
break;
}
-
-   x = SX_READ_VALUE(sx);
continue;
}
 
@@ -1105,14 +1098,14 @@ _sx_sunlock_hard(struct sx *sx, const ch
 */
if (!(x & SX_LOCK_EXCLUSIVE_WAITERS)) {
MPASS(x == SX_SHARERS_LOCK(1));
-   if (atomic_cmpset_rel_ptr(>sx_lock,
-   SX_SHARERS_LOCK(1), SX_LOCK_UNLOCKED)) {
+   x = SX_SHARERS_LOCK(1);
+   if (atomic_fcmpset_rel_ptr(>sx_lock,
+   , SX_LOCK_UNLOCKED)) {
if (LOCK_LOG_TEST(>lock_object, 0))
CTR2(KTR_LOCK, "%s: %p last succeeded",
__func__, sx);
break;
}
-   x = SX_READ_VALUE(sx);
continue;
}
 

Modified: head/sys/sys/sx.h
==
--- head/sys/sys/sx.h   Sun Feb  5 04:53:13 2017(r313270)
+++ head/sys/sys/sx.h   Sun Feb  5 04:54:20 2017(r313271)
@@ -109,7 +109,7 @@ int _sx_slock(struct sx *sx, int opts, c
 int_sx_xlock(struct sx *sx, int opts, const char *file, int line);
 void   _sx_sunlock(struct sx *sx, const char *file, int line);
 void   _sx_xunlock(struct sx *sx, const char *file, int line);
-int_sx_xlock_hard(struct sx *sx, uintptr_t tid, int opts,
+int_sx_xlock_hard(struct sx *sx, uintptr_t v, uintptr_t tid, int opts,
const char *file, int line);
 int_sx_slock_hard(struct 

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

2017-02-04 Thread Mateusz Guzik
Author: mjg
Date: Sun Feb  5 04:53:13 2017
New Revision: 313270
URL: https://svnweb.freebsd.org/changeset/base/313270

Log:
  rwlock: switch to fcmpset
  
  Discussed with:   jhb
  Tested by:pho

Modified:
  head/sys/kern/kern_rwlock.c
  head/sys/sys/rwlock.h

Modified: head/sys/kern/kern_rwlock.c
==
--- head/sys/kern/kern_rwlock.c Sun Feb  5 03:26:34 2017(r313269)
+++ head/sys/kern/kern_rwlock.c Sun Feb  5 04:53:13 2017(r313270)
@@ -440,7 +440,7 @@ __rw_rlock(volatile uintptr_t *c, const 
 * if the lock has been unlocked and write waiters
 * were present.
 */
-   if (atomic_cmpset_acq_ptr(>rw_lock, v,
+   if (atomic_fcmpset_acq_ptr(>rw_lock, ,
v + RW_ONE_READER)) {
if (LOCK_LOG_TEST(>lock_object, 0))
CTR4(KTR_LOCK,
@@ -449,7 +449,6 @@ __rw_rlock(volatile uintptr_t *c, const 
(void *)(v + RW_ONE_READER));
break;
}
-   v = RW_READ_VALUE(rw);
continue;
}
 #ifdef KDTRACE_HOOKS
@@ -675,7 +674,7 @@ _rw_runlock_cookie(volatile uintptr_t *c
 * just drop one and return.
 */
if (RW_READERS(x) > 1) {
-   if (atomic_cmpset_rel_ptr(>rw_lock, x,
+   if (atomic_fcmpset_rel_ptr(>rw_lock, ,
x - RW_ONE_READER)) {
if (LOCK_LOG_TEST(>lock_object, 0))
CTR4(KTR_LOCK,
@@ -684,7 +683,6 @@ _rw_runlock_cookie(volatile uintptr_t *c
(void *)(x - RW_ONE_READER));
break;
}
-   x = RW_READ_VALUE(rw);
continue;
}
/*
@@ -694,14 +692,13 @@ _rw_runlock_cookie(volatile uintptr_t *c
if (!(x & RW_LOCK_WAITERS)) {
MPASS((x & ~RW_LOCK_WRITE_SPINNER) ==
RW_READERS_LOCK(1));
-   if (atomic_cmpset_rel_ptr(>rw_lock, x,
+   if (atomic_fcmpset_rel_ptr(>rw_lock, ,
RW_UNLOCKED)) {
if (LOCK_LOG_TEST(>lock_object, 0))
CTR2(KTR_LOCK, "%s: %p last succeeded",
__func__, rw);
break;
}
-   x = RW_READ_VALUE(rw);
continue;
}
/*
@@ -769,8 +766,8 @@ _rw_runlock_cookie(volatile uintptr_t *c
  * read or write lock.
  */
 void
-__rw_wlock_hard(volatile uintptr_t *c, uintptr_t tid, const char *file,
-int line)
+__rw_wlock_hard(volatile uintptr_t *c, uintptr_t v, uintptr_t tid,
+const char *file, int line)
 {
struct rwlock *rw;
struct turnstile *ts;
@@ -779,7 +776,7 @@ __rw_wlock_hard(volatile uintptr_t *c, u
int spintries = 0;
int i;
 #endif
-   uintptr_t v, x;
+   uintptr_t x;
 #ifdef LOCK_PROFILING
uint64_t waittime = 0;
int contested = 0;
@@ -803,7 +800,6 @@ __rw_wlock_hard(volatile uintptr_t *c, u
lock_delay_arg_init(, NULL);
 #endif
rw = rwlock2rw(c);
-   v = RW_READ_VALUE(rw);
 
if (__predict_false(lv_rw_wowner(v) == (struct thread *)tid)) {
KASSERT(rw->lock_object.lo_flags & LO_RECURSABLE,
@@ -825,9 +821,8 @@ __rw_wlock_hard(volatile uintptr_t *c, u
 #endif
for (;;) {
if (v == RW_UNLOCKED) {
-   if (_rw_write_lock(rw, tid))
+   if (_rw_write_lock_fetch(rw, , tid))
break;
-   v = RW_READ_VALUE(rw);
continue;
}
 #ifdef KDTRACE_HOOKS

Modified: head/sys/sys/rwlock.h
==
--- head/sys/sys/rwlock.h   Sun Feb  5 03:26:34 2017(r313269)
+++ head/sys/sys/rwlock.h   Sun Feb  5 04:53:13 2017(r313270)
@@ -84,6 +84,11 @@
 #define_rw_write_lock(rw, tid) 
\
atomic_cmpset_acq_ptr(&(rw)->rw_lock, RW_UNLOCKED, (tid))
 
+#define_rw_write_lock_fetch(rw, vp, tid) ({
\
+   *vp = RW_UNLOCKED;  \
+   atomic_fcmpset_acq_ptr(&(rw)->rw_lock, vp, (tid));  \
+})
+
 /* Release a write lock quickly if there are no waiters. */
 #define_rw_write_unlock(rw, tid)   

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

2017-02-04 Thread Mateusz Guzik
Author: mjg
Date: Sun Feb  5 03:26:34 2017
New Revision: 313269
URL: https://svnweb.freebsd.org/changeset/base/313269

Log:
  mtx: switch to fcmpset
  
  The found value is passed to locking routines in order to reduce cacheline
  accesses.
  
  mtx_unlock grows an explicit check for regular unlock. On ll/sc architectures
  the routine can fail even if the lock could have been handled by the inline
  primitive.
  
  Discussed with:   jhb
  Tested by:pho (previous version)

Modified:
  head/sys/kern/kern_mutex.c
  head/sys/sys/mutex.h

Modified: head/sys/kern/kern_mutex.c
==
--- head/sys/kern/kern_mutex.c  Sun Feb  5 03:23:16 2017(r313268)
+++ head/sys/kern/kern_mutex.c  Sun Feb  5 03:26:34 2017(r313269)
@@ -455,12 +455,11 @@ _mtx_trylock_flags_(volatile uintptr_t *
  * sleep waiting for it), or if we need to recurse on it.
  */
 void
-__mtx_lock_sleep(volatile uintptr_t *c, uintptr_t tid, int opts,
+__mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v, uintptr_t tid, int opts,
 const char *file, int line)
 {
struct mtx *m;
struct turnstile *ts;
-   uintptr_t v;
 #ifdef ADAPTIVE_MUTEXES
volatile struct thread *owner;
 #endif
@@ -489,7 +488,6 @@ __mtx_lock_sleep(volatile uintptr_t *c, 
lock_delay_arg_init(, NULL);
 #endif
m = mtxlock2mtx(c);
-   v = MTX_READ_VALUE(m);
 
if (__predict_false(lv_mtx_owner(v) == (struct thread *)tid)) {
KASSERT((m->lock_object.lo_flags & LO_RECURSABLE) != 0 ||
@@ -520,9 +518,8 @@ __mtx_lock_sleep(volatile uintptr_t *c, 
 
for (;;) {
if (v == MTX_UNOWNED) {
-   if (_mtx_obtain_lock(m, tid))
+   if (_mtx_obtain_lock_fetch(m, , tid))
break;
-   v = MTX_READ_VALUE(m);
continue;
}
 #ifdef KDTRACE_HOOKS
@@ -674,12 +671,11 @@ _mtx_lock_spin_failed(struct mtx *m)
  * is handled inline.
  */
 void
-_mtx_lock_spin_cookie(volatile uintptr_t *c, uintptr_t tid, int opts,
-const char *file, int line)
+_mtx_lock_spin_cookie(volatile uintptr_t *c, uintptr_t v, uintptr_t tid,
+int opts, const char *file, int line)
 {
struct mtx *m;
struct lock_delay_arg lda;
-   uintptr_t v;
 #ifdef LOCK_PROFILING
int contested = 0;
uint64_t waittime = 0;
@@ -706,12 +702,10 @@ _mtx_lock_spin_cookie(volatile uintptr_t
 #ifdef KDTRACE_HOOKS
spin_time -= lockstat_nsecs(>lock_object);
 #endif
-   v = MTX_READ_VALUE(m);
for (;;) {
if (v == MTX_UNOWNED) {
-   if (_mtx_obtain_lock(m, tid))
+   if (_mtx_obtain_lock_fetch(m, , tid))
break;
-   v = MTX_READ_VALUE(m);
continue;
}
/* Give interrupts a chance while we spin. */
@@ -796,14 +790,11 @@ retry:
m->lock_object.lo_name, file, line));
WITNESS_CHECKORDER(>lock_object,
opts | LOP_NEWORDER | LOP_EXCLUSIVE, file, line, NULL);
-   v = MTX_READ_VALUE(m);
for (;;) {
-   if (v == MTX_UNOWNED) {
-   if (_mtx_obtain_lock(m, tid))
-   break;
-   v = MTX_READ_VALUE(m);
+   if (_mtx_obtain_lock_fetch(m, , tid))
+   break;
+   if (v == MTX_UNOWNED)
continue;
-   }
if (v == tid) {
m->mtx_recurse++;
break;
@@ -896,11 +887,18 @@ __mtx_unlock_sleep(volatile uintptr_t *c
 {
struct mtx *m;
struct turnstile *ts;
+   uintptr_t v;
 
if (SCHEDULER_STOPPED())
return;
 
m = mtxlock2mtx(c);
+   v = MTX_READ_VALUE(m);
+
+   if (v == (uintptr_t)curthread) {
+   if (_mtx_release_lock(m, (uintptr_t)curthread))
+   return;
+   }
 
if (mtx_recursed(m)) {
if (--(m->mtx_recurse) == 0)

Modified: head/sys/sys/mutex.h
==
--- head/sys/sys/mutex.hSun Feb  5 03:23:16 2017(r313268)
+++ head/sys/sys/mutex.hSun Feb  5 03:26:34 2017(r313269)
@@ -98,13 +98,13 @@ voidmtx_sysinit(void *arg);
 int_mtx_trylock_flags_(volatile uintptr_t *c, int opts, const char *file,
int line);
 void   mutex_init(void);
-void   __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t tid, int opts,
-   const char *file, int line);
+void   __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v, uintptr_t tid,
+   int opts, 

svn commit: r313268 - head/sys/kern

2017-02-04 Thread Mateusz Guzik
Author: mjg
Date: Sun Feb  5 03:23:16 2017
New Revision: 313268
URL: https://svnweb.freebsd.org/changeset/base/313268

Log:
  vfs: use atomic_fcmpset in vfs_refcount_*

Modified:
  head/sys/kern/vfs_subr.c

Modified: head/sys/kern/vfs_subr.c
==
--- head/sys/kern/vfs_subr.cSun Feb  5 02:49:42 2017(r313267)
+++ head/sys/kern/vfs_subr.cSun Feb  5 03:23:16 2017(r313268)
@@ -2461,11 +2461,11 @@ vfs_refcount_acquire_if_not_zero(volatil
 {
u_int old;
 
+   old = *count;
for (;;) {
-   old = *count;
if (old == 0)
return (0);
-   if (atomic_cmpset_int(count, old, old + 1))
+   if (atomic_fcmpset_int(count, , old + 1))
return (1);
}
 }
@@ -2475,11 +2475,11 @@ vfs_refcount_release_if_not_last(volatil
 {
u_int old;
 
+   old = *count;
for (;;) {
-   old = *count;
if (old == 1)
return (0);
-   if (atomic_cmpset_int(count, old, old - 1))
+   if (atomic_fcmpset_int(count, , old - 1))
return (1);
}
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2017-02-04 Thread Mateusz Guzik
On Sun, Feb 05, 2017 at 02:16:12AM +, Steven Hartland wrote:
> Hi Mateusz could you improve on the commit message as it currently
> describes what is changed, which can be obtained from the diff, but
> not why?
> 
> I hope on one feels like I'm trying to teach them to suck eggs, as I
> know everyone here has a wealth of experience, but I strongly believe
> commit messages are a very important way of improving the overall
> quality of the code base by sharing with others the reason for
> changes, which they can then learn from. I know I for one love
> picking up new nuggets of knowledge from others in this way.
> 

In general I agree that commit messages should be descriptive (see
below), but I also think there are things which are somewhat
self-explanatory and if someone is unfamiliar with given concept, they
can always ask and/or find it documented elsewhere.

For instance, plugging an unused variable, a memory leak, doing a
lockless check first etc. are all pretty standard and unless there is
something unusual going on (e.g. complicated circumstances leading to a
leak) there is not much to explain. In particular, I don't see why
anyone would explain why leaks are bad on each commit plugging one.

In the same spirit, the switch to fcmpset should be a routine change.
Interested parties can check the man page and the commit message which
introduced it. Arguably I should have elaborated more in there.

The gist is as follows: there are plenty of cases where the kernel wants
to atomically replace the value of a particular variable. Sometimes,
like in this commit, we want to bump the counter by 1, but only if the
current value is not 0. For that we need to read the value, see if it is
0 and if not, try to replace what we read with what we read + 1. We
cannot just increment as the value could have changed to 0 in the
meantime.

But this also means that multiple cpus doing the same operation on the
same variable will trip on each other - one will succeed while the rest
will have to retry.

Prior to this commit, each retry attempt would explicitly re-read the
value. This induces cache coherency traffic slowing everyone down.

amd64 has the nice property of giving us the value it found eleminating
the need to explicitly re-read it. There is similar story on i386 and
sparc.

Other architectures may also benefit from this, but that I did not
benchmark.

In short under contention atomic_fcmpset is going to be faster than
atomic_cmpset.

I did not benchmark this particular change, but a switch of the sort
easily gives 10%+ in microbenchmarks on amd64.

That said, while one can argue this optimizes the code, it really
depessimizes it as something of the sort should have been already
employed.

Parties interested in scalability problems (and cpu caches in
particular) are encouraged to read:
https://www.kernel.org/pub/linux/kernel/people/paulmck/perfbook/perfbook.html

> Also I believe this is area the project as a whole can improve on, so
> I don't mean to single out anyone here.
> 
> Anyway I hope people find this useful:
> 
> When I write a commit message I try to stick to the following rules
> which I believe helps to bring clarity for others about my actions.
> 1. First line is a brief summary of the out come of the change e.g.
> Fixed compiler warnings in nvmecontrol on 32bit platforms

This should be mandatory in the form of one sentence, preferably
prefixed with a keyword.

So in particular I would phrase this one as:
nvme: fix compiler warnings in nvmecontrol on 32bit platforms

or so

> 2. Follow up paragraphs expand on #1 if needed including details
> about not just what but why the change was made e.g.
> Use ssize_t instead of uint32_t to prevent warnings about a
> comparison with different signs. Due to the promotion rules, this
> would only  happen on 32-bit platforms.

See above. Unclear how much explanation is needed. While a safe default
would be to always elaborate, I don't think it is necessary in all
cases.

Things which do need elaborated commit messages is algorithm changes,
bug fixes (unless the bug is trivial), 

> 3. When writing #2 include details that would not be obvious to
> non-experts in the particular area.
> 
> #2 and #3 are really important to sharing knowledge that others may
> not know, its quite relevant to this commit msg, as while it may be
> obvious to you and others familiar with the atomic ops, to the rest
> of us we're just wondering why make this change?
> 

Well, while I don't have the best track record with commit messages, I
do believe I elaborate enough when it is needed, which I think is rare.
see https://svnweb.freebsd.org/base?view=revision=306608
or https://svnweb.freebsd.org/base?view=revision=303643
or https://svnweb.freebsd.org/base?view=revision=295233
for examples

Other than that I think my changes are straightforward (and sometimes
weirdly buggy :/).

tl;dr I think my commit message here was perfectly fine

> N.B. The example is based on Warner's recent 

svn commit: r313266 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace

2017-02-04 Thread Mark Johnston
Author: markj
Date: Sun Feb  5 02:47:34 2017
New Revision: 313266
URL: https://svnweb.freebsd.org/changeset/base/313266

Log:
  Ensure that the DOF string length is divisible by 2.
  
  It is an ASCII encoding of a hexadecimal representation of the DOF file
  used to enable anonymous tracing, so its length should always be even.
  
  MFC after:1 week

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.cSun Feb 
 5 02:45:35 2017(r313265)
+++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.cSun Feb 
 5 02:47:34 2017(r313266)
@@ -13346,8 +13346,11 @@ dtrace_dof_property(const char *name)
 
data += strlen(name) + 1; /* skip past the '=' */
len = eol - data;
+   if (len % 2 != 0) {
+   dtrace_dof_error(NULL, "invalid DOF encoding length");
+   goto doferr;
+   }
bytes = len / 2;
-
if (bytes < sizeof(dof_hdr_t)) {
dtrace_dof_error(NULL, "truncated header");
goto doferr;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2017-02-04 Thread Ngie Cooper (yaneurabeya)

> On Feb 4, 2017, at 18:16, Steven Hartland  
> wrote:
> 
> Hi Mateusz could you improve on the commit message as it currently describes 
> what is changed, which can be obtained from the diff, but not why?
> 
> I hope on one feels like I'm trying to teach them to suck eggs, as I know 
> everyone here has a wealth of experience, but I strongly believe commit 
> messages are a very important way of improving the overall quality of the 
> code base by sharing with others the reason for changes, which they can then 
> learn from. I know I for one love picking up new nuggets of knowledge from 
> others in this way.
> 
> Also I believe this is area the project as a whole can improve on, so I don't 
> mean to single out anyone here.
> 
> Anyway I hope people find this useful:
> 
> When I write a commit message I try to stick to the following rules which I 
> believe helps to bring clarity for others about my actions.
> 1. First line is a brief summary of the out come of the change e.g.
> Fixed compiler warnings in nvmecontrol on 32bit platforms
> 2. Follow up paragraphs expand on #1 if needed including details about not 
> just what but why the change was made e.g.
> Use ssize_t instead of uint32_t to prevent warnings about a comparison with 
> different signs. Due to the promotion rules, this would only  happen on 
> 32-bit platforms.
> 3. When writing #2 include details that would not be obvious to non-experts 
> in the particular area.
> 
> #2 and #3 are really important to sharing knowledge that others may not know, 
> its quite relevant to this commit msg, as while it may be obvious to you and 
> others familiar with the atomic ops, to the rest of us we're just wondering 
> why make this change?
> 
> N.B. The example is based on Warner's recent commit purely as an example, 
> which had a good why, just missing the brief summary.
> 
> While on this subject are there any official guidelines to writing commit 
> messages, if no should we create some?

Please. It really irritates me when I find similar commit messages at 
$work from people that don’t describe the rationale for the commit — especially 
when I need to assess the risk (backport needed, testing required, etc).
Thanks!
-Ngie


signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r313265 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt

2017-02-04 Thread Mark Johnston
Author: markj
Date: Sun Feb  5 02:45:35 2017
New Revision: 313265
URL: https://svnweb.freebsd.org/changeset/base/313265

Log:
  Search for _DTRACE_VERSION in sys/sdt.h rather than unistd.h.
  
  MFC after:1 week

Modified:
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.include.ksh

Modified: 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.include.ksh
==
--- 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.include.ksh   
Sun Feb  5 02:44:48 2017(r313264)
+++ 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.include.ksh   
Sun Feb  5 02:45:35 2017(r313265)
@@ -25,7 +25,7 @@
 #
 # ident"%Z%%M% %I% %E% SMI"
 
-# Make sure  defines _DTRACE_VERSION
+# Make sure  defines _DTRACE_VERSION
 
 DIR=/var/tmp/dtest.$$
 
@@ -33,7 +33,7 @@ mkdir $DIR
 cd $DIR
 
 cat > test.c <
+#include 
 
 int
 main(int argc, char **argv)
@@ -46,7 +46,7 @@ main(int argc, char **argv)
 }
 EOF
 
-cc -xarch=generic -o test test.c
+cc -o test test.c
 if [ $? -ne 0 ]; then
print -u2 "failed to compile test.c"
exit 1
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313264 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt

2017-02-04 Thread Mark Johnston
Author: markj
Date: Sun Feb  5 02:44:48 2017
New Revision: 313264
URL: https://svnweb.freebsd.org/changeset/base/313264

Log:
  Avoid using Sun compiler-specific flags.
  
  MFC after:1 week

Modified:
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh

Modified: 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh
==
--- 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh  
Sun Feb  5 02:44:08 2017(r313263)
+++ 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh  
Sun Feb  5 02:44:48 2017(r313264)
@@ -77,7 +77,7 @@ main(int argc, char **argv)
 }
 EOF
 
-cc -c -xO2 test.c
+cc -c -O2 test.c
 if [ $? -ne 0 ]; then
print -u2 "failed to compile test.c"
exit 1
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313263 - head/cddl/contrib/opensolaris/lib/libdtrace/common

2017-02-04 Thread Mark Johnston
Author: markj
Date: Sun Feb  5 02:44:08 2017
New Revision: 313263
URL: https://svnweb.freebsd.org/changeset/base/313263

Log:
  Fix a double free of libelf data buffers in the USDT link code.
  
  libdtrace needs to append to the input object files' string and symbol
  tables. Currently it does so by allocating a larger buffer, copying the
  existing sections into them, and swapping pointers in the libelf data
  descriptors. However, it also frees those buffers when its processing is
  complete, which leads to a double free since the elftoolchain libelf
  owns them and also frees them in elf_end(3). Instead, free the buffers
  originally allocated by libelf.
  
  MFC after:2 weeks

Modified:
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c
==
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.cSun Feb 
 5 02:39:12 2017(r313262)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.cSun Feb 
 5 02:44:08 2017(r313263)
@@ -1205,6 +1205,7 @@ process_obj(dtrace_hdl_t *dtp, const cha
key_t objkey;
dt_link_pair_t *pair, *bufs = NULL;
dt_strtab_t *strtab;
+   void *tmp;
 
if ((fd = open64(obj, O_RDWR)) == -1) {
return (dt_link_error(dtp, elf, fd, bufs,
@@ -1463,7 +1464,9 @@ process_obj(dtrace_hdl_t *dtp, const cha
bufs = pair;
 
bcopy(data_str->d_buf, pair->dlp_str, data_str->d_size);
+   tmp = data_str->d_buf;
data_str->d_buf = pair->dlp_str;
+   pair->dlp_str = tmp;
data_str->d_size += len;
(void) elf_flagdata(data_str, ELF_C_SET, ELF_F_DIRTY);
 
@@ -1471,7 +1474,9 @@ process_obj(dtrace_hdl_t *dtp, const cha
(void) gelf_update_shdr(scn_str, _str);
 
bcopy(data_sym->d_buf, pair->dlp_sym, data_sym->d_size);
+   tmp = data_sym->d_buf;
data_sym->d_buf = pair->dlp_sym;
+   pair->dlp_sym = tmp;
data_sym->d_size += nsym * symsize;
(void) elf_flagdata(data_sym, ELF_C_SET, ELF_F_DIRTY);
 
@@ -1657,9 +1662,6 @@ process_obj(dtrace_hdl_t *dtp, const cha
(void) elf_end(elf);
(void) close(fd);
 
-#ifndef illumos
-   if (nsym > 0)
-#endif
while ((pair = bufs) != NULL) {
bufs = pair->dlp_next;
dt_free(dtp, pair->dlp_str);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313262 - in head: cddl/contrib/opensolaris/lib/libdtrace/common sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/contrib/opensolaris/uts/common/sys sys/cddl/dev/dtrace

2017-02-04 Thread Mark Johnston
Author: markj
Date: Sun Feb  5 02:39:12 2017
New Revision: 313262
URL: https://svnweb.freebsd.org/changeset/base/313262

Log:
  Use PC-relative relocations for USDT probe sites on i386 and amd64.
  
  When recording probe site addresses in the output DOF file, dtrace -G
  needs to emit relocations for the .SUNW_dof section in order to obtain
  the addresses of functions containing probe sites. DTrace expects the
  addresses to be relative to the base address of the final ELF file,
  and the amd64 USDT implementation was relying on some unspecified and
  incorrect behaviour in the base system GNU ld to achieve this.
  
  This change reimplements the probe site relocation handling to allow
  USDT to be used with lld and newer GNU binutils. Specifically, it
  makes use of R_X86_64_PC64/R_386_PC32 relocations to obtain the
  probe site address relative to the DOF file address, and adds and uses a
  new DOF relocation type which computes the final probe site address using
  these relative offsets.
  
  Reported by and discussed with:   Rafael Espíndola
  MFC after:1 month
  Differential Revision:https://reviews.freebsd.org/D9374

Modified:
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_provider.c
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
  head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h
  head/sys/cddl/dev/dtrace/dtrace_ioctl.c

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c
==
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c Sun Feb  5 
02:27:04 2017(r313261)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c Sun Feb  5 
02:39:12 2017(r313262)
@@ -462,18 +462,8 @@ dof_add_probe(dt_idhash_t *dhp, dt_ident
dt_buf_write(dtp, >ddo_enoffs, pip->pi_enoffs,
pip->pi_nenoffs * sizeof (uint32_t), sizeof (uint32_t));
 
-   /*
-* If pi_rname isn't set, the relocation will be against the
-* function name. If it is, the relocation will be against
-* pi_rname. This will be used if the function is scoped
-* locally so an alternate symbol is added for the purpose
-* of this relocation.
-*/
-   if (pip->pi_rname == NULL)
-   dofr.dofr_name = dofpr.dofpr_func;
-   else
-   dofr.dofr_name = dof_add_string(ddo, pip->pi_rname);
-   dofr.dofr_type = DOF_RELO_SETX;
+   dofr.dofr_name = dof_add_string(ddo, pip->pi_rname);
+   dofr.dofr_type = DOF_RELO_DOFREL;
dofr.dofr_offset = dt_buf_len(>ddo_probes);
dofr.dofr_data = 0;
 

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c
==
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.cSun Feb 
 5 02:27:04 2017(r313261)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.cSun Feb 
 5 02:39:12 2017(r313262)
@@ -237,7 +237,7 @@ printf("%s:%s(%d): DOODAD\n",__FUNCTION_
rel->r_offset = s->dofs_offset +
dofr[j].dofr_offset;
rel->r_info = ELF32_R_INFO(count + dep->de_global,
-   R_386_32);
+   R_386_PC32);
 #elif defined(__mips__)
 /* XXX */
 printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__);
@@ -253,15 +253,6 @@ printf("%s:%s(%d): DOODAD\n",__FUNCTION_
 #elif defined(__riscv__)
 /* XXX */
 printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__);
-#elif defined(__sparc)
-   /*
-* Add 4 bytes to hit the low half of this 64-bit
-* big-endian address.
-*/
-   rel->r_offset = s->dofs_offset +
-   dofr[j].dofr_offset + 4;
-   rel->r_info = ELF32_R_INFO(count + dep->de_global,
-   R_SPARC_32);
 #else
 #error unknown ISA
 #endif
@@ -270,7 +261,7 @@ printf("%s:%s(%d): DOODAD\n",__FUNCTION_
sym->st_value = 0;
sym->st_size = 0;
sym->st_info = ELF32_ST_INFO(STB_GLOBAL, STT_FUNC);
-   sym->st_other = 0;
+   sym->st_other = ELF32_ST_VISIBILITY(STV_HIDDEN);
sym->st_shndx = SHN_UNDEF;
 
rel++;
@@ -287,11 +278,7 @@ printf("%s:%s(%d): DOODAD\n",__FUNCTION_
sym->st_value = 0;
sym->st_size = dof->dofh_filesz;
sym->st_info = ELF32_ST_INFO(STB_GLOBAL, STT_OBJECT);
-#ifdef illumos
-  

svn commit: r313261 - head/sys/kern

2017-02-04 Thread Mark Johnston
Author: markj
Date: Sun Feb  5 02:27:04 2017
New Revision: 313261
URL: https://svnweb.freebsd.org/changeset/base/313261

Log:
  Make witness_warn() always print to the console.
  
  witness_warn() either breaks into the debugger or panics the system, so its
  output should go to the console regardless of the witness(4) output channel
  configuration.
  
  MFC after:1 week
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/kern/subr_witness.c

Modified: head/sys/kern/subr_witness.c
==
--- head/sys/kern/subr_witness.cSun Feb  5 01:40:27 2017
(r313260)
+++ head/sys/kern/subr_witness.cSun Feb  5 02:27:04 2017
(r313261)
@@ -1732,15 +1732,14 @@ witness_warn(int flags, struct lock_obje
continue;
if (n == 0) {
va_start(ap, fmt);
-   witness_voutput(fmt, ap);
+   vprintf(fmt, ap);
va_end(ap);
-   witness_output(
-   " with the following %slocks held:\n",
+   printf(" with the following %slocks held:\n",
(flags & WARN_SLEEPOK) != 0 ?
"non-sleepable " : "");
}
n++;
-   witness_list_lock(lock1, witness_output);
+   witness_list_lock(lock1, printf);
}
 
/*
@@ -1765,11 +1764,11 @@ witness_warn(int flags, struct lock_obje
return (0);
 
va_start(ap, fmt);
-   witness_voutput(fmt, ap);
+   vprintf(fmt, ap);
va_end(ap);
-   witness_output(" with the following %slocks held:\n",
+   printf(" with the following %slocks held:\n",
(flags & WARN_SLEEPOK) != 0 ?  "non-sleepable " : "");
-   n += witness_list_locks(_list, witness_output);
+   n += witness_list_locks(_list, printf);
} else
sched_unpin();
if (flags & WARN_PANIC && n)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2017-02-04 Thread Steven Hartland
Hi Mateusz could you improve on the commit message as it currently 
describes what is changed, which can be obtained from the diff, but not why?


I hope on one feels like I'm trying to teach them to suck eggs, as I 
know everyone here has a wealth of experience, but I strongly believe 
commit messages are a very important way of improving the overall 
quality of the code base by sharing with others the reason for changes, 
which they can then learn from. I know I for one love picking up new 
nuggets of knowledge from others in this way.


Also I believe this is area the project as a whole can improve on, so I 
don't mean to single out anyone here.


Anyway I hope people find this useful:

When I write a commit message I try to stick to the following rules 
which I believe helps to bring clarity for others about my actions.

1. First line is a brief summary of the out come of the change e.g.
Fixed compiler warnings in nvmecontrol on 32bit platforms
2. Follow up paragraphs expand on #1 if needed including details about 
not just what but why the change was made e.g.
Use ssize_t instead of uint32_t to prevent warnings about a comparison 
with different signs. Due to the promotion rules, this would only  
happen on 32-bit platforms.
3. When writing #2 include details that would not be obvious to 
non-experts in the particular area.


#2 and #3 are really important to sharing knowledge that others may not 
know, its quite relevant to this commit msg, as while it may be obvious 
to you and others familiar with the atomic ops, to the rest of us we're 
just wondering why make this change?


N.B. The example is based on Warner's recent commit purely as an 
example, which had a good why, just missing the brief summary.


While on this subject are there any official guidelines to writing 
commit messages, if no should we create some?


On 05/02/2017 01:40, Mateusz Guzik wrote:

Author: mjg
Date: Sun Feb  5 01:40:27 2017
New Revision: 313260
URL: https://svnweb.freebsd.org/changeset/base/313260

Log:
   fd: switch fget_unlocked to atomic_fcmpset

Modified:
   head/sys/kern/kern_descrip.c

Modified: head/sys/kern/kern_descrip.c
==
--- head/sys/kern/kern_descrip.cSun Feb  5 01:20:39 2017
(r313259)
+++ head/sys/kern/kern_descrip.cSun Feb  5 01:40:27 2017
(r313260)
@@ -2569,8 +2569,8 @@ fget_unlocked(struct filedesc *fdp, int
if (error != 0)
return (error);
  #endif
-   retry:
count = fp->f_count;
+   retry:
if (count == 0) {
/*
 * Force a reload. Other thread could reallocate the
@@ -2584,7 +2584,7 @@ fget_unlocked(struct filedesc *fdp, int
 * Use an acquire barrier to force re-reading of fdt so it is
 * refreshed for verification.
 */
-   if (atomic_cmpset_acq_int(>f_count, count, count + 1) == 0)
+   if (atomic_fcmpset_acq_int(>f_count, , count + 1) == 
0)
goto retry;
fdt = fdp->fd_files;
  #ifdefCAPABILITIES



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


svn commit: r313260 - head/sys/kern

2017-02-04 Thread Mateusz Guzik
Author: mjg
Date: Sun Feb  5 01:40:27 2017
New Revision: 313260
URL: https://svnweb.freebsd.org/changeset/base/313260

Log:
  fd: switch fget_unlocked to atomic_fcmpset

Modified:
  head/sys/kern/kern_descrip.c

Modified: head/sys/kern/kern_descrip.c
==
--- head/sys/kern/kern_descrip.cSun Feb  5 01:20:39 2017
(r313259)
+++ head/sys/kern/kern_descrip.cSun Feb  5 01:40:27 2017
(r313260)
@@ -2569,8 +2569,8 @@ fget_unlocked(struct filedesc *fdp, int 
if (error != 0)
return (error);
 #endif
-   retry:
count = fp->f_count;
+   retry:
if (count == 0) {
/*
 * Force a reload. Other thread could reallocate the
@@ -2584,7 +2584,7 @@ fget_unlocked(struct filedesc *fdp, int 
 * Use an acquire barrier to force re-reading of fdt so it is
 * refreshed for verification.
 */
-   if (atomic_cmpset_acq_int(>f_count, count, count + 1) == 0)
+   if (atomic_fcmpset_acq_int(>f_count, , count + 1) == 
0)
goto retry;
fdt = fdp->fd_files;
 #ifdef CAPABILITIES
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r313191 - head/sbin/nvmecontrol

2017-02-04 Thread Warner Losh
Sorry it took so long.

Warner

On Sat, Feb 4, 2017 at 6:26 PM, Cy Schubert  wrote:
> Thanks.
>
>
> --
> Cheers,
> Cy Schubert 
> FreeBSD UNIX:     Web:  http://www.FreeBSD.org
>
> The need of the many outweighs the greed of the few.
>
>
> In message  om>
> , Warner Losh writes:
>> Thanks! Fixed in  r313259.
>>
>> Warner
>>
>> On Sat, Feb 4, 2017 at 6:16 PM, Cy Schubert  wrote:
>> > In message <201702040553.v145r1wb002...@repo.freebsd.org>, Warner Losh
>> > writes:
>> >> Author: imp
>> >> Date: Sat Feb  4 05:53:00 2017
>> >> New Revision: 313191
>> >> URL: https://svnweb.freebsd.org/changeset/base/313191
>> >>
>> >> Log:
>> >>   Implement 5 wdc-specific nvme control options for their HGST drives:
>> >>   wdc cap-diagCapture diagnostic data from drive
>> >>   wdc drive-log   Capture drive history data from drive
>> >>   wdc get-crash-dump  Retrieve firmware crash dump from drive
>> >>
>> >> Added:
>> >>   head/sbin/nvmecontrol/wdc.c   (contents, props changed)
>> >> Modified:
>> >>   head/sbin/nvmecontrol/Makefile
>> >>   head/sbin/nvmecontrol/nvmecontrol.8
>> >>   head/sbin/nvmecontrol/nvmecontrol.c
>> >>   head/sbin/nvmecontrol/nvmecontrol.h
>> > [...]
>> >> + while (len > 0) {
>> >> + resid = len > NVME_MAX_XFER_SIZE ? NVME_MAX_XFER_SIZE : len;
>> >> + wdc_get_data(fd, opcode, resid, offset, cmd, buf, resid);
>> >> + if (write(fd2, buf, resid) != resid)
>> >
>> > Hi Warner,
>> >
>> > I'm seeing the following on i386.
>> >
>> > opt/src/svn-current/sbin/nvmecontrol/wdc.c:156:30: error: comparison of
>> > integers of different signs: 'ssize_t' (aka 'int') and 'uint32_t' (aka
>> > 'unsigned int') [-Werror,-Wsign-compare]
>> > if (write(fd2, buf, resid) != resid)
>> > ~~ ^  ~
>> > 1 error generated.
>> >
>> > amd64 builds okay.
>> >
>> >> + err(1, "write");
>> >> + offset += resid;
>> >> + len -= resid;
>> >> + }
>> >> + free(buf);
>> >> + close(fd2);
>> > [...]
>> >
>> >
>> > --
>> > Cheers,
>> > Cy Schubert 
>> > FreeBSD UNIX:     Web:  http://www.FreeBSD.org
>> >
>> > The need of the many outweighs the greed of the few.
>> >
>> >
>>
>>
>
>
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r313191 - head/sbin/nvmecontrol

2017-02-04 Thread Cy Schubert
Thanks.


-- 
Cheers,
Cy Schubert 
FreeBSD UNIX:     Web:  http://www.FreeBSD.org

The need of the many outweighs the greed of the few.


In message 
, Warner Losh writes:
> Thanks! Fixed in  r313259.
> 
> Warner
> 
> On Sat, Feb 4, 2017 at 6:16 PM, Cy Schubert  wrote:
> > In message <201702040553.v145r1wb002...@repo.freebsd.org>, Warner Losh
> > writes:
> >> Author: imp
> >> Date: Sat Feb  4 05:53:00 2017
> >> New Revision: 313191
> >> URL: https://svnweb.freebsd.org/changeset/base/313191
> >>
> >> Log:
> >>   Implement 5 wdc-specific nvme control options for their HGST drives:
> >>   wdc cap-diagCapture diagnostic data from drive
> >>   wdc drive-log   Capture drive history data from drive
> >>   wdc get-crash-dump  Retrieve firmware crash dump from drive
> >>
> >> Added:
> >>   head/sbin/nvmecontrol/wdc.c   (contents, props changed)
> >> Modified:
> >>   head/sbin/nvmecontrol/Makefile
> >>   head/sbin/nvmecontrol/nvmecontrol.8
> >>   head/sbin/nvmecontrol/nvmecontrol.c
> >>   head/sbin/nvmecontrol/nvmecontrol.h
> > [...]
> >> + while (len > 0) {
> >> + resid = len > NVME_MAX_XFER_SIZE ? NVME_MAX_XFER_SIZE : len;
> >> + wdc_get_data(fd, opcode, resid, offset, cmd, buf, resid);
> >> + if (write(fd2, buf, resid) != resid)
> >
> > Hi Warner,
> >
> > I'm seeing the following on i386.
> >
> > opt/src/svn-current/sbin/nvmecontrol/wdc.c:156:30: error: comparison of
> > integers of different signs: 'ssize_t' (aka 'int') and 'uint32_t' (aka
> > 'unsigned int') [-Werror,-Wsign-compare]
> > if (write(fd2, buf, resid) != resid)
> > ~~ ^  ~
> > 1 error generated.
> >
> > amd64 builds okay.
> >
> >> + err(1, "write");
> >> + offset += resid;
> >> + len -= resid;
> >> + }
> >> + free(buf);
> >> + close(fd2);
> > [...]
> >
> >
> > --
> > Cheers,
> > Cy Schubert 
> > FreeBSD UNIX:     Web:  http://www.FreeBSD.org
> >
> > The need of the many outweighs the greed of the few.
> >
> >
> 
> 


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


Re: svn commit: r313191 - head/sbin/nvmecontrol

2017-02-04 Thread Warner Losh
Thanks! Fixed in  r313259.

Warner

On Sat, Feb 4, 2017 at 6:16 PM, Cy Schubert  wrote:
> In message <201702040553.v145r1wb002...@repo.freebsd.org>, Warner Losh
> writes:
>> Author: imp
>> Date: Sat Feb  4 05:53:00 2017
>> New Revision: 313191
>> URL: https://svnweb.freebsd.org/changeset/base/313191
>>
>> Log:
>>   Implement 5 wdc-specific nvme control options for their HGST drives:
>>   wdc cap-diagCapture diagnostic data from drive
>>   wdc drive-log   Capture drive history data from drive
>>   wdc get-crash-dump  Retrieve firmware crash dump from drive
>>
>> Added:
>>   head/sbin/nvmecontrol/wdc.c   (contents, props changed)
>> Modified:
>>   head/sbin/nvmecontrol/Makefile
>>   head/sbin/nvmecontrol/nvmecontrol.8
>>   head/sbin/nvmecontrol/nvmecontrol.c
>>   head/sbin/nvmecontrol/nvmecontrol.h
> [...]
>> + while (len > 0) {
>> + resid = len > NVME_MAX_XFER_SIZE ? NVME_MAX_XFER_SIZE : len;
>> + wdc_get_data(fd, opcode, resid, offset, cmd, buf, resid);
>> + if (write(fd2, buf, resid) != resid)
>
> Hi Warner,
>
> I'm seeing the following on i386.
>
> opt/src/svn-current/sbin/nvmecontrol/wdc.c:156:30: error: comparison of
> integers of different signs: 'ssize_t' (aka 'int') and 'uint32_t' (aka
> 'unsigned int') [-Werror,-Wsign-compare]
> if (write(fd2, buf, resid) != resid)
> ~~ ^  ~
> 1 error generated.
>
> amd64 builds okay.
>
>> + err(1, "write");
>> + offset += resid;
>> + len -= resid;
>> + }
>> + free(buf);
>> + close(fd2);
> [...]
>
>
> --
> Cheers,
> Cy Schubert 
> FreeBSD UNIX:     Web:  http://www.FreeBSD.org
>
> The need of the many outweighs the greed of the few.
>
>
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313259 - head/sbin/nvmecontrol

2017-02-04 Thread Warner Losh
Author: imp
Date: Sun Feb  5 01:20:39 2017
New Revision: 313259
URL: https://svnweb.freebsd.org/changeset/base/313259

Log:
  Use ssize_t instead of uint32_t to prevent warnings about a comparison
  with different signs. Due to the promotion rules, this would only
  happen on 32-bit platforms.

Modified:
  head/sbin/nvmecontrol/wdc.c

Modified: head/sbin/nvmecontrol/wdc.c
==
--- head/sbin/nvmecontrol/wdc.c Sun Feb  5 00:55:07 2017(r313258)
+++ head/sbin/nvmecontrol/wdc.c Sun Feb  5 01:20:39 2017(r313259)
@@ -127,7 +127,8 @@ wdc_do_dump(int fd, char *tmpl, const ch
 {
int fd2;
uint8_t *buf;
-   uint32_t len, resid, offset;
+   uint32_t len, offset;
+   ssize_t resid;
 
wdc_append_serial_name(fd, tmpl, MAXPATHLEN, suffix);
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r313191 - head/sbin/nvmecontrol

2017-02-04 Thread Cy Schubert
In message <201702040553.v145r1wb002...@repo.freebsd.org>, Warner Losh 
writes:
> Author: imp
> Date: Sat Feb  4 05:53:00 2017
> New Revision: 313191
> URL: https://svnweb.freebsd.org/changeset/base/313191
> 
> Log:
>   Implement 5 wdc-specific nvme control options for their HGST drives:
>   wdc cap-diagCapture diagnostic data from drive
>   wdc drive-log   Capture drive history data from drive
>   wdc get-crash-dump  Retrieve firmware crash dump from drive
> 
> Added:
>   head/sbin/nvmecontrol/wdc.c   (contents, props changed)
> Modified:
>   head/sbin/nvmecontrol/Makefile
>   head/sbin/nvmecontrol/nvmecontrol.8
>   head/sbin/nvmecontrol/nvmecontrol.c
>   head/sbin/nvmecontrol/nvmecontrol.h
[...]
> + while (len > 0) {
> + resid = len > NVME_MAX_XFER_SIZE ? NVME_MAX_XFER_SIZE : len;
> + wdc_get_data(fd, opcode, resid, offset, cmd, buf, resid);
> + if (write(fd2, buf, resid) != resid)

Hi Warner,

I'm seeing the following on i386.

opt/src/svn-current/sbin/nvmecontrol/wdc.c:156:30: error: comparison of 
integers of different signs: 'ssize_t' (aka 'int') and 'uint32_t' (aka 
'unsigned int') [-Werror,-Wsign-compare]
if (write(fd2, buf, resid) != resid)
~~ ^  ~
1 error generated.

amd64 builds okay.

> + err(1, "write");
> + offset += resid;
> + len -= resid;
> + }
> + free(buf);
> + close(fd2);
[...]


-- 
Cheers,
Cy Schubert 
FreeBSD UNIX:     Web:  http://www.FreeBSD.org

The need of the many outweighs the greed of the few.


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


svn commit: r313258 - head/sbin/nvmecontrol

2017-02-04 Thread Warner Losh
Author: imp
Date: Sun Feb  5 00:55:07 2017
New Revision: 313258
URL: https://svnweb.freebsd.org/changeset/base/313258

Log:
  Add the ability to dump log pages directly in binary to stdout.
  Update man page to include this flag, and an example of dumping a
  vendor-specific page while I'm here.

Modified:
  head/sbin/nvmecontrol/logpage.c
  head/sbin/nvmecontrol/nvmecontrol.8

Modified: head/sbin/nvmecontrol/logpage.c
==
--- head/sbin/nvmecontrol/logpage.c Sun Feb  5 00:45:02 2017
(r313257)
+++ head/sbin/nvmecontrol/logpage.c Sun Feb  5 00:55:07 2017
(r313258)
@@ -74,6 +74,12 @@ kv_lookup(const struct kv_name *kv, size
return bad;
 }
 
+static void
+print_bin(void *data, uint32_t length)
+{
+   write(STDOUT_FILENO, data, length);
+}
+
 /*
  * 128-bit integer augments to standard values. On i386 this
  * doesn't exist, so we use 64-bit values. The 128-bit counters
@@ -872,7 +878,7 @@ logpage(int argc, char *argv[])
 {
int fd, nsid;
int log_page = 0, pageflag = false;
-   int hexflag = false, ns_specified;
+   int binflag = false, hexflag = false, 
ns_specified;
charch, *p;
charcname[64];
uint32_tsize;
@@ -882,8 +888,11 @@ logpage(int argc, char *argv[])
struct nvme_controller_data cdata;
print_fn_t  print_fn;
 
-   while ((ch = getopt(argc, argv, "p:xv:")) != -1) {
+   while ((ch = getopt(argc, argv, "bp:xv:")) != -1) {
switch (ch) {
+   case 'b':
+   binflag = true;
+   break;
case 'p':
/* TODO: Add human-readable ASCII page IDs */
log_page = strtol(optarg, , 0);
@@ -942,7 +951,9 @@ logpage(int argc, char *argv[])
 
print_fn = print_hex;
size = DEFAULT_SIZE;
-   if (!hexflag) {
+   if (binflag)
+   print_fn = print_bin;
+   if (!binflag && !hexflag) {
/*
 * See if there is a pretty print function for the specified log
 * page.  If one isn't found, we just revert to the default

Modified: head/sbin/nvmecontrol/nvmecontrol.8
==
--- head/sbin/nvmecontrol/nvmecontrol.8 Sun Feb  5 00:45:02 2017
(r313257)
+++ head/sbin/nvmecontrol/nvmecontrol.8 Sun Feb  5 00:55:07 2017
(r313258)
@@ -33,7 +33,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 10, 2016
+.Dd February 4, 2017
 .Dt NVMECONTROL 8
 .Os
 .Sh NAME
@@ -63,6 +63,7 @@
 .Aq Fl p Ar page_id
 .Op Fl x
 .Op Fl v Ar vendor-string
+.Op Fl b
 .Aq device id
 .Aq namespace id
 .Nm
@@ -147,10 +148,21 @@ Display a human-readable summary of the 
 Log pages defined by the NVMe specification include Error Information Log 
(ID=1),
 SMART/Health Information Log (ID=2), and Firmware Slot Log (ID=3).
 .Pp
+.Dl nvmecontrol logpage -p 0xc1 -v wdc nvme0
+.Pp
+Display a human-readable summary of the nvme0's wdc-specific advanced
+SMART data.
+.Pp
 .Dl nvmecontrol logpage -p 1 -x nvme0
 .Pp
 Display a hexadecimal dump of the nvme0 controller's Error Information Log.
 .Pp
+.Dl nvmecontrol logpage -p 0xcb -b nvme0 > /tmp/page-cb.bin
+.Pp
+Print the contents of vendor specific page 0xcb as binary data on
+standard out.
+Redirect it to a temporary file.
+.Pp
 .Dl nvmecontrol firmware -s 2 -f /tmp/nvme_firmware nvme0
 .Pp
 Download the firmware image contained in "/tmp/nvme_firmware" to slot 2 of the
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313257 - head/sbin/nvmecontrol

2017-02-04 Thread Warner Losh
Author: imp
Date: Sun Feb  5 00:45:02 2017
New Revision: 313257
URL: https://svnweb.freebsd.org/changeset/base/313257

Log:
  Add some descriptions to the man page for the supported log pages as
  well as the new wdc commands. Make wdc be an alias for hgst when
  specifying the vendor to use to interpret the page.

Modified:
  head/sbin/nvmecontrol/logpage.c
  head/sbin/nvmecontrol/nvmecontrol.8

Modified: head/sbin/nvmecontrol/logpage.c
==
--- head/sbin/nvmecontrol/logpage.c Sun Feb  5 00:42:15 2017
(r313256)
+++ head/sbin/nvmecontrol/logpage.c Sun Feb  5 00:45:02 2017
(r313257)
@@ -846,6 +846,8 @@ static struct logpage_function {
 sizeof(struct nvme_firmware_page)},
{HGST_INFO_LOG, "hgst", print_hgst_info_log,
 DEFAULT_SIZE},
+   {HGST_INFO_LOG, "wdc",  print_hgst_info_log,
+DEFAULT_SIZE},
{INTEL_LOG_TEMP_STATS,  "intel", print_intel_temp_stats,
 sizeof(struct intel_log_temp_stats)},
{INTEL_LOG_READ_LAT_LOG,"intel", print_intel_read_lat_log,

Modified: head/sbin/nvmecontrol/nvmecontrol.8
==
--- head/sbin/nvmecontrol/nvmecontrol.8 Sun Feb  5 00:42:15 2017
(r313256)
+++ head/sbin/nvmecontrol/nvmecontrol.8 Sun Feb  5 00:45:02 2017
(r313257)
@@ -62,6 +62,7 @@
 .Ic logpage
 .Aq Fl p Ar page_id
 .Op Fl x
+.Op Fl v Ar vendor-string
 .Aq device id
 .Aq namespace id
 .Nm
@@ -74,7 +75,7 @@
 .Ic power
 .Op Fl l
 .Op Fl p power_state
-.Op fl w workload_hint
+.Op Fl w workload_hint
 .Nm
 .Ic wdc cap-diag
 .Op Fl o path_template
@@ -96,6 +97,26 @@
 .Sh DESCRIPTION
 NVM Express (NVMe) is a storage protocol standard, for SSDs and other
 high-speed storage devices over PCI Express.
+.Pp
+.Ss logpage
+The logpage command knows how to print log pages of various types.
+It also knows about vendor specific log pages from hgst/wdc and intel.
+Page 0xc1 for hgst/wdc contains the advanced smart information about
+the drive.
+Page 0xc1 is read latency stats for intel.
+Page 0xc2 is write latency stats for intel.
+Page 0xc5 is temperature stats for intel.
+Page 0xca is advanced smart information for intel.
+.Ss wdc
+The various wdc command retrieve log data from the wdc/hgst drives.
+The
+.Fl o
+flag specifies a path template to use to output the files.
+Each file takes the path template (which defaults to nothing), appends
+the drive's serial number and the type of dump it is followed
+by .bin.
+These logs must be sent to the vendor for analysis.
+This tool only provides a way to extract them.
 .Sh EXAMPLES
 .Dl nvmecontrol devlist
 .Pp
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313256 - in stable/10/sys: amd64/amd64 i386/i386

2017-02-04 Thread Konstantin Belousov
Author: kib
Date: Sun Feb  5 00:42:15 2017
New Revision: 313256
URL: https://svnweb.freebsd.org/changeset/base/313256

Log:
  MFC r312954:
  Do not leave stale 4K TLB entries on pde (superpage) removal or
  protection change.

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

Modified: stable/10/sys/amd64/amd64/pmap.c
==
--- stable/10/sys/amd64/amd64/pmap.cSun Feb  5 00:39:44 2017
(r313255)
+++ stable/10/sys/amd64/amd64/pmap.cSun Feb  5 00:42:15 2017
(r313256)
@@ -912,7 +912,12 @@ pmap_bootstrap(vm_paddr_t *firstaddr)
 
virtual_avail = va;
 
-   /* Initialize the PAT MSR. */
+   /*
+* Initialize the PAT MSR.
+* pmap_init_pat() clears and sets CR4_PGE, which, as a
+* side-effect, invalidates stale PG_G TLB entries that might
+* have been created in our pre-boot environment.
+*/
pmap_init_pat();
 
/* Initialize TLB Context Id. */
@@ -3372,6 +3377,7 @@ pmap_demote_pde_locked(pmap_t pmap, pd_e
vm_paddr_t mptepa;
vm_page_t mpte;
struct spglist free;
+   vm_offset_t sva;
int PG_PTE_CACHE;
 
PG_G = pmap_global_bit(pmap);
@@ -3410,9 +3416,9 @@ pmap_demote_pde_locked(pmap_t pmap, pd_e
DMAP_MAX_ADDRESS ? VM_ALLOC_INTERRUPT : VM_ALLOC_NORMAL) |
VM_ALLOC_NOOBJ | VM_ALLOC_WIRED)) == NULL) {
SLIST_INIT();
-   pmap_remove_pde(pmap, pde, trunc_2mpage(va), ,
-   lockp);
-   pmap_invalidate_page(pmap, trunc_2mpage(va));
+   sva = trunc_2mpage(va);
+   pmap_remove_pde(pmap, pde, sva, , lockp);
+   pmap_invalidate_range(pmap, sva, sva + NBPDR - 1);
pmap_free_zero_pages();
CTR2(KTR_PMAP, "pmap_demote_pde: failure for va %#lx"
" in pmap %p", va, pmap);
@@ -3555,11 +3561,23 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t 
pmap->pm_stats.wired_count -= NBPDR / PAGE_SIZE;
 
/*
-* Machines that don't support invlpg, also don't support
-* PG_G.
-*/
-   if (oldpde & PG_G)
-   pmap_invalidate_page(kernel_pmap, sva);
+* When workaround_erratum383 is false, a promotion to a 2M
+* page mapping does not invalidate the 512 4K page mappings
+* from the TLB.  Consequently, at this point, the TLB may
+* hold both 4K and 2M page mappings.  Therefore, the entire
+* range of addresses must be invalidated here.  In contrast,
+* when workaround_erratum383 is true, a promotion does
+* invalidate the 512 4K page mappings, and so a single INVLPG
+* suffices to invalidate the 2M page mapping.
+*/
+   if ((oldpde & PG_G) != 0) {
+   if (workaround_erratum383)
+   pmap_invalidate_page(kernel_pmap, sva);
+   else
+   pmap_invalidate_range(kernel_pmap, sva,
+   sva + NBPDR - 1);
+   }
+
pmap_resident_count_dec(pmap, NBPDR / PAGE_SIZE);
if (oldpde & PG_MANAGED) {
CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, oldpde & PG_PS_FRAME);
@@ -3914,9 +3932,14 @@ retry:
if (newpde != oldpde) {
if (!atomic_cmpset_long(pde, oldpde, newpde))
goto retry;
-   if (oldpde & PG_G)
-   pmap_invalidate_page(pmap, sva);
-   else
+   if (oldpde & PG_G) {
+   /* See pmap_remove_pde() for explanation. */
+   if (workaround_erratum383)
+   pmap_invalidate_page(kernel_pmap, sva);
+   else
+   pmap_invalidate_range(kernel_pmap, sva,
+   sva + NBPDR - 1);
+   } else
anychanged = TRUE;
}
return (anychanged);

Modified: stable/10/sys/i386/i386/pmap.c
==
--- stable/10/sys/i386/i386/pmap.c  Sun Feb  5 00:39:44 2017
(r313255)
+++ stable/10/sys/i386/i386/pmap.c  Sun Feb  5 00:42:15 2017
(r313256)
@@ -517,7 +517,14 @@ pmap_bootstrap(vm_paddr_t firstaddr)
for (i = 1; i < NKPT; i++)
PTD[i] = 0;
 
-   /* Initialize the PAT MSR if present. */
+   /*
+* Initialize the PAT MSR if present.
+* pmap_init_pat() clears and sets CR4_PGE, which, as a
+* side-effect, invalidates stale PG_G TLB entries that might
+* have been created in our pre-boot environment.  We assume
+* that PAT support implies PGE and in reverse, PGE presence
+* 

svn commit: r313255 - in stable/11/sys: amd64/amd64 i386/i386

2017-02-04 Thread Konstantin Belousov
Author: kib
Date: Sun Feb  5 00:39:44 2017
New Revision: 313255
URL: https://svnweb.freebsd.org/changeset/base/313255

Log:
  MFC r312954:
  Do not leave stale 4K TLB entries on pde (superpage) removal or
  protection change.

Modified:
  stable/11/sys/amd64/amd64/pmap.c
  stable/11/sys/i386/i386/pmap.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/amd64/amd64/pmap.c
==
--- stable/11/sys/amd64/amd64/pmap.cSun Feb  5 00:32:12 2017
(r313254)
+++ stable/11/sys/amd64/amd64/pmap.cSun Feb  5 00:39:44 2017
(r313255)
@@ -1041,7 +1041,12 @@ pmap_bootstrap(vm_paddr_t *firstaddr)
 
virtual_avail = va;
 
-   /* Initialize the PAT MSR. */
+   /*
+* Initialize the PAT MSR.
+* pmap_init_pat() clears and sets CR4_PGE, which, as a
+* side-effect, invalidates stale PG_G TLB entries that might
+* have been created in our pre-boot environment.
+*/
pmap_init_pat();
 
/* Initialize TLB Context Id. */
@@ -3441,6 +3446,7 @@ pmap_demote_pde_locked(pmap_t pmap, pd_e
vm_paddr_t mptepa;
vm_page_t mpte;
struct spglist free;
+   vm_offset_t sva;
int PG_PTE_CACHE;
 
PG_G = pmap_global_bit(pmap);
@@ -3479,9 +3485,9 @@ pmap_demote_pde_locked(pmap_t pmap, pd_e
DMAP_MAX_ADDRESS ? VM_ALLOC_INTERRUPT : VM_ALLOC_NORMAL) |
VM_ALLOC_NOOBJ | VM_ALLOC_WIRED)) == NULL) {
SLIST_INIT();
-   pmap_remove_pde(pmap, pde, trunc_2mpage(va), ,
-   lockp);
-   pmap_invalidate_page(pmap, trunc_2mpage(va));
+   sva = trunc_2mpage(va);
+   pmap_remove_pde(pmap, pde, sva, , lockp);
+   pmap_invalidate_range(pmap, sva, sva + NBPDR - 1);
pmap_free_zero_pages();
CTR2(KTR_PMAP, "pmap_demote_pde: failure for va %#lx"
" in pmap %p", va, pmap);
@@ -3624,11 +3630,23 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t 
pmap->pm_stats.wired_count -= NBPDR / PAGE_SIZE;
 
/*
-* Machines that don't support invlpg, also don't support
-* PG_G.
-*/
-   if (oldpde & PG_G)
-   pmap_invalidate_page(kernel_pmap, sva);
+* When workaround_erratum383 is false, a promotion to a 2M
+* page mapping does not invalidate the 512 4K page mappings
+* from the TLB.  Consequently, at this point, the TLB may
+* hold both 4K and 2M page mappings.  Therefore, the entire
+* range of addresses must be invalidated here.  In contrast,
+* when workaround_erratum383 is true, a promotion does
+* invalidate the 512 4K page mappings, and so a single INVLPG
+* suffices to invalidate the 2M page mapping.
+*/
+   if ((oldpde & PG_G) != 0) {
+   if (workaround_erratum383)
+   pmap_invalidate_page(kernel_pmap, sva);
+   else
+   pmap_invalidate_range(kernel_pmap, sva,
+   sva + NBPDR - 1);
+   }
+
pmap_resident_count_dec(pmap, NBPDR / PAGE_SIZE);
if (oldpde & PG_MANAGED) {
CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, oldpde & PG_PS_FRAME);
@@ -4011,9 +4029,14 @@ retry:
if (newpde != oldpde) {
if (!atomic_cmpset_long(pde, oldpde, newpde))
goto retry;
-   if (oldpde & PG_G)
-   pmap_invalidate_page(pmap, sva);
-   else
+   if (oldpde & PG_G) {
+   /* See pmap_remove_pde() for explanation. */
+   if (workaround_erratum383)
+   pmap_invalidate_page(kernel_pmap, sva);
+   else
+   pmap_invalidate_range(kernel_pmap, sva,
+   sva + NBPDR - 1);
+   } else
anychanged = TRUE;
}
return (anychanged);

Modified: stable/11/sys/i386/i386/pmap.c
==
--- stable/11/sys/i386/i386/pmap.c  Sun Feb  5 00:32:12 2017
(r313254)
+++ stable/11/sys/i386/i386/pmap.c  Sun Feb  5 00:39:44 2017
(r313255)
@@ -508,7 +508,14 @@ pmap_bootstrap(vm_paddr_t firstaddr)
for (i = 1; i < NKPT; i++)
PTD[i] = 0;
 
-   /* Initialize the PAT MSR if present. */
+   /*
+* Initialize the PAT MSR if present.
+* pmap_init_pat() clears and sets CR4_PGE, which, as a
+* side-effect, invalidates stale PG_G TLB entries that might
+* have been created in our pre-boot environment.  We assume
+* that PAT support implies PGE and in reverse, PGE presence
+

svn commit: r313254 - head/sys/riscv/include

2017-02-04 Thread Ruslan Bukin
Author: br
Date: Sun Feb  5 00:32:12 2017
New Revision: 313254
URL: https://svnweb.freebsd.org/changeset/base/313254

Log:
  Implement atomic_fcmpset_*() for RISC-V.
  
  Requested by: mjg
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D9447

Modified:
  head/sys/riscv/include/atomic.h

Modified: head/sys/riscv/include/atomic.h
==
--- head/sys/riscv/include/atomic.h Sat Feb  4 20:57:09 2017
(r313253)
+++ head/sys/riscv/include/atomic.h Sun Feb  5 00:32:12 2017
(r313254)
@@ -120,6 +120,31 @@ atomic_cmpset_32(volatile uint32_t *p, u
return (!res);
 }
 
+static __inline int
+atomic_fcmpset_32(volatile uint32_t *p, uint32_t *cmpval, uint32_t newval)
+{
+   uint32_t tmp;
+   int res;
+
+   res = 0;
+
+   __asm __volatile(
+   "0:"
+   "li   %1, 1\n"  /* Preset to fail */
+   "lr.w %0, %2\n" /* Load old value */
+   "bne  %0, %z4, 1f\n"/* Compare */
+   "sc.w %1, %z5, %2\n"/* Try to store new value */
+   "j 2f\n"
+   "1:"
+   "sw   %0, %3\n" /* Save old value */
+   "2:"
+   : "=" (tmp), "=" (res), "+A" (*p), "+A" (*cmpval)
+   : "rJ" (*cmpval), "rJ" (newval)
+   : "memory");
+
+   return (!res);
+}
+
 static __inline uint32_t
 atomic_fetchadd_32(volatile uint32_t *p, uint32_t val)
 {
@@ -152,6 +177,7 @@ atomic_readandclear_32(volatile uint32_t
 #defineatomic_add_int  atomic_add_32
 #defineatomic_clear_intatomic_clear_32
 #defineatomic_cmpset_int   atomic_cmpset_32
+#defineatomic_fcmpset_int  atomic_fcmpset_32
 #defineatomic_fetchadd_int atomic_fetchadd_32
 #defineatomic_readandclear_int atomic_readandclear_32
 #defineatomic_set_int  atomic_set_32
@@ -183,6 +209,27 @@ atomic_cmpset_rel_32(volatile uint32_t *
return (atomic_cmpset_32(p, cmpval, newval));
 }
 
+static __inline int
+atomic_fcmpset_acq_32(volatile uint32_t *p, uint32_t *cmpval, uint32_t newval)
+{
+   int res;
+
+   res = atomic_fcmpset_32(p, cmpval, newval);
+
+   fence();
+
+   return (res);
+}
+
+static __inline int
+atomic_fcmpset_rel_32(volatile uint32_t *p, uint32_t *cmpval, uint32_t newval)
+{
+
+   fence();
+
+   return (atomic_fcmpset_32(p, cmpval, newval));
+}
+
 static __inline uint32_t
 atomic_load_acq_32(volatile uint32_t *p)
 {
@@ -207,6 +254,7 @@ atomic_store_rel_32(volatile uint32_t *p
 #defineatomic_add_acq_int  atomic_add_acq_32
 #defineatomic_clear_acq_intatomic_clear_acq_32
 #defineatomic_cmpset_acq_int   atomic_cmpset_acq_32
+#defineatomic_fcmpset_acq_int  atomic_fcmpset_acq_32
 #defineatomic_load_acq_int atomic_load_acq_32
 #defineatomic_set_acq_int  atomic_set_acq_32
 #defineatomic_subtract_acq_int atomic_subtract_acq_32
@@ -214,6 +262,7 @@ atomic_store_rel_32(volatile uint32_t *p
 #defineatomic_add_rel_int  atomic_add_rel_32
 #defineatomic_clear_rel_intatomic_add_rel_32
 #defineatomic_cmpset_rel_int   atomic_cmpset_rel_32
+#defineatomic_fcmpset_rel_int  atomic_fcmpset_rel_32
 #defineatomic_set_rel_int  atomic_set_rel_32
 #defineatomic_subtract_rel_int atomic_subtract_rel_32
 #defineatomic_store_rel_intatomic_store_rel_32
@@ -281,6 +330,31 @@ atomic_cmpset_64(volatile uint64_t *p, u
return (!res);
 }
 
+static __inline int
+atomic_fcmpset_64(volatile uint64_t *p, uint64_t *cmpval, uint64_t newval)
+{
+   uint64_t tmp;
+   int res;
+
+   res = 0;
+
+   __asm __volatile(
+   "0:"
+   "li   %1, 1\n"  /* Preset to fail */
+   "lr.d %0, %2\n" /* Load old value */
+   "bne  %0, %z4, 1f\n"/* Compare */
+   "sc.d %1, %z5, %2\n"/* Try to store new value */
+   "j 2f\n"
+   "1:"
+   "sd   %0, %3\n" /* Save old value */
+   "2:"
+   : "=" (tmp), "=" (res), "+A" (*p), "+A" (*cmpval)
+   : "rJ" (*cmpval), "rJ" (newval)
+   : "memory");
+
+   return (!res);
+}
+
 static __inline uint64_t
 atomic_fetchadd_64(volatile uint64_t *p, uint64_t val)
 {
@@ -339,6 +413,7 @@ atomic_swap_64(volatile uint64_t *p, uin
 #defineatomic_add_long atomic_add_64
 #defineatomic_clear_long   atomic_clear_64
 #defineatomic_cmpset_long  atomic_cmpset_64
+#defineatomic_fcmpset_long atomic_fcmpset_64
 #defineatomic_fetchadd_long

Re: svn commit: r313037 - in head/sys: amd64/include kern mips/include net powerpc/include sparc64/include

2017-02-04 Thread Svatopluk Kraus
Probably not related. But when I took short look to the patch to see
what could go wrong, I walked into the following comment in
_rm_wlock(): "Assumes rm->rm_writecpus update is visible on other CPUs
before rm_cleanIPI is called." There is no explicit barrier to ensure
it. However, there might be some barriers inside of
smp_rendezvous_cpus(). I have no idea what could happened if this
assumption is not met. Note that rm_cleanIPI() is affected by the
patch.



On Sat, Feb 4, 2017 at 9:39 PM, Jason Harmening
 wrote:
> Can you post an example of such panic?  Only 2 MI pieces were changed,
> netisr and rmlock.  I haven't seen problems on my own amd64/i386/arm testing
> of this, so a backtrace might help to narrow down the cause.
>
> On Sat, Feb 4, 2017 at 12:22 PM, Andreas Tobler 
> wrote:
>>
>> On 04.02.17 20:54, Jason Harmening wrote:
>>>
>>> I suspect this broke rmlocks for mips because the rmlock implementation
>>> takes the address of the per-CPU pc_rm_queue when building tracker
>>> lists.  That address may be later accessed from another CPU and will
>>> then translate to the wrong physical region if the address was taken
>>> relative to the globally-constant pcpup VA used on mips.
>>>
>>> Regardless, for mips get_pcpup() should be implemented as
>>> pcpu_find(curcpu) since returning an address that may mean something
>>> different depending on the CPU seems like a big POLA violation if
>>> nothing else.
>>>
>>> I'm more concerned about the report of powerpc breakage.  For powerpc we
>>> simply take each pcpu pointer from the pc_allcpu list (which is the same
>>> value stored in the cpuid_to_pcpu array) and pass it through the ap_pcpu
>>> global to each AP's startup code, which then stores it in sprg0.  It
>>> should be globally unique and won't have the variable-translation issues
>>> seen on mips.   Andreas, are you certain this change was responsible the
>>> breakage you saw, and was it the same sort of hang observed on mips?
>>
>>
>> I'm really sure. 313036 booted fine, allowed me to execute heavy
>> compilation jobs, np. 313037 on the other side gave me various patterns of
>> panics. During startup, but I also succeeded to get into multiuser and then
>> the panic happend during port building.
>>
>> I have no deeper inside where pcpu data is used. Justin mentioned netisr?
>>
>> Andreas
>>
>
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313253 - head/sbin/ifconfig

2017-02-04 Thread Adrian Chadd
Author: adrian
Date: Sat Feb  4 20:57:09 2017
New Revision: 313253
URL: https://svnweb.freebsd.org/changeset/base/313253

Log:
  [net80211] fix quiet_duration parameter to match what is provided in the 
manpage.

Modified:
  head/sbin/ifconfig/ifieee80211.c

Modified: head/sbin/ifconfig/ifieee80211.c
==
--- head/sbin/ifconfig/ifieee80211.cSat Feb  4 20:43:54 2017
(r313252)
+++ head/sbin/ifconfig/ifieee80211.cSat Feb  4 20:57:09 2017
(r313253)
@@ -5594,12 +5594,12 @@ static struct cmd ieee80211_cmds[] = {
DEF_CMD_ARG("bgscanidle",   set80211bgscanidle),
DEF_CMD_ARG("bgscanintvl",  set80211bgscanintvl),
DEF_CMD_ARG("scanvalid",set80211scanvalid),
-   DEF_CMD("quiet",1,  set80211quiet),
-   DEF_CMD("-quiet",   0,  set80211quiet),
-   DEF_CMD_ARG("quiet_count",  set80211quietcount),
-   DEF_CMD_ARG("quiet_period", set80211quietperiod),
-   DEF_CMD_ARG("quiet_dur",set80211quietduration),
-   DEF_CMD_ARG("quiet_offset", set80211quietoffset),
+   DEF_CMD("quiet",1,  set80211quiet),
+   DEF_CMD("-quiet",   0,  set80211quiet),
+   DEF_CMD_ARG("quiet_count",  set80211quietcount),
+   DEF_CMD_ARG("quiet_period", set80211quietperiod),
+   DEF_CMD_ARG("quiet_duration",   set80211quietduration),
+   DEF_CMD_ARG("quiet_offset", set80211quietoffset),
DEF_CMD_ARG("roam:rssi",set80211roamrssi),
DEF_CMD_ARG("roam:rate",set80211roamrate),
DEF_CMD_ARG("mcastrate",set80211mcastrate),
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313252 - head/sbin/nvmecontrol

2017-02-04 Thread Warner Losh
Author: imp
Date: Sat Feb  4 20:43:54 2017
New Revision: 313252
URL: https://svnweb.freebsd.org/changeset/base/313252

Log:
  Fix off by one error that truncated the serial number for filenames.

Modified:
  head/sbin/nvmecontrol/wdc.c

Modified: head/sbin/nvmecontrol/wdc.c
==
--- head/sbin/nvmecontrol/wdc.c Sat Feb  4 20:43:45 2017(r313251)
+++ head/sbin/nvmecontrol/wdc.c Sat Feb  4 20:43:54 2017(r313252)
@@ -94,7 +94,7 @@ wdc_append_serial_name(int fd, char *buf
walker = sn + NVME_SERIAL_NUMBER_LENGTH - 1;
while (walker > sn && *walker == ' ')
walker--;
-   *walker = '\0';
+   *++walker = '\0';
snprintf(buf, len, "%s%s.bin", sn, suffix);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313251 - head/sbin/nvmecontrol

2017-02-04 Thread Warner Losh
Author: imp
Date: Sat Feb  4 20:43:45 2017
New Revision: 313251
URL: https://svnweb.freebsd.org/changeset/base/313251

Log:
  Fix a typo in usage string for unimplemented command.

Modified:
  head/sbin/nvmecontrol/wdc.c

Modified: head/sbin/nvmecontrol/wdc.c
==
--- head/sbin/nvmecontrol/wdc.c Sat Feb  4 19:35:38 2017(r313250)
+++ head/sbin/nvmecontrol/wdc.c Sat Feb  4 20:43:45 2017(r313251)
@@ -69,7 +69,7 @@ static void wdc_purge_monitor(int argc, 
 #define WDC_DRIVE_LOG_USAGE"\tnvmecontrol wdc drive-log [-o 
path-template]\n"
 #define WDC_GET_CRASH_DUMP_USAGE "\tnvmecontrol wdc get-crash-dump [-o 
path-template]\n"
 #define WDC_PURGE_USAGE"\tnvmecontrol wdc purge [-o 
path-template]\n"
-#define WDC_PURGE_MONITOR_USAGE"\tnvmecontrol wdc purge-montor\n"
+#define WDC_PURGE_MONITOR_USAGE"\tnvmecontrol wdc purge-monitor\n"
 
 static struct nvme_function wdc_funcs[] = {
{"cap-diag",wdc_cap_diag,   WDC_CAP_DIAG_USAGE},
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r313037 - in head/sys: amd64/include kern mips/include net powerpc/include sparc64/include

2017-02-04 Thread Jason Harmening
Can you post an example of such panic?  Only 2 MI pieces were changed,
netisr and rmlock.  I haven't seen problems on my own amd64/i386/arm
testing of this, so a backtrace might help to narrow down the cause.

On Sat, Feb 4, 2017 at 12:22 PM, Andreas Tobler 
wrote:

> On 04.02.17 20:54, Jason Harmening wrote:
>
>> I suspect this broke rmlocks for mips because the rmlock implementation
>> takes the address of the per-CPU pc_rm_queue when building tracker
>> lists.  That address may be later accessed from another CPU and will
>> then translate to the wrong physical region if the address was taken
>> relative to the globally-constant pcpup VA used on mips.
>>
>> Regardless, for mips get_pcpup() should be implemented as
>> pcpu_find(curcpu) since returning an address that may mean something
>> different depending on the CPU seems like a big POLA violation if
>> nothing else.
>>
>> I'm more concerned about the report of powerpc breakage.  For powerpc we
>> simply take each pcpu pointer from the pc_allcpu list (which is the same
>> value stored in the cpuid_to_pcpu array) and pass it through the ap_pcpu
>> global to each AP's startup code, which then stores it in sprg0.  It
>> should be globally unique and won't have the variable-translation issues
>> seen on mips.   Andreas, are you certain this change was responsible the
>> breakage you saw, and was it the same sort of hang observed on mips?
>>
>
> I'm really sure. 313036 booted fine, allowed me to execute heavy
> compilation jobs, np. 313037 on the other side gave me various patterns of
> panics. During startup, but I also succeeded to get into multiuser and then
> the panic happend during port building.
>
> I have no deeper inside where pcpu data is used. Justin mentioned netisr?
>
> Andreas
>
>
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r313037 - in head/sys: amd64/include kern mips/include net powerpc/include sparc64/include

2017-02-04 Thread Andreas Tobler

On 04.02.17 20:54, Jason Harmening wrote:

I suspect this broke rmlocks for mips because the rmlock implementation
takes the address of the per-CPU pc_rm_queue when building tracker
lists.  That address may be later accessed from another CPU and will
then translate to the wrong physical region if the address was taken
relative to the globally-constant pcpup VA used on mips.

Regardless, for mips get_pcpup() should be implemented as
pcpu_find(curcpu) since returning an address that may mean something
different depending on the CPU seems like a big POLA violation if
nothing else.

I'm more concerned about the report of powerpc breakage.  For powerpc we
simply take each pcpu pointer from the pc_allcpu list (which is the same
value stored in the cpuid_to_pcpu array) and pass it through the ap_pcpu
global to each AP's startup code, which then stores it in sprg0.  It
should be globally unique and won't have the variable-translation issues
seen on mips.   Andreas, are you certain this change was responsible the
breakage you saw, and was it the same sort of hang observed on mips?


I'm really sure. 313036 booted fine, allowed me to execute heavy 
compilation jobs, np. 313037 on the other side gave me various patterns 
of panics. During startup, but I also succeeded to get into multiuser 
and then the panic happend during port building.


I have no deeper inside where pcpu data is used. Justin mentioned netisr?

Andreas

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


Re: svn commit: r313037 - in head/sys: amd64/include kern mips/include net powerpc/include sparc64/include

2017-02-04 Thread Alexander Kabaev
On Fri, 3 Feb 2017 21:29:33 -0800
Jason Harmening  wrote:

> Hi,
> 
> I'm a bit confused as to how this change breaks MIPS.  The new
> function, get_pcpu() is intended to be used only to access the
> per-cpu data pointer locally.  It returns pcpup, which is the per-cpu
> pointer wired into the local TLB to translate to the local CPU's
> physical data region, correct?
> 
> This is the same value used by the per-CPU accessors such as PCPU_ADD
> and PCPU_GET.  The MI portions of this change only use get_pcpu() to
> access the local CPU's data, e.g. under a critical section in the
> rmlock.  It is not intended to be used for iterating all CPUs.
> 
> If I've missed something and MIPS is truly broken by this, then I'll
> gladly revert, but (maybe because it's late) I'm not seeing where
> this goes wrong on MIPS.
> 
> Thanks,
> Jason

The hang is actually due to _rmlock_assert spinning in
rm_trackers_present with interrupts disabled, due to this constructs:

for (queue = pc->pc_rm_queue.rmq_next; queue !=
>pc_rm_queue; queue = queue->rmq_next) {

You changed the code to pass get_pcpu() results instead of direct
pointer to the corresponding pcpu storage and that is NOT the pointer
that was being used in pcpu_init. On architectures that rig TLB to make
local PCPU available at constant address from each CPU, these two are
generally not same, so while empty pc_rm_queue is a cyclic list
consisting of just one element pc_rm_queue, the loop terminating
condition will never be met, as >pc_rm_qeue value will be very
different from the one that pc->pc_rm_queue.rmq_next was set at
initialisation time.

This affects MIPS in SMP configuration only, UP configs do not bother
with TLB hackery.

-- 
Alexander Kabaev


pgpz8CADzOmvi.pgp
Description: Цифровая подпись OpenPGP


Re: svn commit: r313037 - in head/sys: amd64/include kern mips/include net powerpc/include sparc64/include

2017-02-04 Thread Jason Harmening
I suspect this broke rmlocks for mips because the rmlock implementation
takes the address of the per-CPU pc_rm_queue when building tracker lists.
That address may be later accessed from another CPU and will then translate
to the wrong physical region if the address was taken relative to the
globally-constant pcpup VA used on mips.

Regardless, for mips get_pcpup() should be implemented as pcpu_find(curcpu)
since returning an address that may mean something different depending on
the CPU seems like a big POLA violation if nothing else.

I'm more concerned about the report of powerpc breakage.  For powerpc we
simply take each pcpu pointer from the pc_allcpu list (which is the same
value stored in the cpuid_to_pcpu array) and pass it through the ap_pcpu
global to each AP's startup code, which then stores it in sprg0.  It should
be globally unique and won't have the variable-translation issues seen on
mips.   Andreas, are you certain this change was responsible the breakage
you saw, and was it the same sort of hang observed on mips?

On Sat, Feb 4, 2017 at 1:25 AM, Andreas Tobler  wrote:

> On 04.02.17 07:27, Jason Harmening wrote:
>
>> It's hard to argue with that:)  I've backed it out until we can figure
>> out what's going on.
>> Sorry for the breakage.
>>
>
>
> For the record, powerpc64 was also affected.
>
> Andreas
>
>>
>> On Fri, Feb 3, 2017 at 9:54 PM, Kurt Lidl > > wrote:
>>
>> Having just spent a couple of hours bisecting what broke the kernel on
>> my mips64 machine, I can definitively state it was this commit.
>>
>> With this commit in place, the kernel hangs early in the
>> autoconfiguration:
>>
>> gcc version 4.2.1 20070831 patched [FreeBSD]
>> Preloaded elf kernel "kernel" at 0x80aa96a0.
>> real memory  = 523239424 (510976K bytes)
>> Physical memory chunk(s):
>> 0x00bf3000 - 0x080d5fff, 122564608 bytes (29923 pages)
>> 0x08101000 - 0x0ff00fff, 132120576 bytes (32256 pages)
>> 0x41000 - 0x41f196fff, 253325312 bytes (61847 pages)
>> avail memory = 504360960 (480MB)
>> Create COP2 context zone
>> AP #1 started!
>> FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
>>  hangs here 
>>
>> -Kurt
>>
>> On 2/4/17 12:29 AM, Jason Harmening wrote:
>>
>> Hi,
>>
>> I'm a bit confused as to how this change breaks MIPS.  The new
>> function,
>> get_pcpu() is intended to be used only to access the per-cpu data
>> pointer locally.  It returns pcpup, which is the per-cpu pointer
>> wired
>> into the local TLB to translate to the local CPU's physical data
>> region,
>> correct?
>>
>> This is the same value used by the per-CPU accessors such as
>> PCPU_ADD
>> and PCPU_GET.  The MI portions of this change only use get_pcpu()
>> to
>> access  the local CPU's data, e.g. under a critical section in the
>> rmlock.  It is not intended to be used for iterating all CPUs.
>>
>> If I've missed something and MIPS is truly broken by this, then
>> I'll
>> gladly revert, but (maybe because it's late) I'm not seeing
>> where this
>> goes wrong on MIPS.
>>
>> Thanks,
>> Jason
>>
>> On Fri, Feb 3, 2017 at 8:12 PM, Alexander Kabaev
>> 
>> >> wrote:
>>
>> On Wed, 1 Feb 2017 03:32:49 + (UTC)
>> "Jason A. Harmening"  wrote:
>>
>> > Author: jah
>> > Date: Wed Feb  1 03:32:49 2017
>> > New Revision: 313037
>> > URL: https://svnweb.freebsd.org/changeset/base/313037
>> 
>> > >
>> >
>> > Log:
>> >   Implement get_pcpu() for the remaining architectures and
>> use it to
>> >   replace pcpu_find(curcpu) in MI code.
>> >
>> > Modified:
>> >   head/sys/amd64/include/pcpu.h
>> >   head/sys/kern/kern_rmlock.c
>> >   head/sys/mips/include/pcpu.h
>> >   head/sys/net/netisr.c
>> >   head/sys/powerpc/include/cpufunc.h
>> >   head/sys/powerpc/include/pcpu.h
>> >   head/sys/sparc64/include/pcpu.h
>> >
>>
>> Hi,
>>
>> this change was not reviewed nor testing was thought for all
>> architectures it touches. The change happens to break MIPS
>> quite
>> thoroughly, since MIPS is using different pointers when
>> accessing PCPU
>> area locally and when doing iterations using cpu_to_cpuid
>> array. I
>> therefore 

svn commit: r313250 - in head/sys/dev: mmc sdhci

2017-02-04 Thread Marius Strobl
Author: marius
Date: Sat Feb  4 19:35:38 2017
New Revision: 313250
URL: https://svnweb.freebsd.org/changeset/base/313250

Log:
  Fix some more overly long lines, whitespace and other bugs according to
  style(9) as well as spelling in comments.

Modified:
  head/sys/dev/mmc/mmc.c
  head/sys/dev/mmc/mmcreg.h
  head/sys/dev/sdhci/sdhci.c
  head/sys/dev/sdhci/sdhci.h
  head/sys/dev/sdhci/sdhci_fdt.c
  head/sys/dev/sdhci/sdhci_pci.c

Modified: head/sys/dev/mmc/mmc.c
==
--- head/sys/dev/mmc/mmc.c  Sat Feb  4 19:16:19 2017(r313249)
+++ head/sys/dev/mmc/mmc.c  Sat Feb  4 19:35:38 2017(r313250)
@@ -111,14 +111,15 @@ struct mmc_ivars {
char card_sn_string[16];/* Formatted serial # for disk->d_ident */
 };
 
-#define CMD_RETRIES3
+#defineCMD_RETRIES 3
 
 #defineCARD_ID_FREQUENCY 40 /* Spec requires 400kHz max during ID 
phase. */
 
 static SYSCTL_NODE(_hw, OID_AUTO, mmc, CTLFLAG_RD, NULL, "mmc driver");
 
 static int mmc_debug;
-SYSCTL_INT(_hw_mmc, OID_AUTO, debug, CTLFLAG_RWTUN, _debug, 0, "Debug 
level");
+SYSCTL_INT(_hw_mmc, OID_AUTO, debug, CTLFLAG_RWTUN, _debug, 0,
+"Debug level");
 
 /* bus entry points */
 static int mmc_acquire_bus(device_t busdev, device_t dev);
@@ -137,14 +138,14 @@ static int mmc_wait_for_request(device_t
 static int mmc_write_ivar(device_t bus, device_t child, int which,
 uintptr_t value);
 
-#define MMC_LOCK(_sc)  mtx_lock(&(_sc)->sc_mtx)
+#defineMMC_LOCK(_sc)   mtx_lock(&(_sc)->sc_mtx)
 #defineMMC_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx)
-#define MMC_LOCK_INIT(_sc) \
-   mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->dev),   \
+#defineMMC_LOCK_INIT(_sc)  
\
+   mtx_init(&(_sc)->sc_mtx, device_get_nameunit((_sc)->dev),   \
"mmc", MTX_DEF)
-#define MMC_LOCK_DESTROY(_sc)  mtx_destroy(&_sc->sc_mtx);
-#define MMC_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED);
-#define MMC_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED);
+#defineMMC_LOCK_DESTROY(_sc)   mtx_destroy(&(_sc)->sc_mtx);
+#defineMMC_ASSERT_LOCKED(_sc)  mtx_assert(&(_sc)->sc_mtx, MA_OWNED);
+#defineMMC_ASSERT_UNLOCKED(_sc) mtx_assert(&(_sc)->sc_mtx, 
MA_NOTOWNED);
 
 static int mmc_all_send_cid(struct mmc_softc *sc, uint32_t *rawcid);
 static void mmc_app_decode_scr(uint32_t *raw_scr, struct mmc_scr *scr);
@@ -744,9 +745,9 @@ mmc_set_card_bus_width(struct mmc_softc 
 static int
 mmc_set_timing(struct mmc_softc *sc, int timing)
 {
+   u_char switch_res[64];
int err;
uint8_t value;
-   u_char switch_res[64];
 
switch (timing) {
case bus_timing_normal:
@@ -1161,9 +1162,9 @@ mmc_app_send_scr(struct mmc_softc *sc, u
 static int
 mmc_send_ext_csd(struct mmc_softc *sc, uint8_t *rawextcsd)
 {
-   int err;
struct mmc_command cmd;
struct mmc_data data;
+   int err;
 
memset(, 0, sizeof(cmd));
memset(, 0, sizeof(data));
@@ -1185,9 +1186,9 @@ mmc_send_ext_csd(struct mmc_softc *sc, u
 static int
 mmc_app_sd_status(struct mmc_softc *sc, uint16_t rca, uint32_t *rawsdstatus)
 {
-   int err, i;
struct mmc_command cmd;
struct mmc_data data;
+   int err, i;
 
memset(, 0, sizeof(cmd));
memset(, 0, sizeof(data));
@@ -1393,7 +1394,7 @@ mmc_discover_cards(struct mmc_softc *sc)
 * commands, although the state tables / diagrams in the
 * standard suggest they go back to the transfer state.
 * Other cards don't become deselected, and if we
-* atttempt to blindly re-select them, we get timeout
+* attempt to blindly re-select them, we get timeout
 * errors from some controllers.  So we deselect then
 * reselect to handle all situations.  The only thing we
 * use from the sd_status is the erase sector size, but
@@ -1534,7 +1535,7 @@ mmc_discover_cards(struct mmc_softc *sc)
 static void
 mmc_rescan_cards(struct mmc_softc *sc)
 {
-   struct mmc_ivars *ivar = NULL;
+   struct mmc_ivars *ivar;
device_t *devlist;
int err, i, devcount;
 
@@ -1664,14 +1665,13 @@ mmc_go_discovery(struct mmc_softc *sc)
 static int
 mmc_calculate_clock(struct mmc_softc *sc)
 {
-   int max_dtr, max_hs_dtr, max_timing;
-   int nkid, i, f_max;
device_t *kids;
struct mmc_ivars *ivar;
+   int i, f_max, max_dtr, max_hs_dtr, max_timing, nkid;
 
f_max = mmcbr_get_f_max(sc->dev);
max_dtr = max_hs_dtr = f_max;
-   if ((mmcbr_get_caps(sc->dev) & MMC_CAP_HSPEED))
+   if (mmcbr_get_caps(sc->dev) & MMC_CAP_HSPEED)
max_timing = bus_timing_hs;
else

svn commit: r313249 - head/sys/vm

2017-02-04 Thread Konstantin Belousov
Author: kib
Date: Sat Feb  4 19:16:19 2017
New Revision: 313249
URL: https://svnweb.freebsd.org/changeset/base/313249

Log:
  Style, use tab after #define.
  
  Reviewed by:  alc
  Sponsored by: The FreeBSD Foundation
  MFC after:3 days

Modified:
  head/sys/vm/vm_object.h

Modified: head/sys/vm/vm_object.h
==
--- head/sys/vm/vm_object.h Sat Feb  4 18:25:09 2017(r313248)
+++ head/sys/vm/vm_object.h Sat Feb  4 19:16:19 2017(r313249)
@@ -183,8 +183,8 @@ struct vm_object {
 #defineOBJ_DISCONNECTWNT 0x4000/* disconnect from vnode wanted 
*/
 #defineOBJ_TMPFS   0x8000  /* has tmpfs vnode allocated */
 
-#define IDX_TO_OFF(idx) (((vm_ooffset_t)(idx)) << PAGE_SHIFT)
-#define OFF_TO_IDX(off) ((vm_pindex_t)(((vm_ooffset_t)(off)) >> PAGE_SHIFT))
+#defineIDX_TO_OFF(idx) (((vm_ooffset_t)(idx)) << PAGE_SHIFT)
+#defineOFF_TO_IDX(off) ((vm_pindex_t)(((vm_ooffset_t)(off)) >> 
PAGE_SHIFT))
 
 #ifdef _KERNEL
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313248 - head/sys/net

2017-02-04 Thread Sean Bruno
Author: sbruno
Date: Sat Feb  4 18:25:09 2017
New Revision: 313248
URL: https://svnweb.freebsd.org/changeset/base/313248

Log:
  Delete duplicate break.

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cSat Feb  4 18:20:07 2017(r313247)
+++ head/sys/net/iflib.cSat Feb  4 18:25:09 2017(r313248)
@@ -3422,8 +3422,6 @@ iflib_if_ioctl(if_t ifp, u_long command,
ctx->ifc_if_flags = if_getflags(ifp);
CTX_UNLOCK(ctx);
break;
-
-   break;
case SIOCADDMULTI:
case SIOCDELMULTI:
if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313246 - vendor/NetBSD/tests/02.04.2017_10.12

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 18:13:15 2017
New Revision: 313246
URL: https://svnweb.freebsd.org/changeset/base/313246

Log:
  Copy ^/vendor/NetBSD/tests/dist to ^/vendor/NetBSD/tests/02.04.2017_10.12

Added:
  vendor/NetBSD/tests/02.04.2017_10.12/
 - copied from r313245, vendor/NetBSD/tests/dist/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313245 - in vendor/NetBSD/tests/dist: dev/audio fs/vfs kernel lib/libm net/bpf net/if

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 18:11:48 2017
New Revision: 313245
URL: https://svnweb.freebsd.org/changeset/base/313245

Log:
  Pull in some minor updates to netbsd-tests from upstream

Added:
  vendor/NetBSD/tests/dist/fs/vfs/t_mtime_otrunc.c   (contents, props changed)
  vendor/NetBSD/tests/dist/fs/vfs/t_rwtoro.c   (contents, props changed)
Modified:
  vendor/NetBSD/tests/dist/dev/audio/t_pad_output.bz2.uue
  vendor/NetBSD/tests/dist/kernel/t_ptrace_wait.c
  vendor/NetBSD/tests/dist/lib/libm/t_pow.c
  vendor/NetBSD/tests/dist/net/bpf/t_bpf.c
  vendor/NetBSD/tests/dist/net/if/t_ifconfig.sh

Modified: vendor/NetBSD/tests/dist/dev/audio/t_pad_output.bz2.uue
==
--- vendor/NetBSD/tests/dist/dev/audio/t_pad_output.bz2.uue Sat Feb  4 
18:06:09 2017(r313244)
+++ vendor/NetBSD/tests/dist/dev/audio/t_pad_output.bz2.uue Sat Feb  4 
18:11:48 2017(r313245)
@@ -1,1040 +1,1035 @@
 begin 644 t_pad_output.bz2
-M0EIH.3%!629360S39`>;SS,K;%2@`2::%N=I
-MVR86:*KOO>O99MMM-XP&76N]W/6T=[SW@<[G'3H:Z'K1F?=WON]WO>]S=WN^
-ML]W>^WN[[W;V\VW>[OMN^WW;;3+3/=TK*Y5E4LVE#-E5H:"S530#1IB5LS:V
-MJHK6!JVA2M9LR*V:MFUJ55JBM:Q4*EL,5$`50)L6M11:P55:V%+55:U5C!I3
-M1L,BU5-5JV-%F55-5EL;:@5:K+%5:S--;5-;:M5MJVZZ[:V]>[:7NTN>][;>
-M[O/MO-M[NYOM]WN^[K69ON\^][WO(Q/N8ZZ![N''=O3VP[V/>RCRX[0VJ7FW
-M-FQJ%7-G0R;9MB*N\G'>PTM*5H%``-LF2NKF=-LQFU*50444`446P`
-MUE17-HDJB[#--!MBC$-1L#;!MF@JALFIM-IE3-30"JH#2D`$`!,F$R83(830
-M--,AD!H`R#$9`:`Q-`,":8)D8C`3)@FF":8@P"9,$,"&)D#0)@$
-MD$TPF@`)@```-`"8`)@"8F$R8`F3$`)@`:@),R83":8$Q---,"8"8(
-M,:1D#!,H--)2:$$VF##`"#329,1A-!,Q$:F)A-#$-3TT4>F4]">IZ0#3:@
-MVC4#`-(/4#3T@#30&@/1/1#0#1D``#$-!HR:-!)I2E$H&3TVPVH\BE/QIHC1
-M3,34T4]IE-I0WD4?IJ33T0`R:`9!IM0(`!HT@`&@``
-M``TI$#1IHIFU,F`T:F*>"G@$F:3TP"-3T9&"*/3"3R,33)I/":(T&(T
-M4\T-`GIDR-,$T:GIJ>1B831II/(\C4S(::8F)HU-02:E)*!#5/%/>V,B-H
-MB&"-#(TF(Q38BFVE3_48AM!-(]4_*GJ:>4>-4V*'IIE/RFIY-3RFU#$S4WJA
-MH](](]::/1/4:>IZFF:0/2!DVIZAH-J9`>4!H:?.1!_\Q4%G*&;V=R9PT='B<1$&>Y2K7;'1?;`L!0$`X6":FH$!$6!]N]*1&
-M`>)4`P7%5$G@V]E5TZFK&($]>M7]W^OSGV?[[OM^+/=V,U7MZH"`7P^J9Y.4XK0O)T]ML=,$]>C2&`+KJIP7B%-.A(A^%=L6PJT7:EU$"\C_*-.JQ+2^W+*<`+
-M[7C@ULW[I"-T:`@7%]:`B#,.N],:_+:SN\[:H0"]MG;I((-):D9I@
-MEY+M.9\`=/Z'Y5'G)UUBI`$7\=-,6\WB0M^K1(IGM("()_S^%H$,(T:^:
-MUJXAFG+?)LZ=2(B>DJ4`+\#0+:GW.!F9[Y0"67\4D'5N=?C<2IH"`B?%D\H0
-MGG&E/!&")G6)];))G]L??MF>!#;?]*:P<1'/-^\77VA0`%Z]R
-ME-$,ZC*8W\V[=O*,`"`LNLU]SC!;I4"KG=/S#X!?7Y]N/BU*2;"=,Y6JXJ7(
-M\0$Q,LORY367(RS2IZ5>L>\@(%\(7%0'&:-KRF&'2:+-/TMFDH`&<+FRQ]
-M2/+>LL58^19Q"!7L,11[)RREOK.2B(B\T[XU`#;W%RR(G[K(5$X17%G>A!
-M5%N-\(U<88J#4CQIX2R!95"Z:FJFOLXD$6)JV@!^C#B[K7^`23@`L#R4AD93YM`Q3];.J--PN6QM[K)JH
-M(O;C-[U@O)%QFS:U:_'AEV+O+ML-FTP(.3(!E'S>H'.(0@#>MJ$"'FJI*?4K
-MJ(^8_>2M:QGP"F_OWH5:].!EVM>UB'TW=R@(I#\VT2P%KT]_6]DV]DSX*:$B
-M$\P$5TX-N@FLFP9/6Z#(]F)2R!;.(FW!F6.80[RE%T=?O6H/*`%S(]JQ[
-MR7,>5IA__C[WLV",$5K/Y3CA9I<=R)5=2;=$"#3;X4$!A3SS<4MFG&3LO
-M(C(AK8$A:MCVU5]2F6(!3!"(X/?9Y:@`ZT))M.B\B78]MY1`BX"?4#9]!56Z
-M)(%K(4E%,HP1?M]'(C@/O^H")>Y@?.?#9A!9W#]194/2$B@/0R$+"9F]7%,
-M*1BYC`#LQ@*O)X;[/:@Q((+?>_Z#+K*>EX6<1R+?T&:\=DJ!\#0UPA_,^E
-MKZ<2Y.D"5H,L:04L5`\;Q^3FH0!$N<-%2!`?/ZS>I:''+V&_V'MP$I)`W;W0
-M<("[Y"-384_['P.#[FK55I#5ZVMM[DH!4-F!?_"G;WQ+<>IO:.A1D`8W/]@0M8>%BW/(+<-+N=9T(HE
-M8\PHC>;Y(&31@"8(L>$>5^/YP&:Y@'%$18BM3_NBBG3?7>!ZKL^1-#L?/
-MI`_+Y/!HD`*"]TF31QJ9YV"1#B\R/?U",@5[-@I;.4&_W%90)LS8U+
-M`,#YI0(2X6ML1-K;[$WRF]A\#Y!IMEPB$/?B%:LF@SS8@#$1(96`NH:/6&-`
-M!:=-[T<("%]0_N*VT8X/5G4]+'5W>2@57]UECJP$[[:29VK4&^<0`O3I=VF?
-MKR@)6"J[:JVG6:T`(X0_F^G'Y[@#IX#*^6`L@0>X[PUGR@1M8?GK+(:KI
-M_U,(@U>K55\YIW+R5A#A_I*4^UE*=FQJ$`;GLX^GP`%VFAMHQLA
-MVW-FEG)_<:*\3(P705=2"A.U_T1]?;OU(#\LK5$7LA$\:N3_/7'@3_L2$4!K
-MJ6$S1,[?R[77H`%;Q,<;P<]WB#C?6PY9\/V7UF*!4\2`M<&]Z=&$0`^[XVX`
-MP>#"!:ZO,V=QZ_BB!8WP5-F0XF%^[*`J8WXH"<]L!5-)?B8P\`,YVUF%`M%7EW:-*$+>N64?@;#
-M6+FLFTL@'_E2321+T;G=ZYGMTB0'"&+[8**(!6Z&96X#]H(:2NZ%,2"$GFN,
-M1!^?3G/A^`L*^I@/+HZ6G:DLBAZ_E30+MJ_"3C6J2\[8"57T0*Q`"%5OI.Y.
-M:BNS[E[K4@%]-&1?WDI(=$YDICRZ]&1/M.`*SX?V1W6>I79`5A)E)=C
-MC=S#.CUY].X/Z]T\1.%B=8L[(9KD:Y=]^`D`AJ=I:%X(.1-A<7W`!S-]'$IU
-M%-,2`BN_0O@K[OJ'6R\VPY5,3$:,BZ"HE]\AB;53X3@H[X^"Q3E2>4%#6-2:
-M>^%"

svn commit: r313243 - in stable/11: crypto/openssh secure/usr.sbin/sshd

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 17:26:28 2017
New Revision: 313243
URL: https://svnweb.freebsd.org/changeset/base/313243

Log:
  MFC r311585:
  
  Conditionalize building libwrap support into sshd
  
  Only build libwrap support into sshd if MK_TCP_WRAPPERS != no
  
  This will unbreak the build if libwrap has been removed from the system
  
  PR:   210141

Modified:
  stable/11/crypto/openssh/config.h
  stable/11/secure/usr.sbin/sshd/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/crypto/openssh/config.h
==
--- stable/11/crypto/openssh/config.h   Sat Feb  4 17:21:17 2017
(r313242)
+++ stable/11/crypto/openssh/config.h   Sat Feb  4 17:26:28 2017
(r313243)
@@ -1408,7 +1408,7 @@
 /* #undef LASTLOG_WRITE_PUTUTXLINE */
 
 /* Define if you want TCP Wrappers support */
-#define LIBWRAP 1
+/* #undef LIBWRAP */
 
 /* Define to whatever link() returns for "not supported" if it doesn't return
EOPNOTSUPP. */

Modified: stable/11/secure/usr.sbin/sshd/Makefile
==
--- stable/11/secure/usr.sbin/sshd/Makefile Sat Feb  4 17:21:17 2017
(r313242)
+++ stable/11/secure/usr.sbin/sshd/Makefile Sat Feb  4 17:26:28 2017
(r313243)
@@ -27,7 +27,7 @@ CFLAGS+=-I${SSHDIR} -include ssh_namespa
 SRCS+= ssh_namespace.h
 
 # pam should always happen before ssh here for static linking
-LIBADD=pam ssh util wrap
+LIBADD=pam ssh util
 
 .if ${MK_LDNS} != "no"
 CFLAGS+=   -DHAVE_LDNS=1
@@ -53,6 +53,11 @@ SRCS+=   krb5_config.h
 LIBADD+=   gssapi_krb5 gssapi krb5
 .endif
 
+.if ${MK_TCP_WRAPPERS} != "no"
+CFLAGS+=   -DLIBWRAP
+LIBADD+=   wrap
+.endif
+
 LIBADD+=   crypto
 
 .if defined(LOCALBASE)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313242 - in stable/11: . usr.sbin/bsnmpd/tools usr.sbin/bsnmpd/tools/bsnmptools usr.sbin/bsnmpd/tools/libbsnmptools

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 17:21:17 2017
New Revision: 313242
URL: https://svnweb.freebsd.org/changeset/base/313242

Log:
  MFC r311174:
  
  Make /usr/lib/libbsnmptools.so.0 into an INTERRNALLIB
  
  Although it increases the size of the bsnmp{get,set,walk} binaries by
  four on my [amd64] system, it removes the need for producing .debug
  files, profiled libraries, and for installing the library itself,
  reducing the overall size use on disk by the utilities noted
  previously.
  
  Plus, it guards against ABI/API compatibility issues with the library
  as it's only used internal to the tools themselves.

Modified:
  stable/11/ObsoleteFiles.inc
  stable/11/usr.sbin/bsnmpd/tools/Makefile
  stable/11/usr.sbin/bsnmpd/tools/bsnmptools/Makefile
  stable/11/usr.sbin/bsnmpd/tools/libbsnmptools/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/ObsoleteFiles.inc
==
--- stable/11/ObsoleteFiles.inc Sat Feb  4 17:18:49 2017(r313241)
+++ stable/11/ObsoleteFiles.inc Sat Feb  4 17:21:17 2017(r313242)
@@ -38,6 +38,11 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20170103: libbsnmptools.so made into an INTERNALLIB
+OLD_FILES+=usr/lib/libbsnmptools.a
+OLD_FILES+=usr/lib/libbsnmptools_p.a
+OLD_LIBS+=usr/lib/libbsnmptools.so.0
+OLD_LIBS+=usr/lib/libbsnmptools.so
 # 20170112: sysdecode_getfsstat_flags() renamed to sysdecode_getfsstat_mode()
 OLD_FILES+=usr/share/man/man3/sysdecode_getfsstat_flags.3.gz
 # 20161229: Three files from gnop tests consolidated into one

Modified: stable/11/usr.sbin/bsnmpd/tools/Makefile
==
--- stable/11/usr.sbin/bsnmpd/tools/MakefileSat Feb  4 17:18:49 2017
(r313241)
+++ stable/11/usr.sbin/bsnmpd/tools/MakefileSat Feb  4 17:21:17 2017
(r313242)
@@ -4,4 +4,8 @@
 SUBDIR=libbsnmptools \
bsnmptools
 
+SUBDIR_DEPEND_bsnmptools=  libbsnmptools
+
+SUBDIR_PARALLEL=
+
 .include 

Modified: stable/11/usr.sbin/bsnmpd/tools/bsnmptools/Makefile
==
--- stable/11/usr.sbin/bsnmpd/tools/bsnmptools/Makefile Sat Feb  4 17:18:49 
2017(r313241)
+++ stable/11/usr.sbin/bsnmpd/tools/bsnmptools/Makefile Sat Feb  4 17:21:17 
2017(r313242)
@@ -8,7 +8,9 @@
 PROG=  bsnmpget
 
 LIBADD=bsnmp bsnmptools
-CFLAGS+=   -I${.CURDIR}/../libbsnmptools
+
+CFLAGS+=   -I${.CURDIR:H}/libbsnmptools
+LDFLAGS+=  -L${.OBJDIR:H}/libbsnmptools
 
 LINKS=  ${BINDIR}/bsnmpget ${BINDIR}/bsnmpwalk
 LINKS+=  ${BINDIR}/bsnmpget ${BINDIR}/bsnmpset

Modified: stable/11/usr.sbin/bsnmpd/tools/libbsnmptools/Makefile
==
--- stable/11/usr.sbin/bsnmpd/tools/libbsnmptools/Makefile  Sat Feb  4 
17:18:49 2017(r313241)
+++ stable/11/usr.sbin/bsnmpd/tools/libbsnmptools/Makefile  Sat Feb  4 
17:21:17 2017(r313242)
@@ -5,9 +5,9 @@
 .PATH: ${.CURDIR}
 
 LIB=   bsnmptools
-#INTERNALLIB=
+
 SRCS=  bsnmpimport.c bsnmpmap.c bsnmptools.c bsnmptc.c
 
-SHLIB_MAJOR=   0
+INTERNALLIB=
 
 .include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313241 - stable/11/contrib/bsnmp/snmp_usm

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 17:18:49 2017
New Revision: 313241
URL: https://svnweb.freebsd.org/changeset/base/313241

Log:
  MFC r311394:
  
  op_usm_users: don't deref uusers if it's NULL when SETting the value
  
  Add an XXX comment to note that the conditional seems suspect given
  how it's handled elsewhere in the SNMP_OP_SET case.
  
  CID:  1008573

Modified:
  stable/11/contrib/bsnmp/snmp_usm/usm_snmp.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/bsnmp/snmp_usm/usm_snmp.c
==
--- stable/11/contrib/bsnmp/snmp_usm/usm_snmp.c Sat Feb  4 17:17:38 2017
(r313240)
+++ stable/11/contrib/bsnmp/snmp_usm/usm_snmp.c Sat Feb  4 17:18:49 2017
(r313241)
@@ -169,8 +169,12 @@ op_usm_users(struct snmp_context *ctx, s
val->var.subs[sub - 1] != LEAF_usmUserCloneFrom)
return (SNMP_ERR_NOSUCHNAME);
 
+   /*
+* XXX (ngie): need to investigate the MIB to determine how
+* this is possible given some of the transitions below.
+*/
if (community != COMM_INITIALIZE &&
-   uuser->type == StorageType_readOnly)
+   uuser != NULL && uuser->type == StorageType_readOnly)
return (SNMP_ERR_NOT_WRITEABLE);
 
switch (val->var.subs[sub - 1]) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313240 - in stable/11/lib/libc: . arm/aeabi capability gdtoa gen iconv md posix1e regex/grot resolv stdlib/jemalloc stdtime string sys

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 17:17:38 2017
New Revision: 313240
URL: https://svnweb.freebsd.org/changeset/base/313240

Log:
  MFC r312332,r312446,r312451:
  
  r312332:
  
  Use SRCTOP where possible and use :H to manipulate .CURDIR to get rid of
  unnecessarily long relative path .PATH values with make
  
  r312446 (by emaste):
  
  libc: remove reference to nonexistent lib/locale directory
  
  As far as I can tell this was introduced in r72406 and updated in several
  subsequent revisions, but the lib/locale directory it referenced never
  existed.
  
  r312451:
  
  Replace dot-dot relative pathing with SRCTOP-relative paths where possible
  
  This reduces build output, need for recalculating paths, and makes it clearer
  which paths are relative to what areas in the source tree. The change in
  performance over a locally mounted UFS filesystem was negligible in my 
testing,
  but this may more positively impact other filesystems like NFS.
  
  LIBC_SRCTOP was left alone so Juniper (and other users) can continue to
  manipulate lib/libc/Makefile (and other Makefile.inc's under lib/libc) as
  include Makefiles with custom options.
  
  Discussed with:   marcel, sjg

Modified:
  stable/11/lib/libc/Makefile
  stable/11/lib/libc/arm/aeabi/Makefile.inc
  stable/11/lib/libc/capability/Makefile.inc
  stable/11/lib/libc/gdtoa/Makefile.inc
  stable/11/lib/libc/gen/Makefile.inc
  stable/11/lib/libc/iconv/Makefile.inc
  stable/11/lib/libc/md/Makefile.inc
  stable/11/lib/libc/posix1e/Makefile.inc
  stable/11/lib/libc/regex/grot/Makefile
  stable/11/lib/libc/resolv/Makefile.inc
  stable/11/lib/libc/stdlib/jemalloc/Makefile.inc
  stable/11/lib/libc/stdtime/Makefile.inc
  stable/11/lib/libc/string/Makefile.inc
  stable/11/lib/libc/sys/Makefile.inc
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/libc/Makefile
==
--- stable/11/lib/libc/Makefile Sat Feb  4 17:10:19 2017(r313239)
+++ stable/11/lib/libc/Makefile Sat Feb  4 17:17:38 2017(r313240)
@@ -32,7 +32,7 @@ SHLIB_MAJOR= 7
 SHLIB_LDSCRIPT=libc.ldscript
 SHLIB_LDSCRIPT_LINKS=libxnet.so
 WARNS?=2
-CFLAGS+=-I${LIBC_SRCTOP}/include -I${LIBC_SRCTOP}/../../include
+CFLAGS+=-I${LIBC_SRCTOP}/include -I${SRCTOP}/include
 CFLAGS+=-I${LIBC_SRCTOP}/${LIBC_ARCH}
 .if ${MK_NLS} != "no"
 CFLAGS+=-DNLS

Modified: stable/11/lib/libc/arm/aeabi/Makefile.inc
==
--- stable/11/lib/libc/arm/aeabi/Makefile.inc   Sat Feb  4 17:10:19 2017
(r313239)
+++ stable/11/lib/libc/arm/aeabi/Makefile.inc   Sat Feb  4 17:17:38 2017
(r313240)
@@ -21,7 +21,7 @@ SRCS+=aeabi_vfp_double.S  \
 # libc. This causes issues when other parts of libc call these functions.
 # We work around this by including these functions in libc but mark them as
 # hidden so users of libc will not pick up these versions.
-.PATH: ${LIBC_SRCTOP}/../../contrib/compiler-rt/lib/builtins/arm
+.PATH: ${SRCTOP}/contrib/compiler-rt/lib/builtins/arm
 
 SRCS+= aeabi_memcmp.S  \
aeabi_memcpy.S  \

Modified: stable/11/lib/libc/capability/Makefile.inc
==
--- stable/11/lib/libc/capability/Makefile.inc  Sat Feb  4 17:10:19 2017
(r313239)
+++ stable/11/lib/libc/capability/Makefile.inc  Sat Feb  4 17:17:38 2017
(r313240)
@@ -1,7 +1,7 @@
 # $FreeBSD$
 
 # capability sources
-.PATH: ${LIBC_SRCTOP}/../../sys/kern ${LIBC_SRCTOP}/capability
+.PATH: ${SRCTOP}/sys/kern ${LIBC_SRCTOP}/capability
 
 SRCS+= subr_capability.c
 

Modified: stable/11/lib/libc/gdtoa/Makefile.inc
==
--- stable/11/lib/libc/gdtoa/Makefile.inc   Sat Feb  4 17:10:19 2017
(r313239)
+++ stable/11/lib/libc/gdtoa/Makefile.inc   Sat Feb  4 17:17:38 2017
(r313240)
@@ -10,11 +10,11 @@ GDTOASRCS+=dmisc.c dtoa.c gdtoa.c gethex
 
 SYM_MAPS+=${LIBC_SRCTOP}/gdtoa/Symbol.map
 
-CFLAGS+=-I${LIBC_SRCTOP}/../../contrib/gdtoa
+CFLAGS+=-I${SRCTOP}/contrib/gdtoa
 
 .for src in ${GDTOASRCS}
 MISRCS+=gdtoa_${src}
 CLEANFILES+=gdtoa_${src}
-gdtoa_${src}: ${LIBC_SRCTOP}/../../contrib/gdtoa/${src} .NOMETA
+gdtoa_${src}: ${SRCTOP}/contrib/gdtoa/${src} .NOMETA
ln -sf ${.ALLSRC} ${.TARGET}
 .endfor

Modified: stable/11/lib/libc/gen/Makefile.inc
==
--- stable/11/lib/libc/gen/Makefile.inc Sat Feb  4 17:10:19 2017
(r313239)
+++ stable/11/lib/libc/gen/Makefile.inc Sat Feb  4 17:17:38 2017
(r313240)
@@ -150,11 +150,11 @@ SRCS+=fts-compat.c \
unvis-compat.c
 .endif
 
-.PATH: ${LIBC_SRCTOP}/../../contrib/libc-pwcache
+.PATH: ${SRCTOP}/contrib/libc-pwcache
 SRCS+= pwcache.c pwcache.h
 
-.PATH: ${LIBC_SRCTOP}/../../contrib/libc-vis
-CFLAGS+=   

svn commit: r313239 - in stable/11: share/mk usr.sbin/bsnmpd/modules usr.sbin/bsnmpd/modules/snmp_hostres usr.sbin/bsnmpd/modules/snmp_mibII

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 17:10:19 2017
New Revision: 313239
URL: https://svnweb.freebsd.org/changeset/base/313239

Log:
  MFC r311744,r312328,r312329,r312330:
  
  r311744:
  
  Document bsd.snmpmod.mk from a high-level
  
  r312328:
  
  Add a make target (smilint) for running smilint tool against BMIBS
  
  Running smilint against MIB definitions is useful in finding
  functional problems with MIB definitions/descriptions.
  
  This is inspired by the smilint targets defined in
  usr.sbin/bsnmpd/modules/{snmp_hostres,snmp_mibII}/Makefile
  
  Document all of the variables that are involved in running the
  smilint target, as well as all of the prerequisites to running
  it.
  
  r312329:
  
  Remove ad hoc smilint targets made standard in bsd.snmpmod.mk in r312328
  
  r312330:
  
  Add smilint target to subdir targets so "make smilint" here will run
  the smilint target in subdirs
  
  While here, convert a path that's .CURDIR relative to SRCTOP

Modified:
  stable/11/share/mk/bsd.README
  stable/11/share/mk/bsd.snmpmod.mk
  stable/11/usr.sbin/bsnmpd/modules/Makefile
  stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile
  stable/11/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/mk/bsd.README
==
--- stable/11/share/mk/bsd.README   Sat Feb  4 17:08:21 2017
(r313238)
+++ stable/11/share/mk/bsd.README   Sat Feb  4 17:10:19 2017
(r313239)
@@ -410,6 +410,82 @@ If foo has multiple source files, add th
 
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
+The include file, , handles building MIB modules for bsnmpd
+from one or more source files, along with their manual pages.  It has a
+limited number of suffixes, consistent with the current needs of the BSD
+tree.
+
+bsd.snmpmod.mk leverages bsd.lib.mk for building MIB modules and
+bsd.files.mk for installing MIB description and definition files.
+
+It implements the following additional targets:
+
+   smilint:
+   execute smilint on the MIBs defined by BMIBS.
+
+   The net-mgmt/libsmi package must be installed before
+   executing this target. The net-mgmt/net-snmp package
+   should be installed as well to reduce false positives
+   from smilint.
+
+It sets/uses the following variables:
+
+BMIBS  The MIB definitions to install.
+
+BMIBSDIR   The directory where the MIB definitions are installed.
+   This defaults to `${SHAREDIR}/snmp/mibs`.
+
+DEFS   The MIB description files to install.
+
+DEFSDIRThe directory where MIB description files are installed.
+   This defaults to `${SHAREDIR}/snmp/defs`.
+
+EXTRAMIBDEFS   Extra MIB description files to use as input when
+   generating ${MOD}_oid.h and ${MOD}_tree.[ch].
+
+EXTRAMIBSYMS   Extra MIB definition files used only for extracting
+   symbols.
+
+   EXTRAMIBSYMS are useful when resolving inter-module
+   dependencies and are useful with files containing only
+   enum-definitions.
+
+   See ${MOD}_oid.h for more details.
+
+LOCALBASE  The package root where smilint and the net-snmp
+   definitions can be found
+
+MODThe bsnmpd module name.
+
+SMILINTsmilint binary to use with the smilint make target.
+
+SMILINT_FLAGS  flags to pass to smilint.
+
+SMIPATHA colon-separated directory path where MIBs definitions
+   can be found. See "SMIPATH" in smi_config for more
+   details.
+
+XSYM   MIB names to extract symbols for. See ${MOD}_oid.h for
+   more details.
+
+It generates the following files:
+
+${MOD}_tree.c  A source file and header which programmatically describes
+${MOD}_tree.h  the MIB (type, OID name, ACCESS attributes, etc).
+
+   The files are generated via "gensnmptree -p".
+
+   See gensnmptree(1) for more details.
+
+${MOD}_oid.h   A header which programmatically describes the MIB root and
+   MIB tables.
+
+   The files are generated via "gensnmptree -e".
+
+   See gensnmptree(1) for more details.
+
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
 The include file  contains the default targets for building
 subdirectories.  It has the same seven targets as : all, clean,
 cleandir, depend, install, lint, and tags.  For all of the directories

Modified: stable/11/share/mk/bsd.snmpmod.mk
==
--- stable/11/share/mk/bsd.snmpmod.mk   Sat Feb  4 17:08:21 2017
(r313238)
+++ stable/11/share/mk/bsd.snmpmod.mk   Sat Feb  4 17:10:19 2017
(r313239)
@@ -25,4 +25,18 @@ FILESGROUPS+=BMIBS
 BMIBSDIR?= 

svn commit: r313238 - stable/11/etc

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 17:08:21 2017
New Revision: 313238
URL: https://svnweb.freebsd.org/changeset/base/313238

Log:
  MFC r310467:
  
  Provide some guidance when dealing with sections and variables contained
  within them
  
  For example, using variables designated for %usm requires uncommenting
  %usm section header

Modified:
  stable/11/etc/snmpd.config
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/etc/snmpd.config
==
--- stable/11/etc/snmpd.config  Sat Feb  4 17:06:51 2017(r313237)
+++ stable/11/etc/snmpd.config  Sat Feb  4 17:08:21 2017(r313238)
@@ -116,6 +116,14 @@ snmpEnableAuthenTraps = 2
 # modules
 
 #
+# Control configuration for the modules in the module specific sections, e.g.
+# the "usm" module (begemotSnmpdModulePath."usm") can be controlled in the
+# %usm specific section. You must uncomment the section specific header in
+# order to use the enclosed variables, e.g. `usmUserStatus.$(engine).$(user1)`
+# can only be used if %usm is uncommented.
+#
+
+#
 # Bridge module
 #  This requires the mibII module.
 #
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313237 - stable/11/lib/msun/tests

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 17:06:51 2017
New Revision: 313237
URL: https://svnweb.freebsd.org/changeset/base/313237

Log:
  MFC r303841,r312012,r312213:
  
  r303841 (by bdrewery):
  
  Revert r298434 which should be fixed by r301287, r301394, and r301403.
  
  PR:   208703, 208963
  
  r312012:
  
  fmaxmin_test still fails with clang 3.9.x.. bypass the test
  
  PR:   208703
  
  r312213:
  
  Turn COMPILER_VERSION/COMPILER_TYPE make check into a compile-time check
  of the clang version
  
  This works around breakage on ^/stable/10 when running installworld from
  a ^/stable/10 host where the test wouldn't be compiled on the first
  go-around and would be missing when make installworld is run.
  
  PR:   208703

Modified:
  stable/11/lib/msun/tests/Makefile
  stable/11/lib/msun/tests/fmaxmin_test.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/msun/tests/Makefile
==
--- stable/11/lib/msun/tests/Makefile   Sat Feb  4 17:02:54 2017
(r313236)
+++ stable/11/lib/msun/tests/Makefile   Sat Feb  4 17:06:51 2017
(r313237)
@@ -52,16 +52,7 @@ TAP_TESTS_C+=ctrig_test
 TAP_TESTS_C+=  exponential_test
 TAP_TESTS_C+=  fenv_test
 TAP_TESTS_C+=  fma_test
-# clang 3.8.0 fails always fails this test. See: bug 208703
-#
-# XXX: depending on this compiler version check doesn't work at
-# buildworld/installworld time, which results in jenkins failures (bug 208963)
-# because the build is run on a 10.x instance, which has an older clang
-# compiler.
-#
-#.if ! (${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} == 30800)
-#TAP_TESTS_C+= fmaxmin_test
-#.endif
+TAP_TESTS_C+=  fmaxmin_test
 TAP_TESTS_C+=  ilogb_test
 TAP_TESTS_C+=  invtrig_test
 TAP_TESTS_C+=  invctrig_test

Modified: stable/11/lib/msun/tests/fmaxmin_test.c
==
--- stable/11/lib/msun/tests/fmaxmin_test.c Sat Feb  4 17:02:54 2017
(r313236)
+++ stable/11/lib/msun/tests/fmaxmin_test.c Sat Feb  4 17:06:51 2017
(r313237)
@@ -86,6 +86,8 @@ testall_r(long double big, long double s
return (ok);
 }
 
+const char *comment = NULL;
+
 /*
  * Test all the functions: fmaxf, fmax, fmaxl, fminf, fmin, and fminl,
  * in all rounding modes and with the arguments in different orders.
@@ -107,10 +109,17 @@ testall(int testnum, long double big, lo
break;
}
}
-   printf("%sok %d - big = %.20Lg, small = %.20Lg\n",
-  (i == 4) ? "" : "not ", testnum, big, small);
+   printf("%sok %d - big = %.20Lg, small = %.20Lg%s\n",
+  (i == 4) ? "" : "not ", testnum, big, small,
+  comment == NULL ? "" : comment);
 }
 
+/* Clang 3.8.0+ fails the invariants for testcase 6, 7, 10, and 11. */
+#if defined(__clang__) && \
+(__clang_major__ >= 3 && __clang_minor__ >= 8 && __clang_patchlevel__ >= 0)
+#defineaffected_by_bug_208703
+#endif
+
 int
 main(int argc, char *argv[])
 {
@@ -122,15 +131,23 @@ main(int argc, char *argv[])
testall(3, nextafterf(42.0, INFINITY), 42.0);
testall(4, -5.0, -5.0);
testall(5, -3.0, -4.0);
+#ifdef affected_by_bug_208703
+   comment = "# TODO: testcase 6-7 fails invariant with clang 3.8+ (bug 
208703)";
+#endif
testall(6, 1.0, NAN);
testall(7, INFINITY, NAN);
+   comment = NULL;
testall(8, INFINITY, 1.0);
testall(9, -3.0, -INFINITY);
testall(10, 3.0, -INFINITY);
+#ifdef affected_by_bug_208703
+   comment = "# TODO: testcase 11-12 fails invariant with clang 3.8+ (bug 
208703)";
+#endif
testall(11, NAN, NAN);
 
/* This test isn't strictly required to work by C99. */
testall(12, 0.0, -0.0);
+   comment = NULL;
 
return (0);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313236 - stable/11/tests/sys

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 17:02:54 2017
New Revision: 313236
URL: https://svnweb.freebsd.org/changeset/base/313236

Log:
  MFC r312114:
  
  Enable WARNS?= 6 across all of tests/sys

Added:
  stable/11/tests/sys/Makefile.inc
 - copied unchanged from r312114, head/tests/sys/Makefile.inc
Modified:
Directory Properties:
  stable/11/   (props changed)

Copied: stable/11/tests/sys/Makefile.inc (from r312114, 
head/tests/sys/Makefile.inc)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/11/tests/sys/Makefile.incSat Feb  4 17:02:54 2017
(r313236, copy of r312114, head/tests/sys/Makefile.inc)
@@ -0,0 +1,3 @@
+# $FreeBSD$
+
+WARNS?=6
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313235 - stable/11/tests/sys/mac/bsdextended

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 17:01:53 2017
New Revision: 313235
URL: https://svnweb.freebsd.org/changeset/base/313235

Log:
  MFC r312120:
  
  Fix warnings
  
  - Staticize test_num
  - Promote i to size_t to deal with -Wsign-compare issues
  
  Tested with:  clang, gcc, gcc49

Modified:
  stable/11/tests/sys/mac/bsdextended/ugidfw_test.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/tests/sys/mac/bsdextended/ugidfw_test.c
==
--- stable/11/tests/sys/mac/bsdextended/ugidfw_test.c   Sat Feb  4 17:00:47 
2017(r313234)
+++ stable/11/tests/sys/mac/bsdextended/ugidfw_test.c   Sat Feb  4 17:01:53 
2017(r313235)
@@ -71,7 +71,7 @@ static const char *test_groups[] = {
"bin",
 };
 
-int test_num;
+static int test_num;
 
 /*
  * List of test strings that must go in (and come out) of libugidfw intact.
@@ -149,7 +149,8 @@ test_libugidfw_strings(void)
struct mac_bsdextended_rule rule;
char errorstr[256];
char rulestr[256];
-   int error, i;
+   size_t i;
+   int error;
 
for (i = 0; i < nitems(test_users); i++, test_num++) {
if (getpwnam(test_users[i]) == NULL)
@@ -171,7 +172,7 @@ test_libugidfw_strings(void)
error = bsde_parse_rule_string(test_strings[i], ,
sizeof(errorstr), errorstr);
if (error == -1)
-   printf("not ok %d # bsde_parse_rule_string: '%s' (%d) "
+   printf("not ok %d # bsde_parse_rule_string: '%s' (%zu) "
"failed: %s\n", test_num, test_strings[i], i, 
errorstr);
else
printf("ok %d\n", test_num);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313234 - in stable/10: crypto/openssh secure/usr.sbin/sshd

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 17:00:47 2017
New Revision: 313234
URL: https://svnweb.freebsd.org/changeset/base/313234

Log:
  MFC r311585:
  
  Conditionalize building libwrap support into sshd
  
  Only build libwrap support into sshd if MK_TCP_WRAPPERS != no
  
  This will unbreak the build if libwrap has been removed from the system
  
  PR:   210141

Modified:
  stable/10/crypto/openssh/config.h
  stable/10/secure/usr.sbin/sshd/Makefile
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/crypto/openssh/config.h
==
--- stable/10/crypto/openssh/config.h   Sat Feb  4 16:58:06 2017
(r313233)
+++ stable/10/crypto/openssh/config.h   Sat Feb  4 17:00:47 2017
(r313234)
@@ -1408,7 +1408,7 @@
 /* #undef LASTLOG_WRITE_PUTUTXLINE */
 
 /* Define if you want TCP Wrappers support */
-#define LIBWRAP 1
+/* #undef LIBWRAP */
 
 /* Define to whatever link() returns for "not supported" if it doesn't return
EOPNOTSUPP. */

Modified: stable/10/secure/usr.sbin/sshd/Makefile
==
--- stable/10/secure/usr.sbin/sshd/Makefile Sat Feb  4 16:58:06 2017
(r313233)
+++ stable/10/secure/usr.sbin/sshd/Makefile Sat Feb  4 17:00:47 2017
(r313234)
@@ -25,8 +25,8 @@ MAN=  sshd.8 sshd_config.5
 CFLAGS+=-I${SSHDIR} -include ssh_namespace.h
 SRCS+= ssh_namespace.h
 
-DPADD= ${LIBSSH} ${LIBUTIL} ${LIBWRAP} ${LIBPAM}
-LDADD= -lssh -lutil -lwrap ${MINUSLPAM}
+DPADD= ${LIBSSH} ${LIBUTIL} ${LIBPAM}
+LDADD= -lssh -lutil ${MINUSLPAM}
 USEPRIVATELIB= ssh
 
 .if ${MK_LDNS} != "no"
@@ -51,6 +51,12 @@ LDADD+=   -lgssapi_krb5 -lgssapi -lkrb5 -
-lcom_err -lroken -lwind -lheimbase -lheimipcc
 .endif
 
+.if ${MK_TCP_WRAPPERS} != "no"
+CFLAGS+=   -DLIBWRAP
+DPADD+=${LIBWRAP}
+LDADD+=-lwrap
+.endif
+
 DPADD+= ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ}
 LDADD+= -lcrypt -lcrypto -lz
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313233 - stable/11/tests/sys/vm

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 16:58:06 2017
New Revision: 313233
URL: https://svnweb.freebsd.org/changeset/base/313233

Log:
  MFC r312110:
  
  Fix -Wsign-compare warnings
  
  The loop index (i) doesn't need to be size_t as its comparison is signed

Modified:
  stable/11/tests/sys/vm/mmap_test.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/tests/sys/vm/mmap_test.c
==
--- stable/11/tests/sys/vm/mmap_test.c  Sat Feb  4 16:56:51 2017
(r313232)
+++ stable/11/tests/sys/vm/mmap_test.c  Sat Feb  4 16:58:06 2017
(r313233)
@@ -184,8 +184,7 @@ ATF_TC_WITHOUT_HEAD(mmap__dev_zero_priva
 ATF_TC_BODY(mmap__dev_zero_private, tc)
 {
char *p1, *p2, *p3;
-   size_t i;
-   int fd, pagesize;
+   int fd, i, pagesize;
 
ATF_REQUIRE((pagesize = getpagesize()) > 0);
ATF_REQUIRE((fd = open("/dev/zero", O_RDONLY)) >= 0);
@@ -197,7 +196,7 @@ ATF_TC_BODY(mmap__dev_zero_private, tc)
ATF_REQUIRE(p2 != MAP_FAILED);
 
for (i = 0; i < pagesize; i++)
-   ATF_REQUIRE_EQ_MSG(0, p1[i], "byte at p1[%zu] is %x", i, p1[i]);
+   ATF_REQUIRE_EQ_MSG(0, p1[i], "byte at p1[%d] is %x", i, p1[i]);
 
ATF_REQUIRE(memcmp(p1, p2, pagesize) == 0);
 
@@ -224,8 +223,7 @@ ATF_TC_WITHOUT_HEAD(mmap__dev_zero_share
 ATF_TC_BODY(mmap__dev_zero_shared, tc)
 {
char *p1, *p2, *p3;
-   size_t i;
-   int fd, pagesize;
+   int fd, i, pagesize;
 
ATF_REQUIRE((pagesize = getpagesize()) > 0);
ATF_REQUIRE((fd = open("/dev/zero", O_RDWR)) >= 0);
@@ -237,7 +235,7 @@ ATF_TC_BODY(mmap__dev_zero_shared, tc)
ATF_REQUIRE(p2 != MAP_FAILED);
 
for (i = 0; i < pagesize; i++)
-   ATF_REQUIRE_EQ_MSG(0, p1[i], "byte at p1[%zu] is %x", i, p1[i]);
+   ATF_REQUIRE_EQ_MSG(0, p1[i], "byte at p1[%d] is %x", i, p1[i]);
 
ATF_REQUIRE(memcmp(p1, p2, pagesize) == 0);
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313232 - stable/11/tests/sys/mac/bsdextended

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 16:56:51 2017
New Revision: 313232
URL: https://svnweb.freebsd.org/changeset/base/313232

Log:
  MFC r312164:
  
  Fix -Wformat issue
  
  Use %zu for printing out results from nitems, as it's size_t based

Modified:
  stable/11/tests/sys/mac/bsdextended/ugidfw_test.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/tests/sys/mac/bsdextended/ugidfw_test.c
==
--- stable/11/tests/sys/mac/bsdextended/ugidfw_test.c   Sat Feb  4 16:55:46 
2017(r313231)
+++ stable/11/tests/sys/mac/bsdextended/ugidfw_test.c   Sat Feb  4 16:56:51 
2017(r313232)
@@ -221,7 +221,7 @@ main(void)
return (0);
}
 
-   printf("1..%lu\n", nitems(test_users) + nitems(test_groups) +
+   printf("1..%zu\n", nitems(test_users) + nitems(test_groups) +
3 * nitems(test_strings) + 2);
 
test_libugidfw_strings();
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313231 - stable/11/libexec/tftpd

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 16:55:46 2017
New Revision: 313231
URL: https://svnweb.freebsd.org/changeset/base/313231

Log:
  MFC r311473:
  
  Conditionalize all code that uses tcpd.h behind `LIBWRAP` guard
  
  This will allow the code to stand by itself without libwrap

Modified:
  stable/11/libexec/tftpd/Makefile
  stable/11/libexec/tftpd/tftpd.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/libexec/tftpd/Makefile
==
--- stable/11/libexec/tftpd/MakefileSat Feb  4 16:54:44 2017
(r313230)
+++ stable/11/libexec/tftpd/MakefileSat Feb  4 16:55:46 2017
(r313231)
@@ -1,12 +1,17 @@
 #  @(#)Makefile8.1 (Berkeley) 6/4/93
 # $FreeBSD$
 
+.include 
+
 PROG=  tftpd
 MAN=   tftpd.8
 SRCS=  tftp-file.c tftp-io.c tftp-options.c tftp-transfer.c tftp-utils.c
 SRCS+= tftpd.c
 WFORMAT=0
 
+.if ${MK_TCP_WRAPPERS} != "no"
+CFLAGS+=   -DLIBWRAP
 LIBADD=wrap
+.endif
 
 .include 

Modified: stable/11/libexec/tftpd/tftpd.c
==
--- stable/11/libexec/tftpd/tftpd.c Sat Feb  4 16:54:44 2017
(r313230)
+++ stable/11/libexec/tftpd/tftpd.c Sat Feb  4 16:55:46 2017
(r313231)
@@ -66,7 +66,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include "tftp-file.h"
@@ -75,6 +74,10 @@ __FBSDID("$FreeBSD$");
 #include "tftp-transfer.h"
 #include "tftp-options.h"
 
+#ifdef LIBWRAP
+#include 
+#endif
+
 static voidtftp_wrq(int peer, char *, ssize_t);
 static voidtftp_rrq(int peer, char *, ssize_t);
 
@@ -281,6 +284,7 @@ main(int argc, char *argv[])
}
}
 
+#ifdef LIBWRAP
/*
 * See if the client is allowed to talk to me.
 * (This needs to be done before the chroot())
@@ -329,6 +333,7 @@ main(int argc, char *argv[])
"Full access allowed"
"in /etc/hosts.allow");
}
+#endif
 
/*
 * Since we exit here, we should do that only after the above
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313230 - stable/11/usr.sbin/sendmail

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 16:54:44 2017
New Revision: 313230
URL: https://svnweb.freebsd.org/changeset/base/313230

Log:
  MFC r311471:
  
  Conditionalize wrap(3) use based on MK_TCP_WRAPPERS instead of
  always building support into sendmail.

Modified:
  stable/11/usr.sbin/sendmail/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/sendmail/Makefile
==
--- stable/11/usr.sbin/sendmail/MakefileSat Feb  4 16:52:48 2017
(r313229)
+++ stable/11/usr.sbin/sendmail/MakefileSat Feb  4 16:54:44 2017
(r313230)
@@ -38,7 +38,7 @@ NIS=  -DNIS
 MAPS=  -DMAP_REGEX -DDNSMAP
 
 CFLAGS+= -I${SMDIR} -I${SENDMAIL_DIR}/include -I.
-CFLAGS+= ${DBMDEF} ${NIS} -DTCPWRAPPERS ${MAPS}
+CFLAGS+= ${DBMDEF} ${NIS} ${MAPS}
 
 .if ${MK_INET6_SUPPORT} != "no"
 CFLAGS+= -DNETINET6
@@ -46,7 +46,7 @@ CFLAGS+= -DNETINET6
 
 WARNS?=0
 
-LIBADD=util wrap sm smutil
+LIBADD=util sm smutil
 
 SRCS+= sm_os.h
 CLEANFILES+=sm_os.h
@@ -57,6 +57,11 @@ CFLAGS+= -DSTARTTLS -D_FFR_TLS_1
 LIBADD+=   ssl crypto
 .endif
 
+.if ${MK_TCP_WRAPPERS} != "no"
+CFLAGS+=   -DTCPWRAPPERS
+LIBADD+=   wrap
+.endif
+
 # User customizations to the sendmail build environment
 CFLAGS+=${SENDMAIL_CFLAGS}
 DPADD+=${SENDMAIL_DPADD}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313229 - stable/11/usr.sbin/ypserv

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 16:52:48 2017
New Revision: 313229
URL: https://svnweb.freebsd.org/changeset/base/313229

Log:
  MFC r311469:
  
  Conditionalize wrap(3) use based on MK_TCP_WRAPPERS instead of
  always building support into ypserv.

Modified:
  stable/11/usr.sbin/ypserv/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/ypserv/Makefile
==
--- stable/11/usr.sbin/ypserv/Makefile  Sat Feb  4 16:49:50 2017
(r313228)
+++ stable/11/usr.sbin/ypserv/Makefile  Sat Feb  4 16:52:48 2017
(r313229)
@@ -1,5 +1,7 @@
 # $FreeBSD$
 
+.include 
+
 RPCDIR=${.CURDIR}/../../include/rpcsvc
 .PATH: ${RPCDIR} \
${.CURDIR}/common
@@ -10,11 +12,14 @@ SRCS=   yp_svc.c yp_server.c yp_dblookup.c
ypxfr_clnt.c yp.h yp_main.c yp_error.c yp_access.c yp_svc_udp.c \
yplib_host.c
 
-CFLAGS+= -DDB_CACHE -DTCP_WRAPPER -I.
+CFLAGS+= -DDB_CACHE -I.
 
 WARNS?=0
 
-LIBADD=wrap
+.if ${MK_TCP_WRAPPERS} != "no"
+CFLAGS+=   -DTCP_WRAPPER
+LIBADD+=   wrap
+.endif
 
 CLEANFILES= yp_svc.c ypxfr_clnt.c yp.h
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313228 - stable/11/lib/libnetbsd/sys

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 16:49:50 2017
New Revision: 313228
URL: https://svnweb.freebsd.org/changeset/base/313228

Log:
  MFC r311972:
  
  Add __BIT and __BITS macros from NetBSD to help support new testcases

Modified:
  stable/11/lib/libnetbsd/sys/cdefs.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/libnetbsd/sys/cdefs.h
==
--- stable/11/lib/libnetbsd/sys/cdefs.h Sat Feb  4 16:47:56 2017
(r313227)
+++ stable/11/lib/libnetbsd/sys/cdefs.h Sat Feb  4 16:49:50 2017
(r313228)
@@ -69,4 +69,13 @@
  */
 #define__arraycount(__x)   (sizeof(__x) / sizeof(__x[0]))
 
+/* __BIT(n): nth bit, where __BIT(0) == 0x1. */
+#define__BIT(__n)  \
+(((uintmax_t)(__n) >= NBBY * sizeof(uintmax_t)) ? 0 : \
+((uintmax_t)1 << (uintmax_t)((__n) & (NBBY * sizeof(uintmax_t) - 1
+
+/* __BITS(m, n): bits m through n, m < n. */
+#define__BITS(__m, __n)\
+   ((__BIT(MAX((__m), (__n)) + 1) - 1) ^ (__BIT(MIN((__m), (__n))) - 1))
+
 #endif /* _LIBNETBSD_SYS_CDEFS_H_ */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313227 - in stable/11: contrib/netbsd-tests/lib/libc contrib/netbsd-tests/lib/libc/c063 contrib/netbsd-tests/lib/libc/gen contrib/netbsd-tests/lib/libc/gen/posix_spawn contrib/netbsd-t...

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 16:47:56 2017
New Revision: 313227
URL: https://svnweb.freebsd.org/changeset/base/313227

Log:
  MFC r311925,r311968,r311969,r312102,r312108:
  
  r311925:
  
  Import testcase updates with code contributed back to NetBSD
  
  This also (inadvertently) contains an update to
  contrib/netbsd-tests/lib/libc/sys/t_wait.c (new testcases).
  
  In collaboration with:chris...@netbsd.org
  
  r311968:
  
  Fix lib/libc/sys/access_test after r311925
  
  sys/param.h needs to be #included in order for __FreeBSD_version to be checked
  
  r311969:
  
  Remove __HAVE_LONG_DOUBLE #define from t_strtod.c and place it in Makefile
  
  This is to enable support in other testcases
  
  Inspired by lib/msun/tests/Makefile .
  
  r312102:
  
  Note that sys/types.h is required on FreeBSD for kqueue(2), unlike NetBSD
  
  r312108:
  
  Delete trailing whitespace and use __arraycount instead of nitems in contrib 
code

Modified:
  stable/11/contrib/netbsd-tests/lib/libc/c063/t_faccessat.c
  stable/11/contrib/netbsd-tests/lib/libc/c063/t_fchmodat.c
  stable/11/contrib/netbsd-tests/lib/libc/c063/t_fchownat.c
  stable/11/contrib/netbsd-tests/lib/libc/c063/t_fexecve.c
  stable/11/contrib/netbsd-tests/lib/libc/c063/t_fstatat.c
  stable/11/contrib/netbsd-tests/lib/libc/c063/t_mkfifoat.c
  stable/11/contrib/netbsd-tests/lib/libc/c063/t_mknodat.c
  stable/11/contrib/netbsd-tests/lib/libc/c063/t_o_search.c
  stable/11/contrib/netbsd-tests/lib/libc/c063/t_openat.c
  stable/11/contrib/netbsd-tests/lib/libc/c063/t_readlinkat.c
  stable/11/contrib/netbsd-tests/lib/libc/c063/t_unlinkat.c
  stable/11/contrib/netbsd-tests/lib/libc/c063/t_utimensat.c
  stable/11/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_fileactions.c
  stable/11/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.c
  stable/11/contrib/netbsd-tests/lib/libc/gen/t_assert.c
  stable/11/contrib/netbsd-tests/lib/libc/gen/t_dir.c
  stable/11/contrib/netbsd-tests/lib/libc/gen/t_ftok.c
  stable/11/contrib/netbsd-tests/lib/libc/gen/t_humanize_number.c
  stable/11/contrib/netbsd-tests/lib/libc/gen/t_sleep.c
  stable/11/contrib/netbsd-tests/lib/libc/gen/t_time.c
  stable/11/contrib/netbsd-tests/lib/libc/gen/t_ttyname.c
  stable/11/contrib/netbsd-tests/lib/libc/gen/t_vis.c
  stable/11/contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c
  stable/11/contrib/netbsd-tests/lib/libc/string/t_strchr.c
  stable/11/contrib/netbsd-tests/lib/libc/string/t_strerror.c
  stable/11/contrib/netbsd-tests/lib/libc/sys/t_access.c
  stable/11/contrib/netbsd-tests/lib/libc/sys/t_chroot.c
  stable/11/contrib/netbsd-tests/lib/libc/sys/t_mincore.c
  stable/11/contrib/netbsd-tests/lib/libc/sys/t_mmap.c
  stable/11/contrib/netbsd-tests/lib/libc/sys/t_wait.c
  stable/11/contrib/netbsd-tests/lib/libc/t_cdb.c
  stable/11/lib/libc/tests/stdlib/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/netbsd-tests/lib/libc/c063/t_faccessat.c
==
--- stable/11/contrib/netbsd-tests/lib/libc/c063/t_faccessat.c  Sat Feb  4 
16:47:35 2017(r313226)
+++ stable/11/contrib/netbsd-tests/lib/libc/c063/t_faccessat.c  Sat Feb  4 
16:47:56 2017(r313227)
@@ -1,4 +1,4 @@
-/* $NetBSD: t_faccessat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $ */
+/* $NetBSD: t_faccessat.c,v 1.3 2017/01/10 15:13:56 christos Exp $ */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -29,8 +29,10 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_faccessat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $");
+__RCSID("$NetBSD: t_faccessat.c,v 1.3 2017/01/10 15:13:56 christos Exp $");
 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -39,10 +41,6 @@ __RCSID("$NetBSD: t_faccessat.c,v 1.2 20
 #include 
 #include 
 #include 
-#include 
-#ifdef __FreeBSD__
-#include 
-#endif
 
 #define DIR "dir"
 #define FILE "dir/faccessat"

Modified: stable/11/contrib/netbsd-tests/lib/libc/c063/t_fchmodat.c
==
--- stable/11/contrib/netbsd-tests/lib/libc/c063/t_fchmodat.c   Sat Feb  4 
16:47:35 2017(r313226)
+++ stable/11/contrib/netbsd-tests/lib/libc/c063/t_fchmodat.c   Sat Feb  4 
16:47:56 2017(r313227)
@@ -1,4 +1,4 @@
-/* $NetBSD: t_fchmodat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $ */
+/* $NetBSD: t_fchmodat.c,v 1.3 2017/01/10 15:13:56 christos Exp $ */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -29,8 +29,10 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_fchmodat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $");
+__RCSID("$NetBSD: t_fchmodat.c,v 1.3 2017/01/10 15:13:56 christos Exp $");
 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -39,10 +41,6 @@ __RCSID("$NetBSD: t_fchmodat.c,v 1.2 201
 #include 
 #include 
 #include 
-#include 
-#ifdef __FreeBSD__
-#include 
-#endif
 
 #define DIR "dir"
 #define FILE "dir/fchmodat"

Modified: 

svn commit: r313226 - stable/10/libexec/tftpd

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 16:47:35 2017
New Revision: 313226
URL: https://svnweb.freebsd.org/changeset/base/313226

Log:
  MFC r311473:
  
  Conditionalize all code that uses tcpd.h behind `LIBWRAP` guard
  
  This will allow the code to stand by itself without libwrap

Modified:
  stable/10/libexec/tftpd/Makefile
  stable/10/libexec/tftpd/tftpd.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/libexec/tftpd/Makefile
==
--- stable/10/libexec/tftpd/MakefileSat Feb  4 16:45:44 2017
(r313225)
+++ stable/10/libexec/tftpd/MakefileSat Feb  4 16:47:35 2017
(r313226)
@@ -1,13 +1,18 @@
 #  @(#)Makefile8.1 (Berkeley) 6/4/93
 # $FreeBSD$
 
+.include 
+
 PROG=  tftpd
 MAN=   tftpd.8
 SRCS=  tftp-file.c tftp-io.c tftp-options.c tftp-transfer.c tftp-utils.c
 SRCS+= tftpd.c
 WFORMAT=0
 
-DPADD= ${LIBWRAP}
-LDADD= -lwrap
+.if ${MK_TCP_WRAPPERS} != "no"
+CFLAGS+=   -DLIBWRAP
+DPADD+=${LIBWRAP}
+LDADD+=-lwrap
+.endif
 
 .include 

Modified: stable/10/libexec/tftpd/tftpd.c
==
--- stable/10/libexec/tftpd/tftpd.c Sat Feb  4 16:45:44 2017
(r313225)
+++ stable/10/libexec/tftpd/tftpd.c Sat Feb  4 16:47:35 2017
(r313226)
@@ -66,7 +66,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include "tftp-file.h"
@@ -75,6 +74,10 @@ __FBSDID("$FreeBSD$");
 #include "tftp-transfer.h"
 #include "tftp-options.h"
 
+#ifdef LIBWRAP
+#include 
+#endif
+
 static voidtftp_wrq(int peer, char *, ssize_t);
 static voidtftp_rrq(int peer, char *, ssize_t);
 
@@ -281,6 +284,7 @@ main(int argc, char *argv[])
}
}
 
+#ifdef LIBWRAP
/*
 * See if the client is allowed to talk to me.
 * (This needs to be done before the chroot())
@@ -329,6 +333,7 @@ main(int argc, char *argv[])
"Full access allowed"
"in /etc/hosts.allow");
}
+#endif
 
/*
 * Since we exit here, we should do that only after the above
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313225 - stable/10/usr.sbin/sendmail

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 16:45:44 2017
New Revision: 313225
URL: https://svnweb.freebsd.org/changeset/base/313225

Log:
  MFC r311471:
  
  Conditionalize wrap(3) use based on MK_TCP_WRAPPERS instead of
  always building support into sendmail.

Modified:
  stable/10/usr.sbin/sendmail/Makefile
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/sendmail/Makefile
==
--- stable/10/usr.sbin/sendmail/MakefileSat Feb  4 16:43:35 2017
(r313224)
+++ stable/10/usr.sbin/sendmail/MakefileSat Feb  4 16:45:44 2017
(r313225)
@@ -37,7 +37,7 @@ NIS=  -DNIS
 MAPS=  -DMAP_REGEX -DDNSMAP
 
 CFLAGS+= -I${SMDIR} -I${SENDMAIL_DIR}/include -I.
-CFLAGS+= ${DBMDEF} ${NIS} -DTCPWRAPPERS ${MAPS}
+CFLAGS+= ${DBMDEF} ${NIS} ${MAPS}
 
 .if ${MK_INET6_SUPPORT} != "no"
 CFLAGS+= -DNETINET6 -DIPV6_FULL=0
@@ -45,8 +45,8 @@ CFLAGS+= -DNETINET6 -DIPV6_FULL=0
 
 WARNS?=0
 
-DPADD= ${LIBUTIL} ${LIBWRAP}
-LDADD= -lutil -lwrap
+DPADD= ${LIBUTIL}
+LDADD= -lutil
 
 LIBSMDIR=  ${.OBJDIR}/../../lib/libsm
 LIBSM= ${LIBSMDIR}/libsm.a
@@ -67,6 +67,12 @@ DPADD+=  ${LIBSSL} ${LIBCRYPTO}
 LDADD+=-lssl -lcrypto
 .endif
 
+.if ${MK_TCP_WRAPPERS} != "no"
+CFLAGS+=   -DTCPWRAPPERS
+DPADD+=${LIBWRAP}
+LDADD+=-lwrap
+.endif
+
 # User customizations to the sendmail build environment
 CFLAGS+=${SENDMAIL_CFLAGS}
 DPADD+=${SENDMAIL_DPADD}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313224 - stable/10/etc

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 16:43:35 2017
New Revision: 313224
URL: https://svnweb.freebsd.org/changeset/base/313224

Log:
  MFC r310467:
  
  Provide some guidance when dealing with sections and variables contained
  within them
  
  For example, using variables designated for %usm requires uncommenting
  %usm section header

Modified:
  stable/10/etc/snmpd.config
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/etc/snmpd.config
==
--- stable/10/etc/snmpd.config  Sat Feb  4 16:40:28 2017(r313223)
+++ stable/10/etc/snmpd.config  Sat Feb  4 16:43:35 2017(r313224)
@@ -116,6 +116,14 @@ snmpEnableAuthenTraps = 2
 # modules
 
 #
+# Control configuration for the modules in the module specific sections, e.g.
+# the "usm" module (begemotSnmpdModulePath."usm") can be controlled in the
+# %usm specific section. You must uncomment the section specific header in
+# order to use the enclosed variables, e.g. `usmUserStatus.$(engine).$(user1)`
+# can only be used if %usm is uncommented.
+#
+
+#
 # Bridge module
 #  This requires the mibII module.
 #
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313223 - in stable/10: share/mk usr.sbin/bsnmpd/modules usr.sbin/bsnmpd/modules/snmp_hostres usr.sbin/bsnmpd/modules/snmp_mibII

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 16:40:28 2017
New Revision: 313223
URL: https://svnweb.freebsd.org/changeset/base/313223

Log:
  MFC r311744,r312328,r312329,r312330:
  
  r311744:
  
  Document bsd.snmpmod.mk from a high-level
  
  r312328:
  
  Add a make target (smilint) for running smilint tool against BMIBS
  
  Running smilint against MIB definitions is useful in finding
  functional problems with MIB definitions/descriptions.
  
  This is inspired by the smilint targets defined in
  usr.sbin/bsnmpd/modules/{snmp_hostres,snmp_mibII}/Makefile
  
  Document all of the variables that are involved in running the
  smilint target, as well as all of the prerequisites to running
  it.
  
  r312329:
  
  Remove ad hoc smilint targets made standard in bsd.snmpmod.mk in r312328
  
  r312330:
  
  Add smilint target to subdir targets so "make smilint" here will run
  the smilint target in subdirs
  
  While here, convert a path that's .CURDIR relative to SRCTOP

Modified:
  stable/10/share/mk/bsd.README
  stable/10/share/mk/bsd.snmpmod.mk
  stable/10/usr.sbin/bsnmpd/modules/Makefile
  stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile
  stable/10/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/share/mk/bsd.README
==
--- stable/10/share/mk/bsd.README   Sat Feb  4 16:37:43 2017
(r313222)
+++ stable/10/share/mk/bsd.README   Sat Feb  4 16:40:28 2017
(r313223)
@@ -350,6 +350,82 @@ If foo has multiple source files, add th
 
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
+The include file, , handles building MIB modules for bsnmpd
+from one or more source files, along with their manual pages.  It has a
+limited number of suffixes, consistent with the current needs of the BSD
+tree.
+
+bsd.snmpmod.mk leverages bsd.lib.mk for building MIB modules and
+bsd.files.mk for installing MIB description and definition files.
+
+It implements the following additional targets:
+
+   smilint:
+   execute smilint on the MIBs defined by BMIBS.
+
+   The net-mgmt/libsmi package must be installed before
+   executing this target. The net-mgmt/net-snmp package
+   should be installed as well to reduce false positives
+   from smilint.
+
+It sets/uses the following variables:
+
+BMIBS  The MIB definitions to install.
+
+BMIBSDIR   The directory where the MIB definitions are installed.
+   This defaults to `${SHAREDIR}/snmp/mibs`.
+
+DEFS   The MIB description files to install.
+
+DEFSDIRThe directory where MIB description files are installed.
+   This defaults to `${SHAREDIR}/snmp/defs`.
+
+EXTRAMIBDEFS   Extra MIB description files to use as input when
+   generating ${MOD}_oid.h and ${MOD}_tree.[ch].
+
+EXTRAMIBSYMS   Extra MIB definition files used only for extracting
+   symbols.
+
+   EXTRAMIBSYMS are useful when resolving inter-module
+   dependencies and are useful with files containing only
+   enum-definitions.
+
+   See ${MOD}_oid.h for more details.
+
+LOCALBASE  The package root where smilint and the net-snmp
+   definitions can be found
+
+MODThe bsnmpd module name.
+
+SMILINTsmilint binary to use with the smilint make target.
+
+SMILINT_FLAGS  flags to pass to smilint.
+
+SMIPATHA colon-separated directory path where MIBs definitions
+   can be found. See "SMIPATH" in smi_config for more
+   details.
+
+XSYM   MIB names to extract symbols for. See ${MOD}_oid.h for
+   more details.
+
+It generates the following files:
+
+${MOD}_tree.c  A source file and header which programmatically describes
+${MOD}_tree.h  the MIB (type, OID name, ACCESS attributes, etc).
+
+   The files are generated via "gensnmptree -p".
+
+   See gensnmptree(1) for more details.
+
+${MOD}_oid.h   A header which programmatically describes the MIB root and
+   MIB tables.
+
+   The files are generated via "gensnmptree -e".
+
+   See gensnmptree(1) for more details.
+
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
 The include file  contains the default targets for building
 subdirectories.  It has the same seven targets as : all, clean,
 cleandir, depend, install, lint, and tags.  For all of the directories

Modified: stable/10/share/mk/bsd.snmpmod.mk
==
--- stable/10/share/mk/bsd.snmpmod.mk   Sat Feb  4 16:37:43 2017
(r313222)
+++ stable/10/share/mk/bsd.snmpmod.mk   Sat Feb  4 16:40:28 2017
(r313223)
@@ -24,4 +24,18 @@ FILESGROUPS+=BMIBS
 BMIBSDIR=  

svn commit: r313222 - stable/10/contrib/bsnmp/snmp_usm

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 16:37:43 2017
New Revision: 313222
URL: https://svnweb.freebsd.org/changeset/base/313222

Log:
  MFC r311394:
  
  op_usm_users: don't deref uusers if it's NULL when SETting the value
  
  Add an XXX comment to note that the conditional seems suspect given
  how it's handled elsewhere in the SNMP_OP_SET case.
  
  CID:  1008573

Modified:
  stable/10/contrib/bsnmp/snmp_usm/usm_snmp.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/contrib/bsnmp/snmp_usm/usm_snmp.c
==
--- stable/10/contrib/bsnmp/snmp_usm/usm_snmp.c Sat Feb  4 16:36:07 2017
(r313221)
+++ stable/10/contrib/bsnmp/snmp_usm/usm_snmp.c Sat Feb  4 16:37:43 2017
(r313222)
@@ -169,8 +169,12 @@ op_usm_users(struct snmp_context *ctx, s
val->var.subs[sub - 1] != LEAF_usmUserCloneFrom)
return (SNMP_ERR_NOSUCHNAME);
 
+   /*
+* XXX (ngie): need to investigate the MIB to determine how
+* this is possible given some of the transitions below.
+*/
if (community != COMM_INITIALIZE &&
-   uuser->type == StorageType_readOnly)
+   uuser != NULL && uuser->type == StorageType_readOnly)
return (SNMP_ERR_NOT_WRITEABLE);
 
switch (val->var.subs[sub - 1]) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313221 - stable/10/lib/libc/regex/grot

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 16:36:07 2017
New Revision: 313221
URL: https://svnweb.freebsd.org/changeset/base/313221

Log:
  MFC r312332:
  
  Use SRCTOP where possible and use :H to manipulate .CURDIR to get rid of
  unnecessarily long relative path .PATH values with make

Modified:
  stable/10/lib/libc/regex/grot/Makefile
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/lib/libc/regex/grot/Makefile
==
--- stable/10/lib/libc/regex/grot/Makefile  Sat Feb  4 16:34:44 2017
(r313220)
+++ stable/10/lib/libc/regex/grot/Makefile  Sat Feb  4 16:36:07 2017
(r313221)
@@ -5,7 +5,7 @@
 # Do not take -DPOSIX_MISTAKE out.  REGCFLAGS isn't important to you (it's
 # for my use in some special contexts).
 
-PATHS= ${.CURDIR}/.. ${.CURDIR}/../../locale ${.CURDIR}/../../../../include
+PATHS= ${.CURDIR:H} ${.CURDIR:H:H}/locale ${SRCTOP}/include
 .PATH: ${PATHS}
 
 CFLAGS+= -static -DPOSIX_MISTAKE -DREDEBUG $(REGCFLAGS)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313220 - stable/10/usr.sbin/ypserv

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 16:34:44 2017
New Revision: 313220
URL: https://svnweb.freebsd.org/changeset/base/313220

Log:
  MFC r311469:
  
  Conditionalize wrap(3) use based on MK_TCP_WRAPPERS instead of
  always building support into ypserv.

Modified:
  stable/10/usr.sbin/ypserv/Makefile
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/ypserv/Makefile
==
--- stable/10/usr.sbin/ypserv/Makefile  Sat Feb  4 16:31:24 2017
(r313219)
+++ stable/10/usr.sbin/ypserv/Makefile  Sat Feb  4 16:34:44 2017
(r313220)
@@ -1,5 +1,7 @@
 # $FreeBSD$
 
+.include 
+
 RPCDIR=${.CURDIR}/../../include/rpcsvc
 .PATH: ${RPCDIR}
 
@@ -8,12 +10,15 @@ MAN= ypserv.8 ypinit.8
 SRCS=  yp_svc.c yp_server.c yp_dblookup.c yp_dnslookup.c \
ypxfr_clnt.c yp.h yp_main.c yp_error.c yp_access.c yp_svc_udp.c
 
-CFLAGS+= -DDB_CACHE -DTCP_WRAPPER -I.
+CFLAGS+= -DDB_CACHE -I.
 
 WARNS?=0
 
-DPADD= ${LIBWRAP}
-LDADD= -lwrap
+.if ${MK_TCP_WRAPPERS} != "no"
+CFLAGS+=   -DTCP_WRAPPER
+DPADD+=${LIBWRAP}
+LDADD+=-lwrap
+.endif
 
 CLEANFILES= yp_svc.c ypxfr_clnt.c yp.h
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313219 - stable/10/tests/sys/mac/bsdextended

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 16:31:24 2017
New Revision: 313219
URL: https://svnweb.freebsd.org/changeset/base/313219

Log:
  MFC r312164:
  
  Fix -Wformat issue
  
  Use %zu for printing out results from nitems, as it's size_t based

Modified:
  stable/10/tests/sys/mac/bsdextended/ugidfw_test.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/tests/sys/mac/bsdextended/ugidfw_test.c
==
--- stable/10/tests/sys/mac/bsdextended/ugidfw_test.c   Sat Feb  4 16:29:23 
2017(r313218)
+++ stable/10/tests/sys/mac/bsdextended/ugidfw_test.c   Sat Feb  4 16:31:24 
2017(r313219)
@@ -222,7 +222,7 @@ main(void)
return (0);
}
 
-   printf("1..%lu\n", nitems(test_users) + nitems(test_groups) +
+   printf("1..%zu\n", nitems(test_users) + nitems(test_groups) +
3 * nitems(test_strings) + 2);
 
test_libugidfw_strings();
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313218 - stable/10/tests/sys

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 16:29:23 2017
New Revision: 313218
URL: https://svnweb.freebsd.org/changeset/base/313218

Log:
  MFC r312114,r312194:
  
  r312114:
  
  Enable WARNS?= 6 across all of tests/sys
  
  r312194:
  
  Add include Makefiles for tests/sys/{fs,kern,kqueue,mac}/...
  
  The primary goal for doing this is to leverage the work done in r312114
  for enabling WARNS to address trivial code quality issues with new tests
  
  Tested with:  make tinderbox

Added:
  stable/10/tests/sys/Makefile.inc
 - copied unchanged from r312114, head/tests/sys/Makefile.inc
Modified:
Directory Properties:
  stable/10/   (props changed)

Copied: stable/10/tests/sys/Makefile.inc (from r312114, 
head/tests/sys/Makefile.inc)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/10/tests/sys/Makefile.incSat Feb  4 16:29:23 2017
(r313218, copy of r312114, head/tests/sys/Makefile.inc)
@@ -0,0 +1,3 @@
+# $FreeBSD$
+
+WARNS?=6
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313217 - stable/10/tests/sys/vm

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 16:16:41 2017
New Revision: 313217
URL: https://svnweb.freebsd.org/changeset/base/313217

Log:
  MFC r312110:
  
  Fix -Wsign-compare warnings
  
  The loop index (i) doesn't need to be size_t as its comparison is signed

Modified:
  stable/10/tests/sys/vm/mmap_test.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/tests/sys/vm/mmap_test.c
==
--- stable/10/tests/sys/vm/mmap_test.c  Sat Feb  4 16:15:26 2017
(r313216)
+++ stable/10/tests/sys/vm/mmap_test.c  Sat Feb  4 16:16:41 2017
(r313217)
@@ -192,8 +192,7 @@ ATF_TC_WITHOUT_HEAD(mmap__dev_zero_priva
 ATF_TC_BODY(mmap__dev_zero_private, tc)
 {
char *p1, *p2, *p3;
-   size_t i;
-   int fd, pagesize;
+   int fd, i, pagesize;
 
ATF_REQUIRE((pagesize = getpagesize()) > 0);
ATF_REQUIRE((fd = open("/dev/zero", O_RDONLY)) >= 0);
@@ -205,7 +204,7 @@ ATF_TC_BODY(mmap__dev_zero_private, tc)
ATF_REQUIRE(p2 != MAP_FAILED);
 
for (i = 0; i < pagesize; i++)
-   ATF_REQUIRE_EQ_MSG(0, p1[i], "byte at p1[%zu] is %x", i, p1[i]);
+   ATF_REQUIRE_EQ_MSG(0, p1[i], "byte at p1[%d] is %x", i, p1[i]);
 
ATF_REQUIRE(memcmp(p1, p2, pagesize) == 0);
 
@@ -232,8 +231,7 @@ ATF_TC_WITHOUT_HEAD(mmap__dev_zero_share
 ATF_TC_BODY(mmap__dev_zero_shared, tc)
 {
char *p1, *p2, *p3;
-   size_t i;
-   int fd, pagesize;
+   int fd, i, pagesize;
 
ATF_REQUIRE((pagesize = getpagesize()) > 0);
ATF_REQUIRE((fd = open("/dev/zero", O_RDWR)) >= 0);
@@ -245,7 +243,7 @@ ATF_TC_BODY(mmap__dev_zero_shared, tc)
ATF_REQUIRE(p2 != MAP_FAILED);
 
for (i = 0; i < pagesize; i++)
-   ATF_REQUIRE_EQ_MSG(0, p1[i], "byte at p1[%zu] is %x", i, p1[i]);
+   ATF_REQUIRE_EQ_MSG(0, p1[i], "byte at p1[%d] is %x", i, p1[i]);
 
ATF_REQUIRE(memcmp(p1, p2, pagesize) == 0);
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313216 - stable/10/tests/sys/mac/bsdextended

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 16:15:26 2017
New Revision: 313216
URL: https://svnweb.freebsd.org/changeset/base/313216

Log:
  MFC r312120:
  
  Fix warnings
  
  - Staticize test_num
  - Promote i to size_t to deal with -Wsign-compare issues
  
  Tested with:  clang, gcc, gcc49

Modified:
  stable/10/tests/sys/mac/bsdextended/ugidfw_test.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/tests/sys/mac/bsdextended/ugidfw_test.c
==
--- stable/10/tests/sys/mac/bsdextended/ugidfw_test.c   Sat Feb  4 16:09:07 
2017(r313215)
+++ stable/10/tests/sys/mac/bsdextended/ugidfw_test.c   Sat Feb  4 16:15:26 
2017(r313216)
@@ -71,7 +71,7 @@ static const char *test_groups[] = {
"bin",
 };
 
-int test_num;
+static int test_num;
 
 /*
  * List of test strings that must go in (and come out) of libugidfw intact.
@@ -149,7 +149,8 @@ test_libugidfw_strings(void)
struct mac_bsdextended_rule rule;
char errorstr[256];
char rulestr[256];
-   int error, i;
+   size_t i;
+   int error;
 
for (i = 0; i < nitems(test_users); i++, test_num++) {
if (getpwnam(test_users[i]) == NULL)
@@ -171,7 +172,7 @@ test_libugidfw_strings(void)
error = bsde_parse_rule_string(test_strings[i], ,
sizeof(errorstr), errorstr);
if (error == -1)
-   printf("not ok %d # bsde_parse_rule_string: '%s' (%d) "
+   printf("not ok %d # bsde_parse_rule_string: '%s' (%zu) "
"failed: %s\n", test_num, test_strings[i], i, 
errorstr);
else
printf("ok %d\n", test_num);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313215 - stable/10/lib/libnetbsd/sys

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 16:09:07 2017
New Revision: 313215
URL: https://svnweb.freebsd.org/changeset/base/313215

Log:
  MFC r311972:
  
  Add __BIT and __BITS macros from NetBSD to help support new testcases

Modified:
  stable/10/lib/libnetbsd/sys/cdefs.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/lib/libnetbsd/sys/cdefs.h
==
--- stable/10/lib/libnetbsd/sys/cdefs.h Sat Feb  4 16:02:49 2017
(r313214)
+++ stable/10/lib/libnetbsd/sys/cdefs.h Sat Feb  4 16:09:07 2017
(r313215)
@@ -69,4 +69,13 @@
  */
 #define__arraycount(__x)   (sizeof(__x) / sizeof(__x[0]))
 
+/* __BIT(n): nth bit, where __BIT(0) == 0x1. */
+#define__BIT(__n)  \
+(((uintmax_t)(__n) >= NBBY * sizeof(uintmax_t)) ? 0 : \
+((uintmax_t)1 << (uintmax_t)((__n) & (NBBY * sizeof(uintmax_t) - 1
+
+/* __BITS(m, n): bits m through n, m < n. */
+#define__BITS(__m, __n)\
+   ((__BIT(MAX((__m), (__n)) + 1) - 1) ^ (__BIT(MIN((__m), (__n))) - 1))
+
 #endif /* _LIBNETBSD_SYS_CDEFS_H_ */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313214 - stable/10/tests/sys/kern/acct

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 16:02:49 2017
New Revision: 313214
URL: https://svnweb.freebsd.org/changeset/base/313214

Log:
  MFC r312119,r312216,r312226:
  
  r312119:
  
  encode_long, encode_timeval: mechanically replace `exp` with `exponent`
  
  This helps fix a -Wshadow issue with exp(3) with tests/sys/acct/acct_test,
  which include math.h, which in turn defines exp(3)
  
  Tested with:  clang, gcc 4.2.1, gcc 4.9
  
  r312216:
  
  Revert r312119 and reword the intent to fix -Wshadow issues
  between exp(3) and `exp` var.
  
  The approach taken previously was not ideal for multiple
  functional and stylistic reasons.
  
  Add to existing sed call in Makefile to replace `exp` with
  `exponent` instead.
  
  Requested by: bde
  
  r312226:
  
  Fix typo in r312216
  
  I meant to replace "exp" with "exponent", not "expected"
  
  Pointyhat to: ngie

Modified:
  stable/10/tests/sys/kern/acct/Makefile
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/tests/sys/kern/acct/Makefile
==
--- stable/10/tests/sys/kern/acct/Makefile  Sat Feb  4 16:02:48 2017
(r313213)
+++ stable/10/tests/sys/kern/acct/Makefile  Sat Feb  4 16:02:49 2017
(r313214)
@@ -13,6 +13,7 @@ acct_test.o: convert.c
 
 convert.c: ${.CURDIR:H:H:H:H}/sys/kern/kern_acct.c
sed -n -e 's/log(/syslog(/g' \
+  -e 's/exp/exponent/g' \
   -e '/FLOAT_CONVERSION_START/,/FLOAT_CONVERSION_END/p' ${.ALLSRC} 
>${.TARGET}.tmp
mv ${.TARGET}.tmp ${.TARGET}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313213 - stable/11/tests/sys/kern/acct

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 16:02:48 2017
New Revision: 313213
URL: https://svnweb.freebsd.org/changeset/base/313213

Log:
  MFC r312119,r312216,r312226:
  
  r312119:
  
  encode_long, encode_timeval: mechanically replace `exp` with `exponent`
  
  This helps fix a -Wshadow issue with exp(3) with tests/sys/acct/acct_test,
  which include math.h, which in turn defines exp(3)
  
  Tested with:  clang, gcc 4.2.1, gcc 4.9
  
  r312216:
  
  Revert r312119 and reword the intent to fix -Wshadow issues
  between exp(3) and `exp` var.
  
  The approach taken previously was not ideal for multiple
  functional and stylistic reasons.
  
  Add to existing sed call in Makefile to replace `exp` with
  `exponent` instead.
  
  Requested by: bde
  
  r312226:
  
  Fix typo in r312216
  
  I meant to replace "exp" with "exponent", not "expected"
  
  Pointyhat to: ngie

Modified:
  stable/11/tests/sys/kern/acct/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/tests/sys/kern/acct/Makefile
==
--- stable/11/tests/sys/kern/acct/Makefile  Sat Feb  4 16:00:51 2017
(r313212)
+++ stable/11/tests/sys/kern/acct/Makefile  Sat Feb  4 16:02:48 2017
(r313213)
@@ -13,6 +13,7 @@ acct_test.o: convert.c
 
 convert.c: ${SRCTOP}/sys/kern/kern_acct.c
sed -n -e 's/log(/syslog(/g' \
+  -e 's/exp/exponent/g' \
   -e '/FLOAT_CONVERSION_START/,/FLOAT_CONVERSION_END/p' ${.ALLSRC} 
>${.TARGET}.tmp
mv ${.TARGET}.tmp ${.TARGET}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313212 - in stable/10/usr.sbin/amd: amd include

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 16:00:51 2017
New Revision: 313212
URL: https://svnweb.freebsd.org/changeset/base/313212

Log:
  MFC r311472:
  
  Conditionalize wrap(3) use based on MK_TCP_WRAPPERS instead of
  always building support into amd(8).

Modified:
  stable/10/usr.sbin/amd/amd/Makefile
  stable/10/usr.sbin/amd/include/config.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/amd/amd/Makefile
==
--- stable/10/usr.sbin/amd/amd/Makefile Sat Feb  4 16:00:19 2017
(r313211)
+++ stable/10/usr.sbin/amd/amd/Makefile Sat Feb  4 16:00:51 2017
(r313212)
@@ -30,8 +30,8 @@ CFLAGS+= -I${.CURDIR}/../../../contrib/a
 -I${SRCTOP}/contrib/amd/include \
 -I${.OBJDIR}/../../../include/rpcsvc
 
-DPADD= ${LIBAMU} ${LIBWRAP}
-LDADD= ${LIBAMU} -lwrap
+DPADD= ${LIBAMU}
+LDADD= ${LIBAMU}
 
 SRCS+= conf_parse.c conf_parse.h conf_tok.c
 SRCS+= sun_map_parse.c sun_map_parse.h sun_map_tok.c
@@ -74,4 +74,10 @@ CFLAGS+= -DHAVE_MAP_HESIOD
 SRCS+= info_nis.c
 .endif
 
+.if ${MK_TCP_WRAPPERS} != "no"
+CFLAGS+=   -DHAVE_LIBWRAP -DHAVE_TCPD_H
+DPADD+=${LIBWRAP}
+LDADD+=-lwrap
+.endif
+
 .include 

Modified: stable/10/usr.sbin/amd/include/config.h
==
--- stable/10/usr.sbin/amd/include/config.h Sat Feb  4 16:00:19 2017
(r313211)
+++ stable/10/usr.sbin/amd/include/config.h Sat Feb  4 16:00:51 2017
(r313212)
@@ -530,7 +530,7 @@
 /* #undef HAVE_LIBRT */
 
 /* does libwrap exist? */
-#define HAVE_LIBWRAP 1
+/* #undef HAVE_LIBWRAP */
 
 /* Define to 1 if you have the  header file. */
 #define HAVE_LIMITS_H 1
@@ -1207,7 +1207,7 @@
 #define HAVE_SYS_WAIT_H 1
 
 /* Define to 1 if you have the  header file. */
-#define HAVE_TCPD_H 1
+/* #undef HAVE_TCPD_H */
 
 /* Define to 1 if you have the  header file. */
 #define HAVE_TIME_H 1
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313211 - in stable/11/usr.sbin/amd: amd include

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 16:00:19 2017
New Revision: 313211
URL: https://svnweb.freebsd.org/changeset/base/313211

Log:
  MFC r311472:
  
  Conditionalize wrap(3) use based on MK_TCP_WRAPPERS instead of
  always building support into amd(8).

Modified:
  stable/11/usr.sbin/amd/amd/Makefile
  stable/11/usr.sbin/amd/include/config.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/amd/amd/Makefile
==
--- stable/11/usr.sbin/amd/amd/Makefile Sat Feb  4 15:56:24 2017
(r313210)
+++ stable/11/usr.sbin/amd/amd/Makefile Sat Feb  4 16:00:19 2017
(r313211)
@@ -30,7 +30,7 @@ CFLAGS+= -I${.CURDIR}/../../../contrib/a
 -I${SRCTOP}/contrib/amd/include \
 -I${.OBJDIR}/../../../include/rpcsvc
 
-LIBADD=amu wrap
+LIBADD=amu
 
 SRCS+= conf_parse.c conf_parse.h conf_tok.c
 SRCS+= sun_map_parse.c sun_map_parse.h sun_map_tok.c
@@ -73,4 +73,9 @@ CFLAGS+= -DHAVE_MAP_HESIOD
 SRCS+= info_nis.c
 .endif
 
+.if ${MK_TCP_WRAPPERS} != "no"
+CFLAGS+=   -DHAVE_LIBWRAP -DHAVE_TCPD_H
+LIBADD+=   wrap
+.endif
+
 .include 

Modified: stable/11/usr.sbin/amd/include/config.h
==
--- stable/11/usr.sbin/amd/include/config.h Sat Feb  4 15:56:24 2017
(r313210)
+++ stable/11/usr.sbin/amd/include/config.h Sat Feb  4 16:00:19 2017
(r313211)
@@ -530,7 +530,7 @@
 /* #undef HAVE_LIBRT */
 
 /* does libwrap exist? */
-#define HAVE_LIBWRAP 1
+/* #undef HAVE_LIBWRAP */
 
 /* Define to 1 if you have the  header file. */
 #define HAVE_LIMITS_H 1
@@ -1207,7 +1207,7 @@
 #define HAVE_SYS_WAIT_H 1
 
 /* Define to 1 if you have the  header file. */
-#define HAVE_TCPD_H 1
+/* #undef HAVE_TCPD_H */
 
 /* Define to 1 if you have the  header file. */
 #define HAVE_TIME_H 1
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313210 - stable/11/usr.sbin/rpcbind

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 15:56:24 2017
New Revision: 313210
URL: https://svnweb.freebsd.org/changeset/base/313210

Log:
  MFC r311470:
  
  Conditionalize wrap(3) use based on MK_TCP_WRAPPERS instead of
  always building support into rpcbind.

Modified:
  stable/11/usr.sbin/rpcbind/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/rpcbind/Makefile
==
--- stable/11/usr.sbin/rpcbind/Makefile Sat Feb  4 15:55:31 2017
(r313209)
+++ stable/11/usr.sbin/rpcbind/Makefile Sat Feb  4 15:56:24 2017
(r313210)
@@ -8,18 +8,21 @@ MAN=  rpcbind.8
 SRCS=  check_bound.c rpcb_stat.c rpcb_svc_4.c rpcbind.c pmap_svc.c \
rpcb_svc.c rpcb_svc_com.c security.c warmstart.c util.c
 
-CFLAGS+= -DPORTMAP -DLIBWRAP
+CFLAGS+= -DPORTMAP
 
 .if ${MK_INET6_SUPPORT} != "no"
 CFLAGS+= -DINET6
 .endif
 
+.if ${MK_TCP_WRAPPERS} != "no"
+CFLAGS+=   -DLIBWRAP
+LIBADD+=   wrap
+.endif
+
 .if ${MK_TESTS} != "no"
 SUBDIR+=   tests
 .endif
 
 WARNS?=1
 
-LIBADD=wrap
-
 .include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313209 - stable/10/usr.sbin/rpcbind

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 15:55:31 2017
New Revision: 313209
URL: https://svnweb.freebsd.org/changeset/base/313209

Log:
  MFC r311470:
  
  Conditionalize wrap(3) use based on MK_TCP_WRAPPERS instead of
  always building support into rpcbind.

Modified:
  stable/10/usr.sbin/rpcbind/Makefile
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/rpcbind/Makefile
==
--- stable/10/usr.sbin/rpcbind/Makefile Sat Feb  4 15:53:34 2017
(r313208)
+++ stable/10/usr.sbin/rpcbind/Makefile Sat Feb  4 15:55:31 2017
(r313209)
@@ -8,19 +8,25 @@ MAN=  rpcbind.8
 SRCS=  check_bound.c rpcb_stat.c rpcb_svc_4.c rpcbind.c pmap_svc.c \
rpcb_svc.c rpcb_svc_com.c security.c warmstart.c util.c
 
-CFLAGS+= -DPORTMAP -DLIBWRAP
+CFLAGS+= -DPORTMAP
 
 .if ${MK_INET6_SUPPORT} != "no"
 CFLAGS+= -DINET6
 .endif
 
+.if ${MK_TCP_WRAPPERS} != "no"
+CFLAGS+=   -DLIBWRAP
+DPADD+=${LIBWRAP}
+LDADD+=-lwrap
+.endif
+
 .if ${MK_TESTS} != "no"
 SUBDIR+=   tests
 .endif
 
-WARNS?=1
+DPADD+=${LIBUTIL}
+LDADD+=-lutil
 
-DPADD= ${LIBWRAP} ${LIBUTIL}
-LDADD= -lwrap -lutil
+WARNS?=1
 
 .include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313208 - stable/11/share/misc

2017-02-04 Thread Sevan Janiyan
Author: sevan (doc committer)
Date: Sat Feb  4 15:53:34 2017
New Revision: 313208
URL: https://svnweb.freebsd.org/changeset/base/313208

Log:
  FreeBSD 11.0 release date added.

Modified:
  stable/11/share/misc/bsd-family-tree
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/misc/bsd-family-tree
==
--- stable/11/share/misc/bsd-family-treeSat Feb  4 15:52:49 2017
(r313207)
+++ stable/11/share/misc/bsd-family-treeSat Feb  4 15:53:34 2017
(r313208)
@@ -703,6 +703,7 @@ FreeBSD 10.32016-04-04 [FBD]
 NetBSD 7.0.1   2016-05-22 [NBD]
 DragonFly 4.6.02016-08-02 [DFB]
 OpenBSD 6.02016-09-01 [OBD]
+FreeBSD 11.0   2016-10-10 [FBD]
 
 Bibliography
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313207 - stable/11/share/misc

2017-02-04 Thread Sevan Janiyan
Author: sevan (doc committer)
Date: Sat Feb  4 15:52:49 2017
New Revision: 313207
URL: https://svnweb.freebsd.org/changeset/base/313207

Log:
  Add NetBSD 5.1.4, 5.2.2 & 7.0.1 releases to the tree.
  Ammend the position of NetBSD 6.0.2 release in the tree as it came
  after OpenBSD[1] & DragonFlyBSD[2] release according to the release
  information.
  The entries for the 6.0.5 & 6.1.5 releases were incorrect (fetched from
  NetBSD CVS copy) and confirmed with history page[3]
  
  [1] http://www.openbsd.org/53.html
  [2] https://www.dragonflybsd.org/releases/
  [3] http://netbsd.org/releases/formal.html#history
  
  Approved by:  bcr (mentor)
  Differential Revision:https://reviews.freebsd.org/D8099

Modified:
  stable/11/share/misc/bsd-family-tree
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/misc/bsd-family-tree
==
--- stable/11/share/misc/bsd-family-treeSat Feb  4 15:52:08 2017
(r313206)
+++ stable/11/share/misc/bsd-family-treeSat Feb  4 15:52:49 2017
(r313207)
@@ -258,6 +258,9 @@ FreeBSD 5.2   |  |  
  | |  8.3 |  | |  ||   |
  | |   |  |  | |   NetBSD  |   |
  | |   |  |  | |5.1.3  |   |
+ | |   |  |  | |  ||   |
+ | |   |  |  | |   NetBSD  |   |
+ | |   |  |  | |5.1.4  |   |
  | |   |  |  | |   OpenBSD 5.1 |
  | |   |   Mac OS X  | `.  |   |
  | |   | 10.8|   \ |   |
@@ -268,14 +271,17 @@ FreeBSD 5.2   |  |  
  | |   |  |  | | |||   |
  | |   |  |  | | | NetBSD  |   |
  | |   |  |  | | |  5.2.1  |   |
+ | |   |  |  | | |||   |
+ | |   |  |  | | | NetBSD  |   |
+ | |   |  |  | | |  5.2.2  |   |
  | |   |  |  | | | |   |
  | |   |  |  | |  \|   |
  | |   |  |  | |   NetBSD  |   |
  | |   |  |  | |6.0.1  |   |
- | |   |  |  | |  ||   |
+ | |   |  |  | |  |   OpenBSD 5.3  DragonFly 3.4.1
  | |   |  |  | |   NetBSD  |   |
  | |   |  |  | |6.0.2  |   |
- | |   |  |  | |  |   OpenBSD 5.3  DragonFly 3.4.1
+ | |   |  |  | |  ||   | 
  | |   |  |  | |   NetBSD  |   |
  | |   |  |  | |6.0.3  |   |
  | |   |  |  | |  ||   |
@@ -338,6 +344,7 @@ FreeBSD 5.2   |  |  
  | |  |  | |   DragonFly 4.4.1
  |  FreeBSD   |  |OpenBSD 5.9  |
  |   10.3 |  | |   |
+ ||   NetBSD 7.0.1 |   |
  ||  | |   DragonFly 4.6.0
  *--FreeBSD   |  |OpenBSD 6.0  |
  |   11.0 |  | |   |
@@ -661,12 +668,14 @@ Mac OS X 10.9 2013-10-22 [APL]
 OpenBSD 5.42013-11-01 [OBD]
 DragonFly 3.6.02013-11-25 [DFB]
 FreeBSD 10.0   2014-01-20 [FBD]
-NetBSD 6.0.4   2014-01-27 [NBD]
-NetBSD 6.1.3   2014-01-27 [NBD]
+NetBSD 5.1.4   2014-01-25 [NBD]
+NetBSD 5.2.2   2014-01-25 [NBD]
+NetBSD 6.0.4   2014-01-25 [NBD]
+NetBSD 6.1.3   2014-01-25 [NBD]
 DragonFly 3.6.12014-02-22 [DFB]
 DragonFly 3.6.22014-04-10 [DFB]
-NetBSD 6.0.5   2014-04-19 [NDB]
-NetBSD 6.1.4   2014-04-19 [NDB]
+NetBSD 6.0.5   2014-04-12 [NDB]
+NetBSD 6.1.4   2014-04-12 [NDB]
 OpenBSD 5.52014-05-01 [OBD]
 DragonFly 3.8.02014-06-04 [DFB]
 DragonFly 3.8.12014-06-16 [DFB]
@@ -691,6 +700,7 @@ OpenBSD 5.8 2015-10-18 [OBD]
 DragonFly 4.4.12015-12-07 [DFB]
 OpenBSD 5.92016-03-29 [OBD]
 FreeBSD 10.3   2016-04-04 [FBD]
+NetBSD 7.0.1   2016-05-22 [NBD]
 DragonFly 

svn commit: r313206 - stable/10/usr.sbin/inetd

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 15:52:08 2017
New Revision: 313206
URL: https://svnweb.freebsd.org/changeset/base/313206

Log:
  MFC r312105,r312162:
  
  r312105:
  
  Conditionalize libwrap support into inetd based on MK_TCP_WRAPPERS
  
  This will allow inetd to stand by itself without libwrap.
  
  Relnotes: yes
  
  r312162:
  
  Fix up r312105
  
  - Only #include tcpd.h when LIBWRAP is true to avoid header include errors
  - Only define whichaf when LIBWRAP is true to avoid -Wunused warning and
to avoid issues with structs being defined that should only be defined
when tcpd.h is included.
  
  Pointyhat to: ngie

Modified:
  stable/10/usr.sbin/inetd/Makefile
  stable/10/usr.sbin/inetd/inetd.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/inetd/Makefile
==
--- stable/10/usr.sbin/inetd/Makefile   Sat Feb  4 15:51:45 2017
(r313205)
+++ stable/10/usr.sbin/inetd/Makefile   Sat Feb  4 15:52:08 2017
(r313206)
@@ -16,8 +16,14 @@ CFLAGS+= -DLOGIN_CAP
 CFLAGS+= -DINET6
 .endif
 
-DPADD= ${LIBUTIL} ${LIBWRAP}
-LDADD= -lutil -lwrap
+DPADD+=${LIBUTIL}
+LDADD+=-lutil
+
+.if ${MK_TCP_WRAPPERS} != "no"
+CFLAGS+=   -DLIBWRAP
+DPADD+=${LIBWRAP}
+LDADD+=-lwrap
+.endif
 
 # XXX for src/release/picobsd
 .if !defined(RELEASE_CRUNCH)

Modified: stable/10/usr.sbin/inetd/inetd.c
==
--- stable/10/usr.sbin/inetd/inetd.cSat Feb  4 15:51:45 2017
(r313205)
+++ stable/10/usr.sbin/inetd/inetd.cSat Feb  4 15:52:08 2017
(r313206)
@@ -138,7 +138,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#ifdef LIBWRAP
 #include 
+#endif
 #include 
 
 #include "inetd.h"
@@ -297,6 +299,7 @@ getvalue(const char *arg, int *value, co
return 0;   /* success */
 }
 
+#ifdef LIBWRAP
 static sa_family_t
 whichaf(struct request_info *req)
 {
@@ -310,6 +313,7 @@ whichaf(struct request_info *req)
return AF_INET;
return sa->sa_family;
 }
+#endif
 
 int
 main(int argc, char **argv)
@@ -324,9 +328,11 @@ main(int argc, char **argv)
 #ifdef LOGIN_CAP
login_cap_t *lc = NULL;
 #endif
+#ifdef LIBWRAP
struct request_info req;
int denied;
char *service = NULL;
+#endif
struct sockaddr_storage peer;
int i;
struct addrinfo hints, *res;
@@ -736,6 +742,7 @@ main(int argc, char **argv)
_exit(0);
}
}
+#ifdef LIBWRAP
if (ISWRAP(sep)) {
inetd_setproctitle("wrapping", ctrl);
service = sep->se_server_name ?
@@ -764,6 +771,7 @@ main(int argc, char **argv)
(whichaf() == AF_INET6) ? "6" : "");
}
}
+#endif
if (sep->se_bi) {
(*sep->se_bi->bi_fn)(ctrl, sep);
} else {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313205 - stable/11/share/misc

2017-02-04 Thread Sevan Janiyan
Author: sevan (doc committer)
Date: Sat Feb  4 15:51:45 2017
New Revision: 313205
URL: https://svnweb.freebsd.org/changeset/base/313205

Log:
  OpenBSD 6.0 added.

Modified:
  stable/11/share/misc/bsd-family-tree
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/misc/bsd-family-tree
==
--- stable/11/share/misc/bsd-family-treeSat Feb  4 15:50:47 2017
(r313204)
+++ stable/11/share/misc/bsd-family-treeSat Feb  4 15:51:45 2017
(r313205)
@@ -339,7 +339,7 @@ FreeBSD 5.2   |  |  
  |  FreeBSD   |  |OpenBSD 5.9  |
  |   10.3 |  | |   |
  ||  | |   DragonFly 4.6.0
- *--FreeBSD   |  | |   |
+ *--FreeBSD   |  |OpenBSD 6.0  |
  |   11.0 |  | |   |
  ||  | |   |
  ||  | |   |
@@ -692,6 +692,7 @@ DragonFly 4.4.1 2015-12-07 [DFB]
 OpenBSD 5.92016-03-29 [OBD]
 FreeBSD 10.3   2016-04-04 [FBD]
 DragonFly 4.6.02016-08-02 [DFB]
+OpenBSD 6.02016-09-01 [OBD]
 
 Bibliography
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313204 - stable/11/share/misc

2017-02-04 Thread Sevan Janiyan
Author: sevan (doc committer)
Date: Sat Feb  4 15:50:47 2017
New Revision: 313204
URL: https://svnweb.freebsd.org/changeset/base/313204

Log:
  DragonFly 4.6.0 release added.

Modified:
  stable/11/share/misc/bsd-family-tree
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/misc/bsd-family-tree
==
--- stable/11/share/misc/bsd-family-treeSat Feb  4 15:49:50 2017
(r313203)
+++ stable/11/share/misc/bsd-family-treeSat Feb  4 15:50:47 2017
(r313204)
@@ -338,7 +338,7 @@ FreeBSD 5.2   |  |  
  | |  |  | |   DragonFly 4.4.1
  |  FreeBSD   |  |OpenBSD 5.9  |
  |   10.3 |  | |   |
- ||  | |   |
+ ||  | |   DragonFly 4.6.0
  *--FreeBSD   |  | |   |
  |   11.0 |  | |   |
  ||  | |   |
@@ -691,6 +691,7 @@ OpenBSD 5.8 2015-10-18 [OBD]
 DragonFly 4.4.12015-12-07 [DFB]
 OpenBSD 5.92016-03-29 [OBD]
 FreeBSD 10.3   2016-04-04 [FBD]
+DragonFly 4.6.02016-08-02 [DFB]
 
 Bibliography
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313203 - stable/11/usr.sbin/inetd

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 15:49:50 2017
New Revision: 313203
URL: https://svnweb.freebsd.org/changeset/base/313203

Log:
  MFC r312105,r312162:
  
  r312105:
  
  Conditionalize libwrap support into inetd based on MK_TCP_WRAPPERS
  
  This will allow inetd to stand by itself without libwrap.
  
  Relnotes: yes
  
  r312162:
  
  Fix up r312105
  
  - Only #include tcpd.h when LIBWRAP is true to avoid header include errors
  - Only define whichaf when LIBWRAP is true to avoid -Wunused warning and
to avoid issues with structs being defined that should only be defined
when tcpd.h is included.
  
  Pointyhat to: ngie

Modified:
  stable/11/usr.sbin/inetd/Makefile
  stable/11/usr.sbin/inetd/inetd.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/inetd/Makefile
==
--- stable/11/usr.sbin/inetd/Makefile   Sat Feb  4 15:48:53 2017
(r313202)
+++ stable/11/usr.sbin/inetd/Makefile   Sat Feb  4 15:49:50 2017
(r313203)
@@ -16,7 +16,12 @@ CFLAGS+= -DLOGIN_CAP
 CFLAGS+= -DINET6
 .endif
 
-LIBADD=util wrap
+LIBADD=util
+
+.if ${MK_TCP_WRAPPERS} != "no"
+CFLAGS+=   -DLIBWRAP
+LIBADD+=   wrap
+.endif
 
 # XXX for src/release/picobsd
 .if !defined(RELEASE_CRUNCH)

Modified: stable/11/usr.sbin/inetd/inetd.c
==
--- stable/11/usr.sbin/inetd/inetd.cSat Feb  4 15:48:53 2017
(r313202)
+++ stable/11/usr.sbin/inetd/inetd.cSat Feb  4 15:49:50 2017
(r313203)
@@ -138,7 +138,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#ifdef LIBWRAP
 #include 
+#endif
 #include 
 
 #include "inetd.h"
@@ -297,6 +299,7 @@ getvalue(const char *arg, int *value, co
return 0;   /* success */
 }
 
+#ifdef LIBWRAP
 static sa_family_t
 whichaf(struct request_info *req)
 {
@@ -310,6 +313,7 @@ whichaf(struct request_info *req)
return AF_INET;
return sa->sa_family;
 }
+#endif
 
 int
 main(int argc, char **argv)
@@ -324,9 +328,11 @@ main(int argc, char **argv)
 #ifdef LOGIN_CAP
login_cap_t *lc = NULL;
 #endif
+#ifdef LIBWRAP
struct request_info req;
int denied;
char *service = NULL;
+#endif
struct sockaddr_storage peer;
int i;
struct addrinfo hints, *res;
@@ -736,6 +742,7 @@ main(int argc, char **argv)
_exit(0);
}
}
+#ifdef LIBWRAP
if (ISWRAP(sep)) {
inetd_setproctitle("wrapping", ctrl);
service = sep->se_server_name ?
@@ -764,6 +771,7 @@ main(int argc, char **argv)
(whichaf() == AF_INET6) ? "6" : "");
}
}
+#endif
if (sep->se_bi) {
(*sep->se_bi->bi_fn)(ctrl, sep);
} else {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313202 - stable/11/share/misc

2017-02-04 Thread Sevan Janiyan
Author: sevan (doc committer)
Date: Sat Feb  4 15:48:53 2017
New Revision: 313202
URL: https://svnweb.freebsd.org/changeset/base/313202

Log:
  Fix the previous commit to the family tree file.  It is too early
  to list 11.0, and we do not list -CURRENT here.
  
  Submitted by: maxim
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/11/share/misc/bsd-family-tree
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/misc/bsd-family-tree
==
--- stable/11/share/misc/bsd-family-treeSat Feb  4 15:45:51 2017
(r313201)
+++ stable/11/share/misc/bsd-family-treeSat Feb  4 15:48:53 2017
(r313202)
@@ -691,8 +691,6 @@ OpenBSD 5.8 2015-10-18 [OBD]
 DragonFly 4.4.12015-12-07 [DFB]
 OpenBSD 5.92016-03-29 [OBD]
 FreeBSD 10.3   2016-04-04 [FBD]
-FreeBSD 11.0   2016-06-08 [FBD]
-FreeBSD 12.0   2016-06-09 [FBD]
 
 Bibliography
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313201 - stable/10/contrib/bsnmp/lib

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 15:45:51 2017
New Revision: 313201
URL: https://svnweb.freebsd.org/changeset/base/313201

Log:
  MFC r311263:
  
  Use calloc instead of malloc with buffers in snmp_{recv,send}_packet
  
  This doesn't fix the issue noted in the PR, but at the very least it
  cleans up the error so it looks a bit more sane, and in the event
  that bsnmp did wander off into the weeds, the likelihood of it
  crashing with more sensible output is greater, in my opinion
  
  MFC counter set high so I have enough time to resolve the real
  underlying bug in bsnmpwalk
  
  PR:   215721

Modified:
  stable/10/contrib/bsnmp/lib/snmpclient.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/contrib/bsnmp/lib/snmpclient.c
==
--- stable/10/contrib/bsnmp/lib/snmpclient.cSat Feb  4 15:45:39 2017
(r313200)
+++ stable/10/contrib/bsnmp/lib/snmpclient.cSat Feb  4 15:45:51 2017
(r313201)
@@ -1234,7 +1234,7 @@ snmp_send_packet(struct snmp_pdu * pdu)
 struct asn_buf b;
 ssize_t ret;
 
-   if ((buf = malloc(snmp_client.txbuflen)) == NULL) {
+   if ((buf = calloc(1, snmp_client.txbuflen)) == NULL) {
seterr(_client, "%s", strerror(errno));
return (-1);
}
@@ -1259,7 +1259,7 @@ snmp_send_packet(struct snmp_pdu * pdu)
}
free(buf);
 
-   return pdu->request_id;
+   return (pdu->request_id);
 }
 
 /*
@@ -1355,7 +1355,7 @@ snmp_receive_packet(struct snmp_pdu *pdu
socklen_t optlen;
 #endif
 
-   if ((buf = malloc(snmp_client.rxbuflen)) == NULL) {
+   if ((buf = calloc(1, snmp_client.rxbuflen)) == NULL) {
seterr(_client, "%s", strerror(errno));
return (-1);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313200 - stable/11/contrib/bsnmp/lib

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 15:45:39 2017
New Revision: 313200
URL: https://svnweb.freebsd.org/changeset/base/313200

Log:
  MFC r311263:
  
  Use calloc instead of malloc with buffers in snmp_{recv,send}_packet
  
  This doesn't fix the issue noted in the PR, but at the very least it
  cleans up the error so it looks a bit more sane, and in the event
  that bsnmp did wander off into the weeds, the likelihood of it
  crashing with more sensible output is greater, in my opinion
  
  MFC counter set high so I have enough time to resolve the real
  underlying bug in bsnmpwalk
  
  PR:   215721

Modified:
  stable/11/contrib/bsnmp/lib/snmpclient.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/bsnmp/lib/snmpclient.c
==
--- stable/11/contrib/bsnmp/lib/snmpclient.cSat Feb  4 15:44:49 2017
(r313199)
+++ stable/11/contrib/bsnmp/lib/snmpclient.cSat Feb  4 15:45:39 2017
(r313200)
@@ -1234,7 +1234,7 @@ snmp_send_packet(struct snmp_pdu * pdu)
struct asn_buf b;
ssize_t ret;
 
-   if ((buf = malloc(snmp_client.txbuflen)) == NULL) {
+   if ((buf = calloc(1, snmp_client.txbuflen)) == NULL) {
seterr(_client, "%s", strerror(errno));
return (-1);
}
@@ -1259,7 +1259,7 @@ snmp_send_packet(struct snmp_pdu * pdu)
}
free(buf);
 
-   return pdu->request_id;
+   return (pdu->request_id);
 }
 
 /*
@@ -1355,7 +1355,7 @@ snmp_receive_packet(struct snmp_pdu *pdu
socklen_t optlen;
 #endif
 
-   if ((buf = malloc(snmp_client.rxbuflen)) == NULL) {
+   if ((buf = calloc(1, snmp_client.rxbuflen)) == NULL) {
seterr(_client, "%s", strerror(errno));
return (-1);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313198 - stable/11/lib

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 15:43:54 2017
New Revision: 313198
URL: https://svnweb.freebsd.org/changeset/base/313198

Log:
  MFC r312937:
  
  Fix typo in lib/Makefile
  
  The SUBDIR_DEPEND variable should be for librpcsec_gss, not
  liblibrpc_gss
  
  PR:   216409

Modified:
  stable/11/lib/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/Makefile
==
--- stable/11/lib/Makefile  Sat Feb  4 15:41:59 2017(r313197)
+++ stable/11/lib/Makefile  Sat Feb  4 15:43:54 2017(r313198)
@@ -142,7 +142,7 @@ SUBDIR_DEPEND_libdevstat= libkvm
 SUBDIR_DEPEND_libdpv= libfigpar ncurses libutil
 SUBDIR_DEPEND_libedit= ncurses
 SUBDIR_DEPEND_libgeom= libexpat libsbuf
-SUBDIR_DEPEND_liblibrpcsec_gss= libgssapi
+SUBDIR_DEPEND_librpcsec_gss= libgssapi
 SUBDIR_DEPEND_libmagic= libz
 SUBDIR_DEPEND_libmemstat= libkvm
 SUBDIR_DEPEND_libopie= libmd
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313199 - stable/10/lib

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 15:44:49 2017
New Revision: 313199
URL: https://svnweb.freebsd.org/changeset/base/313199

Log:
  MFC r312937:
  
  Fix typo in lib/Makefile
  
  The SUBDIR_DEPEND variable should be for librpcsec_gss, not
  liblibrpc_gss
  
  PR:   216409

Modified:
  stable/10/lib/Makefile
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/lib/Makefile
==
--- stable/10/lib/Makefile  Sat Feb  4 15:43:54 2017(r313198)
+++ stable/10/lib/Makefile  Sat Feb  4 15:44:49 2017(r313199)
@@ -130,7 +130,7 @@ SUBDIR_DEPEND_libdpv= libfigpar ncurses 
 SUBDIR_DEPEND_libedit= ncurses
 SUBDIR_DEPEND_libg++= msun
 SUBDIR_DEPEND_libgeom= libexpat libsbuf
-SUBDIR_DEPEND_liblibrpcsec_gss= libgssapi
+SUBDIR_DEPEND_librpcsec_gss= libgssapi
 SUBDIR_DEPEND_libmagic= libz
 SUBDIR_DEPEND_libmemstat= libkvm
 SUBDIR_DEPEND_libopie= libmd
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313197 - stable/11/share/misc

2017-02-04 Thread Sevan Janiyan
Author: sevan (doc committer)
Date: Sat Feb  4 15:41:59 2017
New Revision: 313197
URL: https://svnweb.freebsd.org/changeset/base/313197

Log:
  Belatedly add FreeBSD 11.0 and 12.0 to the family tree file.
  
  Submitted by: des (a while back)
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/11/share/misc/bsd-family-tree

Modified: stable/11/share/misc/bsd-family-tree
==
--- stable/11/share/misc/bsd-family-treeSat Feb  4 15:41:44 2017
(r313196)
+++ stable/11/share/misc/bsd-family-treeSat Feb  4 15:41:59 2017
(r313197)
@@ -339,7 +339,11 @@ FreeBSD 5.2   |  |  
  |  FreeBSD   |  |OpenBSD 5.9  |
  |   10.3 |  | |   |
  ||  | |   |
-FreeBSD 11 -current   |  NetBSD -current  OpenBSD -current DragonFly 
-current
+ *--FreeBSD   |  | |   |
+ |   11.0 |  | |   |
+ ||  | |   |
+ ||  | |   |
+FreeBSD 12 -current   |  NetBSD -current  OpenBSD -current DragonFly 
-current
  ||  | |   |
  vv  v v   v
 
@@ -687,6 +691,8 @@ OpenBSD 5.8 2015-10-18 [OBD]
 DragonFly 4.4.12015-12-07 [DFB]
 OpenBSD 5.92016-03-29 [OBD]
 FreeBSD 10.3   2016-04-04 [FBD]
+FreeBSD 11.0   2016-06-08 [FBD]
+FreeBSD 12.0   2016-06-09 [FBD]
 
 Bibliography
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313196 - stable/11/sys/modules

2017-02-04 Thread Ngie Cooper
Author: ngie
Date: Sat Feb  4 15:41:44 2017
New Revision: 313196
URL: https://svnweb.freebsd.org/changeset/base/313196

Log:
  MFC r312935:
  
  Remove duplicate bhnd SUBDIR entry
  
  PR:   216413

Modified:
  stable/11/sys/modules/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/modules/Makefile
==
--- stable/11/sys/modules/Makefile  Sat Feb  4 14:10:16 2017
(r313195)
+++ stable/11/sys/modules/Makefile  Sat Feb  4 15:41:44 2017
(r313196)
@@ -50,7 +50,6 @@ SUBDIR=   \
${_auxio} \
${_bce} \
bfe \
-   bhnd \
bge \
bhnd \
${_bxe} \
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313195 - in head/sbin: decryptcore savecore

2017-02-04 Thread Konrad Witaszczyk
Author: def
Date: Sat Feb  4 14:10:16 2017
New Revision: 313195
URL: https://svnweb.freebsd.org/changeset/base/313195

Log:
  Fix bugs found by Coverity in decryptcore(8) and savecore(8):
  - Perform final decryption and write decrypted data in case of non-block 
aligned
  input data;
  - Use strlcpy(3) instead of strncpy(3) to verify if paths aren't too long;
  - Check errno after calling unlink(2) instead of calling stat(2) in order to
  verify if a decrypted core was created by a child process;
  - Free dumpkey.
  
  Reported by:  Coverity, cem, pfg
  Suggested by: cem
  CID:  1366936, 1366942, 1366951, 1366952
  Approved by:  pjd (mentor)

Modified:
  head/sbin/decryptcore/decryptcore.c
  head/sbin/savecore/savecore.c

Modified: head/sbin/decryptcore/decryptcore.c
==
--- head/sbin/decryptcore/decryptcore.c Sat Feb  4 12:26:38 2017
(r313194)
+++ head/sbin/decryptcore/decryptcore.c Sat Feb  4 14:10:16 2017
(r313195)
@@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
@@ -232,8 +231,6 @@ decrypt(const char *privkeyfile, const c
pjdlog_errno(LOG_ERR, "Unable to read data from %s",
input);
goto failed;
-   } else if (bytes == 0) {
-   break;
}
 
if (bytes > 0) {
@@ -249,10 +246,7 @@ decrypt(const char *privkeyfile, const c
}
}
 
-   if (olen == 0)
-   continue;
-
-   if (write(ofd, buf, olen) != olen) {
+   if (olen > 0 && write(ofd, buf, olen) != olen) {
pjdlog_errno(LOG_ERR, "Unable to write data to %s",
output);
goto failed;
@@ -274,7 +268,6 @@ int
 main(int argc, char **argv)
 {
char core[PATH_MAX], encryptedcore[PATH_MAX], keyfile[PATH_MAX];
-   struct stat sb;
const char *crashdir, *dumpnr, *privatekey;
int ch, debug;
size_t ii;
@@ -297,16 +290,23 @@ main(int argc, char **argv)
usesyslog = true;
break;
case 'c':
-   strncpy(core, optarg, sizeof(core));
+   if (strlcpy(core, optarg, sizeof(core)) >= sizeof(core))
+   pjdlog_exitx(1, "Core file path is too long.");
break;
case 'd':
crashdir = optarg;
break;
case 'e':
-   strncpy(encryptedcore, optarg, sizeof(encryptedcore));
+   if (strlcpy(encryptedcore, optarg,
+   sizeof(encryptedcore)) >= sizeof(encryptedcore)) {
+   pjdlog_exitx(1, "Encrypted core file path is 
too long.");
+   }
break;
case 'k':
-   strncpy(keyfile, optarg, sizeof(keyfile));
+   if (strlcpy(keyfile, optarg, sizeof(keyfile)) >=
+   sizeof(keyfile)) {
+   pjdlog_exitx(1, "Key file path is too long.");
+   }
break;
case 'n':
dumpnr = optarg;
@@ -362,7 +362,7 @@ main(int argc, char **argv)
pjdlog_debug_set(debug);
 
if (!decrypt(privatekey, keyfile, encryptedcore, core)) {
-   if (stat(core, ) == 0 && unlink(core) != 0)
+   if (unlink(core) == -1 && errno != ENOENT)
pjdlog_exit(1, "Unable to remove core");
exit(1);
}

Modified: head/sbin/savecore/savecore.c
==
--- head/sbin/savecore/savecore.c   Sat Feb  4 12:26:38 2017
(r313194)
+++ head/sbin/savecore/savecore.c   Sat Feb  4 14:10:16 2017
(r313195)
@@ -478,6 +478,7 @@ DoFile(const char *savedir, const char *
bool isencrypted, ret;
 
bounds = getbounds();
+   dumpkey = NULL;
mediasize = 0;
status = STATUS_UNKNOWN;
 
@@ -816,6 +817,7 @@ nuke:
}
xo_close_container_h(xostdout, "crashdump");
xo_finish_h(xostdout);
+   free(dumpkey);
free(temp);
close(fd);
return;
@@ -824,6 +826,7 @@ closeall:
fclose(fp);
 
 closefd:
+   free(dumpkey);
free(temp);
close(fd);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313194 - in head/sys: arm/include arm64/include mips/include powerpc/include riscv/include sparc64/include sys x86/include

2017-02-04 Thread Konstantin Belousov
Author: kib
Date: Sat Feb  4 12:26:38 2017
New Revision: 313194
URL: https://svnweb.freebsd.org/changeset/base/313194

Log:
  Define the vm_ooffset_t and vm_pindex_t types as machine-independend.
  
  The types are for the byte offset and page index in vm object.  They
  are similar to off_t, which is defined as 64bit MI integer.  Using MI
  definitions will allow to provide consistent MD values of vm
  object-related maximum sizes.
  
  Reviewed by:  alc
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/arm/include/_types.h
  head/sys/arm64/include/_types.h
  head/sys/mips/include/_types.h
  head/sys/powerpc/include/_types.h
  head/sys/riscv/include/_types.h
  head/sys/sparc64/include/_types.h
  head/sys/sys/types.h
  head/sys/x86/include/_types.h

Modified: head/sys/arm/include/_types.h
==
--- head/sys/arm/include/_types.h   Sat Feb  4 06:24:49 2017
(r313193)
+++ head/sys/arm/include/_types.h   Sat Feb  4 12:26:38 2017
(r313194)
@@ -100,9 +100,7 @@ typedef __uint32_t  __uint_least32_t;
 typedef__uint64_t  __uint_least64_t;
 typedef__uint32_t  __u_register_t;
 typedef__uint32_t  __vm_offset_t;
-typedef__int64_t   __vm_ooffset_t;
 typedef__uint32_t  __vm_paddr_t;
-typedef__uint64_t  __vm_pindex_t;
 typedef__uint32_t  __vm_size_t;
 
 typedefunsigned int___wchar_t;

Modified: head/sys/arm64/include/_types.h
==
--- head/sys/arm64/include/_types.h Sat Feb  4 06:24:49 2017
(r313193)
+++ head/sys/arm64/include/_types.h Sat Feb  4 12:26:38 2017
(r313194)
@@ -88,9 +88,7 @@ typedef   __uint32_t  __uint_least32_t;
 typedef__uint64_t  __uint_least64_t;
 typedef__uint64_t  __u_register_t;
 typedef__uint64_t  __vm_offset_t;
-typedef__int64_t   __vm_ooffset_t;
 typedef__uint64_t  __vm_paddr_t;
-typedef__uint64_t  __vm_pindex_t;
 typedef__uint64_t  __vm_size_t;
 typedefunsigned int___wchar_t;
 

Modified: head/sys/mips/include/_types.h
==
--- head/sys/mips/include/_types.h  Sat Feb  4 06:24:49 2017
(r313193)
+++ head/sys/mips/include/_types.h  Sat Feb  4 12:26:38 2017
(r313194)
@@ -143,8 +143,6 @@ typedef __uint64_t  __vm_paddr_t;
 typedef__uint32_t  __vm_paddr_t;
 #endif
 
-typedef__int64_t   __vm_ooffset_t;
-typedef__uint64_t  __vm_pindex_t;
 typedefint ___wchar_t;
 
 #define__WCHAR_MIN __INT_MIN   /* min value for a wchar_t */

Modified: head/sys/powerpc/include/_types.h
==
--- head/sys/powerpc/include/_types.h   Sat Feb  4 06:24:49 2017
(r313193)
+++ head/sys/powerpc/include/_types.h   Sat Feb  4 12:26:38 2017
(r313194)
@@ -135,8 +135,6 @@ typedef __uint32_t  __vm_paddr_t;
 #endif
 typedef__uint32_t  __vm_size_t;
 #endif
-typedef__int64_t   __vm_ooffset_t;
-typedef__uint64_t  __vm_pindex_t;
 typedefint ___wchar_t;
 
 #define__WCHAR_MIN __INT_MIN   /* min value for a wchar_t */

Modified: head/sys/riscv/include/_types.h
==
--- head/sys/riscv/include/_types.h Sat Feb  4 06:24:49 2017
(r313193)
+++ head/sys/riscv/include/_types.h Sat Feb  4 12:26:38 2017
(r313194)
@@ -88,9 +88,7 @@ typedef   __uint32_t  __uint_least32_t;
 typedef__uint64_t  __uint_least64_t;
 typedef__uint64_t  __u_register_t;
 typedef__uint64_t  __vm_offset_t;
-typedef__int64_t   __vm_ooffset_t;
 typedef__uint64_t  __vm_paddr_t;
-typedef__uint64_t  __vm_pindex_t;
 typedef__uint64_t  __vm_size_t;
 typedefint ___wchar_t;
 

Modified: head/sys/sparc64/include/_types.h
==
--- head/sys/sparc64/include/_types.h   Sat Feb  4 06:24:49 2017
(r313193)
+++ head/sys/sparc64/include/_types.h   Sat Feb  4 12:26:38 2017
(r313194)
@@ -88,9 +88,7 @@ typedef   __uint32_t  __uint_least32_t;
 typedef__uint64_t  __uint_least64_t;
 typedef__uint64_t  __u_register_t;
 typedef__uint64_t  __vm_offset_t;
-typedef__int64_t   __vm_ooffset_t;
 typedef__uint64_t  __vm_paddr_t;
-typedef__uint64_t  __vm_pindex_t;
 typedef__uint64_t  __vm_size_t;
 typedefint ___wchar_t;
 

Modified: 

Re: svn commit: r313037 - in head/sys: amd64/include kern mips/include net powerpc/include sparc64/include

2017-02-04 Thread Andreas Tobler

On 04.02.17 07:27, Jason Harmening wrote:

It's hard to argue with that:)  I've backed it out until we can figure
out what's going on.
Sorry for the breakage.



For the record, powerpc64 was also affected.

Andreas


On Fri, Feb 3, 2017 at 9:54 PM, Kurt Lidl > wrote:

Having just spent a couple of hours bisecting what broke the kernel on
my mips64 machine, I can definitively state it was this commit.

With this commit in place, the kernel hangs early in the
autoconfiguration:

gcc version 4.2.1 20070831 patched [FreeBSD]
Preloaded elf kernel "kernel" at 0x80aa96a0.
real memory  = 523239424 (510976K bytes)
Physical memory chunk(s):
0x00bf3000 - 0x080d5fff, 122564608 bytes (29923 pages)
0x08101000 - 0x0ff00fff, 132120576 bytes (32256 pages)
0x41000 - 0x41f196fff, 253325312 bytes (61847 pages)
avail memory = 504360960 (480MB)
Create COP2 context zone
AP #1 started!
FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
 hangs here 

-Kurt

On 2/4/17 12:29 AM, Jason Harmening wrote:

Hi,

I'm a bit confused as to how this change breaks MIPS.  The new
function,
get_pcpu() is intended to be used only to access the per-cpu data
pointer locally.  It returns pcpup, which is the per-cpu pointer
wired
into the local TLB to translate to the local CPU's physical data
region,
correct?

This is the same value used by the per-CPU accessors such as
PCPU_ADD
and PCPU_GET.  The MI portions of this change only use get_pcpu() to
access  the local CPU's data, e.g. under a critical section in the
rmlock.  It is not intended to be used for iterating all CPUs.

If I've missed something and MIPS is truly broken by this, then I'll
gladly revert, but (maybe because it's late) I'm not seeing
where this
goes wrong on MIPS.

Thanks,
Jason

On Fri, Feb 3, 2017 at 8:12 PM, Alexander Kabaev

>> wrote:

On Wed, 1 Feb 2017 03:32:49 + (UTC)
"Jason A. Harmening"  wrote:

> Author: jah
> Date: Wed Feb  1 03:32:49 2017
> New Revision: 313037
> URL: https://svnweb.freebsd.org/changeset/base/313037

>
>
> Log:
>   Implement get_pcpu() for the remaining architectures and
use it to
>   replace pcpu_find(curcpu) in MI code.
>
> Modified:
>   head/sys/amd64/include/pcpu.h
>   head/sys/kern/kern_rmlock.c
>   head/sys/mips/include/pcpu.h
>   head/sys/net/netisr.c
>   head/sys/powerpc/include/cpufunc.h
>   head/sys/powerpc/include/pcpu.h
>   head/sys/sparc64/include/pcpu.h
>

Hi,

this change was not reviewed nor testing was thought for all
architectures it touches. The change happens to break MIPS quite
thoroughly, since MIPS is using different pointers when
accessing PCPU
area locally and when doing iterations using cpu_to_cpuid
array. I
therefore officially am requesting this change to be
reverted until
reasonable solution is found to unbreak architectures that
use wired
TLBs to access local per-CPU data.

--
Alexander Kabaev






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