svn commit: r263333 - head/sys/net

2014-03-19 Thread Gleb Smirnoff
Author: glebius
Date: Wed Mar 19 06:08:03 2014
New Revision: 26
URL: http://svnweb.freebsd.org/changeset/base/26

Log:
  When exporting ifnet via sysctl, add ifqueue(9) drop count to the
  ifi_oqdrops. This is a temporary workaround until ifqueue(9) vanishes.
  
  While here, remove the pointless ifi_vhid assignment. It has
  sense only when we are exporting ifaddrs, not ifnets.
  
  Sponsored by: Netflix
  Sponsored by: Nginx, Inc.

Modified:
  head/sys/net/rtsock.c

Modified: head/sys/net/rtsock.c
==
--- head/sys/net/rtsock.c   Wed Mar 19 06:03:26 2014(r263332)
+++ head/sys/net/rtsock.c   Wed Mar 19 06:08:03 2014(r26)
@@ -1598,9 +1598,8 @@ sysctl_iflist_ifml(struct ifnet *ifp, st
 
*ifd = ifp-if_data;
 
-   /* Fixup if_data carp(4) vhid. */
-   if (carp_get_vhid_p != NULL)
-   ifd-ifi_vhid = (*carp_get_vhid_p)(ifp-if_addr);
+   /* Some drivers still use ifqueue(9), add its stats. */
+   ifd-ifi_oqdrops += ifp-if_snd.ifq_drops;
 
return (SYSCTL_OUT(w-w_req, (caddr_t)ifm, len));
 }
@@ -1633,9 +1632,9 @@ sysctl_iflist_ifm(struct ifnet *ifp, str
}
 
*ifd = ifp-if_data;
-   /* Fixup if_data carp(4) vhid. */
-   if (carp_get_vhid_p != NULL)
-   ifd-ifi_vhid = (*carp_get_vhid_p)(ifp-if_addr);
+
+   /* Some drivers still use ifqueue(9), add its stats. */
+   ifd-ifi_oqdrops += ifp-if_snd.ifq_drops;
 
return (SYSCTL_OUT(w-w_req, (caddr_t)ifm, len));
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r263336 - head/tests/sys/kern

2014-03-19 Thread Peter Holm
Author: pho
Date: Wed Mar 19 09:41:12 2014
New Revision: 263336
URL: http://svnweb.freebsd.org/changeset/base/263336

Log:
  Added sysctl kern.maxfiles increase test, do not use /etc/passwd for tests
  and use volatile sig_atomic_t for signal handler variable.
  
  Reviewed by:   asomers (previous version)
  Sponsored by: EMC / Isilon storage division

Modified:
  head/tests/sys/kern/kern_descrip_test.c

Modified: head/tests/sys/kern/kern_descrip_test.c
==
--- head/tests/sys/kern/kern_descrip_test.c Wed Mar 19 09:36:29 2014
(r263335)
+++ head/tests/sys/kern/kern_descrip_test.c Wed Mar 19 09:41:12 2014
(r263336)
@@ -29,22 +29,31 @@ __FBSDID($FreeBSD$);
 
 #include errno.h
 #include fcntl.h
+#include signal.h
 #include stdio.h
 #include stdlib.h
 #include strings.h
 #include sys/limits.h
 #include sys/stat.h
+#include sys/sysctl.h
 #include unistd.h
 #include atf-c.h
 
+static volatile sig_atomic_t done;
+
+#define AFILE afile
+#define EXPANDBY 1000
+#define PARALLEL 4
+#define RENDEZVOUS rendezvous
+#define VALUE value
+
 ATF_TC_WITHOUT_HEAD(dup2__simple);
 ATF_TC_BODY(dup2__simple, tc)
 {
int fd1, fd2;
struct stat sb1, sb2;
 
-   fd1 = open(/etc/passwd, O_RDONLY);
-   ATF_REQUIRE(fd1 = 0);
+   ATF_REQUIRE((fd1 = open(AFILE, O_CREAT, 0644)) != -1);
fd2 = 27;
ATF_REQUIRE(dup2(fd1, fd2) != -1);
ATF_REQUIRE(fstat(fd1, sb1) != -1);
@@ -57,22 +66,125 @@ ATF_TC_HEAD(dup2__ebadf_when_2nd_arg_out
 {
atf_tc_set_md_var(tc, descr, Regression test for r234131);
 }
+
 ATF_TC_BODY(dup2__ebadf_when_2nd_arg_out_of_range, tc)
 {
int fd1, fd2, ret;
 
-   fd1 =  open(/etc/passwd, O_RDONLY);
+   ATF_REQUIRE((fd1 = open(AFILE, O_CREAT, 0644)) != -1);
fd2 = INT_MAX;
ret = dup2(fd1, fd2);
ATF_CHECK_EQ(-1, ret);
ATF_CHECK_EQ(EBADF, errno);
 }
 
+static void
+handler(int s __unused)
+{
+   done++;
+}
+
+static void
+openfiles2(size_t n)
+{
+   size_t i;
+   int r;
+
+   errno = 0;
+   for (i = 0; i  n; i++)
+   ATF_REQUIRE((r = open(AFILE, O_RDONLY)) != -1);
+   kill(getppid(), SIGUSR1);
+
+   for (;;) {
+   if (access(RENDEZVOUS, R_OK) != 0)
+   break;
+   usleep(1000);
+   }
+   _exit(0);
+}
+
+static void
+openfiles(size_t n)
+{
+   int i, fd;
+
+   signal(SIGUSR1, handler);
+   ATF_REQUIRE((fd = open(AFILE, O_CREAT, 0644)) != -1);
+   close(fd);
+   ATF_REQUIRE((fd = open(RENDEZVOUS, O_CREAT, 0644)) != -1);
+   close(fd);
+   done = 0;
+   for (i = 0; i  PARALLEL; i++)
+   if (fork() == 0)
+   openfiles2(n / PARALLEL);
+   while (done != PARALLEL)
+   usleep(1000);
+   unlink(RENDEZVOUS);
+   usleep(4);
+}
+
+ATF_TC_WITH_CLEANUP(kern_maxfiles__increase);
+ATF_TC_HEAD(kern_maxfiles__increase, tc)
+{
+   atf_tc_set_md_var(tc, require.user, root);
+   atf_tc_set_md_var(tc, require.config, allow_sysctl_side_effects);
+   atf_tc_set_md_var(tc, descr,
+   Check kern.maxfiles expansion);
+}
+
+ATF_TC_BODY(kern_maxfiles__increase, tc)
+{
+   size_t oldlen;
+   int maxfiles, oldmaxfiles, current;
+   char buf[80];
+
+   oldlen = sizeof(maxfiles);
+   if (sysctlbyname(kern.maxfiles, maxfiles, oldlen, NULL, 0) == -1)
+   atf_tc_fail(getsysctlbyname(%s): %s, kern.maxfiles,
+   strerror(errno));
+   if (sysctlbyname(kern.openfiles, current, oldlen, NULL, 0) == -1)
+   atf_tc_fail(getsysctlbyname(%s): %s, kern.openfiles,
+   strerror(errno));
+
+   oldmaxfiles = maxfiles;
+
+   /* Store old kern.maxfiles in a symlink for cleanup */
+   snprintf(buf, sizeof(buf), %d, oldmaxfiles);
+   if (symlink(buf, VALUE) == 1)
+   atf_tc_fail(symlink(%s, %s): %s, buf, VALUE,
+   strerror(errno));
+
+   maxfiles += EXPANDBY;
+   if (sysctlbyname(kern.maxfiles, NULL, 0, maxfiles, oldlen) == -1)
+   atf_tc_fail(getsysctlbyname(%s): %s, kern.maxfiles,
+   strerror(errno));
+
+   openfiles(oldmaxfiles - current + 1);
+   (void)unlink(VALUE);
+}
+
+ATF_TC_CLEANUP(kern_maxfiles__increase, tc)
+{
+   size_t oldlen;
+   int n, oldmaxfiles;
+   char buf[80];
+
+   if ((n = readlink(VALUE, buf, sizeof(buf)))  0) {
+   buf[n] = '\0';
+   if (sscanf(buf, %d, oldmaxfiles) == 1) {
+   oldlen = sizeof(oldmaxfiles);
+   (void) sysctlbyname(kern.maxfiles, NULL, 0,
+   oldmaxfiles, oldlen);
+   }
+   }
+}
+
 ATF_TP_ADD_TCS(tp)
 {
 
-ATF_TP_ADD_TC(tp, dup2__simple);
-ATF_TP_ADD_TC(tp, dup2__ebadf_when_2nd_arg_out_of_range);
+   ATF_TP_ADD_TC(tp, dup2__simple);
+   

svn commit: r263345 - head/etc/mtree

2014-03-19 Thread Julio Merino
Author: jmmv
Date: Wed Mar 19 12:06:51 2014
New Revision: 263345
URL: http://svnweb.freebsd.org/changeset/base/263345

Log:
  Expand tabs that sneaked in into spaces.
  
  Problem introduced by r263227.  Spotted by Alan Somers.

Modified:
  head/etc/mtree/BSD.tests.dist

Modified: head/etc/mtree/BSD.tests.dist
==
--- head/etc/mtree/BSD.tests.dist   Wed Mar 19 10:42:10 2014
(r263344)
+++ head/etc/mtree/BSD.tests.dist   Wed Mar 19 12:06:51 2014
(r263345)
@@ -116,8 +116,8 @@
 printf
 ..
 sed
-   regress.multitest.out
-   ..
+regress.multitest.out
+..
 ..
 tr
 ..
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


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

2014-03-19 Thread Julio Merino
Author: jmmv
Date: Wed Mar 19 12:29:20 2014
New Revision: 263346
URL: http://svnweb.freebsd.org/changeset/base/263346

Log:
  Migrate tools/regression/usr.bin/make/ to the new tests layout.
  
  Note that these tests are for fmake, not bmake, and thus they are not
  installed nor run when bmake is selected (the default).  Yes, I have
  wasted a *ton* of time on moving tests for no real reason other than
  ensuring they are not left behind.
  
  But maybe, just maybe, it was not work in vain: the majority of these
  tests also work with bmake and the few that don't may point at broken
  stuff.  For example, the tests for the archive feature do not work
  with bmake, but bmake's manpage and source tree seem to imply that they
  should.  So... to be investigated later; need to poke sjg@.

Added:
  head/usr.bin/make/tests/
 - copied from r263227, head/tools/regression/usr.bin/make/
  head/usr.bin/make/tests/archives/fmt_44bsd/Makefile.test
 - copied unchanged from r263227, 
head/tools/regression/usr.bin/make/archives/fmt_44bsd/Makefile
  head/usr.bin/make/tests/archives/fmt_44bsd/legacy_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/make/archives/fmt_44bsd/test.t
  head/usr.bin/make/tests/archives/fmt_44bsd_mod/Makefile.test
 - copied unchanged from r263227, 
head/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/Makefile
  head/usr.bin/make/tests/archives/fmt_44bsd_mod/legacy_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/test.t
  head/usr.bin/make/tests/archives/fmt_oldbsd/Makefile.test
 - copied unchanged from r263227, 
head/tools/regression/usr.bin/make/archives/fmt_oldbsd/Makefile
  head/usr.bin/make/tests/archives/fmt_oldbsd/legacy_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/make/archives/fmt_oldbsd/test.t
  head/usr.bin/make/tests/basic/t0/legacy_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/make/basic/t0/test.t
  head/usr.bin/make/tests/basic/t1/Makefile.test
 - copied unchanged from r263227, 
head/tools/regression/usr.bin/make/basic/t1/Makefile
  head/usr.bin/make/tests/basic/t1/legacy_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/make/basic/t1/test.t
  head/usr.bin/make/tests/basic/t2/Makefile.test
 - copied unchanged from r263227, 
head/tools/regression/usr.bin/make/basic/t2/Makefile
  head/usr.bin/make/tests/basic/t2/legacy_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/make/basic/t2/test.t
  head/usr.bin/make/tests/basic/t3/legacy_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/make/basic/t3/test.t
  head/usr.bin/make/tests/execution/ellipsis/Makefile.test
 - copied unchanged from r263227, 
head/tools/regression/usr.bin/make/execution/ellipsis/Makefile
  head/usr.bin/make/tests/execution/ellipsis/legacy_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/make/execution/ellipsis/test.t
  head/usr.bin/make/tests/execution/empty/Makefile.test
 - copied unchanged from r263227, 
head/tools/regression/usr.bin/make/execution/empty/Makefile
  head/usr.bin/make/tests/execution/empty/legacy_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/make/execution/empty/test.t
  head/usr.bin/make/tests/execution/joberr/Makefile.test
 - copied unchanged from r263227, 
head/tools/regression/usr.bin/make/execution/joberr/Makefile
  head/usr.bin/make/tests/execution/joberr/legacy_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/make/execution/joberr/test.t
  head/usr.bin/make/tests/execution/plus/Makefile.test
 - copied unchanged from r263227, 
head/tools/regression/usr.bin/make/execution/plus/Makefile
  head/usr.bin/make/tests/execution/plus/legacy_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/make/execution/plus/test.t
  head/usr.bin/make/tests/shell/builtin/Makefile.test
 - copied unchanged from r263227, 
head/tools/regression/usr.bin/make/shell/builtin/Makefile
  head/usr.bin/make/tests/shell/builtin/legacy_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/make/shell/builtin/test.t
  head/usr.bin/make/tests/shell/meta/Makefile.test
 - copied unchanged from r263227, 
head/tools/regression/usr.bin/make/shell/meta/Makefile
  head/usr.bin/make/tests/shell/meta/legacy_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/make/shell/meta/test.t
  head/usr.bin/make/tests/shell/path/Makefile.test
 - copied unchanged from r263227, 
head/tools/regression/usr.bin/make/shell/path/Makefile
  head/usr.bin/make/tests/shell/path/legacy_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/make/shell/path/test.t
  head/usr.bin/make/tests/shell/path_select/Makefile.test
 - copied unchanged from r263227, 
head/tools/regression/usr.bin/make/shell/path_select/Makefile
  

svn commit: r263348 - in head/usr.bin/make/tests: . archives archives/fmt_44bsd archives/fmt_44bsd_mod archives/fmt_oldbsd basic basic/t0 basic/t1 basic/t2 basic/t3 execution execution/ellipsis exe...

2014-03-19 Thread Julio Merino
Author: jmmv
Date: Wed Mar 19 12:32:50 2014
New Revision: 263348
URL: http://svnweb.freebsd.org/changeset/base/263348

Log:
  Add Makefiles missed in r263346.
  
  Grrr, I wish svn clearly displayed files not yet added when about to commit.

Added:
  head/usr.bin/make/tests/Makefile   (contents, props changed)
  head/usr.bin/make/tests/archives/Makefile   (contents, props changed)
  head/usr.bin/make/tests/archives/fmt_44bsd/Makefile   (contents, props 
changed)
  head/usr.bin/make/tests/archives/fmt_44bsd_mod/Makefile   (contents, props 
changed)
  head/usr.bin/make/tests/archives/fmt_oldbsd/Makefile   (contents, props 
changed)
  head/usr.bin/make/tests/basic/Makefile   (contents, props changed)
  head/usr.bin/make/tests/basic/t0/Makefile   (contents, props changed)
  head/usr.bin/make/tests/basic/t1/Makefile   (contents, props changed)
  head/usr.bin/make/tests/basic/t2/Makefile   (contents, props changed)
  head/usr.bin/make/tests/basic/t3/Makefile   (contents, props changed)
  head/usr.bin/make/tests/execution/Makefile   (contents, props changed)
  head/usr.bin/make/tests/execution/ellipsis/Makefile   (contents, props 
changed)
  head/usr.bin/make/tests/execution/empty/Makefile   (contents, props changed)
  head/usr.bin/make/tests/execution/joberr/Makefile   (contents, props changed)
  head/usr.bin/make/tests/execution/plus/Makefile   (contents, props changed)
  head/usr.bin/make/tests/shell/Makefile   (contents, props changed)
  head/usr.bin/make/tests/shell/builtin/Makefile   (contents, props changed)
  head/usr.bin/make/tests/shell/meta/Makefile   (contents, props changed)
  head/usr.bin/make/tests/shell/path/Makefile   (contents, props changed)
  head/usr.bin/make/tests/shell/path_select/Makefile   (contents, props changed)
  head/usr.bin/make/tests/shell/replace/Makefile   (contents, props changed)
  head/usr.bin/make/tests/shell/select/Makefile   (contents, props changed)
  head/usr.bin/make/tests/suffixes/Makefile   (contents, props changed)
  head/usr.bin/make/tests/suffixes/basic/Makefile   (contents, props changed)
  head/usr.bin/make/tests/suffixes/src_wild1/Makefile   (contents, props 
changed)
  head/usr.bin/make/tests/suffixes/src_wild2/Makefile   (contents, props 
changed)
  head/usr.bin/make/tests/syntax/Makefile   (contents, props changed)
  head/usr.bin/make/tests/syntax/directive-t0/Makefile   (contents, props 
changed)
  head/usr.bin/make/tests/syntax/enl/Makefile   (contents, props changed)
  head/usr.bin/make/tests/syntax/funny-targets/Makefile   (contents, props 
changed)
  head/usr.bin/make/tests/syntax/semi/Makefile   (contents, props changed)
  head/usr.bin/make/tests/sysmk/Makefile   (contents, props changed)
  head/usr.bin/make/tests/sysmk/t0/2/1/Makefile   (contents, props changed)
  head/usr.bin/make/tests/sysmk/t0/2/Makefile   (contents, props changed)
  head/usr.bin/make/tests/sysmk/t0/Makefile   (contents, props changed)
  head/usr.bin/make/tests/sysmk/t0/mk/Makefile   (contents, props changed)
  head/usr.bin/make/tests/sysmk/t1/2/1/Makefile   (contents, props changed)
  head/usr.bin/make/tests/sysmk/t1/2/Makefile   (contents, props changed)
  head/usr.bin/make/tests/sysmk/t1/Makefile   (contents, props changed)
  head/usr.bin/make/tests/sysmk/t1/mk/Makefile   (contents, props changed)
  head/usr.bin/make/tests/sysmk/t2/2/1/Makefile   (contents, props changed)
  head/usr.bin/make/tests/sysmk/t2/2/Makefile   (contents, props changed)
  head/usr.bin/make/tests/sysmk/t2/Makefile   (contents, props changed)
  head/usr.bin/make/tests/sysmk/t2/mk/Makefile   (contents, props changed)
  head/usr.bin/make/tests/variables/Makefile   (contents, props changed)
  head/usr.bin/make/tests/variables/modifier_M/Makefile   (contents, props 
changed)
  head/usr.bin/make/tests/variables/modifier_t/Makefile   (contents, props 
changed)
  head/usr.bin/make/tests/variables/opt_V/Makefile   (contents, props changed)
  head/usr.bin/make/tests/variables/t0/Makefile   (contents, props changed)

Added: head/usr.bin/make/tests/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/make/tests/MakefileWed Mar 19 12:32:50 2014
(r263348)
@@ -0,0 +1,18 @@
+# $FreeBSD$
+
+TESTSDIR=  ${TESTSBASE}/usr.bin/make
+
+FILESDIR=  ${TESTSDIR}
+FILES= common.sh
+FILES+=test-new.mk
+
+TESTS_SUBDIRS= archives
+TESTS_SUBDIRS+=basic
+TESTS_SUBDIRS+=execution
+TESTS_SUBDIRS+=shell
+TESTS_SUBDIRS+=suffixes
+TESTS_SUBDIRS+=syntax
+TESTS_SUBDIRS+=sysmk
+TESTS_SUBDIRS+=variables
+
+.include bsd.test.mk

Added: head/usr.bin/make/tests/archives/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/make/tests/archives/Makefile   Wed Mar 19 12:32:50 2014
(r263348)
@@ -0,0 +1,7 @@
+# 

svn commit: r263349 - in head/sys: compat/freebsd32 kern

2014-03-19 Thread Konstantin Belousov
Author: kib
Date: Wed Mar 19 12:35:04 2014
New Revision: 263349
URL: http://svnweb.freebsd.org/changeset/base/263349

Log:
  Make the array pointed to by AT_PAGESIZES auxv properly aligned.
  
  Also, remove the expression which calculated the location of the
  strings for a new image and grown over the time to be
  non-comprehensible.  Instead, calculate the offsets by steps, which
  also makes fixing the alignments much cleaner.
  
  Reported and reviewed by: alc
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/compat/freebsd32/freebsd32_misc.c
  head/sys/kern/kern_exec.c

Modified: head/sys/compat/freebsd32/freebsd32_misc.c
==
--- head/sys/compat/freebsd32/freebsd32_misc.c  Wed Mar 19 12:32:50 2014
(r263348)
+++ head/sys/compat/freebsd32/freebsd32_misc.c  Wed Mar 19 12:35:04 2014
(r263349)
@@ -2822,7 +2822,8 @@ freebsd32_copyout_strings(struct image_p
 {
int argc, envc, i;
u_int32_t *vectp;
-   char *stringp, *destp;
+   char *stringp;
+   uintptr_t destp;
u_int32_t *stack_base;
struct freebsd32_ps_strings *arginfo;
char canary[sizeof(long) * 8];
@@ -2844,35 +2845,34 @@ freebsd32_copyout_strings(struct image_p
szsigcode = *(imgp-proc-p_sysent-sv_szsigcode);
else
szsigcode = 0;
-   destp = (caddr_t)arginfo - szsigcode - SPARE_USRSPACE -
-   roundup(execpath_len, sizeof(char *)) -
-   roundup(sizeof(canary), sizeof(char *)) -
-   roundup(sizeof(pagesizes32), sizeof(char *)) -
-   roundup((ARG_MAX - imgp-args-stringspace), sizeof(char *));
+   destp = (uintptr_t)arginfo;
 
/*
 * install sigcode
 */
-   if (szsigcode != 0)
-   copyout(imgp-proc-p_sysent-sv_sigcode,
-   ((caddr_t)arginfo - szsigcode), szsigcode);
+   if (szsigcode != 0) {
+   destp -= szsigcode;
+   destp = rounddown2(destp, sizeof(uint32_t));
+   copyout(imgp-proc-p_sysent-sv_sigcode, (void *)destp,
+   szsigcode);
+   }
 
/*
 * Copy the image path for the rtld.
 */
if (execpath_len != 0) {
-   imgp-execpathp = (uintptr_t)arginfo - szsigcode - execpath_len;
-   copyout(imgp-execpath, (void *)imgp-execpathp,
-   execpath_len);
+   destp -= execpath_len;
+   imgp-execpathp = destp;
+   copyout(imgp-execpath, (void *)destp, execpath_len);
}
 
/*
 * Prepare the canary for SSP.
 */
arc4rand(canary, sizeof(canary), 0);
-   imgp-canary = (uintptr_t)arginfo - szsigcode - execpath_len -
-   sizeof(canary);
-   copyout(canary, (void *)imgp-canary, sizeof(canary));
+   destp -= sizeof(canary);
+   imgp-canary = destp;
+   copyout(canary, (void *)destp, sizeof(canary));
imgp-canarylen = sizeof(canary);
 
/*
@@ -2880,11 +2880,15 @@ freebsd32_copyout_strings(struct image_p
 */
for (i = 0; i  MAXPAGESIZES; i++)
pagesizes32[i] = (uint32_t)pagesizes[i];
-   imgp-pagesizes = (uintptr_t)arginfo - szsigcode - execpath_len -
-   roundup(sizeof(canary), sizeof(char *)) - sizeof(pagesizes32);
-   copyout(pagesizes32, (void *)imgp-pagesizes, sizeof(pagesizes32));
+   destp -= sizeof(pagesizes32);
+   destp = rounddown2(destp, sizeof(uint32_t));
+   imgp-pagesizes = destp;
+   copyout(pagesizes32, (void *)destp, sizeof(pagesizes32));
imgp-pagesizeslen = sizeof(pagesizes32);
 
+   destp -= ARG_MAX - imgp-args-stringspace;
+   destp = rounddown2(destp, sizeof(uint32_t));
+
/*
 * If we have a valid auxargs ptr, prepare some room
 * on the stack.
@@ -2904,13 +2908,14 @@ freebsd32_copyout_strings(struct image_p
vectp = (u_int32_t *) (destp - (imgp-args-argc +
imgp-args-envc + 2 + imgp-auxarg_size + execpath_len) *
sizeof(u_int32_t));
-   } else
+   } else {
/*
 * The '+ 2' is for the null pointers at the end of each of
 * the arg and env vector sets
 */
-   vectp = (u_int32_t *)
-   (destp - (imgp-args-argc + imgp-args-envc + 2) * 
sizeof(u_int32_t));
+   vectp = (u_int32_t *)(destp - (imgp-args-argc +
+   imgp-args-envc + 2) * sizeof(u_int32_t));
+   }
 
/*
 * vectp also becomes our initial stack base
@@ -2923,7 +2928,7 @@ freebsd32_copyout_strings(struct image_p
/*
 * Copy out strings - arguments and environment.
 */
-   copyout(stringp, destp, ARG_MAX - imgp-args-stringspace);
+   copyout(stringp, (void *)destp, ARG_MAX - imgp-args-stringspace);
 
/*
   

svn commit: r263350 - head/sys/kern

2014-03-19 Thread Attilio Rao
Author: attilio
Date: Wed Mar 19 12:45:40 2014
New Revision: 263350
URL: http://svnweb.freebsd.org/changeset/base/263350

Log:
  Fix comments.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/kern/kern_umtx.c

Modified: head/sys/kern/kern_umtx.c
==
--- head/sys/kern/kern_umtx.c   Wed Mar 19 12:35:04 2014(r263349)
+++ head/sys/kern/kern_umtx.c   Wed Mar 19 12:45:40 2014(r263350)
@@ -3115,12 +3115,12 @@ static _umtx_op_func op_table[] = {
__umtx_op_rw_unlock,/* UMTX_OP_RW_UNLOCK */
__umtx_op_wait_uint_private,/* UMTX_OP_WAIT_UINT_PRIVATE */
__umtx_op_wake_private, /* UMTX_OP_WAKE_PRIVATE */
-   __umtx_op_wait_umutex,  /* UMTX_OP_UMUTEX_WAIT */
-   __umtx_op_wake_umutex,  /* UMTX_OP_UMUTEX_WAKE */
+   __umtx_op_wait_umutex,  /* UMTX_OP_MUTEX_WAIT */
+   __umtx_op_wake_umutex,  /* UMTX_OP_MUTEX_WAKE */
__umtx_op_sem_wait, /* UMTX_OP_SEM_WAIT */
__umtx_op_sem_wake, /* UMTX_OP_SEM_WAKE */
__umtx_op_nwake_private,/* UMTX_OP_NWAKE_PRIVATE */
-   __umtx_op_wake2_umutex  /* UMTX_OP_UMUTEX_WAKE2 */
+   __umtx_op_wake2_umutex  /* UMTX_OP_MUTEX_WAKE2 */
 };
 
 int
@@ -3381,12 +3381,12 @@ static _umtx_op_func op_table_compat32[]
__umtx_op_rw_unlock,/* UMTX_OP_RW_UNLOCK */
__umtx_op_wait_uint_private_compat32,   /* UMTX_OP_WAIT_UINT_PRIVATE */
__umtx_op_wake_private, /* UMTX_OP_WAKE_PRIVATE */
-   __umtx_op_wait_umutex_compat32, /* UMTX_OP_UMUTEX_WAIT */
-   __umtx_op_wake_umutex,  /* UMTX_OP_UMUTEX_WAKE */
+   __umtx_op_wait_umutex_compat32, /* UMTX_OP_MUTEX_WAIT */
+   __umtx_op_wake_umutex,  /* UMTX_OP_MUTEX_WAKE */
__umtx_op_sem_wait_compat32,/* UMTX_OP_SEM_WAIT */
__umtx_op_sem_wake, /* UMTX_OP_SEM_WAKE */
__umtx_op_nwake_private32,  /* UMTX_OP_NWAKE_PRIVATE */
-   __umtx_op_wake2_umutex  /* UMTX_OP_UMUTEX_WAKE2 */
+   __umtx_op_wake2_umutex  /* UMTX_OP_MUTEX_WAKE2 */
 };
 
 int
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r263351 - in head: bin/pkill bin/pkill/tests etc/mtree tools/regression/usr.bin/pkill

2014-03-19 Thread Julio Merino
Author: jmmv
Date: Wed Mar 19 12:46:04 2014
New Revision: 263351
URL: http://svnweb.freebsd.org/changeset/base/263351

Log:
  Migrate tools/regression/usr.bin/pkill to the new tests layout.
  
  Interestingly, the pkill tool lives in bin, not usr.bin.  Haven't bothered
  to check if this is because the tool moved or because the tests were
  originally added in the wrong place.

Added:
  head/bin/pkill/tests/
 - copied from r263227, head/tools/regression/usr.bin/pkill/
  head/bin/pkill/tests/Makefile   (contents, props changed)
  head/bin/pkill/tests/pgrep-F_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/pkill/pgrep-F.t
  head/bin/pkill/tests/pgrep-LF_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/pkill/pgrep-LF.t
  head/bin/pkill/tests/pgrep-P_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/pkill/pgrep-P.t
  head/bin/pkill/tests/pgrep-U_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/pkill/pgrep-U.t
  head/bin/pkill/tests/pgrep-_g_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/pkill/pgrep-_g.t
  head/bin/pkill/tests/pgrep-_s_test.sh
 - copied unchanged from r263227, 
head/tools/regression/usr.bin/pkill/pgrep-_s.t
  head/bin/pkill/tests/pgrep-g_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/pkill/pgrep-g.t
  head/bin/pkill/tests/pgrep-i_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/pkill/pgrep-i.t
  head/bin/pkill/tests/pgrep-j_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/pkill/pgrep-j.t
  head/bin/pkill/tests/pgrep-l_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/pkill/pgrep-l.t
  head/bin/pkill/tests/pgrep-n_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/pkill/pgrep-n.t
  head/bin/pkill/tests/pgrep-o_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/pkill/pgrep-o.t
  head/bin/pkill/tests/pgrep-q_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/pkill/pgrep-q.t
  head/bin/pkill/tests/pgrep-s_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/pkill/pgrep-s.t
  head/bin/pkill/tests/pgrep-t_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/pkill/pgrep-t.t
  head/bin/pkill/tests/pgrep-v_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/pkill/pgrep-v.t
  head/bin/pkill/tests/pgrep-x_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/pkill/pgrep-x.t
  head/bin/pkill/tests/pkill-F_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/pkill/pkill-F.t
  head/bin/pkill/tests/pkill-LF_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/pkill/pkill-LF.t
  head/bin/pkill/tests/pkill-P_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/pkill/pkill-P.t
  head/bin/pkill/tests/pkill-U_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/pkill/pkill-U.t
  head/bin/pkill/tests/pkill-_g_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/pkill/pkill-_g.t
  head/bin/pkill/tests/pkill-g_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/pkill/pkill-g.t
  head/bin/pkill/tests/pkill-i_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/pkill/pkill-i.t
  head/bin/pkill/tests/pkill-j_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/pkill/pkill-j.t
  head/bin/pkill/tests/pkill-s_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/pkill/pkill-s.t
  head/bin/pkill/tests/pkill-t_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/pkill/pkill-t.t
  head/bin/pkill/tests/pkill-x_test.sh
 - copied, changed from r263227, 
head/tools/regression/usr.bin/pkill/pkill-x.t
Deleted:
  head/bin/pkill/tests/pgrep-F.t
  head/bin/pkill/tests/pgrep-LF.t
  head/bin/pkill/tests/pgrep-P.t
  head/bin/pkill/tests/pgrep-U.t
  head/bin/pkill/tests/pgrep-_g.t
  head/bin/pkill/tests/pgrep-_s.t
  head/bin/pkill/tests/pgrep-g.t
  head/bin/pkill/tests/pgrep-i.t
  head/bin/pkill/tests/pgrep-j.t
  head/bin/pkill/tests/pgrep-l.t
  head/bin/pkill/tests/pgrep-n.t
  head/bin/pkill/tests/pgrep-o.t
  head/bin/pkill/tests/pgrep-q.t
  head/bin/pkill/tests/pgrep-s.t
  head/bin/pkill/tests/pgrep-t.t
  head/bin/pkill/tests/pgrep-v.t
  head/bin/pkill/tests/pgrep-x.t
  head/bin/pkill/tests/pkill-F.t
  head/bin/pkill/tests/pkill-LF.t
  head/bin/pkill/tests/pkill-P.t
  head/bin/pkill/tests/pkill-U.t
  head/bin/pkill/tests/pkill-_g.t
  head/bin/pkill/tests/pkill-g.t
  head/bin/pkill/tests/pkill-i.t
  head/bin/pkill/tests/pkill-j.t
  head/bin/pkill/tests/pkill-s.t
  head/bin/pkill/tests/pkill-t.t
  head/bin/pkill/tests/pkill-x.t
  head/tools/regression/usr.bin/pkill/
Modified:
  

svn commit: r263352 - head/tools/regression/priv

2014-03-19 Thread Julio Merino
Author: jmmv
Date: Wed Mar 19 12:51:40 2014
New Revision: 263352
URL: http://svnweb.freebsd.org/changeset/base/263352

Log:
  Make the priv test program exit with non-zero if any failures are detected.
  
  And, mind you, this already returns a failure :-/

Modified:
  head/tools/regression/priv/main.c

Modified: head/tools/regression/priv/main.c
==
--- head/tools/regression/priv/main.c   Wed Mar 19 12:46:04 2014
(r263351)
+++ head/tools/regression/priv/main.c   Wed Mar 19 12:51:40 2014
(r263352)
@@ -53,6 +53,16 @@
 #include main.h
 
 /*
+ * If true, some test or preparatory step failed along the execution of this
+ * program.
+ *
+ * Intuitively, we would define a counter instead of a boolean.  However,
+ * we fork to run the subtests and keeping proper track of the number of
+ * failed tests would be tricky and not provide any real value.
+ */
+static int something_failed = 0;
+
+/*
  * Registration table of privilege tests.  Each test registers a name, a test
  * function, and a cleanup function to run after the test has completed,
  * regardless of success/failure.
@@ -358,13 +368,18 @@ expect(const char *test, int error, int 
 {
 
if (error == 0) {
-   if (expected_error != 0)
+   if (expected_error != 0) {
+   something_failed = 1;
warnx(%s: returned 0, test);
+   }
} else {
-   if (expected_error == 0)
+   if (expected_error == 0) {
+   something_failed = 1;
warn(%s: returned (%d, %d), test, error, errno);
-   else if (expected_errno != errno)
+   } else if (expected_errno != errno) {
+   something_failed = 1;
warn(%s: returned (%d, %d), test, error, errno);
+   }
}
 }
 
@@ -488,14 +503,24 @@ run(struct test *test, int asroot, int i
run_child(test, asroot, injail);
fflush(stdout);
fflush(stderr);
-   exit(0);
+   exit(something_failed ? EXIT_FAILURE : EXIT_SUCCESS);
} else {
while (1) {
-   pid = waitpid(childpid, NULL, 0);
-   if (pid == -1)
+   int status;
+   pid = waitpid(childpid, status, 0);
+   if (pid == -1) {
+   something_failed = 1;
warn(test: waitpid %s, test-t_name);
-   if (pid == childpid)
+   }
+   if (pid == childpid) {
+   if (WIFEXITED(status) 
+   WEXITSTATUS(status) == EXIT_SUCCESS) {
+   /* All good in the subprocess! */
+   } else {
+   something_failed = 1;
+   }
break;
+   }
}
}
fflush(stdout);
@@ -530,5 +555,5 @@ main(int argc, char *argv[])
run(tests[i], 1, 0);
run(tests[i], 1, 1);
}
-   return (0);
+   return (something_failed ? EXIT_FAILURE : EXIT_SUCCESS);
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r263353 - head/tools/regression/priv

2014-03-19 Thread Julio Merino
Author: jmmv
Date: Wed Mar 19 12:52:49 2014
New Revision: 263353
URL: http://svnweb.freebsd.org/changeset/base/263353

Log:
  errx prepends the program name to the message; don't do it by hand.

Modified:
  head/tools/regression/priv/main.c

Modified: head/tools/regression/priv/main.c
==
--- head/tools/regression/priv/main.c   Wed Mar 19 12:51:40 2014
(r263352)
+++ head/tools/regression/priv/main.c   Wed Mar 19 12:52:49 2014
(r263353)
@@ -543,7 +543,7 @@ main(int argc, char *argv[])
 * force the use of privilege, and will likely need checking.
 */
if (getuid() != 0  geteuid() != 0)
-   errx(-1, priv: must be run as root);
+   errx(-1, must be run as root);
 
/*
 * Run each test four times, varying whether the process is running
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r263356 - head/usr.sbin/ctld

2014-03-19 Thread Edward Tomasz Napierala
Author: trasz
Date: Wed Mar 19 13:00:44 2014
New Revision: 263356
URL: http://svnweb.freebsd.org/changeset/base/263356

Log:
  Make the error message more clear.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.sbin/ctld/login.c

Modified: head/usr.sbin/ctld/login.c
==
--- head/usr.sbin/ctld/login.c  Wed Mar 19 12:57:13 2014(r263355)
+++ head/usr.sbin/ctld/login.c  Wed Mar 19 13:00:44 2014(r263356)
@@ -1032,7 +1032,7 @@ login(struct connection *conn)
 
if (ag-ag_type == AG_TYPE_DENY) {
login_send_error(request, 0x02, 0x01);
-   log_errx(1, auth-group type is \deny\);
+   log_errx(1, auth-type is \deny\);
}
 
if (ag-ag_type == AG_TYPE_UNKNOWN) {
@@ -1040,7 +1040,7 @@ login(struct connection *conn)
 * This can happen with empty auth-group.
 */
login_send_error(request, 0x02, 0x01);
-   log_errx(1, auth-group type not set, denying access);
+   log_errx(1, auth-type not set, denying access);
}
 
log_debugx(CHAP authentication required);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r263362 - head/sys/net

2014-03-19 Thread Julio Merino
Author: jmmv
Date: Wed Mar 19 13:10:25 2014
New Revision: 263362
URL: http://svnweb.freebsd.org/changeset/base/263362

Log:
  Include strings.h so that bpf_filter.c can be built in userland.
  
  This is to bring in a definition for bzero(3), which in turn allows the
  tests in tools/regression/bpf/ to build again.

Modified:
  head/sys/net/bpf_filter.c

Modified: head/sys/net/bpf_filter.c
==
--- head/sys/net/bpf_filter.c   Wed Mar 19 13:09:38 2014(r263361)
+++ head/sys/net/bpf_filter.c   Wed Mar 19 13:10:25 2014(r263362)
@@ -39,6 +39,9 @@ __FBSDID($FreeBSD$);
 
 #include sys/param.h
 
+#if !defined(_KERNEL)
+#include strings.h
+#endif
 #if !defined(_KERNEL) || defined(sun)
 #include netinet/in.h
 #endif
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r263351 - in head: bin/pkill bin/pkill/tests etc/mtree tools/regression/usr.bin/pkill

2014-03-19 Thread Garance A Drosehn

On 19 Mar 2014, at 8:46, Julio Merino wrote:

 Author: jmmv
 Date: Wed Mar 19 12:46:04 2014
 New Revision: 263351
 URL: http://svnweb.freebsd.org/changeset/base/263351

 Log:
 Migrate tools/regression/usr.bin/pkill to the new tests layout.

 Interestingly, the pkill tool lives in bin, not usr.bin.  Haven't bothered
 to check if this is because the tool moved or because the tests were
 originally added in the wrong place.

FWIW:

pkill was originally in usr.bin, because it was in usr.bin in other
BSD projects (particularly NetBSD, where it came from).  I thought some
kind of marker had been left behind in usr.bin after it was moved, just
because people from other projects might look for it there.  But I guess
that did not happen.

-- 
Garance Alistair Drosehn= dro...@rpi.edu
Senior Systems Programmer   or   g...@freebsd.org
Rensselaer Polytechnic Institute; Troy, NY;  USA
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r263214 - in head/sys: compat/freebsd32 kern sys

2014-03-19 Thread Alan Cox
On 03/15/2014 20:26, John-Mark Gurney wrote:
 Adrian Chadd wrote this message on Sat, Mar 15, 2014 at 18:17 -0700:
 How far along does it get?
 It rarely gets to multiuser, and even if it does, it panics very
 shortly afterward:
 panic: vm_page_alloc: page 0xc0805db0 is wired

 I did finally get around to dumping the vm_page struct for it (the
 CTF crazyness) and I did send it to alc and kib, but neither one has
 replied...

 here is a dump in case someone else has some vm_page clue:
 {'act_count': '\x00',
  'aflags': '\x00',
  'busy_lock': 1,
  'dirty': '\xff',
  'flags': 0,
  'hold_count': 0,
  'listq': {'tqe_next': 0xc0805e00, 'tqe_prev': 0xc06d18a0},
  'md': {'pv_kva': 3235856384,
 'pv_list': {'tqh_first': 0x0, 'tqh_last': 0xc0805de0},
 'pv_memattr': '\x00',
 'pvh_attrs': 0},
  'object': 0xc06d1878,
  'oflags': '\x04',
  'order': '\t',
  'phys_addr': 17776640,
  'pindex': 3572,
  'plinks': {'memguard': {'p': 0, 'v': 3228376932},
 'q': {'tqe_next': 0x0, 'tqe_prev': 0xc06d1f64},
 's': {'pv': 0xc06d1f64, 'ss': {'sle_next': 0x0}}},
  'pool': '\x00',
  'queue': '\xff',
  'segind': '\x01',
  'valid': '\xff',
  'wire_count': 1}

 and as you can see, wire_count is not 0...  but looks resonable...

There are several things wrong with this page.

Two lines later, this assertion would also fail:

KASSERT(m-dirty == 0, (vm_page_alloc: page %p is dirty, m));

because a page in the cache/free lists should never be dirty.

The page's flags field doesn't include PG_CACHED.  So, the object field
should be NULL and the valid field should be 0, but they are not.

All of these fields are (explicitly) cleared when a page is freed (cf.
vm_page_free_toq()).

Can you determine if the value of the object field matches the address
of either kernel_object or kmem_object?  The oflags field containing
VPO_UNMANAGED makes that likely.

In a nutshell, this looks like the same page is simultaneously in use by
one part of the kernel and free in another part.  I doubt that it's a
simple case of use after free.  In that case, the dirty, object, and
valid fields would be zero, and the crash would be in a different part
of the kernel.

 So, I'm blocked until someone w/ clue tells me what more I need to do
 to debug this...


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


svn commit: r263371 - head

2014-03-19 Thread Warner Losh
Author: imp
Date: Wed Mar 19 17:34:37 2014
New Revision: 263371
URL: http://svnweb.freebsd.org/changeset/base/263371

Log:
  Add my humble request for reviews before nanobsd changes happen.

Modified:
  head/MAINTAINERS

Modified: head/MAINTAINERS
==
--- head/MAINTAINERSWed Mar 19 13:37:51 2014(r263370)
+++ head/MAINTAINERSWed Mar 19 17:34:37 2014(r263371)
@@ -131,3 +131,4 @@ nvd(4)  jimharris   Pre-commit review requ
 nvmecontrol(8) jimharris   Pre-commit review requested.
 release/release.sh gjb Pre-commit review and regression tests
requested.
+nanobsdimp Pre-commit review requested for coordination.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r263372 - head/sys/xen

2014-03-19 Thread Warner Losh
Author: imp
Date: Wed Mar 19 17:53:09 2014
New Revision: 263372
URL: http://svnweb.freebsd.org/changeset/base/263372

Log:
  Remove redunant declaration. gcc complains while clang doesn't.

Modified:
  head/sys/xen/xen-os.h

Modified: head/sys/xen/xen-os.h
==
--- head/sys/xen/xen-os.h   Wed Mar 19 17:34:37 2014(r263371)
+++ head/sys/xen/xen-os.h   Wed Mar 19 17:53:09 2014(r263372)
@@ -54,7 +54,6 @@ extern shared_info_t *HYPERVISOR_shared_
 extern start_info_t *HYPERVISOR_start_info;
 
 /* XXX: we need to get rid of this and use HYPERVISOR_start_info directly */
-extern struct xenstore_domain_interface *xen_store;
 extern char *console_page;
 
 enum xen_domain_type {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r263318 - in head: sys/compat/freebsd32 sys/kern sys/sys usr.bin/truss

2014-03-19 Thread Jilles Tjoelker
On Tue, Mar 18, 2014 at 09:32:03PM +, Attilio Rao wrote:
 Author: attilio
 Date: Tue Mar 18 21:32:03 2014
 New Revision: 263318
 URL: http://svnweb.freebsd.org/changeset/base/263318

 Log:
   Remove dead code from umtx support:
   - Retire long time unused (basically always unused) sys__umtx_lock()
 and sys__umtx_unlock() syscalls
   - struct umtx and their supporting definitions
   - UMUTEX_ERROR_CHECK flag
   - Retire UMTX_OP_LOCK/UMTX_OP_UNLOCK from _umtx_op() syscall

   __FreeBSD_version is not bumped yet because it is expected that further
   breakages to the umtx interface will follow up in the next days.
   However there will be a final bump when necessary.

   Sponsored by:   EMC / Isilon storage division
   Reviewed by:jhb

 [snip]
 Modified: head/sys/sys/umtx.h
 ==
 --- head/sys/sys/umtx.h   Tue Mar 18 20:14:13 2014(r263317)
 +++ head/sys/sys/umtx.h   Tue Mar 18 21:32:03 2014(r263318)
 [snip]
 -static __inline int
 -umtx_wait(u_long *p, long val, const struct timespec *timeout)
 -{
 - if (_umtx_op(p, UMTX_OP_WAIT, val, 0,
 - __DECONST(void *, timeout)) == -1)
 - return (errno);
 - return (0);
 -}
 -
 -/* Wake threads waiting on a user address. */
 -static __inline int
 -umtx_wake(u_long *p, int nr_wakeup)
 -{
 - if (_umtx_op(p, UMTX_OP_WAKE, nr_wakeup, 0, 0) == -1)
 - return (errno);
 - return (0);
 -}
 -

These two do not use struct umtx, are not obsolete and are used by some
ports, such as lang/sbcl with certain options. They are similar to the
Linux futex system call. The relatively recent libxshmfence uses the
underlying umtx_op directly, mainly because there is no static inline
function for UMTX_OP_WAIT_UINT.

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


svn commit: r263373 - in head/share: examples/etc mk

2014-03-19 Thread Ian Lepore
Author: ian
Date: Wed Mar 19 18:54:53 2014
New Revision: 263373
URL: http://svnweb.freebsd.org/changeset/base/263373

Log:
  Add a way to apply CFLAGS only when building the given architecture.  This
  is useful primarily on a system used for cross-building, when you have a
  set of flags to apply to the TARGET_ARCH being cross-built but don't want
  those settings applied to building the cross-tools or other components that
  run on the build host machine.

Modified:
  head/share/examples/etc/make.conf
  head/share/mk/bsd.cpu.mk

Modified: head/share/examples/etc/make.conf
==
--- head/share/examples/etc/make.conf   Wed Mar 19 17:53:09 2014
(r263372)
+++ head/share/examples/etc/make.conf   Wed Mar 19 18:54:53 2014
(r263373)
@@ -60,6 +60,12 @@
 # nonstandard optimization settings
 # before submitting bug reports without patches to the developers.
 #
+# CFLAGS.arch provides a mechanism for applying CFLAGS only when building 
+# the given architecture.  This is useful primarily on a system used for 
+# cross-building, when you have a set of flags to apply to the TARGET_ARCH 
+# being cross-built but don't want those settings applied to building the 
+# cross-tools or other components that run on the build host machine.  
+#
 # CXXFLAGS controls the compiler settings used when compiling C++ code.
 # Note that CXXFLAGS is initially set to the value of CFLAGS.  If you wish
 # to add to CXXFLAGS value, += must be used rather than =.  Using =
@@ -71,6 +77,7 @@
 #
 # CFLAGS+= -msse3
 # CXXFLAGS+=   -msse3
+# CFLAGS.armv6+= -mfloat-abi=softfp
 #
 # MAKE_SHELL controls the shell used internally by make(1) to process the
 # command scripts in makefiles.  Three shells are supported, sh, ksh, and

Modified: head/share/mk/bsd.cpu.mk
==
--- head/share/mk/bsd.cpu.mkWed Mar 19 17:53:09 2014(r263372)
+++ head/share/mk/bsd.cpu.mkWed Mar 19 18:54:53 2014(r263373)
@@ -260,3 +260,7 @@ CFLAGS += -G0
 .if !defined(NO_CPU_CFLAGS)
 CFLAGS += ${_CPUCFLAGS}
 .endif
+
+# Add in any architecture-specific CFLAGS.  
+# These come from make.conf or the command line or the environment.
+CFLAGS += ${CFLAGS.${MACHINE_ARCH}}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r263321 - head/sys/dev/vt

2014-03-19 Thread John Baldwin
On Tuesday, March 18, 2014 6:22:48 pm Aleksandr Rybalko wrote:
 Author: ray
 Date: Tue Mar 18 22:22:47 2014
 New Revision: 263321
 URL: http://svnweb.freebsd.org/changeset/base/263321
 
 Log:
   Switch kern.vt.suspendswitch to 0 by default (disabled).
   kern.vt.suspendswitch - sysctl/tunable which enable switch to VT0 before 
 going
   to suspend and switch back after resume.
   
   MFC after:  7 days

I think it is fine to change the default, but I'm not certain that this fixes
the panics on resume.  So far no one has reported back that this did fix them
after I suggested it.  It would be good to fix the panics as well if possible.
The last time I looked at it in detail, it seemed like the callout for only
ttyv0 had been zero'd.  Other ttyv timers used in switching still had the 
correct
contents.

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


Re: svn commit: r263318 - in head: sys/compat/freebsd32 sys/kern sys/sys usr.bin/truss

2014-03-19 Thread Attilio Rao
On Wed, Mar 19, 2014 at 7:10 PM, Jilles Tjoelker jil...@stack.nl wrote:
 On Tue, Mar 18, 2014 at 09:32:03PM +, Attilio Rao wrote:
 Author: attilio
 Date: Tue Mar 18 21:32:03 2014
 New Revision: 263318
 URL: http://svnweb.freebsd.org/changeset/base/263318

 Log:
   Remove dead code from umtx support:
   - Retire long time unused (basically always unused) sys__umtx_lock()
 and sys__umtx_unlock() syscalls
   - struct umtx and their supporting definitions
   - UMUTEX_ERROR_CHECK flag
   - Retire UMTX_OP_LOCK/UMTX_OP_UNLOCK from _umtx_op() syscall

   __FreeBSD_version is not bumped yet because it is expected that further
   breakages to the umtx interface will follow up in the next days.
   However there will be a final bump when necessary.

   Sponsored by:   EMC / Isilon storage division
   Reviewed by:jhb

 [snip]
 Modified: head/sys/sys/umtx.h
 ==
 --- head/sys/sys/umtx.h   Tue Mar 18 20:14:13 2014(r263317)
 +++ head/sys/sys/umtx.h   Tue Mar 18 21:32:03 2014(r263318)
 [snip]
 -static __inline int
 -umtx_wait(u_long *p, long val, const struct timespec *timeout)
 -{
 - if (_umtx_op(p, UMTX_OP_WAIT, val, 0,
 - __DECONST(void *, timeout)) == -1)
 - return (errno);
 - return (0);
 -}
 -
 -/* Wake threads waiting on a user address. */
 -static __inline int
 -umtx_wake(u_long *p, int nr_wakeup)
 -{
 - if (_umtx_op(p, UMTX_OP_WAKE, nr_wakeup, 0, 0) == -1)
 - return (errno);
 - return (0);
 -}
 -

 These two do not use struct umtx, are not obsolete and are used by some
 ports, such as lang/sbcl with certain options. They are similar to the
 Linux futex system call. The relatively recent libxshmfence uses the
 underlying umtx_op directly, mainly because there is no static inline
 function for UMTX_OP_WAIT_UINT.

They can just use _umtx_op() straight off.
I already mentioned in the commit message that I will bump
__FreeBSD_version appropriately when more API breakage will be
introduced and we will have a relatively stable API situation of
umtx. At that point ports maintainer can fix the ports.

Attilio


-- 
Peace can only be achieved by understanding - A. Einstein
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r263377 - head/sys/xen

2014-03-19 Thread Warner Losh
Author: imp
Date: Wed Mar 19 20:40:57 2014
New Revision: 263377
URL: http://svnweb.freebsd.org/changeset/base/263377

Log:
  Revert last change, it breaks other things.

Modified:
  head/sys/xen/xen-os.h

Modified: head/sys/xen/xen-os.h
==
--- head/sys/xen/xen-os.h   Wed Mar 19 19:33:55 2014(r263376)
+++ head/sys/xen/xen-os.h   Wed Mar 19 20:40:57 2014(r263377)
@@ -54,6 +54,7 @@ extern shared_info_t *HYPERVISOR_shared_
 extern start_info_t *HYPERVISOR_start_info;
 
 /* XXX: we need to get rid of this and use HYPERVISOR_start_info directly */
+extern struct xenstore_domain_interface *xen_store;
 extern char *console_page;
 
 enum xen_domain_type {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r263379 - in head/sys: amd64/amd64 i386/i386 i386/xen isa pc98/cbus x86/isa x86/x86

2014-03-19 Thread Warner Losh
Author: imp
Date: Wed Mar 19 21:03:04 2014
New Revision: 263379
URL: http://svnweb.freebsd.org/changeset/base/263379

Log:
  Remove vestiges of knowing the ISA bus, which we gave up on around 20
  years ago. Remove redunant copy of isaregs.h.

Deleted:
  head/sys/x86/isa/isa.h
Modified:
  head/sys/amd64/amd64/vm_machdep.c
  head/sys/i386/i386/vm_machdep.c
  head/sys/i386/xen/clock.c
  head/sys/isa/isareg.h
  head/sys/pc98/cbus/cbus.h
  head/sys/pc98/cbus/cbus_dma.c
  head/sys/x86/isa/atpic.c
  head/sys/x86/isa/isa_dma.c
  head/sys/x86/x86/intr_machdep.c
  head/sys/x86/x86/nexus.c

Modified: head/sys/amd64/amd64/vm_machdep.c
==
--- head/sys/amd64/amd64/vm_machdep.c   Wed Mar 19 20:46:02 2014
(r263378)
+++ head/sys/amd64/amd64/vm_machdep.c   Wed Mar 19 21:03:04 2014
(r263379)
@@ -80,7 +80,7 @@ __FBSDID($FreeBSD$);
 #include vm/vm_map.h
 #include vm/vm_param.h
 
-#include x86/isa/isa.h
+#include isa/isareg.h
 
 static voidcpu_reset_real(void);
 #ifdef SMP

Modified: head/sys/i386/i386/vm_machdep.c
==
--- head/sys/i386/i386/vm_machdep.c Wed Mar 19 20:46:02 2014
(r263378)
+++ head/sys/i386/i386/vm_machdep.c Wed Mar 19 21:03:04 2014
(r263379)
@@ -95,7 +95,7 @@ __FBSDID($FreeBSD$);
 #ifdef PC98
 #include pc98/cbus/cbus.h
 #else
-#include x86/isa/isa.h
+#include isa/isareg.h
 #endif
 
 #ifdef XBOX

Modified: head/sys/i386/xen/clock.c
==
--- head/sys/i386/xen/clock.c   Wed Mar 19 20:46:02 2014(r263378)
+++ head/sys/i386/xen/clock.c   Wed Mar 19 21:03:04 2014(r263379)
@@ -76,7 +76,7 @@ __FBSDID($FreeBSD$);
 #include machine/timerreg.h
 
 #include x86/isa/icu.h
-#include x86/isa/isa.h
+#include isa/isareg.h
 #include isa/rtc.h
 
 #include vm/vm.h

Modified: head/sys/isa/isareg.h
==
--- head/sys/isa/isareg.h   Wed Mar 19 20:46:02 2014(r263378)
+++ head/sys/isa/isareg.h   Wed Mar 19 21:03:04 2014(r263379)
@@ -40,8 +40,6 @@
 #ifndef _ISA_ISA_H_
 #define_ISA_ISA_H_
 
-/* BEWARE:  Included in both assembler and C code */
-
 /*
  * ISA Bus conventions
  */
@@ -51,134 +49,22 @@
  */
 #ifndef IO_ISABEGIN
 #defineIO_ISABEGIN 0x000   /* 0x000 - Beginning of I/O 
Registers */
-
-   /* CPU Board */
 #defineIO_ICU1 0x020   /* 8259A Interrupt Controller 
#1 */
-#defineIO_PMP1 0x026   /* 82347 Power Management 
Peripheral */
 #defineIO_KBD  0x060   /* 8042 Keyboard */
 #defineIO_RTC  0x070   /* RTC */
-#defineIO_NMI  IO_RTC  /* NMI Control */
 #defineIO_ICU2 0x0A0   /* 8259A Interrupt Controller 
#2 */
 
-   /* Cards */
-   /* 0x100 - 0x16F Open */
-
-#defineIO_WD2  0x170   /* Secondary Fixed Disk 
Controller */
-
-#defineIO_PMP2 0x178   /* 82347 Power Management 
Peripheral */
-
-   /* 0x17A - 0x1EF Open */
-
-#defineIO_WD1  0x1F0   /* Primary Fixed Disk 
Controller */
-#defineIO_GAME 0x201   /* Game Controller */
-
-   /* 0x202 - 0x22A Open */
-
-#defineIO_ASC2 0x22B   /* AmiScan addr.grp. 2 */
-
-   /* 0x230 - 0x26A Open */
-
-#defineIO_ASC3 0x26B   /* AmiScan addr.grp. 3 */
-#defineIO_GSC1 0x270 /* -- 0x27B! GeniScan GS-4500 addr.grp. 1 
*/
-#defineIO_LPT2 0x278   /* Parallel Port #2 */
-
-   /* 0x280 - 0x2AA Open */
-
-#defineIO_ASC4 0x2AB   /* AmiScan addr.grp. 4 */
-
-   /* 0x2B0 - 0x2DF Open */
-
-#defineIO_GSC2 0x2E0   /* GeniScan GS-4500 addr.grp. 2 
*/
-#defineIO_COM4 0x2E8   /* COM4 i/o address */
-#defineIO_ASC5 0x2EB   /* AmiScan addr.grp. 5 */
-
-   /* 0x2F0 - 0x2F7 Open */
-
-#defineIO_COM2 0x2F8   /* COM2 i/o address */
-
-   /* 0x300 - 0x32A Open */
-
-#defineIO_ASC6 0x32B   /* AmiScan addr.grp. 6 */
-#defineIO_AHA0 0x330   /* adaptec 1542 default addr. */
-#defineIO_BT0  0x330   /* bustek 742a default addr. */
-#defineIO_UHA0 0x330   /* ultrastore 14f default addr. 
*/
-#defineIO_AHA1 0x334   /* adaptec 1542 default addr. */
-#define

svn commit: r263380 - in head/sys/ia64: ia64 include

2014-03-19 Thread Marcel Moolenaar
Author: marcel
Date: Wed Mar 19 21:30:10 2014
New Revision: 263380
URL: http://svnweb.freebsd.org/changeset/base/263380

Log:
  Add KTR events for the PMAP interface functions
  1.  move unmapped_buf_allowed to machdep.c.
  2.  map both pmap_mapbios() and pmap_mapdev() to pmap_mapdev_attr()
  and have the actual work done by pmap_mapdev_priv() (renamed from
  pmap_mapdev()). Use pmap_mapdev_priv() to map the I/O port space
  because we can't use CTR() that early.
  3.  add pmap_pinit_common() that's used by both pmap_pinit0() and
  pmap_pinit(). Previously pmap_pinit0() would call pmap_pinit(),
  but that would create 2 KTR events. While here, use pmap_t instead
  of struct pmap *.
  4.  fix pmap_kenter() to use vm_paddr_t as the type for the physical.
  5.  various white-space adjustments for consistency.
  6.  use C99 and KNF for function definitions where appropriate.
  7.  slightly re-order prototypes and defines in machine/pmap.h
  
  No functional change (other than the creation of KTR_PMAP events).

Modified:
  head/sys/ia64/ia64/machdep.c
  head/sys/ia64/ia64/pmap.c
  head/sys/ia64/include/pmap.h

Modified: head/sys/ia64/ia64/machdep.c
==
--- head/sys/ia64/ia64/machdep.cWed Mar 19 21:03:04 2014
(r263379)
+++ head/sys/ia64/ia64/machdep.cWed Mar 19 21:30:10 2014
(r263380)
@@ -133,6 +133,7 @@ SYSCTL_UINT(_hw_freq, OID_AUTO, itc, CTL
 ITC frequency);
 
 int cold = 1;
+int unmapped_buf_allowed = 0;
 
 struct bootinfo *bootinfo;
 
@@ -746,8 +747,8 @@ ia64_init(void)
mdlen = md-md_pages * EFI_PAGE_SIZE;
switch (md-md_type) {
case EFI_MD_TYPE_IOPORT:
-   ia64_port_base = (uintptr_t)pmap_mapdev(md-md_phys,
-   mdlen);
+   ia64_port_base = pmap_mapdev_priv(md-md_phys,
+   mdlen, VM_MEMATTR_UNCACHEABLE);
break;
case EFI_MD_TYPE_PALCODE:
ia64_pal_base = md-md_phys;

Modified: head/sys/ia64/ia64/pmap.c
==
--- head/sys/ia64/ia64/pmap.c   Wed Mar 19 21:03:04 2014(r263379)
+++ head/sys/ia64/ia64/pmap.c   Wed Mar 19 21:30:10 2014(r263380)
@@ -52,6 +52,7 @@ __FBSDID($FreeBSD$);
 
 #include sys/param.h
 #include sys/kernel.h
+#include sys/ktr.h
 #include sys/lock.h
 #include sys/mman.h
 #include sys/mutex.h
@@ -484,6 +485,8 @@ void
 pmap_page_init(vm_page_t m)
 {
 
+   CTR2(KTR_PMAP, %s(%p), __func__, m);
+
TAILQ_INIT(m-md.pv_list);
m-md.memattr = VM_MEMATTR_DEFAULT;
 }
@@ -497,6 +500,8 @@ void
 pmap_init(void)
 {
 
+   CTR1(KTR_PMAP, %s(), __func__);
+
ptezone = uma_zcreate(PT ENTRY, sizeof (struct ia64_lpte), 
NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM|UMA_ZONE_NOFREE);
 }
@@ -604,13 +609,25 @@ pmap_free_rid(uint32_t rid)
  * Page table page management routines.
  ***/
 
+static void
+pmap_pinit_common(pmap_t pmap)
+{
+   int i;
+
+   for (i = 0; i  IA64_VM_MINKERN_REGION; i++)
+   pmap-pm_rid[i] = pmap_allocate_rid();
+   TAILQ_INIT(pmap-pm_pvchunk);
+   bzero(pmap-pm_stats, sizeof pmap-pm_stats);
+}
+
 void
-pmap_pinit0(struct pmap *pmap)
+pmap_pinit0(pmap_t pmap)
 {
 
+   CTR2(KTR_PMAP, %s(%p), __func__, pmap);
+
PMAP_LOCK_INIT(pmap);
-   /* kernel_pmap is the same as any other pmap. */
-   pmap_pinit(pmap);
+   pmap_pinit_common(pmap);
 }
 
 /*
@@ -618,14 +635,12 @@ pmap_pinit0(struct pmap *pmap)
  * such as one in a vmspace structure.
  */
 int
-pmap_pinit(struct pmap *pmap)
+pmap_pinit(pmap_t pmap)
 {
-   int i;
 
-   for (i = 0; i  IA64_VM_MINKERN_REGION; i++)
-   pmap-pm_rid[i] = pmap_allocate_rid();
-   TAILQ_INIT(pmap-pm_pvchunk);
-   bzero(pmap-pm_stats, sizeof pmap-pm_stats);
+   CTR2(KTR_PMAP, %s(%p), __func__, pmap);
+
+   pmap_pinit_common(pmap);
return (1);
 }
 
@@ -643,6 +658,8 @@ pmap_release(pmap_t pmap)
 {
int i;
 
+   CTR2(KTR_PMAP, %s(%p), __func__, pmap);
+
for (i = 0; i  IA64_VM_MINKERN_REGION; i++)
if (pmap-pm_rid[i])
pmap_free_rid(pmap-pm_rid[i]);
@@ -658,6 +675,8 @@ pmap_growkernel(vm_offset_t addr)
struct ia64_lpte *leaf;
vm_page_t nkpg;
 
+   CTR2(KTR_PMAP, %s(%#x), __func__, addr);
+
while (kernel_vm_end = addr) {
if (nkpt == PAGE_SIZE/8 + PAGE_SIZE*PAGE_SIZE/64)
panic(%s: out of kernel address space, __func__);
@@ -1152,6 +1171,8 @@ pmap_extract(pmap_t pmap, vm_offset_t va
pmap_t oldpmap;
vm_paddr_t pa;
 
+   CTR3(KTR_PMAP, %s(%p, %#x), __func__, pmap, va);
+
pa = 0;
PMAP_LOCK(pmap);
oldpmap = 

Re: svn commit: r263379 - in head/sys: amd64/amd64 i386/i386 i386/xen isa pc98/cbus x86/isa x86/x86

2014-03-19 Thread Don Lewis
On 19 Mar, Warner Losh wrote:
 Author: imp
 Date: Wed Mar 19 21:03:04 2014
 New Revision: 263379
 URL: http://svnweb.freebsd.org/changeset/base/263379
 
 Log:
   Remove vestiges of knowing the ISA bus, which we gave up on around 20
   years ago. Remove redunant copy of isaregs.h.

It hasn't been that long ...

At $ork we were still running a number of FreeBSD machines with ISA
slots in 2002.  I don't think we were using any ISA cards, except an
Etinc ET/5025 to connect to a T-1.

I've still got a FreeBSD box here in daily use that has ISA slots.

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


Re: svn commit: r263379 - in head/sys: amd64/amd64 i386/i386 i386/xen isa pc98/cbus x86/isa x86/x86

2014-03-19 Thread Warner Losh

On Mar 19, 2014, at 3:43 PM, Don Lewis truck...@freebsd.org wrote:

 On 19 Mar, Warner Losh wrote:
 Author: imp
 Date: Wed Mar 19 21:03:04 2014
 New Revision: 263379
 URL: http://svnweb.freebsd.org/changeset/base/263379
 
 Log:
  Remove vestiges of knowing the ISA bus, which we gave up on around 20
  years ago. Remove redunant copy of isaregs.h.
 
 It hasn't been that long ...
 
 At $ork we were still running a number of FreeBSD machines with ISA
 slots in 2002.  I don't think we were using any ISA cards, except an
 Etinc ET/5025 to connect to a T-1.
 
 I've still got a FreeBSD box here in daily use that has ISA slots.

We still support ISA cards, and this doesn’t change that at all. This just 
retires
a bunch of #defines that haven’t been used in about 20 years (well, maybe only
15 years) and removes a redundant copy of what remains...

Warner

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


svn commit: r263385 - head/cddl/contrib/opensolaris/cmd/zpool

2014-03-19 Thread Xin LI
Author: delphij
Date: Wed Mar 19 23:04:52 2014
New Revision: 263385
URL: http://svnweb.freebsd.org/changeset/base/263385

Log:
  Remove unused option -r from zpool.
  
  Submitted by: Richard Yao ryao gentoo org
  MFC after:2 weeks

Modified:
  head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c

Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
==
--- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.cWed Mar 19 
22:50:14 2014(r263384)
+++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.cWed Mar 19 
23:04:52 2014(r263385)
@@ -1969,7 +1969,7 @@ zpool_do_import(int argc, char **argv)
char *endptr;
 
/* check options */
-   while ((c = getopt(argc, argv, :aCc:d:DEfFmnNo:rR:T:VX)) != -1) {
+   while ((c = getopt(argc, argv, :aCc:d:DEfFmnNo:R:T:VX)) != -1) {
switch (c) {
case 'a':
do_all = B_TRUE;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r263388 - head/usr.bin/sed/tests

2014-03-19 Thread Julio Merino
Author: jmmv
Date: Wed Mar 19 23:29:00 2014
New Revision: 263388
URL: http://svnweb.freebsd.org/changeset/base/263388

Log:
  Mark multi_test as requiring /usr/share/dict/words.
  
  The file may not be present if MK_DICT=no.  Pointed out by Casey Peel.

Modified:
  head/usr.bin/sed/tests/Makefile

Modified: head/usr.bin/sed/tests/Makefile
==
--- head/usr.bin/sed/tests/Makefile Wed Mar 19 23:22:25 2014
(r263387)
+++ head/usr.bin/sed/tests/Makefile Wed Mar 19 23:29:00 2014
(r263388)
@@ -4,6 +4,7 @@ TESTSDIR=   ${TESTSBASE}/usr.bin/sed
 
 TAP_TESTS_SH=  legacy_test
 TAP_TESTS_SH+= multi_test
+TEST_METADATA.multi_test+= required_files=/usr/share/dict/words
 TAP_TESTS_SH+= inplace_race_test
 
 FILESDIR=  ${TESTSDIR}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r263412 - head/sys/dev/cxgbe

2014-03-19 Thread Navdeep Parhar
Author: np
Date: Thu Mar 20 01:58:04 2014
New Revision: 263412
URL: http://svnweb.freebsd.org/changeset/base/263412

Log:
  cxgbe(4): if_iqdrops statistic should include tunnel congestion drops.
  
  MFC after:1 week

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

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cThu Mar 20 00:46:25 2014
(r263411)
+++ head/sys/dev/cxgbe/t4_main.cThu Mar 20 01:58:04 2014
(r263412)
@@ -4085,6 +4085,7 @@ static void
 cxgbe_tick(void *arg)
 {
struct port_info *pi = arg;
+   struct adapter *sc = pi-adapter;
struct ifnet *ifp = pi-ifp;
struct sge_txq *txq;
int i, drops;
@@ -4096,7 +4097,7 @@ cxgbe_tick(void *arg)
return; /* without scheduling another callout */
}
 
-   t4_get_port_stats(pi-adapter, pi-tx_chan, s);
+   t4_get_port_stats(sc, pi-tx_chan, s);
 
ifp-if_opackets = s-tx_frames - s-tx_pause;
ifp-if_ipackets = s-rx_frames - s-rx_pause;
@@ -4107,6 +4108,19 @@ cxgbe_tick(void *arg)
ifp-if_iqdrops = s-rx_ovflow0 + s-rx_ovflow1 + s-rx_ovflow2 +
s-rx_ovflow3 + s-rx_trunc0 + s-rx_trunc1 + s-rx_trunc2 +
s-rx_trunc3;
+   for (i = 0; i  4; i++) {
+   if (pi-rx_chan_map  (1  i)) {
+   uint32_t v;
+
+   /*
+* XXX: indirect reads from the same ADDR/DATA pair can
+* race with each other.
+*/
+   t4_read_indirect(sc, A_TP_MIB_INDEX, A_TP_MIB_DATA, v,
+   1, A_TP_MIB_TNL_CNG_DROP_0 + i);
+   ifp-if_iqdrops += v;
+   }
+   }
 
drops = s-tx_drop;
for_each_txq(pi, i, txq)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r263413 - head/sys/net

2014-03-19 Thread Navdeep Parhar
Author: np
Date: Thu Mar 20 02:23:52 2014
New Revision: 263413
URL: http://svnweb.freebsd.org/changeset/base/263413

Log:
  Add a shorter alias for if_data.ifi_oqdrops.

Modified:
  head/sys/net/if_var.h

Modified: head/sys/net/if_var.h
==
--- head/sys/net/if_var.h   Thu Mar 20 01:58:04 2014(r263412)
+++ head/sys/net/if_var.h   Thu Mar 20 02:23:52 2014(r263413)
@@ -226,6 +226,7 @@ struct ifnet {
 #defineif_imcasts  if_data.ifi_imcasts
 #defineif_omcasts  if_data.ifi_omcasts
 #defineif_iqdrops  if_data.ifi_iqdrops
+#defineif_oqdrops  if_data.ifi_oqdrops
 #defineif_noproto  if_data.ifi_noproto
 #defineif_lastchange   if_data.ifi_lastchange
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r263415 - head/sys/dev/cxgbe

2014-03-19 Thread Navdeep Parhar
Author: np
Date: Thu Mar 20 02:28:05 2014
New Revision: 263415
URL: http://svnweb.freebsd.org/changeset/base/263415

Log:
  cxgbe(4): Use ifi_oqdrops in if_data to count drops in the tx path.

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

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cThu Mar 20 02:27:25 2014
(r263414)
+++ head/sys/dev/cxgbe/t4_main.cThu Mar 20 02:28:05 2014
(r263415)
@@ -4125,7 +4125,7 @@ cxgbe_tick(void *arg)
drops = s-tx_drop;
for_each_txq(pi, i, txq)
drops += txq-br-br_drops;
-   ifp-if_snd.ifq_drops = drops;
+   ifp-if_oqdrops = drops;
 
ifp-if_oerrors = s-tx_error_frames;
ifp-if_ierrors = s-rx_jabber + s-rx_runt + s-rx_too_long +
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r263416 - head/sys/dev/ath

2014-03-19 Thread Adrian Chadd
Author: adrian
Date: Thu Mar 20 04:47:34 2014
New Revision: 263416
URL: http://svnweb.freebsd.org/changeset/base/263416

Log:
  Don't call ath_init() inside the lock.
  
  Yes, this means that sc_invalid is slightly racy, but there are other
  issues here which need fixing.
  
  This fixes a source of eventual LORs - ath_init() grabs ATH_LOCK to do
  work and releases it before it calls ieee80211_start_all().
  ieee80211_start_all() will grab the net80211 comlock to iterate over
  the VAPs.
  
  TODO:
  
  * .. I should just migrate the ieee80211_start_all() work to a
deferred task so it can be done later; it doesn't have to be
immediately done.
  
  Tested:
  
  * AR5416, STA mode

Modified:
  head/sys/dev/ath/if_ath.c

Modified: head/sys/dev/ath/if_ath.c
==
--- head/sys/dev/ath/if_ath.c   Thu Mar 20 02:28:05 2014(r263415)
+++ head/sys/dev/ath/if_ath.c   Thu Mar 20 04:47:34 2014(r263416)
@@ -5948,14 +5948,15 @@ ath_ioctl(struct ifnet *ifp, u_long cmd,
 
switch (cmd) {
case SIOCSIFFLAGS:
-   ATH_LOCK(sc);
if (IS_RUNNING(ifp)) {
/*
 * To avoid rescanning another access point,
 * do not call ath_init() here.  Instead,
 * only reflect promisc mode settings.
 */
+   ATH_LOCK(sc);
ath_mode_init(sc);
+   ATH_UNLOCK(sc);
} else if (ifp-if_flags  IFF_UP) {
/*
 * Beware of being called during attach/detach
@@ -5969,14 +5970,15 @@ ath_ioctl(struct ifnet *ifp, u_long cmd,
if (!sc-sc_invalid)
ath_init(sc);   /* XXX lose error */
} else {
+   ATH_LOCK(sc);
ath_stop_locked(ifp);
 #ifdef notyet
/* XXX must wakeup in places like ath_vap_delete */
if (!sc-sc_invalid)
ath_hal_setpower(sc-sc_ah, HAL_PM_FULL_SLEEP);
 #endif
+   ATH_UNLOCK(sc);
}
-   ATH_UNLOCK(sc);
break;
case SIOCGIFMEDIA:
case SIOCSIFMEDIA:
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r263417 - head/sys/dev/ath/ath_hal/ar5416

2014-03-19 Thread Adrian Chadd
Author: adrian
Date: Thu Mar 20 05:08:31 2014
New Revision: 263417
URL: http://svnweb.freebsd.org/changeset/base/263417

Log:
  Shuffle ah_powerMode to be in a sane spot for the given power operation.
  
  This way the state changes from sleep-awake before the registers are poked
  and from awake-sleep after the registers are poked.
  
  This way spurious warnings aren't printed by my (to be committed)
  debugging code.
  
  Tested:
  
  * AR5416, STA

Modified:
  head/sys/dev/ath/ath_hal/ar5416/ar5416_power.c

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_power.c
==
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_power.c  Thu Mar 20 04:47:34 
2014(r263416)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_power.c  Thu Mar 20 05:08:31 
2014(r263417)
@@ -140,20 +140,22 @@ ar5416SetPowerMode(struct ath_hal *ah, H
modes[ah-ah_powerMode], modes[mode], setChip ? set chip  : );
switch (mode) {
case HAL_PM_AWAKE:
+   ah-ah_powerMode = mode;
status = ar5416SetPowerModeAwake(ah, setChip);
break;
case HAL_PM_FULL_SLEEP:
ar5416SetPowerModeSleep(ah, setChip);
+   ah-ah_powerMode = mode;
break;
case HAL_PM_NETWORK_SLEEP:
ar5416SetPowerModeNetworkSleep(ah, setChip);
+   ah-ah_powerMode = mode;
break;
default:
HALDEBUG(ah, HAL_DEBUG_ANY, %s: unknown power mode 0x%x\n,
__func__, mode);
return AH_FALSE;
}
-   ah-ah_powerMode = mode;
return status;
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r263418 - head/sys/dev/ath

2014-03-19 Thread Adrian Chadd
Author: adrian
Date: Thu Mar 20 05:10:17 2014
New Revision: 263418
URL: http://svnweb.freebsd.org/changeset/base/263418

Log:
  Add some debugging code to print out if registers are touched whilst the
  device is asleep.
  
  This doesn't avoid logging errors for things that are actually OK to
  access whilst the chip is asleep (eg, the RTC registers (0x7000-0x70ff
  on the AR5416 and later.)
  
  But, this is a pretty good indicator if things are accessed incorrectly.
  
  Tested:
  
  * AR5416, STA

Modified:
  head/sys/dev/ath/ah_osdep.c

Modified: head/sys/dev/ath/ah_osdep.c
==
--- head/sys/dev/ath/ah_osdep.c Thu Mar 20 05:08:31 2014(r263417)
+++ head/sys/dev/ath/ah_osdep.c Thu Mar 20 05:10:17 2014(r263418)
@@ -253,6 +253,12 @@ ath_hal_reg_write(struct ath_hal *ah, u_
bus_space_tag_t tag = BUSTAG(ah);
bus_space_handle_t h = ah-ah_sh;
 
+   /* Debug - complain if we haven't fully waken things up */
+   if (ah-ah_powerMode != HAL_PM_AWAKE) {
+   ath_hal_printf(ah, %s: reg=0x%08x, val=0x%08x, pm=%d\n,
+   __func__, reg, val, ah-ah_powerMode);
+   }
+
if (ath_hal_alq) {
struct ale *ale = ath_hal_alq_get(ah);
if (ale) {
@@ -278,6 +284,12 @@ ath_hal_reg_read(struct ath_hal *ah, u_i
bus_space_handle_t h = ah-ah_sh;
u_int32_t val;
 
+   /* Debug - complain if we haven't fully waken things up */
+   if (ah-ah_powerMode != HAL_PM_AWAKE) {
+   ath_hal_printf(ah, %s: reg=0x%08x, pm=%d\n,
+   __func__, reg, ah-ah_powerMode);
+   }
+
if (ah-ah_config.ah_serialise_reg_war)
mtx_lock_spin(ah_regser_mtx);
val = bus_space_read_4(tag, h, reg);
@@ -330,6 +342,12 @@ ath_hal_reg_write(struct ath_hal *ah, u_
bus_space_tag_t tag = BUSTAG(ah);
bus_space_handle_t h = ah-ah_sh;
 
+   /* Debug - complain if we haven't fully waken things up */
+   if (ah-ah_powerMode != HAL_PM_AWAKE) {
+   ath_hal_printf(ah, %s: reg=0x%08x, val=0x%08x, pm=%d\n,
+   __func__, reg, val, ah-ah_powerMode);
+   }
+
if (ah-ah_config.ah_serialise_reg_war)
mtx_lock_spin(ah_regser_mtx);
bus_space_write_4(tag, h, reg, val);
@@ -344,6 +362,12 @@ ath_hal_reg_read(struct ath_hal *ah, u_i
bus_space_handle_t h = ah-ah_sh;
u_int32_t val;
 
+   /* Debug - complain if we haven't fully waken things up */
+   if (ah-ah_powerMode != HAL_PM_AWAKE) {
+   ath_hal_printf(ah, %s: reg=0x%08x, pm=%d\n,
+   __func__, reg, ah-ah_powerMode);
+   }
+
if (ah-ah_config.ah_serialise_reg_war)
mtx_lock_spin(ah_regser_mtx);
val = bus_space_read_4(tag, h, reg);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r263415 - head/sys/dev/cxgbe

2014-03-19 Thread Gleb Smirnoff
On Thu, Mar 20, 2014 at 02:28:05AM +, Navdeep Parhar wrote:
N Author: np
N Date: Thu Mar 20 02:28:05 2014
N New Revision: 263415
N URL: http://svnweb.freebsd.org/changeset/base/263415
N 
N Log:
N   cxgbe(4): Use ifi_oqdrops in if_data to count drops in the tx path.

Thanks for this one and for r263413 :)

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