svn commit: r292531 - head/tools/regression/mac/mac_bsdextended

2015-12-21 Thread Garrett Cooper
Author: ngie
Date: Mon Dec 21 08:14:45 2015
New Revision: 292531
URL: https://svnweb.freebsd.org/changeset/base/292531

Log:
  Make test_matches.sh into a series of TAP testcases
  
  Use temporary filesystems / memory disks instead of a hardcoded path
  which doesn't exist on test systems
  
  MFC after: 2 weeks
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/tools/regression/mac/mac_bsdextended/test_matches.sh

Modified: head/tools/regression/mac/mac_bsdextended/test_matches.sh
==
--- head/tools/regression/mac/mac_bsdextended/test_matches.sh   Mon Dec 21 
07:04:01 2015(r292530)
+++ head/tools/regression/mac/mac_bsdextended/test_matches.sh   Mon Dec 21 
08:14:45 2015(r292531)
@@ -10,158 +10,185 @@ uidoutrange="daemon"
 gidinrange="nobody" # We expect $uidinrange in this group
 gidoutrange="daemon" # We expect $uidinrange in this group
 
-playground="/stuff/nobody/" # Must not be on root fs
-
 #
 # Setup
 #
-rm -f $playground/test*
+
+: ${TMPDIR=/tmp}
+if [ $(id -u) -ne 0 ]; then
+   echo "1..0 # SKIP test must be run as root"
+   exit 0
+fi
+if ! playground=$(mktemp -d $TMPDIR/tmp.XXX); then
+   echo "1..0 # SKIP failed to create temporary directory"
+   exit 0
+fi
+trap "rmdir $playground" EXIT INT TERM
+if ! mdmfs -s 25m md $playground; then
+   echo "1..0 # SKIP failed to mount md device"
+   exit 0
+fi
+chmod a+rwx $playground
+md_device=$(mount -p | grep "$playground" | awk '{ gsub(/^\/dev\//, "", $1); 
print $1 }')
+trap "umount -f $playground; mdconfig -d -u $md_device; rmdir $playground" 
EXIT INT TERM
+if [ -z "$md_device" ]; then
+   mount -p | grep $playground
+   echo "1..0 # md device not properly attached to the system"
+fi
+
 ugidfw remove 1
 
 file1=$playground/test-$uidinrange
 file2=$playground/test-$uidoutrange
-cat < $playground/test-script.pl
-if (open(F, ">" . shift)) { exit 0; } else { exit 1; }
+cat > $playground/test-script.sh <<'EOF'
+#!/bin/sh
+: > $1
 EOF
-command1="perl $playground/test-script.pl $file1"
-command2="perl $playground/test-script.pl $file2"
+if [ $? -ne 0 ]; then
+   echo "1..0 # SKIP failed to create test script"
+   exit 0
+fi
+echo "1..30"
+
+command1="sh $playground/test-script.sh $file1"
+command2="sh $playground/test-script.sh $file2"
 
-echo -n "$uidinrange file: "
-su -m $uidinrange -c "$command1 && echo good"
+echo "# $uidinrange file:"
+su -m $uidinrange -c "if $command1; then echo ok; else echo not ok; fi"
 chown "$uidinrange":"$gidinrange" $file1
 chmod a+w $file1
 
-echo -n "$uidoutrange file: "
-$command2 && echo good
+echo "# $uidoutrange file:"
+if $command2; then echo ok; else echo not ok; fi
 chown "$uidoutrange":"$gidoutrange" $file2
 chmod a+w $file2
 
 #
 # No rules
 #
-echo -n "no rules $uidinrange: "
-su -fm $uidinrange -c "$command1 && echo good"
-echo -n "no rules $uidoutrange: "
-su -fm $uidoutrange -c "$command1 && echo good"
+echo "# no rules $uidinrange:"
+su -fm $uidinrange -c "if $command1; then echo ok; else echo not ok; fi"
+echo "# no rules $uidoutrange:"
+su -fm $uidoutrange -c "if $command1; then echo ok; else echo not ok; fi"
 
 #
 # Subject Match on uid
 #
 ugidfw set 1 subject uid $uidrange object mode rasx
-echo -n "subject uid in range: "
-su -fm $uidinrange -c "$command1 || echo good"
-echo -n "subject uid out range: "
-su -fm $uidoutrange -c "$command1 && echo good"
+echo "# subject uid in range:"
+su -fm $uidinrange -c "if $command1; then echo not ok; else echo ok; fi"
+echo "# subject uid out range:"
+su -fm $uidoutrange -c "if $command1; then echo ok; else echo not ok; fi"
 
 #
 # Subject Match on gid
 #
 ugidfw set 1 subject gid $gidrange object mode rasx
-echo -n "subject gid in range: "
-su -fm $uidinrange -c "$command1 || echo good"
-echo -n "subject gid out range: "
-su -fm $uidoutrange -c "$command1 && echo good"
+echo "# subject gid in range:"
+su -fm $uidinrange -c "if $command1; then echo not ok; else echo ok; fi"
+echo "# subject gid out range:"
+su -fm $uidoutrange -c "if $command1; then echo ok; else echo not ok; fi"
 
 #
 # Subject Match on jail
 #
-echo -n "subject matching jailid: "
 rm -f $playground/test-jail
-jailid=`jail -i / localhost 127.0.0.1 /usr/sbin/daemon -f /bin/sh -c "(sleep 
3; touch $playground/test-jail) &"`
+echo "# subject matching jailid:"
+jailid=`jail -i / localhost 127.0.0.1 /usr/sbin/daemon -f /bin/sh -c "(sleep 
5; touch $playground/test-jail) &"`
 ugidfw set 1 subject jailid $jailid object mode rasx
-sleep 6
-if [ ! -f $playground/test-jail ] ; then echo good ; fi
+sleep 10
+if [ -f $playground/test-jail ]; then echo not ok; else echo ok; fi
 
-echo -n "subject nonmatching jailid: "
 rm -f $playground/test-jail
-jailid=`jail -i / localhost 127.0.0.1 /usr/sbin/daemon -f /bin/sh -c "(sleep 
3; touch $playground/test-jail) &"`
-sleep 6
-if [ -f $playground/test-jail ] ; then echo good ; fi
+echo "# subject nonmatching jailid:"
+jail

svn commit: r292532 - head/tools/regression/mac/mac_bsdextended

2015-12-21 Thread Garrett Cooper
Author: ngie
Date: Mon Dec 21 08:53:26 2015
New Revision: 292532
URL: https://svnweb.freebsd.org/changeset/base/292532

Log:
  Mark `subject matching jailid` testcase as an unexpected failure with
  TODO to ensure that the testcase isn't marked as a failure
  
  PR: 205481
  MFC after: 2 weeks
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/tools/regression/mac/mac_bsdextended/test_matches.sh

Modified: head/tools/regression/mac/mac_bsdextended/test_matches.sh
==
--- head/tools/regression/mac/mac_bsdextended/test_matches.sh   Mon Dec 21 
08:14:45 2015(r292531)
+++ head/tools/regression/mac/mac_bsdextended/test_matches.sh   Mon Dec 21 
08:53:26 2015(r292532)
@@ -97,7 +97,7 @@ echo "# subject matching jailid:"
 jailid=`jail -i / localhost 127.0.0.1 /usr/sbin/daemon -f /bin/sh -c "(sleep 
5; touch $playground/test-jail) &"`
 ugidfw set 1 subject jailid $jailid object mode rasx
 sleep 10
-if [ -f $playground/test-jail ]; then echo not ok; else echo ok; fi
+if [ -f $playground/test-jail ]; then echo "not ok # TODO this testcase is 
buggy (see bug # 205481)"; else echo ok; fi
 
 rm -f $playground/test-jail
 echo "# subject nonmatching jailid:"
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292533 - head/tools/regression/mac/mac_bsdextended

2015-12-21 Thread Garrett Cooper
Author: ngie
Date: Mon Dec 21 08:58:14 2015
New Revision: 292533
URL: https://svnweb.freebsd.org/changeset/base/292533

Log:
  Skip the testcases if mac_bsdextended(4) isn't detected on the
  system
  
  MFC after: 2 weeks
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/tools/regression/mac/mac_bsdextended/test_matches.sh

Modified: head/tools/regression/mac/mac_bsdextended/test_matches.sh
==
--- head/tools/regression/mac/mac_bsdextended/test_matches.sh   Mon Dec 21 
08:53:26 2015(r292532)
+++ head/tools/regression/mac/mac_bsdextended/test_matches.sh   Mon Dec 21 
08:58:14 2015(r292533)
@@ -19,6 +19,10 @@ if [ $(id -u) -ne 0 ]; then
echo "1..0 # SKIP test must be run as root"
exit 0
 fi
+if ! sysctl -N security.mac.bsdextended >/dev/null 2>&1; then
+   echo "1..0 # SKIP mac_bsdextended(4) support isn't available"
+   exit 0
+fi
 if ! playground=$(mktemp -d $TMPDIR/tmp.XXX); then
echo "1..0 # SKIP failed to create temporary directory"
exit 0
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292536 - head/sys/modules/tcp/fastpath

2015-12-21 Thread Ulrich Spoerlein
Author: uqs
Date: Mon Dec 21 09:38:45 2015
New Revision: 292536
URL: https://svnweb.freebsd.org/changeset/base/292536

Log:
  Fix 'make depend'

Modified:
  head/sys/modules/tcp/fastpath/Makefile

Modified: head/sys/modules/tcp/fastpath/Makefile
==
--- head/sys/modules/tcp/fastpath/Makefile  Mon Dec 21 09:36:45 2015
(r292535)
+++ head/sys/modules/tcp/fastpath/Makefile  Mon Dec 21 09:38:45 2015
(r292536)
@@ -7,6 +7,9 @@
 KMOD=  fastpath
 SRCS=  fastpath.c
 
+SRCS+= opt_ipfw.h opt_inet.h opt_inet6.h opt_ipsec.h opt_kdtrace.h
+SRCS+= opt_tcpdebug.h
+
 #
 # Enable full debugging
 #
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292537 - head/sys/compat/linuxkpi/common/include/linux

2015-12-21 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Dec 21 10:56:38 2015
New Revision: 292537
URL: https://svnweb.freebsd.org/changeset/base/292537

Log:
  Implement ACCESS_ONCE(), WRITE_ONCE() and READ_ONCE().
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/linux/compiler.h

Modified: head/sys/compat/linuxkpi/common/include/linux/compiler.h
==
--- head/sys/compat/linuxkpi/common/include/linux/compiler.hMon Dec 21 
09:38:45 2015(r292536)
+++ head/sys/compat/linuxkpi/common/include/linux/compiler.hMon Dec 21 
10:56:38 2015(r292537)
@@ -72,4 +72,20 @@
 
 #definebarrier()   __asm__ __volatile__("": : 
:"memory")
 
+#defineACCESS_ONCE(x)  (*(volatile __typeof(x) *)&(x))
+  
+#defineWRITE_ONCE(x,v) do {\
+   barrier();  \
+   ACCESS_ONCE(x) = (v);   \
+   barrier();  \
+} while (0)
+
+#defineREAD_ONCE(x) ({ \
+   __typeof(x) __var;  \
+   barrier();  \
+   __var = ACCESS_ONCE(x); \
+   barrier();  \
+   __var;  \
+})
+  
 #endif /* _LINUX_COMPILER_H_ */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292538 - head/sys/compat/linuxkpi/common/include/linux

2015-12-21 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Dec 21 11:03:12 2015
New Revision: 292538
URL: https://svnweb.freebsd.org/changeset/base/292538

Log:
  Implement sleepable RCU mechanism using shared exclusive locks.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Added:
  head/sys/compat/linuxkpi/common/include/linux/srcu.h   (contents, props 
changed)

Added: head/sys/compat/linuxkpi/common/include/linux/srcu.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/compat/linuxkpi/common/include/linux/srcu.hMon Dec 21 
11:03:12 2015(r292538)
@@ -0,0 +1,72 @@
+/*-
+ * Copyright (c) 2015 Mellanox Technologies, Ltd.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice unmodified, this list of conditions, and the following
+ *disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+#ifndef_LINUX_SRCU_H_
+#define_LINUX_SRCU_H_
+
+#include 
+#include 
+#include 
+
+struct srcu_struct {
+   struct sx sx;
+};
+
+static inline int
+init_srcu_struct(struct srcu_struct *srcu)
+{
+   sx_init(&srcu->sx, "SleepableRCU");
+   return (0);
+}
+
+static inline void
+cleanup_srcu_struct(struct srcu_struct *srcu)
+{
+   sx_destroy(&srcu->sx);
+}
+
+static inline int
+srcu_read_lock(struct srcu_struct *srcu)
+{
+   sx_slock(&srcu->sx);
+   return (0);
+}
+
+static inline void
+srcu_read_unlock(struct srcu_struct *srcu, int key)
+{
+   sx_sunlock(&srcu->sx);
+}
+
+static inline void
+synchronize_srcu(struct srcu_struct *srcu)
+{
+   sx_xlock(&srcu->sx);
+   sx_xunlock(&srcu->sx);
+}
+
+#endif /* _LINUX_SRCU_H_ */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292539 - head/lib/libc/net

2015-12-21 Thread Hajimu UMEMOTO
Author: ume
Date: Mon Dec 21 11:24:14 2015
New Revision: 292539
URL: https://svnweb.freebsd.org/changeset/base/292539

Log:
  If we end up following a CNAME chain that does not find
  any data return that instead of internal error.
  
  PR:   156684
  Obtained from:NetBSD
  MFC after:1 week

Modified:
  head/lib/libc/net/getaddrinfo.c

Modified: head/lib/libc/net/getaddrinfo.c
==
--- head/lib/libc/net/getaddrinfo.c Mon Dec 21 11:03:12 2015
(r292538)
+++ head/lib/libc/net/getaddrinfo.c Mon Dec 21 11:24:14 2015
(r292539)
@@ -2164,7 +2164,11 @@ getanswer(const querybuf *answer, int an
return sentinel.ai_next;
}
 
-   RES_SET_H_ERRNO(res, NO_RECOVERY);
+   /*
+* We could have walked a CNAME chain, but the ultimate target
+* may not have what we looked for.
+*/
+   RES_SET_H_ERRNO(res, ntohs(hp->ancount) > 0 ? NO_DATA : NO_RECOVERY);
return NULL;
 }
 
@@ -2341,6 +2345,7 @@ _dns_getaddrinfo(void *rv, void *cb_data
if (sentinel.ai_next == NULL)
switch (res->res_h_errno) {
case HOST_NOT_FOUND:
+   case NO_DATA:
return NS_NOTFOUND;
case TRY_AGAIN:
return NS_TRYAGAIN;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292541 - head/sys/ufs/ffs

2015-12-21 Thread Konstantin Belousov
Author: kib
Date: Mon Dec 21 11:50:32 2015
New Revision: 292541
URL: https://svnweb.freebsd.org/changeset/base/292541

Log:
  Recheck curthread->td_su after the VFS_SYNC() call, and re-sync if the
  ast was rescheduled during VFS_SYNC().  It is possible that enough
  parallel writes or slow/hung volume result in VFS_SYNC() deferring to
  the ast flushing of workqueue.
  
  Reported and tested by:   pho
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/ufs/ffs/ffs_softdep.c

Modified: head/sys/ufs/ffs/ffs_softdep.c
==
--- head/sys/ufs/ffs/ffs_softdep.c  Mon Dec 21 11:44:54 2015
(r292540)
+++ head/sys/ufs/ffs/ffs_softdep.c  Mon Dec 21 11:50:32 2015
(r292541)
@@ -13301,43 +13301,43 @@ softdep_ast_cleanup_proc(void)
bool req;
 
td = curthread;
-   mp = td->td_su;
-   if (mp == NULL)
-   return;
-   td->td_su = NULL;
-   error = vfs_busy(mp, MBF_NOWAIT);
-   vfs_rel(mp);
-   if (error != 0)
-   return;
-   if (ffs_own_mount(mp) && MOUNTEDSOFTDEP(mp)) {
-   ump = VFSTOUFS(mp);
-   for (;;) {
-   req = false;
-   ACQUIRE_LOCK(ump);
-   if (softdep_excess_items(ump, D_INODEDEP)) {
-   req = true;
-   request_cleanup(mp, FLUSH_INODES);
-   }
-   if (softdep_excess_items(ump, D_DIRREM)) {
-   req = true;
-   request_cleanup(mp, FLUSH_BLOCKS);
-   }
-   FREE_LOCK(ump);
-   if (softdep_excess_items(ump, D_NEWBLK) ||
-   softdep_excess_items(ump, D_ALLOCDIRECT) ||
-   softdep_excess_items(ump, D_ALLOCINDIR)) {
-   error = vn_start_write(NULL, &mp, V_WAIT);
-   if (error == 0) {
+   while ((mp = td->td_su) != NULL) {
+   td->td_su = NULL;
+   error = vfs_busy(mp, MBF_NOWAIT);
+   vfs_rel(mp);
+   if (error != 0)
+   return;
+   if (ffs_own_mount(mp) && MOUNTEDSOFTDEP(mp)) {
+   ump = VFSTOUFS(mp);
+   for (;;) {
+   req = false;
+   ACQUIRE_LOCK(ump);
+   if (softdep_excess_items(ump, D_INODEDEP)) {
req = true;
-   VFS_SYNC(mp, MNT_WAIT);
-   vn_finished_write(mp);
+   request_cleanup(mp, FLUSH_INODES);
}
+   if (softdep_excess_items(ump, D_DIRREM)) {
+   req = true;
+   request_cleanup(mp, FLUSH_BLOCKS);
+   }
+   FREE_LOCK(ump);
+   if (softdep_excess_items(ump, D_NEWBLK) ||
+   softdep_excess_items(ump, D_ALLOCDIRECT) ||
+   softdep_excess_items(ump, D_ALLOCINDIR)) {
+   error = vn_start_write(NULL, &mp,
+   V_WAIT);
+   if (error == 0) {
+   req = true;
+   VFS_SYNC(mp, MNT_WAIT);
+   vn_finished_write(mp);
+   }
+   }
+   if ((td->td_pflags & TDP_KTHREAD) != 0 || !req)
+   break;
}
-   if ((td->td_pflags & TDP_KTHREAD) != 0 || !req)
-   break;
}
+   vfs_unbusy(mp);
}
-   vfs_unbusy(mp);
 }
 
 /*
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292542 - in head/sys/compat/linuxkpi/common: include/linux src

2015-12-21 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Dec 21 11:58:59 2015
New Revision: 292542
URL: https://svnweb.freebsd.org/changeset/base/292542

Log:
  Minor workqueue cleanup:
  - Make some functions global instead of inline to ease debugging.
  - Fix some minor style issues.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/linux/workqueue.h
  head/sys/compat/linuxkpi/common/src/linux_compat.c

Modified: head/sys/compat/linuxkpi/common/include/linux/workqueue.h
==
--- head/sys/compat/linuxkpi/common/include/linux/workqueue.h   Mon Dec 21 
11:50:32 2015(r292541)
+++ head/sys/compat/linuxkpi/common/include/linux/workqueue.h   Mon Dec 21 
11:58:59 2015(r292542)
@@ -55,6 +55,12 @@ struct delayed_work {
struct callout  timer;
 };
 
+extern void linux_work_fn(void *, int);
+extern void linux_flush_fn(void *, int);
+extern void linux_delayed_work_fn(void *);
+extern struct workqueue_struct *linux_create_workqueue_common(const char *, 
int);
+extern void destroy_workqueue(struct workqueue_struct *);
+
 static inline struct delayed_work *
 to_delayed_work(struct work_struct *work)
 {
@@ -62,21 +68,11 @@ to_delayed_work(struct work_struct *work
return container_of(work, struct delayed_work, work);
 }
 
-
-static inline void
-_work_fn(void *context, int pending)
-{
-   struct work_struct *work;
-
-   work = context;
-   work->fn(work);
-}
-
 #defineINIT_WORK(work, func)   
\
 do {   \
(work)->fn = (func);\
(work)->taskqueue = NULL;   \
-   TASK_INIT(&(work)->work_task, 0, _work_fn, (work)); \
+   TASK_INIT(&(work)->work_task, 0, linux_work_fn, (work));
\
 } while (0)
 
 #defineINIT_DELAYED_WORK(_work, func)  
\
@@ -85,7 +81,7 @@ do {  
\
callout_init(&(_work)->timer, 1);   \
 } while (0)
 
-#defineINIT_DEFERRABLE_WORKINIT_DELAYED_WORK
+#defineINIT_DEFERRABLE_WORK(...) INIT_DELAYED_WORK(__VA_ARGS__)
 
 #defineschedule_work(work) 
\
 do {   \
@@ -95,20 +91,12 @@ do {
\
 
 #defineflush_scheduled_work()  flush_taskqueue(taskqueue_thread)
 
-static inline int queue_work(struct workqueue_struct *q, struct work_struct 
*work)
-{
-   (work)->taskqueue = (q)->taskqueue;
-   /* Return opposite val to align with Linux logic */
-   return !taskqueue_enqueue((q)->taskqueue, &(work)->work_task);
-}
-
-static inline void
-_delayed_work_fn(void *arg)
+static inline int
+queue_work(struct workqueue_struct *wq, struct work_struct *work)
 {
-   struct delayed_work *work;
-
-   work = arg;
-   taskqueue_enqueue(work->work.taskqueue, &work->work.work_task);
+   work->taskqueue = wq->taskqueue;
+   /* Return opposite value to align with Linux logic */
+   return (!taskqueue_enqueue(wq->taskqueue, &work->work_task));
 }
 
 static inline int
@@ -120,68 +108,44 @@ queue_delayed_work(struct workqueue_stru
pending = work->work.work_task.ta_pending;
work->work.taskqueue = wq->taskqueue;
if (delay != 0)
-   callout_reset(&work->timer, delay, _delayed_work_fn, work);
+   callout_reset(&work->timer, delay, linux_delayed_work_fn, work);
else
-   _delayed_work_fn((void *)work);
+   linux_delayed_work_fn((void *)work);
 
return (!pending);
 }
 
-static inline bool schedule_delayed_work(struct delayed_work *dwork,
- unsigned long delay)
-{
-struct workqueue_struct wq;
-wq.taskqueue = taskqueue_thread;
-return queue_delayed_work(&wq, dwork, delay);
-}
-
-static inline struct workqueue_struct *
-_create_workqueue_common(char *name, int cpus)
+static inline bool
+schedule_delayed_work(struct delayed_work *dwork,
+unsigned long delay)
 {
-   struct workqueue_struct *wq;
-
-   wq = kmalloc(sizeof(*wq), M_WAITOK);
-   wq->taskqueue = taskqueue_create((name), M_WAITOK,
-   taskqueue_thread_enqueue,  &wq->taskqueue);
-   taskqueue_start_threads(&wq->taskqueue, cpus, PWAIT, "%s", name);
+   struct workqueue_struct wq;
 
-   return (wq);
+   wq.taskqueue = taskqueue_thread;
+   return (queue_delayed_work(&wq, dwork, delay));
 }
 
-
 #definecreate_singlethread_workqueue(name) 
\
-   _create_workqueue_common(name, 1)
+   linux_crea

svn commit: r292543 - head/sys/compat/linuxkpi/common/include/linux

2015-12-21 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Dec 21 12:13:03 2015
New Revision: 292543
URL: https://svnweb.freebsd.org/changeset/base/292543

Log:
  In the zero delay case in queue_delayed_work() use the return value
  from taskqueue_enqueue() instead of reading "ta_pending" unlocked and
  also ensure the callout is stopped before proceeding.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/linux/workqueue.h

Modified: head/sys/compat/linuxkpi/common/include/linux/workqueue.h
==
--- head/sys/compat/linuxkpi/common/include/linux/workqueue.h   Mon Dec 21 
11:58:59 2015(r292542)
+++ head/sys/compat/linuxkpi/common/include/linux/workqueue.h   Mon Dec 21 
12:13:03 2015(r292543)
@@ -105,13 +105,15 @@ queue_delayed_work(struct workqueue_stru
 {
int pending;
 
-   pending = work->work.work_task.ta_pending;
work->work.taskqueue = wq->taskqueue;
-   if (delay != 0)
+   if (delay != 0) {
+   pending = work->work.work_task.ta_pending;
callout_reset(&work->timer, delay, linux_delayed_work_fn, work);
-   else
-   linux_delayed_work_fn((void *)work);
-
+   } else {
+   callout_stop(&work->timer);
+   pending = taskqueue_enqueue(work->work.taskqueue,
+   &work->work.work_task);
+   }
return (!pending);
 }
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292544 - in head/sys/compat/linuxkpi/common: include/linux src

2015-12-21 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Dec 21 12:20:02 2015
New Revision: 292544
URL: https://svnweb.freebsd.org/changeset/base/292544

Log:
  Implement drain_workqueue() function.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/linux/workqueue.h
  head/sys/compat/linuxkpi/common/src/linux_compat.c

Modified: head/sys/compat/linuxkpi/common/include/linux/workqueue.h
==
--- head/sys/compat/linuxkpi/common/include/linux/workqueue.h   Mon Dec 21 
12:13:03 2015(r292543)
+++ head/sys/compat/linuxkpi/common/include/linux/workqueue.h   Mon Dec 21 
12:20:02 2015(r292544)
@@ -36,10 +36,13 @@
 #include 
 #include 
 
+#include 
+
 #include 
 
 struct workqueue_struct {
struct taskqueue*taskqueue;
+   atomic_tdraining;
 };
 
 struct work_struct {
@@ -95,6 +98,9 @@ static inline int
 queue_work(struct workqueue_struct *wq, struct work_struct *work)
 {
work->taskqueue = wq->taskqueue;
+   /* Check for draining */
+   if (atomic_read(&wq->draining) != 0)
+   return (!work->work_task.ta_pending);
/* Return opposite value to align with Linux logic */
return (!taskqueue_enqueue(wq->taskqueue, &work->work_task));
 }
@@ -106,7 +112,9 @@ queue_delayed_work(struct workqueue_stru
int pending;
 
work->work.taskqueue = wq->taskqueue;
-   if (delay != 0) {
+   if (atomic_read(&wq->draining) != 0) {
+   pending = work->work.work_task.ta_pending;
+   } else if (delay != 0) {
pending = work->work.work_task.ta_pending;
callout_reset(&work->timer, delay, linux_delayed_work_fn, work);
} else {
@@ -124,6 +132,7 @@ schedule_delayed_work(struct delayed_wor
struct workqueue_struct wq;
 
wq.taskqueue = taskqueue_thread;
+   atomic_set(&wq.draining, 0);
return (queue_delayed_work(&wq, dwork, delay));
 }
 
@@ -153,6 +162,14 @@ flush_taskqueue(struct taskqueue *tq)
PRELE(curproc);
 }
 
+static inline void
+drain_workqueue(struct workqueue_struct *wq)
+{
+   atomic_inc(&wq->draining);
+   flush_taskqueue(wq->taskqueue);
+   atomic_dec(&wq->draining);
+}
+
 static inline int
 cancel_work_sync(struct work_struct *work)
 {

Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c
==
--- head/sys/compat/linuxkpi/common/src/linux_compat.c  Mon Dec 21 12:13:03 
2015(r292543)
+++ head/sys/compat/linuxkpi/common/src/linux_compat.c  Mon Dec 21 12:20:02 
2015(r292544)
@@ -945,6 +945,7 @@ linux_create_workqueue_common(const char
wq = kmalloc(sizeof(*wq), M_WAITOK);
wq->taskqueue = taskqueue_create(name, M_WAITOK,
taskqueue_thread_enqueue,  &wq->taskqueue);
+   atomic_set(&wq->draining, 0);
taskqueue_start_threads(&wq->taskqueue, cpus, PWAIT, "%s", name);
 
return (wq);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292545 - head/tools/regression/mac/mac_bsdextended

2015-12-21 Thread Garrett Cooper
Author: ngie
Date: Mon Dec 21 12:39:16 2015
New Revision: 292545
URL: https://svnweb.freebsd.org/changeset/base/292545

Log:
  Redo the TAP integration so it works with Kyua
  
  Kyua needs numbers in the TAP results :/, but prove doesn't
  
  MFC after: 2 weeks
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/tools/regression/mac/mac_bsdextended/test_matches.sh

Modified: head/tools/regression/mac/mac_bsdextended/test_matches.sh
==
--- head/tools/regression/mac/mac_bsdextended/test_matches.sh   Mon Dec 21 
12:20:02 2015(r292544)
+++ head/tools/regression/mac/mac_bsdextended/test_matches.sh   Mon Dec 21 
12:39:16 2015(r292545)
@@ -10,6 +10,19 @@ uidoutrange="daemon"
 gidinrange="nobody" # We expect $uidinrange in this group
 gidoutrange="daemon" # We expect $uidinrange in this group
 
+test_num=1
+pass()
+{
+   echo "ok $test_num # $@"
+   : $(( test_num += 1 ))
+}
+
+fail()
+{
+   echo "not ok $test_num # $@"
+   : $(( test_num += 1 ))
+}
+
 #
 # Setup
 #
@@ -37,7 +50,7 @@ md_device=$(mount -p | grep "$playground
 trap "umount -f $playground; mdconfig -d -u $md_device; rmdir $playground" 
EXIT INT TERM
 if [ -z "$md_device" ]; then
mount -p | grep $playground
-   echo "1..0 # md device not properly attached to the system"
+   echo "1..0 # SKIP md device not properly attached to the system"
 fi
 
 ugidfw remove 1
@@ -57,142 +70,284 @@ echo "1..30"
 command1="sh $playground/test-script.sh $file1"
 command2="sh $playground/test-script.sh $file2"
 
-echo "# $uidinrange file:"
-su -m $uidinrange -c "if $command1; then echo ok; else echo not ok; fi"
+desc="$uidinrange file"
+if su -m $uidinrange -c "$command1"; then
+   pass $desc
+else
+   fail $desc
+fi
+
 chown "$uidinrange":"$gidinrange" $file1
 chmod a+w $file1
 
-echo "# $uidoutrange file:"
-if $command2; then echo ok; else echo not ok; fi
+desc="$uidoutrange file"
+if $command2; then
+   pass $desc
+else
+   fail $desc
+fi
+
 chown "$uidoutrange":"$gidoutrange" $file2
 chmod a+w $file2
 
 #
 # No rules
 #
-echo "# no rules $uidinrange:"
-su -fm $uidinrange -c "if $command1; then echo ok; else echo not ok; fi"
-echo "# no rules $uidoutrange:"
-su -fm $uidoutrange -c "if $command1; then echo ok; else echo not ok; fi"
+desc="no rules $uidinrange"
+if su -fm $uidinrange -c "$command1"; then
+   pass $desc
+else
+   fail $desc
+fi
+
+desc="no rules $uidoutrange"
+if su -fm $uidoutrange -c "$command1"; then
+   pass $desc
+else
+   fail $desc
+fi
 
 #
 # Subject Match on uid
 #
 ugidfw set 1 subject uid $uidrange object mode rasx
-echo "# subject uid in range:"
-su -fm $uidinrange -c "if $command1; then echo not ok; else echo ok; fi"
-echo "# subject uid out range:"
-su -fm $uidoutrange -c "if $command1; then echo ok; else echo not ok; fi"
+desc="subject uid in range"
+if su -fm $uidinrange -c "$command1"; then
+   fail $desc
+else
+   pass $desc
+fi
+
+desc="subject uid out range"
+if su -fm $uidoutrange -c "$command1"; then
+   pass $desc
+else
+   fail $desc
+fi
 
 #
 # Subject Match on gid
 #
 ugidfw set 1 subject gid $gidrange object mode rasx
-echo "# subject gid in range:"
-su -fm $uidinrange -c "if $command1; then echo not ok; else echo ok; fi"
-echo "# subject gid out range:"
-su -fm $uidoutrange -c "if $command1; then echo ok; else echo not ok; fi"
+
+desc="subject gid in range"
+if su -fm $uidinrange -c "$command1"; then
+   fail $desc
+else
+   pass $desc
+fi
+
+desc="subject gid out range"
+if su -fm $uidoutrange -c "$command1"; then
+   pass $desc
+else
+   fail $desc
+fi
 
 #
 # Subject Match on jail
 #
 rm -f $playground/test-jail
-echo "# subject matching jailid:"
+
+desc="subject matching jailid"
 jailid=`jail -i / localhost 127.0.0.1 /usr/sbin/daemon -f /bin/sh -c "(sleep 
5; touch $playground/test-jail) &"`
 ugidfw set 1 subject jailid $jailid object mode rasx
 sleep 10
-if [ -f $playground/test-jail ]; then echo "not ok # TODO this testcase is 
buggy (see bug # 205481)"; else echo ok; fi
+
+if [ -f $playground/test-jail ]; then
+   fail "TODO $desc: this testcase fails (see bug # 205481)"
+else
+   pass $desc
+fi
 
 rm -f $playground/test-jail
-echo "# subject nonmatching jailid:"
+desc="subject nonmatching jailid"
 jailid=`jail -i / localhost 127.0.0.1 /usr/sbin/daemon -f /bin/sh -c "(sleep 
5; touch $playground/test-jail) &"`
 sleep 10
-if [ -f $playground/test-jail ]; then echo ok; else echo not ok; fi
+if [ -f $playground/test-jail ]; then
+   pass $desc
+else
+   fail $desc
+fi
 
 #
 # Object uid
 #
 ugidfw set 1 subject object uid $uidrange mode rasx
-echo "# object uid in range:"
-su -fm $uidinrange -c "if $command1; then echo not ok; else echo ok; fi"
-echo "# object uid out range:"
-su -fm $uidinrange -c "if $command2; then echo ok; else echo not ok; fi"
+
+desc="object uid in range"
+if su -fm $uidinrange -c "$comm

svn commit: r292546 - head/tools/regression/mac/mac_bsdextended

2015-12-21 Thread Garrett Cooper
Author: ngie
Date: Mon Dec 21 12:43:04 2015
New Revision: 292546
URL: https://svnweb.freebsd.org/changeset/base/292546

Log:
  - Convert testcase to TAP format
  - Use nitems(x) instead of handrolled sizeof(x) / sizeof(*x) macro
  - Do not mark count != 0 case with bsde_get_rule_count as a failure; this
generates false positives on systems with ugidfw rules set on it
  
  MFC after: 2 weeks
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/tools/regression/mac/mac_bsdextended/test_ugidfw.c

Modified: head/tools/regression/mac/mac_bsdextended/test_ugidfw.c
==
--- head/tools/regression/mac/mac_bsdextended/test_ugidfw.c Mon Dec 21 
12:39:16 2015(r292545)
+++ head/tools/regression/mac/mac_bsdextended/test_ugidfw.c Mon Dec 21 
12:43:04 2015(r292546)
@@ -33,6 +33,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -45,13 +46,6 @@
  * Starting point for a regression test for mac_bsdextended(4) and the
  * supporting libugidfw(3).
  */
-void
-usage(void)
-{
-
-   fprintf(stderr, "test_ugidfw\n");
-   exit(1);
-}
 
 /*
  * This section of the regression test passes some test cases through the
@@ -69,7 +63,6 @@ static const char *test_users[] = {
"operator",
"bin",
 };
-static const int test_users_len = sizeof(test_users) / sizeof(char *);
 
 static const char *test_groups[] = {
"wheel",
@@ -77,7 +70,8 @@ static const char *test_groups[] = {
"operator",
"bin",
 };
-static const int test_groups_len = sizeof(test_groups) / sizeof(char *);
+
+int test_num;
 
 /*
  * List of test strings that must go in (and come out) of libugidfw intact.
@@ -148,7 +142,6 @@ static const char *test_strings[] = {
"object ! uid root:daemon gid daemon filesys / suid sgid 
uid_of_subject gid_of_subject ! type r "
"mode rsx",
 };
-static const int test_strings_len = sizeof(test_strings) / sizeof(char *);
 
 static void
 test_libugidfw_strings(void)
@@ -156,52 +149,68 @@ test_libugidfw_strings(void)
struct mac_bsdextended_rule rule;
char errorstr[256];
char rulestr[256];
-   int i, error;
+   int error, i;
 
-   for (i = 0; i < test_users_len; i++) {
+   for (i = 0; i < nitems(test_users); i++, test_num++) {
if (getpwnam(test_users[i]) == NULL)
-   err(1, "test_libugidfw_strings: getpwnam: %s",
-   test_users[i]);
+   printf("not ok %d # test_libugidfw_strings: 
getpwnam(%s) "
+   "failed: %s\n", test_num, test_users[i], 
strerror(errno));
+   else
+   printf("ok %d\n", test_num);
}
 
-   for (i = 0; i < test_groups_len; i++) {
+   for (i = 0; i < nitems(test_groups); i++, test_num++) {
if (getgrnam(test_groups[i]) == NULL)
-   err(1, "test_libugidfw_strings: getgrnam: %s",
-   test_groups[i]);
+   printf("not ok %d # test_libugidfw_strings: 
getgrnam(%s) "
+   "failed: %s\n", test_num, test_groups[i], 
strerror(errno));
+   else
+   printf("ok %d\n", test_num);
}
 
-   for (i = 0; i < test_strings_len; i++) {
+   for (i = 0; i < nitems(test_strings); i++) {
error = bsde_parse_rule_string(test_strings[i], &rule,
sizeof(errorstr), errorstr);
if (error == -1)
-   errx(1, "bsde_parse_rule_string: '%s' (%d): %s",
-   test_strings[i], i, errorstr);
+   printf("not ok %d # bsde_parse_rule_string: '%s' (%d) "
+   "failed: %s\n", test_num, test_strings[i], i, 
errorstr);
+   else
+   printf("ok %d\n", test_num);
+   test_num++;
+
error = bsde_rule_to_string(&rule, rulestr, sizeof(rulestr));
if (error < 0)
-   errx(1, "bsde_rule_to_string: rule for '%s' "
-   "returned %d", test_strings[i], error);
+   printf("not ok %d # bsde_rule_to_string: rule for '%s' "
+   "returned %d\n", test_num, test_strings[i], error);
+   else
+   printf("ok %d\n", test_num);
+   test_num++;
 
if (strcmp(test_strings[i], rulestr) != 0)
-   errx(1, "test_libugidfw: '%s' in, '%s' out",
-   test_strings[i], rulestr);
+   printf("not ok %d # test_libugidfw: '%s' in, '%s' "
+   "out\n", test_num, test_strings[i], rulestr);
+   else
+   printf("ok %d\n", test_num);
+   test_num++;
}
 }
 
 int
-main(int argc, char *argv[])
+main(void)
 {

svn commit: r292549 - head/usr.sbin/makefs

2015-12-21 Thread Ed Maste
Author: emaste
Date: Mon Dec 21 16:12:41 2015
New Revision: 292549
URL: https://svnweb.freebsd.org/changeset/base/292549

Log:
  makefs: use ENTRY macro for diff reduction with NetBSD
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.sbin/makefs/makefs.c

Modified: head/usr.sbin/makefs/makefs.c
==
--- head/usr.sbin/makefs/makefs.c   Mon Dec 21 15:13:15 2015
(r292548)
+++ head/usr.sbin/makefs/makefs.c   Mon Dec 21 16:12:41 2015
(r292549)
@@ -66,9 +66,12 @@ typedef struct {
 } fstype_t;
 
 static fstype_t fstypes[] = {
-   { "ffs", ffs_prep_opts, ffs_parse_opts, ffs_cleanup_opts, ffs_makefs },
-   { "cd9660", cd9660_prep_opts, cd9660_parse_opts, cd9660_cleanup_opts,
- cd9660_makefs},
+#define ENTRY(name) { \
+   # name, name ## _prep_opts, name ## _parse_opts, \
+   name ## _cleanup_opts, name ## _makefs  \
+}
+   ENTRY(ffs),
+   ENTRY(cd9660),
{ .type = NULL  },
 };
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292550 - head/lib/libc/net

2015-12-21 Thread Hajimu UMEMOTO
Author: ume
Date: Mon Dec 21 16:55:36 2015
New Revision: 292550
URL: https://svnweb.freebsd.org/changeset/base/292550

Log:
  Simplify _map_v4v6_address().
  
  Suggested by: hrs
  MFC after:1 week

Modified:
  head/lib/libc/net/map_v4v6.c

Modified: head/lib/libc/net/map_v4v6.c
==
--- head/lib/libc/net/map_v4v6.cMon Dec 21 16:12:41 2015
(r292549)
+++ head/lib/libc/net/map_v4v6.cMon Dec 21 16:55:36 2015
(r292550)
@@ -78,19 +78,15 @@ typedef union {
 void
 _map_v4v6_address(const char *src, char *dst)
 {
-   u_char *p = (u_char *)dst;
char tmp[NS_INADDRSZ];
-   int i;
 
/* Stash a temporary copy so our caller can update in place. */
memcpy(tmp, src, NS_INADDRSZ);
/* Mark this ipv6 addr as a mapped ipv4. */
-   for (i = 0; i < 10; i++)
-   *p++ = 0x00;
-   *p++ = 0xff;
-   *p++ = 0xff;
+   memset(&dst[0], 0, 10);
+   memset(&dst[10], 0xff, 2);
/* Retrieve the saved copy and we're done. */
-   memcpy((void*)p, tmp, NS_INADDRSZ);
+   memcpy(&dst[12], tmp, NS_INADDRSZ);
 }
 
 void
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r290197 - in head: etc/defaults etc/rc.d sys/kern

2015-12-21 Thread Jilles Tjoelker
On Fri, Oct 30, 2015 at 03:52:10PM +, Edward Tomasz Napierala wrote:
> Author: trasz
> Date: Fri Oct 30 15:52:10 2015
> New Revision: 290197
> URL: https://svnweb.freebsd.org/changeset/base/290197

> Log:
>   After r290196, the kernel won't wait for stuff like gmirror nodes
>   if they are not required for mounting rootfs.  However, it's possible
>   that some setups try to mount them in mountcritlocal (ie from fstab).

>   Export the list of current root mount holds using a new sysctl,
>   vfs.root_mount_hold, and make mountcritlocal retry if "mount -a" fails
>   and the list is not empty.

>   MFC after:  1 month
>   Sponsored by:   The FreeBSD Foundation
>   Differential Revision:  https://reviews.freebsd.org/D3709

I like the faster startup, but the rc.d script clearly will not wait as
intended. See below.

> Modified:
>   head/etc/defaults/rc.conf
>   head/etc/rc.d/mountcritlocal
>   head/sys/kern/vfs_mountroot.c

> [snip]
> Modified: head/etc/rc.d/mountcritlocal
> ==
> --- head/etc/rc.d/mountcritlocal  Fri Oct 30 15:35:04 2015
> (r290196)
> +++ head/etc/rc.d/mountcritlocal  Fri Oct 30 15:52:10 2015
> (r290197)
> @@ -15,7 +15,7 @@ stop_cmd=sync
>  
>  mountcritlocal_start()
>  {
> - local err
> + local err holders waited
>  
>   # Set up the list of network filesystem types for which mounting
>   # should be delayed until after network initialization.
> @@ -35,8 +35,42 @@ mountcritlocal_start()
>   mount_excludes="${mount_excludes}${fstype},"
>   done
>   mount_excludes=${mount_excludes%,}
> +
> + # Originally, root mount hold had to be released before mounting the 
> root
> + # filesystem.  This delayed the boot, so it was changed to only wait if
> + # the root device isn't readily available.  This can result in this 
> script
> + # executing before all the devices - such as graid(8) - are available.
> + # Thus, should the mount fail, we will wait for the root mount hold 
> release
> + # and retry.

These lines are a bit too long.

>   mount -a -t ${mount_excludes}
>   err=$?
> + if [ $? -ne 0 ]; then

The assignment will set $? to 0, so the new code will never be executed.
"$err" should be tested instead of $?.

> + echo
> + echo 'Mounting /etc/fstab filesystems failed,' \
> + 'will retry after root mount hold release'
> +
> + waited=0
> + while [ ${waited} -lt ${root_hold_delay} ]; do
> + holders="$(sysctl -n vfs.root_mount_hold)"
> + if [ -z "${holders}" ]; then
> + break;
> + fi
> + if [ ${waited} -eq 0 ]; then
> + echo -n "Waiting ${root_hold_delay}s" \
> + "for the root mount holders: ${holders}"
> + else
> + echo -n .
> + fi
> + if [ ${waited} -eq ${root_hold_delay} ]; then
> + break 2
> + fi
> + sleep 1
> + waited=$(($waited + 1))
> + done
> + mount -a -t ${mount_excludes}
> + err=$?
> + fi
> +
>   check_startmsgs && echo '.'
>  
>   case ${err} in
> @@ -44,7 +78,7 @@ mountcritlocal_start()
>   ;;
>   *)
>   echo 'Mounting /etc/fstab filesystems failed,' \
> - ' startup aborted'
> + 'startup aborted'
>   stop_boot true
>   ;;
>   esac
> [snip]

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


svn commit: r292552 - head/contrib/smbfs/lib/smb

2015-12-21 Thread Ian Lepore
Author: ian
Date: Mon Dec 21 17:17:00 2015
New Revision: 292552
URL: https://svnweb.freebsd.org/changeset/base/292552

Log:
  Avoid unaligned memory accesses when encoding netbios names in libsmb.
  
  The current code for encoding a netbios name converts each byte to a 16-bit
  value and stores the result by casting a char* to u_short*, resulting in
  alignment faults on strict-alignment platforms.
  
  This change reimplements the encoding routine using only byte accesses to
  memory. There is no particular reason to work with 16-bit values just
  because the encoding process creates two bytes of output for every byte of
  input. Working a byte at at time also avoids endian problems for big-endian
  platforms.
  
  PR:   180438
  PR:   189415
  Differential Revision:https://reviews.freebsd.org/D4622

Modified:
  head/contrib/smbfs/lib/smb/nb_name.c

Modified: head/contrib/smbfs/lib/smb/nb_name.c
==
--- head/contrib/smbfs/lib/smb/nb_name.cMon Dec 21 17:15:03 2015
(r292551)
+++ head/contrib/smbfs/lib/smb/nb_name.cMon Dec 21 17:17:00 2015
(r292552)
@@ -143,15 +143,13 @@ nb_encname_len(const char *str)
return len;
 }
 
-#defineNBENCODE(c) (htole16((u_short)(((u_char)(c) >> 4) | \
-(((u_char)(c) & 0xf) << 8)) + 0x4141))
-
-static void
-memsetw(char *dst, int n, u_short word)
+static inline void
+nb_char_encode(u_char **ptr, u_char c, int n)
 {
+
while (n--) {
-   *(u_short*)dst = word;
-   dst += 2;
+   *(*ptr)++ = 0x41 + (c >> 4);
+   *(*ptr)++ = 0x41 + (c & 0x0f);
}
 }
 
@@ -165,19 +163,15 @@ nb_name_encode(struct nb_name *np, u_cha
*cp++ = NB_ENCNAMELEN;
name = np->nn_name;
if (name[0] == '*' && name[1] == 0) {
-   *(u_short*)cp = NBENCODE('*');
-   memsetw(cp + 2, NB_NAMELEN - 1, NBENCODE(' '));
-   cp += NB_ENCNAMELEN;
+   nb_char_encode(&cp, '*', 1);
+   nb_char_encode(&cp, ' ', NB_NAMELEN - 1);
} else {
-   for (i = 0; *name && i < NB_NAMELEN - 1; i++, cp += 2, name++)
-   *(u_short*)cp = NBENCODE(toupper(*name));
-   i = NB_NAMELEN - i - 1;
-   if (i > 0) {
-   memsetw(cp, i, NBENCODE(' '));
-   cp += i * 2;
-   }
-   *(u_short*)cp = NBENCODE(np->nn_type);
-   cp += 2;
+   for (i = 0; i < NB_NAMELEN - 1; i++)
+   if (*name != 0)
+   nb_char_encode(&cp, toupper(*name++), 1);
+   else
+   nb_char_encode(&cp, ' ', 1);
+   nb_char_encode(&cp, np->nn_type, 1);
}
*cp = 0;
if (np->nn_scope == NULL)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292553 - in head: lib usr.sbin

2015-12-21 Thread Ian Lepore
Author: ian
Date: Mon Dec 21 17:41:08 2015
New Revision: 292553
URL: https://svnweb.freebsd.org/changeset/base/292553

Log:
  Make the building of libsmb and mount_smbfs unconditional, now that r292552
  has eliminated alignment and endian problems that were making it fail on
  some platforms.
  
  PR:180438
  PR:189415

Modified:
  head/lib/Makefile
  head/usr.sbin/Makefile
  head/usr.sbin/Makefile.amd64
  head/usr.sbin/Makefile.arm
  head/usr.sbin/Makefile.i386
  head/usr.sbin/Makefile.powerpc
  head/usr.sbin/Makefile.sparc64

Modified: head/lib/Makefile
==
--- head/lib/Makefile   Mon Dec 21 17:17:00 2015(r292552)
+++ head/lib/Makefile   Mon Dec 21 17:41:08 2015(r292553)
@@ -91,7 +91,7 @@ SUBDIR=   ${SUBDIR_ORDERED} \
libsbuf \
${_libsdp} \
${_libsm} \
-   ${_libsmb} \
+   libsmb \
${_libsmdb} \
${_libsmutil} \
libsqlite3 \
@@ -243,7 +243,6 @@ _libypclnt= libypclnt
 .endif
 
 .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
-_libsmb=   libsmb
 _libvgl=   libvgl
 _libproc=  libproc
 _librtld_db=   librtld_db
@@ -263,15 +262,9 @@ _librtld_db=   librtld_db
 .if ${MACHINE_CPUARCH} == "powerpc"
 _libproc=  libproc
 _librtld_db=   librtld_db
-_libsmb=   libsmb
-.endif
-
-.if ${MACHINE_CPUARCH} == "sparc64"
-_libsmb=   libsmb
 .endif
 
 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm"
-_libsmb=   libsmb
 _libproc=  libproc
 _librtld_db=   librtld_db
 .endif

Modified: head/usr.sbin/Makefile
==
--- head/usr.sbin/Makefile  Mon Dec 21 17:17:00 2015(r292552)
+++ head/usr.sbin/Makefile  Mon Dec 21 17:41:08 2015(r292553)
@@ -46,6 +46,7 @@ SUBDIR=   adduser \
mixer \
mlxcontrol \
mountd \
+   mount_smbfs \
mpsutil \
mptutil \
mtest \

Modified: head/usr.sbin/Makefile.amd64
==
--- head/usr.sbin/Makefile.amd64Mon Dec 21 17:17:00 2015
(r292552)
+++ head/usr.sbin/Makefile.amd64Mon Dec 21 17:41:08 2015
(r292553)
@@ -25,7 +25,6 @@ SUBDIR+=  hyperv
 .endif
 SUBDIR+=   kgmon
 SUBDIR+=   lptcontrol
-SUBDIR+=   mount_smbfs
 SUBDIR+=   mptable
 .if ${MK_NDIS} != "no"
 SUBDIR+=   ndiscvt

Modified: head/usr.sbin/Makefile.arm
==
--- head/usr.sbin/Makefile.arm  Mon Dec 21 17:17:00 2015(r292552)
+++ head/usr.sbin/Makefile.arm  Mon Dec 21 17:41:08 2015(r292553)
@@ -1,5 +1,4 @@
 # $FreeBSD$
 
 SUBDIR+=   kgmon
-SUBDIR+=   mount_smbfs
 SUBDIR+=   ofwdump

Modified: head/usr.sbin/Makefile.i386
==
--- head/usr.sbin/Makefile.i386 Mon Dec 21 17:17:00 2015(r292552)
+++ head/usr.sbin/Makefile.i386 Mon Dec 21 17:41:08 2015(r292553)
@@ -12,7 +12,6 @@ SUBDIR+=  cpucontrol
 SUBDIR+=   kgmon
 SUBDIR+=   kgzip
 SUBDIR+=   lptcontrol
-SUBDIR+=   mount_smbfs
 SUBDIR+=   mptable
 .if ${MK_NDIS} != "no"
 SUBDIR+=   ndiscvt

Modified: head/usr.sbin/Makefile.powerpc
==
--- head/usr.sbin/Makefile.powerpc  Mon Dec 21 17:17:00 2015
(r292552)
+++ head/usr.sbin/Makefile.powerpc  Mon Dec 21 17:41:08 2015
(r292553)
@@ -1,5 +1,4 @@
 # $FreeBSD$
 
-SUBDIR+=   mount_smbfs
 SUBDIR+=   nvram
 SUBDIR+=   ofwdump

Modified: head/usr.sbin/Makefile.sparc64
==
--- head/usr.sbin/Makefile.sparc64  Mon Dec 21 17:17:00 2015
(r292552)
+++ head/usr.sbin/Makefile.sparc64  Mon Dec 21 17:41:08 2015
(r292553)
@@ -1,5 +1,4 @@
 # $FreeBSD$
 
 SUBDIR+=   eeprom
-SUBDIR+=   mount_smbfs
 SUBDIR+=   ofwdump
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292554 - head/lib/libc/net

2015-12-21 Thread Hajimu UMEMOTO
Author: ume
Date: Mon Dec 21 17:54:23 2015
New Revision: 292554
URL: https://svnweb.freebsd.org/changeset/base/292554

Log:
  Use _map_v4v6_address().
  
  MFC after:1 week

Modified:
  head/lib/libc/net/name6.c

Modified: head/lib/libc/net/name6.c
==
--- head/lib/libc/net/name6.c   Mon Dec 21 17:41:08 2015(r292553)
+++ head/lib/libc/net/name6.c   Mon Dec 21 17:54:23 2015(r292554)
@@ -794,10 +794,9 @@ match_addrselectpolicy(struct sockaddr *
memset(&key, 0, sizeof(key));
key.sin6_family = AF_INET6;
key.sin6_len = sizeof(key);
-   key.sin6_addr.s6_addr[10] = 0xff;
-   key.sin6_addr.s6_addr[11] = 0xff;
-   memcpy(&key.sin6_addr.s6_addr[12],
-  &((struct sockaddr_in *)addr)->sin_addr, 4);
+   _map_v4v6_address(
+   (char *)&((struct sockaddr_in *)addr)->sin_addr,
+   (char *)&key.sin6_addr);
break;
default:
return(NULL);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292555 - in head/sys: arm/arm arm/include conf dev/ofw powerpc/include powerpc/ofw

2015-12-21 Thread Ian Lepore
Author: ian
Date: Mon Dec 21 18:07:32 2015
New Revision: 292555
URL: https://svnweb.freebsd.org/changeset/base/292555

Log:
  Implement OF_decode_addr() for arm.  Move most of powerpc's implementation
  into a new function that other platforms can share.
  
  This creates a new ofw_reg_to_paddr() function (in a new ofw_subr.c file)
  that contains most of the existing ppc implementation, mostly unchanged.
  The ppc code now calls the new MI code from the MD code, then creates a
  ppc-specific bus_space mapping from the results. The new arm implementation
  does the same in an arm-specific way.
  
  This also moves the declaration of OF_decode_addr() from ofw_machdep.h to
  openfirm.h, except on sparc64 which uses a different function signature.
  
  This will help all FDT platforms to set up early console access using
  OF_decode_addr().

Added:
  head/sys/arm/arm/ofw_machdep.c   (contents, props changed)
  head/sys/dev/ofw/ofw_subr.c   (contents, props changed)
  head/sys/dev/ofw/ofw_subr.h   (contents, props changed)
Modified:
  head/sys/arm/include/ofw_machdep.h
  head/sys/conf/files
  head/sys/conf/files.arm
  head/sys/conf/files.powerpc
  head/sys/dev/ofw/openfirm.h
  head/sys/powerpc/include/ofw_machdep.h
  head/sys/powerpc/ofw/ofw_machdep.c

Added: head/sys/arm/arm/ofw_machdep.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm/arm/ofw_machdep.c  Mon Dec 21 18:07:32 2015
(r292555)
@@ -0,0 +1,71 @@
+/*-
+ * Copyright (c) 2015 Ian Lepore 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+int
+OF_decode_addr(phandle_t dev, int regno, bus_space_tag_t *tag,
+bus_space_handle_t *handle)
+{
+   bus_addr_t addr;
+   bus_size_t size;
+   pcell_t pci_hi;
+   int flags, res;
+
+   res = ofw_reg_to_paddr(dev, regno, &addr, &size, &pci_hi);
+   if (res < 0)
+   return (res);
+
+   /*
+* Nothing special to do for PCI busses right now.
+* This may need to be handled per-platform when it does come up.
+*/
+#ifdef notyet
+   if (pci_hi == OFW_PADDR_NOT_PCI) {
+   *tag = fdtbus_bs_tag;
+   flags = 0;
+   } else {
+   *tag = fdtbus_bs_tag;
+   flags = (pci_hi & OFW_PCI_PHYS_HI_PREFETCHABLE) ? 
+   BUS_SPACE_MAP_PREFETCHABLE: 0;
+   }
+#else
+   *tag = fdtbus_bs_tag;
+   flags = 0;
+#endif
+   return (bus_space_map(*tag, addr, size, flags, handle));
+}
+

Modified: head/sys/arm/include/ofw_machdep.h
==
--- head/sys/arm/include/ofw_machdep.h  Mon Dec 21 17:54:23 2015
(r292554)
+++ head/sys/arm/include/ofw_machdep.h  Mon Dec 21 18:07:32 2015
(r292555)
@@ -32,6 +32,9 @@
 #ifndef _MACHINE_OFW_MACHDEP_H_
 #define _MACHINE_OFW_MACHDEP_H_
 
+#include 
+#include 
+#include 
 #include 
 
 typedefuint32_tcell_t;

Modified: head/sys/conf/files
==
--- head/sys/conf/files Mon Dec 21 17:54:23 2015(r292554)
+++ head/sys/conf/files Mon Dec 21 18:07:32 2015(r292555)
@@ -2094,6 +2094,7 @@ dev/ofw/ofw_bus_subr.coptional fdt
 dev/ofw/ofw_fdt.c  optional fdt
 dev/ofw/ofw_if.m   optional fdt
 dev/ofw/ofw_iicbus.c   optional fdt iicbus
+dev/ofw/ofw_subr.c optional fdt
 dev/ofw/ofwbus.c   optional fdt
 dev/ofw/openfirm.c 

Re: svn commit: r292555 - in head/sys: arm/arm arm/include conf dev/ofw powerpc/include powerpc/ofw

2015-12-21 Thread Ian Lepore
On Mon, 2015-12-21 at 18:07 +, Ian Lepore wrote:
> Author: ian
> Date: Mon Dec 21 18:07:32 2015
> New Revision: 292555
> URL: https://svnweb.freebsd.org/changeset/base/292555
> 
> Log:
>   Implement OF_decode_addr() for arm.  Move most of powerpc's implementation
>   into a new function that other platforms can share.
>   
>   This creates a new ofw_reg_to_paddr() function (in a new ofw_subr.c file)
>   that contains most of the existing ppc implementation, mostly unchanged.
>   The ppc code now calls the new MI code from the MD code, then creates a
>   ppc-specific bus_space mapping from the results. The new arm implementation
>   does the same in an arm-specific way.
>   
>   This also moves the declaration of OF_decode_addr() from ofw_machdep.h to
>   openfirm.h, except on sparc64 which uses a different function signature.
>   
>   This will help all FDT platforms to set up early console access using
>   OF_decode_addr().
> 
> Added:
>   head/sys/arm/arm/ofw_machdep.c   (contents, props changed)
>   head/sys/dev/ofw/ofw_subr.c   (contents, props changed)
>   head/sys/dev/ofw/ofw_subr.h   (contents, props changed)
> Modified:
>   head/sys/arm/include/ofw_machdep.h
>   head/sys/conf/files
>   head/sys/conf/files.arm
>   head/sys/conf/files.powerpc
>   head/sys/dev/ofw/openfirm.h
>   head/sys/powerpc/include/ofw_machdep.h
>   head/sys/powerpc/ofw/ofw_machdep.c


Forgot to add Differential Revision: https://reviews.freebsd.org/D4664

-- Ian

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


svn commit: r292556 - in head/sys: conf mips/mips

2015-12-21 Thread Ian Lepore
Author: ian
Date: Mon Dec 21 18:19:14 2015
New Revision: 292556
URL: https://svnweb.freebsd.org/changeset/base/292556

Log:
  Add a mips implementation of OF_decode_addr().

Added:
  head/sys/mips/mips/ofw_machdep.c   (contents, props changed)
Modified:
  head/sys/conf/files.mips

Modified: head/sys/conf/files.mips
==
--- head/sys/conf/files.mipsMon Dec 21 18:07:32 2015(r292555)
+++ head/sys/conf/files.mipsMon Dec 21 18:19:14 2015(r292556)
@@ -30,6 +30,7 @@ mips/mips/minidump_machdep.c  standard
 mips/mips/mp_machdep.c optionalsmp
 mips/mips/mpboot.S optionalsmp
 mips/mips/nexus.c  standard
+mips/mips/ofw_machdep.coptionalfdt
 mips/mips/pm_machdep.c standard
 mips/mips/pmap.c   standard
 mips/mips/ptrace_machdep.c standard

Added: head/sys/mips/mips/ofw_machdep.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/mips/mips/ofw_machdep.cMon Dec 21 18:19:14 2015
(r292556)
@@ -0,0 +1,70 @@
+/*-
+ * Copyright (c) 2015 Ian Lepore 
+ * All rights excluded.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+int
+OF_decode_addr(phandle_t dev, int regno, bus_space_tag_t *tag,
+bus_space_handle_t *handle)
+{
+   bus_addr_t addr;
+   bus_size_t size;
+   pcell_t pci_hi;
+   int flags, res;
+
+   res = ofw_reg_to_paddr(dev, regno, &addr, &size, &pci_hi);
+   if (res < 0)
+   return (res);
+
+   /*
+* Nothing special to do for PCI busses right now.
+* This may need to be handled per-platform when it does come up.
+*/
+#ifdef notyet
+   if (pci_hi == OFW_PADDR_NOT_PCI) {
+   *tag = fdtbus_bs_tag;
+   flags = 0;
+   } else {
+   *tag = fdtbus_bs_tag;
+   flags = (pci_hi & OFW_PCI_PHYS_HI_PREFETCHABLE) ? 
+   BUS_SPACE_MAP_PREFETCHABLE: 0;
+   }
+#else
+   *tag = fdtbus_bs_tag;
+   flags = 0;
+#endif
+   return (bus_space_map(*tag, addr, size, flags, handle));
+}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292557 - head/sys/arm/conf

2015-12-21 Thread Warner Losh
Author: imp
Date: Mon Dec 21 18:27:51 2015
New Revision: 292557
URL: https://svnweb.freebsd.org/changeset/base/292557

Log:
  Configure the Atmel eval boards to boot the same way. This gives
  them the same layout as other embedded systems.

Modified:
  head/sys/arm/conf/SAM9260EK
  head/sys/arm/conf/SAM9G20EK

Modified: head/sys/arm/conf/SAM9260EK
==
--- head/sys/arm/conf/SAM9260EK Mon Dec 21 18:19:14 2015(r292556)
+++ head/sys/arm/conf/SAM9260EK Mon Dec 21 18:27:51 2015(r292557)
@@ -103,8 +103,10 @@ optionsPRINTF_BUFR_SIZE=128# Prevent 
 #options   BOOTP_NFSV3
 #options   BOOTP_WIRED_TO=macb0
 
-# alternatively, boot from a MMC/SD memory card
-# s1 is FAT on this platform.
+# s3 because s1 is reserved for the DOS parittions sometimes needed to
+# boot off SD cards on the G20 and newer chips. s2 is reserved for
+# nanobsd's config partition. s3 and s4 are for the ping-pong upgrade
+# path. 9260 doesn't boot off SD, but let's keep things sane.
 optionsROOTDEVNAME=\"ufs:/dev/mmcsd0s3a\"
 
 # Alternatively, boot from a USB card.

Modified: head/sys/arm/conf/SAM9G20EK
==
--- head/sys/arm/conf/SAM9G20EK Mon Dec 21 18:19:14 2015(r292556)
+++ head/sys/arm/conf/SAM9G20EK Mon Dec 21 18:27:51 2015(r292557)
@@ -82,9 +82,11 @@ options  DDB # Enable the kernel 
debug
 #options   BOOTP_NFSV3
 #options   BOOTP_WIRED_TO=ate0
 
-# s2 because s1 is reserved for the DOS parittions sometimes needed to
-# boot off SD cards on the G20 and newer chips.
-optionsROOTDEVNAME=\"ufs:/dev/mmcsd0s2a\"
+# s3 because s1 is reserved for the DOS parittions sometimes needed to
+# boot off SD cards on the G20 and newer chips. s2 is reserved for
+# nanobsd's config partition. s3 and s4 are for the ping-pong upgrade
+# path.
+optionsROOTDEVNAME=\"ufs:/dev/mmcsd0s3a\"
 
 # kernel/memory size reduction
 optionsMUTEX_NOINLINE
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292558 - head/sys/netinet

2015-12-21 Thread Michael Tuexen
Author: tuexen
Date: Mon Dec 21 18:52:02 2015
New Revision: 292558
URL: https://svnweb.freebsd.org/changeset/base/292558

Log:
  Stop processing of a SACK when the association has been aborted.
  
  MFC after: 3 days

Modified:
  head/sys/netinet/sctp_indata.c

Modified: head/sys/netinet/sctp_indata.c
==
--- head/sys/netinet/sctp_indata.c  Mon Dec 21 18:27:51 2015
(r292557)
+++ head/sys/netinet/sctp_indata.c  Mon Dec 21 18:52:02 2015
(r292558)
@@ -3994,6 +3994,7 @@ again:
op_err = 
sctp_generate_cause(SCTP_CAUSE_USER_INITIATED_ABT, "");
stcb->sctp_ep->last_abort_code = 
SCTP_FROM_SCTP_INDATA + SCTP_LOC_26;
sctp_abort_an_association(stcb->sctp_ep, stcb, 
op_err, SCTP_SO_NOT_LOCKED);
+   return;
} else {
struct sctp_nets *netp;
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292559 - head

2015-12-21 Thread John Baldwin
Author: jhb
Date: Mon Dec 21 19:15:06 2015
New Revision: 292559
URL: https://svnweb.freebsd.org/changeset/base/292559

Log:
  As previously noted in r290409, purge old entries from MAINTAINERS.

Modified:
  head/MAINTAINERS

Modified: head/MAINTAINERS
==
--- head/MAINTAINERSMon Dec 21 18:52:02 2015(r292558)
+++ head/MAINTAINERSMon Dec 21 19:15:06 2015(r292559)
@@ -87,72 +87,3 @@ sys/netpfil/pf   kp,glebius  Pre-commit rev
 tests  freebsd-testing,ngiePre-commit review requested.
 usr.sbin/pkg   pkg@Please coordinate behavior or flag changes with pkg 
team.
 vmm(4) neel,grehan Pre-commit review requested.
- OLD 
-libc/posix1e   rwatson Pre-commit review requested.
-POSIX.1e ACLs  rwatson Pre-commit review requested.
-UFS EAsrwatson Pre-commit review requested.
-MAC Framework  rwatson Pre-commit review requested.
-MAC Modulesrwatson Pre-commit review requested.
-contrib/openbsmrwatson Pre-commit review requested.
-sys/security/audit rwatson Pre-commit review requested.
-ahc(4) gibbs   Pre-commit review requested.
-ahd(4) gibbs   Pre-commit review requested.
-cdboot jhb Pre-commit review requested.
-pxebootjhb Pre-commit review requested.
-witnessjhb Pre-commit review requested.
-CAMgibbs,
-   ken Pre-commit review requested. send to s...@freebsd.org
-devstat(9) ken Pre-commit review requested.
-camcontrol(8)  ken Pre-commit review requested.
-libcam ken Pre-commit review requested.
-libdevstat ken Pre-commit review requested.
-iostat(8)  ken Pre-commit review requested.
-cd(4)  ken Pre-commit review requested.
-pass(4)ken Pre-commit review requested.
-ch(4)  ken Pre-commit review requested.
-em(4)  jfv Pre-commit review requested.
-nvipeter   Try not to break it.
-libz   peter   Try not to break it.
-groff  ru  Recommends pre-commit review.
-ipfw   ipfwPre-commit review preferred. send to i...@freebsd.org
-drmrnoland Just keep me informed of changes, try not to break it.
-unifdef(1) fanfPre-commit review requested.
-ntproberto Pre-commit review requested.
-inetd  dwmaloneRecommends pre-commit review.
-contrib/smbfs  bp  Open for in-tree committs. In case of functional
-   changes pre-commit review requested.
-file   obrien  Insists to keep file blocked from other's unapproved
-   commits
-contrib/bzip2  obrien  Pre-commit review required.
-geom   freebsd-g...@freebsd.org
-geom_concatpjd Pre-commit review preferred.
-geom_gate  pjd Pre-commit review preferred.
-geom_label pjd Pre-commit review preferred.
-geom_mirrorpjd Pre-commit review preferred.
-geom_nop   pjd Pre-commit review preferred.
-geom_raid3 pjd Pre-commit review preferred.
-geom_shsec pjd Pre-commit review preferred.
-geom_stripepjd Pre-commit review preferred.
-geom_zero  pjd Pre-commit review preferred.
-sbin/geom  pjd Pre-commit review preferred.
-zfsfreebsd...@freebsd.org
-linux emul emulation   Please discuss changes here.
-bs{diff,patch} cpercivaPre-commit review requested.
-portsnap   cpercivaPre-commit review requested.
-freebsd-update cpercivaPre-commit review requested.
-sys/netgraph/bluetooth emaxPre-commit review preferred.
-lib/libbluetooth   emaxPre-commit review preferred.
-lib/libsdp emaxPre-commit review preferred.
-usr.bin/bluetooth  emaxPre-commit review preferred.
-usr.sbin/bluetooth emaxPre-commit review preferred.
-share/zoneinfo edwin   Heads-up appreciated, since our data is coming
-   from a third party source.
-usr.sbin/zic   edwin   Heads-up appreciated, since this code is
-   maintained by a third party source.
-lib/libc/stdtime   edwin   Heads-up appreciated, since parts of this code
-   is maintained by a third party source.
-sbin/routedbms Pre-commit review; notify vendor at rhyolite.com
-cmxdan...@roe.ch   Pre-commit review preferred.
-filemonobrien  Pre-commit review preferred.
-sysdoc trhodes Pre-commit review preferred.
-
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292563 - in head/sys/boot/efi/loader: . arch/amd64

2015-12-21 Thread Ed Maste
Author: emaste
Date: Mon Dec 21 19:56:11 2015
New Revision: 292563
URL: https://svnweb.freebsd.org/changeset/base/292563

Log:
  loader.efi: strip trailing whitespace
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/boot/efi/loader/Makefile
  head/sys/boot/efi/loader/arch/amd64/framebuffer.c
  head/sys/boot/efi/loader/devicename.c

Modified: head/sys/boot/efi/loader/Makefile
==
--- head/sys/boot/efi/loader/Makefile   Mon Dec 21 19:49:00 2015
(r292562)
+++ head/sys/boot/efi/loader/Makefile   Mon Dec 21 19:56:11 2015
(r292563)
@@ -67,7 +67,7 @@ HAVE_BCACHE=yes
 CFLAGS+=   -DEFI_STAGING_SIZE=${EFI_STAGING_SIZE}
 .endif
 
-# Always add MI sources 
+# Always add MI sources
 .PATH: ${.CURDIR}/../../common
 .include   "${.CURDIR}/../../common/Makefile.inc"
 CFLAGS+=   -I${.CURDIR}/../../common

Modified: head/sys/boot/efi/loader/arch/amd64/framebuffer.c
==
--- head/sys/boot/efi/loader/arch/amd64/framebuffer.c   Mon Dec 21 19:49:00 
2015(r292562)
+++ head/sys/boot/efi/loader/arch/amd64/framebuffer.c   Mon Dec 21 19:56:11 
2015(r292563)
@@ -303,7 +303,7 @@ efifb_from_uga(struct efi_fb *efifb, EFI
 * offset within the frame buffer of the visible region, nor
 * the stride. Our only option is to look at the system and
 * fill in the blanks based on that. Luckily, UGA was mostly
-* only used on Apple hardware. 
+* only used on Apple hardware.
 */
offset = -1;
ev = getenv("smbios.system.maker");

Modified: head/sys/boot/efi/loader/devicename.c
==
--- head/sys/boot/efi/loader/devicename.c   Mon Dec 21 19:49:00 2015
(r292562)
+++ head/sys/boot/efi/loader/devicename.c   Mon Dec 21 19:56:11 2015
(r292563)
@@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$");
 
 static int efi_parsedev(struct devdesc **, const char *, const char **);
 
-/* 
+/*
  * Point (dev) at an allocated device specifier for the device matching the
  * path in (devspec). If it contains an explicit device specification,
  * use that.  If not, use the default device.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292564 - head/etc

2015-12-21 Thread Jeremie Le Hen
Author: jlh
Date: Mon Dec 21 20:14:40 2015
New Revision: 292564
URL: https://svnweb.freebsd.org/changeset/base/292564

Log:
  Add port for IRC over TLS/SSL, as noted in RFC 7194.
  
  PR:   192505
  Submitted by: loic.b...@unix-experience.fr
  MFC after:3 days

Modified:
  head/etc/services

Modified: head/etc/services
==
--- head/etc/services   Mon Dec 21 19:56:11 2015(r292563)
+++ head/etc/services   Mon Dec 21 20:14:40 2015(r292564)
@@ -2401,6 +2401,7 @@ xdsxdm6558/udp
 sane-port  6566/tcp   #Scanner Access Now Easy (SANE) Control Port
 sane-port  6566/udp   #Scanner Access Now Easy (SANE) Control Port
 ircd   6667/tcp   #Internet Relay Chat (unofficial)
+ircs-u  6697/tcp   #Internet Relay Chat over TLS/SSL
 frc-hp 6704/sctp  #ForCES HP (High Priority) channel
 frc-mp 6705/sctp  #ForCES MP (Medium Priority) channel
 frc-lp 6706/sctp  #ForCES LP (Low priority) channel
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292565 - head/sys/arm/freescale/imx

2015-12-21 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Mon Dec 21 20:17:24 2015
New Revision: 292565
URL: https://svnweb.freebsd.org/changeset/base/292565

Log:
  Add CCM functions to enable HDMI framer and IPU units (video controller)
  
  Reviewed by:  andrew, ian
  Differential Revision:https://reviews.freebsd.org/D4168

Modified:
  head/sys/arm/freescale/imx/imx6_ccm.c
  head/sys/arm/freescale/imx/imx6_ccmreg.h
  head/sys/arm/freescale/imx/imx_ccmvar.h

Modified: head/sys/arm/freescale/imx/imx6_ccm.c
==
--- head/sys/arm/freescale/imx/imx6_ccm.c   Mon Dec 21 20:14:40 2015
(r292564)
+++ head/sys/arm/freescale/imx/imx6_ccm.c   Mon Dec 21 20:17:24 2015
(r292565)
@@ -348,6 +348,43 @@ imx_ccm_ahb_hz(void)
return (13200);
 }
 
+void
+imx_ccm_ipu_enable(int ipu)
+{
+   struct ccm_softc *sc;
+   uint32_t reg;
+
+   sc = ccm_sc;
+   reg = RD4(sc, CCM_CCGR3);
+   if (ipu == 1)
+   reg |= CCGR3_IPU1_IPU | CCGR3_IPU1_DI0;
+   else
+   reg |= CCGR3_IPU2_IPU | CCGR3_IPU2_DI0;
+   WR4(sc, CCM_CCGR3, reg);
+}
+
+void
+imx_ccm_hdmi_enable(void)
+{
+   struct ccm_softc *sc;
+   uint32_t reg;
+
+   sc = ccm_sc;
+   reg = RD4(sc, CCM_CCGR2);
+   reg |= CCGR2_HDMI_TX | CCGR2_HDMI_TX_ISFR;
+   WR4(sc, CCM_CCGR2, reg);
+
+   /* Set HDMI clock to 280MHz */
+   reg = RD4(sc, CCM_CHSCCDR);
+   reg &= ~(CHSCCDR_IPU1_DI0_PRE_CLK_SEL_MASK |
+   CHSCCDR_IPU1_DI0_PODF_MASK | CHSCCDR_IPU1_DI0_CLK_SEL_MASK);
+   reg |= (CHSCCDR_PODF_DIVIDE_BY_3 << CHSCCDR_IPU1_DI0_PODF_SHIFT);
+   reg |= (CHSCCDR_IPU_PRE_CLK_540M_PFD << 
CHSCCDR_IPU1_DI0_PRE_CLK_SEL_SHIFT);
+   WR4(sc, CCM_CHSCCDR, reg);
+   reg |= (CHSCCDR_CLK_SEL_LDB_DI0 << CHSCCDR_IPU1_DI0_CLK_SEL_SHIFT);
+   WR4(sc, CCM_CHSCCDR, reg);
+}
+
 uint32_t
 imx_ccm_get_cacrr(void)
 {

Modified: head/sys/arm/freescale/imx/imx6_ccmreg.h
==
--- head/sys/arm/freescale/imx/imx6_ccmreg.hMon Dec 21 20:14:40 2015
(r292564)
+++ head/sys/arm/freescale/imx/imx6_ccmreg.hMon Dec 21 20:17:24 2015
(r292565)
@@ -30,6 +30,9 @@
 #defineIMX6_CCMREG_H
 
 #defineCCM_CACCR   0x010
+#defineCCM_CBCDR   0x014
+#defineCBCDR_MMDC_CH1_AXI_PODF_SHIFT   3
+#defineCBCDR_MMDC_CH1_AXI_PODF_MASK(7 << 3)
 #defineCCM_CSCMR1  0x01C
 #define  SSI1_CLK_SEL_S  10
 #define  SSI2_CLK_SEL_S  12
@@ -39,6 +42,7 @@
 #define  SSI_CLK_SEL_454_PFD 1
 #define  SSI_CLK_SEL_PLL42
 #defineCCM_CSCMR2  0x020
+#define  CSCMR2_LDB_DI0_IPU_DIV_SHIFT10
 #defineCCM_CS1CDR  0x028
 #define  SSI1_CLK_PODF_SHIFT 0
 #define  SSI1_CLK_PRED_SHIFT 6
@@ -49,6 +53,18 @@
 #defineCCM_CS2CDR  0x02C
 #define  SSI2_CLK_PODF_SHIFT 0
 #define  SSI2_CLK_PRED_SHIFT 6
+#define  LDB_DI0_CLK_SEL_SHIFT   9
+#define  LDB_DI0_CLK_SEL_MASK(3 << LDB_DI0_CLK_SEL_SHIFT)
+#defineCCM_CHSCCDR 0x034
+#define  CHSCCDR_IPU1_DI0_PRE_CLK_SEL_MASK (0x7 << 6)
+#define  CHSCCDR_IPU1_DI0_PRE_CLK_SEL_SHIFT6
+#define  CHSCCDR_IPU1_DI0_PODF_MASK(0x7 << 3)
+#define  CHSCCDR_IPU1_DI0_PODF_SHIFT   3
+#define  CHSCCDR_IPU1_DI0_CLK_SEL_MASK (0x7)
+#define  CHSCCDR_IPU1_DI0_CLK_SEL_SHIFT0
+#define  CHSCCDR_CLK_SEL_LDB_DI0   3
+#define  CHSCCDR_PODF_DIVIDE_BY_3  2
+#define  CHSCCDR_IPU_PRE_CLK_540M_PFD  5
 #defineCCM_CSCDR2  0x038
 #defineCCM_CLPCR   0x054
 #define  CCM_CLPCR_LPM_MASK  0x03

Modified: head/sys/arm/freescale/imx/imx_ccmvar.h
==
--- head/sys/arm/freescale/imx/imx_ccmvar.h Mon Dec 21 20:14:40 2015
(r292564)
+++ head/sys/arm/freescale/imx/imx_ccmvar.h Mon Dec 21 20:17:24 2015
(r292565)
@@ -52,6 +52,8 @@ uint32_t imx_ccm_ahb_hz(void);
 void imx_ccm_usb_enable(device_t _usbdev);
 void imx_ccm_usbphy_enable(device_t _phydev);
 void imx_ccm_ssi_configure(device_t _ssidev);
+void imx_ccm_hdmi_enable(void);
+void imx_ccm_ipu_enable(int ipu);
 
 /* Routines to get and set the arm clock root divisor register. */
 uint32_t imx_ccm_get_cacrr(void);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-h

svn commit: r292567 - head/sys/conf

2015-12-21 Thread Warner Losh
Author: imp
Date: Mon Dec 21 20:36:01 2015
New Revision: 292567
URL: https://svnweb.freebsd.org/changeset/base/292567

Log:
  Revert this change. It broke the trampoline build. Until I'm sure
  nothing else is broken, I'm reverting.

Modified:
  head/sys/conf/Makefile.mips
  head/sys/conf/kern.mk
  head/sys/conf/kmod.mk

Modified: head/sys/conf/Makefile.mips
==
--- head/sys/conf/Makefile.mips Mon Dec 21 20:29:55 2015(r292566)
+++ head/sys/conf/Makefile.mips Mon Dec 21 20:36:01 2015(r292567)
@@ -42,7 +42,7 @@ TRAMPLOADADDR?=0x807963c0
 # We default to the MIPS32 ISA, if none specified in the
 # kernel configuration file.
 ARCH_FLAGS?=-march=mips32
-EXTRA_FLAGS=-DKERNLOADADDR=${KERNLOADADDR}
+EXTRA_FLAGS=-fno-pic -mno-abicalls -G0 -DKERNLOADADDR=${KERNLOADADDR}
 
 HACK_EXTRA_FLAGS=-shared
 

Modified: head/sys/conf/kern.mk
==
--- head/sys/conf/kern.mk   Mon Dec 21 20:29:55 2015(r292566)
+++ head/sys/conf/kern.mk   Mon Dec 21 20:36:01 2015(r292567)
@@ -160,7 +160,6 @@ CFLAGS.gcc+=-mcall-aixdesc
 # For MIPS we also tell gcc to use floating point emulation
 #
 .if ${MACHINE_CPUARCH} == "mips"
-CFLAGS+=   -fno-pic -mno-abicalls -G0 
 CFLAGS+=   -msoft-float
 INLINE_LIMIT?= 8000
 .endif

Modified: head/sys/conf/kmod.mk
==
--- head/sys/conf/kmod.mk   Mon Dec 21 20:29:55 2015(r292566)
+++ head/sys/conf/kmod.mk   Mon Dec 21 20:36:01 2015(r292567)
@@ -130,7 +130,7 @@ CFLAGS+=-mlongcall -fno-omit-frame-poin
 .endif
 
 .if ${MACHINE_CPUARCH} == mips
-CFLAGS+=   -mlong-calls
+CFLAGS+=   -G0 -fno-pic -mno-abicalls -mlong-calls
 .endif
 
 .if defined(DEBUG) || defined(DEBUG_FLAGS)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r292472 - in head/sys: amd64/amd64 sys

2015-12-21 Thread John Baldwin
On Saturday, December 19, 2015 07:01:43 PM Warner Losh wrote:
> Author: imp
> Date: Sat Dec 19 19:01:43 2015
> New Revision: 292472
> URL: https://svnweb.freebsd.org/changeset/base/292472
> 
> Log:
>   Save the physical address passed into the kernel of the UEFI system
>   table.
> 
> Modified:
>   head/sys/amd64/amd64/machdep.c
>   head/sys/sys/efi.h
> 
> Modified: head/sys/amd64/amd64/machdep.c
> ==
> --- head/sys/amd64/amd64/machdep.cSat Dec 19 19:01:42 2015
> (r292471)
> +++ head/sys/amd64/amd64/machdep.cSat Dec 19 19:01:43 2015
> (r292472)
> @@ -1615,6 +1622,8 @@ hammer_time(u_int64_t modulep, u_int64_t
>   /*
>* Use vt(4) by default for UEFI boot (during the sc(4)/vt(4)
>* transition).
> +  * Once bootblocks have updated, we can test directly for
> +  * efi_systbl != NULL here...
>*/
>   if (preload_search_info(kmdp, MODINFO_METADATA | MODINFOMD_EFI_MAP)
>   != NULL)

This part doesn't seem worth changing since the EFI map is always going to be
there and works for both old and new loaders?

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


Re: svn commit: r292528 - head/sys/x86/include

2015-12-21 Thread Ravi Pokala
-Original Message-


From:  on behalf of "Conrad E. Meyer" 

Date: 2015-12-20, Sunday at 20:42
To: , , 

Subject: svn commit: r292528 - head/sys/x86/include

>Author: cem
>Date: Mon Dec 21 04:42:58 2015
>New Revision: 292528
>URL: https://svnweb.freebsd.org/changeset/base/292528
>
>Log:
>  x86: Add CPUID_STDEXT_* macros for CPU feature bits
>  
>  A follow-up to r292478 and r292488.

Hi Conrad,

Between those two changes, you added recognition for CLWB, PCOMMIT, AVX512DQ, 
AVX512IFMA, AVX512BW, and AVX512VBMI; this change adds macros for the first 
five, but it looks like you forgot about AVX512VBMI.

-Ravi (rpokala@)

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


svn commit: r292569 - head/tools/regression/mac/mac_portacl

2015-12-21 Thread Garrett Cooper
Author: ngie
Date: Mon Dec 21 21:15:23 2015
New Revision: 292569
URL: https://svnweb.freebsd.org/changeset/base/292569

Log:
  Make the mac_portacl testcases work / more robust
  
  - A trap(1) call has been added to the test scripts to better
ensure that the tests do a better job at trying to restore the
test host state at the end of the tests (if the test was
interrupted before it would leave the system in an odd state,
potentially making the test results for subsequent runs
non-deterministic).
  - Add root user checks
  - Fix nc(1) usage:
-- -o is deprecated
-- Using `-w 10` will make the call timeout after 10 seconds so it
   doesn't block indefinitely
  - Use local variables
  - Be more terse in the error messages
  - Parameterize out "127.0.0.1"
  
  MFC after: 1 week
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/tools/regression/mac/mac_portacl/misc.sh
  head/tools/regression/mac/mac_portacl/nobody.t
  head/tools/regression/mac/mac_portacl/root.t

Modified: head/tools/regression/mac/mac_portacl/misc.sh
==
--- head/tools/regression/mac/mac_portacl/misc.sh   Mon Dec 21 20:40:17 
2015(r292568)
+++ head/tools/regression/mac/mac_portacl/misc.sh   Mon Dec 21 21:15:23 
2015(r292569)
@@ -6,10 +6,18 @@ if [ $? -ne 0 ]; then
echo "1..0 # SKIP MAC_PORTACL is unavailable."
exit 0
 fi
+if [ $(id -u) -ne 0 ]; then
+   echo "1..0 # SKIP testcases must be run as root"
+   exit 0
+fi
 
 ntest=1
 
 check_bind() {
+   local host idtype name proto port udpflag
+
+   host="127.0.0.1"
+
idtype=${1}
name=${2}
proto=${3}
@@ -17,10 +25,10 @@ check_bind() {
 
[ "${proto}" = "udp" ] && udpflag="-u"
 
-   out=`(
+   out=$(
case "${idtype}" in
uid|gid)
-   ( echo -n | su -m ${name} -c "nc ${udpflag} -o -l 
127.0.0.1 $port" 2>&1 ) &
+   ( echo -n | su -m ${name} -c "nc ${udpflag} -l -w 10 
$host $port" 2>&1 ) &
;;
jail)
kill $$
@@ -29,9 +37,9 @@ check_bind() {
kill $$
esac
sleep 0.3
-   echo | nc ${udpflag} -o 127.0.0.1 $port >/dev/null 2>&1
+   echo | nc ${udpflag} -w 10 $host $port >/dev/null 2>&1
wait
-   )`
+   )
case "${out}" in
"nc: Permission denied"*|"nc: Operation not permitted"*)
echo fl
@@ -46,6 +54,8 @@ check_bind() {
 }
 
 bind_test() {
+   local expect_without_rule expect_with_rule idtype name proto port
+
expect_without_rule=${1}
expect_with_rule=${2}
idtype=${3}
@@ -54,40 +64,40 @@ bind_test() {
port=${6}
 
sysctl security.mac.portacl.rules= >/dev/null
-   out=`check_bind ${idtype} ${name} ${proto} ${port}`
+   out=$(check_bind ${idtype} ${name} ${proto} ${port})
if [ "${out}" = "${expect_without_rule}" ]; then
echo "ok ${ntest}"
elif [ "${out}" = "ok" -o "${out}" = "fl" ]; then
-   echo "not ok ${ntest}"
+   echo "not ok ${ntest} # '${out}' != '${expect_without_rule}'"
else
-   echo "not ok ${ntest} # ${out}"
+   echo "not ok ${ntest} # unexpected output: '${out}'"
fi
-   ntest=$((ntest+1))
+   : $(( ntest += 1 ))
 
if [ "${idtype}" = "uid" ]; then
-   idstr=`id -u ${name}`
+   idstr=$(id -u ${name})
elif [ "${idtype}" = "gid" ]; then
-   idstr=`id -g ${name}`
+   idstr=$(id -g ${name})
else
idstr=${name}
fi
sysctl security.mac.portacl.rules=${idtype}:${idstr}:${proto}:${port} 
>/dev/null
-   out=`check_bind ${idtype} ${name} ${proto} ${port}`
+   out=$(check_bind ${idtype} ${name} ${proto} ${port})
if [ "${out}" = "${expect_with_rule}" ]; then
echo "ok ${ntest}"
elif [ "${out}" = "ok" -o "${out}" = "fl" ]; then
-   echo "not ok ${ntest}"
+   echo "not ok ${ntest} # '${out}' != '${expect_with_rule}'"
else
-   echo "not ok ${ntest} # ${out}"
+   echo "not ok ${ntest} # unexpected output: '${out}'"
fi
-   ntest=$((ntest+1))
+   : $(( ntest += 1 ))
 
sysctl security.mac.portacl.rules= >/dev/null
 }
 
-reserved_high=`sysctl -n net.inet.ip.portrange.reservedhigh`
-suser_exempt=`sysctl -n security.mac.portacl.suser_exempt`
-port_high=`sysctl -n security.mac.portacl.port_high`
+reserved_high=$(sysctl -n net.inet.ip.portrange.reservedhigh)
+suser_exempt=$(sysctl -n security.mac.portacl.suser_exempt)
+port_high=$(sysctl -n security.mac.portacl.port_high)
 
 restore_settings() {
sysctl -n net.inet.ip.portrange.reservedhigh=${reserved_high} >/dev/null

Modif

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

2015-12-21 Thread Gleb Smirnoff
  Nathan,

On Sat, Dec 19, 2015 at 02:16:38AM +, Nathan Whitehorn wrote:
N> Author: nwhitehorn
N> Date: Sat Dec 19 02:16:38 2015
N> New Revision: 292460
N> URL: https://svnweb.freebsd.org/changeset/base/292460
N> 
N> Log:
N>   Provide link state reporting so that ifconfig_llan0="DHCP" works. The
N>   reported link state is fictional (always up) since the hypervisor does
N>   not provide this information.
N>   
N>   MFC after: 1 week

Does dhclient require working ifmedia, or only the link state? For the
latter rolling over a fake ifmedia support isn't required.

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


svn commit: r292570 - in head: etc/mtree tests/sys tests/sys/mac tests/sys/mac/bsdextended tests/sys/mac/portacl tools/regression/mac

2015-12-21 Thread Garrett Cooper
Author: ngie
Date: Mon Dec 21 21:24:03 2015
New Revision: 292570
URL: https://svnweb.freebsd.org/changeset/base/292570

Log:
  Integrate tools/regression/mac/mac_bsdextended and
  tools/regression/mac/mac_portacl into the FreeBSD test suite as
  tests/sys/mac/bsdextended and tests/sys/mac/portacl, respectively
  
  MFC after: 1 month
  Sponsored by: EMC / Isilon Storage Division

Added:
  head/tests/sys/mac/
  head/tests/sys/mac/Makefile   (contents, props changed)
  head/tests/sys/mac/bsdextended/
  head/tests/sys/mac/bsdextended/Makefile   (contents, props changed)
  head/tests/sys/mac/bsdextended/matches_test.sh
 - copied unchanged from r292569, 
head/tools/regression/mac/mac_bsdextended/test_matches.sh
  head/tests/sys/mac/bsdextended/ugidfw_test.c
 - copied unchanged from r292569, 
head/tools/regression/mac/mac_bsdextended/test_ugidfw.c
  head/tests/sys/mac/portacl/
  head/tests/sys/mac/portacl/LICENSE
 - copied unchanged from r292569, 
head/tools/regression/mac/mac_portacl/LICENSE
  head/tests/sys/mac/portacl/Makefile   (contents, props changed)
  head/tests/sys/mac/portacl/misc.sh
 - copied unchanged from r292569, 
head/tools/regression/mac/mac_portacl/misc.sh
  head/tests/sys/mac/portacl/nobody_test.sh
 - copied unchanged from r292569, 
head/tools/regression/mac/mac_portacl/nobody.t
  head/tests/sys/mac/portacl/root_test.sh
 - copied unchanged from r292569, 
head/tools/regression/mac/mac_portacl/root.t
Deleted:
  head/tools/regression/mac/
Modified:
  head/etc/mtree/BSD.tests.dist
  head/tests/sys/Makefile

Modified: head/etc/mtree/BSD.tests.dist
==
--- head/etc/mtree/BSD.tests.dist   Mon Dec 21 21:15:23 2015
(r292569)
+++ head/etc/mtree/BSD.tests.dist   Mon Dec 21 21:24:03 2015
(r292570)
@@ -386,6 +386,12 @@
 ..
 kqueue
 ..
+mac
+bsdextended
+..
+portacl
+..
+..
 mqueue
 ..
 netinet

Modified: head/tests/sys/Makefile
==
--- head/tests/sys/Makefile Mon Dec 21 21:15:23 2015(r292569)
+++ head/tests/sys/Makefile Mon Dec 21 21:24:03 2015(r292570)
@@ -10,6 +10,7 @@ TESTS_SUBDIRS+=   fifo
 TESTS_SUBDIRS+=file
 TESTS_SUBDIRS+=kern
 TESTS_SUBDIRS+=kqueue
+TESTS_SUBDIRS+=mac
 TESTS_SUBDIRS+=mqueue
 TESTS_SUBDIRS+=netinet
 TESTS_SUBDIRS+=opencrypto

Added: head/tests/sys/mac/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tests/sys/mac/Makefile Mon Dec 21 21:24:03 2015(r292570)
@@ -0,0 +1,8 @@
+# $FreeBSD$
+
+TESTSDIR=  ${TESTSBASE}/sys/mac
+
+TESTS_SUBDIRS+=bsdextended
+TESTS_SUBDIRS+=portacl
+
+.include 

Added: head/tests/sys/mac/bsdextended/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tests/sys/mac/bsdextended/Makefile Mon Dec 21 21:24:03 2015
(r292570)
@@ -0,0 +1,13 @@
+# $FreeBSD$
+
+TESTSDIR=  ${TESTSBASE}/sys/mac/bsdextended
+
+TAP_TESTS_C+=  ugidfw_test
+TAP_TESTS_SH+= matches_test
+
+LIBADD.ugidfw_test+=   ugidfw
+
+TEST_METADATA.matches_test+=   required_user="root"
+TEST_METADATA.ugidfw_test+=required_user="root"
+
+.include 

Copied: head/tests/sys/mac/bsdextended/matches_test.sh (from r292569, 
head/tools/regression/mac/mac_bsdextended/test_matches.sh)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tests/sys/mac/bsdextended/matches_test.sh  Mon Dec 21 21:24:03 
2015(r292570, copy of r292569, 
head/tools/regression/mac/mac_bsdextended/test_matches.sh)
@@ -0,0 +1,353 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+uidrange="6:10"
+gidrange="6:10"
+uidinrange="nobody"
+uidoutrange="daemon"
+gidinrange="nobody" # We expect $uidinrange in this group
+gidoutrange="daemon" # We expect $uidinrange in this group
+
+test_num=1
+pass()
+{
+   echo "ok $test_num # $@"
+   : $(( test_num += 1 ))
+}
+
+fail()
+{
+   echo "not ok $test_num # $@"
+   : $(( test_num += 1 ))
+}
+
+#
+# Setup
+#
+
+: ${TMPDIR=/tmp}
+if [ $(id -u) -ne 0 ]; then
+   echo "1..0 # SKIP test must be run as root"
+   exit 0
+fi
+if ! sysctl -N security.mac.bsdextended >/dev/null 2>&1; then
+   echo "1..0 # SKIP mac_bsdextended(4) support isn't available"
+   exit 0
+fi
+if ! playground=$(mktemp -d $TMPDIR/tmp.XXX); then
+   echo "1..0 # SKIP failed to create temporary directory"
+   exit 0
+fi
+trap "rmdir $playground" EXIT INT TERM
+if

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

2015-12-21 Thread Nathan Whitehorn



On 12/21/15 13:24, Gleb Smirnoff wrote:

   Nathan,

On Sat, Dec 19, 2015 at 02:16:38AM +, Nathan Whitehorn wrote:
N> Author: nwhitehorn
N> Date: Sat Dec 19 02:16:38 2015
N> New Revision: 292460
N> URL: https://svnweb.freebsd.org/changeset/base/292460
N>
N> Log:
N>   Provide link state reporting so that ifconfig_llan0="DHCP" works. The
N>   reported link state is fictional (always up) since the hypervisor does
N>   not provide this information.
N>
N>   MFC after:  1 week

Does dhclient require working ifmedia, or only the link state? For the
latter rolling over a fake ifmedia support isn't required.

It needed a reply to SIOCGIFMEDIA. I'm not sure which part of that was 
required, but a fake ifmedia made it easy.

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


svn commit: r292571 - in head/sys/arm: conf freescale/imx

2015-12-21 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Mon Dec 21 21:40:15 2015
New Revision: 292571
URL: https://svnweb.freebsd.org/changeset/base/292571

Log:
  - Add driver for i.MX 6 HDMI framer
  - Enable HDMI driver in IMX6 config
  
  Reviewed by:  andrew, ian, mmel
  Differential Revision:https://reviews.freebsd.org/D4174

Added:
  head/sys/arm/freescale/imx/imx6_hdmi.c   (contents, props changed)
  head/sys/arm/freescale/imx/imx6_hdmireg.h   (contents, props changed)
  head/sys/arm/freescale/imx/imx_iomuxreg.h   (contents, props changed)
Modified:
  head/sys/arm/conf/IMX6
  head/sys/arm/freescale/imx/files.imx6

Modified: head/sys/arm/conf/IMX6
==
--- head/sys/arm/conf/IMX6  Mon Dec 21 21:24:03 2015(r292570)
+++ head/sys/arm/conf/IMX6  Mon Dec 21 21:40:15 2015(r292571)
@@ -133,6 +133,9 @@ device  u3g # USB modems
 #options   SC_DFLT_FONT# compile font in
 #makeoptions   SC_DFLT_FONT=cp437
 
+device videomode
+device hdmi
+
 # Flattened Device Tree
 optionsFDT # Configure using FDT/DTB data
 makeoptionsMODULES_EXTRA=dtb/imx6

Modified: head/sys/arm/freescale/imx/files.imx6
==
--- head/sys/arm/freescale/imx/files.imx6   Mon Dec 21 21:24:03 2015
(r292570)
+++ head/sys/arm/freescale/imx/files.imx6   Mon Dec 21 21:40:15 2015
(r292571)
@@ -24,6 +24,9 @@ arm/freescale/imx/imx6_sdma.c optional 
 arm/freescale/imx/imx6_audmux.coptional sound
 arm/freescale/imx/imx6_ssi.c   optional sound
 
+arm/arm/hdmi_if.m  optional hdmi
+arm/freescale/imx/imx6_hdmi.c  optional hdmi
+
 #
 # Optional devices.
 #

Added: head/sys/arm/freescale/imx/imx6_hdmi.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm/freescale/imx/imx6_hdmi.c  Mon Dec 21 21:40:15 2015
(r292571)
@@ -0,0 +1,768 @@
+/*-
+ * Copyright (c) 2015 Oleksandr Tymoshenko 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+/*
+ * HDMI core module
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include "hdmi_if.h"
+
+#defineI2C_DDC_ADDR(0x50 << 1)
+#defineEDID_LENGTH 0x80
+
+struct imx_hdmi_softc {
+   device_tsc_dev;
+   struct resource *sc_mem_res;
+   int sc_mem_rid;
+   struct intr_config_hook sc_mode_hook;
+   struct videomodesc_mode;
+   uint8_t *sc_edid;
+   uint8_t sc_edid_len;
+   phandle_t   sc_i2c_xref;
+};
+
+static struct ofw_compat_data compat_data[] = {
+   {"fsl,imx6dl-hdmi", 1},
+   {"fsl,imx6q-hdmi",  1},
+   {NULL,  0}
+};
+
+static inline uint8_t
+RD1(struct imx_hdmi_softc *sc, bus_size_t off)
+{
+
+   return (bus_read_1(sc->sc_mem_res, off));
+}
+
+static inline void
+WR1(struct imx_hdmi_softc *sc, bus_size_t off, uint8_t val)
+{
+
+   bus_write_1(sc->sc_mem_res, off, val);
+}
+
+static void
+imx_hdmi_phy_wait_i2c_done(struct imx_hdmi_softc *sc, int msec)
+{
+   uint8_t val;
+
+   val = RD1(sc, HDMI_IH_I2CMPHY_STAT0) &
+   (HDMI_IH_I2CMPHY_STAT0_DONE | HDMI_IH_I2CMPHY_STAT0_ERROR);
+   while (val == 0) {
+   pause("HDMI_PHY

Re: svn commit: r292528 - head/sys/x86/include

2015-12-21 Thread Conrad Meyer
No, I didn't forget.  AVX512VBMI is a flag in ECX
("cpu_stdext_feature2") rather than EBX ("cpu_stdext_feature"), and
there aren't any macros for any of the ECX flags yet (PREFETCHWT1,
AVX512VBMI, PKU, and OSPKE).

Best,
Conrad

On Mon, Dec 21, 2015 at 12:57 PM, Ravi Pokala  wrote:
> -Original Message-
>
>
> From:  on behalf of "Conrad E. Meyer" 
> 
> Date: 2015-12-20, Sunday at 20:42
> To: , , 
> 
> Subject: svn commit: r292528 - head/sys/x86/include
>
>>Author: cem
>>Date: Mon Dec 21 04:42:58 2015
>>New Revision: 292528
>>URL: https://svnweb.freebsd.org/changeset/base/292528
>>
>>Log:
>>  x86: Add CPUID_STDEXT_* macros for CPU feature bits
>>
>>  A follow-up to r292478 and r292488.
>
> Hi Conrad,
>
> Between those two changes, you added recognition for CLWB, PCOMMIT, AVX512DQ, 
> AVX512IFMA, AVX512BW, and AVX512VBMI; this change adds macros for the first 
> five, but it looks like you forgot about AVX512VBMI.
>
> -Ravi (rpokala@)
>
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292573 - head/sbin/mount

2015-12-21 Thread Alan Somers
Author: asomers
Date: Mon Dec 21 22:19:22 2015
New Revision: 292573
URL: https://svnweb.freebsd.org/changeset/base/292573

Log:
  Fix "mount -a" for NFS and ZFS filesystems with shared mountpoints
  
  sbin/mount.c
Check whether an fstab entry has the same fstype as a mounted
filesystem before declaring it to be mounted. This will allow NFS
filesystems that share a mountpoint with a local filesystem to be
automatically mounted at boot.
  
This is not such an unusual situation. For example, if somebody uses
the standard installer with a ZFS root, he'll get a /usr/home
filesystem, even though he may choose to mount /usr/home over NFS.
  
  Reviewed by:  trasz
  MFC after:4 weeks
  Sponsored by: Spectra Logic Corp
  Differential Revision:https://reviews.freebsd.org/D4556

Modified:
  head/sbin/mount/mount.c

Modified: head/sbin/mount/mount.c
==
--- head/sbin/mount/mount.c Mon Dec 21 22:16:09 2015(r292572)
+++ head/sbin/mount/mount.c Mon Dec 21 22:19:22 2015(r292573)
@@ -485,10 +485,18 @@ ismounted(struct fstab *fs, struct statf
strlcpy(realfsfile, fs->fs_file, sizeof(realfsfile));
}
 
+   /* 
+* Consider the filesystem to be mounted if:
+* It has the same mountpoint as a mounted filesytem, and
+* It has the same type as that same mounted filesystem, and
+* It has the same device name as that same mounted filesystem, OR
+* It is a nonremountable filesystem
+*/
for (i = mntsize - 1; i >= 0; --i)
if (strcmp(realfsfile, mntbuf[i].f_mntonname) == 0 &&
+   strcmp(fs->fs_vfstype, mntbuf[i].f_fstypename) == 0 && 
(!isremountable(fs->fs_vfstype) ||
-strcmp(fs->fs_spec, mntbuf[i].f_mntfromname) == 0))
+(strcmp(fs->fs_spec, mntbuf[i].f_mntfromname) == 0)))
return (1);
return (0);
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292574 - in head/sys/arm: conf freescale/imx

2015-12-21 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Mon Dec 21 22:25:35 2015
New Revision: 292574
URL: https://svnweb.freebsd.org/changeset/base/292574

Log:
  Add i.MX 6 IPU driver and enable it in IMX6 config
  
  Current functionality is somewhat limited: driver assumes that there
  is only one active IPU unit (IPU1) and that video output is DI0 and
  video mode is 1024x768. For more advanced functionality driver requires
  proper clock management which is work in progress. At the moment driver
  assumes that pixel clock is configured by u-boot for 1026x768 mode.
  
  Reviewed by:  andrew, ian, mmel
  Differential Revision:https://reviews.freebsd.org/D4168

Added:
  head/sys/arm/freescale/imx/imx6_ipu.c   (contents, props changed)
Modified:
  head/sys/arm/conf/IMX6
  head/sys/arm/freescale/imx/files.imx6

Modified: head/sys/arm/conf/IMX6
==
--- head/sys/arm/conf/IMX6  Mon Dec 21 22:19:22 2015(r292573)
+++ head/sys/arm/conf/IMX6  Mon Dec 21 22:25:35 2015(r292574)
@@ -133,6 +133,9 @@ device  u3g # USB modems
 #options   SC_DFLT_FONT# compile font in
 #makeoptions   SC_DFLT_FONT=cp437
 
+device vt
+device kbdmux
+device ukbd
 device videomode
 device hdmi
 

Modified: head/sys/arm/freescale/imx/files.imx6
==
--- head/sys/arm/freescale/imx/files.imx6   Mon Dec 21 22:19:22 2015
(r292573)
+++ head/sys/arm/freescale/imx/files.imx6   Mon Dec 21 22:25:35 2015
(r292574)
@@ -27,6 +27,8 @@ arm/freescale/imx/imx6_ssi.c  optional s
 arm/arm/hdmi_if.m  optional hdmi
 arm/freescale/imx/imx6_hdmi.c  optional hdmi
 
+arm/freescale/imx/imx6_ipu.c   optionalvt
+
 #
 # Optional devices.
 #

Added: head/sys/arm/freescale/imx/imx6_ipu.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm/freescale/imx/imx6_ipu.c   Mon Dec 21 22:25:35 2015
(r292574)
@@ -0,0 +1,1203 @@
+/*-
+ * Copyright 2015 Oleksandr Tymoshenko 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+#include "fb_if.h"
+#include "hdmi_if.h"
+
+#define EDID_DEBUG_not
+
+static int have_ipu = 0;
+
+#defineLDB_CLOCK_RATE  28000
+
+#defineMODE_HBP(mode)  ((mode)->htotal - (mode)->hsync_end)
+#defineMODE_HFP(mode)  ((mode)->hsync_start - (mode)->hdisplay)
+#defineMODE_HSW(mode)  ((mode)->hsync_end - (mode)->hsync_start)
+#defineMODE_VBP(mode)  ((mode)->vtotal - (mode)->vsync_end)
+#defineMODE_VFP(mode)  ((mode)->vsync_start - (mode)->vdisplay)
+#defineMODE_VSW(mode)  ((mode)->vsync_end - (mode)->vsync_start)
+
+#defineMODE_BPP16
+#defineMODE_PIXEL_CLOCK_INVERT 1
+
+#define M(nm,hr,vr,clk,hs,he,ht,vs,ve,vt,f) \
+   { clk, hr, hs, he, ht, vr, vs, ve, vt, f, nm }
+
+static struct videomode mode1024x768 = 
M("1024x768x60",1024,768,65000,1048,1184,1344,771,777,806,VID_NHSYNC|VID_PHSYNC);
+
+#defineDMA_CHANNEL 23
+#defineDC_CHAN55
+#defineDI_PORT 0
+
+#defineIPU_LOCK(_sc)   mtx_lock(&(_sc)->sc_mtx)
+#define

svn commit: r292575 - head/libexec/rtld-elf

2015-12-21 Thread Ed Maste
Author: emaste
Date: Mon Dec 21 22:40:29 2015
New Revision: 292575
URL: https://svnweb.freebsd.org/changeset/base/292575

Log:
  rtld: Use common NT_FREEBSD_* note types introduced in r291909
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/libexec/rtld-elf/rtld.c

Modified: head/libexec/rtld-elf/rtld.c
==
--- head/libexec/rtld-elf/rtld.cMon Dec 21 22:25:35 2015
(r292574)
+++ head/libexec/rtld-elf/rtld.cMon Dec 21 22:40:29 2015
(r292575)
@@ -1362,22 +1362,22 @@ digest_notes(Obj_Entry *obj, Elf_Addr no
if (note->n_namesz != sizeof(NOTE_FREEBSD_VENDOR) ||
note->n_descsz != sizeof(int32_t))
continue;
-   if (note->n_type != ABI_NOTETYPE &&
-   note->n_type != CRT_NOINIT_NOTETYPE)
+   if (note->n_type != NT_FREEBSD_ABI_TAG &&
+   note->n_type != NT_FREEBSD_NOINIT_TAG)
continue;
note_name = (const char *)(note + 1);
if (strncmp(NOTE_FREEBSD_VENDOR, note_name,
sizeof(NOTE_FREEBSD_VENDOR)) != 0)
continue;
switch (note->n_type) {
-   case ABI_NOTETYPE:
+   case NT_FREEBSD_ABI_TAG:
/* FreeBSD osrel note */
p = (uintptr_t)(note + 1);
p += roundup2(note->n_namesz, sizeof(Elf32_Addr));
obj->osrel = *(const int32_t *)(p);
dbg("note osrel %d", obj->osrel);
break;
-   case CRT_NOINIT_NOTETYPE:
+   case NT_FREEBSD_NOINIT_TAG:
/* FreeBSD 'crt does not call init' note */
obj->crt_no_init = true;
dbg("note crt_no_init");
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292576 - head/sys/boot/efi/boot1

2015-12-21 Thread Ed Maste
Author: emaste
Date: Mon Dec 21 22:42:03 2015
New Revision: 292576
URL: https://svnweb.freebsd.org/changeset/base/292576

Log:
  boot1.efi: show EFI error number, not full status value
  
  EFI return values set the high bit to indicate an error. The log
  messages changed here are printed only in the case of an error,
  so including the error bit is redundant. Also switch to decimal to
  match the error definitions (in sys/boot/efi/include/efierr.h).
  
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/boot/efi/boot1/boot1.c

Modified: head/sys/boot/efi/boot1/boot1.c
==
--- head/sys/boot/efi/boot1/boot1.c Mon Dec 21 22:40:29 2015
(r292575)
+++ head/sys/boot/efi/boot1/boot1.c Mon Dec 21 22:42:03 2015
(r292576)
@@ -330,18 +330,21 @@ load(const char *fname)
status = systab->BootServices->LoadImage(TRUE, image, bootdevpath,
buffer, bufsize, &loaderhandle);
if (EFI_ERROR(status))
-   printf("LoadImage failed with error %lx\n", status);
+   printf("LoadImage failed with error %lu\n",
+   status & ~EFI_ERROR_MASK);
 
status = systab->BootServices->HandleProtocol(loaderhandle,
&LoadedImageGUID, (VOID**)&loaded_image);
if (EFI_ERROR(status))
-   printf("HandleProtocol failed with error %lx\n", status);
+   printf("HandleProtocol failed with error %lu\n",
+   status & ~EFI_ERROR_MASK);
 
loaded_image->DeviceHandle = bootdevhandle;
 
status = systab->BootServices->StartImage(loaderhandle, NULL, NULL);
if (EFI_ERROR(status))
-   printf("StartImage failed with error %lx\n", status);
+   printf("StartImage failed with error %lu\n",
+   status & ~EFI_ERROR_MASK);
 }
 
 static void
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r292576 - head/sys/boot/efi/boot1

2015-12-21 Thread John Baldwin
On Monday, December 21, 2015 10:42:03 PM Ed Maste wrote:
> Author: emaste
> Date: Mon Dec 21 22:42:03 2015
> New Revision: 292576
> URL: https://svnweb.freebsd.org/changeset/base/292576
> 
> Log:
>   boot1.efi: show EFI error number, not full status value
>   
>   EFI return values set the high bit to indicate an error. The log
>   messages changed here are printed only in the case of an error,
>   so including the error bit is redundant. Also switch to decimal to
>   match the error definitions (in sys/boot/efi/include/efierr.h).
>   
>   MFC after:  1 week
>   Sponsored by:   The FreeBSD Foundation

Perhaps it would be useful to have a shared 'EFI_ERROR_NUM()' macro?

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


svn commit: r292577 - head/sys/dev/ofw

2015-12-21 Thread Ian Lepore
Author: ian
Date: Mon Dec 21 23:47:49 2015
New Revision: 292577
URL: https://svnweb.freebsd.org/changeset/base/292577

Log:
  Include machine/_bus.h so that bus_space_[tag|handle]_t will be available.
  
  It appears that all platforms except aarch64 are getting the file via
  various header pollution, and ensuring _bus.h is included before any
  openfirmware headers in every consumer of ofw/fdt stuff seems like more of
  a career path than a task, so I'm taking this easy way out.

Modified:
  head/sys/dev/ofw/openfirm.h

Modified: head/sys/dev/ofw/openfirm.h
==
--- head/sys/dev/ofw/openfirm.h Mon Dec 21 22:42:03 2015(r292576)
+++ head/sys/dev/ofw/openfirm.h Mon Dec 21 23:47:49 2015(r292577)
@@ -61,6 +61,7 @@
 #define _DEV_OPENFIRM_H_
 
 #include 
+#include 
 
 /*
  * Prototypes for Open Firmware Interface Routines
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292578 - in head/contrib/netbsd-tests/lib/libc: gen ssp

2015-12-21 Thread Garrett Cooper
Author: ngie
Date: Tue Dec 22 00:43:22 2015
New Revision: 292578
URL: https://svnweb.freebsd.org/changeset/base/292578

Log:
  Don't dump core files with lib/libc/ssp/ssp_test and lib/libc/gen/assert_test
  
  The default `sysctl kern.corefile` value is compatible with `kyua test` 
(FreeBSD
  will dump to the current directory). If it's set to an absolute path however,
  `kyua test` will not be able to clean up the corefiles after the fact
  
  The corefiles have little value when testing the behavior of feature behavior,
  so just disable corefile generation
  
  MFC after: 1 week
  Obtained from: Isilon OneFS (^/onefs/head@r511419)
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/contrib/netbsd-tests/lib/libc/gen/t_assert.c
  head/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh

Modified: head/contrib/netbsd-tests/lib/libc/gen/t_assert.c
==
--- head/contrib/netbsd-tests/lib/libc/gen/t_assert.c   Mon Dec 21 23:47:49 
2015(r292577)
+++ head/contrib/netbsd-tests/lib/libc/gen/t_assert.c   Tue Dec 22 00:43:22 
2015(r292578)
@@ -40,6 +40,23 @@ __RCSID("$NetBSD: t_assert.c,v 1.2 2011/
 #include 
 #include 
 
+#ifdef __FreeBSD__
+#include 
+#include 
+#include 
+
+static void
+disable_corefile(void)
+{
+   struct rlimit limits;
+
+   limits.rlim_cur = 0;
+   limits.rlim_max = 0;
+
+   ATF_REQUIRE(setrlimit(RLIMIT_CORE, &limits) == 0);
+}
+#endif
+
 static voidhandler(int);
 
 static void
@@ -65,6 +82,9 @@ ATF_TC_BODY(assert_false, tc)
 
if (pid == 0) {
 
+#ifdef __FreeBSD__
+   disable_corefile();
+#endif
(void)closefrom(0);
(void)memset(&sa, 0, sizeof(struct sigaction));
 
@@ -102,6 +122,9 @@ ATF_TC_BODY(assert_true, tc)
 
if (pid == 0) {
 
+#ifdef __FreeBSD__
+   disable_corefile();
+#endif
(void)closefrom(0);
(void)memset(&sa, 0, sizeof(struct sigaction));
 

Modified: head/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh
==
--- head/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh Mon Dec 21 23:47:49 
2015(r292577)
+++ head/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh Tue Dec 22 00:43:22 
2015(r292578)
@@ -35,6 +35,7 @@ h_fail()
 {
echo "Executing command [ $2$1 ]"
# Begin FreeBSD
+   ulimit -c 0
if true; then
eval $2 atf_check -s signal -o ignore -e ignore $1
else
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292579 - head/sys/dev/ofw

2015-12-21 Thread Ian Lepore
Author: ian
Date: Tue Dec 22 00:53:19 2015
New Revision: 292579
URL: https://svnweb.freebsd.org/changeset/base/292579

Log:
  Fix the detection of IO/memory space changing across busses when the bus
  is not pci (and thus where, ironically, the whole situation is meaningless).
  
  This was not an error in the original code, it was introduced during my
  refactoring to commonize the routine.  A small change a few lines above
  drove the need to make this change, and the error didn't show up on the
  platforms I initially tested with.

Modified:
  head/sys/dev/ofw/ofw_subr.c

Modified: head/sys/dev/ofw/ofw_subr.c
==
--- head/sys/dev/ofw/ofw_subr.c Tue Dec 22 00:43:22 2015(r292578)
+++ head/sys/dev/ofw/ofw_subr.c Tue Dec 22 00:53:19 2015(r292579)
@@ -137,9 +137,8 @@ ofw_reg_to_paddr(phandle_t dev, int regn
res /= sizeof(cell[0]);
regno = 0;
while (regno < res) {
-   rspc = (pci)
-   ? cell[regno] & OFW_PCI_PHYS_HI_SPACEMASK
-   : OFW_PADDR_NOT_PCI;
+   rspc = (pci ? cell[regno] : OFW_PADDR_NOT_PCI) &
+   OFW_PCI_PHYS_HI_SPACEMASK;
if (rspc != spc) {
regno += naddr + nbridge + nsize;
continue;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292580 - head/usr.sbin/jls

2015-12-21 Thread Craig Rodrigues
Author: rodrigc
Date: Tue Dec 22 00:58:35 2015
New Revision: 292580
URL: https://svnweb.freebsd.org/changeset/base/292580

Log:
  Add libxo support to jls
  
  PR:200746
  Submitted by:  Emmanuel Vadot 
  Reviewed by:   allanjude
  Relnotes:  yes
  Differential Revision: https://reviews.freebsd.org/D4452

Modified:
  head/usr.sbin/jls/Makefile
  head/usr.sbin/jls/jls.8
  head/usr.sbin/jls/jls.c

Modified: head/usr.sbin/jls/Makefile
==
--- head/usr.sbin/jls/Makefile  Tue Dec 22 00:53:19 2015(r292579)
+++ head/usr.sbin/jls/Makefile  Tue Dec 22 00:58:35 2015(r292580)
@@ -4,7 +4,7 @@
 
 PROG=  jls
 MAN=   jls.8
-LIBADD=jail
+LIBADD=jail xo
 
 .if ${MK_INET6_SUPPORT} != "no"
 CFLAGS+= -DINET6

Modified: head/usr.sbin/jls/jls.8
==
--- head/usr.sbin/jls/jls.8 Tue Dec 22 00:53:19 2015(r292579)
+++ head/usr.sbin/jls/jls.8 Tue Dec 22 00:58:35 2015(r292580)
@@ -33,6 +33,7 @@
 .Nd "list jails"
 .Sh SYNOPSIS
 .Nm
+.Op Fl -libxo
 .Op Fl dhNnqsv
 .Op Fl j Ar jail
 .Op Ar parameter ...
@@ -62,6 +63,13 @@ and path (path).
 .Pp
 The following options are available:
 .Bl -tag -width indent
+.It Fl -libxo
+Generate output via
+.Xr libxo 3
+in a selection of different human and machine readable formats.
+See
+.Xr xo_parse_args 3
+for details on command line arguments.
 .It Fl d
 List
 .Va dying
@@ -106,7 +114,9 @@ Without this option, all active jails wi
 .Sh SEE ALSO
 .Xr jail_get 2 ,
 .Xr jail 8 ,
-.Xr jexec 8
+.Xr jexec 8 ,
+.Xr libxo 3 ,
+.Xr xo_parse_args 3
 .Sh HISTORY
 The
 .Nm
@@ -114,3 +124,5 @@ utility was added in
 .Fx 5.1 .
 Extensible jail parameters were introduced in
 .Fx 8.0 .
+libxo support was added in
+.Fx 11.0 .

Modified: head/usr.sbin/jls/jls.c
==
--- head/usr.sbin/jls/jls.c Tue Dec 22 00:53:19 2015(r292579)
+++ head/usr.sbin/jls/jls.c Tue Dec 22 00:58:35 2015(r292580)
@@ -2,6 +2,7 @@
  * Copyright (c) 2003 Mike Barcroft 
  * Copyright (c) 2008 Bjoern A. Zeeb 
  * Copyright (c) 2009 James Gritton 
+ * Copyright (c) 2015 Emmanuel Vadot 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -45,10 +46,13 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #defineJP_USER 0x0100
 #defineJP_OPT  0x0200
 
+#define JLS_XO_VERSION "1"
+
 #definePRINT_DEFAULT   0x01
 #definePRINT_HEADER0x02
 #definePRINT_NAMEVAL   0x04
@@ -73,7 +77,7 @@ static int sort_param(const void *a, con
 static char *noname(const char *name);
 static char *nononame(const char *name);
 static int print_jail(int pflags, int jflags);
-static void quoted_print(char *str);
+static void quoted_print(int pflags, char *name, char *value);
 
 int
 main(int argc, char **argv)
@@ -81,6 +85,11 @@ main(int argc, char **argv)
char *dot, *ep, *jname, *pname;
int c, i, jflags, jid, lastjid, pflags, spc;
 
+   argc = xo_parse_args(argc, argv);
+   if (argc < 0)
+   exit(1);
+
+xo_set_version(JLS_XO_VERSION);
jname = NULL;
pflags = jflags = jid = 0;
while ((c = getopt(argc, argv, "adj:hNnqsv")) >= 0)
@@ -119,7 +128,7 @@ main(int argc, char **argv)
PRINT_VERBOSE;
break;
default:
-   errx(1, "usage: jls [-dhNnqv] [-j jail] [param ...]");
+   xo_errx(1, "usage: jls [-dhNnqv] [-j jail] [param 
...]");
}
 
 #ifdef INET6
@@ -196,42 +205,48 @@ main(int argc, char **argv)
add_param("lastjid", &lastjid, sizeof(lastjid), NULL, 0);
 
/* Print a header line if requested. */
-   if (pflags & PRINT_VERBOSE)
-   printf("   JID  Hostname  Path\n"
-  "Name  State\n"
-  "CPUSetID\n"
-  "IP Address(es)\n");
+   if (pflags & PRINT_VERBOSE) {
+   xo_emit("{T:/%3s}{T:JID}{P:  }{T:Hostname}{Pd:/%22s}{T:Path}\n",
+   "", "");
+   xo_emit("{P:/%8s}{T:Name}{Pd:/%26s}{T:State}\n", "", "");
+   xo_emit("{P:/%8s}{T:CPUSetID}\n", "");
+   xo_emit("{P:/%8s}{T:IP Address(es)}\n", "");
+   }
else if (pflags & PRINT_DEFAULT)
if (pflags & PRINT_JAIL_NAME)
-   printf(" JID IP Address  "
-   "Hostname  Path\n");
+   xo_emit("{P: }{T:JID/%-15s}{P: }{T:IP Address/%-15s}"
+   "{P: }{T:Hostname/%-29s}{P: }{T:Path}\n");
el

svn commit: r292581 - head/contrib/netbsd-tests/usr.bin/grep

2015-12-21 Thread Garrett Cooper
Author: ngie
Date: Tue Dec 22 01:21:27 2015
New Revision: 292581
URL: https://svnweb.freebsd.org/changeset/base/292581

Log:
  Use stable output to a test file instead of depending on the OS name being
  grep'able in /bin/sh
  
  This fixes the situation where the OS has been rebranded to something other
  than `FreeBSD`
  
  MFC after: 1 week
  Obtained from: Isilon OneFS (^/onefs/head@r511419)
  Reviewed by: cem, Daniel O'Connor 
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/contrib/netbsd-tests/usr.bin/grep/d_binary.out
  head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh

Modified: head/contrib/netbsd-tests/usr.bin/grep/d_binary.out
==
--- head/contrib/netbsd-tests/usr.bin/grep/d_binary.out Tue Dec 22 00:58:35 
2015(r292580)
+++ head/contrib/netbsd-tests/usr.bin/grep/d_binary.out Tue Dec 22 01:21:27 
2015(r292581)
@@ -1 +1 @@
-Binary file /bin/sh matches
+Binary file test.file matches

Modified: head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh
==
--- head/contrib/netbsd-tests/usr.bin/grep/t_grep.shTue Dec 22 00:58:35 
2015(r292580)
+++ head/contrib/netbsd-tests/usr.bin/grep/t_grep.shTue Dec 22 01:21:27 
2015(r292581)
@@ -43,7 +43,20 @@ binary_head()
 }
 binary_body()
 {
+   # Begin FreeBSD
+   #
+   # Generate stable output instead of depending on uname to match the
+   # branded OS name of /bin/sh
+   if true; then
+   dd if=/dev/zero count=1 of=test.file
+   echo -n "foobar" >> test.file
+   atf_check -o file:"$(atf_get_srcdir)/d_binary.out" grep foobar test.file
+   else
+   # End FreeBSD
atf_check -o file:"$(atf_get_srcdir)/d_binary.out" grep $(uname) /bin/sh
+   # Begin FreeBSD
+   fi
+   # End FreeBSD
 }
 
 atf_test_case recurse
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292582 - head/tests/sys/file

2015-12-21 Thread Garrett Cooper
Author: ngie
Date: Tue Dec 22 02:10:31 2015
New Revision: 292582
URL: https://svnweb.freebsd.org/changeset/base/292582

Log:
  Dump out the output from flock_helper on failure so failures with the
  test app can be debugged
  
  MFC after: 1 week
  Obtained from: Isilon OneFS (^/onefs/head@r511419)
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/tests/sys/file/flock_test.sh

Modified: head/tests/sys/file/flock_test.sh
==
--- head/tests/sys/file/flock_test.sh   Tue Dec 22 01:21:27 2015
(r292581)
+++ head/tests/sys/file/flock_test.sh   Tue Dec 22 02:10:31 2015
(r292582)
@@ -43,10 +43,11 @@ for n in `seq 1 $last_testcase`; do
todomsg=" # TODO: racy testcase"
fi
 
-   $(dirname $0)/flock_helper . $n | grep -q SUCCEED
-   if [ $? -eq 0 ]; then
+   output=$($(dirname $0)/flock_helper . $n)
+   if echo "$output" | grep -q SUCCEED; then
echo "ok $n$todomsg"
else
echo "not ok $n$todomsg"
+   echo "$output" >&2
fi
 done
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292583 - head/lib/libstand

2015-12-21 Thread Ian Lepore
Author: ian
Date: Tue Dec 22 03:02:52 2015
New Revision: 292583
URL: https://svnweb.freebsd.org/changeset/base/292583

Log:
  Allow dhcp/bootp server-provided values to be overriden from environment
  variables in loader(8) and other libstand applications.
  
  Sometimes a dhcp server provides incorrect information along with the IP
  address. It would be useful to have a way to override this with
  locally-supplied information, such as command line parameters passed from a
  prior-stage bootloader. This change allows pre-existing env vars to take
  precedence over values delivered by the dhcp or bootp server.
  
  The bootp/dhcp code in libstand automatically creates environment variables
  from the data provided by the server (dhcp.root-path, dhcp.domain-name,
  etc). It also transcribes the values to some global variables such as
  'rootpath' and 'hostname'.
  
  This change does two things:
  
  When adding dhcp.* vars to the environment, don't replace existing
  vars/values.
  
  When setting the global vars rootpath and hostname, use the
  dhcp.root-path and dhcp.host-name env var values if they exist.
  
  This allows the platform-specific part of loader(8) to obtain override
  values in some platform-specific way and store them in the environment
  before opening the network device. The set of values that can be overriden
  is currently limited to just string options. The values that are delivered
  as binary data are things that probably shouldn't be overridden (IP,
  netmask, gateway, etc).
  
  The original patch this evolved from was submitted by martymac@
  
  PR:   202098
  Differential Revision:https://reviews.freebsd.org/D4559

Modified:
  head/lib/libstand/bootp.c

Modified: head/lib/libstand/bootp.c
==
--- head/lib/libstand/bootp.c   Tue Dec 22 02:10:31 2015(r292582)
+++ head/lib/libstand/bootp.c   Tue Dec 22 03:02:52 2015(r292583)
@@ -354,6 +354,7 @@ vend_rfc1048(cp, len)
u_char *ep;
int size;
u_char tag;
+   const char *val;
 
 #ifdef BOOTP_DEBUG
if (debug)
@@ -380,15 +381,17 @@ vend_rfc1048(cp, len)
}
if (tag == TAG_SWAPSERVER) {
/* let it override bp_siaddr */
-   bcopy(cp, &rootip.s_addr, sizeof(swapip.s_addr));
+   bcopy(cp, &rootip.s_addr, sizeof(rootip.s_addr));
}
if (tag == TAG_ROOTPATH) {
-   strncpy(rootpath, (char *)cp, sizeof(rootpath));
-   rootpath[size] = '\0';
+   if ((val = getenv("dhcp.root-path")) == NULL)
+   val = (const char *)cp;
+   strlcpy(rootpath, val, sizeof(rootpath));
}
if (tag == TAG_HOSTNAME) {
-   strncpy(hostname, (char *)cp, sizeof(hostname));
-   hostname[size] = '\0';
+   if ((val = getenv("dhcp.host-name")) == NULL)
+   val = (const char *)cp;
+   strlcpy(hostname, val, sizeof(hostname));
}
 #ifdef SUPPORT_DHCP
if (tag == TAG_DHCP_MSGTYPE) {
@@ -730,7 +733,11 @@ setenv_(u_char *cp,  u_char *ep, struct 
sprintf(env, op->desc, opts[0].desc, tag);
else
sprintf(env, "%s%s", opts[0].desc, op->desc);
-   setenv(env, buf, 1);
+   /*
+* Do not replace existing values in the environment, so that
+* locally-obtained values can override server-provided values.
+*/
+   setenv(env, buf, 0);
}
 }
 if (tp != tags) {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292584 - head/sys/boot/efi/loader

2015-12-21 Thread Ian Lepore
Author: ian
Date: Tue Dec 22 03:07:38 2015
New Revision: 292584
URL: https://svnweb.freebsd.org/changeset/base/292584

Log:
  Set env vars from values on the efi loader command line.
  
  Examine each cmdline arg and if it contains an '=' convert it to ascii and
  pass it to putenv(). This allows var=value settings to come in on the
  command line.
  
  This will allow overriding dhcp server-provided data in loader(8), as
  discussed in PR 202098
  
  PR:   202098
  Differential Revision:https://reviews.freebsd.org/D4561

Modified:
  head/sys/boot/efi/loader/main.c

Modified: head/sys/boot/efi/loader/main.c
==
--- head/sys/boot/efi/loader/main.c Tue Dec 22 03:02:52 2015
(r292583)
+++ head/sys/boot/efi/loader/main.c Tue Dec 22 03:07:38 2015
(r292584)
@@ -64,10 +64,10 @@ EFI_GUID fdtdtb = FDT_TABLE_GUID;
 EFI_STATUS
 main(int argc, CHAR16 *argv[])
 {
-   char vendor[128];
+   char var[128];
EFI_LOADED_IMAGE *img;
EFI_GUID *guid;
-   int i;
+   int i, j, vargood;
 
/*
 * XXX Chicken-and-egg problem; we want to have console output
@@ -77,6 +77,29 @@ main(int argc, CHAR16 *argv[])
 */
cons_probe();
 
+   /*
+* Loop through the args, and for each one that contains an '=' that is
+* not the first character, add it to the environment.  This allows
+* loader and kernel env vars to be passed on the command line.  Convert
+* args from UCS-2 to ASCII (16 to 8 bit) as they are copied.
+*/
+   for (i = 1; i < argc; i++) {
+   vargood = 0;
+   for (j = 0; argv[i][j] != 0; j++) {
+   if (j == sizeof(var)) {
+   vargood = 0;
+   break;
+   }
+   if (j > 0 && argv[i][j] == '=')
+   vargood = 1;
+   var[j] = (char)argv[i][j];
+   }
+   if (vargood) {
+   var[j] = 0;
+   putenv(var);
+   }
+   }
+
if (efi_copy_init()) {
printf("failed to allocate staging area\n");
return (EFI_BUFFER_TOO_SMALL);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r292576 - head/sys/boot/efi/boot1

2015-12-21 Thread Ed Maste
On 21 December 2015 at 23:26, John Baldwin  wrote:
>
> Perhaps it would be useful to have a shared 'EFI_ERROR_NUM()' macro?

Yes, or perhaps even an efi_err() similar to err(3). My immediate goal
is to bring the UEFI fixes from HEAD into stable/10 for 10.3, but will
add EFI_ERROR_NUM or efi_err in a bit.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292585 - head/usr.sbin/uhsoctl

2015-12-21 Thread Garrett Cooper
Author: ngie
Date: Tue Dec 22 05:57:23 2015
New Revision: 292585
URL: https://svnweb.freebsd.org/changeset/base/292585

Log:
  Prevent use-after-free with ctx->ns in set_nameservers(..), which could occur
  if the memory wasn't allocated again later on
  
  Reported by: Coverity
  Submitted by: Miles Ohlrich 
  MFC after: 1 week
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/usr.sbin/uhsoctl/uhsoctl.c

Modified: head/usr.sbin/uhsoctl/uhsoctl.c
==
--- head/usr.sbin/uhsoctl/uhsoctl.c Tue Dec 22 03:07:38 2015
(r292584)
+++ head/usr.sbin/uhsoctl/uhsoctl.c Tue Dec 22 05:57:23 2015
(r292585)
@@ -452,6 +452,7 @@ set_nameservers(struct ctx *ctx, const c
free(ctx->ns[i]);
}
free(ctx->ns);
+   ctx->ns = NULL;
}
 
fd = open(respath, O_RDWR | O_CREAT | O_NOFOLLOW, 0666);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292586 - head/tools/tools/nanobsd/embedded

2015-12-21 Thread Warner Losh
Author: imp
Date: Tue Dec 22 06:36:00 2015
New Revision: 292586
URL: https://svnweb.freebsd.org/changeset/base/292586

Log:
  For embedded platforms that require it, use mtools to copy the
  appropriate u-boot port's files into the fat part.

Modified:
  head/tools/tools/nanobsd/embedded/common

Modified: head/tools/tools/nanobsd/embedded/common
==
--- head/tools/tools/nanobsd/embedded/commonTue Dec 22 05:57:23 2015
(r292585)
+++ head/tools/tools/nanobsd/embedded/commonTue Dec 22 06:36:00 2015
(r292586)
@@ -86,7 +86,7 @@ NANO_CFG_BASE=$(pwd)
 NANO_CFG_BASE=$(realpath ${NANO_CFG_BASE}/..)
 NANO_SRC=$(realpath ${NANO_CFG_BASE}/../../..)
  XXX share obj 
-NANO_OBJ=$(realpath ${NANO_SRC}/../$NANO_NAME/obj || echo 
${NANO_SRC}/../$NANO_NAME/obj)
+NANO_OBJ=${NANO_SRC}/../$NANO_NAME/obj
 # Where cust_pkg() finds packages to install
 #XXX: Is this the right place?
 #NANO_PORTS=$(realpath ${NANO_SRC}/../ports)
@@ -100,6 +100,9 @@ unset MAKEOBJDIRPREFIX
 NANO_PORTS=${NANO_PORTS:-/usr/ports}
 
 mkdir -p ${NANO_OBJ}
+NANO_OBJ=$(realpath ${NANO_OBJ})
+
+NANO_FAT_DIR=${NANO_OBJ}/_.fat
 
 customize_cmd cust_allow_ssh_root
 
@@ -301,8 +304,11 @@ create_diskimage_mbr ( ) (
echo Creating MSDOS partition for kernel
newfs_msdos -C ${NANO_SLICE_FAT_SIZE} -F 16 -L ${NANO_NAME} \
${NANO_OBJ}/_.${NANO_SLICE_FAT}
-   # Need to copy files from ${NANO_FATDIR} with mtools, or use
-   # makefs -t msdos once that's supported
+   if [ -d ${NANO_FAT_DIR} ]; then
+   # Need to copy files from ${NANO_FATDIR} with mtools, 
or use
+   # makefs -t msdos once that's supported
+   mcopy -i ${NANO_OBJ}/_.${NANO_SLICE_FAT} 
${NANO_FAT_DIR}/* ::
+   fi
fi
 
# Populate the Powerpc boot image, if needed
@@ -440,7 +446,7 @@ save_build ( )
 }
 customize_cmd save_build
 
-shrink_md_fbsize()
+shrink_md_fbsize ( )
 {
# We have a lot of little files on our memory disks. Let's decrease
# the block and frag size to fit more little files on them (this
@@ -454,8 +460,28 @@ customize_cmd shrink_md_fbsize
 
 customize_cmd cust_comconsole
 
-product_custom()
-{
+dos_boot_part ( )
+(
+   local d=/usr/local/share/u-boot/${NANO_BOOT_PKG}
+
+   mkdir ${NANO_FAT_DIR}
+   cp ${d}/* ${NANO_FAT_DIR}   
+)
+
+if [ -n "$NANO_BOOT_PKG" ]; then
+   if [ ! -d ${d} ]; then
+   echo ${NANO_BOOT_PKG} not installed. Sadly, it must be.
+   exit 1
+   fi
+   if [ ! -x /usr/local/bin/mcopy ]; then
+   echo mtools not installed. Sadly, we gotta have it.
+   exit 1
+   fi
+   customize_cmd dos_boot_part
+fi
+
+product_custom ( )
+(
# not quie ready to tweak these in nopriv build
if [ -z ${NANO_NOPRIV_BUILD} ]; then
# Last second tweaks -- generally not needed
@@ -467,7 +493,7 @@ product_custom()
chown root:wheel ${NANO_WORLDDIR}/
chown root:wheel ${NANO_WORLDDIR}/usr
fi
-}
+)
 late_customize_cmd product_custom
 
 #
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"