svn commit: r334915 - head/usr.bin/calendar/calendars

2018-06-09 Thread Michael Dexter
Author: dexter (doc committer)
Date: Sun Jun 10 05:48:03 2018
New Revision: 334915
URL: https://svnweb.freebsd.org/changeset/base/334915

Log:
  Add myself to calendar.freebsd
  
  Approved by:  bcr (mentor)

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdSun Jun 10 05:37:40 
2018(r334914)
+++ head/usr.bin/calendar/calendars/calendar.freebsdSun Jun 10 05:48:03 
2018(r334915)
@@ -356,6 +356,7 @@
 09/21  Gleb Kurtsou  born in Minsk, Belarus, 1984
 09/22  Alan Somers  born in San Antonio, Texas, United 
States, 1982
 09/22  Bryan Drewery  born in San Diego, California, 
United States, 1984
+09/23  Michael Dexter  born in Los Angeles, California, 
1972
 09/23  Martin Matuska  born in Bratislava, Slovakia, 1979
 09/24  Larry Rosenman  born in Queens, New York, United 
States, 1957
 09/27  Kyle Evans  born in Oklahoma City, Oklahoma, United 
States, 1991
___
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: r334914 - head/share/misc

2018-06-09 Thread Michael Dexter
Author: dexter (doc committer)
Date: Sun Jun 10 05:37:40 2018
New Revision: 334914
URL: https://svnweb.freebsd.org/changeset/base/334914

Log:
  Add myself with mentor. Corrected path svnadmin/conf/access in comments.
  
  Approved by:  bcr (mentor)

Modified:
  head/share/misc/committers-doc.dot

Modified: head/share/misc/committers-doc.dot
==
--- head/share/misc/committers-doc.dot  Sun Jun 10 04:25:19 2018
(r334913)
+++ head/share/misc/committers-doc.dot  Sun Jun 10 05:37:40 2018
(r334914)
@@ -15,7 +15,7 @@ digraph doc {
 #   foo [label="Foo Bar\n...@freebsd.org\n/??/??"]
 #
 # /??/?? is the date when the commit bit was obtained, usually the one you
-# can find looking at svn logs for the svnadmin/access file.
+# can find looking at svn logs for the svnadmin/conf/access file.
 # Use /MM/DD format.
 #
 # For returned commit bits, the node definition will follow this example:
@@ -61,6 +61,7 @@ chinsan [label="Chinsan Huang\nchin...@freebsd.org\n20
 crees [label="Chris Rees\ncr...@freebsd.org\n2013/05/27"]
 danger [label="Daniel Gerzo\ndan...@freebsd.org\n2006/08/20"]
 delphij [label="Xin Li\ndelp...@freebsd.org\n2004/09/14"]
+dexter [label="Michael Dexter\ndex...@freebsd.org\n2016/11/15"]
 dru [label="Dru Lavigne\n...@freebsd.org\n2013/01/22"]
 eadler [label="Eitan Adler\nead...@freebsd.org\n2012/10/15"]
 ebrandi [label="Edson Brandi\nebra...@freebsd.org\n2012/09/13"]
@@ -106,6 +107,7 @@ bcr -> jgh
 bcr -> allanjude
 bcr -> bhd
 bcr -> sevan
+bcr -> dexter
 
 blackend -> ale
 
___
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: r334913 - head

2018-06-09 Thread Peter Grehan
Author: grehan
Date: Sun Jun 10 04:25:19 2018
New Revision: 334913
URL: https://svnweb.freebsd.org/changeset/base/334913

Log:
  Pass on   bhyve kernel module maintenance to
  tychon and jhb who've both had a long history
  with the codebase.
  
  Discussed with:tychon, jhb

Modified:
  head/MAINTAINERS

Modified: head/MAINTAINERS
==
--- head/MAINTAINERSSun Jun 10 02:36:38 2018(r334912)
+++ head/MAINTAINERSSun Jun 10 04:25:19 2018(r334913)
@@ -104,7 +104,7 @@ usr.sbin/bsdconfig  dteske  Pre-commit phabricator revie
 usr.sbin/dpv   dteske  Pre-commit review requested. Keep in sync with libdpv.
 usr.sbin/pkg   pkg@Please coordinate behavior or flag changes with pkg 
team.
 usr.sbin/sysrc dteske  Pre-commit phabricator review requested. Keep in sync 
with bsdconfig(8) sysrc.subr.
-vmm(4) grehan  Pre-commit review requested.
+vmm(4) tychon, jhb Pre-commit review requested.
 autofs(5)  trasz   Pre-commit review recommended.
 iscsi(4)   trasz   Pre-commit review recommended.
 rctl(8)trasz   Pre-commit review recommended.
___
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: r334912 - head/stand/lua

2018-06-09 Thread Kyle Evans
Author: kevans
Date: Sun Jun 10 02:36:38 2018
New Revision: 334912
URL: https://svnweb.freebsd.org/changeset/base/334912

Log:
  lualoader: Support variable substitution in env var settings
  
  We support both of the following cases of substitution:
  
  bar="y"
  foo="${bar}"
  foo="$bar"
  
  The latter substitution syntax is, of course, not recommended- all
  punctuation must be considered potential variable names, and we do not go
  through the effort of searching the different combinations of, for instance,
  "$x.y.z" to determine if the variable is $x, $x.y, or $x.y.z.
  
  This is not officially documented as supported, but it has worked in
  forthloader for what is most likely a long time as `evaluate` is used to
  process the right hand side of the assignment.

Modified:
  head/stand/lua/config.lua

Modified: head/stand/lua/config.lua
==
--- head/stand/lua/config.lua   Sun Jun 10 02:34:41 2018(r334911)
+++ head/stand/lua/config.lua   Sun Jun 10 02:36:38 2018(r334912)
@@ -102,6 +102,25 @@ local function setKey(key, name, value)
modules[key][name] = value
 end
 
+-- Escapes the named value for use as a literal in a replacement pattern.
+-- e.g. dhcp.host-name gets turned into dhcp%.host%-name to remove the special
+-- meaning.
+local function escapeName(name)
+   return name:gsub("([%p])", "%%%1")
+end
+
+local function processEnvVar(value)
+   for name in value:gmatch("${([^}]+)}") do
+   local replacement = loader.getenv(name) or ""
+   value = value:gsub("${" .. escapeName(name) .. "}", replacement)
+   end
+   for name in value:gmatch("$([%w%p]+)%s*") do
+   local replacement = loader.getenv(name) or ""
+   value = value:gsub("$" .. escapeName(name), replacement)
+   end
+   return value
+end
+
 local pattern_table = {
{
str = "^%s*(#.*)",
@@ -172,7 +191,7 @@ local pattern_table = {
{
str = "^%s*([%w%p]+)%s*=%s*\"([%w%s%p]-)\"%s*(.*)",
process = function(k, v)
-   if setEnv(k, v) ~= 0 then
+   if setEnv(k, processEnvVar(v)) ~= 0 then
print(MSG_FAILSETENV:format(k, v))
end
end,
@@ -181,7 +200,7 @@ local pattern_table = {
{
str = "^%s*([%w%p]+)%s*=%s*(%d+)%s*(.*)",
process = function(k, v)
-   if setEnv(k, v) ~= 0 then
+   if setEnv(k, processEnvVar(v)) ~= 0 then
print(MSG_FAILSETENV:format(k, tostring(v)))
end
end,
___
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: r334911 - in head/lib/libcompat: . 4.1 4.3 4.4

2018-06-09 Thread John Baldwin
Author: jhb
Date: Sun Jun 10 02:34:41 2018
New Revision: 334911
URL: https://svnweb.freebsd.org/changeset/base/334911

Log:
  Use __SCSSID() for SCCS IDs.
  
  While here, fix $FreeBSD$ ID in ftime.c to use __FBSDID instead of a static
  array.

Modified:
  head/lib/libcompat/4.1/ftime.c
  head/lib/libcompat/4.3/re_comp.c
  head/lib/libcompat/4.3/rexec.c
  head/lib/libcompat/4.4/cuserid.c
  head/lib/libcompat/Makefile

Modified: head/lib/libcompat/4.1/ftime.c
==
--- head/lib/libcompat/4.1/ftime.c  Sun Jun 10 02:30:09 2018
(r334910)
+++ head/lib/libcompat/4.1/ftime.c  Sun Jun 10 02:34:41 2018
(r334911)
@@ -30,9 +30,8 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef lint
-static char rcsid[] = "$FreeBSD$";
-#endif /* not lint */
+#include 
+__FBSDID("$FreeBSD$");
 
 #include 
 #include 

Modified: head/lib/libcompat/4.3/re_comp.c
==
--- head/lib/libcompat/4.3/re_comp.cSun Jun 10 02:30:09 2018
(r334910)
+++ head/lib/libcompat/4.3/re_comp.cSun Jun 10 02:34:41 2018
(r334911)
@@ -34,6 +34,7 @@
 
 #include 
 __FBSDID("$FreeBSD$");
+__SCCSID("@(#)regex.c  5.1 (Berkeley) 3/29/92");
 
 /*
  * Compatibility routines that implement the old re_comp/re_exec interface in
@@ -41,10 +42,6 @@ __FBSDID("$FreeBSD$");
  * rely on dark corners of re_comp/re_exec and won't work with this version,
  * but most programs should be fine.
  */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)regex.c5.1 (Berkeley) 3/29/92";
-#endif /* LIBC_SCCS and not lint */
 
 #include 
 #include 

Modified: head/lib/libcompat/4.3/rexec.c
==
--- head/lib/libcompat/4.3/rexec.c  Sun Jun 10 02:30:09 2018
(r334910)
+++ head/lib/libcompat/4.3/rexec.c  Sun Jun 10 02:34:41 2018
(r334911)
@@ -27,13 +27,11 @@
  * 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$
  */
 
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)rexec.c8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
+#include 
+__FBSDID("$FreeBSD$");
+__SCCSID("@(#)rexec.c  8.1 (Berkeley) 6/4/93");
 
 #include 
 #include 

Modified: head/lib/libcompat/4.4/cuserid.c
==
--- head/lib/libcompat/4.4/cuserid.cSun Jun 10 02:30:09 2018
(r334910)
+++ head/lib/libcompat/4.4/cuserid.cSun Jun 10 02:34:41 2018
(r334911)
@@ -29,11 +29,9 @@
  * SUCH DAMAGE.
  */
 
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)cuserid.c  8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
 #include 
 __FBSDID("$FreeBSD$");
+__SCCSID("@(#)cuserid.c8.1 (Berkeley) 6/4/93");
 
 #include 
 #include 

Modified: head/lib/libcompat/Makefile
==
--- head/lib/libcompat/Makefile Sun Jun 10 02:30:09 2018(r334910)
+++ head/lib/libcompat/Makefile Sun Jun 10 02:34:41 2018(r334911)
@@ -3,7 +3,7 @@
 
 PACKAGE=lib${LIB}
 LIB=   compat
-CFLAGS+=-DLIBC_SCCS -DSYSLIBC_SCCS -I${SRCTOP}/lib/libc/locale
+CFLAGS+=-I${SRCTOP}/lib/libc/locale
 NO_PIC=
 
 WARNS?=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: r334910 - head/usr.sbin/cron/cron

2018-06-09 Thread Warner Losh
Author: imp
Date: Sun Jun 10 02:30:09 2018
New Revision: 334910
URL: https://svnweb.freebsd.org/changeset/base/334910

Log:
  Remove old, dead compat code.
  
  We no longer need to od these things conditionally, and the fallbacks
  are to 4.2BSD era defaults, which nobody uses anymore. Vixie cron has
  diverged from upstream anyway in our tree, and it's not clear there's
  actually a viable upstream anymore. Plus, we don't follow the
  vendor-supplied code pattern here.
  
  I'm doing this to reduce false positives from grep.

Modified:
  head/usr.sbin/cron/cron/pathnames.h

Modified: head/usr.sbin/cron/cron/pathnames.h
==
--- head/usr.sbin/cron/cron/pathnames.h Sun Jun 10 02:13:30 2018
(r334909)
+++ head/usr.sbin/cron/cron/pathnames.h Sun Jun 10 02:30:09 2018
(r334910)
@@ -53,11 +53,7 @@
 
/* where should the daemon stick its PID?
 */
-#ifdef _PATH_VARRUN
-# define PIDDIR_PATH_VARRUN
-#else
-# define PIDDIR "/etc/"
-#endif
+#define PIDDIR _PATH_VARRUN
 #define PIDFILE"%scron.pid"
 
/* 4.3BSD-style crontab */
@@ -68,16 +64,4 @@
/* what editor to use if no EDITOR or VISUAL
 * environment variable specified.
 */
-#if defined(_PATH_VI)
-# define EDITOR _PATH_VI
-#else
-# define EDITOR "/usr/ucb/vi"
-#endif
-
-#ifndef _PATH_BSHELL
-# define _PATH_BSHELL "/bin/sh"
-#endif
-
-#ifndef _PATH_DEFPATH
-# define _PATH_DEFPATH "/usr/bin:/bin"
-#endif
+#define EDITOR _PATH_VI
___
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: r334909 - head/etc

2018-06-09 Thread Warner Losh
Author: imp
Date: Sun Jun 10 02:13:30 2018
New Revision: 334909
URL: https://svnweb.freebsd.org/changeset/base/334909

Log:
  Set the  $PATH in /etc/crontab like it is set by the cron(8)
  daemon, for consistency.
  
  Submitted by: Ben RUBSON
  Pull Request: https://github.com/freebsd/freebsd/pull/155

Modified:
  head/etc/crontab

Modified: head/etc/crontab
==
--- head/etc/crontabSun Jun 10 01:41:07 2018(r334908)
+++ head/etc/crontabSun Jun 10 02:13:30 2018(r334909)
@@ -3,7 +3,7 @@
 # $FreeBSD$
 #
 SHELL=/bin/sh
-PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
+PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
 #
 #minutehourmdaymonth   wdaywho command
 #
___
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: r334907 - head/stand/lua

2018-06-09 Thread Kyle Evans
Author: kevans
Date: Sun Jun 10 01:38:52 2018
New Revision: 334907
URL: https://svnweb.freebsd.org/changeset/base/334907

Log:
  lualoader: Process loader_conf_files properly
  
  loader.conf(5) documents loader_conf_files to mean "additional configuration
  files to be processed right after the present file." However, lualoader
  ignored loader_conf_files after processing /boot/defaults/loader.conf.
  
  Rewrite these bits to process loader_conf_files after each loaded file.

Modified:
  head/stand/lua/config.lua

Modified: head/stand/lua/config.lua
==
--- head/stand/lua/config.lua   Sun Jun 10 00:02:56 2018(r334906)
+++ head/stand/lua/config.lua   Sun Jun 10 01:38:52 2018(r334907)
@@ -250,7 +250,34 @@ local function loadModule(mod, silent)
return status
 end
 
+local function readConfFiles(loaded_files)
+   local f = loader.getenv("loader_conf_files")
+   if f ~= nil then
+   for name in f:gmatch("([%w%p]+)%s*") do
+   if loaded_files[name] ~= nil then
+   goto continue
+   end
 
+   local prefiles = loader.getenv("loader_conf_files")
+
+   print("Loading " .. name)
+   -- These may or may not exist, and that's ok. Do a
+   -- silent parse so that we complain on parse errors but
+   -- not for them simply not existing.
+   if not config.processFile(name, true) then
+   print(MSG_FAILPARSECFG:format(name))
+   end
+
+   loaded_files[name] = true
+   local newfiles = loader.getenv("loader_conf_files")
+   if prefiles ~= newfiles then
+   readConfFiles(loaded_files)
+   end
+   ::continue::
+   end
+   end
+end
+
 local function readFile(name, silent)
local f = io.open(name)
if f == nil then
@@ -467,17 +494,8 @@ function config.load(file, reloading)
print(MSG_FAILPARSECFG:format(file))
end
 
-   local f = loader.getenv("loader_conf_files")
-   if f ~= nil then
-   for name in f:gmatch("([%w%p]+)%s*") do
-   -- These may or may not exist, and that's ok. Do a
-   -- silent parse so that we complain on parse errors but
-   -- not for them simply not existing.
-   if not config.processFile(name, true) then
-   print(MSG_FAILPARSECFG:format(name))
-   end
-   end
-   end
+   local loaded_files = {file = true}
+   readConfFiles(loaded_files)
 
checkNextboot()
 
___
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: r334906 - head/usr.bin/top

2018-06-09 Thread Eitan Adler
Author: eadler
Date: Sun Jun 10 00:02:56 2018
New Revision: 334906
URL: https://svnweb.freebsd.org/changeset/base/334906

Log:
  top(1): permit sub-second delay times
  
  This removes the getuid check for delay==0. It didn't prevent users from
  writing similar programs in the general case. In theory, if top(1) is
  among one of the few restricted programs you're allowed to run, it may
  have helped a little, but there are better ways of handling that case.

Modified:
  head/usr.bin/top/top.c
  head/usr.bin/top/top.h

Modified: head/usr.bin/top/top.c
==
--- head/usr.bin/top/top.c  Sat Jun  9 23:45:05 2018(r334905)
+++ head/usr.bin/top/top.c  Sun Jun 10 00:02:56 2018(r334906)
@@ -235,7 +235,7 @@ main(int argc, char *argv[])
 static char tempbuf2[50];
 int old_sigmask;   /* only used for BSD-style signals */
 int topn = Infinity;
-int delay = Default_DELAY;
+double delay = 2;
 int displays = 0;  /* indicates unspecified */
 int sel_ret = 0;
 time_t curr_time;
@@ -426,15 +426,16 @@ _Static_assert(sizeof(command_chars) == CMD_toggletid 
break;
  }
 
- case 's':
-   if ((delay = atoi(optarg)) < 0 || (delay == 0 && getuid() != 0))
-   {
-   fprintf(stderr,
-   "%s: warning: seconds delay should be positive -- using 
default\n",
-   myname);
-   delay = Default_DELAY;
-   warnings++;
-   }
+ case 's':
+   delay = strtod(optarg, NULL);
+   if (delay < 0) {
+   fprintf(stderr,
+   "%s: warning: seconds delay 
should be positive -- using default\n",
+   myname);
+   delay = 2;
+   warnings++;
+   }
+
break;
 
  case 'q': /* be quick about it */
@@ -781,7 +782,7 @@ restart:
no_command = true;
if (!interactive)
{
-   sleep(delay);
+   usleep(delay * 1e6);
if (leaveflag) {
end_screen();
exit(0);

Modified: head/usr.bin/top/top.h
==
--- head/usr.bin/top/top.h  Sat Jun  9 23:45:05 2018(r334905)
+++ head/usr.bin/top/top.h  Sun Jun 10 00:02:56 2018(r334906)
@@ -1,18 +1,14 @@
-/*
+/*-
+ * Top - a top users display for Berkeley Unix
+ *
+ * General (global) definitions
  * $FreeBSD$
  */
-/*
- *  Top - a top users display for Berkeley Unix
- *
- *  General (global) definitions
- */
 
 #ifndef TOP_H
 #define TOP_H
 
 #include 
-
-#define Default_DELAY 2
 
 /* Number of lines of header information on the standard screen */
 extern int Header_lines;   /* 7 */
___
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: r334904 - head/sys/fs/nfs

2018-06-09 Thread Rick Macklem
Author: rmacklem
Date: Sat Jun  9 23:38:22 2018
New Revision: 334904
URL: https://svnweb.freebsd.org/changeset/base/334904

Log:
  Delete some macros that are unused.
  
  These macros were added because they were used by the pNFS server last
  year. However, they are no longer used by the pNFS server code and
  might as well be deleted.
  This is a partial reversion of r326735.

Modified:
  head/sys/fs/nfs/nfsport.h

Modified: head/sys/fs/nfs/nfsport.h
==
--- head/sys/fs/nfs/nfsport.h   Sat Jun  9 23:24:08 2018(r334903)
+++ head/sys/fs/nfs/nfsport.h   Sat Jun  9 23:38:22 2018(r334904)
@@ -705,21 +705,6 @@ void nfsrvd_rcv(struct socket *, void *, int);
 #defineNFSUNLOCKLAYOUT(l)  mtx_unlock(&((l)->mtx))
 #defineNFSDDSLOCK()mtx_lock(_dslock_mtx)
 #defineNFSDDSUNLOCK()  mtx_unlock(_dslock_mtx)
-#defineNFSDSCLOCKMUTEXPTR  (_dsclock_mtx)
-#defineNFSDSCLOCK()mtx_lock(_dsclock_mtx)
-#defineNFSDSCUNLOCK()  mtx_unlock(_dsclock_mtx)
-#defineNFSDSRMLOCKMUTEXPTR (_dsrmlock_mtx)
-#defineNFSDSRMLOCK()   mtx_lock(_dsrmlock_mtx)
-#defineNFSDSRMUNLOCK() mtx_unlock(_dsrmlock_mtx)
-#defineNFSDWRPCLOCKMUTEXPTR(_dwrpclock_mtx)
-#defineNFSDWRPCLOCK()  mtx_lock(_dwrpclock_mtx)
-#defineNFSDWRPCUNLOCK()mtx_unlock(_dwrpclock_mtx)
-#defineNFSDSRPCLOCKMUTEXPTR(_dsrpclock_mtx)
-#defineNFSDSRPCLOCK()  mtx_lock(_dsrpclock_mtx)
-#defineNFSDSRPCUNLOCK()mtx_unlock(_dsrpclock_mtx)
-#defineNFSDARPCLOCKMUTEXPTR(_darpclock_mtx)
-#defineNFSDARPCLOCK()  mtx_lock(_darpclock_mtx)
-#defineNFSDARPCUNLOCK()mtx_unlock(_darpclock_mtx)
 
 /*
  * Use these macros to initialize/free a mutex.
___
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: r334864 - head/usr.bin/top

2018-06-09 Thread Eitan Adler
On 9 June 2018 at 16:13, Eitan Adler  wrote:
> On 9 June 2018 at 08:55, Eitan Adler  wrote:
>
 Another issue I just found is that if you start top with -P some columns
 don't show any values:
>
> Thanks to "git bisect" I've narrowed this down to r334822. Patch coming soon.

Fixed in r334903.



-- 
Eitan Adler
Source, Ports, Doc committer
Bugmeister, Ports Security teams
___
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: r334903 - head/usr.bin/top

2018-06-09 Thread Eitan Adler
Author: eadler
Date: Sat Jun  9 23:24:08 2018
New Revision: 334903
URL: https://svnweb.freebsd.org/changeset/base/334903

Log:
  top(1): correctly reset per-cpu counters
  
  I had changed this from a for loop to a memset during an earlier
  cleanup. This change was incorrect so revert it.
  
  While here, clean up
  
  Reported by:  flo

Modified:
  head/usr.bin/top/display.c
  head/usr.bin/top/utils.c

Modified: head/usr.bin/top/display.c
==
--- head/usr.bin/top/display.c  Sat Jun  9 23:14:59 2018(r334902)
+++ head/usr.bin/top/display.c  Sat Jun  9 23:24:08 2018(r334903)
@@ -162,28 +162,23 @@ display_resize(void)
 
 int display_updatecpus(struct statics *statics)
 {
-int *lp;
 int lines;
 int i;
 
 /* call resize to do the dirty work */
 lines = display_resize();
 if (pcpu_stats)
-   num_cpus = statics->ncpus;
+   num_cpus = statics->ncpus;
 else
-   num_cpus = 1;
+   num_cpus = 1;
 cpustates_column = 5;  /* CPU: */
-if (num_cpus != 1)
-cpustates_column += 2; /* CPU 0: */
-for (i = num_cpus; i > 9; i /= 10)
-   cpustates_column++;
+if (num_cpus > 1) {
+   cpustates_column += 1 + digits(num_cpus); /* CPU #: */
+   }
 
 /* fill the "last" array with all -1s, to insure correct updating */
-lp = lcpustates;
-i = num_cpustates * num_cpus;
-while (--i >= 0)
-{
-   *lp++ = -1;
+   for (i = 0; i < num_cpustates * num_cpus; ++i) {
+   lcpustates[i] = -1;
 }
 
 return(lines);
@@ -541,7 +536,9 @@ z_cpustates(void)
 }
 
 /* fill the "last" array with all -1s, to insure correct updating */
-memset(lcpustates, -1, num_cpustates * num_cpus);
+   for (i = 0; i < num_cpustates * num_cpus; ++i) {
+   lcpustates[i] = -1;
+}
 }
 
 /*

Modified: head/usr.bin/top/utils.c
==
--- head/usr.bin/top/utils.cSat Jun  9 23:14:59 2018(r334902)
+++ head/usr.bin/top/utils.cSat Jun  9 23:24:08 2018(r334903)
@@ -134,8 +134,8 @@ digits(int val)
 
 while (val > 0)
 {
-   cnt++;
-   val /= 10;
+   cnt++;
+   val /= 10;
 }
 return(cnt);
 }
___
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: r334902 - head/sys/fs/nfs

2018-06-09 Thread Rick Macklem
Author: rmacklem
Date: Sat Jun  9 23:14:59 2018
New Revision: 334902
URL: https://svnweb.freebsd.org/changeset/base/334902

Log:
  Delete an unused macro and clean up a comment about it.
  
  NFSDEV_MIRRORSTR was defined for the pNFS server, but has not been used,
  so this patch deletes it. It also cleans up the comment and hopefully
  makes it more readable.

Modified:
  head/sys/fs/nfs/nfs.h

Modified: head/sys/fs/nfs/nfs.h
==
--- head/sys/fs/nfs/nfs.h   Sat Jun  9 23:08:02 2018(r334901)
+++ head/sys/fs/nfs/nfs.h   Sat Jun  9 23:14:59 2018(r334902)
@@ -179,13 +179,10 @@ struct nfsd_nfsd_args {
 };
 
 /*
- * NFSDEV_MIRRORSTR - string of digits that number the DSs 0->999.
- * (To support more than 1000 DSs on an MDS, this needs to be increased.)
- * NFSDEV_MAXMIRRORS - Maximum # of mirrors for a DS.
- * (Most will only have a single mirror, but this setting allows up to 3.)
+ * NFSDEV_MAXMIRRORS - Maximum level of mirroring for a DS.
+ * (Most will only put files on two DSs, but this setting allows up to 4.)
  * NFSDEV_MAXVERS - maximum number of NFS versions supported by Flex File.
  */
-#defineNFSDEV_MIRRORSTR3
 #defineNFSDEV_MAXMIRRORS   4
 #defineNFSDEV_MAXVERS  4
 
___
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: r334864 - head/usr.bin/top

2018-06-09 Thread Eitan Adler
On 9 June 2018 at 08:55, Eitan Adler  wrote:

>>> Another issue I just found is that if you start top with -P some columns
>>> don't show any values:

Thanks to "git bisect" I've narrowed this down to r334822. Patch coming soon.




-- 
Eitan Adler
Source, Ports, Doc committer
Bugmeister, Ports Security teams
___
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: r334901 - head/usr.bin/top

2018-06-09 Thread Eitan Adler
Author: eadler
Date: Sat Jun  9 23:08:02 2018
New Revision: 334901
URL: https://svnweb.freebsd.org/changeset/base/334901

Log:
  top(1): handle specific pids better
  
  When told to watch a specific pid, don't filter idle, system, or self
  processes. The summary at the top will still flip correctly though.

Modified:
  head/usr.bin/top/machine.c
  head/usr.bin/top/top.c

Modified: head/usr.bin/top/machine.c
==
--- head/usr.bin/top/machine.c  Sat Jun  9 23:07:32 2018(r334900)
+++ head/usr.bin/top/machine.c  Sat Jun  9 23:08:02 2018(r334901)
@@ -841,11 +841,11 @@ get_process_info(struct system_info *si, struct proces
/* not in use */
continue;
 
-   if (!sel->self && pp->ki_pid == mypid)
+   if (!sel->self && pp->ki_pid == mypid && sel->pid == -1)
/* skip self */
continue;
 
-   if (!sel->system && (pp->ki_flag & P_SYSTEM))
+   if (!sel->system && (pp->ki_flag & P_SYSTEM) && sel->pid == -1)
/* skip system process */
continue;
 
@@ -861,7 +861,7 @@ get_process_info(struct system_info *si, struct proces
/* skip zombies */
continue;
 
-   if (!sel->kidle && pp->ki_tdflags & TDF_IDLETD)
+   if (!sel->kidle && pp->ki_tdflags & TDF_IDLETD && sel->pid == 
-1)
/* skip kernel idle process */
continue;
 

Modified: head/usr.bin/top/top.c
==
--- head/usr.bin/top/top.c  Sat Jun  9 23:07:32 2018(r334900)
+++ head/usr.bin/top/top.c  Sat Jun  9 23:08:02 2018(r334901)
@@ -259,7 +259,6 @@ main(int argc, char *argv[])
 char *order_name = NULL;
 int order_index = 0;
 fd_set readfds;
-char old_system = false;
 
 static const char command_chars[] = "\f qh?en#sdkriIutHmSCajzPJwopT";
 /* these defines enumerate the "strchr"s of the commands in command_chars */
@@ -381,7 +380,6 @@ _Static_assert(sizeof(command_chars) == CMD_toggletid 
 
  case 'S': /* show system processes */
ps.system = true;
-   old_system = true;
break;
 
  case 'I':   /* show idle processes */
@@ -1086,7 +1084,6 @@ restart:
break;
case CMD_viewsys:
ps.system = !ps.system;
-   old_system = ps.system;
break;
case CMD_showargs:
fmt_flags ^= FMT_SHOWARGS;
@@ -1193,7 +1190,6 @@ restart:
if (tempbuf2[0] == '+' &&
tempbuf2[1] == '\0') {
ps.pid = (pid_t)-1;
-   ps.system = old_system;
} else {
unsigned long long num;
const char *errstr;
@@ -1206,10 +1202,7 @@ restart:
tempbuf2);
no_command = true;
} else {
-   if (ps.system == false)
-   old_system = 
false;
ps.pid = (pid_t)num;
-   ps.system = true;
}
}
putchar('\r');
___
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: r334899 - head/usr.bin/top

2018-06-09 Thread Eitan Adler
Author: eadler
Date: Sat Jun  9 22:30:10 2018
New Revision: 334899
URL: https://svnweb.freebsd.org/changeset/base/334899

Log:
  top(1): implement additional missing long options

Modified:
  head/usr.bin/top/top.c

Modified: head/usr.bin/top/top.c
==
--- head/usr.bin/top/top.c  Sat Jun  9 21:40:33 2018(r334898)
+++ head/usr.bin/top/top.c  Sat Jun  9 22:30:10 2018(r334899)
@@ -87,12 +87,13 @@ static void (*d_process)(int line, char *thisline) = i
 
 static void reset_display(void);
 
-
 static const struct option longopts[] = {
 { "cpu-display-mode", no_argument, NULL, 'C' }, /* differs from orignal */
 /* D reserved */
 { "thread", no_argument, NULL, 'H' },
 { "idle-procs", no_argument, NULL, 'I' },
+   { "jail", required_argument, NULL, 'J' },
+   { "per-cpu", no_argument, NULL, 'P' },
 { "system-procs", no_argument, NULL, 'S' },
 { "thread-id", no_argument, NULL, 'T' }, /* differs from orignal */
 { "user", required_argument, NULL, 'U' },
@@ -111,6 +112,7 @@ static const struct option longopts[] = {
 { "threads", no_argument, NULL, 't' },
 { "uids", no_argument, NULL, 'u' },
 { "version", no_argument, NULL, 'v' },
+   { "swap", no_argument, NULL, 'w' },
{ "system-idle-procs", no_argument, NULL, 'z' }
 };
 
___
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: r334898 - head/usr.bin/top

2018-06-09 Thread Eitan Adler
Author: eadler
Date: Sat Jun  9 21:40:33 2018
New Revision: 334898
URL: https://svnweb.freebsd.org/changeset/base/334898

Log:
  top(1): initial pass to freebsdize the man page
  
  The previous man page used many conventions not typical in FreeBSD.
  Since we've forked top completely, convert the man page too.

Modified:
  head/usr.bin/top/top.1

Modified: head/usr.bin/top/top.1
==
--- head/usr.bin/top/top.1  Sat Jun  9 21:40:24 2018(r334897)
+++ head/usr.bin/top/top.1  Sat Jun  9 21:40:33 2018(r334898)
@@ -1,390 +1,311 @@
 .\" $FreeBSD$
-.nr N -1
-.nr D 2
-.TH TOP 1 Local
-.UC 4
-.SH NAME
-top \- display and update information about the top cpu processes
-.SH SYNOPSIS
-.B top
-[
-.B \-abCHIijnPqStuvwz
-] [
-.BI \-d count
-] [
-.BI \-m io | cpu
-] [
-.BI \-o field
-]
-.br
-.ti +4
-[
-.BI \-p pid
-] [
-.BI \-s time
-] [
-.BI \-J jail
-] [
-.BI \-U username
-] [
-.I number
-]
-.SH DESCRIPTION
-.\" This defines appropriate quote strings for nroff and troff
-.ds lq \&"
-.ds rq \&"
-.if t .ds lq ``
-.if t .ds rq ''
-.\" Just in case these number registers aren't set yet...
-.if \nN==0 .nr N 10
-.if \nD==0 .nr D 2
-.I Top
+.Dd June 9, 2018
+.Dt TOP 1
+.Os
+.Sh NAME
+.Nm top
+.Nd display and update information about the top cpu processes
+.Sh SYNOPSIS
+.Nm
+.Op Fl CHIPSTabijnpqtuvxz
+.Op Fl J Ar jail
+.Op Fl U Ar uid
+.Op Fl d Ar count
+.Op Fl m Ar cpu|io
+.Op Fl s Ar time
+.Op Fl o Ar field
+.Op Fl p Ar pid
+.Op Ar count
+.Sh DESCRIPTION
+.Nm
 displays the top
-.if !\nN==-1 \nN
 processes on the system and periodically updates this information.
-.if \nN==-1 \
-\{\
 If standard output is an intelligent terminal (see below) then
 as many processes as will fit on the terminal screen are displayed
-by default.  Otherwise, a good number of them are shown (around 20).
-.\}
-Raw cpu percentage is used to rank the processes.  If
-.I number
+by default.
+Otherwise, a good number of them are shown (around 20).
+Raw cpu percentage is used to rank the processes.
+If
+.Ar number
 is given, then the top
-.I number
+.Ar number
 processes will be displayed instead of the default.
-.PP
-.I Top
+.Pp
+.Nm
 makes a distinction between terminals that support advanced capabilities
-and those that do not.  This
-distinction affects the choice of defaults for certain options.  In the
-remainder of this document, an \*(lqintelligent\*(rq terminal is one that
+and those that do not.
+This distinction affects the choice of defaults for certain options.
+In the remainder of this document, an \*(lqintelligent\*(rq terminal is one 
that
 supports cursor addressing, clear screen, and clear to end of line.
 Conversely, a \*(lqdumb\*(rq terminal is one that does not support such
-features.  If the output of
-.I top
+features.
+If the output of
+.Nm
 is redirected to a file, it acts as if it were being run on a dumb
 terminal.
-.SH OPTIONS
-.TP
-.B \-C
+.Bl -tag -width indent -compact
+.It Fl C
 Toggle CPU display mode.
 By default top displays the weighted CPU percentage in the WCPU column
 (this is the same value that
-.IR ps (1)
+.Xr ps 1
 displays as CPU).
 Each time
-.B \-C
+.It Fl C
 flag is passed it toggles between \*(lqraw cpu\*(rq mode
 and \*(lqweighted cpu\*(rq mode, showing the \*(lqCPU\*(rq or
 the \*(lqWCPU\*(rq column respectively.
-.TP
-.B \-S
-Show system processes in the display.  Normally, system processes such as
-the pager and the swapper are not shown.  This option makes them visible.
-.TP
-.B \-a
+.It Fl S
+Show system processes in the display.
+Normally, system processes such as the pager and the swapper are not shown.
+This option makes them visible.
+.It Fl a
 Display command names derived from the argv[] vector, rather than real
-executable name. It's useful when you want to watch applications, that
-puts their status information there. If the real name differs from argv[0],
+executable name.
+It it useful when you want to watch applications, that
+puts their status information there.
+If the real name differs from argv[0],
 it will be displayed in parenthesis.
-.TP
-.B \-b
-Use \*(lqbatch\*(rq mode.  In this mode, all input from the terminal is
-ignored.  Interrupt characters (such as ^C and ^\e) still have an effect.
+.It Fl b
+Use \*(lqbatch\*(rq mode.
+In this mode, all input from the terminal is
+ignored.
+Interrupt characters (such as ^C and ^\e) still have an effect.
 This is the default on a dumb terminal, or when the output is not a terminal.
-.TP
-.B \-H
+.It Fl H
 Display each thread for a multithreaded process individually.
 By default a single summary line is displayed for each process.
-.TP
-.B \-i
-Use \*(lqinteractive\*(rq mode.  In this mode, any input is immediately
-read for processing.  See the section on \*(lqInteractive Mode\*(rq
+.It Fl i
+Use \*(lqinteractive\*(rq mode.
+In this mode, any input is immediately
+read for processing.
+See the section on \*(lqInteractive Mode\*(rq
 for an 

svn commit: r334897 - head/usr.bin/top

2018-06-09 Thread Eitan Adler
Author: eadler
Date: Sat Jun  9 21:40:24 2018
New Revision: 334897
URL: https://svnweb.freebsd.org/changeset/base/334897

Log:
  top(1): Implement long options
  
  This also documents some reserved or differing options from top's
  original upstream.

Modified:
  head/usr.bin/top/top.c

Modified: head/usr.bin/top/top.c
==
--- head/usr.bin/top/top.c  Sat Jun  9 21:09:24 2018(r334896)
+++ head/usr.bin/top/top.c  Sat Jun  9 21:40:24 2018(r334897)
@@ -21,6 +21,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -86,6 +87,33 @@ static void (*d_process)(int line, char *thisline) = i
 
 static void reset_display(void);
 
+
+static const struct option longopts[] = {
+{ "cpu-display-mode", no_argument, NULL, 'C' }, /* differs from orignal */
+/* D reserved */
+{ "thread", no_argument, NULL, 'H' },
+{ "idle-procs", no_argument, NULL, 'I' },
+{ "system-procs", no_argument, NULL, 'S' },
+{ "thread-id", no_argument, NULL, 'T' }, /* differs from orignal */
+{ "user", required_argument, NULL, 'U' },
+{ "all", no_argument, NULL, 'a' },
+{ "batch", no_argument, NULL, 'b' },
+/* c reserved */
+{ "displays", required_argument, NULL, 'd' },
+{ "interactive", no_argument, NULL, 'i' },
+{ "jail-id", no_argument, NULL, 'j' },
+{ "display-mode", required_argument, NULL, 'm' },
+/* n is identical to batch */
+{ "sort-order", required_argument, NULL, 'o' },
+{ "pid", required_argument, NULL, 'p' },
+{ "quick", no_argument, NULL, 'q' },
+{ "delay", required_argument, NULL, 's' },
+{ "threads", no_argument, NULL, 't' },
+{ "uids", no_argument, NULL, 'u' },
+{ "version", no_argument, NULL, 'v' },
+   { "system-idle-procs", no_argument, NULL, 'z' }
+};
+
 static void
 reset_uids(void)
 {
@@ -328,7 +356,7 @@ _Static_assert(sizeof(command_chars) == CMD_toggletid 
optind = 1;
}
 
-   while ((i = getopt(ac, av, "CSIHPabijJ:nquvzs:d:U:m:o:p:Ttw")) != EOF)
+   while ((i = getopt_long(ac, av, "CSIHPabijJ:nquvzs:d:U:m:o:p:Ttw", 
longopts, NULL)) != EOF)
{
switch(i)
{
___
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: r334883 - head/cddl/contrib/opensolaris/tools/ctf/cvt

2018-06-09 Thread O. Hartmann
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

Am Sat, 9 Jun 2018 16:02:16 -0400
Mark Johnston  schrieb:

> On Sat, Jun 09, 2018 at 08:37:14PM +0200, O. Hartmann wrote:
> > I started on one of the faster boxes with a make cleanworld and tried then 
> > to rebuild
> > world and kernel. It ends up at the very same error for me.  
> 
> I believe r334892 will fix the problem, please give it a try. Sorry for
> the breakage.
> ___
> 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"

Your believe seems right.

Thanks,

oh

- -- 
O. Hartmann

Ich widerspreche der Nutzung oder Übermittlung meiner Daten für
Werbezwecke oder für die Markt- oder Meinungsforschung (§ 28 Abs. 4 BDSG).
-BEGIN PGP SIGNATURE-

iLUEARMKAB0WIQQZVZMzAtwC2T/86TrS528fyFhYlAUCWxxCyAAKCRDS528fyFhY
lBCCAgCi3yARIm3ncQM0etwCyPaBvcPqdjXcwfhPPgWryL8BcqDHo0b2usAEgis9
WW7yr1Rf0Kz7itEKpYPH+c7+myDZAf0bjWfa3N3c4PVQ61RGEddN4iPKEqkxz5+H
Y9ZnLX563xv6Ph4Wm1c/hQLAHbq+d37kZUSx2Y5acDvSus5quH8x
=3mEI
-END PGP SIGNATURE-
___
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: r334896 - head/usr.bin/diff

2018-06-09 Thread Baptiste Daroussin
Author: bapt
Date: Sat Jun  9 21:09:24 2018
New Revision: 334896
URL: https://svnweb.freebsd.org/changeset/base/334896

Log:
  diff: Import fixes from OpenBSD
  
  original commit log by miller@OpenBSD  r1.46:
  Fix exit value when diffing directories with missing files and the -N
  or -P options are not used.  From Ibrahim Khalifa

Modified:
  head/usr.bin/diff/diffdir.c

Modified: head/usr.bin/diff/diffdir.c
==
--- head/usr.bin/diff/diffdir.c Sat Jun  9 21:05:25 2018(r334895)
+++ head/usr.bin/diff/diffdir.c Sat Jun  9 21:09:24 2018(r334896)
@@ -58,7 +58,7 @@ diffdir(char *p1, char *p2, int flags)
dirlen1 = strlcpy(path1, *p1 ? p1 : ".", sizeof(path1));
if (dirlen1 >= sizeof(path1) - 1) {
warnc(ENAMETOOLONG, "%s", p1);
-   status = 2;
+   status |= 2;
return;
}
if (path1[dirlen1 - 1] != '/') {
@@ -68,7 +68,7 @@ diffdir(char *p1, char *p2, int flags)
dirlen2 = strlcpy(path2, *p2 ? p2 : ".", sizeof(path2));
if (dirlen2 >= sizeof(path2) - 1) {
warnc(ENAMETOOLONG, "%s", p2);
-   status = 2;
+   status |= 2;
return;
}
if (path2[dirlen2 - 1] != '/') {
@@ -131,12 +131,12 @@ diffdir(char *p1, char *p2, int flags)
dp2++;
} else if (pos < 0) {
/* file only in first dir, only diff if -N */
-   if (Nflag)
+   if (Nflag) {
diffit(dent1, path1, dirlen1, path2, dirlen2,
flags);
-   else {
+   } else {
print_only(path1, dirlen1, dent1->d_name);
-   status = 1;
+   status |= 1;
}
dp1++;
} else {
@@ -146,7 +146,7 @@ diffdir(char *p1, char *p2, int flags)
flags);
else {
print_only(path2, dirlen2, dent2->d_name);
-   status = 1;
+   status |= 1;
}
dp2++;
}
___
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: r334895 - head/usr.bin/calendar/calendars

2018-06-09 Thread Guangyuan Yang
Author: ygy (doc committer)
Date: Sat Jun  9 21:05:25 2018
New Revision: 334895
URL: https://svnweb.freebsd.org/changeset/base/334895

Log:
  Add myself to the calendar
  
  Requested by: mckusick
  Reviewed by:  emaste

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdSat Jun  9 20:24:17 
2018(r334894)
+++ head/usr.bin/calendar/calendars/calendar.freebsdSat Jun  9 21:05:25 
2018(r334895)
@@ -17,6 +17,7 @@
 01/06  Philippe Audeoud  born in Bretigny-Sur-Orge, 
France, 1980
 01/08  Michael L. Hostbaek  born in Copenhagen, Denmark, 1977
 01/10  Jean-Yves Lefort  born in Charleroi, Belgium, 1980
+01/10  Guangyuan Yang  born in Yangzhou, Jiangsu, People's 
Republic of China, 1997
 01/12  Yen-Ming Lee  born in Taipei, Taiwan, Republic of 
China, 1977
 01/12  Ying-Chieh Liao  born in Taipei, Taiwan, Republic 
of China, 1979
 01/12  Kristof Provost  born in Aalst, Belgium, 1983
___
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: r334894 - head/usr.bin/diff

2018-06-09 Thread Baptiste Daroussin
Author: bapt
Date: Sat Jun  9 20:24:17 2018
New Revision: 334894
URL: https://svnweb.freebsd.org/changeset/base/334894

Log:
  Isolate the pr(1) related code in its own source files
  
  This keeps diffreg.c closer to what it is supposed to do:
  diffing regular files.
  
  It also allows my code to get a proper license

Added:
  head/usr.bin/diff/pr.c   (contents, props changed)
  head/usr.bin/diff/pr.h   (contents, props changed)
Modified:
  head/usr.bin/diff/Makefile
  head/usr.bin/diff/diffreg.c

Modified: head/usr.bin/diff/Makefile
==
--- head/usr.bin/diff/Makefile  Sat Jun  9 20:06:06 2018(r334893)
+++ head/usr.bin/diff/Makefile  Sat Jun  9 20:24:17 2018(r334894)
@@ -3,7 +3,7 @@
 .include 
 
 PROG=  diff
-SRCS=  diff.c diffdir.c diffreg.c xmalloc.c
+SRCS=  diff.c diffdir.c diffreg.c xmalloc.c pr.c
 
 HAS_TESTS=
 SUBDIR.${MK_TESTS}+= tests

Modified: head/usr.bin/diff/diffreg.c
==
--- head/usr.bin/diff/diffreg.c Sat Jun  9 20:06:06 2018(r334893)
+++ head/usr.bin/diff/diffreg.c Sat Jun  9 20:24:17 2018(r334894)
@@ -70,11 +70,7 @@
 __FBSDID("$FreeBSD$");
 
 #include 
-#include 
 #include 
-#include 
-#include 
-#include 
 
 #include 
 #include 
@@ -88,15 +84,11 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
-#include 
-#include 
 
+#include "pr.h"
 #include "diff.h"
 #include "xmalloc.h"
 
-#define _PATH_PR "/usr/bin/pr"
-
 /*
  * diff - compare two files.
  */
@@ -260,13 +252,9 @@ diffreg(char *file1, char *file2, int flags, int capsi
 {
FILE *f1, *f2;
int i, rval;
-   int ostdout = -1;
-   int pr_pd, kq;
-   struct kevent *e;
+   struct pr *pr = NULL;
cap_rights_t rights_ro;
 
-   e = NULL;
-   kq = -1;
f1 = f2 = NULL;
rval = D_SAME;
anychange = 0;
@@ -324,53 +312,9 @@ diffreg(char *file1, char *file2, int flags, int capsi
goto closem;
}
 
-   if (lflag) {
-   /* redirect stdout to pr */
-   int  pfd[2];
-   pid_t   pid;
-   char*header;
+   if (lflag)
+   pr = start_pr(file1, file2);
 
-   xasprintf(, "%s %s %s", diffargs, file1, file2);
-   signal(SIGPIPE, SIG_IGN);
-   fflush(stdout);
-   rewind(stdout);
-   pipe(pfd);
-   switch ((pid = pdfork(_pd, PD_CLOEXEC))) {
-   case -1:
-   status |= 2;
-   free(header);
-   err(2, "No more processes");
-   case 0:
-   /* child */
-   if (pfd[0] != STDIN_FILENO) {
-   dup2(pfd[0], STDIN_FILENO);
-   close(pfd[0]);
-   }
-   close(pfd[1]);
-   execl(_PATH_PR, _PATH_PR, "-h", header, (char *)0);
-   _exit(127);
-   default:
-
-   /* parent */
-   if (pfd[1] != STDOUT_FILENO) {
-   ostdout = dup(STDOUT_FILENO);
-   dup2(pfd[1], STDOUT_FILENO);
-   close(pfd[1]);
-   }
-   close(pfd[0]);
-   rewind(stdout);
-   free(header);
-   kq = kqueue();
-   if (kq == -1)
-   err(2, "kqueue");
-   e = xmalloc(sizeof(struct kevent));
-   EV_SET(e, pr_pd, EVFILT_PROCDESC, EV_ADD, NOTE_EXIT, 0,
-   NULL);
-   if (kevent(kq, e, 1, NULL, 0, NULL) == -1)
-   err(2, "kevent");
-   }
-   }
-
if (capsicum) {
cap_rights_init(_ro, CAP_READ, CAP_FSTAT, CAP_SEEK);
if (cap_rights_limit(fileno(f1), _ro) < 0
@@ -443,26 +387,8 @@ diffreg(char *file1, char *file2, int flags, int capsi
ixnew = xreallocarray(ixnew, len[1] + 2, sizeof(*ixnew));
check(f1, f2, flags);
output(file1, f1, file2, f2, flags);
-   if (ostdout != -1 && e != NULL) {
-   /* close the pipe to pr and restore stdout */
-   int wstatus;
-
-   fflush(stdout);
-   if (ostdout != STDOUT_FILENO) {
-   close(STDOUT_FILENO);
-   dup2(ostdout, STDOUT_FILENO);
-   close(ostdout);
-   }
-   if (kevent(kq, NULL, 0, e, 1, NULL) == -1)
-   err(2, "kevent");
-   wstatus = e[0].data;
-   close(kq);
-   if (WIFEXITED(wstatus) && WEXITSTATUS(wstatus) != 0)
-   

svn commit: r334893 - head/usr.bin/top

2018-06-09 Thread Eitan Adler
Author: eadler
Date: Sat Jun  9 20:06:06 2018
New Revision: 334893
URL: https://svnweb.freebsd.org/changeset/base/334893

Log:
  top(1): allow starting with -T flag

Modified:
  head/usr.bin/top/top.c

Modified: head/usr.bin/top/top.c
==
--- head/usr.bin/top/top.c  Sat Jun  9 20:01:03 2018(r334892)
+++ head/usr.bin/top/top.c  Sat Jun  9 20:06:06 2018(r334893)
@@ -328,7 +328,7 @@ _Static_assert(sizeof(command_chars) == CMD_toggletid 
optind = 1;
}
 
-   while ((i = getopt(ac, av, "CSIHPabijJ:nquvzs:d:U:m:o:p:tw")) != EOF)
+   while ((i = getopt(ac, av, "CSIHPabijJ:nquvzs:d:U:m:o:p:Ttw")) != EOF)
{
switch(i)
{
___
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: r334883 - head/cddl/contrib/opensolaris/tools/ctf/cvt

2018-06-09 Thread Mark Johnston
On Sat, Jun 09, 2018 at 08:37:14PM +0200, O. Hartmann wrote:
> I started on one of the faster boxes with a make cleanworld and tried then to 
> rebuild
> world and kernel. It ends up at the very same error for me.

I believe r334892 will fix the problem, please give it a try. Sorry for
the breakage.
___
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: r334892 - in head: . sys/sys

2018-06-09 Thread Mark Johnston
Author: markj
Date: Sat Jun  9 20:01:03 2018
New Revision: 334892
URL: https://svnweb.freebsd.org/changeset/base/334892

Log:
  Bump __FreeBSD_version after r334881 and force libdwarf to be rebuilt.
  
  Reported by:  O. Hartmann 
  Reviewed by:  bdrewery

Modified:
  head/Makefile.inc1
  head/sys/sys/param.h

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Sat Jun  9 19:51:09 2018(r334891)
+++ head/Makefile.inc1  Sat Jun  9 20:01:03 2018(r334892)
@@ -1843,7 +1843,8 @@ update: .PHONY
 # ELF Tool Chain libraries are needed for ELF tools and dtrace tools.
 # r296685 fix cross-endian objcopy
 # r310724 fixed PR 215350, a crash in libdwarf with objects built by GCC 6.2.
-.if ${BOOTSTRAPPING} < 1200020
+# r334881 added libdwarf constants used by ctfconvert.
+.if ${BOOTSTRAPPING} < 1200067
 _elftoolchain_libs= lib/libelf lib/libdwarf
 .endif
 

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hSat Jun  9 19:51:09 2018(r334891)
+++ head/sys/sys/param.hSat Jun  9 20:01:03 2018(r334892)
@@ -60,7 +60,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1200066  /* Master, propagated to newvers */
+#define __FreeBSD_version 1200067  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
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: r334891 - head/stand/lua

2018-06-09 Thread Kyle Evans
Author: kevans
Date: Sat Jun  9 19:51:09 2018
New Revision: 334891
URL: https://svnweb.freebsd.org/changeset/base/334891

Log:
  lualoader: Add cli.lua(8) to the tree
  
  Reviewed by:  rpokala
  Differential Revision:https://reviews.freebsd.org/D14818

Added:
  head/stand/lua/cli.lua.8   (contents, props changed)

Added: head/stand/lua/cli.lua.8
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/stand/lua/cli.lua.8Sat Jun  9 19:51:09 2018(r334891)
@@ -0,0 +1,112 @@
+.\"
+.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+.\"
+.\" Copyright (c) 2018 Kyle Evans 
+.\"
+.\" 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd June 9, 2018
+.Dt CLI.LUA 8
+.Os
+.Sh NAME
+.Nm cli.lua
+.Nd FreeBSD Lua CLI module
+.Sh DESCRIPTION
+.Nm
+contains the main functionality required to add new CLI commands, which can be
+executed at the loader prompt.
+.Pp
+Before hooking into the functionality provided by
+.Nm ,
+it must be included with a statement such as the following:
+.Pp
+.Dl local cli = require("cli")
+.Ss Adding new commands
+New loader commands may be created by adding functions to the object returned 
by
+requiring the
+.Nm
+module.
+.Pp
+For instance:
+.Pp
+.Bd -literal -offset indent -compact
+local cli = require("cli")
+
+cli.foo = function(...)
+   -- Expand args to command name and the rest of argv.  These arguments
+   -- are pushed directly to the stack by loader, then handed off to
+   -- cli_execute.  cli_execute then passes them on to the invoked
+   -- function, where they appear as varargs that must be peeled apart into
+   -- their respective components.
+   local _, argv = cli.arguments(...)
+
+   print("This is the foo command!")
+   for k, v in ipairs(argv) do
+   print("arg #" .. tostring(k) .. ": '" .. v .. "'")
+   end
+   -- Perform a loader command directly.  This will not get dispatched back
+   -- to Lua, so it is acceptable to have a function of the exact same name
+   -- in loader.  Lua will have the first chance to handle any commands
+   -- executed at the loader prompt.
+   loader.perform("foo")
+end
+.Ed
+.Pp
+This function may be invoked by a user at the loader prompt by simply typing
+.Ic foo .
+Arguments may be passed to it as usual, space-delimited.
+.Ss Default Commands
+As of present, the
+.Nm
+module by default provides commands for
+.Ic autoboot
+and
+.Ic boot .
+In both cases, the
+.Xr core.lua 8
+module will load all ELF modules as-needed before executing the equivalent
+built-in loader commands.
+All non-kernel arguments to these commands are passed in the same order to the
+loader command.
+.Ss Exported Functions
+The following functions are exported from
+.Nm :
+.Bl -tag -width cli.arguments -offset indent
+.It Fn cli.arguments ...
+Takes varargs passed on the stack from
+.Xr loader 8
+to
+.Ic cli_execute ,
+splits them out into two return values: the command name, traditionally 
argv[0],
+and the rest of argv.
+.El
+.Sh SEE ALSO
+.Xr loader.conf 5 ,
+.Xr core.lua 8 ,
+.Xr loader 8
+.Sh AUTHORS
+The
+.Nm
+file was originally written by
+.An Kyle Evans Aq Mt kev...@freebsd.org .
___
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: r334883 - head/cddl/contrib/opensolaris/tools/ctf/cvt

2018-06-09 Thread O. Hartmann
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

Am Sat, 9 Jun 2018 14:02:37 -0400
Mark Johnston  schrieb:

> On Sat, Jun 09, 2018 at 01:56:18PM -0400, Bryan Drewery wrote:
> > On 6/9/18 1:39 PM, Mark Johnston wrote:  
> > > On Sat, Jun 09, 2018 at 07:35:00PM +0200, O. Hartmann wrote:  
> > >> -BEGIN PGP SIGNED MESSAGE-
> > >> Hash: SHA512
> > >>
> > >> Am Sat, 9 Jun 2018 15:10:49 + (UTC)
> > >> Mark Johnston  schrieb:
> > >>  
> > >>> Author: markj
> > >>> Date: Sat Jun  9 15:10:49 2018
> > >>> New Revision: 334883
> > >>> URL: https://svnweb.freebsd.org/changeset/base/334883
> > >>>
> > >>> Log:
> > >>>   Don't process DWARF generated from non-C/C++ code.
> > >>>   
> > >>>   ctfconvert(1) is not designed to handle DWARF generated from such 
> > >>> code,
> > >>>   and will generally fail in non-obvious ways.  Use an explicit check to
> > >>>   help catch such potential failures.
> > >>>   
> > >>>   Reported by:  Johannes Lundberg 
> > >>>   MFC after:2 weeks
> > >>>
> > >>> Modified:
> > >>>   head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
> > >>>
> > >>> Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
> > >>> ==
> > >>> --- head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Sat Jun  9 
> > >>> 15:10:39
> > >>> 2018(r334882) +++ 
> > >>> head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
> > >>> Sat Jun  9 15:10:49 2018(r334883) @@ -1901,7 +1901,7 @@
> > >>> should_have_dwarf(Elf *elf) int
> > >>>  dw_read(tdata_t *td, Elf *elf, char *filename __unused)
> > >>>  {
> > >>> -   Dwarf_Unsigned abboff, hdrlen, nxthdr;
> > >>> +   Dwarf_Unsigned abboff, hdrlen, lang, nxthdr;
> > >>> Dwarf_Half vers, addrsz, offsz;
> > >>> Dwarf_Die cu = 0;
> > >>> Dwarf_Die child = 0;
> > >>> @@ -1941,8 +1941,8 @@ dw_read(tdata_t *td, Elf *elf, char *filename 
> > >>> __unused
> > >>> }
> > >>>  
> > >>> if ((rc = dwarf_next_cu_header_b(dw.dw_dw, , , 
> > >>> ,
> > >>> -   , , NULL, , _err)) != 
> > >>> DW_DLV_OK) {
> > >>> -   if (dw.dw_err.err_error ==  DW_DLE_NO_ENTRY)
> > >>> +   , , NULL, , _err)) != DW_DLV_OK) {
> > >>> +   if (dw.dw_err.err_error == DW_DLE_NO_ENTRY)
> > >>> exit(0);
> > >>> else
> > >>> terminate("rc = %d %s\n", rc, 
> > >>> dwarf_errmsg(dw.dw_err));
> > >>> @@ -1971,6 +1971,25 @@ dw_read(tdata_t *td, Elf *elf, char *filename 
> > >>> __unused
> > >>> debug(1, "DWARF emitter: %s\n", prod);
> > >>> free(prod);
> > >>> }
> > >>> +
> > >>> +   if (dwarf_attrval_unsigned(cu, DW_AT_language, , 
> > >>> _err) == 0)
> > >>> +   switch (lang) {
> > >>> +   case DW_LANG_C:
> > >>> +   case DW_LANG_C89:
> > >>> +   case DW_LANG_C99:
> > >>> +   case DW_LANG_C11:
> > >>> +   case DW_LANG_C_plus_plus:
> > >>> +   case DW_LANG_C_plus_plus_03:
> > >>> +   case DW_LANG_C_plus_plus_11:
> > >>> +   case DW_LANG_C_plus_plus_14:
> > >>> +   break;
> > >>> +   default:
> > >>> +   terminate("file contains DWARF for unsupported "
> > >>> +   "language %d", lang);
> > >>> +   }
> > >>> +   else
> > >>> +   warning("die %llu: failed to get language attribute: 
> > >>> %s\n",
> > >>> +   die_off(, cu), dwarf_errmsg(dw.dw_err));
> > >>>  
> > >>> if ((dw.dw_cuname = die_name(, cu)) != NULL) {
> > >>> char *base = xstrdup(basename(dw.dw_cuname));
> > >>> ___
> > >>> 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" 
> > >>>  
> > >> This commit makes buildworld (WITH_META_MODE) failing:  
> > > 
> > > I added these identifiers in r334881, and the CI build is passing. Might
> > > this be a problem with META_MODE?
> > >   
> > >> [...]  
> > >> ===> cddl/usr.bin/ctfconvert (obj,all,install)  
> > >> Building 
> > >> /usr/obj/usr/src/amd64.amd64/tmp/obj-tools/cddl/usr.bin/ctfconvert/dwarf.o
> > >>   
> > 
> > obj-tools means it is trying to build a HOST NATIVE version of this.
> > Where are these defined? In this case they need to be defined in
> > /usr/include already unless the build has -I.CURDIR/somewhere/to/headers
> > instead.  
> 
> The definitions are in contrib/elftoolchain/libdwarf/dwarf.h. Indeed,
> the ctfconvert makefile doesn't explicitly add libdwarf to the include
> path. I'm surprised that this is necessary though - do I need to modify
> the BOOTSTRAPPING check for _elftoolchain_libs in Makefile.inc1?
> ___
> 

svn commit: r334890 - in head/sys: amd64/include i386/include

2018-06-09 Thread Mark Johnston
Author: markj
Date: Sat Jun  9 18:31:19 2018
New Revision: 334890
URL: https://svnweb.freebsd.org/changeset/base/334890

Log:
  Tell the compiler that rdtscp clobbers %ecx.

Modified:
  head/sys/amd64/include/cpufunc.h
  head/sys/i386/include/cpufunc.h

Modified: head/sys/amd64/include/cpufunc.h
==
--- head/sys/amd64/include/cpufunc.hSat Jun  9 18:11:46 2018
(r334889)
+++ head/sys/amd64/include/cpufunc.hSat Jun  9 18:31:19 2018
(r334890)
@@ -391,7 +391,7 @@ rdtscp(void)
 {
uint32_t low, high;
 
-   __asm __volatile("rdtscp" : "=a" (low), "=d" (high));
+   __asm __volatile("rdtscp" : "=a" (low), "=d" (high) : : "ecx");
return (low | ((uint64_t)high << 32));
 }
 

Modified: head/sys/i386/include/cpufunc.h
==
--- head/sys/i386/include/cpufunc.h Sat Jun  9 18:11:46 2018
(r334889)
+++ head/sys/i386/include/cpufunc.h Sat Jun  9 18:31:19 2018
(r334890)
@@ -373,7 +373,7 @@ rdtscp(void)
 {
uint64_t rv;
 
-   __asm __volatile("rdtscp" : "=A" (rv));
+   __asm __volatile("rdtscp" : "=A" (rv) : : "ecx");
return (rv);
 }
 
___
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: r334889 - head/usr.bin/grep

2018-06-09 Thread Kyle Evans
Author: kevans
Date: Sat Jun  9 18:11:46 2018
New Revision: 334889
URL: https://svnweb.freebsd.org/changeset/base/334889

Log:
  bsdgrep(1): Some more int -> bool conversions and name changes
  
  Again motivated by upcoming work to rewrite a bunch of this- single-letter
  variable names and slightly misleading variable names ("lastmatches" to
  indicate that the last matched) are not helpful.

Modified:
  head/usr.bin/grep/util.c

Modified: head/usr.bin/grep/util.c
==
--- head/usr.bin/grep/util.cSat Jun  9 17:49:43 2018(r334888)
+++ head/usr.bin/grep/util.cSat Jun  9 18:11:46 2018(r334889)
@@ -74,7 +74,7 @@ static bool procmatches(struct mprintc *mc, struct par
 static int litexec(const struct pat *pat, const char *string,
 size_t nmatch, regmatch_t pmatch[]);
 #endif
-static int procline(struct parsec *pc);
+static bool procline(struct parsec *pc);
 static void printline(struct parsec *pc, int sep);
 static void printline_metadata(struct str *line, int sep);
 
@@ -210,7 +210,7 @@ procmatch_match(struct mprintc *mc, struct parsec *pc)
while (pc->matchidx >= MAX_MATCHES) {
/* Reset matchidx and try again */
pc->matchidx = 0;
-   if (procline(pc) == 0)
+   if (procline(pc))
printline(pc, ':');
else
break;
@@ -283,7 +283,8 @@ procfile(const char *fn)
struct file *f;
struct stat sb;
mode_t s;
-   int lines, t;
+   int lines;
+   bool line_matched;
 
if (strcmp(fn, "-") == 0) {
fn = label != NULL ? label : errstr[1];
@@ -316,6 +317,7 @@ procfile(const char *fn)
pc.cntlines = false;
memset(, 0, sizeof(mc));
mc.printmatch = true;
+   line_matched = false;
if ((pc.binary && binbehave == BINFILE_BIN) || cflag || qflag ||
lflag || Lflag)
mc.printmatch = false;
@@ -354,11 +356,12 @@ procfile(const char *fn)
return (0);
}
 
-   if ((t = procline()) == 0)
+   line_matched = procline();
+   if (line_matched)
++lines;
 
/* Halt processing if we hit our match limit */
-   if (!procmatches(, , t == 0))
+   if (!procmatches(, , line_matched))
break;
}
if (Bflag > 0)
@@ -453,31 +456,33 @@ litexec(const struct pat *pat, const char *string, siz
  * matches.  The matching lines are passed to printline() to display the
  * appropriate output.
  */
-static int
+static bool
 procline(struct parsec *pc)
 {
regmatch_t pmatch, lastmatch, chkmatch;
wchar_t wbegin, wend;
size_t st, nst;
unsigned int i;
-   int c = 0, r = 0, lastmatches = 0, leflags = eflags;
+   int r = 0, leflags = eflags;
size_t startm = 0, matchidx;
unsigned int retry;
+   bool lastmatched, matched;
 
matchidx = pc->matchidx;
 
/* Special case: empty pattern with -w flag, check first character */
if (matchall && wflag) {
if (pc->ln.len == 0)
-   return (0);
+   return (true);
wend = L' ';
if (sscanf(>ln.dat[0], "%lc", ) != 1 || iswword(wend))
-   return (1);
+   return (false);
else
-   return (0);
+   return (true);
} else if (matchall)
-   return (0);
+   return (true);
 
+   matched = false;
st = pc->lnstart;
nst = 0;
/* Initialize to avoid a false positive warning from GCC. */
@@ -485,7 +490,7 @@ procline(struct parsec *pc)
 
/* Loop to process the whole line */
while (st <= pc->ln.len) {
-   lastmatches = 0;
+   lastmatched = false;
startm = matchidx;
retry = 0;
if (st > 0 && pc->ln.dat[st - 1] != fileeol)
@@ -537,11 +542,11 @@ procline(struct parsec *pc)
if (r == REG_NOMATCH)
continue;
}
-   lastmatches++;
+   lastmatched = true;
lastmatch = pmatch;
 
if (matchidx == 0)
-   c++;
+   matched = true;
 
/*
 * Replace previous match if the new one is earlier
@@ -567,7 +572,7 @@ procline(struct parsec *pc)
if ((color == NULL && !oflag) || qflag || lflag ||
matchidx >= MAX_MATCHES) {
pc->lnstart = nst;

Re: svn commit: r334827 - in head/sys: amd64/amd64 arm/arm dev/hwpmc i386/i386 kern mips/atheros mips/cavium powerpc/powerpc sys

2018-06-09 Thread Matthew Macy
On Sat, Jun 9, 2018 at 10:51 Mark Johnston  wrote:

> On Sat, Jun 09, 2018 at 08:11:15AM -0400, John Baldwin wrote:
> > On 6/8/18 12:34 PM, Matthew Macy wrote:
> > >> The fact that our NMI handler isn't re-entrant can lead to subtle
> > >> problems. If while executing the NMI handler we hit a dtrace
> > >> probe or DDB breakpoint, the iret executed upon return to the handler
> > >> will re-enable NMIs. Then, if a second NMI arrives before the handler
> > >> for the first has returned, the trapframe will be clobbered. Did you
> > >> rule out an issue like this?
> > >
> > > No, but it happened instantly on all CPUs an a non-debug kernel 100%
> > > of the time after I changed pmc_process_interrupt earlier this week.
> > > My voodoo fix now avoids it. What you're describing sounds episodic
> > > and doesn't sound like it would be fixed / worked around by my change.
> >
> > OTOH, a compiler bug will crop up in other places.  It is best to run
> > it to ground.  Can you describe what the bug was in more detail?
> > It would probably not be hard to come up with something you can run
> > creduce against to get down to a test case.  If you do that, the
> > LLVM folks are quite helpful and able at fixing the issue which fixes
> > it in more places than just here.
>
> The bug is the rdtscp() intrinsic added in r334746 is wrong. It was just
> copied from rdtsc(), but unlike rdtsc, rdtscp clobbers rcx, which is the
> register containing the tf pointer.
>
Thanks for identifying that. Are you going to update it?

-M
___
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: r334883 - head/cddl/contrib/opensolaris/tools/ctf/cvt

2018-06-09 Thread Mark Johnston
On Sat, Jun 09, 2018 at 01:56:18PM -0400, Bryan Drewery wrote:
> On 6/9/18 1:39 PM, Mark Johnston wrote:
> > On Sat, Jun 09, 2018 at 07:35:00PM +0200, O. Hartmann wrote:
> >> -BEGIN PGP SIGNED MESSAGE-
> >> Hash: SHA512
> >>
> >> Am Sat, 9 Jun 2018 15:10:49 + (UTC)
> >> Mark Johnston  schrieb:
> >>
> >>> Author: markj
> >>> Date: Sat Jun  9 15:10:49 2018
> >>> New Revision: 334883
> >>> URL: https://svnweb.freebsd.org/changeset/base/334883
> >>>
> >>> Log:
> >>>   Don't process DWARF generated from non-C/C++ code.
> >>>   
> >>>   ctfconvert(1) is not designed to handle DWARF generated from such code,
> >>>   and will generally fail in non-obvious ways.  Use an explicit check to
> >>>   help catch such potential failures.
> >>>   
> >>>   Reported by:Johannes Lundberg 
> >>>   MFC after:  2 weeks
> >>>
> >>> Modified:
> >>>   head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
> >>>
> >>> Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
> >>> ==
> >>> --- head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c   Sat Jun  9 
> >>> 15:10:39
> >>> 2018  (r334882) +++ 
> >>> head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
> >>> Sat Jun  9 15:10:49 2018  (r334883) @@ -1901,7 +1901,7 @@ 
> >>> should_have_dwarf(Elf
> >>> *elf) int
> >>>  dw_read(tdata_t *td, Elf *elf, char *filename __unused)
> >>>  {
> >>> - Dwarf_Unsigned abboff, hdrlen, nxthdr;
> >>> + Dwarf_Unsigned abboff, hdrlen, lang, nxthdr;
> >>>   Dwarf_Half vers, addrsz, offsz;
> >>>   Dwarf_Die cu = 0;
> >>>   Dwarf_Die child = 0;
> >>> @@ -1941,8 +1941,8 @@ dw_read(tdata_t *td, Elf *elf, char *filename 
> >>> __unused
> >>>   }
> >>>  
> >>>   if ((rc = dwarf_next_cu_header_b(dw.dw_dw, , , ,
> >>> - , , NULL, , _err)) != DW_DLV_OK) {
> >>> - if (dw.dw_err.err_error ==  DW_DLE_NO_ENTRY)
> >>> + , , NULL, , _err)) != DW_DLV_OK) {
> >>> + if (dw.dw_err.err_error == DW_DLE_NO_ENTRY)
> >>>   exit(0);
> >>>   else
> >>>   terminate("rc = %d %s\n", rc, dwarf_errmsg(dw.dw_err));
> >>> @@ -1971,6 +1971,25 @@ dw_read(tdata_t *td, Elf *elf, char *filename 
> >>> __unused
> >>>   debug(1, "DWARF emitter: %s\n", prod);
> >>>   free(prod);
> >>>   }
> >>> +
> >>> + if (dwarf_attrval_unsigned(cu, DW_AT_language, , _err) == 0)
> >>> + switch (lang) {
> >>> + case DW_LANG_C:
> >>> + case DW_LANG_C89:
> >>> + case DW_LANG_C99:
> >>> + case DW_LANG_C11:
> >>> + case DW_LANG_C_plus_plus:
> >>> + case DW_LANG_C_plus_plus_03:
> >>> + case DW_LANG_C_plus_plus_11:
> >>> + case DW_LANG_C_plus_plus_14:
> >>> + break;
> >>> + default:
> >>> + terminate("file contains DWARF for unsupported "
> >>> + "language %d", lang);
> >>> + }
> >>> + else
> >>> + warning("die %llu: failed to get language attribute: %s\n",
> >>> + die_off(, cu), dwarf_errmsg(dw.dw_err));
> >>>  
> >>>   if ((dw.dw_cuname = die_name(, cu)) != NULL) {
> >>>   char *base = xstrdup(basename(dw.dw_cuname));
> >>> ___
> >>> 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"
> >> This commit makes buildworld (WITH_META_MODE) failing:
> > 
> > I added these identifiers in r334881, and the CI build is passing. Might
> > this be a problem with META_MODE?
> > 
> >> [...]
> >> ===> cddl/usr.bin/ctfconvert (obj,all,install)
> >> Building 
> >> /usr/obj/usr/src/amd64.amd64/tmp/obj-tools/cddl/usr.bin/ctfconvert/dwarf.o
> 
> obj-tools means it is trying to build a HOST NATIVE version of this.
> Where are these defined? In this case they need to be defined in
> /usr/include already unless the build has -I.CURDIR/somewhere/to/headers
> instead.

The definitions are in contrib/elftoolchain/libdwarf/dwarf.h. Indeed,
the ctfconvert makefile doesn't explicitly add libdwarf to the include
path. I'm surprised that this is necessary though - do I need to modify
the BOOTSTRAPPING check for _elftoolchain_libs in Makefile.inc1?
___
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: r334883 - head/cddl/contrib/opensolaris/tools/ctf/cvt

2018-06-09 Thread Mark Johnston
On Sat, Jun 09, 2018 at 07:35:00PM +0200, O. Hartmann wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA512
> 
> Am Sat, 9 Jun 2018 15:10:49 + (UTC)
> Mark Johnston  schrieb:
> 
> > Author: markj
> > Date: Sat Jun  9 15:10:49 2018
> > New Revision: 334883
> > URL: https://svnweb.freebsd.org/changeset/base/334883
> > 
> > Log:
> >   Don't process DWARF generated from non-C/C++ code.
> >   
> >   ctfconvert(1) is not designed to handle DWARF generated from such code,
> >   and will generally fail in non-obvious ways.  Use an explicit check to
> >   help catch such potential failures.
> >   
> >   Reported by:  Johannes Lundberg 
> >   MFC after:2 weeks
> > 
> > Modified:
> >   head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
> > 
> > Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
> > ==
> > --- head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Sat Jun  9 
> > 15:10:39
> > 2018(r334882) +++ 
> > head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
> > Sat Jun  9 15:10:49 2018(r334883) @@ -1901,7 +1901,7 @@ 
> > should_have_dwarf(Elf
> > *elf) int
> >  dw_read(tdata_t *td, Elf *elf, char *filename __unused)
> >  {
> > -   Dwarf_Unsigned abboff, hdrlen, nxthdr;
> > +   Dwarf_Unsigned abboff, hdrlen, lang, nxthdr;
> > Dwarf_Half vers, addrsz, offsz;
> > Dwarf_Die cu = 0;
> > Dwarf_Die child = 0;
> > @@ -1941,8 +1941,8 @@ dw_read(tdata_t *td, Elf *elf, char *filename __unused
> > }
> >  
> > if ((rc = dwarf_next_cu_header_b(dw.dw_dw, , , ,
> > -   , , NULL, , _err)) != DW_DLV_OK) {
> > -   if (dw.dw_err.err_error ==  DW_DLE_NO_ENTRY)
> > +   , , NULL, , _err)) != DW_DLV_OK) {
> > +   if (dw.dw_err.err_error == DW_DLE_NO_ENTRY)
> > exit(0);
> > else
> > terminate("rc = %d %s\n", rc, dwarf_errmsg(dw.dw_err));
> > @@ -1971,6 +1971,25 @@ dw_read(tdata_t *td, Elf *elf, char *filename 
> > __unused
> > debug(1, "DWARF emitter: %s\n", prod);
> > free(prod);
> > }
> > +
> > +   if (dwarf_attrval_unsigned(cu, DW_AT_language, , _err) == 0)
> > +   switch (lang) {
> > +   case DW_LANG_C:
> > +   case DW_LANG_C89:
> > +   case DW_LANG_C99:
> > +   case DW_LANG_C11:
> > +   case DW_LANG_C_plus_plus:
> > +   case DW_LANG_C_plus_plus_03:
> > +   case DW_LANG_C_plus_plus_11:
> > +   case DW_LANG_C_plus_plus_14:
> > +   break;
> > +   default:
> > +   terminate("file contains DWARF for unsupported "
> > +   "language %d", lang);
> > +   }
> > +   else
> > +   warning("die %llu: failed to get language attribute: %s\n",
> > +   die_off(, cu), dwarf_errmsg(dw.dw_err));
> >  
> > if ((dw.dw_cuname = die_name(, cu)) != NULL) {
> > char *base = xstrdup(basename(dw.dw_cuname));
> > ___
> > 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"
> This commit makes buildworld (WITH_META_MODE) failing:

I added these identifiers in r334881, and the CI build is passing. Might
this be a problem with META_MODE?

> [...]
> ===> cddl/usr.bin/ctfconvert (obj,all,install)
> Building 
> /usr/obj/usr/src/amd64.amd64/tmp/obj-tools/cddl/usr.bin/ctfconvert/dwarf.o
> - --- dwarf.o ---
> /usr/src/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c:1980:8: error: use of 
> undeclared
> identifier 'DW_LANG_C11' case DW_LANG_C11:
>  ^
> /usr/src/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c:1982:8: error: use of 
> undeclared
> identifier 'DW_LANG_C_plus_plus_03' case DW_LANG_C_plus_plus_03:
>  ^
> /usr/src/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c:1983:8: error: use of 
> undeclared
> identifier 'DW_LANG_C_plus_plus_11' case DW_LANG_C_plus_plus_11:
>  ^
> /usr/src/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c:1984:8: error: use of 
> undeclared
> identifier 'DW_LANG_C_plus_plus_14' case DW_LANG_C_plus_plus_14:
>  ^
> 4 errors generated.
> *** [dwarf.o] Error code 1
___
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: r334883 - head/cddl/contrib/opensolaris/tools/ctf/cvt

2018-06-09 Thread Bryan Drewery
On 6/9/18 1:39 PM, Mark Johnston wrote:
> On Sat, Jun 09, 2018 at 07:35:00PM +0200, O. Hartmann wrote:
>> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA512
>>
>> Am Sat, 9 Jun 2018 15:10:49 + (UTC)
>> Mark Johnston  schrieb:
>>
>>> Author: markj
>>> Date: Sat Jun  9 15:10:49 2018
>>> New Revision: 334883
>>> URL: https://svnweb.freebsd.org/changeset/base/334883
>>>
>>> Log:
>>>   Don't process DWARF generated from non-C/C++ code.
>>>   
>>>   ctfconvert(1) is not designed to handle DWARF generated from such code,
>>>   and will generally fail in non-obvious ways.  Use an explicit check to
>>>   help catch such potential failures.
>>>   
>>>   Reported by:  Johannes Lundberg 
>>>   MFC after:2 weeks
>>>
>>> Modified:
>>>   head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
>>>
>>> Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
>>> ==
>>> --- head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Sat Jun  9 
>>> 15:10:39
>>> 2018(r334882) +++ 
>>> head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
>>> Sat Jun  9 15:10:49 2018(r334883) @@ -1901,7 +1901,7 @@ 
>>> should_have_dwarf(Elf
>>> *elf) int
>>>  dw_read(tdata_t *td, Elf *elf, char *filename __unused)
>>>  {
>>> -   Dwarf_Unsigned abboff, hdrlen, nxthdr;
>>> +   Dwarf_Unsigned abboff, hdrlen, lang, nxthdr;
>>> Dwarf_Half vers, addrsz, offsz;
>>> Dwarf_Die cu = 0;
>>> Dwarf_Die child = 0;
>>> @@ -1941,8 +1941,8 @@ dw_read(tdata_t *td, Elf *elf, char *filename __unused
>>> }
>>>  
>>> if ((rc = dwarf_next_cu_header_b(dw.dw_dw, , , ,
>>> -   , , NULL, , _err)) != DW_DLV_OK) {
>>> -   if (dw.dw_err.err_error ==  DW_DLE_NO_ENTRY)
>>> +   , , NULL, , _err)) != DW_DLV_OK) {
>>> +   if (dw.dw_err.err_error == DW_DLE_NO_ENTRY)
>>> exit(0);
>>> else
>>> terminate("rc = %d %s\n", rc, dwarf_errmsg(dw.dw_err));
>>> @@ -1971,6 +1971,25 @@ dw_read(tdata_t *td, Elf *elf, char *filename 
>>> __unused
>>> debug(1, "DWARF emitter: %s\n", prod);
>>> free(prod);
>>> }
>>> +
>>> +   if (dwarf_attrval_unsigned(cu, DW_AT_language, , _err) == 0)
>>> +   switch (lang) {
>>> +   case DW_LANG_C:
>>> +   case DW_LANG_C89:
>>> +   case DW_LANG_C99:
>>> +   case DW_LANG_C11:
>>> +   case DW_LANG_C_plus_plus:
>>> +   case DW_LANG_C_plus_plus_03:
>>> +   case DW_LANG_C_plus_plus_11:
>>> +   case DW_LANG_C_plus_plus_14:
>>> +   break;
>>> +   default:
>>> +   terminate("file contains DWARF for unsupported "
>>> +   "language %d", lang);
>>> +   }
>>> +   else
>>> +   warning("die %llu: failed to get language attribute: %s\n",
>>> +   die_off(, cu), dwarf_errmsg(dw.dw_err));
>>>  
>>> if ((dw.dw_cuname = die_name(, cu)) != NULL) {
>>> char *base = xstrdup(basename(dw.dw_cuname));
>>> ___
>>> 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"
>> This commit makes buildworld (WITH_META_MODE) failing:
> 
> I added these identifiers in r334881, and the CI build is passing. Might
> this be a problem with META_MODE?
> 
>> [...]
>> ===> cddl/usr.bin/ctfconvert (obj,all,install)
>> Building 
>> /usr/obj/usr/src/amd64.amd64/tmp/obj-tools/cddl/usr.bin/ctfconvert/dwarf.o

obj-tools means it is trying to build a HOST NATIVE version of this.
Where are these defined? In this case they need to be defined in
/usr/include already unless the build has -I.CURDIR/somewhere/to/headers
instead.

>> - --- dwarf.o ---
>> /usr/src/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c:1980:8: error: use 
>> of undeclared
>> identifier 'DW_LANG_C11' case DW_LANG_C11:
>>  ^
>> /usr/src/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c:1982:8: error: use 
>> of undeclared
>> identifier 'DW_LANG_C_plus_plus_03' case DW_LANG_C_plus_plus_03:
>>  ^
>> /usr/src/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c:1983:8: error: use 
>> of undeclared
>> identifier 'DW_LANG_C_plus_plus_11' case DW_LANG_C_plus_plus_11:
>>  ^
>> /usr/src/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c:1984:8: error: use 
>> of undeclared
>> identifier 'DW_LANG_C_plus_plus_14' case DW_LANG_C_plus_plus_14:
>>  ^
>> 4 errors generated.
>> *** [dwarf.o] Error code 1


-- 
Regards,
Bryan Drewery



signature.asc
Description: OpenPGP digital signature


svn commit: r334887 - head/tools/boot

2018-06-09 Thread Allan Jude
Author: allanjude
Date: Sat Jun  9 17:47:56 2018
New Revision: 334887
URL: https://svnweb.freebsd.org/changeset/base/334887

Log:
  Change rootgen.sh to use the default ZFS boot environment name
  
  Reviewed by:  imp (maintainer)
  Sponsored by: Klara Systems
  Differential Revision:https://reviews.freebsd.org/D15699

Modified:
  head/tools/boot/rootgen.sh

Modified: head/tools/boot/rootgen.sh
==
--- head/tools/boot/rootgen.sh  Sat Jun  9 17:40:31 2018(r334886)
+++ head/tools/boot/rootgen.sh  Sat Jun  9 17:47:56 2018(r334887)
@@ -96,7 +96,7 @@ mk_nogeli_gpt_zfs_legacy() {
 # install-boot will make this bootable
 zpool create -O mountpoint=none -R ${mntpt} ${pool} ${md}p2
 zpool set bootfs=${pool} ${pool}
-zfs create -o mountpoint=/ ${pool}/ROOT
+zfs create -po mountpoint=/ ${pool}/ROOT/default
 # NB: The online guides go nuts customizing /var and other mountpoints 
here, no need
 cpsys ${src} ${mntpt}
 df
@@ -109,9 +109,9 @@ EOF
 cp /boot/kernel/opensolaris.ko ${mntpt}/boot/kernel/opensolaris.ko
 ls -las ${mntpt}/boot
 # end tweaks
-zfs umount -f ${pool}/ROOT
-zfs set mountpoint=none ${pool}/ROOT
-zpool set bootfs=${pool}/ROOT ${pool}
+zfs umount -f ${pool}/ROOT/default
+zfs set mountpoint=none ${pool}/ROOT/default
+zpool set bootfs=${pool}/ROOT/default ${pool}
 zpool set autoexpand=on ${pool}
 zpool export ${pool}
 ${SRCTOP}/tools/boot/install-boot.sh -g ${geli} -s ${scheme} -f ${fs} -b 
${bios} -d ${src} ${md}
___
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: r334827 - in head/sys: amd64/amd64 arm/arm dev/hwpmc i386/i386 kern mips/atheros mips/cavium powerpc/powerpc sys

2018-06-09 Thread Mark Johnston
On Sat, Jun 09, 2018 at 08:11:15AM -0400, John Baldwin wrote:
> On 6/8/18 12:34 PM, Matthew Macy wrote:
> >> The fact that our NMI handler isn't re-entrant can lead to subtle
> >> problems. If while executing the NMI handler we hit a dtrace
> >> probe or DDB breakpoint, the iret executed upon return to the handler
> >> will re-enable NMIs. Then, if a second NMI arrives before the handler
> >> for the first has returned, the trapframe will be clobbered. Did you
> >> rule out an issue like this?
> > 
> > No, but it happened instantly on all CPUs an a non-debug kernel 100%
> > of the time after I changed pmc_process_interrupt earlier this week.
> > My voodoo fix now avoids it. What you're describing sounds episodic
> > and doesn't sound like it would be fixed / worked around by my change.
> 
> OTOH, a compiler bug will crop up in other places.  It is best to run
> it to ground.  Can you describe what the bug was in more detail?
> It would probably not be hard to come up with something you can run
> creduce against to get down to a test case.  If you do that, the
> LLVM folks are quite helpful and able at fixing the issue which fixes
> it in more places than just here.

The bug is the rdtscp() intrinsic added in r334746 is wrong. It was just
copied from rdtsc(), but unlike rdtsc, rdtscp clobbers rcx, which is the
register containing the tf pointer.
___
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: r334886 - in head: . tools/build/mk

2018-06-09 Thread Dimitry Andric
Author: dim
Date: Sat Jun  9 17:40:31 2018
New Revision: 334886
URL: https://svnweb.freebsd.org/changeset/base/334886

Log:
  Add missed libc++ entries to (Optional)ObsoleteFiles.inc
  
  Some of these were removed during the libc++ 5.0.0 import, others were
  added in the libc++ 6.0.0 import.
  
  MFC after:3 days

Modified:
  head/ObsoleteFiles.inc
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Sat Jun  9 15:52:29 2018(r334885)
+++ head/ObsoleteFiles.inc  Sat Jun  9 17:40:31 2018(r334886)
@@ -38,6 +38,11 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20180609: obsolete libc++ files missed from the 5.0.0 import
+OLD_FILES+=usr/include/c++/v1/__refstring
+OLD_FILES+=usr/include/c++/v1/__undef_min_max
+OLD_FILES+=usr/include/c++/v1/tr1/__refstring
+OLD_FILES+=usr/include/c++/v1/tr1/__undef_min_max
 # 20180607: remove nls support from grep
 OLD_FILES+=usr/share/nls/pt_BR.ISO8859-1/grep.cat
 OLD_FILES+=usr/share/nls/hu_HU.ISO8859-2/grep.cat

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Sat Jun  9 15:52:29 
2018(r334885)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Sat Jun  9 17:40:31 
2018(r334886)
@@ -4009,7 +4009,6 @@ OLD_FILES+=usr/include/c++/v1/__libcpp_version
 OLD_FILES+=usr/include/c++/v1/__locale
 OLD_FILES+=usr/include/c++/v1/__mutex_base
 OLD_FILES+=usr/include/c++/v1/__nullptr
-OLD_FILES+=usr/include/c++/v1/__refstring
 OLD_FILES+=usr/include/c++/v1/__split_buffer
 OLD_FILES+=usr/include/c++/v1/__sso_allocator
 OLD_FILES+=usr/include/c++/v1/__std_stream
@@ -4062,6 +4061,7 @@ OLD_FILES+=usr/include/c++/v1/experimental/__memory
 OLD_FILES+=usr/include/c++/v1/experimental/algorithm
 OLD_FILES+=usr/include/c++/v1/experimental/any
 OLD_FILES+=usr/include/c++/v1/experimental/chrono
+OLD_FILES+=usr/include/c++/v1/experimental/coroutine
 OLD_FILES+=usr/include/c++/v1/experimental/deque
 OLD_FILES+=usr/include/c++/v1/experimental/dynarray
 OLD_FILES+=usr/include/c++/v1/experimental/filesystem
@@ -4071,6 +4071,7 @@ OLD_FILES+=usr/include/c++/v1/experimental/iterator
 OLD_FILES+=usr/include/c++/v1/experimental/list
 OLD_FILES+=usr/include/c++/v1/experimental/map
 OLD_FILES+=usr/include/c++/v1/experimental/memory_resource
+OLD_FILES+=usr/include/c++/v1/experimental/numeric
 OLD_FILES+=usr/include/c++/v1/experimental/optional
 OLD_FILES+=usr/include/c++/v1/experimental/propagate_const
 OLD_FILES+=usr/include/c++/v1/experimental/ratio
@@ -4152,7 +4153,6 @@ OLD_FILES+=usr/include/c++/v1/tr1/__libcpp_version
 OLD_FILES+=usr/include/c++/v1/tr1/__locale
 OLD_FILES+=usr/include/c++/v1/tr1/__mutex_base
 OLD_FILES+=usr/include/c++/v1/tr1/__nullptr
-OLD_FILES+=usr/include/c++/v1/tr1/__refstring
 OLD_FILES+=usr/include/c++/v1/tr1/__split_buffer
 OLD_FILES+=usr/include/c++/v1/tr1/__sso_allocator
 OLD_FILES+=usr/include/c++/v1/tr1/__std_stream
@@ -4160,7 +4160,7 @@ OLD_FILES+=usr/include/c++/v1/tr1/__string
 OLD_FILES+=usr/include/c++/v1/tr1/__threading_support
 OLD_FILES+=usr/include/c++/v1/tr1/__tree
 OLD_FILES+=usr/include/c++/v1/tr1/__tuple
-OLD_FILES+=usr/include/c++/v1/tr1/__undef_min_max
+OLD_FILES+=usr/include/c++/v1/tr1/__undef_macros
 OLD_FILES+=usr/include/c++/v1/tr1/algorithm
 OLD_FILES+=usr/include/c++/v1/tr1/any
 OLD_FILES+=usr/include/c++/v1/tr1/array
___
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: r334888 - head/tools/boot

2018-06-09 Thread Allan Jude
Author: allanjude
Date: Sat Jun  9 17:49:43 2018
New Revision: 334888
URL: https://svnweb.freebsd.org/changeset/base/334888

Log:
  Add ZFS+GPT EFI and LEGACY+EFI to rootgen.sh and installboot.sh
  
  Reviewed by:  imp (maintainer)
  Sponsored by: Klara Systems
  Differential Revision:https://reviews.freebsd.org/D15700

Modified:
  head/tools/boot/install-boot.sh
  head/tools/boot/rootgen.sh

Modified: head/tools/boot/install-boot.sh
==
--- head/tools/boot/install-boot.sh Sat Jun  9 17:47:56 2018
(r334887)
+++ head/tools/boot/install-boot.sh Sat Jun  9 17:49:43 2018
(r334888)
@@ -51,6 +51,37 @@ boot_nogeli_gpt_ufs_legacy() {
 exit 0
 }
 
+boot_nogeli_gpt_zfs_uefi() {
+dev=$1
+dst=$2
+
+idx=$(find-part $dev "efi")
+if [ -z "$idx" ] ; then
+   die "No efi ESP partition found"
+fi
+doit gpart bootcode -p ${efi2} -i $idx $dev
+exit 0
+}
+
+boot_nogeli_gpt_zfs_both() {
+dev=$1
+dst=$2
+
+# XXX: Should this be copy/pasted, or should it call both _uefi and _legacy
+idx=$(find-part $dev "efi")
+if [ -z "$idx" ] ; then
+   die "No efi ESP partition found"
+fi
+doit gpart bootcode -p ${efi2} -i $idx $dev
+
+idx=$(find-part $dev "freebsd-boot")
+if [ -z "$idx" ] ; then
+   die "No freebsd-boot partition found"
+fi
+doit gpart bootcode -b ${gpt0} -p ${gptzfs2} -i $idx $dev
+exit 0
+}
+
 boot_nogeli_mbr_zfs_legacy() {
 dev=$1
 dst=$2
@@ -133,6 +164,10 @@ dev=$1
 gpt0=${DESTDIR}/boot/pmbr
 gpt2=${DESTDIR}/boot/gptboot
 gptzfs2=${DESTDIR}/boot/gptzfsboot
+
+# For gpt + EFI we install the ESP
+# XXX This should use newfs or makefs, but it deosn't yet
+efi2=${DESTDIR}/boot/boot1.efifat
 
 # For MBR, we have lots of choices, but select boot0
 mbr0=${DESTDIR}/boot/boot0

Modified: head/tools/boot/rootgen.sh
==
--- head/tools/boot/rootgen.sh  Sat Jun  9 17:47:56 2018(r334887)
+++ head/tools/boot/rootgen.sh  Sat Jun  9 17:49:43 2018(r334888)
@@ -119,9 +119,84 @@ EOF
 }
 
 mk_nogeli_gpt_zfs_uefi() {
+src=$1
+img=$2
+mntpt=$3
+geli=$4
+scheme=$5
+fs=$6
+bios=$7
+pool=nogeli-gpt-zfs-uefi
+
+dd if=/dev/zero of=${img} count=1 seek=$((200 * 1024 * 1024 / 512))
+md=$(mdconfig -f ${img})
+gpart create -s gpt ${md}
+gpart add -t efi -s 800k -a 4k ${md}
+gpart add -t freebsd-zfs -l root $md
+# install-boot will make this bootable
+zpool create -O mountpoint=none -R ${mntpt} ${pool} ${md}p2
+zpool set bootfs=${pool} ${pool}
+zfs create -po mountpoint=/ ${pool}/ROOT/default
+# NB: The online guides go nuts customizing /var and other mountpoints 
here, no need
+cpsys ${src} ${mntpt}
+df
+# need to make a couple of tweaks
+cat > ${mntpt}/boot/loader.conf < ${mntpt}/boot/loader.conf < $sh
-echo "qemu-system-x86_64 -bios ~/bios/OVMF-X64.fd --drive 
file=${img},format=raw ${qser}" > $sh
+echo "qemu-system-x86_64 -bios ~/bios/OVMF-X64.fd --drive 
file=${img},format=raw ${qser}" >> $sh
 }
 
 # arm
@@ -288,7 +363,7 @@ qemu_i386_both()
 sh=$2
 
 echo "qemu-system-i386 --drive file=${img},format=raw ${qser}" > $sh
-echo "qemu-system-i386 -bios ~/bios/OVMF-X32.fd --drive 
file=${img},format=raw ${qser}" > $sh
+echo "qemu-system-i386 -bios ~/bios/OVMF-X32.fd --drive 
file=${img},format=raw ${qser}" >> $sh
 }
 
 # mips
@@ -314,8 +389,15 @@ DESTDIR=${OBJDIR}/boot-tree
 rm -rf ${DESTDIR}
 mkdir -p ${DESTDIR}/boot/defaults
 mkdir -p ${DESTDIR}/boot/kernel
+cp /boot/boot0 ${DESTDIR}/boot
+cp /boot/boot0sio ${DESTDIR}/boot
+cp /boot/pmbr ${DESTDIR}/boot
+cp /boot/boot ${DESTDIR}/boot
 # XXX boot1 exists only on sparc64
 cp /boot/boot1 ${DESTDIR}/boot
+cp /boot/boot1.efifat ${DESTDIR}/boot
+cp /boot/gptboot ${DESTDIR}/boot
+cp /boot/gptzfsboot ${DESTDIR}/boot
 cp /boot/loader ${DESTDIR}/boot
 cp /boot/kernel/kernel ${DESTDIR}/boot/kernel
 echo -h -D -S115200 > ${DESTDIR}/boot.config
___
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: r334883 - head/cddl/contrib/opensolaris/tools/ctf/cvt

2018-06-09 Thread O. Hartmann
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

Am Sat, 9 Jun 2018 15:10:49 + (UTC)
Mark Johnston  schrieb:

> Author: markj
> Date: Sat Jun  9 15:10:49 2018
> New Revision: 334883
> URL: https://svnweb.freebsd.org/changeset/base/334883
> 
> Log:
>   Don't process DWARF generated from non-C/C++ code.
>   
>   ctfconvert(1) is not designed to handle DWARF generated from such code,
>   and will generally fail in non-obvious ways.  Use an explicit check to
>   help catch such potential failures.
>   
>   Reported by:Johannes Lundberg 
>   MFC after:  2 weeks
> 
> Modified:
>   head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
> 
> Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
> ==
> --- head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c   Sat Jun  9 
> 15:10:39
> 2018  (r334882) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
> Sat Jun  9 15:10:49 2018  (r334883) @@ -1901,7 +1901,7 @@ 
> should_have_dwarf(Elf
> *elf) int
>  dw_read(tdata_t *td, Elf *elf, char *filename __unused)
>  {
> - Dwarf_Unsigned abboff, hdrlen, nxthdr;
> + Dwarf_Unsigned abboff, hdrlen, lang, nxthdr;
>   Dwarf_Half vers, addrsz, offsz;
>   Dwarf_Die cu = 0;
>   Dwarf_Die child = 0;
> @@ -1941,8 +1941,8 @@ dw_read(tdata_t *td, Elf *elf, char *filename __unused
>   }
>  
>   if ((rc = dwarf_next_cu_header_b(dw.dw_dw, , , ,
> - , , NULL, , _err)) != DW_DLV_OK) {
> - if (dw.dw_err.err_error ==  DW_DLE_NO_ENTRY)
> + , , NULL, , _err)) != DW_DLV_OK) {
> + if (dw.dw_err.err_error == DW_DLE_NO_ENTRY)
>   exit(0);
>   else
>   terminate("rc = %d %s\n", rc, dwarf_errmsg(dw.dw_err));
> @@ -1971,6 +1971,25 @@ dw_read(tdata_t *td, Elf *elf, char *filename __unused
>   debug(1, "DWARF emitter: %s\n", prod);
>   free(prod);
>   }
> +
> + if (dwarf_attrval_unsigned(cu, DW_AT_language, , _err) == 0)
> + switch (lang) {
> + case DW_LANG_C:
> + case DW_LANG_C89:
> + case DW_LANG_C99:
> + case DW_LANG_C11:
> + case DW_LANG_C_plus_plus:
> + case DW_LANG_C_plus_plus_03:
> + case DW_LANG_C_plus_plus_11:
> + case DW_LANG_C_plus_plus_14:
> + break;
> + default:
> + terminate("file contains DWARF for unsupported "
> + "language %d", lang);
> + }
> + else
> + warning("die %llu: failed to get language attribute: %s\n",
> + die_off(, cu), dwarf_errmsg(dw.dw_err));
>  
>   if ((dw.dw_cuname = die_name(, cu)) != NULL) {
>   char *base = xstrdup(basename(dw.dw_cuname));
> ___
> 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"
This commit makes buildworld (WITH_META_MODE) failing:

[...]
===> cddl/usr.bin/ctfconvert (obj,all,install)
Building 
/usr/obj/usr/src/amd64.amd64/tmp/obj-tools/cddl/usr.bin/ctfconvert/dwarf.o
- --- dwarf.o ---
/usr/src/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c:1980:8: error: use of 
undeclared
identifier 'DW_LANG_C11' case DW_LANG_C11:
 ^
/usr/src/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c:1982:8: error: use of 
undeclared
identifier 'DW_LANG_C_plus_plus_03' case DW_LANG_C_plus_plus_03:
 ^
/usr/src/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c:1983:8: error: use of 
undeclared
identifier 'DW_LANG_C_plus_plus_11' case DW_LANG_C_plus_plus_11:
 ^
/usr/src/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c:1984:8: error: use of 
undeclared
identifier 'DW_LANG_C_plus_plus_14' case DW_LANG_C_plus_plus_14:
 ^
4 errors generated.
*** [dwarf.o] Error code 1


kind regards,

oh


- -- 
O. Hartmann

Ich widerspreche der Nutzung oder Übermittlung meiner Daten für
Werbezwecke oder für die Markt- oder Meinungsforschung (§ 28 Abs. 4 BDSG).
-BEGIN PGP SIGNATURE-

iLUEARMKAB0WIQQZVZMzAtwC2T/86TrS528fyFhYlAUCWxwP3wAKCRDS528fyFhY
lJOfAgCW9iJl/0qxPSn4CWidr+ZiZSUXc/AEvtFVMFPB9JFedZBsJRBQGv0ktWs0
suAa9pIP03SgWvco0vESi6AxfFYiAf9YB2uD25XiVOOl+lcEIZ3h/oGrRvejNR02
ppq+WPaiTUINWDb26l5Q1ugl1UU9lwhrzXgJGhdj9StSvxiZ6OuJ
=zyIM
-END PGP SIGNATURE-
___
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: r334875 - head/sys/net

2018-06-09 Thread Rodney W. Grimes
> Author: ae
> Date: Sat Jun  9 09:57:14 2018
> New Revision: 334875
> URL: https://svnweb.freebsd.org/changeset/base/334875
> 
> Log:
>   Explicitly change the link state when we assingn an address.
>   
>   Since we are setting IFF_UP flag on SIOCSIFADDR, it is possible, that
>   after this link state information still not initialized properly.
>   This leads to problems with routing, since now interface has
>   IFCAP_LINKSTATE capability and a route is considered as working only
>   when interface's link state is in LINK_STATE_UP (see RT_LINK_IS_UP()
>   macro).

I was going to say something when the ability to up and down
the loopback interfaces was added as it perturbed me but I
could not put my finger on places it may cause problems so
remained silent on the matter.

Now that I see this issue, having lo0 go DOWN can kill a network
that is using exported from lo0 into a routing protocol routes that 
are used for management purposes.

How does Cisco, Juniper, etc at handle this?
Do any of them or all of them allow you to "down" loopback?

>   
>   Reported by:Marek Zarychta
>   MFC after:  3 days
> 
> Modified:
>   head/sys/net/if_loop.c
> 
> Modified: head/sys/net/if_loop.c
> ==
> --- head/sys/net/if_loop.cSat Jun  9 04:54:36 2018(r334874)
> +++ head/sys/net/if_loop.cSat Jun  9 09:57:14 2018(r334875)
> @@ -380,6 +380,7 @@ loioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
>   case SIOCSIFADDR:
>   ifp->if_flags |= IFF_UP;
>   ifp->if_drv_flags |= IFF_DRV_RUNNING;
> + if_link_state_change(ifp, LINK_STATE_UP);
>   /*
>* Everything else is done at a higher level.
>*/
> 
> 

-- 
Rod Grimes rgri...@freebsd.org
___
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: r334814 - head/sbin/dump

2018-06-09 Thread John Baldwin
On 6/8/18 10:27 AM, Justin Hibbits wrote:
> On Fri, Jun 8, 2018 at 10:08 AM, Ed Maste  wrote:
>> On 7 June 2018 at 16:49, Kirk McKusick  wrote:
>>> Author: mckusick
>>> Date: Thu Jun  7 20:49:01 2018
>>> New Revision: 334814
>>> URL: https://svnweb.freebsd.org/changeset/base/334814
>>>
>>> Log:
>>>   Ensure proper initialization of superblock.
>>>
>> ...
>>> --- head/sbin/dump/main.c   Thu Jun  7 19:57:55 2018(r334813)
>>> +++ head/sbin/dump/main.c   Thu Jun  7 20:49:01 2018(r334814)
>>> @@ -433,6 +433,7 @@ main(int argc, char *argv[])
>>> msgtail("to %s\n", tape);
>>>
>>> sync();
>>> +   sblock = NULL;
>>> if ((ret = sbget(diskfd, , -1)) != 0) {
>>
>> sblock is initialized to NULL at the beginning of ffs_sbget, so I'm
>> not really sure what's happening here.
>>
> 
> Diane just found possibly the real cause of the problem.  dump.h is
> included by almost every .c file, but defines variables, doesn't just
> declare them.  I think the real solution would be to  define them in
> main.c, or somewhere else, and just declare them in dump.h.  Or if
> they're truly only needed on a per-file basis, not as globals, they
> could be marked static so there is no chance of conflict, and they're
> pre-initialized to 0.  The linker "might" merge them into the common
> section, or might not, resulting in bizarre conflicts like what she's
> seeing.  Though, I'm surprised we're not seeing a linker error or
> warning anyway.

Is this in fact fallout from lld vs ld.bfd then?

-- 
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: r334864 - head/usr.bin/top

2018-06-09 Thread Eitan Adler
On 8 June 2018 at 23:13, Florian Smeets  wrote:
> On 09.06.18 04:14, Eitan Adler wrote:
>> Author: eadler
>> Date: Sat Jun  9 02:14:33 2018
>> New Revision: 334864
>> URL: https://svnweb.freebsd.org/changeset/base/334864
>>
>> Log:
>>   top(1): use a different command to toggle tid vs pid
>
> Thank you.
>
> You cannot start top with -T unless you add something like the following:

I have a patch out for this, but svn is having issues right now (or at
least I am).

> Another issue I just found is that if you start top with -P some columns
> don't show any values:

>
> It is correct if you start top with -TP or -HP, or if you start top -P
> and then use H or T to switch back and forth. I'm not sure in which
> revision this was broken, it works with r333899.

I'm guessing this is because I forgot to initalize "prehead"
somewhere. I'd like to rewrite the entire header creation, but will
try and fix this. Thanks for the report!




-- 
Eitan Adler
Source, Ports, Doc committer
Bugmeister, Ports Security teams
___
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: r334885 - in head/stand: common efi/loader i386/libi386 userboot/userboot

2018-06-09 Thread Kyle Evans
Author: kevans
Date: Sat Jun  9 15:52:29 2018
New Revision: 334885
URL: https://svnweb.freebsd.org/changeset/base/334885

Log:
  stand: One more trivial consolidation (setting environment from howto)

Modified:
  head/stand/common/boot.c
  head/stand/common/bootstrap.h
  head/stand/efi/loader/main.c
  head/stand/i386/libi386/bootinfo.c
  head/stand/userboot/userboot/bootinfo.c

Modified: head/stand/common/boot.c
==
--- head/stand/common/boot.cSat Jun  9 15:28:37 2018(r334884)
+++ head/stand/common/boot.cSat Jun  9 15:52:29 2018(r334885)
@@ -174,6 +174,16 @@ bootenv_flags()
return (howto);
 }
 
+void
+bootenv_set(int howto)
+{
+   int i;
+
+   for (i = 0; howto_names[i].ev != NULL; i++)
+   if (howto & howto_names[i].mask)
+   setenv(howto_names[i].ev, "YES", 1);
+}
+
 static int
 autoboot(int timeout, char *prompt)
 {

Modified: head/stand/common/bootstrap.h
==
--- head/stand/common/bootstrap.h   Sat Jun  9 15:28:37 2018
(r334884)
+++ head/stand/common/bootstrap.h   Sat Jun  9 15:52:29 2018
(r334885)
@@ -64,6 +64,7 @@ int   parse(int *argc, char ***argv, const char *str);
 void   autoboot_maybe(void);
 intgetrootmount(char *rootdev);
 intbootenv_flags(void);
+void   bootenv_set(int);
 
 /* misc.c */
 char   *unargv(int argc, char *argv[]);

Modified: head/stand/efi/loader/main.c
==
--- head/stand/efi/loader/main.cSat Jun  9 15:28:37 2018
(r334884)
+++ head/stand/efi/loader/main.cSat Jun  9 15:52:29 2018
(r334885)
@@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -549,9 +548,8 @@ main(int argc, CHAR16 *argv[])
}
}
}
-   for (i = 0; howto_names[i].ev != NULL; i++)
-   if (howto & howto_names[i].mask)
-   setenv(howto_names[i].ev, "YES", 1);
+
+   bootenv_set(howto);
 
/*
 * XXX we need fallback to this stuff after looking at the ConIn, 
ConOut and ConErr variables

Modified: head/stand/i386/libi386/bootinfo.c
==
--- head/stand/i386/libi386/bootinfo.c  Sat Jun  9 15:28:37 2018
(r334884)
+++ head/stand/i386/libi386/bootinfo.c  Sat Jun  9 15:52:29 2018
(r334885)
@@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include "bootstrap.h"
 #include "libi386.h"
 #include "btxv86.h"
@@ -130,11 +129,8 @@ bi_getboothowto(char *kargs)
 void
 bi_setboothowto(int howto)
 {
-inti;
 
-for (i = 0; howto_names[i].ev != NULL; i++)
-   if (howto & howto_names[i].mask)
-   setenv(howto_names[i].ev, "YES", 1);
+bootenv_set(howto);
 }
 
 /*

Modified: head/stand/userboot/userboot/bootinfo.c
==
--- head/stand/userboot/userboot/bootinfo.c Sat Jun  9 15:28:37 2018
(r334884)
+++ head/stand/userboot/userboot/bootinfo.c Sat Jun  9 15:52:29 2018
(r334885)
@@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 
 #include "bootstrap.h"
 #include "libuserboot.h"
@@ -131,11 +130,8 @@ bi_getboothowto(char *kargs)
 void
 bi_setboothowto(int howto)
 {
-inti;
 
-for (i = 0; howto_names[i].ev != NULL; i++)
-   if (howto & howto_names[i].mask)
-   setenv(howto_names[i].ev, "YES", 1);
+bootenv_set(howto);
 }
 
 /*
___
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: r334877 - head/tests/sys/netpfil/pf

2018-06-09 Thread Kristof Provost
Author: kp
Date: Sat Jun  9 14:21:07 2018
New Revision: 334877
URL: https://svnweb.freebsd.org/changeset/base/334877

Log:
  pf tests: Basic route-to tests
  
  Very basic route-to tests. These tests attempt to provoke PR 228782 for IPv4
  and IPv6. A test failure will panic the machine.

Added:
  head/tests/sys/netpfil/pf/route_to.sh   (contents, props changed)
Modified:
  head/tests/sys/netpfil/pf/Makefile

Modified: head/tests/sys/netpfil/pf/Makefile
==
--- head/tests/sys/netpfil/pf/Makefile  Sat Jun  9 14:17:06 2018
(r334876)
+++ head/tests/sys/netpfil/pf/Makefile  Sat Jun  9 14:21:07 2018
(r334877)
@@ -8,7 +8,8 @@ TESTS_SUBDIRS+= ioctl
 ATF_TESTS_SH+= pass_block \
forward \
fragmentation \
-   set_tos
+   set_tos \
+   route_to
 
 ${PACKAGE}FILES+=  utils.subr \
pft_ping.py

Added: head/tests/sys/netpfil/pf/route_to.sh
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tests/sys/netpfil/pf/route_to.sh   Sat Jun  9 14:21:07 2018
(r334877)
@@ -0,0 +1,81 @@
+# $FreeBSD$
+
+. $(atf_get_srcdir)/utils.subr
+
+atf_test_case "v4" "cleanup"
+v4_head()
+{
+   atf_set descr 'Basic route-to test'
+   atf_set require.user root
+}
+
+v4_body()
+{
+   pft_init
+
+   epair_send=$(pft_mkepair)
+   ifconfig ${epair_send}a 192.0.2.1/24 up
+   epair_route=$(pft_mkepair)
+   ifconfig ${epair_route}a 203.0.113.1/24 up
+
+   pft_mkjail alcatraz ${epair_send}b ${epair_route}b
+   jexec alcatraz ifconfig ${epair_send}b 192.0.2.2/24 up
+   jexec alcatraz ifconfig ${epair_route}b 203.0.113.2/24 up
+   jexec alcatraz route add -net 198.51.100.0/24 192.0.2.1
+   jexec alcatraz pfctl -e
+
+   # Attempt to provoke PR 228782
+   pft_set_rules alcatraz "block all" "pass user 2" \
+   "pass out route-to (${epair_route}b 203.0.113.1) from 192.0.2.2 
to 198.51.100.1 no state"
+   jexec alcatraz nc -w 3 -s 192.0.2.2 198.51.100.1 22
+
+   # atf wants us to not return an error, but our netcat will fail
+   true
+}
+
+v4_cleanup()
+{
+   pft_cleanup
+}
+
+atf_test_case "v6" "cleanup"
+v6_head()
+{
+   atf_set descr 'Basic route-to test (IPv6)'
+   atf_set require.user root
+}
+
+v6_body()
+{
+   pft_init
+
+   epair_send=$(pft_mkepair)
+   ifconfig ${epair_send}a inet6 2001:db8:42::1/64 up no_dad -ifdisabled
+   epair_route=$(pft_mkepair)
+   ifconfig ${epair_route}a inet6 2001:db8:43::1/64 up no_dad -ifdisabled
+
+   pft_mkjail alcatraz ${epair_send}b ${epair_route}b
+   jexec alcatraz ifconfig ${epair_send}b inet6 2001:db8:42::2/64 up no_dad
+   jexec alcatraz ifconfig ${epair_route}b inet6 2001:db8:43::2/64 up 
no_dad
+   jexec alcatraz route add -6 2001:db8:666::/64 2001:db8:42::2
+   jexec alcatraz pfctl -e
+
+   # Attempt to provoke PR 228782
+   pft_set_rules alcatraz "block all" "pass user 2" \
+   "pass out route-to (${epair_route}b 2001:db8:43::1) from 
2001:db8:42::2 to 2001:db8:666::1 no state"
+   jexec alcatraz nc -6 -w 3 -s 2001:db8:42::2 2001:db8:666::1 22
+
+   # atf wants us to not return an error, but our netcat will fail
+   true
+}
+
+v6_cleanup()
+{
+   pft_cleanup
+}
+
+atf_init_test_cases()
+{
+   atf_add_test_case "v4"
+   atf_add_test_case "v6"
+}
___
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: r334827 - in head/sys: amd64/amd64 arm/arm dev/hwpmc i386/i386 kern mips/atheros mips/cavium powerpc/powerpc sys

2018-06-09 Thread John Baldwin
On 6/8/18 12:34 PM, Matthew Macy wrote:
>> The fact that our NMI handler isn't re-entrant can lead to subtle
>> problems. If while executing the NMI handler we hit a dtrace
>> probe or DDB breakpoint, the iret executed upon return to the handler
>> will re-enable NMIs. Then, if a second NMI arrives before the handler
>> for the first has returned, the trapframe will be clobbered. Did you
>> rule out an issue like this?
> 
> No, but it happened instantly on all CPUs an a non-debug kernel 100%
> of the time after I changed pmc_process_interrupt earlier this week.
> My voodoo fix now avoids it. What you're describing sounds episodic
> and doesn't sound like it would be fixed / worked around by my change.

OTOH, a compiler bug will crop up in other places.  It is best to run
it to ground.  Can you describe what the bug was in more detail?
It would probably not be hard to come up with something you can run
creduce against to get down to a test case.  If you do that, the
LLVM folks are quite helpful and able at fixing the issue which fixes
it in more places than just here.

-- 
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: r334878 - head/stand/libsa

2018-06-09 Thread Kyle Evans
Author: kevans
Date: Sat Jun  9 14:24:16 2018
New Revision: 334878
URL: https://svnweb.freebsd.org/changeset/base/334878

Log:
  libsa(3): Correct statement about FS Write-support, name change
  
  - jhb implemented UFS write support a little over 16 years ago.
  - Update the library name while we're here.
  
  Reviewed by:  jhb, rpokala
  Differential Revision:https://reviews.freebsd.org/D14476

Modified:
  head/stand/libsa/libsa.3

Modified: head/stand/libsa/libsa.3
==
--- head/stand/libsa/libsa.3Sat Jun  9 14:21:07 2018(r334877)
+++ head/stand/libsa/libsa.3Sat Jun  9 14:24:16 2018(r334878)
@@ -24,11 +24,11 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 1, 2018
-.Dt LIBSTAND 3
+.Dd February 22, 2018
+.Dt LIBSA 3
 .Os
 .Sh NAME
-.Nm libstand
+.Nm libsa
 .Nd support library for standalone executables
 .Sh SYNOPSIS
 .In stand.h
@@ -402,8 +402,8 @@ except that file creation is not supported, so the mod
 required.
 The
 .Fa flags
-argument may be one of O_RDONLY, O_WRONLY and O_RDWR (although no file systems
-currently support writing).
+argument may be one of O_RDONLY, O_WRONLY and O_RDWR.
+Only UFS currently supports writing.
 .It Xo
 .Ft int
 .Fn close "int fd"
___
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: r334879 - head/stand/lua

2018-06-09 Thread Kyle Evans
Author: kevans
Date: Sat Jun  9 14:26:30 2018
New Revision: 334879
URL: https://svnweb.freebsd.org/changeset/base/334879

Log:
  lualoader: Add hook.lua(8) to tree
  
  Reviewed by:  rpokala (w/ "All Rights Reserved" previously added)
  Differential Revision:https://reviews.freebsd.org/D14815

Added:
  head/stand/lua/hook.lua.8   (contents, props changed)

Added: head/stand/lua/hook.lua.8
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/stand/lua/hook.lua.8   Sat Jun  9 14:26:30 2018(r334879)
@@ -0,0 +1,94 @@
+.\"
+.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+.\"
+.\" Copyright (c) 2018 Kyle Evans 
+.\"
+.\" 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd June 9, 2018
+.Dt HOOK.LUA 8
+.Os
+.Sh NAME
+.Nm hook.lua
+.Nd FreeBSD hook module
+.Sh DESCRIPTION
+.Nm
+contains functionality for defining hook types and attaching hooks.
+Hooks are functions used to attach custom behaviors at pre-defined points in
+loader execution.
+These pre-defined points are what we refer to as
+.Dq hook types .
+.Pp
+Before using the functionality provided by
+.Nm ,
+it must be included with a statement such as the following:
+.Pp
+.Dl local hook = require("hook")
+.Ss Exported functions
+The following functions are exported from
+.Nm :
+.Bl -tag -width hook.registerType -offset indent
+.It Fn hook.registerType hooktype
+Adds
+.Ev hooktype
+as a recognized hook type.
+This allows functions to be added to run when hooks of this type are invoked
+using
+.Fn hook.runAll hooktype .
+.It Fn hook.register hooktype hookfunc
+Register
+.Ev hookfunc
+to be run when hooks of type
+.Ev hooktype
+are invoked.
+.It Fn hook.runAll hooktype
+Invoke all hooks registered for type
+.Ev hooktype .
+Hooks are invoked in the order in which they are registered.
+.El
+.Ss Hook Naming Guidelines
+Hook names should consist of the name of the module they are defined in, as 
well
+as a verb describing when the hook is executed, separated by a period.
+For example,
+.Dq config.reloaded
+is defined in the
+.Xr config.lua 8
+module and run when the configuration is reloaded.
+.Sh EXAMPLES
+To register a hook to be run when configuration is reloaded:
+.Pp
+.Bd -literal -offset indent -compact
+local hook = require("hook")
+
+local function configuration_was_reloaded()
+   print("Configuration was reloaded!")
+end
+
+hook.register("config.reloaded", configuration_was_reloaded)
+.Ed
+.Sh AUTHORS
+The
+.Nm
+file was originally written by
+.An Kyle Evans Aq Mt kev...@freebsd.org .
___
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: r334864 - head/usr.bin/top

2018-06-09 Thread Eitan Adler
On 9 June 2018 at 08:54, Eitan Adler  wrote:
> On 8 June 2018 at 23:13, Florian Smeets  wrote:
>> On 09.06.18 04:14, Eitan Adler wrote:
>>> Author: eadler
>>> Date: Sat Jun  9 02:14:33 2018
>>> New Revision: 334864
>>> URL: https://svnweb.freebsd.org/changeset/base/334864
>>>
>>> Log:
>>>   top(1): use a different command to toggle tid vs pid
>>
>> Thank you.
>>
>> You cannot start top with -T unless you add something like the following:
>
> I have a patch out for this, but svn is having issues right now (or at
> least I am).
>
>> Another issue I just found is that if you start top with -P some columns
>> don't show any values:
>
>>
>> It is correct if you start top with -TP or -HP, or if you start top -P
>> and then use H or T to switch back and forth. I'm not sure in which
>> revision this was broken, it works with r333899.
>
> I'm guessing this is because I forgot to initalize "prehead"
> somewhere. I'd like to rewrite the entire header creation, but will
> try and fix this. Thanks for the report!

By header, I meant header and data format string :)


-- 
Eitan Adler
Source, Ports, Doc committer
Bugmeister, Ports Security teams
___
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: r334880 - head/sys/dev/vnic

2018-06-09 Thread Andrew Turner
Author: andrew
Date: Sat Jun  9 14:47:49 2018
New Revision: 334880
URL: https://svnweb.freebsd.org/changeset/base/334880

Log:
  In the ThunderX BGX network driver we were skipping the NULL terminator
  when parsing the phy type, however this is included in the length returned
  by OF_getprop. To fix this stop ignoring the terminator.
  
  PR:   228828
  Reported by:  sbruno
  Sponsored by: DARPA, AFRL

Modified:
  head/sys/dev/vnic/thunder_bgx_fdt.c

Modified: head/sys/dev/vnic/thunder_bgx_fdt.c
==
--- head/sys/dev/vnic/thunder_bgx_fdt.c Sat Jun  9 14:26:30 2018
(r334879)
+++ head/sys/dev/vnic/thunder_bgx_fdt.c Sat Jun  9 14:47:49 2018
(r334880)
@@ -93,44 +93,44 @@ bgx_fdt_phy_mode_match(struct bgx *bgx, char *qlm_mode
switch (bgx->qlm_mode) {
case QLM_MODE_SGMII:
type = "sgmii";
-   sz = sizeof("sgmii") - 1;
+   sz = sizeof("sgmii");
offset = size - sz;
break;
case QLM_MODE_XAUI_1X4:
type = "xaui";
-   sz = sizeof("xaui") - 1;
+   sz = sizeof("xaui");
offset = size - sz;
if (offset < 0)
return (FALSE);
if (strncmp(_mode[offset], type, sz) == 0)
return (TRUE);
type = "dxaui";
-   sz = sizeof("dxaui") - 1;
+   sz = sizeof("dxaui");
offset = size - sz;
break;
case QLM_MODE_RXAUI_2X2:
type = "raui";
-   sz = sizeof("raui") - 1;
+   sz = sizeof("raui");
offset = size - sz;
break;
case QLM_MODE_XFI_4X1:
type = "xfi";
-   sz = sizeof("xfi") - 1;
+   sz = sizeof("xfi");
offset = size - sz;
break;
case QLM_MODE_XLAUI_1X4:
type = "xlaui";
-   sz = sizeof("xlaui") - 1;
+   sz = sizeof("xlaui");
offset = size - sz;
break;
case QLM_MODE_10G_KR_4X1:
type = "xfi-10g-kr";
-   sz = sizeof("xfi-10g-kr") - 1;
+   sz = sizeof("xfi-10g-kr");
offset = size - sz;
break;
case QLM_MODE_40G_KR4_1X4:
type = "xlaui-40g-kr";
-   sz = sizeof("xlaui-40g-kr") - 1;
+   sz = sizeof("xlaui-40g-kr");
offset = size - sz;
break;
default:
@@ -155,37 +155,37 @@ bgx_fdt_phy_name_match(struct bgx *bgx, char *phy_name
switch (bgx->qlm_mode) {
case QLM_MODE_SGMII:
type = "sgmii";
-   sz = sizeof("sgmii") - 1;
+   sz = sizeof("sgmii");
break;
case QLM_MODE_XAUI_1X4:
type = "xaui";
-   sz = sizeof("xaui") - 1;
+   sz = sizeof("xaui");
if (sz < size)
return (FALSE);
if (strncmp(phy_name, type, sz) == 0)
return (TRUE);
type = "dxaui";
-   sz = sizeof("dxaui") - 1;
+   sz = sizeof("dxaui");
break;
case QLM_MODE_RXAUI_2X2:
type = "raui";
-   sz = sizeof("raui") - 1;
+   sz = sizeof("raui");
break;
case QLM_MODE_XFI_4X1:
type = "xfi";
-   sz = sizeof("xfi") - 1;
+   sz = sizeof("xfi");
break;
case QLM_MODE_XLAUI_1X4:
type = "xlaui";
-   sz = sizeof("xlaui") - 1;
+   sz = sizeof("xlaui");
break;
case QLM_MODE_10G_KR_4X1:
type = "xfi-10g-kr";
-   sz = sizeof("xfi-10g-kr") - 1;
+   sz = sizeof("xfi-10g-kr");
break;
case QLM_MODE_40G_KR4_1X4:
type = "xlaui-40g-kr";
-   sz = sizeof("xlaui-40g-kr") - 1;
+   sz = sizeof("xlaui-40g-kr");
break;
default:
return (FALSE);
___
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: r334876 - head/sys/netpfil/pf

2018-06-09 Thread Kristof Provost
Author: kp
Date: Sat Jun  9 14:17:06 2018
New Revision: 334876
URL: https://svnweb.freebsd.org/changeset/base/334876

Log:
  pf: Fix deadlock with route-to
  
  If a locally generated packet is routed (with route-to/reply-to/dup-to) out of
  a different interface it's passed through the firewall again. This meant we
  lost the inp pointer and if we required the pointer (e.g. for user ID 
matching)
  we'd deadlock trying to acquire an inp lock we've already got.
  
  Pass the inp pointer along with pf_route()/pf_route6().
  
  PR:   228782
  MFC after:1 week

Modified:
  head/sys/netpfil/pf/pf.c

Modified: head/sys/netpfil/pf/pf.c
==
--- head/sys/netpfil/pf/pf.cSat Jun  9 09:57:14 2018(r334875)
+++ head/sys/netpfil/pf/pf.cSat Jun  9 14:17:06 2018(r334876)
@@ -295,14 +295,14 @@ static voidpf_mtag_free(struct m_tag *);
 #ifdef INET
 static void pf_route(struct mbuf **, struct pf_rule *, int,
struct ifnet *, struct pf_state *,
-   struct pf_pdesc *);
+   struct pf_pdesc *, struct inpcb *);
 #endif /* INET */
 #ifdef INET6
 static void pf_change_a6(struct pf_addr *, u_int16_t *,
struct pf_addr *, u_int8_t);
 static void pf_route6(struct mbuf **, struct pf_rule *, int,
struct ifnet *, struct pf_state *,
-   struct pf_pdesc *);
+   struct pf_pdesc *, struct inpcb *);
 #endif /* INET6 */
 
 int in4_cksum(struct mbuf *m, u_int8_t nxt, int off, int len);
@@ -5442,7 +5442,7 @@ pf_routable(struct pf_addr *addr, sa_family_t af, stru
 #ifdef INET
 static void
 pf_route(struct mbuf **m, struct pf_rule *r, int dir, struct ifnet *oifp,
-struct pf_state *s, struct pf_pdesc *pd)
+struct pf_state *s, struct pf_pdesc *pd, struct inpcb *inp)
 {
struct mbuf *m0, *m1;
struct sockaddr_in  dst;
@@ -5510,7 +5510,7 @@ pf_route(struct mbuf **m, struct pf_rule *r, int dir, 
goto bad;
 
if (oifp != ifp) {
-   if (pf_test(PF_OUT, 0, ifp, , NULL) != PF_PASS)
+   if (pf_test(PF_OUT, 0, ifp, , inp) != PF_PASS)
goto bad;
else if (m0 == NULL)
goto done;
@@ -5603,7 +5603,7 @@ bad:
 #ifdef INET6
 static void
 pf_route6(struct mbuf **m, struct pf_rule *r, int dir, struct ifnet *oifp,
-struct pf_state *s, struct pf_pdesc *pd)
+struct pf_state *s, struct pf_pdesc *pd, struct inpcb *inp)
 {
struct mbuf *m0;
struct sockaddr_in6 dst;
@@ -5672,7 +5672,7 @@ pf_route6(struct mbuf **m, struct pf_rule *r, int dir,
goto bad;
 
if (oifp != ifp) {
-   if (pf_test6(PF_OUT, PFIL_FWD, ifp, , NULL) != PF_PASS)
+   if (pf_test6(PF_OUT, PFIL_FWD, ifp, , inp) != PF_PASS)
goto bad;
else if (m0 == NULL)
goto done;
@@ -6236,7 +6236,7 @@ done:
default:
/* pf_route() returns unlocked. */
if (r->rt) {
-   pf_route(m0, r, dir, kif->pfik_ifp, s, );
+   pf_route(m0, r, dir, kif->pfik_ifp, s, , inp);
return (action);
}
break;
@@ -6633,7 +6633,7 @@ done:
default:
/* pf_route6() returns unlocked. */
if (r->rt) {
-   pf_route6(m0, r, dir, kif->pfik_ifp, s, );
+   pf_route6(m0, r, dir, kif->pfik_ifp, s, , inp);
return (action);
}
break;
___
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: r334882 - in head/stand: common efi/loader i386/libi386 userboot/userboot

2018-06-09 Thread Kyle Evans
Author: kevans
Date: Sat Jun  9 15:10:39 2018
New Revision: 334882
URL: https://svnweb.freebsd.org/changeset/base/334882

Log:
  stand: Consolidate checking for boot flags driven by environment vars
  
  e.g. boot_mute, boot_single, boot_verbose, and friends; we checked for these
  in multiple places, consolidate into common/ and allow a setting of "NO" for
  any of these to turn them off. This allows systems with multiple
  loader.conf(5) or loader.conf(5) overlay systems to easily turn off
  variables in later processed files by setting it to NO.
  
  Reported by:  Nick Wolff @ iXsystems
  Reviewed by:  imp

Modified:
  head/stand/common/boot.c
  head/stand/common/bootstrap.h
  head/stand/common/metadata.c
  head/stand/efi/loader/bootinfo.c
  head/stand/i386/libi386/bootinfo.c
  head/stand/userboot/userboot/bootinfo.c

Modified: head/stand/common/boot.c
==
--- head/stand/common/boot.cSat Jun  9 14:50:38 2018(r334881)
+++ head/stand/common/boot.cSat Jun  9 15:10:39 2018(r334882)
@@ -32,6 +32,8 @@ __FBSDID("$FreeBSD$");
  */
 
 #include 
+#include 
+#include 
 #include 
 
 #include "bootstrap.h"
@@ -156,6 +158,20 @@ autoboot_maybe()
cp = getenv("autoboot_delay");
if ((autoboot_tried == 0) && ((cp == NULL) || strcasecmp(cp, "NO")))
autoboot(-1, NULL); /* try to boot automatically */
+}
+
+int
+bootenv_flags()
+{
+   int i, howto;
+   char *val;
+
+   for (howto = 0, i = 0; howto_names[i].ev != NULL; i++) {
+   val = getenv(howto_names[i].ev);
+   if (val != NULL && strcasecmp(val, "no") != 0)
+   howto |= howto_names[i].mask;
+   }
+   return (howto);
 }
 
 static int

Modified: head/stand/common/bootstrap.h
==
--- head/stand/common/bootstrap.h   Sat Jun  9 14:50:38 2018
(r334881)
+++ head/stand/common/bootstrap.h   Sat Jun  9 15:10:39 2018
(r334882)
@@ -63,6 +63,7 @@ int   parse(int *argc, char ***argv, const char *str);
 /* boot.c */
 void   autoboot_maybe(void);
 intgetrootmount(char *rootdev);
+intbootenv_flags(void);
 
 /* misc.c */
 char   *unargv(int argc, char *argv[]);

Modified: head/stand/common/metadata.c
==
--- head/stand/common/metadata.cSat Jun  9 14:50:38 2018
(r334881)
+++ head/stand/common/metadata.cSat Jun  9 15:10:39 2018
(r334882)
@@ -31,9 +31,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include 
 #include 
-#include 
 #if defined(LOADER_FDT_SUPPORT)
 #include 
 #endif
@@ -100,7 +98,6 @@ md_getboothowto(char *kargs)
 char   *cp;
 inthowto;
 intactive;
-inti;
 
 /* Parse kargs */
 howto = 0;
@@ -153,10 +150,7 @@ md_getboothowto(char *kargs)
}
 }
 
-/* get equivalents from the environment */
-for (i = 0; howto_names[i].ev != NULL; i++)
-   if (getenv(howto_names[i].ev) != NULL)
-   howto |= howto_names[i].mask;
+howto |= bootenv_flags();
 #if defined(__sparc64__)
 if (md_bootserial() != -1)
howto |= RB_SERIAL;

Modified: head/stand/efi/loader/bootinfo.c
==
--- head/stand/efi/loader/bootinfo.cSat Jun  9 14:50:38 2018
(r334881)
+++ head/stand/efi/loader/bootinfo.cSat Jun  9 15:10:39 2018
(r334882)
@@ -32,9 +32,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -72,15 +71,9 @@ bi_getboothowto(char *kargs)
const char *sw;
char *opts;
char *console;
-   int howto, i;
+   int howto;
 
-   howto = 0;
-
-   /* Get the boot options from the environment first. */
-   for (i = 0; howto_names[i].ev != NULL; i++) {
-   if (getenv(howto_names[i].ev) != NULL)
-   howto |= howto_names[i].mask;
-   }
+   howto = bootenv_flags();
 
console = getenv("console");
if (console != NULL) {

Modified: head/stand/i386/libi386/bootinfo.c
==
--- head/stand/i386/libi386/bootinfo.c  Sat Jun  9 14:50:38 2018
(r334881)
+++ head/stand/i386/libi386/bootinfo.c  Sat Jun  9 15:10:39 2018
(r334882)
@@ -43,7 +43,6 @@ bi_getboothowto(char *kargs)
 char   *curpos, *next, *string;
 inthowto;
 intactive;
-inti;
 intvidconsole;
 
 /* Parse kargs */
@@ -96,10 +95,7 @@ bi_getboothowto(char *kargs)
cp++;
}
 }
-/* get equivalents from the environment */
-for (i = 0; howto_names[i].ev != NULL; 

svn commit: r334884 - head/stand/common

2018-06-09 Thread Kyle Evans
Author: kevans
Date: Sat Jun  9 15:28:37 2018
New Revision: 334884
URL: https://svnweb.freebsd.org/changeset/base/334884

Log:
  stand: Fix build after r334882
  
  Not sure how this was not caught in Universe.

Modified:
  head/stand/common/metadata.c

Modified: head/stand/common/metadata.c
==
--- head/stand/common/metadata.cSat Jun  9 15:10:49 2018
(r334883)
+++ head/stand/common/metadata.cSat Jun  9 15:28:37 2018
(r334884)
@@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #if defined(LOADER_FDT_SUPPORT)
 #include 
 #endif
___
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: r334867 - in head: lib usr.sbin

2018-06-09 Thread John Baldwin
On 6/8/18 10:25 PM, Matt Macy wrote:
> Author: mmacy
> Date: Sat Jun  9 02:25:18 2018
> New Revision: 334867
> URL: https://svnweb.freebsd.org/changeset/base/334867
> 
> Log:
>   pmc: fix logic in skipping riscv

This would still appear to not be right as eventually riscv will
use llvm.  Also, I wonder if the more normal way of handling
this would be to make MK_PMC a BROKEN_OPTION for riscv in
src.opts.mk as then it is centralized in one place.

Similarly, what is the actual compiler requirement?  If you need C++11
support for example then it would be better to express this
in terms of COMPILER_FEATURES (and that might also be doable in
src.opts.mk so that it is centralized).

> Modified:
>   head/lib/Makefile
>   head/usr.sbin/Makefile
> 
> Modified: head/lib/Makefile
> ==
> --- head/lib/Makefile Sat Jun  9 02:18:15 2018(r334866)
> +++ head/lib/Makefile Sat Jun  9 02:25:18 2018(r334867)
> @@ -202,7 +202,7 @@ _libdl=   libdl
>  .endif
>  
>  SUBDIR.${MK_OPENSSL}+=   libmp
> -.if (${COMPILER_TYPE} == "clang" || (${COMPILER_TYPE} == "gcc" && 
> ${COMPILER_VERSION} >= 60100) && ${MACHINE_CPUARCH} != "riscv")
> +.if (${COMPILER_TYPE} == "clang" || (${COMPILER_TYPE} == "gcc" && 
> ${COMPILER_VERSION} >= 60100 && ${MACHINE_CPUARCH} != "riscv"))
>  SUBDIR.${MK_PMC}+=   libpmc libpmcstat
>  .endif
>  SUBDIR.${MK_RADIUS_SUPPORT}+=libradius
> 
> Modified: head/usr.sbin/Makefile
> ==
> --- head/usr.sbin/MakefileSat Jun  9 02:18:15 2018(r334866)
> +++ head/usr.sbin/MakefileSat Jun  9 02:25:18 2018(r334867)
> @@ -179,7 +179,7 @@ SUBDIR.${MK_OPENSSL}+=keyserv
>  SUBDIR.${MK_PC_SYSINSTALL}+= pc-sysinstall
>  SUBDIR.${MK_PF}+=ftp-proxy
>  SUBDIR.${MK_PKGBOOTSTRAP}+=  pkg
> -.if (${COMPILER_TYPE} == "clang" || (${COMPILER_TYPE} == "gcc" && 
> ${COMPILER_VERSION} >= 60100) && ${MACHINE_CPUARCH} != "riscv")
> +.if (${COMPILER_TYPE} == "clang" || (${COMPILER_TYPE} == "gcc" && 
> ${COMPILER_VERSION} >= 60100 && ${MACHINE_CPUARCH} != "riscv"))
>  SUBDIR.${MK_PMC}+=   pmc
>  SUBDIR.${MK_PMC}+=   pmcannotate
>  SUBDIR.${MK_PMC}+=   pmccontrol
> 


-- 
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: r334844 - in head: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/cmd/ztest cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/openso

2018-06-09 Thread Alexey Dokuchaev
On Fri, Jun 08, 2018 at 05:38:28PM +, Sean Eric Fagan wrote:
> New Revision: 334844
> URL: https://svnweb.freebsd.org/changeset/base/334844
> 
> Log:
>   This originated from ZFS On Linux [...]
>   
>   During scans (scrubs or resilvers), it sorts the blocks in each
>   transaction group by block offset; the result can be a significant
>   improvement.

That's pretty cool, thanks for bringing this in!  Couple of comments
about the commit itself (not the code).

> @@ -2281,14 +2281,14 @@ dump_dir(objset_t *os)
>   object_count++;
>   }
>  
> - ASSERT3U(object_count, ==, usedobjs);
> -
>   (void) printf("\n");
>  
>   if (error != ESRCH) {
>   (void) fprintf(stderr, "dmu_object_next() = %d\n", error);
>   abort();
>   }
> +
> + ASSERT3U(object_count, ==, usedobjs);

This seems to be about something else, not the sorting of blocks, is it?

> - if (ps && ps->pss_state == DSS_SCANNING &&
> + if (ps != NULL && ps->pss_state == DSS_SCANNING &&
...
> - /*
> -  * Scan is finished or canceled.
> -  */
> - if (ps->pss_state == DSS_FINISHED) {
> - uint64_t minutes_taken = (end - start) / 60;
> - char *fmt = NULL;
>  
> + /* Scan is finished or canceled. */
> + if (ps->pss_state == DSS_FINISHED) {

Ideally, style fixes should be committed separately from the functional
changes.

> - if (ps && ps->pss_func == POOL_SCAN_RESILVER &&
> + if (ps != NULL && ps->pss_func == POOL_SCAN_RESILVER &&
>   ps->pss_state == DSS_SCANNING)
>   return (ZPOOL_STATUS_RESILVERING);

There're not awfully many of them, but still.

./danfe
___
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: r334883 - head/cddl/contrib/opensolaris/tools/ctf/cvt

2018-06-09 Thread Mark Johnston
Author: markj
Date: Sat Jun  9 15:10:49 2018
New Revision: 334883
URL: https://svnweb.freebsd.org/changeset/base/334883

Log:
  Don't process DWARF generated from non-C/C++ code.
  
  ctfconvert(1) is not designed to handle DWARF generated from such code,
  and will generally fail in non-obvious ways.  Use an explicit check to
  help catch such potential failures.
  
  Reported by:  Johannes Lundberg 
  MFC after:2 weeks

Modified:
  head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c

Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
==
--- head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Sat Jun  9 15:10:39 
2018(r334882)
+++ head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Sat Jun  9 15:10:49 
2018(r334883)
@@ -1901,7 +1901,7 @@ should_have_dwarf(Elf *elf)
 int
 dw_read(tdata_t *td, Elf *elf, char *filename __unused)
 {
-   Dwarf_Unsigned abboff, hdrlen, nxthdr;
+   Dwarf_Unsigned abboff, hdrlen, lang, nxthdr;
Dwarf_Half vers, addrsz, offsz;
Dwarf_Die cu = 0;
Dwarf_Die child = 0;
@@ -1941,8 +1941,8 @@ dw_read(tdata_t *td, Elf *elf, char *filename __unused
}
 
if ((rc = dwarf_next_cu_header_b(dw.dw_dw, , , ,
-   , , NULL, , _err)) != DW_DLV_OK) {
-   if (dw.dw_err.err_error ==  DW_DLE_NO_ENTRY)
+   , , NULL, , _err)) != DW_DLV_OK) {
+   if (dw.dw_err.err_error == DW_DLE_NO_ENTRY)
exit(0);
else
terminate("rc = %d %s\n", rc, dwarf_errmsg(dw.dw_err));
@@ -1971,6 +1971,25 @@ dw_read(tdata_t *td, Elf *elf, char *filename __unused
debug(1, "DWARF emitter: %s\n", prod);
free(prod);
}
+
+   if (dwarf_attrval_unsigned(cu, DW_AT_language, , _err) == 0)
+   switch (lang) {
+   case DW_LANG_C:
+   case DW_LANG_C89:
+   case DW_LANG_C99:
+   case DW_LANG_C11:
+   case DW_LANG_C_plus_plus:
+   case DW_LANG_C_plus_plus_03:
+   case DW_LANG_C_plus_plus_11:
+   case DW_LANG_C_plus_plus_14:
+   break;
+   default:
+   terminate("file contains DWARF for unsupported "
+   "language %d", lang);
+   }
+   else
+   warning("die %llu: failed to get language attribute: %s\n",
+   die_off(, cu), dwarf_errmsg(dw.dw_err));
 
if ((dw.dw_cuname = die_name(, cu)) != NULL) {
char *base = xstrdup(basename(dw.dw_cuname));
___
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: r334881 - head/contrib/elftoolchain/libdwarf

2018-06-09 Thread Mark Johnston
Author: markj
Date: Sat Jun  9 14:50:38 2018
New Revision: 334881
URL: https://svnweb.freebsd.org/changeset/base/334881

Log:
  Add DW_LANG_* definitions from DWARF 4 and 5.
  
  Reviewed by:  emaste
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D15712

Modified:
  head/contrib/elftoolchain/libdwarf/dwarf.h
  head/contrib/elftoolchain/libdwarf/dwarf_dump.c

Modified: head/contrib/elftoolchain/libdwarf/dwarf.h
==
--- head/contrib/elftoolchain/libdwarf/dwarf.h  Sat Jun  9 14:47:49 2018
(r334880)
+++ head/contrib/elftoolchain/libdwarf/dwarf.h  Sat Jun  9 14:50:38 2018
(r334881)
@@ -523,6 +523,24 @@
 #define DW_LANG_ObjC_plus_plus 0x0011
 #define DW_LANG_UPC0x0012
 #define DW_LANG_D  0x0013
+#define DW_LANG_Python 0x0014
+#define DW_LANG_OpenCL 0x0015
+#define DW_LANG_Go 0x0016
+#define DW_LANG_Modula30x0017
+#define DW_LANG_Haskell0x0018
+#define DW_LANG_C_plus_plus_03 0x0019
+#define DW_LANG_C_plus_plus_11 0x001a
+#define DW_LANG_OCaml  0x001b
+#define DW_LANG_Rust   0x001c
+#define DW_LANG_C110x001d
+#define DW_LANG_Swift  0x001e
+#define DW_LANG_Julia  0x001f
+#define DW_LANG_Dylan  0x0020
+#define DW_LANG_C_plus_plus_14 0x0021
+#define DW_LANG_Fortran03  0x0022
+#define DW_LANG_Fortran08  0x0023
+#define DW_LANG_RenderScript   0x0024
+#define DW_LANG_BLISS  0x0025
 #define DW_LANG_lo_user0x8000
 #define DW_LANG_Mips_Assembler 0x8001
 #define DW_LANG_hi_user0x

Modified: head/contrib/elftoolchain/libdwarf/dwarf_dump.c
==
--- head/contrib/elftoolchain/libdwarf/dwarf_dump.c Sat Jun  9 14:47:49 
2018(r334880)
+++ head/contrib/elftoolchain/libdwarf/dwarf_dump.c Sat Jun  9 14:50:38 
2018(r334881)
@@ -788,6 +788,42 @@ dwarf_get_LANG_name(unsigned lang, const char **s)
*s = "DW_LANG_UPC"; break;
case DW_LANG_D:
*s = "DW_LANG_D"; break;
+   case DW_LANG_Python:
+   *s = "DW_LANG_Python"; break;
+   case DW_LANG_OpenCL:
+   *s = "DW_LANG_OpenCL"; break;
+   case DW_LANG_Go:
+   *s = "DW_LANG_Go"; break;
+   case DW_LANG_Modula3:
+   *s = "DW_LANG_Modula3"; break;
+   case DW_LANG_Haskell:
+   *s = "DW_LANG_Haskell"; break;
+   case DW_LANG_C_plus_plus_03:
+   *s = "DW_LANG_C_plus_plus_03"; break;
+   case DW_LANG_C_plus_plus_11:
+   *s = "DW_LANG_C_plus_plus_11"; break;
+   case DW_LANG_OCaml:
+   *s = "DW_LANG_OCaml"; break;
+   case DW_LANG_Rust:
+   *s = "DW_LANG_Rust"; break;
+   case DW_LANG_C11:
+   *s = "DW_LANG_C11"; break;
+   case DW_LANG_Swift:
+   *s = "DW_LANG_Swift"; break;
+   case DW_LANG_Julia:
+   *s = "DW_LANG_Julia"; break;
+   case DW_LANG_Dylan:
+   *s = "DW_LANG_Dylan"; break;
+   case DW_LANG_C_plus_plus_14:
+   *s = "DW_LANG_C_plus_plus_14"; break;
+   case DW_LANG_Fortran03:
+   *s = "DW_LANG_Fortran03"; break;
+   case DW_LANG_Fortran08:
+   *s = "DW_LANG_Fortran08"; break;
+   case DW_LANG_RenderScript:
+   *s = "DW_LANG_RenderScript"; break;
+   case DW_LANG_BLISS:
+   *s = "DW_LANG_BLISS"; break;
case DW_LANG_lo_user:
*s = "DW_LANG_lo_user"; break;
case DW_LANG_Mips_Assembler:
___
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: r334875 - head/sys/net

2018-06-09 Thread Andrey V. Elsukov
Author: ae
Date: Sat Jun  9 09:57:14 2018
New Revision: 334875
URL: https://svnweb.freebsd.org/changeset/base/334875

Log:
  Explicitly change the link state when we assingn an address.
  
  Since we are setting IFF_UP flag on SIOCSIFADDR, it is possible, that
  after this link state information still not initialized properly.
  This leads to problems with routing, since now interface has
  IFCAP_LINKSTATE capability and a route is considered as working only
  when interface's link state is in LINK_STATE_UP (see RT_LINK_IS_UP()
  macro).
  
  Reported by:  Marek Zarychta
  MFC after:3 days

Modified:
  head/sys/net/if_loop.c

Modified: head/sys/net/if_loop.c
==
--- head/sys/net/if_loop.c  Sat Jun  9 04:54:36 2018(r334874)
+++ head/sys/net/if_loop.c  Sat Jun  9 09:57:14 2018(r334875)
@@ -380,6 +380,7 @@ loioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
case SIOCSIFADDR:
ifp->if_flags |= IFF_UP;
ifp->if_drv_flags |= IFF_DRV_RUNNING;
+   if_link_state_change(ifp, LINK_STATE_UP);
/*
 * Everything else is done at a higher level.
 */
___
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: r334856 - head/sys/amd64/amd64

2018-06-09 Thread Rodney W. Grimes
[ Charset UTF-8 unsupported, converting... ]
> Author: tychon
> Date: Fri Jun  8 20:35:58 2018
> New Revision: 334856
> URL: https://svnweb.freebsd.org/changeset/base/334856
> 
> Log:
>   Don't bother looking for non-executable pages when a process is
>   excluded from PTI.
>   
>   Reviewed by:kib
>   Sponsored by:   Dell EMC Isilon
>   Differential Revision:  https://reviews.freebsd.org/D15708

MFC?

> Modified:
>   head/sys/amd64/amd64/trap.c
> 
> Modified: head/sys/amd64/amd64/trap.c
> ==
> --- head/sys/amd64/amd64/trap.c   Fri Jun  8 20:31:59 2018
> (r334855)
> +++ head/sys/amd64/amd64/trap.c   Fri Jun  8 20:35:58 2018
> (r334856)
> @@ -770,7 +770,8 @@ trap_pfault(struct trapframe *frame, int usermode)
>* If nx protection of the usermode portion of kernel page
>* tables caused trap, panic.
>*/
> - if (pti && usermode && pg_nx != 0 && (frame->tf_err & (PGEX_P | PGEX_W |
> + if (PCPU_GET(curpmap)->pm_ucr3 != PMAP_NO_CR3 && usermode &&
> + pg_nx != 0 && (frame->tf_err & (PGEX_P | PGEX_W |
>   PGEX_U | PGEX_I)) == (PGEX_P | PGEX_U | PGEX_I) &&
>   (curpcb->pcb_saved_ucr3 & ~CR3_PCID_MASK)==
>   (PCPU_GET(curpmap)->pm_cr3 & ~CR3_PCID_MASK))
> 
> 

-- 
Rod Grimes rgri...@freebsd.org
___
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: r334864 - head/usr.bin/top

2018-06-09 Thread Florian Smeets via svn-src-head
On 09.06.18 04:14, Eitan Adler wrote:
> Author: eadler
> Date: Sat Jun  9 02:14:33 2018
> New Revision: 334864
> URL: https://svnweb.freebsd.org/changeset/base/334864
> 
> Log:
>   top(1): use a different command to toggle tid vs pid

Thank you.

You cannot start top with -T unless you add something like the following:

Index: top.c
===
--- top.c   (revision 334874)
+++ top.c   (working copy)
@@ -328,7 +328,7 @@
optind = 1;
}

-   while ((i = getopt(ac, av, "CSIHPabijJ:nquvzs:d:U:m:o:p:tw")) != EOF)
+   while ((i = getopt(ac, av, "CSIHPTabijJ:nquvzs:d:U:m:o:p:tw")) != EOF)
{
switch(i)
{

Another issue I just found is that if you start top with -P some columns
don't show any values:

CPU 0:  0.0% user,  0.0% nice,  0.0% system,  0.0% interrupt,  100% idle
CPU 1:  0.0% user,  0.0% nice,  0.0% system,  0.0% interrupt,  100% idle
CPU 2: % user, % nice,  1.2% system, % interrupt, 98.8% idle
CPU 3:  0.4% user, % nice,  0.4% system, % interrupt, 99.2% idle
CPU 4: % user, % nice,  0.4% system, % interrupt, 99.6% idle
CPU 5: % user, % nice,  2.4% system, % interrupt, 97.6% idle
CPU 6: % user, % nice,  0.4% system, % interrupt, 99.6% idle
CPU 7: % user, % nice,  2.4% system, % interrupt, 97.6% idle

It is correct if you start top with -TP or -HP, or if you start top -P
and then use H or T to switch back and forth. I'm not sure in which
revision this was broken, it works with r333899.

Florian



signature.asc
Description: OpenPGP digital signature