From owner-svn-src-head@freebsd.org Sun Jun 10 00:02:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91FD41006269; Sun, 10 Jun 2018 00:02:57 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 42D158039A; Sun, 10 Jun 2018 00:02:57 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 23D4724F82; Sun, 10 Jun 2018 00:02:57 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5A02vmX012216; Sun, 10 Jun 2018 00:02:57 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5A02uBP012215; Sun, 10 Jun 2018 00:02:56 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806100002.w5A02uBP012215@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 10 Jun 2018 00:02:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334906 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 334906 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jun 2018 00:02:57 -0000 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 */ From owner-svn-src-head@freebsd.org Sun Jun 10 01:38:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7DEF10087B7; Sun, 10 Jun 2018 01:38:53 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D54E82E5B; Sun, 10 Jun 2018 01:38:53 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4F09D25E3A; Sun, 10 Jun 2018 01:38:53 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5A1creQ058329; Sun, 10 Jun 2018 01:38:53 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5A1crbu058328; Sun, 10 Jun 2018 01:38:53 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201806100138.w5A1crbu058328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 10 Jun 2018 01:38:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334907 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 334907 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jun 2018 01:38:53 -0000 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() From owner-svn-src-head@freebsd.org Sun Jun 10 02:13:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1962E10096AE; Sun, 10 Jun 2018 02:13:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BE207840BA; Sun, 10 Jun 2018 02:13:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9F4FB264D7; Sun, 10 Jun 2018 02:13:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5A2DUWi078264; Sun, 10 Jun 2018 02:13:30 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5A2DU45078263; Sun, 10 Jun 2018 02:13:30 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806100213.w5A2DU45078263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 10 Jun 2018 02:13:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334909 - head/etc X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/etc X-SVN-Commit-Revision: 334909 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jun 2018 02:13:31 -0000 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/crontab Sun Jun 10 01:41:07 2018 (r334908) +++ head/etc/crontab Sun 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 # #minute hour mday month wday who command # From owner-svn-src-head@freebsd.org Sun Jun 10 02:30:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB4E51009D27; Sun, 10 Jun 2018 02:30:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9441D84792; Sun, 10 Jun 2018 02:30:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 72F7C2669F; Sun, 10 Jun 2018 02:30:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5A2U9wU083965; Sun, 10 Jun 2018 02:30:09 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5A2U9Sh083964; Sun, 10 Jun 2018 02:30:09 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806100230.w5A2U9Sh083964@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 10 Jun 2018 02:30:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334910 - head/usr.sbin/cron/cron X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.sbin/cron/cron X-SVN-Commit-Revision: 334910 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jun 2018 02:30:10 -0000 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 From owner-svn-src-head@freebsd.org Sun Jun 10 02:34:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 990181009FE5; Sun, 10 Jun 2018 02:34:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49DC684BFD; Sun, 10 Jun 2018 02:34:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B07126835; Sun, 10 Jun 2018 02:34:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5A2YhkL088596; Sun, 10 Jun 2018 02:34:43 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5A2YgpO088591; Sun, 10 Jun 2018 02:34:42 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201806100234.w5A2YgpO088591@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sun, 10 Jun 2018 02:34:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334911 - in head/lib/libcompat: . 4.1 4.3 4.4 X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/lib/libcompat: . 4.1 4.3 4.4 X-SVN-Commit-Revision: 334911 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jun 2018 02:34:43 -0000 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.c Sun Jun 10 02:30:09 2018 (r334910) +++ head/lib/libcompat/4.3/re_comp.c Sun 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.c 5.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.c 8.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.c Sun Jun 10 02:30:09 2018 (r334910) +++ head/lib/libcompat/4.4/cuserid.c Sun 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.c 8.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 From owner-svn-src-head@freebsd.org Sun Jun 10 02:36:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08C19100A0F9; Sun, 10 Jun 2018 02:36:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AAFF684DAB; Sun, 10 Jun 2018 02:36:38 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8CCF52683E; Sun, 10 Jun 2018 02:36:38 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5A2acWt088719; Sun, 10 Jun 2018 02:36:38 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5A2acUp088718; Sun, 10 Jun 2018 02:36:38 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201806100236.w5A2acUp088718@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 10 Jun 2018 02:36:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334912 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 334912 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jun 2018 02:36:39 -0000 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, From owner-svn-src-head@freebsd.org Sun Jun 10 04:25:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D370101AFE8; Sun, 10 Jun 2018 04:25:20 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 51CF969DB5; Sun, 10 Jun 2018 04:25:20 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2FFE127AF3; Sun, 10 Jun 2018 04:25:20 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5A4PJRn044980; Sun, 10 Jun 2018 04:25:19 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5A4PJBF044979; Sun, 10 Jun 2018 04:25:19 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201806100425.w5A4PJBF044979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Sun, 10 Jun 2018 04:25:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334913 - head X-SVN-Group: head X-SVN-Commit-Author: grehan X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 334913 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jun 2018 04:25:20 -0000 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/MAINTAINERS Sun Jun 10 02:36:38 2018 (r334912) +++ head/MAINTAINERS Sun 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. From owner-svn-src-head@freebsd.org Sun Jun 10 05:37:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7BC010088E0; Sun, 10 Jun 2018 05:37:41 +0000 (UTC) (envelope-from dexter@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7DE326D3DE; Sun, 10 Jun 2018 05:37:41 +0000 (UTC) (envelope-from dexter@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B113695; Sun, 10 Jun 2018 05:37:41 +0000 (UTC) (envelope-from dexter@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5A5bfck080627; Sun, 10 Jun 2018 05:37:41 GMT (envelope-from dexter@FreeBSD.org) Received: (from dexter@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5A5bfQT080626; Sun, 10 Jun 2018 05:37:41 GMT (envelope-from dexter@FreeBSD.org) Message-Id: <201806100537.w5A5bfQT080626@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dexter set sender to dexter@FreeBSD.org using -f From: Michael Dexter Date: Sun, 10 Jun 2018 05:37:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334914 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: dexter X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 334914 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jun 2018 05:37:42 -0000 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\nfoo@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 YYYY/MM/DD format. # # For returned commit bits, the node definition will follow this example: @@ -61,6 +61,7 @@ chinsan [label="Chinsan Huang\nchinsan@FreeBSD.org\n20 crees [label="Chris Rees\ncrees@FreeBSD.org\n2013/05/27"] danger [label="Daniel Gerzo\ndanger@FreeBSD.org\n2006/08/20"] delphij [label="Xin Li\ndelphij@FreeBSD.org\n2004/09/14"] +dexter [label="Michael Dexter\ndexter@FreeBSD.org\n2016/11/15"] dru [label="Dru Lavigne\ndru@FreeBSD.org\n2013/01/22"] eadler [label="Eitan Adler\neadler@FreeBSD.org\n2012/10/15"] ebrandi [label="Edson Brandi\nebrandi@FreeBSD.org\n2012/09/13"] @@ -106,6 +107,7 @@ bcr -> jgh bcr -> allanjude bcr -> bhd bcr -> sevan +bcr -> dexter blackend -> ale From owner-svn-src-head@freebsd.org Sun Jun 10 05:48:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B1E0100AAA7; Sun, 10 Jun 2018 05:48:04 +0000 (UTC) (envelope-from dexter@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 293516DCA6; Sun, 10 Jun 2018 05:48:04 +0000 (UTC) (envelope-from dexter@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B625832; Sun, 10 Jun 2018 05:48:04 +0000 (UTC) (envelope-from dexter@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5A5m3ux085563; Sun, 10 Jun 2018 05:48:03 GMT (envelope-from dexter@FreeBSD.org) Received: (from dexter@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5A5m3Bn085562; Sun, 10 Jun 2018 05:48:03 GMT (envelope-from dexter@FreeBSD.org) Message-Id: <201806100548.w5A5m3Bn085562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dexter set sender to dexter@FreeBSD.org using -f From: Michael Dexter Date: Sun, 10 Jun 2018 05:48:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334915 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: dexter X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 334915 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jun 2018 05:48:04 -0000 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.freebsd Sun Jun 10 05:37:40 2018 (r334914) +++ head/usr.bin/calendar/calendars/calendar.freebsd Sun 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 From owner-svn-src-head@freebsd.org Sun Jun 10 06:21:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03951101117C; Sun, 10 Jun 2018 06:21:46 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AD8D66F767; Sun, 10 Jun 2018 06:21:45 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E313E5A; Sun, 10 Jun 2018 06:21:45 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5A6LjAB001812; Sun, 10 Jun 2018 06:21:45 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5A6LjRj001811; Sun, 10 Jun 2018 06:21:45 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806100621.w5A6LjRj001811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 10 Jun 2018 06:21:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334916 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 334916 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jun 2018 06:21:46 -0000 Author: eadler Date: Sun Jun 10 06:21:45 2018 New Revision: 334916 URL: https://svnweb.freebsd.org/changeset/base/334916 Log: top(1): permit sending signal with any case Modified: head/usr.bin/top/commands.c Modified: head/usr.bin/top/commands.c ============================================================================== --- head/usr.bin/top/commands.c Sun Jun 10 05:48:03 2018 (r334915) +++ head/usr.bin/top/commands.c Sun Jun 10 06:21:45 2018 (r334916) @@ -401,17 +401,17 @@ kill_procs(char *str) /* translate the name into a number */ for (sigp = sigdesc; sigp->name != NULL; sigp++) { - if (strcmp(sigp->name, str + 1) == 0) - { - signum = sigp->number; - break; + if (strcasecmp(sigp->name, str + 1) == 0) + { + signum = sigp->number; + break; + } } - } /* was it ever found */ if (sigp->name == NULL) { - return(bad_signal_name); + return(bad_signal_name); } } /* put the new pointer in place */ From owner-svn-src-head@freebsd.org Sun Jun 10 06:21:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42E541011318; Sun, 10 Jun 2018 06:21:54 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 713436F853; Sun, 10 Jun 2018 06:21:53 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E163AE65; Sun, 10 Jun 2018 06:21:52 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5A6LqDk004272; Sun, 10 Jun 2018 06:21:52 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5A6Lpbc004251; Sun, 10 Jun 2018 06:21:51 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806100621.w5A6Lpbc004251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 10 Jun 2018 06:21:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334917 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 334917 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jun 2018 06:21:54 -0000 Author: eadler Date: Sun Jun 10 06:21:51 2018 New Revision: 334917 URL: https://svnweb.freebsd.org/changeset/base/334917 Log: top(1): filter fewer warnings; clean up - remove WARNS?=6. It is default - we no longer have cast-qual problems - remove unused macros - remove unneeded casts - add include guard for loadavg.h Modified: head/usr.bin/top/Makefile head/usr.bin/top/loadavg.h head/usr.bin/top/top.c head/usr.bin/top/top.h head/usr.bin/top/username.c Modified: head/usr.bin/top/Makefile ============================================================================== --- head/usr.bin/top/Makefile Sun Jun 10 06:21:45 2018 (r334916) +++ head/usr.bin/top/Makefile Sun Jun 10 06:21:51 2018 (r334917) @@ -8,17 +8,15 @@ SRCS= commands.c display.c machine.c screen.c top.c \ CFLAGS+= -I ${.OBJDIR} MAN= top.1 -WARNS?= 6 - .if ${COMPILER_TYPE} == "gcc" .if ${COMPILER_VERSION} >= 50000 -CFLAGS.gcc=-Wno-error=cast-align -Wno-error=cast-qual -Wno-error=discarded-qualifiers -Wno-error=incompatible-pointer-types \ +CFLAGS.gcc=-Wno-error=cast-qual -Wno-error=discarded-qualifiers -Wno-error=incompatible-pointer-types \ -Wno-error=maybe-uninitialized .else #base gcc NO_WERROR= .endif .endif -CFLAGS.clang=-Wno-error=incompatible-pointer-types-discards-qualifiers -Wno-error=cast-qual -Wno-error=cast-align +CFLAGS.clang=-Wno-error=incompatible-pointer-types-discards-qualifiers -Wno-error=cast-qual LIBADD= ncursesw m kvm jail Modified: head/usr.bin/top/loadavg.h ============================================================================== --- head/usr.bin/top/loadavg.h Sun Jun 10 06:21:45 2018 (r334916) +++ head/usr.bin/top/loadavg.h Sun Jun 10 06:21:51 2018 (r334917) @@ -14,12 +14,14 @@ * $FreeBSD$ */ -#define FIXED_LOADAVG FSCALE -#define FIXED_PCTCPU FSCALE +#ifndef LOADAVG_H +#define LOADAVG_H +#include + typedef long pctcpu; -#define pctdouble(p) ((double)(p) / FIXED_PCTCPU) +#define pctdouble(p) ((double)(p) / FSCALE) typedef fixpt_t load_avg; -#define loaddouble(la) ((double)(la) / FIXED_LOADAVG) -#define intload(i) ((int)((i) * FIXED_LOADAVG)) +#define loaddouble(la) ((double)(la) / FSCALE) +#endif /* LOADAVG_H */ Modified: head/usr.bin/top/top.c ============================================================================== --- head/usr.bin/top/top.c Sun Jun 10 06:21:45 2018 (r334916) +++ head/usr.bin/top/top.c Sun Jun 10 06:21:51 2018 (r334917) @@ -643,8 +643,8 @@ _Static_assert(sizeof(command_chars) == CMD_toggletid if (warnings) { fputs("....", stderr); - fflush(stderr); /* why must I do this? */ - sleep((unsigned)(3 * warnings)); + fflush(stderr); + sleep(3 * warnings); fputc('\n', stderr); } Modified: head/usr.bin/top/top.h ============================================================================== --- head/usr.bin/top/top.h Sun Jun 10 06:21:45 2018 (r334916) +++ head/usr.bin/top/top.h Sun Jun 10 06:21:51 2018 (r334917) @@ -23,10 +23,6 @@ extern int Header_lines; /* 7 */ /* maximum number we can have */ #define Largest 0x7fffffff -/* - * The entire display is based on these next numbers being defined as is. - */ - /* Exit code for system errors */ #define TOP_EX_SYS_ERROR 23 @@ -43,7 +39,6 @@ extern int pcpu_stats; extern int overstrike; extern pid_t mypid; - extern const char * myname; extern int (*compares[])(const void*, const void*); @@ -74,13 +69,5 @@ void quit(int); * overridden on the command line, even with the value "infinity". */ #define Nominal_TOPN 18 - -/* - * If the local system's getpwnam interface uses random access to retrieve - * a record (i.e.: 4.3 systems, Sun "yellow pages"), then defining - * RANDOM_PW will take advantage of that fact. - */ - -#define RANDOM_PW 1 #endif /* TOP_H */ Modified: head/usr.bin/top/username.c ============================================================================== --- head/usr.bin/top/username.c Sun Jun 10 06:21:45 2018 (r334916) +++ head/usr.bin/top/username.c Sun Jun 10 06:21:51 2018 (r334917) @@ -115,8 +115,6 @@ int enter_user(int uid, char name[], bool wecare) /* * Get a userid->name mapping from the system. - * If the passwd database is hashed (#define RANDOM_PW), we - * just handle this uid. */ int @@ -127,7 +125,7 @@ get_user(int uid) /* no performance penalty for using getpwuid makes it easy */ if ((pwd = getpwuid(uid)) != NULL) { - return(enter_user(pwd->pw_uid, pwd->pw_name, 1)); + return(enter_user(pwd->pw_uid, pwd->pw_name, 1)); } /* if we can't find the name at all, then use the uid as the name */ From owner-svn-src-head@freebsd.org Sun Jun 10 06:33:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DB301013C60; Sun, 10 Jun 2018 06:33:50 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CE4E0704FE; Sun, 10 Jun 2018 06:33:49 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF536104F; Sun, 10 Jun 2018 06:33:49 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5A6XnxS010888; Sun, 10 Jun 2018 06:33:49 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5A6XnvD010887; Sun, 10 Jun 2018 06:33:49 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806100633.w5A6XnvD010887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 10 Jun 2018 06:33:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334918 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 334918 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jun 2018 06:33:50 -0000 Author: eadler Date: Sun Jun 10 06:33:49 2018 New Revision: 334918 URL: https://svnweb.freebsd.org/changeset/base/334918 Log: top(1): use correct word when displaying threads PR: 182204 Reported by: "Brodey Dover" Modified: head/usr.bin/top/display.c Modified: head/usr.bin/top/display.c ============================================================================== --- head/usr.bin/top/display.c Sun Jun 10 06:21:51 2018 (r334917) +++ head/usr.bin/top/display.c Sun Jun 10 06:33:49 2018 (r334918) @@ -349,7 +349,7 @@ i_procstates(int total, int *brkdn) int i; /* write current number of processes and remember the value */ - printf("%d processes:", total); + printf("%d %s:", total, (ps.thread) ? "threads" :"processes"); ltotal = total; /* put out enough spaces to get to column 15 */ From owner-svn-src-head@freebsd.org Sun Jun 10 08:59:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D101B10087CC; Sun, 10 Jun 2018 08:59:58 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 821E676996; Sun, 10 Jun 2018 08:59:58 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 64D55271E; Sun, 10 Jun 2018 08:59:58 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5A8xwPX082118; Sun, 10 Jun 2018 08:59:58 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5A8xvlO082115; Sun, 10 Jun 2018 08:59:57 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806100859.w5A8xvlO082115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 10 Jun 2018 08:59:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334919 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 334919 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jun 2018 08:59:59 -0000 Author: eadler Date: Sun Jun 10 08:59:57 2018 New Revision: 334919 URL: https://svnweb.freebsd.org/changeset/base/334919 Log: top(1): bring some structure to commands Right now this is only used for help text but it'll eventually be used to build up long options array, dispatch commands, etc. Modified: head/usr.bin/top/commands.c head/usr.bin/top/commands.h head/usr.bin/top/top.h Modified: head/usr.bin/top/commands.c ============================================================================== --- head/usr.bin/top/commands.c Sun Jun 10 06:33:49 2018 (r334918) +++ head/usr.bin/top/commands.c Sun Jun 10 08:59:57 2018 (r334919) @@ -51,61 +51,56 @@ static int str_addarg(char *str, int len, char *arg, b * either 'h' or '?'. */ +static const struct command all_commands[] = +{ + {'C', "toggle the displaying of weighted CPU percentage", false }, + {'d', "change number of displays to show", false}, + {'e', "list errors generated by last \"kill\" or \"renice\" command", false}, + {'H', "toggle the displaying of threads", false}, + {'h', "show this help text", false}, + {'i', "toggle the displaying of idle processes", false}, + {'j', "toggle the displaying of jail ID", false}, + {'J', "display processes for only one jail (+ selects all jails)", false}, + {'k', "kill processes; send a signal to a list of processes", false}, + {'q', "quit" , false}, + {'m', "toggle the display between 'cpu' and 'io' modes", false}, + {'n', "change number of processes to display", false}, + {'o', "specify the sort order", false}, + {'p', "display one process (+ selects all processes)", false}, + {'P', "toggle the displaying of per-CPU statistics", false}, + {'r', "renice a process", false}, + {'s', "change number of seconds to delay between updates", false}, + {'S', "toggle the displaying of system processes", false}, + {'a', "toggle the displaying of process titles", false}, + {'T', "toggle the displaying of thread IDs", false}, + {'t', "toggle the display of this process", false}, + {'u', "display processes for only one user (+ selects all users)", false}, + {'w', "toggle the display of swap use for each process", false}, + {'z', "toggle the displaying of the system idle process", false }, + {0, NULL, true} +}; +/* XXX: eventually remove command_chars, but assert they are the same for now */ + void show_help(void) { - printf("Top version FreeBSD, %s\n", copyright); - fputs("\n\n\ -A top users display for Unix\n\ -\n\ -These single-character commands are available:\n\ -\n\ -^L - redraw screen\n\ -q - quit\n\ -h or ? - help; show this text\n", stdout); + const struct command *curcmd; - /* not all commands are available with overstrike terminals */ + printf("Top version FreeBSD, %s\n", copyright); + curcmd = all_commands; + while (curcmd->c != 0) { + if (overstrike && !curcmd->available_to_dumb) { + ++curcmd; + continue; + } + printf("%c\t- %s\n", curcmd->c, curcmd->desc); + ++curcmd; + } if (overstrike) { - fputs("\n\ -Other commands are also available, but this terminal is not\n\ -sophisticated enough to handle those commands gracefully.\n\n", stdout); - } - else - { - fputs("\ -C - toggle the displaying of weighted CPU percentage\n\ -d - change number of displays to show\n\ -e - list errors generated by last \"kill\" or \"renice\" command\n\ -H - toggle the displaying of threads\n\ -i or I - toggle the displaying of idle processes\n\ -j - toggle the displaying of jail ID\n\ -J - display processes for only one jail (+ selects all jails)\n\ -k - kill processes; send a signal to a list of processes\n\ -m - toggle the display between 'cpu' and 'io' modes\n\ -n or # - change number of processes to display\n", stdout); - if (displaymode == DISP_CPU) fputs("\ -o - specify sort order (pri, size, res, cpu, time, threads, jid, pid)\n", - stdout); - else - fputs("\ -o - specify sort order (vcsw, ivcsw, read, write, fault, total, jid, pid)\n", - stdout); - fputs("\ -p - display one process (+ selects all processes)\n\ -P - toggle the displaying of per-CPU statistics\n\ -r - renice a process\n\ -s - change number of seconds to delay between updates\n\ -S - toggle the displaying of system processes\n\ -a - toggle the displaying of process titles\n\ -T - toggle the displaying of thread IDs\n\ -t - toggle the display of this process\n\ -u - display processes for only one user (+ selects all users)\n\ -w - toggle the display of swap use for each process\n\ -z - toggle the displaying of the system idle process\n\ -\n\ -\n", stdout); + Other commands are also available, but this terminal is not\n\ + sophisticated enough to handle those commands gracefully.\n", stdout); } } @@ -352,17 +347,17 @@ show_errors(void) } } -static char no_proc_specified[] = " no processes specified"; -static char invalid_signal_number[] = " invalid_signal_number"; -static char bad_signal_name[] = " bad signal name"; -static char bad_pri_value[] = " bad priority value"; +static const char no_proc_specified[] = " no processes specified"; +static const char invalid_signal_number[] = " invalid_signal_number"; +static const char bad_signal_name[] = " bad signal name"; +static const char bad_pri_value[] = " bad priority value"; /* * kill_procs(str) - send signals to processes, much like the "kill" * command does; invoked in response to 'k'. */ -char * +const char * kill_procs(char *str) { char *nptr; @@ -450,7 +445,7 @@ kill_procs(char *str) * "renice" command does; invoked in response to 'r'. */ -char * +const char * renice_procs(char *str) { char negate; Modified: head/usr.bin/top/commands.h ============================================================================== --- head/usr.bin/top/commands.h Sun Jun 10 06:33:49 2018 (r334918) +++ head/usr.bin/top/commands.h Sun Jun 10 08:59:57 2018 (r334919) @@ -18,4 +18,10 @@ void show_errors(void); int error_count(void); void show_help(void); +struct command { + char c; + const char * const desc; + bool available_to_dumb; +}; + #endif /* COMMANDS_H */ Modified: head/usr.bin/top/top.h ============================================================================== --- head/usr.bin/top/top.h Sun Jun 10 06:33:49 2018 (r334918) +++ head/usr.bin/top/top.h Sun Jun 10 08:59:57 2018 (r334919) @@ -43,8 +43,8 @@ extern const char * myname; extern int (*compares[])(const void*, const void*); -char* kill_procs(char *); -char* renice_procs(char *); +const char* kill_procs(char *); +const char* renice_procs(char *); extern char copyright[]; From owner-svn-src-head@freebsd.org Sun Jun 10 09:00:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DFBF1008963; Sun, 10 Jun 2018 09:00:05 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F3A23769F3; Sun, 10 Jun 2018 09:00:02 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 940BA2722; Sun, 10 Jun 2018 09:00:02 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5A902Si082223; Sun, 10 Jun 2018 09:00:02 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5A902GI082222; Sun, 10 Jun 2018 09:00:02 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806100900.w5A902GI082222@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 10 Jun 2018 09:00:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334920 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 334920 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jun 2018 09:00:05 -0000 Author: eadler Date: Sun Jun 10 09:00:01 2018 New Revision: 334920 URL: https://svnweb.freebsd.org/changeset/base/334920 Log: top(1): use sys_signame instead of hard coding signals This enables the removal of the signal.h awk script. Shamelessly stolen from kill(1). Deleted: head/usr.bin/top/sigconv.awk Modified: head/usr.bin/top/Makefile head/usr.bin/top/commands.c Modified: head/usr.bin/top/Makefile ============================================================================== --- head/usr.bin/top/Makefile Sun Jun 10 08:59:57 2018 (r334919) +++ head/usr.bin/top/Makefile Sun Jun 10 09:00:01 2018 (r334920) @@ -4,7 +4,7 @@ PROG= top SRCS= commands.c display.c machine.c screen.c top.c \ - username.c utils.c sigdesc.h + username.c utils.c CFLAGS+= -I ${.OBJDIR} MAN= top.1 @@ -19,10 +19,4 @@ NO_WERROR= CFLAGS.clang=-Wno-error=incompatible-pointer-types-discards-qualifiers -Wno-error=cast-qual LIBADD= ncursesw m kvm jail - -CLEANFILES= sigdesc.h -SIGNAL_H= ${SRCTOP}/sys/sys/signal.h -sigdesc.h: sigconv.awk ${SIGNAL_H} - awk -f ${SRCTOP}/usr.bin/top/sigconv.awk < ${SIGNAL_H} > ${.TARGET} - .include Modified: head/usr.bin/top/commands.c ============================================================================== --- head/usr.bin/top/commands.c Sun Jun 10 08:59:57 2018 (r334919) +++ head/usr.bin/top/commands.c Sun Jun 10 09:00:01 2018 (r334920) @@ -30,7 +30,6 @@ #include #include "commands.h" -#include "sigdesc.h" /* generated automatically */ #include "top.h" #include "machine.h" @@ -352,6 +351,20 @@ static const char invalid_signal_number[] = " invalid_ static const char bad_signal_name[] = " bad signal name"; static const char bad_pri_value[] = " bad priority value"; +static int +signame_to_signum(const char * sig) +{ + int n; + + if (strncasecmp(sig, "SIG", 3) == 0) + sig += 3; + for (n = 1; n < sys_nsig; n++) { + if (!strcasecmp(sys_signame[n], sig)) + return (n); + } + return (-1); +} + /* * kill_procs(str) - send signals to processes, much like the "kill" * command does; invoked in response to 'k'. @@ -363,7 +376,6 @@ kill_procs(char *str) char *nptr; int signum = SIGTERM; /* default */ int procnum; - struct sigdesc *sigp; int uid; /* reset error array */ @@ -393,18 +405,10 @@ kill_procs(char *str) } else { - /* translate the name into a number */ - for (sigp = sigdesc; sigp->name != NULL; sigp++) - { - if (strcasecmp(sigp->name, str + 1) == 0) - { - signum = sigp->number; - break; - } - } + signum = signame_to_signum(str + 1); /* was it ever found */ - if (sigp->name == NULL) + if (signum == -1 ) { return(bad_signal_name); } From owner-svn-src-head@freebsd.org Sun Jun 10 09:04:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C02CF10092A1; Sun, 10 Jun 2018 09:04:57 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6BFF9770B7; Sun, 10 Jun 2018 09:04:57 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D3F628B2; Sun, 10 Jun 2018 09:04:57 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5A94vOl087153; Sun, 10 Jun 2018 09:04:57 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5A94v4g087152; Sun, 10 Jun 2018 09:04:57 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806100904.w5A94v4g087152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 10 Jun 2018 09:04:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334921 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 334921 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jun 2018 09:04:57 -0000 Author: eadler Date: Sun Jun 10 09:04:56 2018 New Revision: 334921 URL: https://svnweb.freebsd.org/changeset/base/334921 Log: top(1): add command aliases; correct dumb support Modified: head/usr.bin/top/commands.c Modified: head/usr.bin/top/commands.c ============================================================================== --- head/usr.bin/top/commands.c Sun Jun 10 09:00:01 2018 (r334920) +++ head/usr.bin/top/commands.c Sun Jun 10 09:04:56 2018 (r334921) @@ -56,14 +56,17 @@ static const struct command all_commands[] = {'d', "change number of displays to show", false}, {'e', "list errors generated by last \"kill\" or \"renice\" command", false}, {'H', "toggle the displaying of threads", false}, - {'h', "show this help text", false}, + {'h', "show this help text", true}, + {'?', "show this help text", true}, {'i', "toggle the displaying of idle processes", false}, + {'I', "toggle the displaying of idle processes", false}, {'j', "toggle the displaying of jail ID", false}, {'J', "display processes for only one jail (+ selects all jails)", false}, {'k', "kill processes; send a signal to a list of processes", false}, - {'q', "quit" , false}, + {'q', "quit" , true}, {'m', "toggle the display between 'cpu' and 'io' modes", false}, {'n', "change number of processes to display", false}, + {'#', "change number of processes to display", false}, {'o', "specify the sort order", false}, {'p', "display one process (+ selects all processes)", false}, {'P', "toggle the displaying of per-CPU statistics", false}, From owner-svn-src-head@freebsd.org Sun Jun 10 09:15:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 725E7100A238; Sun, 10 Jun 2018 09:15:14 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 28B8E77837; Sun, 10 Jun 2018 09:15:14 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E66A72A51; Sun, 10 Jun 2018 09:15:13 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5A9FD8V092329; Sun, 10 Jun 2018 09:15:13 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5A9FD6q092326; Sun, 10 Jun 2018 09:15:13 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806100915.w5A9FD6q092326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 10 Jun 2018 09:15:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334922 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 334922 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jun 2018 09:15:14 -0000 Author: eadler Date: Sun Jun 10 09:15:13 2018 New Revision: 334922 URL: https://svnweb.freebsd.org/changeset/base/334922 Log: top(1): use modern interfaces for nice and related - attempt and fail, rather than check for permission. - use macro rather than explicit "-20" Modified: head/usr.bin/top/commands.c head/usr.bin/top/top.c Modified: head/usr.bin/top/commands.c ============================================================================== --- head/usr.bin/top/commands.c Sun Jun 10 09:04:56 2018 (r334921) +++ head/usr.bin/top/commands.c Sun Jun 10 09:15:13 2018 (r334922) @@ -379,14 +379,10 @@ kill_procs(char *str) char *nptr; int signum = SIGTERM; /* default */ int procnum; - int uid; /* reset error array */ ERR_RESET; - /* remember our uid */ - uid = getuid(); - /* skip over leading white space */ while (isspace(*str)) str++; @@ -429,13 +425,8 @@ kill_procs(char *str) } else { - /* check process owner if we're not root */ - if (uid && (uid != proc_owner(procnum))) - { - ERROR(str, EACCES); - } /* go in for the kill */ - else if (kill(procnum, signum) == -1) + if (kill(procnum, signum) == -1) { /* chalk up an error */ ERROR(str, errno); @@ -458,10 +449,8 @@ renice_procs(char *str) char negate; int prio; int procnum; - int uid; ERR_RESET; - uid = getuid(); /* allow for negative priority values */ if ((negate = (*str == '-')) != 0) @@ -499,12 +488,7 @@ renice_procs(char *str) ERROR(str, 0); } - /* check process owner if we're not root */ - else if (uid && (uid != proc_owner(procnum))) - { - ERROR(str, EACCES); - } - else if (setpriority(PRIO_PROCESS, procnum, prio) == -1) + if (setpriority(PRIO_PROCESS, procnum, prio) == -1) { ERROR(str, errno); } Modified: head/usr.bin/top/top.c ============================================================================== --- head/usr.bin/top/top.c Sun Jun 10 09:04:56 2018 (r334921) +++ head/usr.bin/top/top.c Sun Jun 10 09:15:13 2018 (r334922) @@ -16,9 +16,9 @@ #include #include #include +#include #include #include -#include #include #include @@ -439,19 +439,13 @@ _Static_assert(sizeof(command_chars) == CMD_toggletid break; case 'q': /* be quick about it */ - /* only allow this if user is really root */ - if (getuid() == 0) - { - /* be very un-nice! */ - nice(-20); - } - else - { - fprintf(stderr, - "%s: warning: `-q' option can only be used by root\n", - myname); - warnings++; - } + errno = 0; + i = setpriority(PRIO_PROCESS, 0, PRIO_MIN); + if (i == -1 && errno != 0) { + fprintf(stderr, + "%s: warning: `-q' option failed (%m)\n", myname); + warnings++; + } break; case 'm': /* select display mode */ From owner-svn-src-head@freebsd.org Sun Jun 10 10:23:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A8C810105D5; Sun, 10 Jun 2018 10:23:34 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C85F479EC3; Sun, 10 Jun 2018 10:23:33 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A3FBB3930; Sun, 10 Jun 2018 10:23:33 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5AANXrv027938; Sun, 10 Jun 2018 10:23:33 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5AANWIw027931; Sun, 10 Jun 2018 10:23:32 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201806101023.w5AANWIw027931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 10 Jun 2018 10:23:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334923 - in head: share/man/man4 share/man/man4/man4.i386 sys/dev/atkbdc sys/dev/mse sys/dev/syscons sys/sys X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: in head: share/man/man4 share/man/man4/man4.i386 sys/dev/atkbdc sys/dev/mse sys/dev/syscons sys/sys X-SVN-Commit-Revision: 334923 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jun 2018 10:23:34 -0000 Author: wulf Date: Sun Jun 10 10:23:31 2018 New Revision: 334923 URL: https://svnweb.freebsd.org/changeset/base/334923 Log: Drop MOUSE_GETVARS and MOUSE_SETVARS ioctls support. These ioctls are not documented and only stubbed in a few drivers: mse(4), psm(4) and syscon's sysmouse(4). The only exception is MOUSE_GETVARS implemented in psm(4) Given the fact that they were introduced 20 years ago and implementation has never been completed, remove any related code. PR: 228718 (exp-run) Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D15726 Modified: head/share/man/man4/man4.i386/mse.4 head/share/man/man4/mouse.4 head/share/man/man4/psm.4 head/share/man/man4/sysmouse.4 head/sys/dev/atkbdc/psm.c head/sys/dev/mse/mse.c head/sys/dev/syscons/sysmouse.c head/sys/sys/mouse.h Modified: head/share/man/man4/man4.i386/mse.4 ============================================================================== --- head/share/man/man4/man4.i386/mse.4 Sun Jun 10 09:15:13 2018 (r334922) +++ head/share/man/man4/man4.i386/mse.4 Sun Jun 10 10:23:31 2018 (r334923) @@ -319,12 +319,6 @@ and may be modifiable. Setting values in the other field does not generate error and has no effect. -.\" .Pp -.\" .It Dv MOUSE_GETVARS Ar mousevar_t *vars -.\" .It Dv MOUSE_SETVARS Ar mousevar_t *vars -.\" These commands are not supported by the -.\" .Nm -.\" driver. .Pp .It Dv MOUSE_READDATA Ar mousedata_t *data .It Dv MOUSE_READSTATE Ar mousedata_t *state Modified: head/share/man/man4/mouse.4 ============================================================================== --- head/share/man/man4/mouse.4 Sun Jun 10 09:15:13 2018 (r334922) +++ head/share/man/man4/mouse.4 Sun Jun 10 10:23:31 2018 (r334923) @@ -292,27 +292,6 @@ You may also put zero in and .Dv rate , and the default value for the fields will be selected. -.\" .Pp -.\" .It Dv MOUSE_GETVARS Ar mousevar_t *vars -.\" Get internal variables of the mouse driver. -.\" The variables which can be manipulated through these commands -.\" are specific to each driver. -.\" This command may not be supported by all drivers. -.\" .Bd -literal -.\" typedef struct mousevar { -.\" int var[16]; /* internal variables */ -.\" } mousevar_t; -.\" .Ed -.\" .Pp -.\" If the commands are supported, the first element of the array is -.\" filled with a signature value. -.\" Apart from the signature data, there is currently no standard concerning -.\" the other elements of the buffer. -.\" .Pp -.\" .It Dv MOUSE_SETVARS Ar mousevar_t *vars -.\" Get internal variables of the mouse driver. -.\" The first element of the array must be a signature value. -.\" This command may not be supported by all drivers. .Pp .It Dv MOUSE_READDATA Ar mousedata_t *data The command reads the raw data from the device. Modified: head/share/man/man4/psm.4 ============================================================================== --- head/share/man/man4/psm.4 Sun Jun 10 09:15:13 2018 (r334922) +++ head/share/man/man4/psm.4 Sun Jun 10 10:23:31 2018 (r334923) @@ -591,12 +591,6 @@ You may also put zero in and .Dv rate , and the default value for the fields will be selected. -.\" .Pp -.\" .It Dv MOUSE_GETVARS Ar mousevar_t *vars -.\" .It Dv MOUSE_SETVARS Ar mousevar_t *vars -.\" These commands are not supported by the -.\" .Nm -.\" driver. .Pp .It Dv MOUSE_READDATA Ar mousedata_t *data .\" The command reads the raw data from the device. Modified: head/share/man/man4/sysmouse.4 ============================================================================== --- head/share/man/man4/sysmouse.4 Sun Jun 10 09:15:13 2018 (r334922) +++ head/share/man/man4/sysmouse.4 Sun Jun 10 10:23:31 2018 (r334923) @@ -264,12 +264,6 @@ Only may be modifiable. Setting values in the other field does not generate error and has no effect. -.\" .Pp -.\" .It Dv MOUSE_GETVARS Ar mousevar_t *vars -.\" .It Dv MOUSE_SETVARS Ar mousevar_t *vars -.\" These commands are not supported by the -.\" .Nm -.\" driver. .Pp .It Dv MOUSE_READDATA Ar mousedata_t *data .It Dv MOUSE_READSTATE Ar mousedata_t *state Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Sun Jun 10 09:15:13 2018 (r334922) +++ head/sys/dev/atkbdc/psm.c Sun Jun 10 10:23:31 2018 (r334923) @@ -2560,9 +2560,6 @@ psmioctl(struct cdev *dev, u_long cmd, caddr_t addr, i struct psm_softc *sc = dev->si_drv1; mousemode_t mode; mousestatus_t status; -#if (defined(MOUSE_GETVARS)) - mousevar_t *var; -#endif mousedata_t *data; int stat[3]; int command_byte; @@ -2758,21 +2755,6 @@ psmioctl(struct cdev *dev, u_long cmd, caddr_t addr, i splx(s); *(mousestatus_t *)addr = status; break; - -#if (defined(MOUSE_GETVARS)) - case MOUSE_GETVARS: - var = (mousevar_t *)addr; - bzero(var, sizeof(*var)); - s = spltty(); - var->var[0] = MOUSE_VARS_PS2_SIG; - var->var[1] = sc->config; - var->var[2] = sc->flags; - splx(s); - break; - - case MOUSE_SETVARS: - return (ENODEV); -#endif /* MOUSE_GETVARS */ case MOUSE_READSTATE: case MOUSE_READDATA: Modified: head/sys/dev/mse/mse.c ============================================================================== --- head/sys/dev/mse/mse.c Sun Jun 10 09:15:13 2018 (r334922) +++ head/sys/dev/mse/mse.c Sun Jun 10 10:23:31 2018 (r334923) @@ -434,12 +434,6 @@ mseioctl(struct cdev *dev, u_long cmd, caddr_t addr, i case MOUSE_READDATA: return (ENODEV); -#if (defined(MOUSE_GETVARS)) - case MOUSE_GETVARS: - case MOUSE_SETVARS: - return (ENODEV); -#endif - default: return (ENOTTY); } Modified: head/sys/dev/syscons/sysmouse.c ============================================================================== --- head/sys/dev/syscons/sysmouse.c Sun Jun 10 09:15:13 2018 (r334922) +++ head/sys/dev/syscons/sysmouse.c Sun Jun 10 10:23:31 2018 (r334923) @@ -202,12 +202,6 @@ smdev_ioctl(struct tty *tp, u_long cmd, caddr_t data, mouse_status.dz = 0; return 0; -#ifdef notyet - case MOUSE_GETVARS: /* get internal mouse variables */ - case MOUSE_SETVARS: /* set internal mouse variables */ - return ENODEV; -#endif - case MOUSE_READSTATE: /* read status from the device */ case MOUSE_READDATA: /* read data from the device */ return ENODEV; Modified: head/sys/sys/mouse.h ============================================================================== --- head/sys/sys/mouse.h Sun Jun 10 09:15:13 2018 (r334922) +++ head/sys/sys/mouse.h Sun Jun 10 10:23:31 2018 (r334923) @@ -38,8 +38,6 @@ #define MOUSE_SETMODE _IOW('M', 3, mousemode_t) #define MOUSE_GETLEVEL _IOR('M', 4, int) #define MOUSE_SETLEVEL _IOW('M', 5, int) -#define MOUSE_GETVARS _IOR('M', 6, mousevar_t) -#define MOUSE_SETVARS _IOW('M', 7, mousevar_t) #define MOUSE_READSTATE _IOWR('M', 8, mousedata_t) #define MOUSE_READDATA _IOWR('M', 9, mousedata_t) @@ -227,19 +225,6 @@ typedef struct mousedata { int len; /* # of data in the buffer */ int buf[16]; /* data buffer */ } mousedata_t; - -#if (defined(MOUSE_GETVARS)) - -typedef struct mousevar { - int var[16]; -} mousevar_t; - -/* magic numbers in var[0] */ -#define MOUSE_VARS_PS2_SIG 0x00325350 /* 'PS2' */ -#define MOUSE_VARS_BUS_SIG 0x00535542 /* 'BUS' */ -#define MOUSE_VARS_INPORT_SIG 0x00504e49 /* 'INP' */ - -#endif /* MOUSE_GETVARS */ /* Synaptics Touchpad */ #define MOUSE_SYNAPTICS_PACKETSIZE 6 /* '3' works better */ From owner-svn-src-head@freebsd.org Sun Jun 10 12:28:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A459E101F2A1; Sun, 10 Jun 2018 12:28:19 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 55E187F4EC; Sun, 10 Jun 2018 12:28:19 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 4D6221E271; Sun, 10 Jun 2018 12:28:19 +0000 (UTC) Date: Sun, 10 Jun 2018 12:28:19 +0000 From: Alexey Dokuchaev To: Bruce Evans Cc: Eitan Adler , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r333945 - head/usr.bin/top Message-ID: <20180610122819.GA75055@FreeBSD.org> References: <201805202319.w4KNJ9hj038452@repo.freebsd.org> <20180521094344.Q1053@besplex.bde.org> <20180521063953.GA70671@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180521063953.GA70671@FreeBSD.org> User-Agent: Mutt/1.9.5 (2018-04-13) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jun 2018 12:28:19 -0000 On Mon, May 21, 2018 at 06:39:53AM +0000, Alexey Dokuchaev wrote: > I [...] have to patch top(1) locally to use namelength = 8 and header > format so it neatly looks like this: > > PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND > 844 danfe 2 21 0 114M 38836K select 0 49:39 3.82% Xorg > 5836 danfe 12 20 0 101M 23020K select 0 38:19 2.26% deadbeef > > instead of our ugly, default this: > > vvvv > PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND > 41086 danfe 1 20 0 13280K 3112K CPU1 1 0:00 0.09% top > 751 root 1 20 0 10812K 596K select 2 16:53 0.03% powerd > ^^^^^^^^^^ > The amount of wasted space (shown above) is unjustified IMO. I've just tried the latest top(8). Now it's even worse: vvvvvvv (7, was 4) PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAN 818 root 1 20 0 4484K 2148K select 0 0:01 1.57% moused 995 danfe 2 20 0 94208K 40084K select 1 0:06 0.47% Xorg 1107 danfe 1 20 0 35728K 14544K select 0 0:00 0.05% xterm Notice COMMAN (before it was not truncated) and increased amount of wasted space. If I switch to separate threads mode ('H'), alignment breaks: PID USERNAME PRI NICE SIZE RES STATE C TIME WCPU COMMAND 818 root 20 0 4484K 2148K select 0 0:01 1.96% moused 995 danfe 20 0 93660K 38912K select 1 0:06 0.57% Xorg{Xorg} 1107 danfe 20 0 35728K 13624K select 0 0:01 0.05% xterm If I press 'T', it says "Displaying tid", but the column name is THR, not TID. This is a bit confusing. Displaying tid THR USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMA 100122 root 1 20 0 4484K 2148K select 0 0:01 0.49% mouse Also, it is COMMA now. Can we please do something about this? I am not calling for "USER PRI" as Bruce had suggested, but "USERNAME PRI" is just about right. Most of the usernames are 8 characters or less. Even if they are longer, it makes more sense to truncate usernames than the column names and, especially, command lines. Thanks, ./danfe From owner-svn-src-head@freebsd.org Sun Jun 10 14:21:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CDB9100C5CA; Sun, 10 Jun 2018 14:21:02 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C73CC84142; Sun, 10 Jun 2018 14:21:01 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A94FE5F40; Sun, 10 Jun 2018 14:21:01 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5AEL1Wh049281; Sun, 10 Jun 2018 14:21:01 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5AEL1Qf049280; Sun, 10 Jun 2018 14:21:01 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201806101421.w5AEL1Qf049280@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Sun, 10 Jun 2018 14:21:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334924 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 334924 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jun 2018 14:21:02 -0000 Author: bde Date: Sun Jun 10 14:21:01 2018 New Revision: 334924 URL: https://svnweb.freebsd.org/changeset/base/334924 Log: Fix panics in potentially all x86bios calls on i386 since r332489. A call to npxsave() in the exception trampolines was not relocated. This call to a garbage address usually paniced when made, but it is only made when the thread has used an FPU recently, and this is not the usual case. PR: 228755 Reviewed by: kib Modified: head/sys/i386/i386/vm86bios.s Modified: head/sys/i386/i386/vm86bios.s ============================================================================== --- head/sys/i386/i386/vm86bios.s Sun Jun 10 10:23:31 2018 (r334923) +++ head/sys/i386/i386/vm86bios.s Sun Jun 10 14:21:01 2018 (r334924) @@ -67,7 +67,8 @@ ENTRY(vm86_bioscall) pushl %edx movl TD_PCB(%ecx),%ecx pushl PCB_SAVEFPU(%ecx) - call npxsave + movl $npxsave,%eax + call *%eax addl $4,%esp popl %edx /* recover our pcb */ 1: From owner-svn-src-head@freebsd.org Sun Jun 10 14:49:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9378B1012F50; Sun, 10 Jun 2018 14:49:14 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4247386739; Sun, 10 Jun 2018 14:49:14 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E15563EA; Sun, 10 Jun 2018 14:49:14 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5AEnDhj065158; Sun, 10 Jun 2018 14:49:13 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5AEnDLJ065156; Sun, 10 Jun 2018 14:49:13 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201806101449.w5AEnDLJ065156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Sun, 10 Jun 2018 14:49:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334925 - in head/sys: amd64/amd64 x86/x86 X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: in head/sys: amd64/amd64 x86/x86 X-SVN-Commit-Revision: 334925 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jun 2018 14:49:14 -0000 Author: bde Date: Sun Jun 10 14:49:13 2018 New Revision: 334925 URL: https://svnweb.freebsd.org/changeset/base/334925 Log: Untangle configuration ifdefs a little. On x86, msi is optional on pci, and also on apic in common and i386 files (except for xen it is optional only on xenhvm), but it was not ifdefed except on apic in common and i386 files. This is all that is left from an attempt to build a (sub-)minimal kernel without any devices. The isa "option" is still used without ifdefs in many standard files even on amd64. ISAPNP is not optional on at least i386. ATPIC is not optional on i386 (it is used mainly for Xspuriousint). But pci is now supposed to be optional on x86. Modified: head/sys/amd64/amd64/machdep.c head/sys/x86/x86/nexus.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Sun Jun 10 14:21:01 2018 (r334924) +++ head/sys/amd64/amd64/machdep.c Sun Jun 10 14:49:13 2018 (r334925) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include "opt_kstack_pages.h" #include "opt_maxmem.h" #include "opt_mp_watchdog.h" +#include "opt_pci.h" #include "opt_platform.h" #include "opt_sched.h" @@ -184,7 +185,9 @@ struct init_ops init_ops = { .mp_bootaddress = mp_bootaddress, .start_all_aps = native_start_all_aps, #endif +#ifdef DEV_PCI .msi_init = msi_init, +#endif }; /* Modified: head/sys/x86/x86/nexus.c ============================================================================== --- head/sys/x86/x86/nexus.c Sun Jun 10 14:21:01 2018 (r334924) +++ head/sys/x86/x86/nexus.c Sun Jun 10 14:49:13 2018 (r334925) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include "opt_apic.h" #endif #include "opt_isa.h" +#include "opt_pci.h" #include #include @@ -131,7 +132,7 @@ static int nexus_get_resource(device_t, device_t, int, static void nexus_delete_resource(device_t, device_t, int, int); static int nexus_get_cpus(device_t, device_t, enum cpu_sets, size_t, cpuset_t *); -#ifdef DEV_APIC +#if defined(DEV_APIC) && defined(DEV_PCI) static int nexus_alloc_msi(device_t pcib, device_t dev, int count, int maxcount, int *irqs); static int nexus_release_msi(device_t pcib, device_t dev, int count, int *irqs); static int nexus_alloc_msix(device_t pcib, device_t dev, int *irq); @@ -172,7 +173,7 @@ static device_method_t nexus_methods[] = { DEVMETHOD(bus_get_cpus, nexus_get_cpus), /* pcib interface */ -#ifdef DEV_APIC +#if defined(DEV_APIC) && defined(DEV_PCI) DEVMETHOD(pcib_alloc_msi, nexus_alloc_msi), DEVMETHOD(pcib_release_msi, nexus_release_msi), DEVMETHOD(pcib_alloc_msix, nexus_alloc_msix), @@ -701,7 +702,7 @@ nexus_add_irq(u_long irq) panic("%s: failed", __func__); } -#ifdef DEV_APIC +#if defined(DEV_APIC) && defined(DEV_PCI) static int nexus_alloc_msix(device_t pcib, device_t dev, int *irq) { @@ -736,7 +737,7 @@ nexus_map_msi(device_t pcib, device_t dev, int irq, ui return (msi_map(irq, addr, data)); } -#endif +#endif /* DEV_APIC && DEV_PCI */ /* Placeholder for system RAM. */ static void From owner-svn-src-head@freebsd.org Sun Jun 10 15:56:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B56B1101C93F for ; Sun, 10 Jun 2018 15:56:56 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 612F069578 for ; Sun, 10 Jun 2018 15:56:56 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from mail-yb0-f173.google.com (mail-yb0-f173.google.com [209.85.213.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: eadler) by smtp.freebsd.org (Postfix) with ESMTPSA id 29EB1B62F for ; Sun, 10 Jun 2018 15:56:56 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: by mail-yb0-f173.google.com with SMTP id v17-v6so5921179ybe.7 for ; Sun, 10 Jun 2018 08:56:56 -0700 (PDT) X-Gm-Message-State: APt69E15fUt1LLA7FxdBR/1LFt8xnQtpYQbBxBOW4AOetHyllSBFpJG6 /2YCaJyjdAiflbiSTcNtmuPFBOhHzm5cdH9fF3x9fA== X-Google-Smtp-Source: ADUXVKJwHL7diGwZc4qio6hVASFXUMqKH0Venp+3rk4Zpc6F2JZ9Omeqq+nFOX1pQhBG0A12dI0CuFP01i06krIaotc= X-Received: by 2002:a25:500a:: with SMTP id e10-v6mr8528462ybb.87.1528646215452; Sun, 10 Jun 2018 08:56:55 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ef50:0:0:0:0:0 with HTTP; Sun, 10 Jun 2018 08:56:24 -0700 (PDT) In-Reply-To: <20180610122819.GA75055@FreeBSD.org> References: <201805202319.w4KNJ9hj038452@repo.freebsd.org> <20180521094344.Q1053@besplex.bde.org> <20180521063953.GA70671@FreeBSD.org> <20180610122819.GA75055@FreeBSD.org> From: Eitan Adler Date: Sun, 10 Jun 2018 08:56:24 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r333945 - head/usr.bin/top To: Alexey Dokuchaev Cc: Bruce Evans , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jun 2018 15:56:57 -0000 On 10 June 2018 at 05:28, Alexey Dokuchaev wrote: > On Mon, May 21, 2018 at 06:39:53AM +0000, Alexey Dokuchaev wrote: >> I [...] have to patch top(1) locally to use namelength = 8 and header >> format so it neatly looks like this: >> >> PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND >> 844 danfe 2 21 0 114M 38836K select 0 49:39 3.82% Xorg >> 5836 danfe 12 20 0 101M 23020K select 0 38:19 2.26% deadbeef >> >> instead of our ugly, default this: >> >> vvvv >> PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND >> 41086 danfe 1 20 0 13280K 3112K CPU1 1 0:00 0.09% top >> 751 root 1 20 0 10812K 596K select 2 16:53 0.03% powerd >> ^^^^^^^^^^ >> The amount of wasted space (shown above) is unjustified IMO. > > I've just tried the latest top(8). Now it's even worse: > > vvvvvvv (7, was 4) > PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAN > 818 root 1 20 0 4484K 2148K select 0 0:01 1.57% moused > 995 danfe 2 20 0 94208K 40084K select 1 0:06 0.47% Xorg > 1107 danfe 1 20 0 35728K 14544K select 0 0:00 0.05% xterm > > Notice COMMAN (before it was not truncated) and increased amount of wasted > space. > > If I switch to separate threads mode ('H'), alignment breaks: > > PID USERNAME PRI NICE SIZE RES STATE C TIME WCPU COMMAND > 818 root 20 0 4484K 2148K select 0 0:01 1.96% moused > 995 danfe 20 0 93660K 38912K select 1 0:06 0.57% Xorg{Xorg} > 1107 danfe 20 0 35728K 13624K select 0 0:01 0.05% xterm > > If I press 'T', it says "Displaying tid", but the column name is THR, not > TID. This is a bit confusing. > > Displaying tid > THR USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMA > 100122 root 1 20 0 4484K 2148K select 0 0:01 0.49% mouse > > Also, it is COMMA now. Can we please do something about this? I am not > calling for "USER PRI" as Bruce had suggested, but "USERNAME PRI" is just > about right. FWIW I have not forgotten about this. I am planning on completely rewriting how the header, and data, get displayed so its low my priority (pun intended) list to fix this specific case until then. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@freebsd.org Sun Jun 10 16:21:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE2B6101FF69; Sun, 10 Jun 2018 16:21:22 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6FAAA6A92A; Sun, 10 Jun 2018 16:21:22 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 50F7D73F9; Sun, 10 Jun 2018 16:21:22 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5AGLMqD013899; Sun, 10 Jun 2018 16:21:22 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5AGLLL6013897; Sun, 10 Jun 2018 16:21:21 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201806101621.w5AGLLL6013897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 10 Jun 2018 16:21:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334926 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 334926 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jun 2018 16:21:23 -0000 Author: andrew Date: Sun Jun 10 16:21:21 2018 New Revision: 334926 URL: https://svnweb.freebsd.org/changeset/base/334926 Log: Clean up handling of unexpected exceptions. Previously we would issue a breakpoint instruction, however this would lose information that may be useful for debugging. These are now handled in a similar way to other exceptions, however it won't exit out of the exception handler until it is known if we can handle these exceptions in a useful way. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/exception.S head/sys/arm64/arm64/trap.c Modified: head/sys/arm64/arm64/exception.S ============================================================================== --- head/sys/arm64/arm64/exception.S Sun Jun 10 14:49:13 2018 (r334925) +++ head/sys/arm64/arm64/exception.S Sun Jun 10 16:21:21 2018 (r334926) @@ -161,10 +161,6 @@ ENTRY(handle_el1h_irq) eret END(handle_el1h_irq) -ENTRY(handle_el1h_error) - brk 0xf13 -END(handle_el1h_error) - ENTRY(handle_el0_sync) save_registers 0 ldr x0, [x18, #PC_CURTHREAD] @@ -185,18 +181,23 @@ ENTRY(handle_el0_irq) eret END(handle_el0_irq) -ENTRY(handle_el0_error) +ENTRY(handle_serror) save_registers 0 mov x0, sp - bl do_el0_error - brk 0xf23 - 1: b 1b -END(handle_el0_error) +1: bl do_serror + b 1b +END(handle_serror) +ENTRY(handle_empty_exception) + save_registers 0 + mov x0, sp +1: bl unhandled_exception + b 1b +END(handle_unhandled_exception) + .macro vempty .align 7 - brk 0xfff - 1: b 1b + b handle_empty_exception .endm .macro vector name @@ -215,15 +216,15 @@ exception_vectors: vector el1h_sync /* Synchronous EL1h */ vector el1h_irq /* IRQ EL1h */ vempty /* FIQ EL1h */ - vector el1h_error /* Error EL1h */ + vector serror /* Error EL1h */ vector el0_sync /* Synchronous 64-bit EL0 */ vector el0_irq /* IRQ 64-bit EL0 */ vempty /* FIQ 64-bit EL0 */ - vector el0_error /* Error 64-bit EL0 */ + vector serror /* Error 64-bit EL0 */ vector el0_sync /* Synchronous 32-bit EL0 */ vector el0_irq /* IRQ 32-bit EL0 */ vempty /* FIQ 32-bit EL0 */ - vector el0_error /* Error 32-bit EL0 */ + vector serror /* Error 32-bit EL0 */ Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Sun Jun 10 14:49:13 2018 (r334925) +++ head/sys/arm64/arm64/trap.c Sun Jun 10 16:21:21 2018 (r334926) @@ -76,6 +76,9 @@ extern register_t fsu_intr_fault; void do_el1h_sync(struct thread *, struct trapframe *); void do_el0_sync(struct thread *, struct trapframe *); void do_el0_error(struct trapframe *); +void do_serror(struct trapframe *); +void unhandled_exception(struct trapframe *); + static void print_registers(struct trapframe *frame); int (*dtrace_invop_jump_addr)(struct trapframe *); @@ -477,10 +480,33 @@ do_el0_sync(struct thread *td, struct trapframe *frame ("Kernel VFP state in use when entering userspace")); } +/* + * TODO: We will need to handle these later when we support ARMv8.2 RAS. + */ void -do_el0_error(struct trapframe *frame) +do_serror(struct trapframe *frame) { + uint64_t esr, far; - panic("ARM64TODO: do_el0_error"); + far = READ_SPECIALREG(far_el1); + esr = frame->tf_esr; + + print_registers(frame); + printf(" far: %16lx\n", far); + printf(" esr: %.8lx\n", esr); + panic("Unhandled System Error"); } +void +unhandled_exception(struct trapframe *frame) +{ + uint64_t esr, far; + + far = READ_SPECIALREG(far_el1); + esr = frame->tf_esr; + + print_registers(frame); + printf(" far: %16lx\n", far); + printf(" esr: %.8lx\n", esr); + panic("Unhandled exception"); +} From owner-svn-src-head@freebsd.org Sun Jun 10 16:26:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEA781020CD3; Sun, 10 Jun 2018 16:26:53 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9572E6AD39; Sun, 10 Jun 2018 16:26:53 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 8AE606D4; Sun, 10 Jun 2018 16:26:53 +0000 (UTC) Date: Sun, 10 Jun 2018 16:26:53 +0000 From: Alexey Dokuchaev To: Eitan Adler Cc: Bruce Evans , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Subject: Re: svn commit: r333945 - head/usr.bin/top Message-ID: <20180610162653.GA2999@FreeBSD.org> References: <201805202319.w4KNJ9hj038452@repo.freebsd.org> <20180521094344.Q1053@besplex.bde.org> <20180521063953.GA70671@FreeBSD.org> <20180610122819.GA75055@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.5 (2018-04-13) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jun 2018 16:26:54 -0000 On Sun, Jun 10, 2018 at 08:56:24AM -0700, Eitan Adler wrote: > On 10 June 2018 at 05:28, Alexey Dokuchaev wrote: > > I've just tried the latest top(1). Now it's even worse: > > ... > > Also, it is COMMA now. Can we please do something about this? I am not > > calling for "USER PRI" as Bruce had suggested, but "USERNAME PRI" is just > > about right. > > FWIW I have not forgotten about this. I am planning on completely > rewriting how the header, and data, get displayed so its low my > priority (pun intended) list to fix this specific case until then. Great! Looking forward to improvements. top(1) should be neat(TM). Take your time Eitan, it's not that urgent. ./danfe From owner-svn-src-head@freebsd.org Sun Jun 10 16:44:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AE9D10012F6; Sun, 10 Jun 2018 16:44:20 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3A2D56B977; Sun, 10 Jun 2018 16:44:20 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1BFCA777D; Sun, 10 Jun 2018 16:44:20 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5AGiK9d025464; Sun, 10 Jun 2018 16:44:20 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5AGiInW025457; Sun, 10 Jun 2018 16:44:18 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201806101644.w5AGiInW025457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Sun, 10 Jun 2018 16:44:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334927 - head/usr.bin/indent X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: head/usr.bin/indent X-SVN-Commit-Revision: 334927 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jun 2018 16:44:21 -0000 Author: pstef Date: Sun Jun 10 16:44:18 2018 New Revision: 334927 URL: https://svnweb.freebsd.org/changeset/base/334927 Log: indent(1): group global option variables into an options structure It's clearer now when a variable represents a toggable command line option. Many options were stored in the parser's state structure, so fix also that. Modified: head/usr.bin/indent/args.c head/usr.bin/indent/indent.c head/usr.bin/indent/indent_globs.h head/usr.bin/indent/io.c head/usr.bin/indent/lexi.c head/usr.bin/indent/parse.c head/usr.bin/indent/pr_comment.c Modified: head/usr.bin/indent/args.c ============================================================================== --- head/usr.bin/indent/args.c Sun Jun 10 16:21:21 2018 (r334926) +++ head/usr.bin/indent/args.c Sun Jun 10 16:44:18 2018 (r334927) @@ -102,72 +102,72 @@ struct pro { {"U", PRO_SPECIAL, 0, KEY_FILE, 0}, {"-version", PRO_SPECIAL, 0, VERSION, 0}, {"P", PRO_SPECIAL, 0, IGN, 0}, - {"bacc", PRO_BOOL, false, ON, &blanklines_around_conditional_compilation}, - {"badp", PRO_BOOL, false, ON, &blanklines_after_declarations_at_proctop}, - {"bad", PRO_BOOL, false, ON, &blanklines_after_declarations}, - {"bap", PRO_BOOL, false, ON, &blanklines_after_procs}, - {"bbb", PRO_BOOL, false, ON, &blanklines_before_blockcomments}, - {"bc", PRO_BOOL, true, OFF, &ps.leave_comma}, - {"bl", PRO_BOOL, true, OFF, &btype_2}, - {"br", PRO_BOOL, true, ON, &btype_2}, - {"bs", PRO_BOOL, false, ON, &Bill_Shannon}, - {"cdb", PRO_BOOL, true, ON, &comment_delimiter_on_blankline}, - {"cd", PRO_INT, 0, 0, &ps.decl_com_ind}, - {"ce", PRO_BOOL, true, ON, &cuddle_else}, - {"ci", PRO_INT, 0, 0, &continuation_indent}, + {"bacc", PRO_BOOL, false, ON, &opt.blanklines_around_conditional_compilation}, + {"badp", PRO_BOOL, false, ON, &opt.blanklines_after_declarations_at_proctop}, + {"bad", PRO_BOOL, false, ON, &opt.blanklines_after_declarations}, + {"bap", PRO_BOOL, false, ON, &opt.blanklines_after_procs}, + {"bbb", PRO_BOOL, false, ON, &opt.blanklines_before_blockcomments}, + {"bc", PRO_BOOL, true, OFF, &opt.leave_comma}, + {"bl", PRO_BOOL, true, OFF, &opt.btype_2}, + {"br", PRO_BOOL, true, ON, &opt.btype_2}, + {"bs", PRO_BOOL, false, ON, &opt.Bill_Shannon}, + {"cdb", PRO_BOOL, true, ON, &opt.comment_delimiter_on_blankline}, + {"cd", PRO_INT, 0, 0, &opt.decl_com_ind}, + {"ce", PRO_BOOL, true, ON, &opt.cuddle_else}, + {"ci", PRO_INT, 0, 0, &opt.continuation_indent}, {"cli", PRO_SPECIAL, 0, CLI, 0}, - {"c", PRO_INT, 33, 0, &ps.com_ind}, - {"di", PRO_INT, 16, 0, &ps.decl_indent}, - {"dj", PRO_BOOL, false, ON, &ps.ljust_decl}, - {"d", PRO_INT, 0, 0, &ps.unindent_displace}, - {"eei", PRO_BOOL, false, ON, &extra_expression_indent}, - {"ei", PRO_BOOL, true, ON, &ps.else_if}, - {"fbs", PRO_BOOL, true, ON, &function_brace_split}, - {"fc1", PRO_BOOL, true, ON, &format_col1_comments}, - {"fcb", PRO_BOOL, true, ON, &format_block_comments}, - {"ip", PRO_BOOL, true, ON, &ps.indent_parameters}, - {"i", PRO_INT, 8, 0, &ps.ind_size}, - {"lc", PRO_INT, 0, 0, &block_comment_max_col}, - {"ldi", PRO_INT, -1, 0, &ps.local_decl_indent}, - {"lpl", PRO_BOOL, false, ON, &lineup_to_parens_always}, - {"lp", PRO_BOOL, true, ON, &lineup_to_parens}, - {"l", PRO_INT, 78, 0, &max_col}, - {"nbacc", PRO_BOOL, false, OFF, &blanklines_around_conditional_compilation}, - {"nbadp", PRO_BOOL, false, OFF, &blanklines_after_declarations_at_proctop}, - {"nbad", PRO_BOOL, false, OFF, &blanklines_after_declarations}, - {"nbap", PRO_BOOL, false, OFF, &blanklines_after_procs}, - {"nbbb", PRO_BOOL, false, OFF, &blanklines_before_blockcomments}, - {"nbc", PRO_BOOL, true, ON, &ps.leave_comma}, - {"nbs", PRO_BOOL, false, OFF, &Bill_Shannon}, - {"ncdb", PRO_BOOL, true, OFF, &comment_delimiter_on_blankline}, - {"nce", PRO_BOOL, true, OFF, &cuddle_else}, - {"ndj", PRO_BOOL, false, OFF, &ps.ljust_decl}, - {"neei", PRO_BOOL, false, OFF, &extra_expression_indent}, - {"nei", PRO_BOOL, true, OFF, &ps.else_if}, - {"nfbs", PRO_BOOL, true, OFF, &function_brace_split}, - {"nfc1", PRO_BOOL, true, OFF, &format_col1_comments}, - {"nfcb", PRO_BOOL, true, OFF, &format_block_comments}, - {"nip", PRO_BOOL, true, OFF, &ps.indent_parameters}, - {"nlpl", PRO_BOOL, false, OFF, &lineup_to_parens_always}, - {"nlp", PRO_BOOL, true, OFF, &lineup_to_parens}, - {"npcs", PRO_BOOL, false, OFF, &proc_calls_space}, + {"c", PRO_INT, 33, 0, &opt.com_ind}, + {"di", PRO_INT, 16, 0, &opt.decl_indent}, + {"dj", PRO_BOOL, false, ON, &opt.ljust_decl}, + {"d", PRO_INT, 0, 0, &opt.unindent_displace}, + {"eei", PRO_BOOL, false, ON, &opt.extra_expression_indent}, + {"ei", PRO_BOOL, true, ON, &opt.else_if}, + {"fbs", PRO_BOOL, true, ON, &opt.function_brace_split}, + {"fc1", PRO_BOOL, true, ON, &opt.format_col1_comments}, + {"fcb", PRO_BOOL, true, ON, &opt.format_block_comments}, + {"ip", PRO_BOOL, true, ON, &opt.indent_parameters}, + {"i", PRO_INT, 8, 0, &opt.ind_size}, + {"lc", PRO_INT, 0, 0, &opt.block_comment_max_col}, + {"ldi", PRO_INT, -1, 0, &opt.local_decl_indent}, + {"lpl", PRO_BOOL, false, ON, &opt.lineup_to_parens_always}, + {"lp", PRO_BOOL, true, ON, &opt.lineup_to_parens}, + {"l", PRO_INT, 78, 0, &opt.max_col}, + {"nbacc", PRO_BOOL, false, OFF, &opt.blanklines_around_conditional_compilation}, + {"nbadp", PRO_BOOL, false, OFF, &opt.blanklines_after_declarations_at_proctop}, + {"nbad", PRO_BOOL, false, OFF, &opt.blanklines_after_declarations}, + {"nbap", PRO_BOOL, false, OFF, &opt.blanklines_after_procs}, + {"nbbb", PRO_BOOL, false, OFF, &opt.blanklines_before_blockcomments}, + {"nbc", PRO_BOOL, true, ON, &opt.leave_comma}, + {"nbs", PRO_BOOL, false, OFF, &opt.Bill_Shannon}, + {"ncdb", PRO_BOOL, true, OFF, &opt.comment_delimiter_on_blankline}, + {"nce", PRO_BOOL, true, OFF, &opt.cuddle_else}, + {"ndj", PRO_BOOL, false, OFF, &opt.ljust_decl}, + {"neei", PRO_BOOL, false, OFF, &opt.extra_expression_indent}, + {"nei", PRO_BOOL, true, OFF, &opt.else_if}, + {"nfbs", PRO_BOOL, true, OFF, &opt.function_brace_split}, + {"nfc1", PRO_BOOL, true, OFF, &opt.format_col1_comments}, + {"nfcb", PRO_BOOL, true, OFF, &opt.format_block_comments}, + {"nip", PRO_BOOL, true, OFF, &opt.indent_parameters}, + {"nlpl", PRO_BOOL, false, OFF, &opt.lineup_to_parens_always}, + {"nlp", PRO_BOOL, true, OFF, &opt.lineup_to_parens}, + {"npcs", PRO_BOOL, false, OFF, &opt.proc_calls_space}, {"npro", PRO_SPECIAL, 0, IGN, 0}, - {"npsl", PRO_BOOL, true, OFF, &procnames_start_line}, - {"nsac", PRO_BOOL, false, OFF, &space_after_cast}, - {"nsc", PRO_BOOL, true, OFF, &star_comment_cont}, - {"nsob", PRO_BOOL, false, OFF, &swallow_optional_blanklines}, - {"nut", PRO_BOOL, true, OFF, &use_tabs}, - {"nv", PRO_BOOL, false, OFF, &verbose}, - {"pcs", PRO_BOOL, false, ON, &proc_calls_space}, - {"psl", PRO_BOOL, true, ON, &procnames_start_line}, - {"sac", PRO_BOOL, false, ON, &space_after_cast}, - {"sc", PRO_BOOL, true, ON, &star_comment_cont}, - {"sob", PRO_BOOL, false, ON, &swallow_optional_blanklines}, + {"npsl", PRO_BOOL, true, OFF, &opt.procnames_start_line}, + {"nsac", PRO_BOOL, false, OFF, &opt.space_after_cast}, + {"nsc", PRO_BOOL, true, OFF, &opt.star_comment_cont}, + {"nsob", PRO_BOOL, false, OFF, &opt.swallow_optional_blanklines}, + {"nut", PRO_BOOL, true, OFF, &opt.use_tabs}, + {"nv", PRO_BOOL, false, OFF, &opt.verbose}, + {"pcs", PRO_BOOL, false, ON, &opt.proc_calls_space}, + {"psl", PRO_BOOL, true, ON, &opt.procnames_start_line}, + {"sac", PRO_BOOL, false, ON, &opt.space_after_cast}, + {"sc", PRO_BOOL, true, ON, &opt.star_comment_cont}, + {"sob", PRO_BOOL, false, ON, &opt.swallow_optional_blanklines}, {"st", PRO_SPECIAL, 0, STDIN, 0}, - {"ta", PRO_BOOL, false, ON, &auto_typedefs}, - {"ts", PRO_INT, 8, 0, &tabsize}, - {"ut", PRO_BOOL, true, ON, &use_tabs}, - {"v", PRO_BOOL, false, ON, &verbose}, + {"ta", PRO_BOOL, false, ON, &opt.auto_typedefs}, + {"ts", PRO_INT, 8, 0, &opt.tabsize}, + {"ut", PRO_BOOL, true, ON, &opt.use_tabs}, + {"v", PRO_BOOL, false, ON, &opt.verbose}, /* whew! */ {0, 0, 0, 0, 0} }; @@ -224,7 +224,7 @@ scan_profile(FILE *f) } if (p != buf) { *p++ = 0; - if (verbose) + if (opt.verbose) printf("profile: %s\n", buf); set_option(buf); } Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Sun Jun 10 16:21:21 2018 (r334926) +++ head/usr.bin/indent/indent.c Sun Jun 10 16:44:18 2018 (r334927) @@ -126,7 +126,7 @@ main(int argc, char **argv) combuf[0] = codebuf[0] = labbuf[0] = ' '; /* set up code, label, and * comment buffers */ combuf[1] = codebuf[1] = labbuf[1] = '\0'; - ps.else_if = 1; /* Default else-if special processing to on */ + opt.else_if = 1; /* Default else-if special processing to on */ s_lab = e_lab = labbuf + 1; s_code = e_code = codebuf + 1; s_com = e_com = combuf + 1; @@ -251,16 +251,16 @@ main(int argc, char **argv) if (cap_enter() < 0 && errno != ENOSYS) err(EXIT_FAILURE, "unable to enter capability mode"); - if (ps.com_ind <= 1) - ps.com_ind = 2; /* dont put normal comments before column 2 */ - if (block_comment_max_col <= 0) - block_comment_max_col = max_col; - if (ps.local_decl_indent < 0) /* if not specified by user, set this */ - ps.local_decl_indent = ps.decl_indent; - if (ps.decl_com_ind <= 0) /* if not specified by user, set this */ - ps.decl_com_ind = ps.ljust_decl ? (ps.com_ind <= 10 ? 2 : ps.com_ind - 8) : ps.com_ind; - if (continuation_indent == 0) - continuation_indent = ps.ind_size; + if (opt.com_ind <= 1) + opt.com_ind = 2; /* don't put normal comments before column 2 */ + if (opt.block_comment_max_col <= 0) + opt.block_comment_max_col = opt.max_col; + if (opt.local_decl_indent < 0) /* if not specified by user, set this */ + opt.local_decl_indent = opt.decl_indent; + if (opt.decl_com_ind <= 0) /* if not specified by user, set this */ + opt.decl_com_ind = opt.ljust_decl ? (opt.com_ind <= 10 ? 2 : opt.com_ind - 8) : opt.com_ind; + if (opt.continuation_indent == 0) + opt.continuation_indent = opt.ind_size; fill_buffer(); /* get first batch of stuff into input buffer */ parse(semicolon); @@ -272,13 +272,13 @@ main(int argc, char **argv) if (*p == ' ') col++; else if (*p == '\t') - col = tabsize * (1 + (col - 1) / tabsize) + 1; + col = opt.tabsize * (1 + (col - 1) / opt.tabsize) + 1; else break; p++; } - if (col > ps.ind_size) - ps.ind_level = ps.i_l_follow = col / ps.ind_size; + if (col > opt.ind_size) + ps.ind_level = ps.i_l_follow = col / opt.ind_size; } /* @@ -359,7 +359,7 @@ main(int argc, char **argv) * jump out of this loop in order to avoid copying the token * again under the default case of the switch below. */ - if (sc_end != NULL && btype_2) { + if (sc_end != NULL && opt.btype_2) { save_com[0] = '{'; /* * Originally the lbrace may have been alone on its own @@ -386,7 +386,7 @@ main(int argc, char **argv) e_code != s_code && e_code[-1] == '}') /* "else if" */ || (type_code == sp_paren && *token == 'i' && - last_else && ps.else_if); + last_else && opt.else_if); if (remove_newlines) force_nl = false; if (sc_end == NULL) { /* ignore buffering if @@ -397,7 +397,7 @@ main(int argc, char **argv) while (sc_end > save_com && isblank((unsigned char)sc_end[-1])) { sc_end--; } - if (swallow_optional_blanklines || + if (opt.swallow_optional_blanklines || (!comment_buffered && remove_newlines)) { force_nl = !remove_newlines; while (sc_end > save_com && sc_end[-1] == '\n') { @@ -411,7 +411,7 @@ main(int argc, char **argv) * newline is read from the buffer */ *sc_end++ = '\n'; *sc_end++ = ' '; - if (verbose) /* print error msg if the line was + if (opt.verbose) /* print error msg if the line was * not already broken */ diag2(0, "Line broken"); } @@ -484,7 +484,7 @@ check_type: if (ps.tos > 1) /* check for balanced braces */ diag2(1, "Stuff missing from end of file"); - if (verbose) { + if (opt.verbose) { printf("There were %d output lines and %d comments\n", ps.out_lines, ps.out_coms); printf("(Lines with comments)/(Lines with code): %6.3f\n", @@ -500,9 +500,9 @@ check_type: (type_code != form_feed)) { if (force_nl && (type_code != semicolon) && - (type_code != lbrace || !btype_2)) { + (type_code != lbrace || !opt.btype_2)) { /* we should force a broken line here */ - if (verbose) + if (opt.verbose) diag2(0, "Line broken"); dump_line(); ps.want_blank = false; /* dont insert blank at line start */ @@ -548,7 +548,7 @@ check_type: case newline: if (ps.last_token != comma || ps.p_l_follow > 0 - || !ps.leave_comma || ps.block_init || !break_comma || s_com != e_com) { + || !opt.leave_comma || ps.block_init || !break_comma || s_com != e_com) { dump_line(); ps.want_blank = false; } @@ -572,18 +572,18 @@ check_type: } else if (ps.want_blank && ((ps.last_token != ident && ps.last_token != funcname) || - proc_calls_space || + opt.proc_calls_space || /* offsetof (1) is never allowed a space; sizeof (2) gets * one iff -bs; all other keywords (>2) always get a space * before lparen */ - ps.keyword + Bill_Shannon > 2)) + ps.keyword + opt.Bill_Shannon > 2)) *e_code++ = ' '; ps.want_blank = false; *e_code++ = token[0]; ps.paren_indents[ps.p_l_follow - 1] = count_spaces_until(1, s_code, e_code) - 1; - if (sp_sw && ps.p_l_follow == 1 && extra_expression_indent - && ps.paren_indents[0] < 2 * ps.ind_size) - ps.paren_indents[0] = 2 * ps.ind_size; + if (sp_sw && ps.p_l_follow == 1 && opt.extra_expression_indent + && ps.paren_indents[0] < 2 * opt.ind_size) + ps.paren_indents[0] = 2 * opt.ind_size; if (ps.in_or_st && *token == '(' && ps.tos <= 2) { /* * this is a kluge to make sure that declarations will be @@ -603,7 +603,7 @@ check_type: if (ps.cast_mask & (1 << ps.p_l_follow) & ~ps.not_cast_mask) { ps.last_u_d = true; ps.cast_mask &= (1 << ps.p_l_follow) - 1; - ps.want_blank = space_after_cast; + ps.want_blank = opt.space_after_cast; } else ps.want_blank = true; ps.not_cast_mask &= (1 << ps.p_l_follow) - 1; @@ -627,10 +627,10 @@ check_type: parse(hd_type); /* let parser worry about if, or whatever */ } - ps.search_brace = btype_2; /* this should insure that constructs - * such as main(){...} and int[]{...} - * have their braces put in the right - * place */ + ps.search_brace = opt.btype_2; /* this should ensure that + * constructs such as main(){...} + * and int[]{...} have their braces + * put in the right place */ break; case unary_op: /* this could be any unary operation */ @@ -793,14 +793,14 @@ check_type: ps.block_init_level++; if (s_code != e_code && !ps.block_init) { - if (!btype_2) { + if (!opt.btype_2) { dump_line(); ps.want_blank = false; } else if (ps.in_parameter_declaration && !ps.in_or_st) { ps.i_l_follow = 0; - if (function_brace_split) { /* dump the line prior to the - * brace ... */ + if (opt.function_brace_split) { /* dump the line prior + * to the brace ... */ dump_line(); ps.want_blank = false; } else /* add a space between the decl and brace */ @@ -838,7 +838,7 @@ check_type: * a declaration, so don't do * special indentation of * comments */ - if (blanklines_after_declarations_at_proctop + if (opt.blanklines_after_declarations_at_proctop && ps.in_parameter_declaration) postfix_blankline_requested = 1; ps.in_parameter_declaration = 0; @@ -868,7 +868,7 @@ check_type: ps.block_init_level--; if (s_code != e_code && !ps.block_init) { /* '}' must be first on * line */ - if (verbose) + if (opt.verbose) diag2(0, "Line broken"); dump_line(); } @@ -884,9 +884,9 @@ check_type: } prefix_blankline_requested = 0; parse(rbrace); /* let parser know about this */ - ps.search_brace = cuddle_else && ps.p_stack[ps.tos] == ifhead + ps.search_brace = opt.cuddle_else && ps.p_stack[ps.tos] == ifhead && ps.il[ps.tos] >= ps.ind_level; - if (ps.tos <= 1 && blanklines_after_procs && ps.dec_nest <= 0) + if (ps.tos <= 1 && opt.blanklines_after_procs && ps.dec_nest <= 0) postfix_blankline_requested = 1; break; @@ -910,8 +910,8 @@ check_type: case sp_nparen: /* got else, do */ ps.in_stmt = false; if (*token == 'e') { - if (e_code != s_code && (!cuddle_else || e_code[-1] != '}')) { - if (verbose) + if (e_code != s_code && (!opt.cuddle_else || e_code[-1] != '}')) { + if (opt.verbose) diag2(0, "Line broken"); dump_line();/* make sure this starts a line */ ps.want_blank = false; @@ -922,7 +922,7 @@ check_type: } else { if (e_code != s_code) { /* make sure this starts a line */ - if (verbose) + if (opt.verbose) diag2(0, "Line broken"); dump_line(); ps.want_blank = false; @@ -949,7 +949,7 @@ check_type: ps.want_blank = 0; } } - if (ps.in_parameter_declaration && ps.indent_parameters && ps.dec_nest == 0) { + if (ps.in_parameter_declaration && opt.indent_parameters && ps.dec_nest == 0) { ps.ind_level = ps.i_l_follow = 1; ps.ind_stmt = 0; } @@ -963,12 +963,12 @@ check_type: if (ps.ind_level == 0 || ps.dec_nest > 0) { /* global variable or struct member in local variable */ - dec_ind = ps.decl_indent > 0 ? ps.decl_indent : i; - tabs_to_var = (use_tabs ? ps.decl_indent > 0 : 0); + dec_ind = opt.decl_indent > 0 ? opt.decl_indent : i; + tabs_to_var = (opt.use_tabs ? opt.decl_indent > 0 : 0); } else { /* local variable */ - dec_ind = ps.local_decl_indent > 0 ? ps.local_decl_indent : i; - tabs_to_var = (use_tabs ? ps.local_decl_indent > 0 : 0); + dec_ind = opt.local_decl_indent > 0 ? opt.local_decl_indent : i; + tabs_to_var = (opt.use_tabs ? opt.local_decl_indent > 0 : 0); } goto copy_id; @@ -977,7 +977,7 @@ check_type: if (ps.in_decl) { if (type_code == funcname) { ps.in_decl = false; - if (procnames_start_line && s_code != e_code) { + if (opt.procnames_start_line && s_code != e_code) { *e_code = '\0'; dump_line(); } @@ -1048,9 +1048,9 @@ check_type: if (ps.p_l_follow == 0) { if (ps.block_init_level <= 0) ps.block_init = 0; - if (break_comma && (!ps.leave_comma || + if (break_comma && (!opt.leave_comma || count_spaces_until(compute_code_target(), s_code, e_code) > - max_col - tabsize)) + opt.max_col - opt.tabsize)) force_nl = true; } break; @@ -1190,7 +1190,7 @@ check_type: break; } } - if (blanklines_around_conditional_compilation) { + if (opt.blanklines_around_conditional_compilation) { postfix_blankline_requested++; n_real_blanklines = 0; } @@ -1266,15 +1266,15 @@ indent_declaration(int cur_dec_ind, int tabs_to_var) /* * get the tab math right for indentations that are not multiples of tabsize */ - if ((ps.ind_level * ps.ind_size) % tabsize != 0) { - pos += (ps.ind_level * ps.ind_size) % tabsize; - cur_dec_ind += (ps.ind_level * ps.ind_size) % tabsize; + if ((ps.ind_level * opt.ind_size) % opt.tabsize != 0) { + pos += (ps.ind_level * opt.ind_size) % opt.tabsize; + cur_dec_ind += (ps.ind_level * opt.ind_size) % opt.tabsize; } if (tabs_to_var) { int tpos; - CHECK_SIZE_CODE(cur_dec_ind / tabsize); - while ((tpos = tabsize * (1 + pos / tabsize)) <= cur_dec_ind) { + CHECK_SIZE_CODE(cur_dec_ind / opt.tabsize); + while ((tpos = opt.tabsize * (1 + pos / opt.tabsize)) <= cur_dec_ind) { *e_code++ = '\t'; pos = tpos; } Modified: head/usr.bin/indent/indent_globs.h ============================================================================== --- head/usr.bin/indent/indent_globs.h Sun Jun 10 16:21:21 2018 (r334926) +++ head/usr.bin/indent/indent_globs.h Sun Jun 10 16:44:18 2018 (r334927) @@ -141,83 +141,96 @@ char *bp_save; /* saved value of buf_ptr when t char *be_save; /* similarly saved value of buf_end */ +struct options { + int blanklines_around_conditional_compilation; + int blanklines_after_declarations_at_proctop; /* this is vaguely + * similar to blanklines_after_decla except + * that in only applies to the first set of + * declarations in a procedure (just after + * the first '{') and it causes a blank line + * to be generated even if there are no + * declarations */ + int blanklines_after_declarations; + int blanklines_after_procs; + int blanklines_before_blockcomments; + int leave_comma; /* if true, never break declarations after + * commas */ + int btype_2; /* when true, brace should be on same line + * as if, while, etc */ + int Bill_Shannon; /* true iff a blank should always be + * inserted after sizeof */ + int comment_delimiter_on_blankline; + int decl_com_ind; /* the column in which comments after + * declarations should be put */ + int cuddle_else; /* true if else should cuddle up to '}' */ + int continuation_indent; /* set to the indentation between the + * edge of code and continuation lines */ + int com_ind; /* the column in which comments to the right + * of code should start */ + int decl_indent; /* column to indent declared identifiers to */ + int ljust_decl; /* true if declarations should be left + * justified */ + int unindent_displace; /* comments not to the right of code + * will be placed this many + * indentation levels to the left of + * code */ + int extra_expression_indent; /* true if continuation lines from + * the expression part of "if(e)", + * "while(e)", "for(e;e;e)" should be + * indented an extra tab stop so that they + * don't conflict with the code that follows */ + int else_if; /* True iff else if pairs should be handled + * specially */ + int function_brace_split; /* split function declaration and + * brace onto separate lines */ + int format_col1_comments; /* If comments which start in column 1 + * are to be magically reformatted (just + * like comments that begin in later columns) */ + int format_block_comments; /* true if comments beginning with + * `/ * \n' are to be reformatted */ + int indent_parameters; + int ind_size; /* the size of one indentation level */ + int block_comment_max_col; + int local_decl_indent; /* like decl_indent but for locals */ + int lineup_to_parens_always; /* if true, do not attempt to keep + * lined-up code within the margin */ + int lineup_to_parens; /* if true, continued code within parens + * will be lined up to the open paren */ + int proc_calls_space; /* If true, procedure calls look like: + * foo (bar) rather than foo(bar) */ + int procnames_start_line; /* if true, the names of procedures + * being defined get placed in column 1 (ie. + * a newline is placed between the type of + * the procedure and its name) */ + int space_after_cast; /* "b = (int) a" vs "b = (int)a" */ + int star_comment_cont; /* true iff comment continuation lines + * should have stars at the beginning of + * each line. */ + int swallow_optional_blanklines; + int auto_typedefs; /* set true to recognize identifiers + * ending in "_t" like typedefs */ + int tabsize; /* the size of a tab */ + int max_col; /* the maximum allowable line length */ + int use_tabs; /* set true to use tabs for spacing, false + * uses all spaces */ + int verbose; /* when true, non-essential error messages + * are printed */ +} opt; + int found_err; -int blanklines_after_declarations; -int blanklines_before_blockcomments; -int blanklines_after_procs; -int blanklines_around_conditional_compilation; -int swallow_optional_blanklines; int n_real_blanklines; int prefix_blankline_requested; int postfix_blankline_requested; int break_comma; /* when true and not in parens, break after a * comma */ -int btype_2; /* when true, brace should be on same line as - * if, while, etc */ float case_ind; /* indentation level to be used for a "case * n:" */ int code_lines; /* count of lines with code */ int had_eof; /* set to true when input is exhausted */ int line_no; /* the current line number. */ -int max_col; /* the maximum allowable line length */ -int verbose; /* when true, non-essential error messages are - * printed */ -int cuddle_else; /* true if else should cuddle up to '}' */ -int star_comment_cont; /* true iff comment continuation lines should - * have stars at the beginning of each line. */ -int comment_delimiter_on_blankline; -int procnames_start_line; /* if true, the names of procedures - * being defined get placed in column - * 1 (ie. a newline is placed between - * the type of the procedure and its - * name) */ -int proc_calls_space; /* If true, procedure calls look like: - * foo (bar) rather than foo(bar) */ -int format_block_comments; /* true if comments beginning with - * `/ * \n' are to be reformatted */ -int format_col1_comments; /* If comments which start in column 1 - * are to be magically reformatted - * (just like comments that begin in - * later columns) */ int inhibit_formatting; /* true if INDENT OFF is in effect */ int suppress_blanklines;/* set iff following blanklines should be * suppressed */ -int continuation_indent;/* set to the indentation between the edge of - * code and continuation lines */ -int lineup_to_parens; /* if true, continued code within parens will - * be lined up to the open paren */ -int lineup_to_parens_always; /* if true, do not attempt to keep - * lined-up code within the margin */ -int Bill_Shannon; /* true iff a blank should always be inserted - * after sizeof */ -int blanklines_after_declarations_at_proctop; /* This is vaguely - * similar to - * blanklines_after_decla - * rations except that - * it only applies to - * the first set of - * declarations in a - * procedure (just after - * the first '{') and it - * causes a blank line - * to be generated even - * if there are no - * declarations */ -int block_comment_max_col; -int extra_expression_indent; /* true if continuation lines from the - * expression part of "if(e)", - * "while(e)", "for(e;e;e)" should be - * indented an extra tab stop so that - * they don't conflict with the code - * that follows */ -int function_brace_split; /* split function declaration and - * brace onto separate lines */ -int use_tabs; /* set true to use tabs for spacing, - * false uses all spaces */ -int auto_typedefs; /* set true to recognize identifiers - * ending in "_t" like typedefs */ -int space_after_cast; /* "b = (int) a" vs "b = (int)a" */ -int tabsize; /* the size of a tab */ struct parser_state { int last_token; @@ -252,13 +265,9 @@ struct parser_state { * column 1 */ int com_col; /* this is the column in which the current * comment should start */ - int com_ind; /* the column in which comments to the right - * of code should start */ int com_lines; /* the number of lines with comments, set by * dump_line */ int dec_nest; /* current nesting level for structure or init */ - int decl_com_ind; /* the column in which comments after - * declarations should be put */ int decl_on_line; /* set to true if this line of code has part * of a declaration on it */ int i_l_follow; /* the level to which ind_level should be set @@ -268,16 +277,11 @@ struct parser_state { * slightly different */ int in_stmt; /* set to 1 while in a stmt */ int ind_level; /* the current indentation level */ - int ind_size; /* the size of one indentation level */ int ind_stmt; /* set to 1 if next line should have an extra * indentation level because we are in the * middle of a stmt */ int last_u_d; /* set to true after scanning a token which * forces a following operator to be unary */ - int leave_comma; /* if true, never break declarations after - * commas */ - int ljust_decl; /* true if declarations should be left - * justified */ int out_coms; /* the number of comments processed, set by * pr_comment */ int out_lines; /* the number of lines written, set by @@ -293,25 +297,16 @@ struct parser_state { int search_brace; /* set to true by parse when it is necessary * to buffer up all info up to the start of a * stmt after an if, while, etc */ - int unindent_displace; /* comments not to the right of code - * will be placed this many - * indentation levels to the left of - * code */ int use_ff; /* set to one if the current line should be * terminated with a form feed */ int want_blank; /* set to true when the following token should * be prefixed by a blank. (Said prefixing is * ignored in some cases.) */ - int else_if; /* True iff else if pairs should be handled - * specially */ - int decl_indent; /* column to indent declared identifiers to */ - int local_decl_indent; /* like decl_indent but for locals */ int keyword; /* the type of a keyword or 0 */ int dumped_decl_indent; float case_indent; /* The distance to indent case labels from the * switch statement */ int in_parameter_declaration; - int indent_parameters; int tos; /* pointer to top of stack */ char procname[100]; /* The name of the current procedure */ int just_saw_decl; Modified: head/usr.bin/indent/io.c ============================================================================== --- head/usr.bin/indent/io.c Sun Jun 10 16:21:21 2018 (r334926) +++ head/usr.bin/indent/io.c Sun Jun 10 16:44:18 2018 (r334927) @@ -83,7 +83,7 @@ dump_line(void) suppress_blanklines = 0; ps.bl_line = false; if (prefix_blankline_requested && not_first_line) { - if (swallow_optional_blanklines) { + if (opt.swallow_optional_blanklines) { if (n_real_blanklines == 1) n_real_blanklines = 0; } @@ -163,12 +163,14 @@ dump_line(void) target += ps.comment_delta; while (*com_st == '\t') /* consider original indentation in * case this is a box comment */ - com_st++, target += tabsize; + com_st++, target += opt.tabsize; while (target <= 0) if (*com_st == ' ') target++, com_st++; - else if (*com_st == '\t') - target = tabsize * (1 + (target - 1) / tabsize) + 1, com_st++; + else if (*com_st == '\t') { + target = opt.tabsize * (1 + (target - 1) / opt.tabsize) + 1; + com_st++; + } else target = 1; if (cur_col > target) { /* if comment can't fit on this line, @@ -189,7 +191,7 @@ dump_line(void) else putc('\n', output); ++ps.out_lines; - if (ps.just_saw_decl == 1 && blanklines_after_declarations) { + if (ps.just_saw_decl == 1 && opt.blanklines_after_declarations) { prefix_blankline_requested = 1; ps.just_saw_decl = 0; } @@ -220,20 +222,20 @@ dump_line(void) int compute_code_target(void) { - int target_col = ps.ind_size * ps.ind_level + 1; + int target_col = opt.ind_size * ps.ind_level + 1; if (ps.paren_level) - if (!lineup_to_parens) - target_col += continuation_indent - * (2 * continuation_indent == ps.ind_size ? 1 : ps.paren_level); - else if (lineup_to_parens_always) + if (!opt.lineup_to_parens) + target_col += opt.continuation_indent * + (2 * opt.continuation_indent == opt.ind_size ? 1 : ps.paren_level); + else if (opt.lineup_to_parens_always) target_col = paren_target; else { int w; int t = paren_target; - if ((w = count_spaces(t, s_code) - max_col) > 0 - && count_spaces(target_col, s_code) <= max_col) { + if ((w = count_spaces(t, s_code) - opt.max_col) > 0 + && count_spaces(target_col, s_code) <= opt.max_col) { t -= w + 1; if (t > target_col) target_col = t; @@ -242,7 +244,7 @@ compute_code_target(void) target_col = t; } else if (ps.ind_stmt) - target_col += continuation_indent; + target_col += opt.continuation_indent; return target_col; } @@ -250,9 +252,9 @@ int compute_label_target(void) { return - ps.pcase ? (int) (case_ind * ps.ind_size) + 1 + ps.pcase ? (int) (case_ind * opt.ind_size) + 1 : *s_lab == '#' ? 1 - : ps.ind_size * (ps.ind_level - label_offset) + 1; + : opt.ind_size * (ps.ind_level - label_offset) + 1; } @@ -400,10 +402,10 @@ pad_output(int current, int target) if (current >= target) return (current); /* line is already long enough */ curr = current; - if (use_tabs) { + if (opt.use_tabs) { int tcur; - while ((tcur = tabsize * (1 + (curr - 1) / tabsize) + 1) <= target) { + while ((tcur = opt.tabsize * (1 + (curr - 1) / opt.tabsize) + 1) <= target) { putc('\t', output); curr = tcur; } @@ -452,7 +454,7 @@ count_spaces_until(int cur, char *buffer, char *end) break; case '\t': - cur = tabsize * (1 + (cur - 1) / tabsize) + 1; + cur = opt.tabsize * (1 + (cur - 1) / opt.tabsize) + 1; break; case 010: /* backspace */ Modified: head/usr.bin/indent/lexi.c ============================================================================== --- head/usr.bin/indent/lexi.c Sun Jun 10 16:21:21 2018 (r334926) +++ head/usr.bin/indent/lexi.c Sun Jun 10 16:44:18 2018 (r334927) @@ -296,7 +296,7 @@ lexi(struct parser_state *state) char *u; /* ... so maybe a type_t or a typedef */ - if ((auto_typedefs && ((u = strrchr(s_token, '_')) != NULL) && + if ((opt.auto_typedefs && ((u = strrchr(s_token, '_')) != NULL) && strcmp(u, "_t") == 0) || (typename_top >= 0 && bsearch(s_token, typenames, typename_top + 1, sizeof(typenames[0]), strcmp_type))) { Modified: head/usr.bin/indent/parse.c ============================================================================== --- head/usr.bin/indent/parse.c Sun Jun 10 16:21:21 2018 (r334926) +++ head/usr.bin/indent/parse.c Sun Jun 10 16:44:18 2018 (r334927) @@ -75,7 +75,7 @@ parse(int tk) /* tk: the code for the construct scanne * input */ case decl: /* scanned a declaration word */ - ps.search_brace = btype_2; + ps.search_brace = opt.btype_2; /* indicate that following brace should be on same line */ if (ps.p_stack[ps.tos] != decl) { /* only put one declaration * onto stack */ @@ -84,7 +84,7 @@ parse(int tk) /* tk: the code for the construct scanne ps.p_stack[++ps.tos] = decl; ps.il[ps.tos] = ps.i_l_follow; - if (ps.ljust_decl) {/* only do if we want left justified + if (opt.ljust_decl) {/* only do if we want left justified * declarations */ ps.ind_level = 0; for (i = ps.tos - 1; i > 0; --i) @@ -97,7 +97,7 @@ parse(int tk) /* tk: the code for the construct scanne break; case ifstmt: /* scanned if (...) */ - if (ps.p_stack[ps.tos] == elsehead && ps.else_if) /* "else if ..." */ + if (ps.p_stack[ps.tos] == elsehead && opt.else_if) /* "else if ..." */ /* * Note that the stack pointer here is decremented, effectively * reducing "else if" to "if". This saves a lot of stack space @@ -110,7 +110,7 @@ parse(int tk) /* tk: the code for the construct scanne ps.p_stack[++ps.tos] = tk; ps.il[ps.tos] = ps.ind_level = ps.i_l_follow; ++ps.i_l_follow; /* subsequent statements should be indented 1 */ - ps.search_brace = btype_2; + ps.search_brace = opt.btype_2; break; case lbrace: /* scanned { */ @@ -154,7 +154,7 @@ parse(int tk) /* tk: the code for the construct scanne ps.p_stack[++ps.tos] = whilestmt; ps.il[ps.tos] = ps.i_l_follow; ++ps.i_l_follow; - ps.search_brace = btype_2; + ps.search_brace = opt.btype_2; } break; @@ -170,7 +170,7 @@ parse(int tk) /* tk: the code for the construct scanne * be in 1 level */ ps.p_stack[ps.tos] = elsehead; /* remember if with else */ - ps.search_brace = btype_2 | ps.else_if; + ps.search_brace = opt.btype_2 | opt.else_if; } break; @@ -194,7 +194,7 @@ parse(int tk) /* tk: the code for the construct scanne * switch */ ps.i_l_follow += ps.case_indent + 1; /* statements should be two * levels in */ - ps.search_brace = btype_2; + ps.search_brace = opt.btype_2; break; case semicolon: /* this indicates a simple stmt */ Modified: head/usr.bin/indent/pr_comment.c ============================================================================== --- head/usr.bin/indent/pr_comment.c Sun Jun 10 16:21:21 2018 (r334926) +++ head/usr.bin/indent/pr_comment.c Sun Jun 10 16:44:18 2018 (r334927) @@ -91,9 +91,10 @@ pr_comment(void) char *last_bl; /* points to the last blank in the output * buffer */ char *t_ptr; /* used for moving string */ - int break_delim = comment_delimiter_on_blankline; + int break_delim = opt.comment_delimiter_on_blankline; int l_just_saw_decl = ps.just_saw_decl; - adj_max_col = max_col; + + adj_max_col = opt.max_col; ps.just_saw_decl = 0; last_bl = NULL; /* no blanks found so far */ ps.box_com = false; /* at first, assume that we are not in @@ -103,7 +104,7 @@ pr_comment(void) /* Figure where to align and how to treat the comment */ - if (ps.col_1 && !format_col1_comments) { /* if comment starts in column + if (ps.col_1 && !opt.format_col1_comments) { /* if comment starts in column * 1 it should not be touched */ ps.box_com = true; break_delim = false; @@ -111,7 +112,7 @@ pr_comment(void) } else { if (*buf_ptr == '-' || *buf_ptr == '*' || - (*buf_ptr == '\n' && !format_block_comments)) { + (*buf_ptr == '\n' && !opt.format_block_comments)) { ps.box_com = true; /* A comment with a '-' or '*' immediately * after the /+* is assumed to be a boxed * comment. A comment with a newline @@ -127,10 +128,10 @@ pr_comment(void) * If this (*and previous lines are*) blank, dont put comment way * out at left */ - ps.com_col = (ps.ind_level - ps.unindent_displace) * ps.ind_size + 1; - adj_max_col = block_comment_max_col; + ps.com_col = (ps.ind_level - opt.unindent_displace) * opt.ind_size + 1; + adj_max_col = opt.block_comment_max_col; if (ps.com_col <= 1) - ps.com_col = 1 + !format_col1_comments; + ps.com_col = 1 + !opt.format_col1_comments; } else { int target_col; @@ -142,9 +143,9 @@ pr_comment(void) if (s_lab != e_lab) target_col = count_spaces(compute_label_target(), s_lab); } - ps.com_col = ps.decl_on_line || ps.ind_level == 0 ? ps.decl_com_ind : ps.com_ind; + ps.com_col = ps.decl_on_line || ps.ind_level == 0 ? opt.decl_com_ind : opt.com_ind; if (ps.com_col <= target_col) - ps.com_col = tabsize * (1 + (target_col - 1) / tabsize) + 1; + ps.com_col = opt.tabsize * (1 + (target_col - 1) / opt.tabsize) + 1; if (ps.com_col + 24 > adj_max_col) adj_max_col = ps.com_col + 24; } @@ -193,11 +194,11 @@ pr_comment(void) char *t = e_com; e_com = s_com + 2; *e_com = 0; - if (blanklines_before_blockcomments && ps.last_token != lbrace) + if (opt.blanklines_before_blockcomments && ps.last_token != lbrace) prefix_blankline_requested = 1; dump_line(); e_com = s_com = t; - if (!ps.box_com && star_comment_cont) + if (!ps.box_com && opt.star_comment_cont) *e_com++ = ' ', *e_com++ = '*', *e_com++ = ' '; } @@ -213,7 +214,7 @@ pr_comment(void) /* fix so dump_line uses a form feed */ dump_line(); last_bl = NULL; - if (!ps.box_com && star_comment_cont) + if (!ps.box_com && opt.star_comment_cont) *e_com++ = ' ', *e_com++ = '*', *e_com++ = ' '; while (*++buf_ptr == ' ' || *buf_ptr == '\t') ; @@ -239,11 +240,11 @@ pr_comment(void) *e_com++ = ' '; if (!ps.box_com && e_com - s_com > 3) { dump_line(); - if (star_comment_cont) + if (opt.star_comment_cont) *e_com++ = ' ', *e_com++ = '*', *e_com++ = ' '; } dump_line(); - if (!ps.box_com && star_comment_cont) + if (!ps.box_com && opt.star_comment_cont) *e_com++ = ' ', *e_com++ = '*', *e_com++ = ' '; } else { @@ -324,14 +325,14 @@ pr_comment(void) */ if (last_bl == NULL) { dump_line(); - if (!ps.box_com && star_comment_cont) + if (!ps.box_com && opt.star_comment_cont) *e_com++ = ' ', *e_com++ = '*', *e_com++ = ' '; break; } *e_com = '\0'; e_com = last_bl; dump_line(); - if (!ps.box_com && star_comment_cont) + if (!ps.box_com && opt.star_comment_cont) *e_com++ = ' ', *e_com++ = '*', *e_com++ = ' '; for (t_ptr = last_bl + 1; *t_ptr == ' ' || *t_ptr == '\t'; t_ptr++) From owner-svn-src-head@freebsd.org Sun Jun 10 17:54:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E2AC100B0C6; Sun, 10 Jun 2018 17:54:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E73346EA88; Sun, 10 Jun 2018 17:54:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C8729102F4; Sun, 10 Jun 2018 17:54:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5AHsit5061029; Sun, 10 Jun 2018 17:54:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5AHsi4r061028; Sun, 10 Jun 2018 17:54:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201806101754.w5AHsi4r061028@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 10 Jun 2018 17:54:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334928 - head/lib/libc/stdlib X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/lib/libc/stdlib X-SVN-Commit-Revision: 334928 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jun 2018 17:54:45 -0000 Author: kib Date: Sun Jun 10 17:54:44 2018 New Revision: 334928 URL: https://svnweb.freebsd.org/changeset/base/334928 Log: libc qsort(3): stop aliasing. Qsort swap code aliases the sorted array elements to ints and longs in order to do swap by machine words. Unfortunately this breaks with the full code optimization, e.g. LTO. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83201 which seems to reference code directly copied from libc/stdlib/qsort.c. PR: 228780 Reported by: mliska@suse.cz Reviewed by: brooks Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D15714 Modified: head/lib/libc/stdlib/qsort.c Modified: head/lib/libc/stdlib/qsort.c ============================================================================== --- head/lib/libc/stdlib/qsort.c Sun Jun 10 16:44:18 2018 (r334927) +++ head/lib/libc/stdlib/qsort.c Sun Jun 10 17:54:44 2018 (r334928) @@ -43,53 +43,27 @@ typedef int cmp_t(void *, const void *, const void * typedef int cmp_t(const void *, const void *); #endif static inline char *med3(char *, char *, char *, cmp_t *, void *); -static inline void swapfunc(char *, char *, size_t, int, int); #define MIN(a, b) ((a) < (b) ? a : b) /* * Qsort routine from Bentley & McIlroy's "Engineering a Sort Function". */ -#define swapcode(TYPE, parmi, parmj, n) { \ - size_t i = (n) / sizeof (TYPE); \ - TYPE *pi = (TYPE *) (parmi); \ - TYPE *pj = (TYPE *) (parmj); \ - do { \ - TYPE t = *pi; \ - *pi++ = *pj; \ - *pj++ = t; \ - } while (--i > 0); \ -} -#define SWAPINIT(TYPE, a, es) swaptype_ ## TYPE = \ - ((char *)a - (char *)0) % sizeof(TYPE) || \ - es % sizeof(TYPE) ? 2 : es == sizeof(TYPE) ? 0 : 1; - static inline void -swapfunc(char *a, char *b, size_t n, int swaptype_long, int swaptype_int) +swapfunc(char *a, char *b, size_t es) { - if (swaptype_long <= 1) - swapcode(long, a, b, n) - else if (swaptype_int <= 1) - swapcode(int, a, b, n) - else - swapcode(char, a, b, n) + char t; + + do { + t = *a; + *a++ = *b; + *b++ = t; + } while (--es > 0); } -#define swap(a, b) \ - if (swaptype_long == 0) { \ - long t = *(long *)(a); \ - *(long *)(a) = *(long *)(b); \ - *(long *)(b) = t; \ - } else if (swaptype_int == 0) { \ - int t = *(int *)(a); \ - *(int *)(a) = *(int *)(b); \ - *(int *)(b) = t; \ - } else \ - swapfunc(a, b, es, swaptype_long, swaptype_int) - #define vecswap(a, b, n) \ - if ((n) > 0) swapfunc(a, b, n, swaptype_long, swaptype_int) + if ((n) > 0) swapfunc(a, b, n) #ifdef I_AM_QSORT_R #define CMP(t, x, y) (cmp((t), (x), (y))) @@ -121,17 +95,16 @@ qsort(void *a, size_t n, size_t es, cmp_t *cmp) char *pa, *pb, *pc, *pd, *pl, *pm, *pn; size_t d1, d2; int cmp_result; - int swaptype_long, swaptype_int, swap_cnt; + int swap_cnt; -loop: SWAPINIT(long, a, es); - SWAPINIT(int, a, es); +loop: swap_cnt = 0; if (n < 7) { for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es) for (pl = pm; pl > (char *)a && CMP(thunk, pl - es, pl) > 0; pl -= es) - swap(pl, pl - es); + swapfunc(pl, pl - es, es); return; } pm = (char *)a + (n / 2) * es; @@ -147,7 +120,7 @@ loop: SWAPINIT(long, a, es); } pm = med3(pl, pm, pn, cmp, thunk); } - swap(a, pm); + swapfunc(a, pm, es); pa = pb = (char *)a + es; pc = pd = (char *)a + (n - 1) * es; @@ -155,7 +128,7 @@ loop: SWAPINIT(long, a, es); while (pb <= pc && (cmp_result = CMP(thunk, pb, a)) <= 0) { if (cmp_result == 0) { swap_cnt = 1; - swap(pa, pb); + swapfunc(pa, pb, es); pa += es; } pb += es; @@ -163,14 +136,14 @@ loop: SWAPINIT(long, a, es); while (pb <= pc && (cmp_result = CMP(thunk, pc, a)) >= 0) { if (cmp_result == 0) { swap_cnt = 1; - swap(pc, pd); + swapfunc(pc, pd, es); pd -= es; } pc -= es; } if (pb > pc) break; - swap(pb, pc); + swapfunc(pb, pc, es); swap_cnt = 1; pb += es; pc -= es; @@ -180,7 +153,7 @@ loop: SWAPINIT(long, a, es); for (pl = pm; pl > (char *)a && CMP(thunk, pl - es, pl) > 0; pl -= es) - swap(pl, pl - es); + swapfunc(pl, pl - es, es); return; } From owner-svn-src-head@freebsd.org Sun Jun 10 18:38:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8503A101143A; Sun, 10 Jun 2018 18:38:49 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 32A0A70723; Sun, 10 Jun 2018 18:38:49 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0FB6F1097C; Sun, 10 Jun 2018 18:38:49 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5AIcmZx081342; Sun, 10 Jun 2018 18:38:48 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5AIcmxH081341; Sun, 10 Jun 2018 18:38:48 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806101838.w5AIcmxH081341@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 10 Jun 2018 18:38:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334929 - in head: . sys/sys X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in head: . sys/sys X-SVN-Commit-Revision: 334929 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jun 2018 18:38:49 -0000 Author: eadler Date: Sun Jun 10 18:38:48 2018 New Revision: 334929 URL: https://svnweb.freebsd.org/changeset/base/334929 Log: include: remove sys/capability.h This file has only generated a warning for the last 18 months. Its existence at this point only serves to confuse software looking for POSIX.1e capabilities and produce actionless warnings. Deleted: head/sys/sys/capability.h Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Jun 10 17:54:44 2018 (r334928) +++ head/ObsoleteFiles.inc Sun Jun 10 18:38:48 2018 (r334929) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20180610: Remove sys/capability.h +OLD_FILES+=usr/include/sys/capability.h # 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 From owner-svn-src-head@freebsd.org Sun Jun 10 18:43:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6EC571011E77; Sun, 10 Jun 2018 18:43:09 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-it0-x229.google.com (mail-it0-x229.google.com [IPv6:2607:f8b0:4001:c0b::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F2C1070C2B; Sun, 10 Jun 2018 18:43:08 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-it0-x229.google.com with SMTP id 188-v6so7417256ita.5; Sun, 10 Jun 2018 11:43:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=GCGKeM7JKGoPWNp8EJdLgMwMVdWJthUcobkG6vI0HWs=; b=YjmnjBSYFqECM8YEgMlYwcTkh/QawEqtCQcu123PIVmzbR/9ZHWJ4vcJRwqdAgErOF F5LhAjr1SfJdzZkEyJjFI99Chlun/KDSA08d9nLp1fVTDLq0SbZZaKoTzW14hGUwj41T EKdSmX1eLYuC0kndXJnxhKz29CcK9K06tNWDHE1Ho8macsf4SnXyhSn35T/5R15bqu61 CErdYfxoTInOyvi1U8Nvn+2xwpYtMpTNFdkO4oRfG9zYT1q/5d/wJsO6igRUxibhUhCW /cCjLojAE2So6JaFKmxgjU/e0zAlhnPzWJ6pl2T0bn+Oui+T/VuEzxaNT+yJeVc2Oq7o cLsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=GCGKeM7JKGoPWNp8EJdLgMwMVdWJthUcobkG6vI0HWs=; b=HVL9L8KoboOxRcjjbD3riOrGXaviXBQuXl7V8JYzGsQEDFGRGRe7GsU0vuVwSgavww DRh8m9acpG7BU4LMRK5SHO+B5kWxNVBiHOI7QqaEKgqb5pLuzQTCu8GNT6/Ira7ZSfnG +wIHQspx+pFwzdmyS7w/y5P/gHPFlMz9EcBDxLavcTwdqswNzZQBcT1lMaB9mybugoP5 Q+ZS9j/WxvUCKZLgJ6VbTokjMBYDWmL3b0kYkeoh9e4fWAqZ1XufBrJglWpCjuNCMN50 rTWCJnrzQiZgn0HOlYiG4/Pt0wQoSxRMVD8MxzFvKFb6J2hqlUnzsLew+OB7ScMoNfiI i/8g== X-Gm-Message-State: APt69E0dy2P4Jn9CtjNHaOOkL/gPD/2Z48iu28TXZua0fBeKF3+KbeWF 66bzPRsrPcXFiLAOK9Bk5UdkAPos X-Google-Smtp-Source: ADUXVKKNyqpxa0K4kKNMMVzHz4ertrJGbFBf6vPfkQibAkV/4K24sc29rh+qVZZq685Zrhc0NCHrTg== X-Received: by 2002:a24:470b:: with SMTP id t11-v6mr8548436itb.26.1528656188152; Sun, 10 Jun 2018 11:43:08 -0700 (PDT) Received: from pesky ([75.98.19.133]) by smtp.gmail.com with ESMTPSA id i19-v6sm8874778ioj.2.2018.06.10.11.43.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 Jun 2018 11:43:07 -0700 (PDT) Sender: Mark Johnston Date: Sun, 10 Jun 2018 14:43:00 -0400 From: Mark Johnston To: Eitan Adler Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334929 - in head: . sys/sys Message-ID: <20180610184300.GC24973@pesky> References: <201806101838.w5AIcmxH081341@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201806101838.w5AIcmxH081341@repo.freebsd.org> User-Agent: Mutt/1.10.0 (2018-05-17) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jun 2018 18:43:09 -0000 On Sun, Jun 10, 2018 at 06:38:48PM +0000, Eitan Adler wrote: > Author: eadler > Date: Sun Jun 10 18:38:48 2018 > New Revision: 334929 > URL: https://svnweb.freebsd.org/changeset/base/334929 > > Log: > include: remove sys/capability.h > > This file has only generated a warning for the last 18 months. Its > existence at this point only serves to confuse software looking for > POSIX.1e capabilities and produce actionless warnings. Don't you need an exp-run to make this claim? > Deleted: > head/sys/sys/capability.h > Modified: > head/ObsoleteFiles.inc From owner-svn-src-head@freebsd.org Sun Jun 10 18:53:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F82A101343F; Sun, 10 Jun 2018 18:53:36 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-it0-x242.google.com (mail-it0-x242.google.com [IPv6:2607:f8b0:4001:c0b::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CB1D47138F; Sun, 10 Jun 2018 18:53:35 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-it0-x242.google.com with SMTP id a195-v6so7934026itd.3; Sun, 10 Jun 2018 11:53:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=SIE7jLZ1gaf9cum/1i9O/oKijIDJWBAYZQdLOTdPptk=; b=YMRtmRzhEPR0+Jf3jtUAiZlxlbJCRaENqi28ptv3V4AWZYd2p927wOaM08VsXghIzx BXr/R4GVMfWLIKuCUHvEpAzB8W3g1J5Xhq5yJK5Z2hGGccnPOIRM1tSdI/+5/TWLmNwF yHcSeuf3oTUXQ5gD4gnQ3buiKFj8cIlyMWf1VDPJL3EoN5K+mwP4rQ1LQ/OUmdcMFHZH f+yryUhtKk67taWjZ9UV1qa7ans/y8/1EKhNfGPzHLZoRTYhyQ2r3sWzxF4pJZtiW6of l3psk7uYpf2E/0BP9WC1q150Ch1QKHp/BqpKtenRsaJd9RfmEranu3vMo6ndnU2kX4Av XCvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=SIE7jLZ1gaf9cum/1i9O/oKijIDJWBAYZQdLOTdPptk=; b=bBveLyB+7n3xAhrvPS7R1jk86FWhir9GJP8WCegwSJpkDwSJTKCMKJUbg596ODfZFl rH8ZyTPuhsgz1spbSPOgbtwFIgaMMyZhxW8gvVyTXRlnS+vrfkpBgtE4WLfZlmIapp7/ EQzIROZ5tt4ja5vPvAkb2LGablrreJ/OLeGoFhtfU1mM38I2mrbDGON55SzmiSFQCoAX kbsjkAalaazogoufZlEqWsn0zo7Vcd7GYhfq8tqGa+A+7r5dyn6fGcQYeTtp0FGHl27T mUIu20qID5IdSl7880TTqLpVtSPTJWJTSKszkCG3URHPUvd0pTVdAwZg73FzA5mFKKfN FwAQ== X-Gm-Message-State: APt69E0DMGtyLaduOz9vwOT8p36hg2GVuUBD1wGUiSSv7S3XYOBK/sZm gy0tZxd4HRZwhJLx3XfsSDbB5u4c61yhFCD+vtE= X-Google-Smtp-Source: ADUXVKJ1M5YQoVKO5DK1hm1qzt2zbOTL+3sQvR2PfaKCJuufbqjh4X6EtqsYoH3iFUznrlLgY+XUhKFSD9kMfUuAMVc= X-Received: by 2002:a24:af55:: with SMTP id l21-v6mr4400415iti.55.1528656814946; Sun, 10 Jun 2018 11:53:34 -0700 (PDT) MIME-Version: 1.0 Sender: antoine.brodin.freebsd@gmail.com Received: by 2002:a02:384a:0:0:0:0:0 with HTTP; Sun, 10 Jun 2018 11:53:34 -0700 (PDT) In-Reply-To: <20180610184300.GC24973@pesky> References: <201806101838.w5AIcmxH081341@repo.freebsd.org> <20180610184300.GC24973@pesky> From: Antoine Brodin Date: Sun, 10 Jun 2018 20:53:34 +0200 X-Google-Sender-Auth: q4hVroXsgOb8C7HDvJcHJoFgiWM Message-ID: Subject: Re: svn commit: r334929 - in head: . sys/sys To: Eitan Adler Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Mark Johnston Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jun 2018 18:53:36 -0000 On Sun, Jun 10, 2018 at 8:43 PM, Mark Johnston wrote: > On Sun, Jun 10, 2018 at 06:38:48PM +0000, Eitan Adler wrote: >> Author: eadler >> Date: Sun Jun 10 18:38:48 2018 >> New Revision: 334929 >> URL: https://svnweb.freebsd.org/changeset/base/334929 >> >> Log: >> include: remove sys/capability.h >> >> This file has only generated a warning for the last 18 months. Its >> existence at this point only serves to confuse software looking for >> POSIX.1e capabilities and produce actionless warnings. > > Don't you need an exp-run to make this claim? Yes, please revert. Cheers, Antoine (with hat: portmgr) > >> Deleted: >> head/sys/sys/capability.h >> Modified: >> head/ObsoleteFiles.inc > From owner-svn-src-head@freebsd.org Sun Jun 10 19:03:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D26901014C55; Sun, 10 Jun 2018 19:03:22 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8543B71DC2; Sun, 10 Jun 2018 19:03:22 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6601810E32; Sun, 10 Jun 2018 19:03:22 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5AJ3MdV096521; Sun, 10 Jun 2018 19:03:22 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5AJ3Mkw096520; Sun, 10 Jun 2018 19:03:22 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201806101903.w5AJ3Mkw096520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 10 Jun 2018 19:03:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334930 - head/sys/fs/nfsclient X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsclient X-SVN-Commit-Revision: 334930 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jun 2018 19:03:23 -0000 Author: rmacklem Date: Sun Jun 10 19:03:21 2018 New Revision: 334930 URL: https://svnweb.freebsd.org/changeset/base/334930 Log: Add checks for the Flexible File layout to LayoutRecall callbacks. The Flexible File layout case wasn't handled by LayoutRecall callbacks because it just checked for File layout and returned NFSERR_NOMATCHLAYOUT otherwise. This patch adds the Flexible File layout handling. Found during testing of the pNFS server. MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clstate.c Modified: head/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c Sun Jun 10 18:38:48 2018 (r334929) +++ head/sys/fs/nfsclient/nfs_clstate.c Sun Jun 10 19:03:21 2018 (r334930) @@ -3422,9 +3422,12 @@ nfscl_docb(struct nfsrv_descript *nd, NFSPROC_T *p) else changed = 0; recalltype = fxdr_unsigned(int, *tl); + NFSCL_DEBUG(4, "layt=%d iom=%d ch=%d rectyp=%d\n", + laytype, iomode, changed, recalltype); recallp = malloc(sizeof(*recallp), M_NFSLAYRECALL, M_WAITOK); - if (laytype != NFSLAYOUT_NFSV4_1_FILES) + if (laytype != NFSLAYOUT_NFSV4_1_FILES && + laytype != NFSLAYOUT_FLEXFILE) error = NFSERR_NOMATCHLAYOUT; else if (recalltype == NFSLAYOUTRETURN_FILE) { error = nfsm_getfh(nd, &nfhp); @@ -3441,6 +3444,9 @@ nfscl_docb(struct nfsrv_descript *nd, NFSPROC_T *p) error = NFSERR_NOTSUPP; else if (i == 0) error = NFSERR_OPNOTINSESS; + NFSCL_DEBUG(4, "off=%ju len=%ju sq=%u err=%d\n", + (uintmax_t)off, (uintmax_t)len, + stateid.seqid, error); if (error == 0) { NFSLOCKCLSTATE(); clp = nfscl_getclntsess(sessionid); @@ -3453,7 +3459,8 @@ nfscl_docb(struct nfsrv_descript *nd, NFSPROC_T *p) lyp); if (lyp != NULL && (lyp->nfsly_flags & - NFSLY_FILES) != 0 && + (NFSLY_FILES | + NFSLY_FLEXFILE)) != 0 && !NFSBCMP(stateid.other, lyp->nfsly_stateid.other, NFSX_STATEIDOTHER)) { From owner-svn-src-head@freebsd.org Sun Jun 10 19:15:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCFA91016D82; Sun, 10 Jun 2018 19:15:39 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 70F8572ACE; Sun, 10 Jun 2018 19:15:39 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5218010FE4; Sun, 10 Jun 2018 19:15:39 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5AJFdEQ001909; Sun, 10 Jun 2018 19:15:39 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5AJFcZM001907; Sun, 10 Jun 2018 19:15:38 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806101915.w5AJFcZM001907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 10 Jun 2018 19:15:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334931 - in head: . sys/sys X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in head: . sys/sys X-SVN-Commit-Revision: 334931 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jun 2018 19:15:40 -0000 Author: eadler Date: Sun Jun 10 19:15:38 2018 New Revision: 334931 URL: https://svnweb.freebsd.org/changeset/base/334931 Log: Revert r334929 Apparently some software might depend on a header whose sole contents is a `#warning` to remove it. Revert pending exp-run. Added: head/sys/sys/capability.h - copied unchanged from r334928, head/sys/sys/capability.h Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Jun 10 19:03:21 2018 (r334930) +++ head/ObsoleteFiles.inc Sun Jun 10 19:15:38 2018 (r334931) @@ -38,8 +38,6 @@ # xargs -n1 | sort | uniq -d; # done -# 20180610: Remove sys/capability.h -OLD_FILES+=usr/include/sys/capability.h # 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 Copied: head/sys/sys/capability.h (from r334928, head/sys/sys/capability.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/capability.h Sun Jun 10 19:15:38 2018 (r334931, copy of r334928, head/sys/sys/capability.h) @@ -0,0 +1,46 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2014 Robert N. M. Watson + * All rights reserved. + * + * This software was developed at the University of Cambridge Computer + * Laboratory with support from a grant from Google, Inc. + * + * 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$ + */ + +/* + * Historically, the key userspace and kernel Capsicum definitions were found + * in this file. However, it conflicted with POSIX.1e's capability.h, so has + * been renamed capsicum.h. The file remains for backwards compatibility + * reasons as a nested include. + */ +#ifndef _SYS_CAPABILITY_H_ +#define _SYS_CAPABILITY_H_ + +#warning this file includes which is deprecated +#include + +#endif /* !_SYS_CAPABILITY_H_ */ From owner-svn-src-head@freebsd.org Sun Jun 10 19:19:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0D131017618; Sun, 10 Jun 2018 19:19:10 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-it0-x242.google.com (mail-it0-x242.google.com [IPv6:2607:f8b0:4001:c0b::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8445672E54; Sun, 10 Jun 2018 19:19:10 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-it0-x242.google.com with SMTP id a3-v6so8498040itd.0; Sun, 10 Jun 2018 12:19:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=LrqPJ/70UlA+oQb66IJzqhX2CKsHhKdjabq7QqogUjA=; b=ec6VOFvZQ5uuKXJtLIGURFQsEcWP4D7SnrMqiSKMdI/aDwJFnIlsc7aLCsWV2ZcwAe sC5MxMbnYmx/m1iZj61aOWDmuFt3ywCF3nBGHxvCeVW56A7Al+uZhLKnR2JC3pZnI59T vA/SEfLbbTr0y2OMQsOXkB2IJeXqVh0B9n0iSq+5Pg75xdVgKMf6BvlvqoJzmL0yk4gz MEduTDqns2N1jI1rfgJT1v6YHN/ptwBAgX+E7jGHVHmwUalM0N8H1gSdw0BvqQwtRgSa DoIa1tTOFLgokbWUFpf8yF3Kfk+hNV6fxfhDULZMh7OVBuIDy5JO8YjSr5LsQiI3tiDw ou2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=LrqPJ/70UlA+oQb66IJzqhX2CKsHhKdjabq7QqogUjA=; b=h2qM0wMtzYF11/4feVmD09Qvpd8nlaUYEmk1j6apn3W9ObVcoxwN39Frf/5TNjIBlx H0/cwA2lx4WHtYxE13JGooF0gZubPnhnCEHyNYPrP7SaOzeqpssffoNRc1m1R1hZ49XC tM8d9zjzpqnPYiR/NNNqnZUDqLRt5xgAXiwDZJjRRjLL6aksWK0mHr+5X1q/R/t09sGQ yGApLH6/Wgy+OWQzHPgstc+RzJzcTIiVuaEWKZqq3CGinFXhgNwsjO5Xn2+WGh/9eed1 QvRlIbeTuZDKy+PZ1POd0+l5HncBOAib/+/2XY2W4x0NXC4Fmb0J9cFdu2EY/XbZYzYQ 0BuA== X-Gm-Message-State: APt69E2I7m0hfbp1Lj4RsuQBZBzW7bjIGMIDTZSInScmzLEwPRgXt99m kQgHClZf6PkPDryQ96+kTDiipzTXIIlvU7ciqe+llw== X-Google-Smtp-Source: ADUXVKLP4rCvPiMgKVjbCQVONr5fub/PT/kjZ3RiziT1v2FqjQjsucuweQk4r1aKWcjn89ypvugdsYuQwAVebPOMXXY= X-Received: by 2002:a24:1a10:: with SMTP id 16-v6mr7927744iti.66.1528658349911; Sun, 10 Jun 2018 12:19:09 -0700 (PDT) MIME-Version: 1.0 Sender: antoine.brodin.freebsd@gmail.com Received: by 2002:a02:384a:0:0:0:0:0 with HTTP; Sun, 10 Jun 2018 12:19:09 -0700 (PDT) In-Reply-To: <201806101915.w5AJFcZM001907@repo.freebsd.org> References: <201806101915.w5AJFcZM001907@repo.freebsd.org> From: Antoine Brodin Date: Sun, 10 Jun 2018 21:19:09 +0200 X-Google-Sender-Auth: taxTGADM2V_g7fMt3fhsuye0RGU Message-ID: Subject: Re: svn commit: r334931 - in head: . sys/sys To: Eitan Adler Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jun 2018 19:19:11 -0000 On Sun, Jun 10, 2018 at 9:15 PM, Eitan Adler wrote: > Author: eadler > Date: Sun Jun 10 19:15:38 2018 > New Revision: 334931 > URL: https://svnweb.freebsd.org/changeset/base/334931 > > Log: > Revert r334929 > > Apparently some software might depend on a header whose sole contents is > a `#warning` to remove it. Revert pending exp-run. Hi, It's not just a #warning, there is a #include line below... And after this change, most ports that supported sandboxing were no longer sandboxed. Cheers, Antoine From owner-svn-src-head@freebsd.org Sun Jun 10 19:19:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C63EB10176F0 for ; Sun, 10 Jun 2018 19:19:28 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 74DAC72F8A for ; Sun, 10 Jun 2018 19:19:28 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from mail-yw0-f178.google.com (mail-yw0-f178.google.com [209.85.161.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: eadler) by smtp.freebsd.org (Postfix) with ESMTPSA id 42BE9CA73 for ; Sun, 10 Jun 2018 19:19:28 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: by mail-yw0-f178.google.com with SMTP id v131-v6so5683163ywg.2 for ; Sun, 10 Jun 2018 12:19:28 -0700 (PDT) X-Gm-Message-State: APt69E0+nifUOR/mS+wWeoMswsmKU8srJCTuzShhr3T/bmgOWZhmlgWG D+Lphr8VB4EusaQfEJ/rsdNYEhY33ncUS/52VuQV1w== X-Google-Smtp-Source: ADUXVKK94KIcd7Pz8ov2LldWaYTLA5YHkHKfcSp/57oi5MD9mVZuVdoOPfj7ssjH/hnVeoNtyapgaZNVog2guV2tPYk= X-Received: by 2002:a81:3e16:: with SMTP id l22-v6mr8338262ywa.37.1528658367677; Sun, 10 Jun 2018 12:19:27 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ef50:0:0:0:0:0 with HTTP; Sun, 10 Jun 2018 12:18:57 -0700 (PDT) In-Reply-To: References: <201806101838.w5AIcmxH081341@repo.freebsd.org> <20180610184300.GC24973@pesky> From: Eitan Adler Date: Sun, 10 Jun 2018 12:18:57 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334929 - in head: . sys/sys To: Antoine Brodin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Mark Johnston Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jun 2018 19:19:29 -0000 On 10 June 2018 at 11:53, Antoine Brodin wrote: > On Sun, Jun 10, 2018 at 8:43 PM, Mark Johnston wrote: >> On Sun, Jun 10, 2018 at 06:38:48PM +0000, Eitan Adler wrote: >>> Author: eadler >>> Date: Sun Jun 10 18:38:48 2018 >>> New Revision: 334929 >>> URL: https://svnweb.freebsd.org/changeset/base/334929 >>> >>> Log: >>> include: remove sys/capability.h >>> >>> This file has only generated a warning for the last 18 months. Its >>> existence at this point only serves to confuse software looking for >>> POSIX.1e capabilities and produce actionless warnings. >> >> Don't you need an exp-run to make this claim? ... Reverted and exp-run request in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=228878 -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@freebsd.org Sun Jun 10 19:42:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC8ED101AFF0; Sun, 10 Jun 2018 19:42:45 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 843FE744BB; Sun, 10 Jun 2018 19:42:45 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 65563114D3; Sun, 10 Jun 2018 19:42:45 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5AJgj6C017867; Sun, 10 Jun 2018 19:42:45 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5AJgiGm017862; Sun, 10 Jun 2018 19:42:44 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201806101942.w5AJgiGm017862@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 10 Jun 2018 19:42:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334932 - in head/sys: arm64/arm64 arm64/conf conf X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys: arm64/arm64 arm64/conf conf X-SVN-Commit-Revision: 334932 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jun 2018 19:42:46 -0000 Author: andrew Date: Sun Jun 10 19:42:44 2018 New Revision: 334932 URL: https://svnweb.freebsd.org/changeset/base/334932 Log: Remove the psci option from arm64. It is now a standard option as it is required to boot correctly. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/cpu_errata.c head/sys/arm64/arm64/vm_machdep.c head/sys/arm64/conf/GENERIC head/sys/conf/files.arm64 head/sys/conf/options.arm64 Modified: head/sys/arm64/arm64/cpu_errata.c ============================================================================== --- head/sys/arm64/arm64/cpu_errata.c Sun Jun 10 19:15:38 2018 (r334931) +++ head/sys/arm64/arm64/cpu_errata.c Sun Jun 10 19:42:44 2018 (r334932) @@ -41,9 +41,7 @@ __FBSDID("$FreeBSD$"); #include -#ifdef DEV_PSCI #include -#endif typedef void (cpu_quirk_install)(void); struct cpu_quirks { @@ -81,9 +79,7 @@ static void install_psci_bp_hardening(void) { -#ifdef DEV_PSCI PCPU_SET(bp_harden, psci_get_version); -#endif } void Modified: head/sys/arm64/arm64/vm_machdep.c ============================================================================== --- head/sys/arm64/arm64/vm_machdep.c Sun Jun 10 19:15:38 2018 (r334931) +++ head/sys/arm64/arm64/vm_machdep.c Sun Jun 10 19:42:44 2018 (r334932) @@ -54,9 +54,7 @@ __FBSDID("$FreeBSD$"); #include #endif -#ifdef DEV_PSCI #include -#endif /* * Finish a fork operation, with process p2 nearly set up. @@ -119,9 +117,7 @@ void cpu_reset(void) { -#ifdef DEV_PSCI psci_reset(); -#endif printf("cpu_reset failed"); while(1) Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Sun Jun 10 19:15:38 2018 (r334931) +++ head/sys/arm64/conf/GENERIC Sun Jun 10 19:42:44 2018 (r334932) @@ -239,7 +239,6 @@ device tun # Packet tunnel. device md # Memory "disks" device gif # IPv6 and IPv4 tunneling device firmware # firmware assist module -device psci # Support for ARM PSCI options EFIRT # EFI Runtime Services # EXT_RESOURCES pseudo devices Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Sun Jun 10 19:15:38 2018 (r334931) +++ head/sys/conf/files.arm64 Sun Jun 10 19:42:44 2018 (r334932) @@ -206,8 +206,8 @@ dev/ofw/ofwpci.c optional fdt pci dev/pci/pci_host_generic.c optional pci dev/pci/pci_host_generic_acpi.c optional pci acpi dev/pci/pci_host_generic_fdt.c optional pci fdt -dev/psci/psci.c optional psci -dev/psci/psci_arm64.S optional psci +dev/psci/psci.c standard +dev/psci/psci_arm64.S standard dev/uart/uart_cpu_arm64.c optional uart dev/uart/uart_dev_pl011.c optional uart pl011 dev/usb/controller/dwc_otg_hisi.c optional dwcotg fdt soc_hisi_hi6220 Modified: head/sys/conf/options.arm64 ============================================================================== --- head/sys/conf/options.arm64 Sun Jun 10 19:15:38 2018 (r334931) +++ head/sys/conf/options.arm64 Sun Jun 10 19:42:44 2018 (r334932) @@ -13,9 +13,6 @@ COMPAT_FREEBSD32 opt_global.h # EFI Runtime services support EFIRT opt_efirt.h -# Devices -DEV_PSCI opt_platform.h - # SoC Support SOC_ALLWINNER_A64 opt_soc.h SOC_ALLWINNER_H5 opt_soc.h From owner-svn-src-head@freebsd.org Sun Jun 10 19:43:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 514C5101B0AD; Sun, 10 Jun 2018 19:43:06 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 06F8F745EC; Sun, 10 Jun 2018 19:43:06 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from [192.168.42.150] (unknown [127.0.1.132]) by freefall.freebsd.org (Postfix) with ESMTP id CDA912C09; Sun, 10 Jun 2018 19:43:04 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) From: "Jonathan Anderson" To: "Antoine Brodin" Cc: "Eitan Adler" , "Robert N. M. Watson" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334931 - in head: . sys/sys Date: Sun, 10 Jun 2018 17:10:32 -0230 X-Mailer: MailMate (1.11.2r5479) Message-ID: <3D29EC4B-D05D-4485-98BD-8E5EB5C1E8E9@FreeBSD.org> In-Reply-To: References: <201806101915.w5AJFcZM001907@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jun 2018 19:43:06 -0000 On 10 Jun 2018, at 16:49, Antoine Brodin wrote: > On Sun, Jun 10, 2018 at 9:15 PM, Eitan Adler > wrote: >> Author: eadler >> Date: Sun Jun 10 19:15:38 2018 >> New Revision: 334931 >> URL: https://svnweb.freebsd.org/changeset/base/334931 >> >> Log: >> Revert r334929 >> >> Apparently some software might depend on a header whose sole >> contents is >> a `#warning` to remove it. Revert pending exp-run. > > Hi, > > It's not just a #warning, there is a #include line below... > And after this change, most ports that supported sandboxing were no > longer sandboxed. This used the be the primary header file for Capsicum, but we switched to the somewhat-more-portable sys/capsicum.h awhile ago. The current sys/capability.h includes the new header while emitting a warning in order to encourage people to switch to capsicum.h without breaking anything (yet). This is a transitional step, and I think the plan is to remove sys/capability.h after... maybe the 12-STABLE branch? Jon -- Jonathan Anderson jonathan@FreeBSD.org From owner-svn-src-head@freebsd.org Sun Jun 10 20:05:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C5C9101E08A for ; Sun, 10 Jun 2018 20:05:27 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-yw0-x22e.google.com (mail-yw0-x22e.google.com [IPv6:2607:f8b0:4002:c05::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D39875478 for ; Sun, 10 Jun 2018 20:05:26 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-yw0-x22e.google.com with SMTP id v131-v6so5702477ywg.2 for ; Sun, 10 Jun 2018 13:05:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=wugeaBzbHTlJD2257Trvl6x3CAIr4EnqFK4f8JLYDks=; b=zjqbYPnYmlzp7Qsk/v2nwe/apCCsNAMTqm1Y5AQcd4l+xi0MkIlKpYCu9YnoSjBllB PN/v2kcgjii3ahjb6KpJQSI8QoL6MIUpRrbycqZ4w0LfWWlJakVloOMhBs6hJp6w1Q3L /vbSJzxf9vf6kH9yQiglpBdScuqPmgnMDsFK/cSapcXWIa8yu8pTl7o25lX61FiXc8ew QvRC7M/CFrYUcinmKz/GG3Z3lRZd7vQ4ETfRdlaDNh7MuIgUpofTUihL0IdSzsHSsb7W K99VydG5MIlPcK+BRgXEyH3uNZNu4M6XxMMmskov972FT45rp7ZTRGhpg9K+FNPVKOYC ePWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=wugeaBzbHTlJD2257Trvl6x3CAIr4EnqFK4f8JLYDks=; b=hNhn0nAkybJZJl7ubwXkmwlb6KI3uMqzUQZhzXkePkTFwLsuT+FUjcdRHWGQmmQ5Lj DqcRCanColFuCRgbRDzTJR2QPLL6urhKEWQVbKJpji+HYXXbGlaXH2U8F9h34RtBPgxt Ne6yAe8+z3Y4nZGZqN5QkLTqYzfmL/7qL3bIYRg7gnVJsSldtuUBO0NHzXMno0OAderK G5LhYfgYPy9pW5kaXWl0HXXv19qwuCk62HhUrdjGgvCdnXncGARem6zOFfceVI6FcTBz vFJrtHM3iYvYeKcKfUW0APya8bJ143zJFP8BJgaA8A0kFE/36EWCy5tR4o51FOoYTCro /F+Q== X-Gm-Message-State: APt69E0G+SfMia27uhUpSDrC+kOWaKcMn2LdtzaJBBteEZV7r5m3KiEq Pn2jhnWyEALEX8y3p+ADzBQrCcoyBlOiOX2X4L58xg== X-Google-Smtp-Source: ADUXVKIQ/+xdWuOVMh7BWe5URmMEJIdY6/gk1jTl0pgPm84Flb6pwMYVjHENiqZaAQa+wa/hbwnSHLXzPv+lfMMITCY= X-Received: by 2002:a81:5f55:: with SMTP id t82-v6mr8577942ywb.382.1528661125643; Sun, 10 Jun 2018 13:05:25 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:db86:0:0:0:0:0 with HTTP; Sun, 10 Jun 2018 13:05:24 -0700 (PDT) In-Reply-To: <3D29EC4B-D05D-4485-98BD-8E5EB5C1E8E9@FreeBSD.org> References: <201806101915.w5AJFcZM001907@repo.freebsd.org> <3D29EC4B-D05D-4485-98BD-8E5EB5C1E8E9@FreeBSD.org> From: Oliver Pinter Date: Sun, 10 Jun 2018 22:05:24 +0200 Message-ID: Subject: Re: svn commit: r334931 - in head: . sys/sys To: Jonathan Anderson Cc: Antoine Brodin , svn-src-head@freebsd.org, "Robert N. M. Watson" , src-committers , Eitan Adler , svn-src-all@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jun 2018 20:05:27 -0000 On 6/10/18, Jonathan Anderson wrote: > On 10 Jun 2018, at 16:49, Antoine Brodin wrote: > >> On Sun, Jun 10, 2018 at 9:15 PM, Eitan Adler >> wrote: >>> Author: eadler >>> Date: Sun Jun 10 19:15:38 2018 >>> New Revision: 334931 >>> URL: https://svnweb.freebsd.org/changeset/base/334931 >>> >>> Log: >>> Revert r334929 >>> >>> Apparently some software might depend on a header whose sole >>> contents is >>> a `#warning` to remove it. Revert pending exp-run. >> >> Hi, >> >> It's not just a #warning, there is a #include line below... >> And after this change, most ports that supported sandboxing were no >> longer sandboxed. > > This used the be the primary header file for Capsicum, but we switched > to the somewhat-more-portable sys/capsicum.h awhile ago. The current > sys/capability.h includes the new header while emitting a warning in > order to encourage people to switch to capsicum.h without breaking > anything (yet). This is a transitional step, and I think the plan is to > remove sys/capability.h after... maybe the 12-STABLE branch? > As second step, it would be fine to slip the #warning over to #error, and fix the ports. > > Jon > -- > Jonathan Anderson > jonathan@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-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Sun Jun 10 21:36:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 380F0100A9D0; Sun, 10 Jun 2018 21:36:30 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF5C579AEB; Sun, 10 Jun 2018 21:36:29 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC60112687; Sun, 10 Jun 2018 21:36:29 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5ALaT1E073836; Sun, 10 Jun 2018 21:36:29 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5ALaTrG073834; Sun, 10 Jun 2018 21:36:29 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201806102136.w5ALaTrG073834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 10 Jun 2018 21:36:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334933 - head/tests/sys/audit X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/audit X-SVN-Commit-Revision: 334933 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jun 2018 21:36:30 -0000 Author: asomers Date: Sun Jun 10 21:36:29 2018 New Revision: 334933 URL: https://svnweb.freebsd.org/changeset/base/334933 Log: audit(4): add tests for stat(2) and friends This revision adds auditability tests for stat, lstat, fstat, and fstatat, all from the fa audit class. More tests from that audit class will follow. Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15709 Added: head/tests/sys/audit/file-attribute-access.c (contents, props changed) Modified: head/tests/sys/audit/Makefile Modified: head/tests/sys/audit/Makefile ============================================================================== --- head/tests/sys/audit/Makefile Sun Jun 10 19:42:44 2018 (r334932) +++ head/tests/sys/audit/Makefile Sun Jun 10 21:36:29 2018 (r334933) @@ -2,13 +2,16 @@ TESTSDIR= ${TESTSBASE}/sys/audit -ATF_TESTS_C= file-create +ATF_TESTS_C= file-attribute-access +ATF_TESTS_C+= file-create ATF_TESTS_C+= file-delete ATF_TESTS_C+= file-close ATF_TESTS_C+= file-write ATF_TESTS_C+= file-read ATF_TESTS_C+= open +SRCS.file-attribute-access+= file-attribute-access.c +SRCS.file-attribute-access+= utils.c SRCS.file-create+= file-create.c SRCS.file-create+= utils.c SRCS.file-delete+= file-delete.c Added: head/tests/sys/audit/file-attribute-access.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/audit/file-attribute-access.c Sun Jun 10 21:36:29 2018 (r334933) @@ -0,0 +1,239 @@ +/*- + * Copyright (c) 2018 Aniket Pandey + * + * 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 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * 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 + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include + +#include +#include +#include + +#include "utils.h" + +static struct pollfd fds[1]; +static mode_t mode = 0777; +static char extregex[80]; +static struct stat statbuff; +static const char *auclass = "fa"; +static const char *path = "fileforaudit"; +static const char *errpath = "dirdoesnotexist/fileforaudit"; +static const char *successreg = "fileforaudit.*return,success"; +static const char *failurereg = "fileforaudit.*return,failure"; + + +ATF_TC_WITH_CLEANUP(stat_success); +ATF_TC_HEAD(stat_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "stat(2) call"); +} + +ATF_TC_BODY(stat_success, tc) +{ + /* File needs to exist to call stat(2) */ + ATF_REQUIRE(open(path, O_CREAT, mode) != -1); + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, stat(path, &statbuff)); + check_audit(fds, successreg, pipefd); +} + +ATF_TC_CLEANUP(stat_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(stat_failure); +ATF_TC_HEAD(stat_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "stat(2) call"); +} + +ATF_TC_BODY(stat_failure, tc) +{ + FILE *pipefd = setup(fds, auclass); + /* Failure reason: file does not exist */ + ATF_REQUIRE_EQ(-1, stat(errpath, &statbuff)); + check_audit(fds, failurereg, pipefd); +} + +ATF_TC_CLEANUP(stat_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(lstat_success); +ATF_TC_HEAD(lstat_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "lstat(2) call"); +} + +ATF_TC_BODY(lstat_success, tc) +{ + /* Symbolic link needs to exist to call lstat(2) */ + ATF_REQUIRE_EQ(0, symlink("symlink", path)); + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, lstat(path, &statbuff)); + check_audit(fds, successreg, pipefd); +} + +ATF_TC_CLEANUP(lstat_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(lstat_failure); +ATF_TC_HEAD(lstat_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "lstat(2) call"); +} + +ATF_TC_BODY(lstat_failure, tc) +{ + FILE *pipefd = setup(fds, auclass); + /* Failure reason: symbolic link does not exist */ + ATF_REQUIRE_EQ(-1, lstat(errpath, &statbuff)); + check_audit(fds, failurereg, pipefd); +} + +ATF_TC_CLEANUP(lstat_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(fstat_success); +ATF_TC_HEAD(fstat_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "fstat(2) call"); +} + +ATF_TC_BODY(fstat_success, tc) +{ + int filedesc; + /* File needs to exist to call fstat(2) */ + ATF_REQUIRE((filedesc = open(path, O_CREAT | O_RDWR, mode)) != -1); + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, fstat(filedesc, &statbuff)); + + snprintf(extregex, sizeof(extregex), + "fstat.*%jd.*return,success", (intmax_t)statbuff.st_ino); + check_audit(fds, extregex, pipefd); +} + +ATF_TC_CLEANUP(fstat_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(fstat_failure); +ATF_TC_HEAD(fstat_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "fstat(2) call"); +} + +ATF_TC_BODY(fstat_failure, tc) +{ + FILE *pipefd = setup(fds, auclass); + const char *regex = "fstat.*return,failure : Bad file descriptor"; + /* Failure reason: bad file descriptor */ + ATF_REQUIRE_EQ(-1, fstat(-1, &statbuff)); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(fstat_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(fstatat_success); +ATF_TC_HEAD(fstatat_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "fstatat(2) call"); +} + +ATF_TC_BODY(fstatat_success, tc) +{ + /* File or Symbolic link needs to exist to call lstat(2) */ + ATF_REQUIRE_EQ(0, symlink("symlink", path)); + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, fstatat(AT_FDCWD, path, &statbuff, + AT_SYMLINK_NOFOLLOW)); + check_audit(fds, successreg, pipefd); +} + +ATF_TC_CLEANUP(fstatat_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(fstatat_failure); +ATF_TC_HEAD(fstatat_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "fstatat(2) call"); +} + +ATF_TC_BODY(fstatat_failure, tc) +{ + FILE *pipefd = setup(fds, auclass); + /* Failure reason: symbolic link does not exist */ + ATF_REQUIRE_EQ(-1, fstatat(AT_FDCWD, path, &statbuff, + AT_SYMLINK_NOFOLLOW)); + check_audit(fds, failurereg, pipefd); +} + +ATF_TC_CLEANUP(fstatat_failure, tc) +{ + cleanup(); +} + + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, stat_success); + ATF_TP_ADD_TC(tp, stat_failure); + ATF_TP_ADD_TC(tp, lstat_success); + ATF_TP_ADD_TC(tp, lstat_failure); + ATF_TP_ADD_TC(tp, fstat_success); + ATF_TP_ADD_TC(tp, fstat_failure); + ATF_TP_ADD_TC(tp, fstatat_success); + ATF_TP_ADD_TC(tp, fstatat_failure); + + return (atf_no_error()); +} From owner-svn-src-head@freebsd.org Mon Jun 11 01:32:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7ABEA100AD8E; Mon, 11 Jun 2018 01:32:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2C6C883A7F; Mon, 11 Jun 2018 01:32:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0EB6B14CFC; Mon, 11 Jun 2018 01:32:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5B1WIXr094547; Mon, 11 Jun 2018 01:32:18 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5B1WI5d094546; Mon, 11 Jun 2018 01:32:18 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201806110132.w5B1WI5d094546@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 11 Jun 2018 01:32:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334939 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 334939 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 01:32:19 -0000 Author: kevans Date: Mon Jun 11 01:32:18 2018 New Revision: 334939 URL: https://svnweb.freebsd.org/changeset/base/334939 Log: lualoader: Allow brand-*.lua for adding new brands dteske@, I believe, had originally pointed out that lualoader failed to allow logo-*.lua for new logos to be added. When correcting this mistake, I failed to do the same for brands. Correct the sub-mistake: creating new brands is almost identical to creating new logos, except one must use `drawer.addBrand` and 'graphic' is the only valid key for a branddef at the moment. While here, I've added `drawer.default_brand` to be set to name of brand to be used (e.g. 'fbsd', project default). Eventually this whole goolash will be documented. Reported by: kmoore, iXsystems Modified: head/stand/lua/drawer.lua Modified: head/stand/lua/drawer.lua ============================================================================== --- head/stand/lua/drawer.lua Mon Jun 11 01:22:01 2018 (r334938) +++ head/stand/lua/drawer.lua Mon Jun 11 01:32:18 2018 (r334939) @@ -51,6 +51,22 @@ local function menuEntryName(drawing_menu, entry) return entry.name end +local function getBranddef(brand) + if brand == nil then + return nil + end + -- Look it up + local branddef = drawer.branddefs[brand] + + -- Try to pull it in + if branddef == nil then + try_include('brand-' .. brand) + branddef = drawer.branddefs[brand] + end + + return branddef +end + local function getLogodef(logo) if logo == nil then return nil @@ -79,6 +95,8 @@ fbsd_brand = { none = {""} -- Module exports +drawer.default_brand = 'fbsd' + drawer.menu_name_handlers = { -- Menu name handlers should take the menu being drawn and entry being -- drawn as parameters, and return the name of the item. @@ -315,8 +333,13 @@ function drawer.drawbrand() local y = tonumber(loader.getenv("loader_brand_y")) or drawer.brand_position.y - local graphic = drawer.branddefs[loader.getenv("loader_brand")] or - fbsd_brand + local branddef = getBranddef(loader.getenv("loader_brand")) + + if branddef == nil then + branddef = getBranddef(drawer.default_brand) + end + + local graphic = branddef.graphic x = x + drawer.shift.x y = y + drawer.shift.y From owner-svn-src-head@freebsd.org Mon Jun 11 02:09:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFB8B100FA78; Mon, 11 Jun 2018 02:09:22 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7146185465; Mon, 11 Jun 2018 02:09:22 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3982D15211; Mon, 11 Jun 2018 02:09:22 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5B29Mab010563; Mon, 11 Jun 2018 02:09:22 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5B29Lni010557; Mon, 11 Jun 2018 02:09:21 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201806110209.w5B29Lni010557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 11 Jun 2018 02:09:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334940 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 334940 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 02:09:23 -0000 Author: araujo Date: Mon Jun 11 02:09:20 2018 New Revision: 334940 URL: https://svnweb.freebsd.org/changeset/base/334940 Log: - Add bhyve virtio-scsi storage backend support. Example of configuration: ctl.conf: portal-group pg0 { discovery-auth-group no-authentication listen 0.0.0.0 listen [::] } target iqn.2012-06.com.example:target0 { auth-group no-authentication portal-group pg0 port ioctl/5/3 lun 0 { path /z/test.img size 8G } lun 1 { path /z/test1.img size 8G } } bhyve <...> -s 4,virtio-scsi,/dev/cam/ctl5.3,iid=3 From inside guest: root@:~ # zpool status test pool: test state: ONLINE scan: none requested config: NAME STATE READ WRITE CKSUM test ONLINE 0 0 0 da0 ONLINE 0 0 0 da1 ONLINE 0 0 0 dmesg: da0 at vtscsi0 bus 0 scbus0 target 0 lun 0 da0: Fixed Direct Access SPC-5 SCSI device da0: Serial Number MYSERIAL0000 da0: 300.000MB/s transfers da0: Command Queueing enabled da0: 8192MB (16777216 512 byte sectors) da1 at vtscsi0 bus 0 scbus0 target 0 lun 1 da1: Fixed Direct Access SPC-5 SCSI device da1: Serial Number MYSERIAL0001 da1: 300.000MB/s transfers da1: Command Queueing enabled da1: 8192MB (16777216 512 byte sectors) Discussed with: grehan Reviewed by: mav Obtained from: TrueOS Relnotes: Yes Sponsored by: iXsystems Inc. Tested with: FreeBSD HEAD, Fedora 28 (Workstation) and Ubuntu 18.04. Differential Revision: https://reviews.freebsd.org/D15276 Added: head/usr.sbin/bhyve/iov.c (contents, props changed) head/usr.sbin/bhyve/iov.h (contents, props changed) head/usr.sbin/bhyve/pci_virtio_scsi.c (contents, props changed) Modified: head/usr.sbin/bhyve/Makefile head/usr.sbin/bhyve/bhyve.8 head/usr.sbin/bhyve/virtio.h Modified: head/usr.sbin/bhyve/Makefile ============================================================================== --- head/usr.sbin/bhyve/Makefile Mon Jun 11 01:32:18 2018 (r334939) +++ head/usr.sbin/bhyve/Makefile Mon Jun 11 02:09:20 2018 (r334940) @@ -3,6 +3,8 @@ # .include +CFLAGS+=-I${SRCTOP}/sys +.PATH: ${SRCTOP}/sys/cam/ctl PROG= bhyve PACKAGE= bhyve @@ -22,6 +24,8 @@ SRCS= \ bootrom.c \ console.c \ consport.c \ + ctl_util.c \ + ctl_scsi_all.c \ dbgport.c \ fwctl.c \ gdb.c \ @@ -42,6 +46,7 @@ SRCS= \ pci_virtio_console.c \ pci_virtio_net.c \ pci_virtio_rnd.c \ + pci_virtio_scsi.c \ pci_uart.c \ pci_xhci.c \ pm.c \ @@ -59,12 +64,13 @@ SRCS= \ virtio.c \ vga.c \ xmsr.c \ - spinup_ap.c + spinup_ap.c \ + iov.c .PATH: ${BHYVE_SYSDIR}/sys/amd64/vmm SRCS+= vmm_instruction_emul.c -LIBADD= vmmapi md pthread z +LIBADD= vmmapi md pthread z util sbuf cam .if ${MK_OPENSSL} == "no" CFLAGS+=-DNO_OPENSSL Modified: head/usr.sbin/bhyve/bhyve.8 ============================================================================== --- head/usr.sbin/bhyve/bhyve.8 Mon Jun 11 01:32:18 2018 (r334939) +++ head/usr.sbin/bhyve/bhyve.8 Mon Jun 11 02:09:20 2018 (r334940) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 1, 2018 +.Dd Jun 11, 2018 .Dt BHYVE 8 .Os .Sh NAME @@ -216,6 +216,8 @@ PCI pass-through device. Virtio network interface. .It Li virtio-blk Virtio block storage interface. +.It Li virtio-scsi +Virtio SCSI interface. .It Li virtio-rnd Virtio RNG interface. .It Li virtio-console @@ -285,6 +287,11 @@ Force the file to be opened read-only. Specify the logical and physical sector sizes of the emulated disk. The physical sector size is optional and is equal to the logical sector size if not explicitly specified. +.El +.Pp +SCSI devices: +.Bl -tag -width 10n +.It Pa /dev/cam/ Ns Oo , Ns Ar port and initiator_id Oc .El .Pp TTY devices: Added: head/usr.sbin/bhyve/iov.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bhyve/iov.c Mon Jun 11 02:09:20 2018 (r334940) @@ -0,0 +1,141 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2016 Jakub Klama . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include "iov.h" + +void +seek_iov(struct iovec *iov1, size_t niov1, struct iovec *iov2, size_t *niov2, + size_t seek) +{ + size_t remainder = 0; + size_t left = seek; + size_t i, j; + + for (i = 0; i < niov1; i++) { + size_t toseek = MIN(left, iov1[i].iov_len); + left -= toseek; + + if (toseek == iov1[i].iov_len) + continue; + + if (left == 0) { + remainder = toseek; + break; + } + } + + for (j = i; j < niov1; j++) { + iov2[j - i].iov_base = (char *)iov1[j].iov_base + remainder; + iov2[j - i].iov_len = iov1[j].iov_len - remainder; + remainder = 0; + } + + *niov2 = j - i; +} + +size_t +count_iov(struct iovec *iov, size_t niov) +{ + size_t i, total = 0; + + for (i = 0; i < niov; i++) + total += iov[i].iov_len; + + return (total); +} + +size_t +truncate_iov(struct iovec *iov, size_t niov, size_t length) +{ + size_t i, done = 0; + + for (i = 0; i < niov; i++) { + size_t toseek = MIN(length - done, iov[i].iov_len); + done += toseek; + + if (toseek < iov[i].iov_len) { + iov[i].iov_len = toseek; + return (i + 1); + } + } + + return (niov); +} + +ssize_t +iov_to_buf(struct iovec *iov, size_t niov, void **buf) +{ + size_t i, ptr = 0, total = 0; + + for (i = 0; i < niov; i++) { + total += iov[i].iov_len; + *buf = realloc(*buf, total); + if (*buf == NULL) + return (-1); + + memcpy(*buf + ptr, iov[i].iov_base, iov[i].iov_len); + ptr += iov[i].iov_len; + } + + return (total); +} + +ssize_t +buf_to_iov(void *buf, size_t buflen, struct iovec *iov, size_t niov, + size_t seek) +{ + struct iovec *diov; + size_t ndiov, i; + uintptr_t off = 0; + + if (seek > 0) { + diov = malloc(sizeof(struct iovec) * niov); + seek_iov(iov, niov, diov, &ndiov, seek); + } else { + diov = iov; + ndiov = niov; + } + + for (i = 0; i < ndiov; i++) { + memcpy(diov[i].iov_base, buf + off, diov[i].iov_len); + off += diov[i].iov_len; + } + + return ((ssize_t)off); +} + Added: head/usr.sbin/bhyve/iov.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bhyve/iov.h Mon Jun 11 02:09:20 2018 (r334940) @@ -0,0 +1,43 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2016 Jakub Klama . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer + * in this position and unchanged. + * 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$ + */ + +#ifndef _IOV_H_ +#define _IOV_H_ + +void seek_iov(struct iovec *iov1, size_t niov1, struct iovec *iov2, + size_t *niov2, size_t seek); +size_t truncate_iov(struct iovec *iov, size_t niov, size_t length); +size_t count_iov(struct iovec *iov, size_t niov); +ssize_t iov_to_buf(struct iovec *iov, size_t niov, void **buf); +ssize_t buf_to_iov(void *buf, size_t buflen, struct iovec *iov, size_t niov, + size_t seek); + +#endif /* _IOV_H_ */ Added: head/usr.sbin/bhyve/pci_virtio_scsi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bhyve/pci_virtio_scsi.c Mon Jun 11 02:09:20 2018 (r334940) @@ -0,0 +1,718 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2016 Jakub Klama . + * Copyright (c) 2018 Marcelo Araujo . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "bhyverun.h" +#include "pci_emul.h" +#include "virtio.h" +#include "iov.h" + +#define VTSCSI_RINGSZ 64 +#define VTSCSI_REQUESTQ 1 +#define VTSCSI_THR_PER_Q 16 +#define VTSCSI_MAXQ (VTSCSI_REQUESTQ + 2) +#define VTSCSI_MAXSEG 64 + +#define VTSCSI_IN_HEADER_LEN(_sc) \ + (sizeof(struct pci_vtscsi_req_cmd_rd) + _sc->vss_config.cdb_size) + +#define VTSCSI_OUT_HEADER_LEN(_sc) \ + (sizeof(struct pci_vtscsi_req_cmd_wr) + _sc->vss_config.sense_size) + +#define VIRTIO_SCSI_MAX_CHANNEL 0 +#define VIRTIO_SCSI_MAX_TARGET 0 +#define VIRTIO_SCSI_MAX_LUN 16383 + +#define VIRTIO_SCSI_F_INOUT (1 << 0) +#define VIRTIO_SCSI_F_HOTPLUG (1 << 1) +#define VIRTIO_SCSI_F_CHANGE (1 << 2) + +static int pci_vtscsi_debug = 0; +#define DPRINTF(params) if (pci_vtscsi_debug) printf params +#define WPRINTF(params) printf params + +struct pci_vtscsi_config { + uint32_t num_queues; + uint32_t seg_max; + uint32_t max_sectors; + uint32_t cmd_per_lun; + uint32_t event_info_size; + uint32_t sense_size; + uint32_t cdb_size; + uint16_t max_channel; + uint16_t max_target; + uint32_t max_lun; +} __attribute__((packed)); + +struct pci_vtscsi_queue { + struct pci_vtscsi_softc * vsq_sc; + struct vqueue_info * vsq_vq; + int vsq_ctl_fd; + pthread_mutex_t vsq_mtx; + pthread_mutex_t vsq_qmtx; + pthread_cond_t vsq_cv; + STAILQ_HEAD(, pci_vtscsi_request) vsq_requests; + LIST_HEAD(, pci_vtscsi_worker) vsq_workers; +}; + +struct pci_vtscsi_worker { + struct pci_vtscsi_queue * vsw_queue; + pthread_t vsw_thread; + bool vsw_exiting; + LIST_ENTRY(pci_vtscsi_worker) vsw_link; +}; + +struct pci_vtscsi_request { + struct pci_vtscsi_queue * vsr_queue; + struct iovec vsr_iov_in[VTSCSI_MAXSEG]; + int vsr_niov_in; + struct iovec vsr_iov_out[VTSCSI_MAXSEG]; + int vsr_niov_out; + uint32_t vsr_idx; + STAILQ_ENTRY(pci_vtscsi_request) vsr_link; +}; + +/* + * Per-device softc + */ +struct pci_vtscsi_softc { + struct virtio_softc vss_vs; + struct vqueue_info vss_vq[VTSCSI_MAXQ]; + struct pci_vtscsi_queue vss_queues[VTSCSI_REQUESTQ]; + pthread_mutex_t vss_mtx; + int vss_iid; + int vss_ctl_fd; + uint32_t vss_features; + struct pci_vtscsi_config vss_config; +}; + +#define VIRTIO_SCSI_T_TMF 0 +#define VIRTIO_SCSI_T_TMF_ABORT_TASK 0 +#define VIRTIO_SCSI_T_TMF_ABORT_TASK_SET 1 +#define VIRTIO_SCSI_T_TMF_CLEAR_ACA 2 +#define VIRTIO_SCSI_T_TMF_CLEAR_TASK_SET 3 +#define VIRTIO_SCSI_T_TMF_I_T_NEXUS_RESET 4 +#define VIRTIO_SCSI_T_TMF_LOGICAL_UNIT_RESET 5 +#define VIRTIO_SCSI_T_TMF_QUERY_TASK 6 +#define VIRTIO_SCSI_T_TMF_QUERY_TASK_SET 7 + +/* command-specific response values */ +#define VIRTIO_SCSI_S_FUNCTION_COMPLETE 0 +#define VIRTIO_SCSI_S_FUNCTION_SUCCEEDED 10 +#define VIRTIO_SCSI_S_FUNCTION_REJECTED 11 + +struct pci_vtscsi_ctrl_tmf { + uint32_t type; + uint32_t subtype; + uint8_t lun[8]; + uint64_t id; + uint8_t response; +} __attribute__((packed)); + +#define VIRTIO_SCSI_T_AN_QUERY 1 +#define VIRTIO_SCSI_EVT_ASYNC_OPERATIONAL_CHANGE 2 +#define VIRTIO_SCSI_EVT_ASYNC_POWER_MGMT 4 +#define VIRTIO_SCSI_EVT_ASYNC_EXTERNAL_REQUEST 8 +#define VIRTIO_SCSI_EVT_ASYNC_MEDIA_CHANGE 16 +#define VIRTIO_SCSI_EVT_ASYNC_MULTI_HOST 32 +#define VIRTIO_SCSI_EVT_ASYNC_DEVICE_BUSY 64 + +struct pci_vtscsi_ctrl_an { + uint32_t type; + uint8_t lun[8]; + uint32_t event_requested; + uint32_t event_actual; + uint8_t response; +} __attribute__((packed)); + +/* command-specific response values */ +#define VIRTIO_SCSI_S_OK 0 +#define VIRTIO_SCSI_S_OVERRUN 1 +#define VIRTIO_SCSI_S_ABORTED 2 +#define VIRTIO_SCSI_S_BAD_TARGET 3 +#define VIRTIO_SCSI_S_RESET 4 +#define VIRTIO_SCSI_S_BUSY 5 +#define VIRTIO_SCSI_S_TRANSPORT_FAILURE 6 +#define VIRTIO_SCSI_S_TARGET_FAILURE 7 +#define VIRTIO_SCSI_S_NEXUS_FAILURE 8 +#define VIRTIO_SCSI_S_FAILURE 9 +#define VIRTIO_SCSI_S_INCORRECT_LUN 12 + +/* task_attr */ +#define VIRTIO_SCSI_S_SIMPLE 0 +#define VIRTIO_SCSI_S_ORDERED 1 +#define VIRTIO_SCSI_S_HEAD 2 +#define VIRTIO_SCSI_S_ACA 3 + +struct pci_vtscsi_event { + uint32_t event; + uint8_t lun[8]; + uint32_t reason; +} __attribute__((packed)); + +struct pci_vtscsi_req_cmd_rd { + uint8_t lun[8]; + uint64_t id; + uint8_t task_attr; + uint8_t prio; + uint8_t crn; + uint8_t cdb[]; +} __attribute__((packed)); + +struct pci_vtscsi_req_cmd_wr { + uint32_t sense_len; + uint32_t residual; + uint16_t status_qualifier; + uint8_t status; + uint8_t response; + uint8_t sense[]; +} __attribute__((packed)); + +static void *pci_vtscsi_proc(void *); +static void pci_vtscsi_reset(void *); +static void pci_vtscsi_neg_features(void *, uint64_t); +static int pci_vtscsi_cfgread(void *, int, int, uint32_t *); +static int pci_vtscsi_cfgwrite(void *, int, int, uint32_t); +static inline int pci_vtscsi_get_lun(uint8_t *); +static int pci_vtscsi_control_handle(struct pci_vtscsi_softc *, void *, size_t); +static int pci_vtscsi_tmf_handle(struct pci_vtscsi_softc *, + struct pci_vtscsi_ctrl_tmf *); +static int pci_vtscsi_an_handle(struct pci_vtscsi_softc *, + struct pci_vtscsi_ctrl_an *); +static int pci_vtscsi_request_handle(struct pci_vtscsi_queue *, struct iovec *, + int, struct iovec *, int); +static void pci_vtscsi_controlq_notify(void *, struct vqueue_info *); +static void pci_vtscsi_eventq_notify(void *, struct vqueue_info *); +static void pci_vtscsi_requestq_notify(void *, struct vqueue_info *); +static int pci_vtscsi_init_queue(struct pci_vtscsi_softc *, + struct pci_vtscsi_queue *, int); +static int pci_vtscsi_init(struct vmctx *, struct pci_devinst *, char *); + +static struct virtio_consts vtscsi_vi_consts = { + "vtscsi", /* our name */ + VTSCSI_MAXQ, /* we support 2+n virtqueues */ + sizeof(struct pci_vtscsi_config), /* config reg size */ + pci_vtscsi_reset, /* reset */ + NULL, /* device-wide qnotify */ + pci_vtscsi_cfgread, /* read virtio config */ + pci_vtscsi_cfgwrite, /* write virtio config */ + pci_vtscsi_neg_features, /* apply negotiated features */ + 0, /* our capabilities */ +}; + +static void * +pci_vtscsi_proc(void *arg) +{ + struct pci_vtscsi_worker *worker = (struct pci_vtscsi_worker *)arg; + struct pci_vtscsi_queue *q = worker->vsw_queue; + struct pci_vtscsi_request *req; + int iolen; + + for (;;) { + pthread_mutex_lock(&q->vsq_mtx); + + while (STAILQ_EMPTY(&q->vsq_requests) + && !worker->vsw_exiting) + pthread_cond_wait(&q->vsq_cv, &q->vsq_mtx); + + if (worker->vsw_exiting) + break; + + req = STAILQ_FIRST(&q->vsq_requests); + STAILQ_REMOVE_HEAD(&q->vsq_requests, vsr_link); + + pthread_mutex_unlock(&q->vsq_mtx); + iolen = pci_vtscsi_request_handle(q, req->vsr_iov_in, + req->vsr_niov_in, req->vsr_iov_out, req->vsr_niov_out); + + pthread_mutex_lock(&q->vsq_qmtx); + vq_relchain(q->vsq_vq, req->vsr_idx, iolen); + vq_endchains(q->vsq_vq, 0); + pthread_mutex_unlock(&q->vsq_qmtx); + + DPRINTF(("virtio-scsi: request completed\n", + req->vsr_idx)); + free(req); + } + + pthread_mutex_unlock(&q->vsq_mtx); + return (NULL); +} + +static void +pci_vtscsi_reset(void *vsc) +{ + struct pci_vtscsi_softc *sc; + + sc = vsc; + + DPRINTF(("vtscsi: device reset requested\n")); + vi_reset_dev(&sc->vss_vs); + + /* initialize config structure */ + sc->vss_config = (struct pci_vtscsi_config){ + .num_queues = VTSCSI_REQUESTQ, + .seg_max = VTSCSI_MAXSEG, + .max_sectors = 2, + .cmd_per_lun = 1, + .event_info_size = sizeof(struct pci_vtscsi_event), + .sense_size = 96, + .cdb_size = 32, + .max_channel = VIRTIO_SCSI_MAX_CHANNEL, + .max_target = VIRTIO_SCSI_MAX_TARGET, + .max_lun = VIRTIO_SCSI_MAX_LUN + }; +} + +static void +pci_vtscsi_neg_features(void *vsc, uint64_t negotiated_features) +{ + struct pci_vtscsi_softc *sc = vsc; + + sc->vss_features = negotiated_features; +} + +static int +pci_vtscsi_cfgread(void *vsc, int offset, int size, uint32_t *retval) +{ + struct pci_vtscsi_softc *sc = vsc; + void *ptr; + + ptr = (uint8_t *)&sc->vss_config + offset; + memcpy(retval, ptr, size); + return (0); +} + +static int +pci_vtscsi_cfgwrite(void *vsc, int offset, int size, uint32_t val) +{ + + return (0); +} + +static inline int +pci_vtscsi_get_lun(uint8_t *lun) +{ + + return (((lun[2] << 8) | lun[3]) & 0x3fff); +} + +static int +pci_vtscsi_control_handle(struct pci_vtscsi_softc *sc, void *buf, + size_t bufsize) +{ + struct pci_vtscsi_ctrl_tmf *tmf; + struct pci_vtscsi_ctrl_an *an; + uint32_t type; + + type = *(uint32_t *)buf; + + if (type == VIRTIO_SCSI_T_TMF) { + tmf = (struct pci_vtscsi_ctrl_tmf *)buf; + return (pci_vtscsi_tmf_handle(sc, tmf)); + } + + if (type == VIRTIO_SCSI_T_AN_QUERY) { + an = (struct pci_vtscsi_ctrl_an *)buf; + return (pci_vtscsi_an_handle(sc, an)); + } + + return (0); +} + +static int +pci_vtscsi_tmf_handle(struct pci_vtscsi_softc *sc, + struct pci_vtscsi_ctrl_tmf *tmf) +{ + union ctl_io *io; + int err; + + io = ctl_scsi_alloc_io(sc->vss_iid); + ctl_scsi_zero_io(io); + + io->io_hdr.io_type = CTL_IO_TASK; + io->io_hdr.nexus.targ_port = tmf->lun[1]; + io->io_hdr.nexus.targ_lun = pci_vtscsi_get_lun(tmf->lun); + io->taskio.tag_type = CTL_TAG_SIMPLE; + io->taskio.tag_num = (uint32_t)tmf->id; + + switch (tmf->subtype) { + case VIRTIO_SCSI_T_TMF_ABORT_TASK: + io->taskio.task_action = CTL_TASK_ABORT_TASK; + break; + + case VIRTIO_SCSI_T_TMF_ABORT_TASK_SET: + io->taskio.task_action = CTL_TASK_ABORT_TASK_SET; + break; + + case VIRTIO_SCSI_T_TMF_CLEAR_ACA: + io->taskio.task_action = CTL_TASK_CLEAR_ACA; + break; + + case VIRTIO_SCSI_T_TMF_CLEAR_TASK_SET: + io->taskio.task_action = CTL_TASK_CLEAR_TASK_SET; + break; + + case VIRTIO_SCSI_T_TMF_I_T_NEXUS_RESET: + io->taskio.task_action = CTL_TASK_I_T_NEXUS_RESET; + break; + + case VIRTIO_SCSI_T_TMF_LOGICAL_UNIT_RESET: + io->taskio.task_action = CTL_TASK_LUN_RESET; + break; + + case VIRTIO_SCSI_T_TMF_QUERY_TASK: + io->taskio.task_action = CTL_TASK_QUERY_TASK; + break; + + case VIRTIO_SCSI_T_TMF_QUERY_TASK_SET: + io->taskio.task_action = CTL_TASK_QUERY_TASK_SET; + break; + } + + if (pci_vtscsi_debug) { + struct sbuf *sb = sbuf_new_auto(); + ctl_io_sbuf(io, sb); + sbuf_finish(sb); + DPRINTF(("pci_virtio_scsi: %s", sbuf_data(sb))); + sbuf_delete(sb); + } + + err = ioctl(sc->vss_ctl_fd, CTL_IO, io); + if (err != 0) + WPRINTF(("CTL_IO: err=%d (%s)\n", errno, strerror(errno))); + + tmf->response = io->taskio.task_status; + ctl_scsi_free_io(io); + return (1); +} + +static int +pci_vtscsi_an_handle(struct pci_vtscsi_softc *sc, + struct pci_vtscsi_ctrl_an *an) +{ + + return (0); +} + +static int +pci_vtscsi_request_handle(struct pci_vtscsi_queue *q, struct iovec *iov_in, + int niov_in, struct iovec *iov_out, int niov_out) +{ + struct pci_vtscsi_softc *sc = q->vsq_sc; + struct pci_vtscsi_req_cmd_rd *cmd_rd = NULL; + struct pci_vtscsi_req_cmd_wr *cmd_wr; + struct iovec data_iov_in[VTSCSI_MAXSEG], data_iov_out[VTSCSI_MAXSEG]; + union ctl_io *io; + size_t data_niov_in, data_niov_out; + void *ext_data_ptr = NULL; + uint32_t ext_data_len = 0, ext_sg_entries = 0; + int err; + + seek_iov(iov_in, niov_in, data_iov_in, &data_niov_in, + VTSCSI_IN_HEADER_LEN(sc)); + seek_iov(iov_out, niov_out, data_iov_out, &data_niov_out, + VTSCSI_OUT_HEADER_LEN(sc)); + + truncate_iov(iov_in, niov_in, VTSCSI_IN_HEADER_LEN(sc)); + truncate_iov(iov_out, niov_out, VTSCSI_OUT_HEADER_LEN(sc)); + iov_to_buf(iov_in, niov_in, (void **)&cmd_rd); + + cmd_wr = malloc(VTSCSI_OUT_HEADER_LEN(sc)); + io = ctl_scsi_alloc_io(sc->vss_iid); + ctl_scsi_zero_io(io); + + io->io_hdr.nexus.targ_port = cmd_rd->lun[1]; + io->io_hdr.nexus.targ_lun = pci_vtscsi_get_lun(cmd_rd->lun); + + io->io_hdr.io_type = CTL_IO_SCSI; + + if (data_niov_in > 0) { + ext_data_ptr = (void *)data_iov_in; + ext_sg_entries = data_niov_in; + ext_data_len = count_iov(data_iov_in, data_niov_in); + io->io_hdr.flags |= CTL_FLAG_DATA_OUT; + } else if (data_niov_out > 0) { + ext_data_ptr = (void *)data_iov_out; + ext_sg_entries = data_niov_out; + ext_data_len = count_iov(data_iov_out, data_niov_out); + io->io_hdr.flags |= CTL_FLAG_DATA_IN; + } + + io->scsiio.sense_len = sc->vss_config.sense_size; + io->scsiio.tag_num = (uint32_t)cmd_rd->id; + io->scsiio.tag_type = CTL_TAG_SIMPLE; + io->scsiio.ext_sg_entries = ext_sg_entries; + io->scsiio.ext_data_ptr = ext_data_ptr; + io->scsiio.ext_data_len = ext_data_len; + io->scsiio.ext_data_filled = 0; + io->scsiio.cdb_len = sc->vss_config.cdb_size; + memcpy(io->scsiio.cdb, cmd_rd->cdb, sc->vss_config.cdb_size); + + if (pci_vtscsi_debug) { + struct sbuf *sb = sbuf_new_auto(); + ctl_io_sbuf(io, sb); + sbuf_finish(sb); + DPRINTF(("pci_virtio_scsi: %s", sbuf_data(sb))); + sbuf_delete(sb); + } + + err = ioctl(q->vsq_ctl_fd, CTL_IO, io); + if (err != 0) { + WPRINTF(("CTL_IO: err=%d (%s)\n", errno, strerror(errno))); + cmd_wr->response = VIRTIO_SCSI_S_FAILURE; + } else { + cmd_wr->sense_len = MIN(io->scsiio.sense_len, + sc->vss_config.sense_size); + cmd_wr->residual = io->scsiio.residual; + cmd_wr->status = io->scsiio.scsi_status; + cmd_wr->response = VIRTIO_SCSI_S_OK; + memcpy(&cmd_wr->sense, &io->scsiio.sense_data, + cmd_wr->sense_len); + } + + buf_to_iov(cmd_wr, VTSCSI_OUT_HEADER_LEN(sc), iov_out, niov_out, 0); + free(cmd_rd); + free(cmd_wr); + ctl_scsi_free_io(io); + return (VTSCSI_OUT_HEADER_LEN(sc) + io->scsiio.ext_data_filled); +} + +static void +pci_vtscsi_controlq_notify(void *vsc, struct vqueue_info *vq) +{ + struct pci_vtscsi_softc *sc; + struct iovec iov[VTSCSI_MAXSEG]; + uint16_t idx, n; + void *buf = NULL; + size_t bufsize; + int iolen; + + sc = vsc; + + while (vq_has_descs(vq)) { + n = vq_getchain(vq, &idx, iov, VTSCSI_MAXSEG, NULL); + bufsize = iov_to_buf(iov, n, &buf); + iolen = pci_vtscsi_control_handle(sc, buf, bufsize); + buf_to_iov(buf + bufsize - iolen, iolen, iov, n, iolen); + + /* + * Release this chain and handle more + */ + vq_relchain(vq, idx, iolen); + } + vq_endchains(vq, 1); /* Generate interrupt if appropriate. */ +} + +static void +pci_vtscsi_eventq_notify(void *vsc, struct vqueue_info *vq) +{ + + vq->vq_used->vu_flags |= VRING_USED_F_NO_NOTIFY; +} + +static void +pci_vtscsi_requestq_notify(void *vsc, struct vqueue_info *vq) +{ + struct pci_vtscsi_softc *sc; + struct pci_vtscsi_queue *q; + struct pci_vtscsi_request *req; + struct iovec iov[VTSCSI_MAXSEG]; + uint16_t flags[VTSCSI_MAXSEG]; + uint16_t idx, n, i; + int readable; + + sc = vsc; + q = &sc->vss_queues[vq->vq_num - 2]; + + while (vq_has_descs(vq)) { + readable = 0; + n = vq_getchain(vq, &idx, iov, VTSCSI_MAXSEG, flags); + + /* Count readable descriptors */ + for (i = 0; i < n; i++) { + if (flags[i] & VRING_DESC_F_WRITE) + break; + + readable++; + } + + req = calloc(1, sizeof(struct pci_vtscsi_request)); + req->vsr_idx = idx; + req->vsr_queue = q; + req->vsr_niov_in = readable; + req->vsr_niov_out = n - readable; + memcpy(req->vsr_iov_in, iov, + req->vsr_niov_in * sizeof(struct iovec)); + memcpy(req->vsr_iov_out, iov + readable, + req->vsr_niov_out * sizeof(struct iovec)); + + pthread_mutex_lock(&q->vsq_mtx); + STAILQ_INSERT_TAIL(&q->vsq_requests, req, vsr_link); + pthread_cond_signal(&q->vsq_cv); + pthread_mutex_unlock(&q->vsq_mtx); + + DPRINTF(("virtio-scsi: request enqueued\n", idx)); + } +} + +static int +pci_vtscsi_init_queue(struct pci_vtscsi_softc *sc, + struct pci_vtscsi_queue *queue, int num) +{ + struct pci_vtscsi_worker *worker; + char threadname[16]; + int i; + + queue->vsq_sc = sc; + queue->vsq_ctl_fd = open("/dev/cam/ctl", O_RDWR); + queue->vsq_vq = &sc->vss_vq[num + 2]; + + if (queue->vsq_ctl_fd < 0) { + WPRINTF(("cannot open /dev/cam/ctl: %s\n", strerror(errno))); + return (-1); + } + + pthread_mutex_init(&queue->vsq_mtx, NULL); + pthread_mutex_init(&queue->vsq_qmtx, NULL); + pthread_cond_init(&queue->vsq_cv, NULL); + STAILQ_INIT(&queue->vsq_requests); + LIST_INIT(&queue->vsq_workers); + + for (i = 0; i < VTSCSI_THR_PER_Q; i++) { + worker = calloc(1, sizeof(struct pci_vtscsi_worker)); + worker->vsw_queue = queue; + + pthread_create(&worker->vsw_thread, NULL, &pci_vtscsi_proc, + (void *)worker); + + sprintf(threadname, "virtio-scsi:%d-%d", num, i); + pthread_set_name_np(worker->vsw_thread, threadname); + LIST_INSERT_HEAD(&queue->vsq_workers, worker, vsw_link); + } + + return (0); +} + +static int +pci_vtscsi_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts) +{ + struct pci_vtscsi_softc *sc; + char *optname = NULL; + char *opt; + int i; + + sc = calloc(1, sizeof(struct pci_vtscsi_softc)); + sc->vss_ctl_fd = open("/dev/cam/ctl", O_RDWR); + + if (sc->vss_ctl_fd < 0) { + WPRINTF(("cannot open /dev/cam/ctl: %s\n", strerror(errno))); + return (1); + } + + while ((opt = strsep(&opts, ",")) != NULL) { + if ((optname = strsep(&opt, "=")) != NULL) { + if (strcmp(optname, "iid") == 0) { + sc->vss_iid = strtoul(opt, NULL, 10); + } + } + } + + vi_softc_linkup(&sc->vss_vs, &vtscsi_vi_consts, sc, pi, sc->vss_vq); + sc->vss_vs.vs_mtx = &sc->vss_mtx; + + /* controlq */ + sc->vss_vq[0].vq_qsize = VTSCSI_RINGSZ; + sc->vss_vq[0].vq_notify = pci_vtscsi_controlq_notify; + + /* eventq */ + sc->vss_vq[1].vq_qsize = VTSCSI_RINGSZ; + sc->vss_vq[1].vq_notify = pci_vtscsi_eventq_notify; + + /* request queues */ + for (i = 2; i < VTSCSI_MAXQ; i++) { + sc->vss_vq[i].vq_qsize = VTSCSI_RINGSZ; + sc->vss_vq[i].vq_notify = pci_vtscsi_requestq_notify; + pci_vtscsi_init_queue(sc, &sc->vss_queues[i - 2], i - 2); + } + + /* initialize config space */ + pci_set_cfgdata16(pi, PCIR_DEVICE, VIRTIO_DEV_SCSI); + pci_set_cfgdata16(pi, PCIR_VENDOR, VIRTIO_VENDOR); + pci_set_cfgdata8(pi, PCIR_CLASS, PCIC_STORAGE); + pci_set_cfgdata16(pi, PCIR_SUBDEV_0, VIRTIO_TYPE_SCSI); + pci_set_cfgdata16(pi, PCIR_SUBVEND_0, VIRTIO_VENDOR); + + if (vi_intr_init(&sc->vss_vs, 1, fbsdrun_virtio_msix())) + return (1); + vi_set_io_bar(&sc->vss_vs, 0); + + return (0); +} + + +struct pci_devemu pci_de_vscsi = { + .pe_emu = "virtio-scsi", + .pe_init = pci_vtscsi_init, + .pe_barwrite = vi_pci_write, + .pe_barread = vi_pci_read +}; +PCI_EMUL_SET(pci_de_vscsi); Modified: head/usr.sbin/bhyve/virtio.h ============================================================================== --- head/usr.sbin/bhyve/virtio.h Mon Jun 11 01:32:18 2018 (r334939) +++ head/usr.sbin/bhyve/virtio.h Mon Jun 11 02:09:20 2018 (r334940) @@ -213,6 +213,7 @@ struct vring_used { #define VIRTIO_DEV_BLOCK 0x1001 #define VIRTIO_DEV_CONSOLE 0x1003 #define VIRTIO_DEV_RANDOM 0x1005 +#define VIRTIO_DEV_SCSI 0x1008 /* * PCI config space constants. From owner-svn-src-head@freebsd.org Mon Jun 11 02:35:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BFF010132C9 for ; Mon, 11 Jun 2018 02:35:48 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic315-21.consmr.mail.ne1.yahoo.com (sonic315-21.consmr.mail.ne1.yahoo.com [66.163.190.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BDFE86A67 for ; Mon, 11 Jun 2018 02:35:47 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1528684540; bh=fs5yY9pcinvKOIYE6tOUvw4H8aIcfA7Kd/y1px9f44Y=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=SSuQgMSAi91R7hox0N2fkp0pop7PLNAPcSJjdhIiemeez7uiLqf56r/ufkC3X0e7EUqDwBrVuAVf1/HPtc6yWSmwgyh9TbI154ZHkoH3NCw3sWkSnqhsVBjRovJpTTQFK26q9Guh7V0aHYGJjIvp1NPl/p4Tj8caermgsG9rzRKnAhQovQ9PDdgZaIJYhuWCdSp2plm7aCUIVzS5OQKXnpA2omL37pWCeROYdYaf5chB86kr/wqKYyeBki9rdxdJ6Q1RO1QrhLS/UVa7K2aab5LM1zltCiTnEgUu17nryfSxzwUi2JQSWdHeLObYQ1pt7XbvcBsYUlH9VSHKCJ8iqw== X-YMail-OSG: ZnJb4C0VM1kDc03XSMtsLLdQs0_kj1S0N2OorGVuW95gYmYiyWr.ONU7LJ2RH7E IPZRCvmGj9JmNzuUktb6I8QLTlcQQOyMC7QEPpD9z9jly9oNizR97pUOS1kFrDWavbkfhS4FSwei hMELowZfWfDh8LgQFWdL7k8YU7bby4574SpVwDEs1VHDTDjva1RoGhzkGP4MvzEV9e6hQN3t0COg daM89FSq8dNN8wJFqzC4Hl2r8JfeTV0osrtYQHkPxglobY5vGFR1x_rPk2JIKCBmhDI8hZG_FGkW ZTl8ym.F4mhPTyJca4AJ3T4gnOxdWnSssJQbt6QeQZGH6zV8jeUdvqYgAl3a9tM0.DGaGvpbPPRc L7s4tttqYc7_v3aKfUfSTUuYLrqBgrFrtX17AiVqWa81DVUlj.H9p0IBqubgn8wF5.oHtsZeP39A 8elCtNhF0ob8nXNlOQvtWq4XEiCTZIC3j4CrQl70Zl6l5q0mfcb7nB1d3Ggo1y3qCCzzBHx4MoMI b.7RM54Vkz1GA5TrUGV37go2k7ockKGooG_IWBNF5Dp.MH2LWitI9LDX9Ow8I9jTqufiEZOJTi2i JzQpC9F10dtvHHf0R_H557Pljx9ukOrcK0icSD10mYSQkicdKPm5XdTWefuo6tBKtbjvdksS9S1y wte8pujTZjXt7pJ4lfKQVobLqRzCrelHyxuKMVU5qKj74mRQ9hWikhzy44.EjxQLeYEiRMvHvPt4 jcMBBpWwz3XlYIQcLvTsJfwfxA3RKU_CaPwmJWk1G6E0RjbRqBxmgWvG2tZaGECFuGim3tAK8_mB uTsluiDornvhLEYyLpH8uqotLiVDVl_gEUX5yb9P3u9Awf08qzKrOVMmjz5ElL.22_kwgTRx_QV3 dG1HPAUZziXeoT0UUKEBmmTc88fo9T3fjFBhacNnhWA1gtDB9acb7G5dP5drLbjG2n8yqji6I4Aq 2ADSQxg-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic315.consmr.mail.ne1.yahoo.com with HTTP; Mon, 11 Jun 2018 02:35:40 +0000 Received: from 181.52.72.201 (EHLO [192.168.0.6]) ([181.52.72.201]) by smtp422.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 4cf020aab94b4c5444456e4ba99bd765; Mon, 11 Jun 2018 02:25:30 +0000 (UTC) Subject: Re: svn commit: r334940 - head/usr.sbin/bhyve To: Marcelo Araujo , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201806110209.w5B29Lni010557@repo.freebsd.org> From: Pedro Giffuni Organization: FreeBSD Project Message-ID: Date: Sun, 10 Jun 2018 21:25:30 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <201806110209.w5B29Lni010557@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 02:35:48 -0000 On 10/06/2018 21:09, Marcelo Araujo wrote: > Author: araujo > Date: Mon Jun 11 02:09:20 2018 > New Revision: 334940 > URL: https://svnweb.freebsd.org/changeset/base/334940 > > Log: > - Add bhyve virtio-scsi storage backend support. > > Example of configuration: > ctl.conf: > portal-group pg0 { > discovery-auth-group no-authentication > listen 0.0.0.0 > listen [::] > } > > target iqn.2012-06.com.example:target0 { > auth-group no-authentication > portal-group pg0 > port ioctl/5/3 > > lun 0 { > path /z/test.img > size 8G > } > lun 1 { > path /z/test1.img > size 8G > } > } > > bhyve <...> -s 4,virtio-scsi,/dev/cam/ctl5.3,iid=3 > > From inside guest: > root@:~ # zpool status test > pool: test > state: ONLINE > scan: none requested > config: > > NAME STATE READ WRITE CKSUM > test ONLINE 0 0 0 > da0 ONLINE 0 0 0 > da1 ONLINE 0 0 0 > > dmesg: > da0 at vtscsi0 bus 0 scbus0 target 0 lun 0 > da0: Fixed Direct Access SPC-5 SCSI device > da0: Serial Number MYSERIAL0000 > da0: 300.000MB/s transfers > da0: Command Queueing enabled > da0: 8192MB (16777216 512 byte sectors) > da1 at vtscsi0 bus 0 scbus0 target 0 lun 1 > da1: Fixed Direct Access SPC-5 SCSI device > da1: Serial Number MYSERIAL0001 > da1: 300.000MB/s transfers > da1: Command Queueing enabled > da1: 8192MB (16777216 512 byte sectors) > > Discussed with: grehan > Reviewed by: mav > Obtained from: TrueOS > Relnotes: Yes > Sponsored by: iXsystems Inc. > Tested with: FreeBSD HEAD, Fedora 28 (Workstation) and > Ubuntu 18.04. > Differential Revision: https://reviews.freebsd.org/D15276 > > Added: > head/usr.sbin/bhyve/iov.c (contents, props changed) > head/usr.sbin/bhyve/iov.h (contents, props changed) > head/usr.sbin/bhyve/pci_virtio_scsi.c (contents, props changed) > Modified: > head/usr.sbin/bhyve/Makefile > head/usr.sbin/bhyve/bhyve.8 > head/usr.sbin/bhyve/virtio.h > > ... > Added: head/usr.sbin/bhyve/pci_virtio_scsi.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.sbin/bhyve/pci_virtio_scsi.c Mon Jun 11 02:09:20 2018 (r334940) > @@ -0,0 +1,718 @@ > +/*- > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > + * > + * Copyright (c) 2016 Jakub Klama . > + * Copyright (c) 2018 Marcelo Araujo . > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer > + * in this position and unchanged. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include "bhyverun.h" > +#include "pci_emul.h" > +#include "virtio.h" > +#include "iov.h" > + > +#define VTSCSI_RINGSZ 64 > +#define VTSCSI_REQUESTQ 1 > +#define VTSCSI_THR_PER_Q 16 > +#define VTSCSI_MAXQ (VTSCSI_REQUESTQ + 2) > +#define VTSCSI_MAXSEG 64 > + > +#define VTSCSI_IN_HEADER_LEN(_sc) \ > + (sizeof(struct pci_vtscsi_req_cmd_rd) + _sc->vss_config.cdb_size) > + > +#define VTSCSI_OUT_HEADER_LEN(_sc) \ > + (sizeof(struct pci_vtscsi_req_cmd_wr) + _sc->vss_config.sense_size) > + > +#define VIRTIO_SCSI_MAX_CHANNEL 0 > +#define VIRTIO_SCSI_MAX_TARGET 0 > +#define VIRTIO_SCSI_MAX_LUN 16383 > + > +#define VIRTIO_SCSI_F_INOUT (1 << 0) > +#define VIRTIO_SCSI_F_HOTPLUG (1 << 1) > +#define VIRTIO_SCSI_F_CHANGE (1 << 2) > + TABS missing inconsistently after #define above ... > +static int pci_vtscsi_debug = 0; > +#define DPRINTF(params) if (pci_vtscsi_debug) printf params > +#define WPRINTF(params) printf params > + > +struct pci_vtscsi_config { > + uint32_t num_queues; > + uint32_t seg_max; > + uint32_t max_sectors; > + uint32_t cmd_per_lun; > + uint32_t event_info_size; > + uint32_t sense_size; > + uint32_t cdb_size; > + uint16_t max_channel; > + uint16_t max_target; > + uint32_t max_lun; > +} __attribute__((packed)); > + > +struct pci_vtscsi_queue { > + struct pci_vtscsi_softc * vsq_sc; > + struct vqueue_info * vsq_vq; > + int vsq_ctl_fd; > + pthread_mutex_t vsq_mtx; > + pthread_mutex_t vsq_qmtx; > + pthread_cond_t vsq_cv; > + STAILQ_HEAD(, pci_vtscsi_request) vsq_requests; > + LIST_HEAD(, pci_vtscsi_worker) vsq_workers; > +}; > + > +struct pci_vtscsi_worker { > + struct pci_vtscsi_queue * vsw_queue; > + pthread_t vsw_thread; > + bool vsw_exiting; > + LIST_ENTRY(pci_vtscsi_worker) vsw_link; > +}; > + > +struct pci_vtscsi_request { > + struct pci_vtscsi_queue * vsr_queue; > + struct iovec vsr_iov_in[VTSCSI_MAXSEG]; > + int vsr_niov_in; > + struct iovec vsr_iov_out[VTSCSI_MAXSEG]; > + int vsr_niov_out; > + uint32_t vsr_idx; > + STAILQ_ENTRY(pci_vtscsi_request) vsr_link; > +}; > + > +/* > + * Per-device softc > + */ > +struct pci_vtscsi_softc { > + struct virtio_softc vss_vs; > + struct vqueue_info vss_vq[VTSCSI_MAXQ]; > + struct pci_vtscsi_queue vss_queues[VTSCSI_REQUESTQ]; > + pthread_mutex_t vss_mtx; > + int vss_iid; > + int vss_ctl_fd; > + uint32_t vss_features; > + struct pci_vtscsi_config vss_config; > +}; > + > +#define VIRTIO_SCSI_T_TMF 0 > +#define VIRTIO_SCSI_T_TMF_ABORT_TASK 0 > +#define VIRTIO_SCSI_T_TMF_ABORT_TASK_SET 1 > +#define VIRTIO_SCSI_T_TMF_CLEAR_ACA 2 > +#define VIRTIO_SCSI_T_TMF_CLEAR_TASK_SET 3 > +#define VIRTIO_SCSI_T_TMF_I_T_NEXUS_RESET 4 > +#define VIRTIO_SCSI_T_TMF_LOGICAL_UNIT_RESET 5 > +#define VIRTIO_SCSI_T_TMF_QUERY_TASK 6 > +#define VIRTIO_SCSI_T_TMF_QUERY_TASK_SET 7 > + > +/* command-specific response values */ > +#define VIRTIO_SCSI_S_FUNCTION_COMPLETE 0 > +#define VIRTIO_SCSI_S_FUNCTION_SUCCEEDED 10 > +#define VIRTIO_SCSI_S_FUNCTION_REJECTED 11 > + and here above ... > +struct pci_vtscsi_ctrl_tmf { > + uint32_t type; > + uint32_t subtype; > + uint8_t lun[8]; > + uint64_t id; > + uint8_t response; > +} __attribute__((packed)); > + > +#define VIRTIO_SCSI_T_AN_QUERY 1 > +#define VIRTIO_SCSI_EVT_ASYNC_OPERATIONAL_CHANGE 2 > +#define VIRTIO_SCSI_EVT_ASYNC_POWER_MGMT 4 > +#define VIRTIO_SCSI_EVT_ASYNC_EXTERNAL_REQUEST 8 > +#define VIRTIO_SCSI_EVT_ASYNC_MEDIA_CHANGE 16 > +#define VIRTIO_SCSI_EVT_ASYNC_MULTI_HOST 32 > +#define VIRTIO_SCSI_EVT_ASYNC_DEVICE_BUSY 64 > + > +struct pci_vtscsi_ctrl_an { > + uint32_t type; > + uint8_t lun[8]; > + uint32_t event_requested; > + uint32_t event_actual; > + uint8_t response; > +} __attribute__((packed)); > + > +/* command-specific response values */ > +#define VIRTIO_SCSI_S_OK 0 > +#define VIRTIO_SCSI_S_OVERRUN 1 > +#define VIRTIO_SCSI_S_ABORTED 2 > +#define VIRTIO_SCSI_S_BAD_TARGET 3 > +#define VIRTIO_SCSI_S_RESET 4 > +#define VIRTIO_SCSI_S_BUSY 5 > +#define VIRTIO_SCSI_S_TRANSPORT_FAILURE 6 > +#define VIRTIO_SCSI_S_TARGET_FAILURE 7 > +#define VIRTIO_SCSI_S_NEXUS_FAILURE 8 > +#define VIRTIO_SCSI_S_FAILURE 9 > +#define VIRTIO_SCSI_S_INCORRECT_LUN 12 > + > +/* task_attr */ > +#define VIRTIO_SCSI_S_SIMPLE 0 > +#define VIRTIO_SCSI_S_ORDERED 1 > +#define VIRTIO_SCSI_S_HEAD 2 > +#define VIRTIO_SCSI_S_ACA 3 > + And here ... Pedro. From owner-svn-src-head@freebsd.org Mon Jun 11 02:41:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35DE91013F8A; Mon, 11 Jun 2018 02:41:42 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-lf0-x22e.google.com (mail-lf0-x22e.google.com [IPv6:2a00:1450:4010:c07::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 87A9086DE0; Mon, 11 Jun 2018 02:41:41 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-lf0-x22e.google.com with SMTP id 36-v6so28149527lfr.11; Sun, 10 Jun 2018 19:41:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Nxho1elf8rARGXGLFo0xFdhtaAPVZyf7Vah8Rjqw/VA=; b=V+X2pKDYUvDp087Oxaf9iUv7iVz3y7aKg84CYWjGuzBXh07NO3LqenEZoQyLLEGXCZ WRQrc0DnRurFoeec/HSQ6cj28I/517zJi+STTQcaZ9OhwwAcbGwUzR9j4VP4MTTsAwfb Pv/Ke7R/o/GBBMY4z8kUdx8ISTj9Zx9r+Dstb7xmqwY+Jlwzb0phk2xN+a9TLbtdz+Hd 1b7+c78QMLLa7i/AAt0ocWfyr8n5lOr/ABImgMwDTbQDAZAIsLbCxkWtyRKcIX9gP1oK RKQgs10Ew0wtzcEdXIXtktaz5hzXgb6om6AJQh8fmaC0MBYoVuy125tczVz9K1sD4AUy RKaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=Nxho1elf8rARGXGLFo0xFdhtaAPVZyf7Vah8Rjqw/VA=; b=rF1XhFh78tWWzpe81BMIrpj9oucD9nyPtwmV/rvsywPseoTcTeSHkr3R7ZLc8QS6zp Lusmp6J9nwH/5Kgpe20+VXw6x1hfiF72UdtdVth/9CDWDKbEag6PIWXFxrPPhGdAvZWP QF5Jy5V/PpyDurlhXZNI7sH3nB0lvMul3hYj99HGE7sDOR8O9bDu72FLbZD1sCyzYbpH EfeXzaWFynbbAoNiRPXiG9R0KvulGV7RPS0hUi8vfoAh7MgdxuSgfi9xwgeYDsyQhrpV XJCiUIxUwjw7E5SmKHkx7wMvKRHyJQ/s+LBRrI1eNZtdZoykq6XpOT4fyYubMZz0C15d SjCA== X-Gm-Message-State: APt69E3IhDotA/4g70YWBElu+0PXslPWBfhuiYFnrEXKtgKQCZNcdBWn gY7x2xjD1oPclISBmYKAwgSb2xGexkj7wJk/7SIm/g== X-Google-Smtp-Source: ADUXVKLI+6VQELdXdAJkUcLpEBW3rbuzaz3DxarAK56Ilfh8QdpRp72Z4ebQkNTlj7exIxwWwRZc+w1kL0yKToTe7M8= X-Received: by 2002:a2e:808e:: with SMTP id i14-v6mr6782624ljg.85.1528684899954; Sun, 10 Jun 2018 19:41:39 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a19:1f94:0:0:0:0:0 with HTTP; Sun, 10 Jun 2018 19:41:39 -0700 (PDT) Reply-To: araujo@freebsd.org In-Reply-To: References: <201806110209.w5B29Lni010557@repo.freebsd.org> From: Marcelo Araujo Date: Mon, 11 Jun 2018 10:41:39 +0800 Message-ID: Subject: Re: svn commit: r334940 - head/usr.sbin/bhyve To: Pedro Giffuni Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 02:41:42 -0000 2018-06-11 10:25 GMT+08:00 Pedro Giffuni : > > > On 10/06/2018 21:09, Marcelo Araujo wrote: > >> Author: araujo >> Date: Mon Jun 11 02:09:20 2018 >> New Revision: 334940 >> URL: https://svnweb.freebsd.org/changeset/base/334940 >> >> Log: >> - Add bhyve virtio-scsi storage backend support. >> Example of configuration: >> ctl.conf: >> portal-group pg0 { >> discovery-auth-group no-authentication >> listen 0.0.0.0 >> listen [::] >> } >> target iqn.2012-06.com.example:target0 { >> auth-group no-authentication >> portal-group pg0 >> port ioctl/5/3 >> lun 0 { >> path /z/test.img >> size 8G >> } >> lun 1 { >> path /z/test1.img >> size 8G >> } >> } >> bhyve <...> -s 4,virtio-scsi,/dev/cam/ctl5.3,iid=3 >> From inside guest: >> root@:~ # zpool status test >> pool: test >> state: ONLINE >> scan: none requested >> config: >> NAME STATE READ WRITE CKSUM >> test ONLINE 0 0 0 >> da0 ONLINE 0 0 0 >> da1 ONLINE 0 0 0 >> dmesg: >> da0 at vtscsi0 bus 0 scbus0 target 0 lun 0 >> da0: Fixed Direct Access SPC-5 SCSI device >> da0: Serial Number MYSERIAL0000 >> da0: 300.000MB/s transfers >> da0: Command Queueing enabled >> da0: 8192MB (16777216 512 byte sectors) >> da1 at vtscsi0 bus 0 scbus0 target 0 lun 1 >> da1: Fixed Direct Access SPC-5 SCSI device >> da1: Serial Number MYSERIAL0001 >> da1: 300.000MB/s transfers >> da1: Command Queueing enabled >> da1: 8192MB (16777216 512 byte sectors) >> Discussed with: grehan >> Reviewed by: mav >> Obtained from: TrueOS >> Relnotes: Yes >> Sponsored by: iXsystems Inc. >> Tested with: FreeBSD HEAD, Fedora 28 (Workstation) and >> Ubuntu 18.04. >> Differential Revision: https://reviews.freebsd.org/D15276 >> >> Added: >> head/usr.sbin/bhyve/iov.c (contents, props changed) >> head/usr.sbin/bhyve/iov.h (contents, props changed) >> head/usr.sbin/bhyve/pci_virtio_scsi.c (contents, props changed) >> Modified: >> head/usr.sbin/bhyve/Makefile >> head/usr.sbin/bhyve/bhyve.8 >> head/usr.sbin/bhyve/virtio.h >> >> ... >> > > Added: head/usr.sbin/bhyve/pci_virtio_scsi.c >> ============================================================ >> ================== >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >> +++ head/usr.sbin/bhyve/pci_virtio_scsi.c Mon Jun 11 02:09:20 >> 2018 (r334940) >> @@ -0,0 +1,718 @@ >> +/*- >> + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD >> + * >> + * Copyright (c) 2016 Jakub Klama . >> + * Copyright (c) 2018 Marcelo Araujo . >> + * All rights reserved. >> + * >> + * Redistribution and use in source and binary forms, with or without >> + * modification, are permitted provided that the following conditions >> + * are met: >> + * 1. Redistributions of source code must retain the above copyright >> + * notice, this list of conditions and the following disclaimer >> + * in this position and unchanged. >> + * 2. Redistributions in binary form must reproduce the above copyright >> + * notice, this list of conditions and the following disclaimer in the >> + * documentation and/or other materials provided with the >> distribution. >> + * >> + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND >> + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >> + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >> PURPOSE >> + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE >> LIABLE >> + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >> CONSEQUENTIAL >> + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE >> GOODS >> + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) >> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, >> STRICT >> + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY >> WAY >> + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF >> + * SUCH DAMAGE. >> + */ >> + >> +#include >> +__FBSDID("$FreeBSD$"); >> + >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> + >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> + >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> + >> +#include "bhyverun.h" >> +#include "pci_emul.h" >> +#include "virtio.h" >> +#include "iov.h" >> + >> +#define VTSCSI_RINGSZ 64 >> +#define VTSCSI_REQUESTQ 1 >> +#define VTSCSI_THR_PER_Q 16 >> +#define VTSCSI_MAXQ (VTSCSI_REQUESTQ + 2) >> +#define VTSCSI_MAXSEG 64 >> + >> +#define VTSCSI_IN_HEADER_LEN(_sc) \ >> + (sizeof(struct pci_vtscsi_req_cmd_rd) + _sc->vss_config.cdb_size) >> + >> +#define VTSCSI_OUT_HEADER_LEN(_sc) \ >> + (sizeof(struct pci_vtscsi_req_cmd_wr) + >> _sc->vss_config.sense_size) >> + >> +#define VIRTIO_SCSI_MAX_CHANNEL 0 >> +#define VIRTIO_SCSI_MAX_TARGET 0 >> +#define VIRTIO_SCSI_MAX_LUN 16383 >> + >> +#define VIRTIO_SCSI_F_INOUT (1 << 0) >> +#define VIRTIO_SCSI_F_HOTPLUG (1 << 1) >> +#define VIRTIO_SCSI_F_CHANGE (1 << 2) >> + >> > TABS missing inconsistently after #define above ... > > > +static int pci_vtscsi_debug = 0; >> +#define DPRINTF(params) if (pci_vtscsi_debug) printf params >> +#define WPRINTF(params) printf params >> + >> +struct pci_vtscsi_config { >> + uint32_t num_queues; >> + uint32_t seg_max; >> + uint32_t max_sectors; >> + uint32_t cmd_per_lun; >> + uint32_t event_info_size; >> + uint32_t sense_size; >> + uint32_t cdb_size; >> + uint16_t max_channel; >> + uint16_t max_target; >> + uint32_t max_lun; >> +} __attribute__((packed)); >> + >> +struct pci_vtscsi_queue { >> + struct pci_vtscsi_softc * vsq_sc; >> + struct vqueue_info * vsq_vq; >> + int vsq_ctl_fd; >> + pthread_mutex_t vsq_mtx; >> + pthread_mutex_t vsq_qmtx; >> + pthread_cond_t vsq_cv; >> + STAILQ_HEAD(, pci_vtscsi_request) vsq_requests; >> + LIST_HEAD(, pci_vtscsi_worker) vsq_workers; >> +}; >> + >> +struct pci_vtscsi_worker { >> + struct pci_vtscsi_queue * vsw_queue; >> + pthread_t vsw_thread; >> + bool vsw_exiting; >> + LIST_ENTRY(pci_vtscsi_worker) vsw_link; >> +}; >> + >> +struct pci_vtscsi_request { >> + struct pci_vtscsi_queue * vsr_queue; >> + struct iovec vsr_iov_in[VTSCSI_MAXSEG]; >> + int vsr_niov_in; >> + struct iovec vsr_iov_out[VTSCSI_MAXSEG]; >> + int vsr_niov_out; >> + uint32_t vsr_idx; >> + STAILQ_ENTRY(pci_vtscsi_request) vsr_link; >> +}; >> + >> +/* >> + * Per-device softc >> + */ >> +struct pci_vtscsi_softc { >> + struct virtio_softc vss_vs; >> + struct vqueue_info vss_vq[VTSCSI_MAXQ]; >> + struct pci_vtscsi_queue vss_queues[VTSCSI_REQUESTQ]; >> + pthread_mutex_t vss_mtx; >> + int vss_iid; >> + int vss_ctl_fd; >> + uint32_t vss_features; >> + struct pci_vtscsi_config vss_config; >> +}; >> + >> +#define VIRTIO_SCSI_T_TMF 0 >> +#define VIRTIO_SCSI_T_TMF_ABORT_TASK 0 >> +#define VIRTIO_SCSI_T_TMF_ABORT_TASK_SET 1 >> +#define VIRTIO_SCSI_T_TMF_CLEAR_ACA 2 >> +#define VIRTIO_SCSI_T_TMF_CLEAR_TASK_SET 3 >> +#define VIRTIO_SCSI_T_TMF_I_T_NEXUS_RESET 4 >> +#define VIRTIO_SCSI_T_TMF_LOGICAL_UNIT_RESET 5 >> +#define VIRTIO_SCSI_T_TMF_QUERY_TASK 6 >> +#define VIRTIO_SCSI_T_TMF_QUERY_TASK_SET 7 >> + >> +/* command-specific response values */ >> +#define VIRTIO_SCSI_S_FUNCTION_COMPLETE 0 >> +#define VIRTIO_SCSI_S_FUNCTION_SUCCEEDED 10 >> +#define VIRTIO_SCSI_S_FUNCTION_REJECTED 11 >> + >> > and here above ... > > > +struct pci_vtscsi_ctrl_tmf { >> + uint32_t type; >> + uint32_t subtype; >> + uint8_t lun[8]; >> + uint64_t id; >> + uint8_t response; >> +} __attribute__((packed)); >> + >> +#define VIRTIO_SCSI_T_AN_QUERY 1 >> +#define VIRTIO_SCSI_EVT_ASYNC_OPERATIONAL_CHANGE 2 >> +#define VIRTIO_SCSI_EVT_ASYNC_POWER_MGMT 4 >> +#define VIRTIO_SCSI_EVT_ASYNC_EXTERNAL_REQUEST 8 >> +#define VIRTIO_SCSI_EVT_ASYNC_MEDIA_CHANGE 16 >> +#define VIRTIO_SCSI_EVT_ASYNC_MULTI_HOST 32 >> +#define VIRTIO_SCSI_EVT_ASYNC_DEVICE_BUSY 64 >> + >> +struct pci_vtscsi_ctrl_an { >> + uint32_t type; >> + uint8_t lun[8]; >> + uint32_t event_requested; >> + uint32_t event_actual; >> + uint8_t response; >> +} __attribute__((packed)); >> + >> +/* command-specific response values */ >> +#define VIRTIO_SCSI_S_OK 0 >> +#define VIRTIO_SCSI_S_OVERRUN 1 >> +#define VIRTIO_SCSI_S_ABORTED 2 >> +#define VIRTIO_SCSI_S_BAD_TARGET 3 >> +#define VIRTIO_SCSI_S_RESET 4 >> +#define VIRTIO_SCSI_S_BUSY 5 >> +#define VIRTIO_SCSI_S_TRANSPORT_FAILURE 6 >> +#define VIRTIO_SCSI_S_TARGET_FAILURE 7 >> +#define VIRTIO_SCSI_S_NEXUS_FAILURE 8 >> +#define VIRTIO_SCSI_S_FAILURE 9 >> +#define VIRTIO_SCSI_S_INCORRECT_LUN 12 >> + >> +/* task_attr */ >> +#define VIRTIO_SCSI_S_SIMPLE 0 >> +#define VIRTIO_SCSI_S_ORDERED 1 >> +#define VIRTIO_SCSI_S_HEAD 2 >> +#define VIRTIO_SCSI_S_ACA 3 >> + >> > And here ... > > Pedro. > > _______________________________________________ > 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-unsubscribe@freebsd.org" > Hi Pedro, I think it is the email message that messed up with it. I did check it again, usually I use 'vi' and also I checked here: https://svnweb.freebsd.org/base/head/usr.sbin/bhyve/pci_virtio_scsi.c?view=markup&pathrev=334940 Seems everything is correct! Am I missing something? Best, -- -- Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-head@freebsd.org Mon Jun 11 02:44:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9223C1014734 for ; Mon, 11 Jun 2018 02:44:36 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic310-23.consmr.mail.ne1.yahoo.com (sonic310-23.consmr.mail.ne1.yahoo.com [66.163.186.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1970887279 for ; Mon, 11 Jun 2018 02:44:36 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1528685075; bh=p+chWXGv75K2jVEhrtI8uO2y0DsYiA32Xxz9QOgMD1Y=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=m571PEL4rbBYUxrUDkhCFoKyQuoz0m1V/IZcrfKYodiQzQPCiav02i6BaAjcxEHcN8qFWVj5iE1mhjIAGhBaaFDgwvUYFtm8nb/rPp4oFIYyabCxBhkRTfiPVWXRQ9YkZAJHR0BUjPVXD1M6FQA2uslAeR2yQPWhHAMrXv7gnJ/DBADAZoCf/RQepCPmrhmZpWBZea553sF7bgcKlMQS0uZ1ZstrRC+ljEqLkOMA9SYSRUrPz2Ju7o2K0ND2HbNGGA/wnW1ju16XuDdmUyh0Uk6I5b+LtOrVRHP12e8XEBMsuxofPHAhEVeHVWT2K3XWSfVhXzQ0h3fTiOD+bLplxg== X-YMail-OSG: UVN4OpgVM1keeIUMWh64g.QUCFUhXbyMqfJ0mGfbO39fWIQSSS5dbzvDkv9m2uE sJoBMwDxHGsgRaxUzT3XFqWQ0FQskeg8j0YTbDrHCMfEXl0TpAoInFBam._H26A93QUu68ttpKU_ eH7KLFwEQ5OgXouKelnNnWdfqwsixrajvZTsaZcqs55umbKQ1O0yDj5VrbLKnKMN6g7tLgtaMX0j A_9_bOqrHGS1ESMVtoeUeUfT_D6EQtcwksfvWSbdi7bv11gjZCZU9zcgCi8yTBv2BOmF0Jb0C3va g9uOBggWEwcEajVI2zBkbe.rsWZO14nipsTPUNmQmD.BjwYlPIfPnVliNCAV4xlegZs3ao6pl05u 0FOutkdf13wdtP220ELZCOgpoLaAdfPtZ1HA8p.maF9KsABIDhI0WoJ29U1eimsvCaUsY3lbTEr1 GExDLlgRftlylmIv1drpVS_IWJHZEN1oqiaXqyyWyNBmhvsIeYY7dQEDPK04DAA_bVcAcNFjDc5P Fp86pbZFChhb8fZ6hKLSQR7fkvQxCV5xiEv7HBzF9QSsmJviNogLydsjjiCdpYbAb2UD36bOYWBu 7gWo7upSDIXTQql9UKmoAW8tkyfhwAUuSzJbsJxRaapGTL.UBK5mNH0mXRNg9mU2lzGFAx7RSQ.p NzFUkERm0HIxeMtE8JfL10OhXFtT5tyOHPFqA5P5I4P85Rir_X6vQltykmjDCgcQSDafjAfpMwSU 5xqSMzJlqs296s2nv6Q81WwhrxqGD8cDtsv3B3NlKUpSYy9alecg3TpNgq50Eo6JrMylZRby2MUq 5GtuAVIVwS8opWWF9PaSNMvOT49MXil4sVsaLTjLbTkbJTMCPUI4spcdaJ2OFteFd_L03Nv2AMbY 0TG2tqoNtOK3UCRG3CIXA0H6Jx8SYECUZaOPN8wI9IsT8be1uZaXkIxIBV6mr_3U9ou0jWpP8_r0 - Received: from sonic.gate.mail.ne1.yahoo.com by sonic310.consmr.mail.ne1.yahoo.com with HTTP; Mon, 11 Jun 2018 02:44:35 +0000 Received: from 181.52.72.201 (EHLO [192.168.0.6]) ([181.52.72.201]) by smtp429.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID c79f109519a7a5f1453506de25c52f37; Mon, 11 Jun 2018 02:44:31 +0000 (UTC) Subject: Re: svn commit: r334940 - head/usr.sbin/bhyve To: araujo@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201806110209.w5B29Lni010557@repo.freebsd.org> From: Pedro Giffuni Organization: FreeBSD Project Message-ID: Date: Sun, 10 Jun 2018 21:44:31 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 02:44:37 -0000 On 10/06/2018 21:41, Marcelo Araujo wrote: > > > 2018-06-11 10:25 GMT+08:00 Pedro Giffuni >: > > > > On 10/06/2018 21:09, Marcelo Araujo wrote: > > Author: araujo > Date: Mon Jun 11 02:09:20 2018 > New Revision: 334940 > URL: https://svnweb.freebsd.org/changeset/base/334940 > > > Log: >    - Add bhyve virtio-scsi storage backend support. >       Example of configuration: >    ctl.conf: >    portal-group pg0 { >            discovery-auth-group no-authentication >            listen 0.0.0.0 >            listen [::] >    } >       target iqn.2012-06.com.example:target0 { >            auth-group no-authentication >            portal-group pg0 >            port ioctl/5/3 >               lun 0 { >                    path /z/test.img >                    size 8G >            } >            lun 1 { >                    path /z/test1.img >                    size 8G >            } >    } >       bhyve <...> -s 4,virtio-scsi,/dev/cam/ctl5.3,iid=3 >       From inside guest: >    root@:~ # zpool status test >      pool: test >     state: ONLINE >      scan: none requested >    config: >               NAME        STATE     READ WRITE CKSUM >            test        ONLINE       0     0     0 >              da0       ONLINE       0     0     0 >              da1       ONLINE       0     0     0 >       dmesg: >    da0 at vtscsi0 bus 0 scbus0 target 0 lun 0 >    da0: Fixed Direct Access SPC-5 SCSI > device >    da0: Serial Number MYSERIAL0000 >    da0: 300.000MB/s transfers >    da0: Command Queueing enabled >    da0: 8192MB (16777216 512 byte sectors) >    da1 at vtscsi0 bus 0 scbus0 target 0 lun 1 >    da1: Fixed Direct Access SPC-5 SCSI > device >    da1: Serial Number MYSERIAL0001 >    da1: 300.000MB/s transfers >    da1: Command Queueing enabled >    da1: 8192MB (16777216 512 byte sectors) >       Discussed with:           grehan >    Reviewed by:         mav >    Obtained from:               TrueOS >    Relnotes:            Yes >    Sponsored by:                iXsystems Inc. >    Tested with:         FreeBSD HEAD, Fedora 28 (Workstation) and >                         Ubuntu 18.04. >    Differential Revision: https://reviews.freebsd.org/D15276 > > > Added: >    head/usr.sbin/bhyve/iov.c   (contents, props changed) >    head/usr.sbin/bhyve/iov.h   (contents, props changed) >    head/usr.sbin/bhyve/pci_virtio_scsi.c  (contents, props > changed) > Modified: >    head/usr.sbin/bhyve/Makefile >    head/usr.sbin/bhyve/bhyve.8 >    head/usr.sbin/bhyve/virtio.h > > ... > > > Added: head/usr.sbin/bhyve/pci_virtio_scsi.c > ============================================================================== > --- /dev/null   00:00:00 1970   (empty, because file is newly > added) > +++ head/usr.sbin/bhyve/pci_virtio_scsi.c  Mon Jun 11 02:09:20 > 2018        (r334940) > @@ -0,0 +1,718 @@ > +/*- > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > + * > + * Copyright (c) 2016 Jakub Klama . > + * Copyright (c) 2018 Marcelo Araujo . > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or > without > + * modification, are permitted provided that the following > conditions > + * are met: > + * 1. Redistributions of source code must retain the above > copyright > + *    notice, this list of conditions and the following > disclaimer > + *    in this position and unchanged. > + * 2. Redistributions in binary form must reproduce the above > copyright > + *    notice, this list of conditions and the following > disclaimer in the > + *    documentation and/or other materials provided with the > distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS > ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT > LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A > PARTICULAR PURPOSE > + * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR > CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, > OR CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF > SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS > INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN > CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) > ARISING IN ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE > POSSIBILITY OF > + * SUCH DAMAGE. > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include "bhyverun.h" > +#include "pci_emul.h" > +#include "virtio.h" > +#include "iov.h" > + > +#define VTSCSI_RINGSZ          64 > +#define        VTSCSI_REQUESTQ         1 > +#define        VTSCSI_THR_PER_Q        16 > +#define        VTSCSI_MAXQ  (VTSCSI_REQUESTQ + 2) > +#define        VTSCSI_MAXSEG           64 > + > +#define        VTSCSI_IN_HEADER_LEN(_sc)       \ > +       (sizeof(struct pci_vtscsi_req_cmd_rd) + > _sc->vss_config.cdb_size) > + > +#define        VTSCSI_OUT_HEADER_LEN(_sc)      \ > +       (sizeof(struct pci_vtscsi_req_cmd_wr) + > _sc->vss_config.sense_size) > + > +#define VIRTIO_SCSI_MAX_CHANNEL 0 > +#define VIRTIO_SCSI_MAX_TARGET  0 > +#define VIRTIO_SCSI_MAX_LUN     16383 > + > +#define        VIRTIO_SCSI_F_INOUT     (1 << 0) > +#define        VIRTIO_SCSI_F_HOTPLUG   (1 << 1) > +#define        VIRTIO_SCSI_F_CHANGE    (1 << 2) > + > > TABS missing inconsistently after #define above ... > > > +static int pci_vtscsi_debug = 0; > +#define DPRINTF(params) if (pci_vtscsi_debug) printf params > +#define WPRINTF(params) printf params > + > +struct pci_vtscsi_config { > +       uint32_t num_queues; > +       uint32_t seg_max; > +       uint32_t max_sectors; > +       uint32_t cmd_per_lun; > +       uint32_t event_info_size; > +       uint32_t sense_size; > +       uint32_t cdb_size; > +       uint16_t max_channel; > +       uint16_t max_target; > +       uint32_t max_lun; > +} __attribute__((packed)); > + > +struct pci_vtscsi_queue { > +       struct pci_vtscsi_softc *         vsq_sc; > +       struct vqueue_info *              vsq_vq; > +       int  vsq_ctl_fd; > +       pthread_mutex_t                   vsq_mtx; > +       pthread_mutex_t                   vsq_qmtx; > +        pthread_cond_t                    vsq_cv; > +       STAILQ_HEAD(, pci_vtscsi_request) vsq_requests; > +       LIST_HEAD(, pci_vtscsi_worker) vsq_workers; > +}; > + > +struct pci_vtscsi_worker { > +       struct pci_vtscsi_queue *     vsw_queue; > +       pthread_t                     vsw_thread; > +       bool                          vsw_exiting; > +        LIST_ENTRY(pci_vtscsi_worker) vsw_link; > +}; > + > +struct pci_vtscsi_request { > +       struct pci_vtscsi_queue * vsr_queue; > +       struct iovec vsr_iov_in[VTSCSI_MAXSEG]; > +       int                       vsr_niov_in; > +       struct iovec vsr_iov_out[VTSCSI_MAXSEG]; > +       int                       vsr_niov_out; > +       uint32_t                  vsr_idx; > +       STAILQ_ENTRY(pci_vtscsi_request) vsr_link; > +}; > + > +/* > + * Per-device softc > + */ > +struct pci_vtscsi_softc { > +       struct virtio_softc      vss_vs; > +       struct vqueue_info  vss_vq[VTSCSI_MAXQ]; > +       struct pci_vtscsi_queue vss_queues[VTSCSI_REQUESTQ]; > +       pthread_mutex_t          vss_mtx; > +       int                      vss_iid; > +       int                      vss_ctl_fd; > +       uint32_t                 vss_features; > +       struct pci_vtscsi_config vss_config; > +}; > + > +#define VIRTIO_SCSI_T_TMF                      0 > +#define VIRTIO_SCSI_T_TMF_ABORT_TASK           0 > +#define VIRTIO_SCSI_T_TMF_ABORT_TASK_SET  1 > +#define VIRTIO_SCSI_T_TMF_CLEAR_ACA            2 > +#define VIRTIO_SCSI_T_TMF_CLEAR_TASK_SET  3 > +#define VIRTIO_SCSI_T_TMF_I_T_NEXUS_RESET 4 > +#define VIRTIO_SCSI_T_TMF_LOGICAL_UNIT_RESET  5 > +#define VIRTIO_SCSI_T_TMF_QUERY_TASK           6 > +#define VIRTIO_SCSI_T_TMF_QUERY_TASK_SET  7 > + > +/* command-specific response values */ > +#define VIRTIO_SCSI_S_FUNCTION_COMPLETE         0 > +#define VIRTIO_SCSI_S_FUNCTION_SUCCEEDED  10 > +#define VIRTIO_SCSI_S_FUNCTION_REJECTED         11 > + > > and here above ... > > > +struct pci_vtscsi_ctrl_tmf { > +       uint32_t type; > +       uint32_t subtype; > +       uint8_t lun[8]; > +       uint64_t id; > +       uint8_t response; > +} __attribute__((packed)); > + > +#define VIRTIO_SCSI_T_AN_QUERY                 1 > +#define VIRTIO_SCSI_EVT_ASYNC_OPERATIONAL_CHANGE 2 > +#define VIRTIO_SCSI_EVT_ASYNC_POWER_MGMT  4 > +#define VIRTIO_SCSI_EVT_ASYNC_EXTERNAL_REQUEST 8 > +#define VIRTIO_SCSI_EVT_ASYNC_MEDIA_CHANGE  16 > +#define VIRTIO_SCSI_EVT_ASYNC_MULTI_HOST  32 > +#define VIRTIO_SCSI_EVT_ASYNC_DEVICE_BUSY 64 > + > +struct pci_vtscsi_ctrl_an { > +       uint32_t type; > +       uint8_t lun[8]; > +       uint32_t event_requested; > +       uint32_t event_actual; > +       uint8_t response; > +} __attribute__((packed)); > + > +/* command-specific response values */ > +#define VIRTIO_SCSI_S_OK                       0 > +#define VIRTIO_SCSI_S_OVERRUN                  1 > +#define VIRTIO_SCSI_S_ABORTED                  2 > +#define VIRTIO_SCSI_S_BAD_TARGET               3 > +#define VIRTIO_SCSI_S_RESET                    4 > +#define VIRTIO_SCSI_S_BUSY                     5 > +#define VIRTIO_SCSI_S_TRANSPORT_FAILURE         6 > +#define VIRTIO_SCSI_S_TARGET_FAILURE           7 > +#define VIRTIO_SCSI_S_NEXUS_FAILURE            8 > +#define VIRTIO_SCSI_S_FAILURE                  9 > +#define VIRTIO_SCSI_S_INCORRECT_LUN            12 > + > +/* task_attr */ > +#define VIRTIO_SCSI_S_SIMPLE                   0 > +#define VIRTIO_SCSI_S_ORDERED                  1 > +#define VIRTIO_SCSI_S_HEAD                     2 > +#define VIRTIO_SCSI_S_ACA                      3 > + > > And here ... > > Pedro. > > _______________________________________________ > 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-unsubscribe@freebsd.org > " > > > Hi Pedro, > > I think it is the email message that messed up with it. Hmm... could be, sorry for the false alarm! Pedro. From owner-svn-src-head@freebsd.org Mon Jun 11 05:05:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02EAE1004FE4; Mon, 11 Jun 2018 05:05:22 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 97EA76CEB8; Mon, 11 Jun 2018 05:05:21 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 791AB16F9F; Mon, 11 Jun 2018 05:05:21 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5B55LV9002127; Mon, 11 Jun 2018 05:05:21 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5B55LjF002125; Mon, 11 Jun 2018 05:05:21 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806110505.w5B55LjF002125@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Mon, 11 Jun 2018 05:05:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334941 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 334941 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 05:05:22 -0000 Author: eadler Date: Mon Jun 11 05:05:20 2018 New Revision: 334941 URL: https://svnweb.freebsd.org/changeset/base/334941 Log: top(1): handle 0 in "digits" functions Modified: head/usr.bin/top/Makefile head/usr.bin/top/utils.c Modified: head/usr.bin/top/Makefile ============================================================================== --- head/usr.bin/top/Makefile Mon Jun 11 02:09:20 2018 (r334940) +++ head/usr.bin/top/Makefile Mon Jun 11 05:05:20 2018 (r334941) @@ -5,7 +5,6 @@ PROG= top SRCS= commands.c display.c machine.c screen.c top.c \ username.c utils.c -CFLAGS+= -I ${.OBJDIR} MAN= top.1 .if ${COMPILER_TYPE} == "gcc" Modified: head/usr.bin/top/utils.c ============================================================================== --- head/usr.bin/top/utils.c Mon Jun 11 02:09:20 2018 (r334940) +++ head/usr.bin/top/utils.c Mon Jun 11 05:05:20 2018 (r334941) @@ -124,16 +124,18 @@ itoa7(int val) /* * digits(val) - return number of decimal digits in val. Only works for - * positive numbers. If val <= 0 then digits(val) == 0. + * non-negative numbers. If val <= 0 then digits(val) == 0. */ -int +int __pure2 digits(int val) { int cnt = 0; + if (val == 0) { + return 1; + } - while (val > 0) - { + while (val > 0) { cnt++; val /= 10; } From owner-svn-src-head@freebsd.org Mon Jun 11 05:27:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E19D610081B7; Mon, 11 Jun 2018 05:27:08 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8CF8C6DDC3; Mon, 11 Jun 2018 05:27:08 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 683A7172EC; Mon, 11 Jun 2018 05:27:08 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5B5R8AO012394; Mon, 11 Jun 2018 05:27:08 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5B5R81o012393; Mon, 11 Jun 2018 05:27:08 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806110527.w5B5R81o012393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Mon, 11 Jun 2018 05:27:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334942 - head/sys/dev/usb X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/sys/dev/usb X-SVN-Commit-Revision: 334942 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 05:27:09 -0000 Author: eadler Date: Mon Jun 11 05:27:07 2018 New Revision: 334942 URL: https://svnweb.freebsd.org/changeset/base/334942 Log: usbdevs: adding vendor PR: 228856 Reported by: hrs, ys-h@imail.earth Modified: head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Mon Jun 11 05:05:20 2018 (r334941) +++ head/sys/dev/usb/usbdevs Mon Jun 11 05:27:07 2018 (r334942) @@ -714,6 +714,7 @@ vendor AMIT 0x18c5 AMIT vendor GOOGLE 0x18d1 Google vendor QCOM 0x18e8 Qcom vendor ELV 0x18ef ELV +vendor ZTE 0x19d2 ZTE vendor LINKSYS3 0x1915 Linksys vendor MEINBERG 0x1938 Meinberg Funkuhren vendor BECEEM 0x198f Beceem Communications From owner-svn-src-head@freebsd.org Mon Jun 11 05:28:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 506011008354; Mon, 11 Jun 2018 05:28:01 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F28FF6DF2C; Mon, 11 Jun 2018 05:28:00 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D464F172EE; Mon, 11 Jun 2018 05:28:00 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5B5S02M012484; Mon, 11 Jun 2018 05:28:00 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5B5S0xK012483; Mon, 11 Jun 2018 05:28:00 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806110528.w5B5S0xK012483@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Mon, 11 Jun 2018 05:28:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334943 - head/sys/dev/usb X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/sys/dev/usb X-SVN-Commit-Revision: 334943 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 05:28:01 -0000 Author: eadler Date: Mon Jun 11 05:28:00 2018 New Revision: 334943 URL: https://svnweb.freebsd.org/changeset/base/334943 Log: usbdevs: sort my prior commit Modified: head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Mon Jun 11 05:27:07 2018 (r334942) +++ head/sys/dev/usb/usbdevs Mon Jun 11 05:28:00 2018 (r334943) @@ -714,10 +714,10 @@ vendor AMIT 0x18c5 AMIT vendor GOOGLE 0x18d1 Google vendor QCOM 0x18e8 Qcom vendor ELV 0x18ef ELV -vendor ZTE 0x19d2 ZTE vendor LINKSYS3 0x1915 Linksys vendor MEINBERG 0x1938 Meinberg Funkuhren vendor BECEEM 0x198f Beceem Communications +vendor ZTE 0x19d2 ZTE vendor QUALCOMMINC 0x19d2 Qualcomm, Incorporated vendor QUALCOMM3 0x19f5 Qualcomm, Inc. vendor QUANTA2 0x1a32 Quanta From owner-svn-src-head@freebsd.org Mon Jun 11 05:36:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24A4810093CB; Mon, 11 Jun 2018 05:36:00 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C9DD36E67A; Mon, 11 Jun 2018 05:35:59 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A6C3817481; Mon, 11 Jun 2018 05:35:59 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5B5ZxwO017626; Mon, 11 Jun 2018 05:35:59 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5B5Zv7a017614; Mon, 11 Jun 2018 05:35:57 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201806110535.w5B5Zv7a017614@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Mon, 11 Jun 2018 05:35:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334944 - in head/usr.bin/indent: . tests X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: in head/usr.bin/indent: . tests X-SVN-Commit-Revision: 334944 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 05:36:00 -0000 Author: pstef Date: Mon Jun 11 05:35:57 2018 New Revision: 334944 URL: https://svnweb.freebsd.org/changeset/base/334944 Log: indent(1): rename -nsac/-sac ("space after cast") to -ncs/-cs Also update tests and the manpage. GNU indent had the option earlier as -cs, let's not diverge unnecessarily. Added: head/usr.bin/indent/tests/cs.0 - copied unchanged from r334943, head/usr.bin/indent/tests/sac.0 head/usr.bin/indent/tests/cs.0.pro - copied, changed from r334943, head/usr.bin/indent/tests/sac.0.pro head/usr.bin/indent/tests/cs.0.stdout - copied unchanged from r334943, head/usr.bin/indent/tests/sac.0.stdout head/usr.bin/indent/tests/ncs.0 - copied unchanged from r334943, head/usr.bin/indent/tests/nsac.0 head/usr.bin/indent/tests/ncs.0.pro - copied, changed from r334943, head/usr.bin/indent/tests/nsac.0.pro head/usr.bin/indent/tests/ncs.0.stdout - copied unchanged from r334943, head/usr.bin/indent/tests/nsac.0.stdout Deleted: head/usr.bin/indent/tests/nsac.0 head/usr.bin/indent/tests/nsac.0.pro head/usr.bin/indent/tests/nsac.0.stdout head/usr.bin/indent/tests/sac.0 head/usr.bin/indent/tests/sac.0.pro head/usr.bin/indent/tests/sac.0.stdout Modified: head/usr.bin/indent/args.c head/usr.bin/indent/indent.1 head/usr.bin/indent/tests/Makefile Modified: head/usr.bin/indent/args.c ============================================================================== --- head/usr.bin/indent/args.c Mon Jun 11 05:28:00 2018 (r334943) +++ head/usr.bin/indent/args.c Mon Jun 11 05:35:57 2018 (r334944) @@ -116,6 +116,7 @@ struct pro { {"ce", PRO_BOOL, true, ON, &opt.cuddle_else}, {"ci", PRO_INT, 0, 0, &opt.continuation_indent}, {"cli", PRO_SPECIAL, 0, CLI, 0}, + {"cs", PRO_BOOL, false, ON, &opt.space_after_cast}, {"c", PRO_INT, 33, 0, &opt.com_ind}, {"di", PRO_INT, 16, 0, &opt.decl_indent}, {"dj", PRO_BOOL, false, ON, &opt.ljust_decl}, @@ -141,6 +142,7 @@ struct pro { {"nbs", PRO_BOOL, false, OFF, &opt.Bill_Shannon}, {"ncdb", PRO_BOOL, true, OFF, &opt.comment_delimiter_on_blankline}, {"nce", PRO_BOOL, true, OFF, &opt.cuddle_else}, + {"ncs", PRO_BOOL, false, OFF, &opt.space_after_cast}, {"ndj", PRO_BOOL, false, OFF, &opt.ljust_decl}, {"neei", PRO_BOOL, false, OFF, &opt.extra_expression_indent}, {"nei", PRO_BOOL, true, OFF, &opt.else_if}, @@ -153,14 +155,12 @@ struct pro { {"npcs", PRO_BOOL, false, OFF, &opt.proc_calls_space}, {"npro", PRO_SPECIAL, 0, IGN, 0}, {"npsl", PRO_BOOL, true, OFF, &opt.procnames_start_line}, - {"nsac", PRO_BOOL, false, OFF, &opt.space_after_cast}, {"nsc", PRO_BOOL, true, OFF, &opt.star_comment_cont}, {"nsob", PRO_BOOL, false, OFF, &opt.swallow_optional_blanklines}, {"nut", PRO_BOOL, true, OFF, &opt.use_tabs}, {"nv", PRO_BOOL, false, OFF, &opt.verbose}, {"pcs", PRO_BOOL, false, ON, &opt.proc_calls_space}, {"psl", PRO_BOOL, true, ON, &opt.procnames_start_line}, - {"sac", PRO_BOOL, false, ON, &opt.space_after_cast}, {"sc", PRO_BOOL, true, ON, &opt.star_comment_cont}, {"sob", PRO_BOOL, false, ON, &opt.swallow_optional_blanklines}, {"st", PRO_SPECIAL, 0, STDIN, 0}, Modified: head/usr.bin/indent/indent.1 ============================================================================== --- head/usr.bin/indent/indent.1 Mon Jun 11 05:28:00 2018 (r334943) +++ head/usr.bin/indent/indent.1 Mon Jun 11 05:35:57 2018 (r334944) @@ -30,7 +30,7 @@ .\" @(#)indent.1 8.1 (Berkeley) 7/1/93 .\" $FreeBSD$ .\" -.Dd June 4, 2018 +.Dd June 11, 2018 .Dt INDENT 1 .Os .Sh NAME @@ -55,6 +55,7 @@ .Op Fl \&ce | Fl nce .Op Fl \&ci Ns Ar n .Op Fl cli Ns Ar n +.Op Fl cs | Fl ncs .Op Fl d Ns Ar n .Op Fl \&di Ns Ar n .Op Fl dj | Fl ndj @@ -78,7 +79,6 @@ .Op Fl P Ns Ar file .Op Fl pcs | Fl npcs .Op Fl psl | Fl npsl -.Op Fl sac | Fl nsac .Op Fl \&sc | Fl nsc .Bk -words .Op Fl sob | Fl nsob @@ -259,6 +259,11 @@ causes case labels to be indented half a tab stop. The default is .Fl cli0 . +.It Fl cs , ncs +Control whether parenthesized type names in casts are followed by a space or +not. +The default is +.Fl ncs . .It Fl d Ns Ar n Controls the placement of comments which are not to the right of code. @@ -423,11 +428,6 @@ column 1 \- their types, if any, will be left on the p The default is .Fl psl . -.It Fl sac , nsac -Control whether parenthesized type names in casts are followed by a space or -not. -The default is -.Fl nsac . .It Fl \&sc , nsc Enables (disables) the placement of asterisks (`*'s) at the left edge of all comments. Modified: head/usr.bin/indent/tests/Makefile ============================================================================== --- head/usr.bin/indent/tests/Makefile Mon Jun 11 05:28:00 2018 (r334943) +++ head/usr.bin/indent/tests/Makefile Mon Jun 11 05:35:57 2018 (r334944) @@ -20,9 +20,9 @@ ${PACKAGE}FILES+= label.0.stdout ${PACKAGE}FILES+= label.0.pro ${PACKAGE}FILES+= list_head.0 ${PACKAGE}FILES+= list_head.0.stdout -${PACKAGE}FILES+= nsac.0 -${PACKAGE}FILES+= nsac.0.stdout -${PACKAGE}FILES+= nsac.0.pro +${PACKAGE}FILES+= ncs.0 +${PACKAGE}FILES+= ncs.0.stdout +${PACKAGE}FILES+= ncs.0.pro ${PACKAGE}FILES+= offsetof.0 ${PACKAGE}FILES+= offsetof.0.stdout ${PACKAGE}FILES+= parens.0 @@ -31,9 +31,9 @@ ${PACKAGE}FILES+= parens.0.pro ${PACKAGE}FILES+= pcs.0 ${PACKAGE}FILES+= pcs.0.stdout ${PACKAGE}FILES+= pcs.0.pro -${PACKAGE}FILES+= sac.0 -${PACKAGE}FILES+= sac.0.stdout -${PACKAGE}FILES+= sac.0.pro +${PACKAGE}FILES+= cs.0 +${PACKAGE}FILES+= cs.0.stdout +${PACKAGE}FILES+= cs.0.pro ${PACKAGE}FILES+= struct.0 ${PACKAGE}FILES+= struct.0.stdout ${PACKAGE}FILES+= surplusbad.0 Copied: head/usr.bin/indent/tests/cs.0 (from r334943, head/usr.bin/indent/tests/sac.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/indent/tests/cs.0 Mon Jun 11 05:35:57 2018 (r334944, copy of r334943, head/usr.bin/indent/tests/sac.0) @@ -0,0 +1,4 @@ +/* $FreeBSD$ */ +void t(void) { + int a = (double) 8; +} Copied and modified: head/usr.bin/indent/tests/cs.0.pro (from r334943, head/usr.bin/indent/tests/sac.0.pro) ============================================================================== --- head/usr.bin/indent/tests/sac.0.pro Mon Jun 11 05:28:00 2018 (r334943, copy source) +++ head/usr.bin/indent/tests/cs.0.pro Mon Jun 11 05:35:57 2018 (r334944) @@ -1,2 +1,2 @@ /* $FreeBSD$ */ --sac +-cs Copied: head/usr.bin/indent/tests/cs.0.stdout (from r334943, head/usr.bin/indent/tests/sac.0.stdout) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/indent/tests/cs.0.stdout Mon Jun 11 05:35:57 2018 (r334944, copy of r334943, head/usr.bin/indent/tests/sac.0.stdout) @@ -0,0 +1,6 @@ +/* $FreeBSD$ */ +void +t(void) +{ + int a = (double) 8; +} Copied: head/usr.bin/indent/tests/ncs.0 (from r334943, head/usr.bin/indent/tests/nsac.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/indent/tests/ncs.0 Mon Jun 11 05:35:57 2018 (r334944, copy of r334943, head/usr.bin/indent/tests/nsac.0) @@ -0,0 +1,4 @@ +/* $FreeBSD$ */ +void t(void) { + int a = (double) 8; +} Copied and modified: head/usr.bin/indent/tests/ncs.0.pro (from r334943, head/usr.bin/indent/tests/nsac.0.pro) ============================================================================== --- head/usr.bin/indent/tests/nsac.0.pro Mon Jun 11 05:28:00 2018 (r334943, copy source) +++ head/usr.bin/indent/tests/ncs.0.pro Mon Jun 11 05:35:57 2018 (r334944) @@ -1,2 +1,2 @@ /* $FreeBSD$ */ --nsac +-ncs Copied: head/usr.bin/indent/tests/ncs.0.stdout (from r334943, head/usr.bin/indent/tests/nsac.0.stdout) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/indent/tests/ncs.0.stdout Mon Jun 11 05:35:57 2018 (r334944, copy of r334943, head/usr.bin/indent/tests/nsac.0.stdout) @@ -0,0 +1,6 @@ +/* $FreeBSD$ */ +void +t(void) +{ + int a = (double)8; +} From owner-svn-src-head@freebsd.org Mon Jun 11 05:49:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 271F1100B095; Mon, 11 Jun 2018 05:49:03 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 5513D6F08F; Mon, 11 Jun 2018 05:49:01 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 690AA1091FF; Mon, 11 Jun 2018 15:48:53 +1000 (AEST) Date: Mon, 11 Jun 2018 15:48:52 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334928 - head/lib/libc/stdlib In-Reply-To: <201806101754.w5AHsi4r061028@repo.freebsd.org> Message-ID: <20180611141715.W1182@besplex.bde.org> References: <201806101754.w5AHsi4r061028@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=I9sVfJog c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=mDV3o1hIAAAA:8 a=WY4ZAdi-BDP5Bc_qsLIA:9 a=CjuIK1q_8ugA:10 a=_FVE-zBwftR9WsbkzFJk:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 05:49:03 -0000 On Sun, 10 Jun 2018, Konstantin Belousov wrote: > Log: > libc qsort(3): stop aliasing. > > Qsort swap code aliases the sorted array elements to ints and longs in > order to do swap by machine words. Unfortunately this breaks with the > full code optimization, e.g. LTO. > > See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83201 which seems to > reference code directly copied from libc/stdlib/qsort.c. This can be fixed without much churn or any loss of efficiency using memcpy(). However, optimization of this was silly, since he slow part of qsort() is doing many more comparisons than swaps, with relative slowness of comparisons guranteed by them being in extern functions. > Modified: head/lib/libc/stdlib/qsort.c > ============================================================================== > --- head/lib/libc/stdlib/qsort.c Sun Jun 10 16:44:18 2018 (r334927) > +++ head/lib/libc/stdlib/qsort.c Sun Jun 10 17:54:44 2018 (r334928) > @@ -43,53 +43,27 @@ typedef int cmp_t(void *, const void *, const void * > typedef int cmp_t(const void *, const void *); > #endif > static inline char *med3(char *, char *, char *, cmp_t *, void *); > -static inline void swapfunc(char *, char *, size_t, int, int); > > #define MIN(a, b) ((a) < (b) ? a : b) > > /* > * Qsort routine from Bentley & McIlroy's "Engineering a Sort Function". > */ > -#define swapcode(TYPE, parmi, parmj, n) { \ > - size_t i = (n) / sizeof (TYPE); \ > - TYPE *pi = (TYPE *) (parmi); \ > - TYPE *pj = (TYPE *) (parmj); \ > - do { \ > - TYPE t = *pi; \ > - *pi++ = *pj; \ > - *pj++ = t; \ > - } while (--i > 0); \ > -} I doubt that Bentley & McIlroy wrote this silly optimization. Change TYPE to unsigned char to fix this with minimal churn and the same pessimizations as in this commit. Change TYPE to unsigned char[sizeof(old TYPE)] and use memcpy() to assign the variables to fix this with small churn and without the pessimizations in this commit. This gives portable code back to K&R1978 + memcpy(), and is as efficient as the above when the above works. On x86, even gcc-3.3 produces a load and store for memcpy(p, q, sizeof(register_t)) when p and q are void *. Change TYPE to unsigned char[n] and use a single memcpy() without a loop to assign the variables to fix this with larger churn and with different (smaller?) pessimizations than in this commit. Setup and initialization for this method is also simpler. This uses the newfangled VLA feature, and since n is variable for qsort(), builtin memcpy() with length n doesn't work so well. > -#define SWAPINIT(TYPE, a, es) swaptype_ ## TYPE = \ > - ((char *)a - (char *)0) % sizeof(TYPE) || \ > - es % sizeof(TYPE) ? 2 : es == sizeof(TYPE) ? 0 : 1; - > static inline void > -swapfunc(char *a, char *b, size_t n, int swaptype_long, int swaptype_int) > +swapfunc(char *a, char *b, size_t es) > { > - if (swaptype_long <= 1) > - swapcode(long, a, b, n) > - else if (swaptype_int <= 1) > - swapcode(int, a, b, n) > - else > - swapcode(char, a, b, n) > + char t; > + > + do { > + t = *a; > + *a++ = *b; > + *b++ = t; > + } while (--es > 0); > } Copying bytewise asks for pessimal code. Since es is variable, the compiler can't usefully replace this by inline memcpy()'s, and it probably shouldn't bother combining the bytes either. clang actually combines the bytes and inlines the result, but doesn't inline the memcpy()s. > ... Test program: XX #include XX XX volatile char qq, rr;; XX XX static inline void XX slowswap(void *iap, void *ibp, size_t len) XX { XX unsigned char *ap, *bp, tmp; XX XX for (ap = iap, bp = ibp; len != 0; ap++, bp++, len--) { XX tmp = *ap; XX *ap = *bp; XX *bp = tmp; XX } XX } XX XX static inline void XX swap(void *ap, void *bp, int len) XX { XX unsigned char tmp[len]; XX XX memcpy(&tmp, ap, len); XX memcpy(ap, bp, len); XX memcpy(bp, &tmp, len); XX } XX XX int a, b; XX void *p, *q; XX size_t plen; XX XX void XX foo(void) XX { XX swap(&a, &b, sizeof(a)); XX swap(p, q, plen); XX } XX XX XX void XX slowfoo(void) XX { XX slowswap(&a, &b, sizeof(a)); XX slowswap(p, q, plen); XX } clang generates very good code for swap() on small fixed-size data. It inlines the memcpy()s to load-store (using AVX for larger sizes if available). clang generates not so good code for slowswap() on small fixed-sized data. It inlines the 4-byte swap of 'a' and 'b', but does this weirdly using 16-bit and 8-bit register loads and stores instead of 32-bit ones. This takes 5 loads and 5 stores but should take 2 loads and 2 stores. clang generates not so good code for swap() on unknown-size data. It just calls memcpy() from inlined swap() into foo(). clang generates sophisticated code for slowswap() on unknown-size data. (All this is in x86, mostly on amd64.) Without AVX, but with XMM, it combines the bytes into blocks of size 64, 32, ..., 1 and inlines everything. This gives enormous code which is probably slower for small sizes than simpler methods. gcc-4.2.1 generates very bad code for swap() on small fixed-size data. It doesn't inline the memcpy()s or even swap(), and the code in the extern swap() has too much setup. Similarly for unknown-size data. The first case can be fixed using __always_inline instead of inline. Using macros instead of inlines as in qsort should work too. gcc-4.2.1 generates slow code for slowswap() on small fixed-size data. It just inlines slowswap() into a bytewise loop. Similarly for unknown- size data. Bruce From owner-svn-src-head@freebsd.org Mon Jun 11 05:59:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE29D100C36D for ; Mon, 11 Jun 2018 05:59:00 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic306-2.consmr.mail.bf2.yahoo.com (sonic306-2.consmr.mail.bf2.yahoo.com [74.6.132.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 680306F7C8 for ; Mon, 11 Jun 2018 05:59:00 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: GP9UmM4VM1ntael6WHgp.HmtU9w9g6tv1ylWpCr69sI0EsRbFcxu3QPWZbg.8B1 33Tm9sNv9qy.ERJAmE7aCoc9QtLdfp5Ou0kSUC_MTiQFXzQLjPlxiUfWkuMrVgmJSHYlliFFOy6J cdn1qDDKF2tvUmxnk0hGXA6wsQsdDcSaEImhINh1qvKqqjDCLN0DxShGG5pU4m7HVWuLBdd8hkPi eDx1o7GMsc5mAX9A1D8hWmiXC.ifDI6CEZG3Sl2KjPoV18aJDF9ZLGl7Z0KurEGJGv68U2zewYEG uPziSbZVNCiR1AaXUXQCDedxmDVlgzySHLLk2QEPqJI9DT.GB_rGL34m7WLHhWNR8RsQWjBbh7o5 VlD38D8FtxQqSru0bDGw_R64dl5kXiiIpY6KzAM5kYDX66VKobILB062gDVDKVFuyiSuGfZAeHC. Yo0UdKCHL1PCVEs8Ykhnh5JuJqGel242DOWviHHNXp972AXuUonfWv2FJW_4xnsLfuYRGySkmlW9 LHTGElTc5hdufe.8ewZwqbMDh.dAYDWta2dive5LDor2f2vhVKHOWNufisXD0_677GpyUG7AtEvY poIzWpUy9CpFuMXm7EYgoVDe0zNFz90LetGYdvC72Bpkh1sUoTI.mHEB.ErLdy2VppK9nmcGDNRH VR9myv79PZPe6hd4ZIX.ENgqiX_9RKpIdNW8FaUQCZOiGh0yubXY222MmvLyhTe5BYJwf9060AqL mV_uInIjzjvoOjYNHqUfDSvtxE6E0shkaxQTQpsDsNvWh.HDV5OczRNovnyc_bB2lKh2SDgPIJsc 6JnugLGiDLa42y_KGExEqqSU9qIRpnFN26YeTTFjXJC55PUhtYLCKghfeh6j_3J5CJ4oZuuQ4uzn 33drtayVa4btIJUB1t2Q2JwgiGyZRpzbMp4H4CvVElWkR5EHHE8aJ3LvXCSF9SmGwTX7zRvjxuTp BNZ3fKg-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.bf2.yahoo.com with HTTP; Mon, 11 Jun 2018 05:58:54 +0000 Received: from ip70-189-131-151.lv.lv.cox.net (EHLO [192.168.0.109]) ([70.189.131.151]) by smtp408.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 69bdff0c7992474e3ccd1d4cec099893; Mon, 11 Jun 2018 05:48:47 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Subject: Re: svn commit: r334941 - head/usr.bin/top Message-Id: <28144794-1F92-4F0F-8D8C-A5AB7BA75CE2@yahoo.com> Date: Sun, 10 Jun 2018 22:48:45 -0700 To: Eitan Adler , svn-src-head@freebsd.org X-Mailer: Apple Mail (2.3445.8.2) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 05:59:00 -0000 Eitan Adler eadler at FreeBSD.org wrote on Mon Jun 11 05:05:22 UTC 2018 : . . . > - * positive numbers. If val <= 0 then digits(val) == 0. > + * non-negative numbers. If val <= 0 then digits(val) == 0. > */ > > -int > +int __pure2 > digits(int val) > { > int cnt = 0; > + if (val == 0) { > + return 1; > + } . . . The code has digits(0) == 1 but the comment says digits(0) == 0 still. (The indentation was odd in how it showed in the web browser before I copied/pasted it above.) === Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Mon Jun 11 07:57:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C384101B670; Mon, 11 Jun 2018 07:57:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0020574337; Mon, 11 Jun 2018 07:57:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D56EB18B11; Mon, 11 Jun 2018 07:57:32 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5B7vW4I088080; Mon, 11 Jun 2018 07:57:32 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5B7vWSo088079; Mon, 11 Jun 2018 07:57:32 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201806110757.w5B7vWSo088079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 11 Jun 2018 07:57:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334945 - head/sys/dev/ocs_fc X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/sys/dev/ocs_fc X-SVN-Commit-Revision: 334945 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 07:57:33 -0000 Author: dim Date: Mon Jun 11 07:57:32 2018 New Revision: 334945 URL: https://svnweb.freebsd.org/changeset/base/334945 Log: Fix build of ocs_fs with base gcc on i386 Add a few intermediate casts to uintptr_t to suppress "cast to pointer from integer of different size" warnings from gcc. Also remove a few incorrect casts. Reviewed by: ram MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D15747 Modified: head/sys/dev/ocs_fc/ocs_ioctl.c head/sys/dev/ocs_fc/ocs_sport.c Modified: head/sys/dev/ocs_fc/ocs_ioctl.c ============================================================================== --- head/sys/dev/ocs_fc/ocs_ioctl.c Mon Jun 11 05:35:57 2018 (r334944) +++ head/sys/dev/ocs_fc/ocs_ioctl.c Mon Jun 11 07:57:32 2018 (r334945) @@ -140,7 +140,7 @@ ocs_process_sli_config (ocs_t *ocs, ocs_ioctl_elxu_mbo wrobj->host_buffer_descriptor[0].u.data.buffer_address_high = ocs_addr32_hi(dma->phys); /* copy the data into the DMA buffer */ - copyin((void *)mcmd->in_addr, dma->virt, mcmd->in_bytes); + copyin((void *)(uintptr_t)mcmd->in_addr, dma->virt, mcmd->in_bytes); } break; case SLI4_OPC_COMMON_DELETE_OBJECT: @@ -169,8 +169,8 @@ ocs_process_sli_config (ocs_t *ocs, ocs_ioctl_elxu_mbo break; default: device_printf(ocs->dev, "%s: in=%p (%lld) out=%p (%lld)\n", __func__, - (void *)mcmd->in_addr, (unsigned long long)mcmd->in_bytes, - (void *)mcmd->out_addr, (unsigned long long)mcmd->out_bytes); + (void *)(uintptr_t)mcmd->in_addr, (unsigned long long)mcmd->in_bytes, + (void *)(uintptr_t)mcmd->out_addr, (unsigned long long)mcmd->out_bytes); device_printf(ocs->dev, "%s: unknown (opc=%#x)\n", __func__, req->opcode); hexdump(mcmd, mcmd->size, NULL, 0); @@ -184,7 +184,7 @@ ocs_process_sli_config (ocs_t *ocs, ocs_ioctl_elxu_mbo return ENXIO; } - copyin((void *)mcmd->in_addr, dma->virt, mcmd->in_bytes); + copyin((void *)(uintptr_t)mcmd->in_addr, dma->virt, mcmd->in_bytes); sli_config->payload.mem.address_low = ocs_addr32_lo(dma->phys); sli_config->payload.mem.address_high = ocs_addr32_hi(dma->phys); @@ -250,7 +250,7 @@ ocs_process_mbx_ioctl(ocs_t *ocs, ocs_ioctl_elxu_mbox_ if( SLI4_MBOX_COMMAND_SLI_CONFIG == ((sli4_mbox_command_header_t *)mcmd->payload)->command && mcmd->out_bytes && dma.virt) { - copyout(dma.virt, (void *)mcmd->out_addr, mcmd->out_bytes); + copyout(dma.virt, (void *)(uintptr_t)mcmd->out_addr, mcmd->out_bytes); } no_support: Modified: head/sys/dev/ocs_fc/ocs_sport.c ============================================================================== --- head/sys/dev/ocs_fc/ocs_sport.c Mon Jun 11 05:35:57 2018 (r334944) +++ head/sys/dev/ocs_fc/ocs_sport.c Mon Jun 11 07:57:32 2018 (r334945) @@ -781,7 +781,7 @@ __ocs_sport_attached(ocs_sm_ctx_t *ctx, ocs_sm_event_t case OCS_EVT_ENTER: { ocs_node_t *node; - ocs_log_debug(ocs, "[%s] SPORT attached WWPN %016llx WWNN %016llx \n", (unsigned long long)sport->display_name, + ocs_log_debug(ocs, "[%s] SPORT attached WWPN %016llx WWNN %016llx \n", sport->display_name, sport->wwpn, sport->wwnn); ocs_sport_lock(sport); ocs_list_foreach(&sport->node_list, node) { @@ -805,7 +805,7 @@ __ocs_sport_attached(ocs_sm_ctx_t *ctx, ocs_sm_event_t } case OCS_EVT_EXIT: - ocs_log_debug(ocs, "[%s] SPORT deattached WWPN %016llx WWNN %016llx \n", (unsigned long long)sport->display_name, + ocs_log_debug(ocs, "[%s] SPORT deattached WWPN %016llx WWNN %016llx \n", sport->display_name, sport->wwpn, sport->wwnn); if (sport->enable_ini) { ocs_scsi_ini_del_sport(sport); From owner-svn-src-head@freebsd.org Mon Jun 11 08:11:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62BD9101D6CA; Mon, 11 Jun 2018 08:11:36 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 18C3074EDF; Mon, 11 Jun 2018 08:11:36 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EDE5A18CF0; Mon, 11 Jun 2018 08:11:35 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5B8BZGg094959; Mon, 11 Jun 2018 08:11:35 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5B8BZmr094958; Mon, 11 Jun 2018 08:11:35 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201806110811.w5B8BZmr094958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 11 Jun 2018 08:11:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334946 - head/sys/dev/drm2/i915 X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/sys/dev/drm2/i915 X-SVN-Commit-Revision: 334946 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 08:11:36 -0000 Author: dim Date: Mon Jun 11 08:11:35 2018 New Revision: 334946 URL: https://svnweb.freebsd.org/changeset/base/334946 Log: Fix build of i915kms with base gcc Base gcc fails to compile sys/dev/drm2/i915/intel_display.c for i386, with the following -Werror warnings: cc1: warnings being treated as errors /usr/src/sys/dev/drm2/i915/intel_display.c:8884: warning: initialization from incompatible pointer type This is due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36432, which incorrectly interprets the [] as a flexible array member. Because base gcc does not have a -W flag to suppress this particular warning, it requires a rather ugly cast. To not influence any other compiler, put it in a #if/#endif block. Reviewed by: kib MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D15744 Modified: head/sys/dev/drm2/i915/intel_display.c Modified: head/sys/dev/drm2/i915/intel_display.c ============================================================================== --- head/sys/dev/drm2/i915/intel_display.c Mon Jun 11 07:57:32 2018 (r334945) +++ head/sys/dev/drm2/i915/intel_display.c Mon Jun 11 08:11:35 2018 (r334946) @@ -8872,7 +8872,15 @@ static int intel_dmi_reverse_brightness(const struct d static const struct intel_dmi_quirk intel_dmi_quirks[] = { { - .dmi_id_list = &(const struct dmi_system_id[]) { + .dmi_id_list = +#if !defined(__clang__) && !__GNUC_PREREQ__(4, 3) + /* gcc 4.2 needs an additional cast, to avoid a bogus + * "initialization from incompatible pointer type" warning. + * see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36432 + */ + (const struct dmi_system_id (*)[]) +#endif + &(const struct dmi_system_id[]) { { .callback = intel_dmi_reverse_brightness, .ident = "NCR Corporation", From owner-svn-src-head@freebsd.org Mon Jun 11 08:42:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCC3710214DD; Mon, 11 Jun 2018 08:42:04 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6EA4376789; Mon, 11 Jun 2018 08:42:04 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4FA14192E6; Mon, 11 Jun 2018 08:42:04 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5B8g4gp013346; Mon, 11 Jun 2018 08:42:04 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5B8g4we013345; Mon, 11 Jun 2018 08:42:04 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201806110842.w5B8g4we013345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 11 Jun 2018 08:42:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334947 - head/sys/modules X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/sys/modules X-SVN-Commit-Revision: 334947 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 08:42:04 -0000 Author: dim Date: Mon Jun 11 08:42:03 2018 New Revision: 334947 URL: https://svnweb.freebsd.org/changeset/base/334947 Log: Disable building aesni with base gcc Because base gcc does not support the required intrinsics, do not attempt to compile the aesni module with it. Noticed by: Dan Allen MFC after: 3 days Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Jun 11 08:11:35 2018 (r334946) +++ head/sys/modules/Makefile Mon Jun 11 08:42:03 2018 (r334947) @@ -627,7 +627,9 @@ _aac= aac _aacraid= aacraid _acpi= acpi .if ${MK_CRYPT} != "no" || defined(ALL_MODULES) +.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} > 40201 _aesni= aesni +.endif .endif _amd_ecc_inject=amd_ecc_inject _amdsbwd= amdsbwd From owner-svn-src-head@freebsd.org Mon Jun 11 09:22:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 568761005134; Mon, 11 Jun 2018 09:22:42 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C517378E36; Mon, 11 Jun 2018 09:22:41 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTP id w5B9MUJb001691; Mon, 11 Jun 2018 12:22:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w5B9MUJb001691 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w5B9MUQD001690; Mon, 11 Jun 2018 12:22:30 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 11 Jun 2018 12:22:30 +0300 From: Konstantin Belousov To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334928 - head/lib/libc/stdlib Message-ID: <20180611092230.GB1939@kib.kiev.ua> References: <201806101754.w5AHsi4r061028@repo.freebsd.org> <20180611141715.W1182@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180611141715.W1182@besplex.bde.org> User-Agent: Mutt/1.10.0 (2018-05-17) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 09:22:42 -0000 On Mon, Jun 11, 2018 at 03:48:52PM +1000, Bruce Evans wrote: > Change TYPE to unsigned char[sizeof(old TYPE)] and use memcpy() to assign > the variables to fix this with small churn and without the pessimizations > in this commit. This gives portable code back to K&R1978 + memcpy(), and > is as efficient as the above when the above works. On x86, even gcc-3.3 > produces a load and store for memcpy(p, q, sizeof(register_t)) when p and > q are void *. > > Change TYPE to unsigned char[n] and use a single memcpy() without a loop > to assign the variables to fix this with larger churn and with different > (smaller?) pessimizations than in this commit. Setup and initialization > for this method is also simpler. This uses the newfangled VLA feature, > and since n is variable for qsort(), builtin memcpy() with length n > doesn't work so well. Either results in the unacceptable stack use. I can limit the char[es] and memcpy to some value of es, but I do not see a point. I will not object if somebody decides to do it. From owner-svn-src-head@freebsd.org Mon Jun 11 10:08:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 784CE100B3F2; Mon, 11 Jun 2018 10:08:23 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 28C187B09C; Mon, 11 Jun 2018 10:08:23 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A0C01A00C; Mon, 11 Jun 2018 10:08:23 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5BA8Mfb055659; Mon, 11 Jun 2018 10:08:22 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5BA8MGY055658; Mon, 11 Jun 2018 10:08:22 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201806111008.w5BA8MGY055658@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 11 Jun 2018 10:08:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334948 - head/sys/dev/bxe X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/sys/dev/bxe X-SVN-Commit-Revision: 334948 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 10:08:23 -0000 Author: dim Date: Mon Jun 11 10:08:22 2018 New Revision: 334948 URL: https://svnweb.freebsd.org/changeset/base/334948 Log: Fix build of bxe with base gcc on i386 Casting from rman_res_t to a pointer results in "cast to pointer from integer of different size" warnings with base gcc on i386, so print these without casting. The kva field of struct bxe_bar is of type vm_offset_t, which can be 32 or 64 bit, so cast it to uintmax_t before printing. Reviewed by: markj MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D15733 Modified: head/sys/dev/bxe/bxe.c Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Mon Jun 11 08:42:03 2018 (r334947) +++ head/sys/dev/bxe/bxe.c Mon Jun 11 10:08:22 2018 (r334948) @@ -12849,12 +12849,12 @@ bxe_allocate_bars(struct bxe_softc *sc) sc->bar[i].handle = rman_get_bushandle(sc->bar[i].resource); sc->bar[i].kva = (vm_offset_t)rman_get_virtual(sc->bar[i].resource); - BLOGI(sc, "PCI BAR%d [%02x] memory allocated: %p-%p (%jd) -> %p\n", + BLOGI(sc, "PCI BAR%d [%02x] memory allocated: %#jx-%#jx (%jd) -> %#jx\n", i, PCIR_BAR(i), - (void *)rman_get_start(sc->bar[i].resource), - (void *)rman_get_end(sc->bar[i].resource), + rman_get_start(sc->bar[i].resource), + rman_get_end(sc->bar[i].resource), rman_get_size(sc->bar[i].resource), - (void *)sc->bar[i].kva); + (uintmax_t)sc->bar[i].kva); } return (0); From owner-svn-src-head@freebsd.org Mon Jun 11 11:16:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 785C510143B4; Mon, 11 Jun 2018 11:16:56 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 8DC767E7FA; Mon, 11 Jun 2018 11:16:54 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 070D0105FD1; Mon, 11 Jun 2018 21:16:52 +1000 (AEST) Date: Mon, 11 Jun 2018 21:16:51 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334928 - head/lib/libc/stdlib In-Reply-To: <20180611092230.GB1939@kib.kiev.ua> Message-ID: <20180611193811.M1292@besplex.bde.org> References: <201806101754.w5AHsi4r061028@repo.freebsd.org> <20180611141715.W1182@besplex.bde.org> <20180611092230.GB1939@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=cIaQihWN c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=4WncY0STsJbJ7bl2gfEA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 11:16:56 -0000 On Mon, 11 Jun 2018, Konstantin Belousov wrote: > On Mon, Jun 11, 2018 at 03:48:52PM +1000, Bruce Evans wrote: >> Change TYPE to unsigned char[sizeof(old TYPE)] and use memcpy() to assign >> the variables to fix this with small churn and without the pessimizations >> in this commit. This gives portable code back to K&R1978 + memcpy(), and >> is as efficient as the above when the above works. On x86, even gcc-3.3 >> produces a load and store for memcpy(p, q, sizeof(register_t)) when p and >> q are void *. >> >> Change TYPE to unsigned char[n] and use a single memcpy() without a loop >> to assign the variables to fix this with larger churn and with different >> (smaller?) pessimizations than in this commit. Setup and initialization >> for this method is also simpler. This uses the newfangled VLA feature, >> and since n is variable for qsort(), builtin memcpy() with length n >> doesn't work so well. > Either results in the unacceptable stack use. 'unsigned char[sizeof(old TYPE)]' uses no memory and thus no stack provided memcpy() is optimized to register moves. Similarly for 'unsigned char[n]', except this might be harder to optimize. If it uses memory, then it wasn't optimized to register moves. n must be split up into blocks that fit in registers, just like the reverse of what clang does now for combining byte-sized moves into larger blocks that fit in registers. Any source code may result in unacceptable stack usage if the compiler optimizations aren't quite right. The compiler should do something like combining assignments of small objects to assignments of objects of size n; then reblock to fit this in registers. When this is not done right, parts that don't fit in registers might be spilled to the stack, and when this is done wrong the spill size might be nearly n or even larger. In my example, clang and gcc-4.2.1 get the optimization with the VLA wrong by putting the VLA on the stack and not doing any reblocking; clang doesn't use any stack when it generates large code to reblock the byte assignments (except when it uses AVX, signal handlers use more stack). > I can limit the char[es] and memcpy to some value of es, but I do not > see a point. I will not object if somebody decides to do it. The old code reblocked es into smaller objects and got the type punning for this wrong. I checked the speed of qsort(). It is O(n*log(n)) for both swaps and comparisons. Howver, I think most uses of it have small elements, since for large data the elements should be keys or pointers to avoid swapping the data. The old version is almost optimal for swapping pointers. clang's sophisticted reblocking of byte swaps is really bad for swapping pointers: on amd64: XX movq plen(%rip), %r10 XX testq %r10, %r10 XX je .LBB2_18 plen is 8, so don't branch. XX # %bb.1: # %for.body.lr.ph.i XX movq q(%rip), %rcx XX movq p(%rip), %rdx XX cmpq $32, %r10 XX jb .LBB2_12 plen is < 32, so branch. XX .... XX .LBB2_12: # %for.body.i8.preheader XX leaq -1(%r10), %rsi XX movq %r10, %rdi XX andq $3, %rdi XX je .LBB2_15 plen is 0 mod 4, so branch. XX ... XX .LBB2_15: # %for.body.i8.prol.loopexit XX cmpq $3, %rsi XX jb .LBB2_18 plen - 1 is not below 3, so don't branch. XX # %bb.16: # %for.body.i8.preheader.new XX xorl %esi, %esi XX .p2align 4, 0x90 XX .LBB2_17: # %for.body.i8 XX # =>This Inner Loop Header: Depth=1 XX movzbl (%rdx,%rsi), %edi XX movzbl (%rcx,%rsi), %eax XX movb %al, (%rdx,%rsi) XX movb %dil, (%rcx,%rsi) XX movzbl 1(%rdx,%rsi), %edi XX movzbl 1(%rcx,%rsi), %eax XX movb %al, 1(%rdx,%rsi) XX movb %dil, 1(%rcx,%rsi) XX movzbl 2(%rdx,%rsi), %edi XX movzbl 2(%rcx,%rsi), %eax XX movb %al, 2(%rdx,%rsi) XX movb %dil, 2(%rcx,%rsi) XX movzbl 3(%rdx,%rsi), %edi XX movzbl 3(%rcx,%rsi), %eax XX movb %al, 3(%rdx,%rsi) XX movb %dil, 3(%rcx,%rsi) XX addq $4, %rsi End swapping copying a byte at a time after all. Swap 4 bytes per iteration. XX cmpq %rsi, %r10 XX jne .LBB2_17 Iterate twice for the 8 byte pointer. All this instead of 2 loads and 2 stores that the old code might have generated. Since es is not always 8, the old code must generate more than 2 loads and 2 stores -- it will have to reblock using similar branches to the above. It only uses 2 block sizes (sizeof(long) and 1), but the compiler might pessimize this to the same as the above. clang actually generates enormous^2 code with the current version and enormous^3 code with the previous version. For the current version, 1742 lines, with 192 lines for just movups instructions. For the previous version, it generates 4823 lines with 576 movups instructions. gcc -O2 generates 619 lines for the current version and 1053 lines for the previous version. So I don't mind the simplification. It would take lots of __predict_ugly() annotations to prevent unrolling that pessimizes the usual case. Bruce From owner-svn-src-head@freebsd.org Mon Jun 11 13:36:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78A1210042E4; Mon, 11 Jun 2018 13:36:47 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1DC5285E13; Mon, 11 Jun 2018 13:36:47 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [64.201.244.132] (port=49679 helo=[10.0.0.112]) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1fSE3F-0004yQ-8k; Mon, 11 Jun 2018 04:03:29 +0000 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r334939 - head/stand/lua From: Devin Teske X-Mailer: iPhone Mail (15D60) In-Reply-To: <201806110132.w5B1WI5d094546@repo.freebsd.org> Date: Mon, 11 Jun 2018 06:36:38 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201806110132.w5B1WI5d094546@repo.freebsd.org> To: Kyle Evans Sender: devin@shxd.cx X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 13:36:47 -0000 > On Jun 10, 2018, at 6:32 PM, Kyle Evans wrote: >=20 > Author: kevans > Date: Mon Jun 11 01:32:18 2018 > New Revision: 334939 > URL: https://svnweb.freebsd.org/changeset/base/334939 >=20 > Log: > lualoader: Allow brand-*.lua for adding new brands >=20 > dteske@, I believe, had originally pointed out that lualoader failed to > allow logo-*.lua for new logos to be added. When correcting this mistake,= I > failed to do the same for brands. >=20 You=E2=80=99re doing an amazing job, Kyle. I continually see nothing but genuine effort toward feature parity which mak= es me think one day I can pass the reigns. Yeah, I will always love Forth. It will always hold a special place in my he= art as that whacky language that simultaneously exudes great power while als= o having the image ability to induce vomiting =F0=9F=A4=AE by the uninitiate= d. However, all that being said, I=E2=80=99d actually like to keep the Ficl boo= t stuff as an option through to 14.0 and here is why ... Last year we were looking to update from ficl3 to ficl4. That may not sound t= oo exciting to most folks, but most folks don=E2=80=99t know the power that f= icl4 brings =E2=80=94 like the capability to use full networking in the load= er! Can lua do that? How cool would it be to be able to communicate with the= network from the loader before the kernel is even loaded into memory? I had= a few hair-brained schemes left for Forth which might be exciting, lol Anywho, keep up the great work. I love it and support you all the way. =E2=80=94=20 Devin= From owner-svn-src-head@freebsd.org Mon Jun 11 14:07:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 051251007826 for ; Mon, 11 Jun 2018 14:07:26 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x243.google.com (mail-it0-x243.google.com [IPv6:2607:f8b0:4001:c0b::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 966AD870B2 for ; Mon, 11 Jun 2018 14:07:25 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x243.google.com with SMTP id a195-v6so10463483itd.3 for ; Mon, 11 Jun 2018 07:07:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=m656pQOi2Nx0jQ4VcPhx+2GNQdwM8mYYgZfBrvBcdQc=; b=cbo2zB2zQBIGw3sBbJkdLQgWjdMwrGkPHlYfUBS7z9OAl9kKxTw40qyiAuPTxJ8dyf LMqibc6FTU3U0Qnl8n8vzb16HL2iStsTV6eidtbmJDJd3t6dnu8n39M4CQjmL+aAwRy2 EERFLqoUUvOhTpoUEezbxIgeylF9PfDhno0HaeY2YWVPQh5uYjArbTwm7b1mxT68QMEU MPfJQ7LtHfvkp0RomCl9NrKD0u3tkrgPvLr7+TPP1HYt7jz7HwfBuZHp7EAsU9GYSUew yzxEO88U0c+lWS0Lqse34HpITugOs/qW5hgcceUdyFjbhYMXr9nDXzWeug7n3Nya/W3h SieA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=m656pQOi2Nx0jQ4VcPhx+2GNQdwM8mYYgZfBrvBcdQc=; b=JgHXA4VYCkwm1d0vqreZSi8DnS+9pw4iyOwnJSTGeHxbV4GrzULnumKt735fRl+gDv TgcqFZaUxQaRHqPC+mTUXRAlwfojUTy4xfTx5Xv2ekr9vdb4+2dBKwA6HBGi21U6jHcT FG+R3cGhg3yaySjp+BPq407i+KEoCT087T3t3p3FGZOM1pv4CX4svZ0kCqf1LFvuD6uN okEC7dUevF9OhxVxOSLCcWDiHLg98J6XoPhSoQ/tAJIu6QojZcB7I7HMoR/zoqOAMNrt 6VLYmASWKKDcLDsxJS651BpBfT4Dd7b/Z2sBlxwaflGFp2MMEfVJ8YirgiH0zZFukz2+ Zm+A== X-Gm-Message-State: APt69E3jIQvD0Vtg6eA0/2SGv3eRnlL+KBRR/ByhOhFA1VzwNwAzOguL 94l0dyTMnY1AY5S+vWy6INbeLb/ZJVNouo1l45PE3w== X-Google-Smtp-Source: ADUXVKKLxgqG4XvdR2NWHucV53nE5L0XXFG3lwAz0MWU+LLYvljJosUBABFiLW167SoxIq3GZtrF5X71m0eSUkXq5IM= X-Received: by 2002:a24:7c8d:: with SMTP id a135-v6mr10513504itd.73.1528726044634; Mon, 11 Jun 2018 07:07:24 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:d028:0:0:0:0:0 with HTTP; Mon, 11 Jun 2018 07:07:23 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: References: <201806110132.w5B1WI5d094546@repo.freebsd.org> From: Warner Losh Date: Mon, 11 Jun 2018 08:07:23 -0600 X-Google-Sender-Auth: -Z0l0BK8O8JRT4hqR22MTA09SGI Message-ID: Subject: Re: svn commit: r334939 - head/stand/lua To: Devin Teske Cc: Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 14:07:26 -0000 On Mon, Jun 11, 2018 at 7:36 AM, Devin Teske wrote: > > > > On Jun 10, 2018, at 6:32 PM, Kyle Evans wrote: > > > > Author: kevans > > Date: Mon Jun 11 01:32:18 2018 > > New Revision: 334939 > > URL: https://svnweb.freebsd.org/changeset/base/334939 > > > > Log: > > lualoader: Allow brand-*.lua for adding new brands > > > > dteske@, I believe, had originally pointed out that lualoader failed t= o > > allow logo-*.lua for new logos to be added. When correcting this > mistake, I > > failed to do the same for brands. > > > > You=E2=80=99re doing an amazing job, Kyle. > > I continually see nothing but genuine effort toward feature parity which > makes me think one day I can pass the reigns. > > Yeah, I will always love Forth. It will always hold a special place in my > heart as that whacky language that simultaneously exudes great power whil= e > also having the image ability to induce vomiting =F0=9F=A4=AE by the unin= itiated. > > However, all that being said, I=E2=80=99d actually like to keep the Ficl = boot > stuff as an option through to 14.0 and here is why ... > > Last year we were looking to update from ficl3 to ficl4. That may not > sound too exciting to most folks, but most folks don=E2=80=99t know the p= ower that > ficl4 brings =E2=80=94 like the capability to use full networking in the = loader! > Can lua do that? How cool would it be to be able to communicate with the > network from the loader before the kernel is even loaded into memory? I h= ad > a few hair-brained schemes left for Forth which might be exciting, lol > The current boot loader can already communicate via NFS or TFTP today. Adding http would be easy, https would be harder due to crypto being huge and space being small (though bear ssl might be small enough). The last articulated plan in arch@ was that LUA will be default in 12, and we plan to remove FORTH in 13. Last time I said it there in February, there was only email agreeing that I could find. This matches the in-person consensus poll I took at BSDcan as well. I think it would take a very extraordinary set circumstance and severe problems with LUA to change those plans. Warner From owner-svn-src-head@freebsd.org Mon Jun 11 14:27:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A485F10097AF; Mon, 11 Jun 2018 14:27:20 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A05887EB1; Mon, 11 Jun 2018 14:27:20 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B43C1C9F7; Mon, 11 Jun 2018 14:27:20 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5BERK6q087202; Mon, 11 Jun 2018 14:27:20 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5BERJL6087200; Mon, 11 Jun 2018 14:27:19 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201806111427.w5BERJL6087200@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Mon, 11 Jun 2018 14:27:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334949 - in head/sys/netinet: . tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: in head/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 334949 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 14:27:20 -0000 Author: jtl Date: Mon Jun 11 14:27:19 2018 New Revision: 334949 URL: https://svnweb.freebsd.org/changeset/base/334949 Log: Change RACK dependency on TCPHPTS from a build-time dependency to a load- time dependency. At present, RACK requires the TCPHPTS option to run. However, because modules can be moved from machine to machine, this dependency is really best assessed at load time rather than at build time. Reviewed by: rrs Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D15756 Modified: head/sys/netinet/tcp_hpts.c head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_hpts.c ============================================================================== --- head/sys/netinet/tcp_hpts.c Mon Jun 11 10:08:22 2018 (r334948) +++ head/sys/netinet/tcp_hpts.c Mon Jun 11 14:27:19 2018 (r334949) @@ -1960,3 +1960,4 @@ tcp_init_hptsi(void *st) } SYSINIT(tcphptsi, SI_SUB_KTHREAD_IDLE, SI_ORDER_ANY, tcp_init_hptsi, NULL); +MODULE_VERSION(tcphpts, 1); Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Mon Jun 11 10:08:22 2018 (r334948) +++ head/sys/netinet/tcp_stacks/rack.c Mon Jun 11 14:27:19 2018 (r334949) @@ -127,10 +127,6 @@ uma_zone_t rack_pcb_zone; struct sysctl_ctx_list rack_sysctl_ctx; struct sysctl_oid *rack_sysctl_root; -#ifndef TCPHPTS -fatal error missing option TCPHSTS in the build; -#endif - #define CUM_ACKED 1 #define SACKED 2 @@ -9162,3 +9158,4 @@ static moduledata_t tcp_rack = { MODULE_VERSION(MODNAME, 1); DECLARE_MODULE(MODNAME, tcp_rack, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY); +MODULE_DEPEND(MODNAME, tcphpts, 1, 1, 1); From owner-svn-src-head@freebsd.org Mon Jun 11 14:45:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB377100BC5C; Mon, 11 Jun 2018 14:45:35 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D796690D7; Mon, 11 Jun 2018 14:45:35 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4F5CE1CD72; Mon, 11 Jun 2018 14:45:35 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5BEjZbZ097451; Mon, 11 Jun 2018 14:45:35 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5BEjZT8097450; Mon, 11 Jun 2018 14:45:35 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201806111445.w5BEjZT8097450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 11 Jun 2018 14:45:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334950 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 334950 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 14:45:36 -0000 Author: pfg Date: Mon Jun 11 14:45:34 2018 New Revision: 334950 URL: https://svnweb.freebsd.org/changeset/base/334950 Log: style(9): Fix tabs after #define. No functional change intended. Modified: head/usr.sbin/bhyve/pci_virtio_scsi.c Modified: head/usr.sbin/bhyve/pci_virtio_scsi.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_scsi.c Mon Jun 11 14:27:19 2018 (r334949) +++ head/usr.sbin/bhyve/pci_virtio_scsi.c Mon Jun 11 14:45:34 2018 (r334950) @@ -77,17 +77,17 @@ __FBSDID("$FreeBSD$"); #define VTSCSI_OUT_HEADER_LEN(_sc) \ (sizeof(struct pci_vtscsi_req_cmd_wr) + _sc->vss_config.sense_size) -#define VIRTIO_SCSI_MAX_CHANNEL 0 -#define VIRTIO_SCSI_MAX_TARGET 0 -#define VIRTIO_SCSI_MAX_LUN 16383 +#define VIRTIO_SCSI_MAX_CHANNEL 0 +#define VIRTIO_SCSI_MAX_TARGET 0 +#define VIRTIO_SCSI_MAX_LUN 16383 #define VIRTIO_SCSI_F_INOUT (1 << 0) #define VIRTIO_SCSI_F_HOTPLUG (1 << 1) #define VIRTIO_SCSI_F_CHANGE (1 << 2) static int pci_vtscsi_debug = 0; -#define DPRINTF(params) if (pci_vtscsi_debug) printf params -#define WPRINTF(params) printf params +#define DPRINTF(params) if (pci_vtscsi_debug) printf params +#define WPRINTF(params) printf params struct pci_vtscsi_config { uint32_t num_queues; @@ -108,7 +108,7 @@ struct pci_vtscsi_queue { int vsq_ctl_fd; pthread_mutex_t vsq_mtx; pthread_mutex_t vsq_qmtx; - pthread_cond_t vsq_cv; + pthread_cond_t vsq_cv; STAILQ_HEAD(, pci_vtscsi_request) vsq_requests; LIST_HEAD(, pci_vtscsi_worker) vsq_workers; }; @@ -117,7 +117,7 @@ struct pci_vtscsi_worker { struct pci_vtscsi_queue * vsw_queue; pthread_t vsw_thread; bool vsw_exiting; - LIST_ENTRY(pci_vtscsi_worker) vsw_link; + LIST_ENTRY(pci_vtscsi_worker) vsw_link; }; struct pci_vtscsi_request { @@ -144,20 +144,20 @@ struct pci_vtscsi_softc { struct pci_vtscsi_config vss_config; }; -#define VIRTIO_SCSI_T_TMF 0 -#define VIRTIO_SCSI_T_TMF_ABORT_TASK 0 -#define VIRTIO_SCSI_T_TMF_ABORT_TASK_SET 1 -#define VIRTIO_SCSI_T_TMF_CLEAR_ACA 2 -#define VIRTIO_SCSI_T_TMF_CLEAR_TASK_SET 3 -#define VIRTIO_SCSI_T_TMF_I_T_NEXUS_RESET 4 -#define VIRTIO_SCSI_T_TMF_LOGICAL_UNIT_RESET 5 -#define VIRTIO_SCSI_T_TMF_QUERY_TASK 6 -#define VIRTIO_SCSI_T_TMF_QUERY_TASK_SET 7 +#define VIRTIO_SCSI_T_TMF 0 +#define VIRTIO_SCSI_T_TMF_ABORT_TASK 0 +#define VIRTIO_SCSI_T_TMF_ABORT_TASK_SET 1 +#define VIRTIO_SCSI_T_TMF_CLEAR_ACA 2 +#define VIRTIO_SCSI_T_TMF_CLEAR_TASK_SET 3 +#define VIRTIO_SCSI_T_TMF_I_T_NEXUS_RESET 4 +#define VIRTIO_SCSI_T_TMF_LOGICAL_UNIT_RESET 5 +#define VIRTIO_SCSI_T_TMF_QUERY_TASK 6 +#define VIRTIO_SCSI_T_TMF_QUERY_TASK_SET 7 /* command-specific response values */ -#define VIRTIO_SCSI_S_FUNCTION_COMPLETE 0 -#define VIRTIO_SCSI_S_FUNCTION_SUCCEEDED 10 -#define VIRTIO_SCSI_S_FUNCTION_REJECTED 11 +#define VIRTIO_SCSI_S_FUNCTION_COMPLETE 0 +#define VIRTIO_SCSI_S_FUNCTION_SUCCEEDED 10 +#define VIRTIO_SCSI_S_FUNCTION_REJECTED 11 struct pci_vtscsi_ctrl_tmf { uint32_t type; @@ -167,13 +167,13 @@ struct pci_vtscsi_ctrl_tmf { uint8_t response; } __attribute__((packed)); -#define VIRTIO_SCSI_T_AN_QUERY 1 -#define VIRTIO_SCSI_EVT_ASYNC_OPERATIONAL_CHANGE 2 -#define VIRTIO_SCSI_EVT_ASYNC_POWER_MGMT 4 -#define VIRTIO_SCSI_EVT_ASYNC_EXTERNAL_REQUEST 8 -#define VIRTIO_SCSI_EVT_ASYNC_MEDIA_CHANGE 16 -#define VIRTIO_SCSI_EVT_ASYNC_MULTI_HOST 32 -#define VIRTIO_SCSI_EVT_ASYNC_DEVICE_BUSY 64 +#define VIRTIO_SCSI_T_AN_QUERY 1 +#define VIRTIO_SCSI_EVT_ASYNC_OPERATIONAL_CHANGE 2 +#define VIRTIO_SCSI_EVT_ASYNC_POWER_MGMT 4 +#define VIRTIO_SCSI_EVT_ASYNC_EXTERNAL_REQUEST 8 +#define VIRTIO_SCSI_EVT_ASYNC_MEDIA_CHANGE 16 +#define VIRTIO_SCSI_EVT_ASYNC_MULTI_HOST 32 +#define VIRTIO_SCSI_EVT_ASYNC_DEVICE_BUSY 64 struct pci_vtscsi_ctrl_an { uint32_t type; @@ -184,23 +184,23 @@ struct pci_vtscsi_ctrl_an { } __attribute__((packed)); /* command-specific response values */ -#define VIRTIO_SCSI_S_OK 0 -#define VIRTIO_SCSI_S_OVERRUN 1 -#define VIRTIO_SCSI_S_ABORTED 2 -#define VIRTIO_SCSI_S_BAD_TARGET 3 -#define VIRTIO_SCSI_S_RESET 4 -#define VIRTIO_SCSI_S_BUSY 5 -#define VIRTIO_SCSI_S_TRANSPORT_FAILURE 6 -#define VIRTIO_SCSI_S_TARGET_FAILURE 7 -#define VIRTIO_SCSI_S_NEXUS_FAILURE 8 -#define VIRTIO_SCSI_S_FAILURE 9 -#define VIRTIO_SCSI_S_INCORRECT_LUN 12 +#define VIRTIO_SCSI_S_OK 0 +#define VIRTIO_SCSI_S_OVERRUN 1 +#define VIRTIO_SCSI_S_ABORTED 2 +#define VIRTIO_SCSI_S_BAD_TARGET 3 +#define VIRTIO_SCSI_S_RESET 4 +#define VIRTIO_SCSI_S_BUSY 5 +#define VIRTIO_SCSI_S_TRANSPORT_FAILURE 6 +#define VIRTIO_SCSI_S_TARGET_FAILURE 7 +#define VIRTIO_SCSI_S_NEXUS_FAILURE 8 +#define VIRTIO_SCSI_S_FAILURE 9 +#define VIRTIO_SCSI_S_INCORRECT_LUN 12 /* task_attr */ -#define VIRTIO_SCSI_S_SIMPLE 0 -#define VIRTIO_SCSI_S_ORDERED 1 -#define VIRTIO_SCSI_S_HEAD 2 -#define VIRTIO_SCSI_S_ACA 3 +#define VIRTIO_SCSI_S_SIMPLE 0 +#define VIRTIO_SCSI_S_ORDERED 1 +#define VIRTIO_SCSI_S_HEAD 2 +#define VIRTIO_SCSI_S_ACA 3 struct pci_vtscsi_event { uint32_t event; From owner-svn-src-head@freebsd.org Mon Jun 11 14:46:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D082D100BE4D for ; Mon, 11 Jun 2018 14:46:44 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic302-21.consmr.mail.gq1.yahoo.com (sonic302-21.consmr.mail.gq1.yahoo.com [98.137.68.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 21B986927F for ; Mon, 11 Jun 2018 14:46:44 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1528728397; bh=FJeuO5l7nRtWgnVmzsk7SjDknV3iNEcMPUZ+PC/IZC0=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=fltnpo/IGoy93npaHpX0+v9Hns1b8lVc0Hdn+23g4Xu/2pRBVchTaMSVRnvVNzzXI4TkOdCCFEB/qQP2IEGKqifrwydeNwwmAZN//Y4PYBhh9FOWUZWgtRdHOHNev04ny+0bnij1BQomxq/uK/z2E9acLwtulLyLmrkbSGFTnWDqDKCGQE+Moi84ccZED+Y0o5lAVnXUt2zzaguYC/XdeCi33eac3LNUKnPq8ykzffL619jNvaLbp5dcqfe1VySzW8FR0C0CXGQEk7gaeCN91T1wpl7cZO6fd/06jQeAXrUDt7q63/G1L93XTkO+/vZXoMZlLFcseJqK89xNivkTRA== X-YMail-OSG: jhFdqcEVM1knQteNI8brzpZVPNTaa4fc2s_Vu5YHQ3AxnjkPf1mqow0iEJTMYqS zLJm6QbvgjeH.hvWHm4ISI9mtHuPuVM5_txQ3LaN8Z7Pfx5Es4ojn9Dud2UtqxEOY.EWbhULwWEZ AGqOMirsijuFuaPoirV.psPfz3PNejd5l.o_TljzQAQDhFtJkOb5TbqBQxzi41gNFY6WszFijS3m .K.mm9WNEm1HzYJpLBQkQ_xOh4W5z1Yqb77aXHeCX4sRaOSpwKkBr.lmn1FmNOhoJEUKx5orgcx7 mej1VPz3Fs_Q1efg2tbbD8w5wFxIn_Owr7kHs5AWkxjdGpoRsfdIKJp_RAbUGr.OP3CaIKfZ1KSO CLpTtxmmPDzKiBiaKkh8r4wDTJjtnyHn0FxK7BE1jg4lZW4_S1iFIcTkBh7Wj6jM5vXHmss454Fg rZEU4ng08fxwXxGfq3ve8SgPon7e0YvroY1d.ux67_o1GeWcpA00ZG5cHQFrMlt8bGE_EPKwL85l 9aFQwI4Cy6ni7t1VxQfm4l8hDDcQcscpTDdusgmaTVULw2jQePdy.itI0wuS7zcBnoQDD2zbFJa1 8AacwQjQ89jmrmpn1inG0jWXNaQuf2tlBIwGVHuOmHbz5SkxkVsNZ2iCWzStwBVS9qvvrN5L.KTG JzEaSEpW4KBFaSWPF9o7ucS7LN.OE.i1DeGZQVYQ4jnhxjMoW34PGE.u9w0T_zI32OzKbmd3UzyN dKhedVtIu0SnfxtvvMDRu0.x3GcbO_dkn3FSyov56WiN54YccL5N5J9cfoYTaCnBlZhqPEDOEP2o mOd7xdyPVu7bZwZGMiIJhUh5i3b004kOClYfoCSRka25XPOT9Zlvnt6FGCHyhfuEVNpfFYtahu6D BN43G_z5jD7vEDBsU1YOvRh5ys_tkzfpocdl_HlG7wRMDiXsNzzE_8HiovlUFmagiNSyA0710BaS B Received: from sonic.gate.mail.ne1.yahoo.com by sonic302.consmr.mail.gq1.yahoo.com with HTTP; Mon, 11 Jun 2018 14:46:37 +0000 Received: from 181.52.72.201 (EHLO [192.168.0.6]) ([181.52.72.201]) by smtp412.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID aa31224a24712d5f9c785a48a04b7004; Mon, 11 Jun 2018 14:46:35 +0000 (UTC) Subject: Re: svn commit: r334940 - head/usr.sbin/bhyve To: araujo@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201806110209.w5B29Lni010557@repo.freebsd.org> From: Pedro Giffuni Message-ID: <2b5f4141-51c8-edfa-43ad-d55d52666e7b@FreeBSD.org> Date: Mon, 11 Jun 2018 09:46:36 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 14:46:45 -0000 On 06/10/18 21:41, Marcelo Araujo wrote: > > > 2018-06-11 10:25 GMT+08:00 Pedro Giffuni >: > > > > On 10/06/2018 21:09, Marcelo Araujo wrote: > > Author: araujo > Date: Mon Jun 11 02:09:20 2018 > New Revision: 334940 > URL: https://svnweb.freebsd.org/changeset/base/334940 > > > Log: >    - Add bhyve virtio-scsi storage backend support. >       Example of configuration: >    ctl.conf: >    portal-group pg0 { >            discovery-auth-group no-authentication >            listen 0.0.0.0 >            listen [::] >    } >       target iqn.2012-06.com.example:target0 { >            auth-group no-authentication >            portal-group pg0 >            port ioctl/5/3 >               lun 0 { >                    path /z/test.img >                    size 8G >            } >            lun 1 { >                    path /z/test1.img >                    size 8G >            } >    } >       bhyve <...> -s 4,virtio-scsi,/dev/cam/ctl5.3,iid=3 >       From inside guest: >    root@:~ # zpool status test >      pool: test >     state: ONLINE >      scan: none requested >    config: >               NAME        STATE     READ WRITE CKSUM >            test        ONLINE       0     0     0 >              da0       ONLINE       0     0     0 >              da1       ONLINE       0     0     0 >       dmesg: >    da0 at vtscsi0 bus 0 scbus0 target 0 lun 0 >    da0: Fixed Direct Access SPC-5 SCSI > device >    da0: Serial Number MYSERIAL0000 >    da0: 300.000MB/s transfers >    da0: Command Queueing enabled >    da0: 8192MB (16777216 512 byte sectors) >    da1 at vtscsi0 bus 0 scbus0 target 0 lun 1 >    da1: Fixed Direct Access SPC-5 SCSI > device >    da1: Serial Number MYSERIAL0001 >    da1: 300.000MB/s transfers >    da1: Command Queueing enabled >    da1: 8192MB (16777216 512 byte sectors) >       Discussed with:           grehan >    Reviewed by:         mav >    Obtained from:               TrueOS >    Relnotes:            Yes >    Sponsored by:                iXsystems Inc. >    Tested with:         FreeBSD HEAD, Fedora 28 (Workstation) and >                         Ubuntu 18.04. >    Differential Revision: https://reviews.freebsd.org/D15276 > > > Added: >    head/usr.sbin/bhyve/iov.c   (contents, props changed) >    head/usr.sbin/bhyve/iov.h   (contents, props changed) >    head/usr.sbin/bhyve/pci_virtio_scsi.c  (contents, props > changed) > Modified: >    head/usr.sbin/bhyve/Makefile >    head/usr.sbin/bhyve/bhyve.8 >    head/usr.sbin/bhyve/virtio.h > > ... > > > Added: head/usr.sbin/bhyve/pci_virtio_scsi.c > ============================================================================== > --- /dev/null   00:00:00 1970   (empty, because file is newly > added) > +++ head/usr.sbin/bhyve/pci_virtio_scsi.c  Mon Jun 11 02:09:20 > 2018        (r334940) > @@ -0,0 +1,718 @@ > +/*- > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > + * > + * Copyright (c) 2016 Jakub Klama . > + * Copyright (c) 2018 Marcelo Araujo . > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or > without > + * modification, are permitted provided that the following > conditions > + * are met: > + * 1. Redistributions of source code must retain the above > copyright > + *    notice, this list of conditions and the following > disclaimer > + *    in this position and unchanged. > + * 2. Redistributions in binary form must reproduce the above > copyright > + *    notice, this list of conditions and the following > disclaimer in the > + *    documentation and/or other materials provided with the > distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS > ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT > LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A > PARTICULAR PURPOSE > + * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR > CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, > OR CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF > SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS > INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN > CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) > ARISING IN ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE > POSSIBILITY OF > + * SUCH DAMAGE. > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include "bhyverun.h" > +#include "pci_emul.h" > +#include "virtio.h" > +#include "iov.h" > + > +#define VTSCSI_RINGSZ          64 > +#define        VTSCSI_REQUESTQ         1 > +#define        VTSCSI_THR_PER_Q        16 > +#define        VTSCSI_MAXQ  (VTSCSI_REQUESTQ + 2) > +#define        VTSCSI_MAXSEG           64 > + > +#define        VTSCSI_IN_HEADER_LEN(_sc)       \ > +       (sizeof(struct pci_vtscsi_req_cmd_rd) + > _sc->vss_config.cdb_size) > + > +#define        VTSCSI_OUT_HEADER_LEN(_sc)      \ > +       (sizeof(struct pci_vtscsi_req_cmd_wr) + > _sc->vss_config.sense_size) > + > +#define VIRTIO_SCSI_MAX_CHANNEL 0 > +#define VIRTIO_SCSI_MAX_TARGET  0 > +#define VIRTIO_SCSI_MAX_LUN     16383 > + > +#define        VIRTIO_SCSI_F_INOUT     (1 << 0) > +#define        VIRTIO_SCSI_F_HOTPLUG   (1 << 1) > +#define        VIRTIO_SCSI_F_CHANGE    (1 << 2) > + > > TABS missing inconsistently after #define above ... > > > +static int pci_vtscsi_debug = 0; > +#define DPRINTF(params) if (pci_vtscsi_debug) printf params > +#define WPRINTF(params) printf params > + > +struct pci_vtscsi_config { > +       uint32_t num_queues; > +       uint32_t seg_max; > +       uint32_t max_sectors; > +       uint32_t cmd_per_lun; > +       uint32_t event_info_size; > +       uint32_t sense_size; > +       uint32_t cdb_size; > +       uint16_t max_channel; > +       uint16_t max_target; > +       uint32_t max_lun; > +} __attribute__((packed)); > + > +struct pci_vtscsi_queue { > +       struct pci_vtscsi_softc *         vsq_sc; > +       struct vqueue_info *              vsq_vq; > +       int  vsq_ctl_fd; > +       pthread_mutex_t                   vsq_mtx; > +       pthread_mutex_t                   vsq_qmtx; > +        pthread_cond_t                    vsq_cv; > +       STAILQ_HEAD(, pci_vtscsi_request) vsq_requests; > +       LIST_HEAD(, pci_vtscsi_worker) vsq_workers; > +}; > + > +struct pci_vtscsi_worker { > +       struct pci_vtscsi_queue *     vsw_queue; > +       pthread_t                     vsw_thread; > +       bool                          vsw_exiting; > +        LIST_ENTRY(pci_vtscsi_worker) vsw_link; > +}; > + > +struct pci_vtscsi_request { > +       struct pci_vtscsi_queue * vsr_queue; > +       struct iovec vsr_iov_in[VTSCSI_MAXSEG]; > +       int                       vsr_niov_in; > +       struct iovec vsr_iov_out[VTSCSI_MAXSEG]; > +       int                       vsr_niov_out; > +       uint32_t                  vsr_idx; > +       STAILQ_ENTRY(pci_vtscsi_request) vsr_link; > +}; > + > +/* > + * Per-device softc > + */ > +struct pci_vtscsi_softc { > +       struct virtio_softc      vss_vs; > +       struct vqueue_info  vss_vq[VTSCSI_MAXQ]; > +       struct pci_vtscsi_queue vss_queues[VTSCSI_REQUESTQ]; > +       pthread_mutex_t          vss_mtx; > +       int                      vss_iid; > +       int                      vss_ctl_fd; > +       uint32_t                 vss_features; > +       struct pci_vtscsi_config vss_config; > +}; > + > +#define VIRTIO_SCSI_T_TMF                      0 > +#define VIRTIO_SCSI_T_TMF_ABORT_TASK           0 > +#define VIRTIO_SCSI_T_TMF_ABORT_TASK_SET  1 > +#define VIRTIO_SCSI_T_TMF_CLEAR_ACA            2 > +#define VIRTIO_SCSI_T_TMF_CLEAR_TASK_SET  3 > +#define VIRTIO_SCSI_T_TMF_I_T_NEXUS_RESET 4 > +#define VIRTIO_SCSI_T_TMF_LOGICAL_UNIT_RESET  5 > +#define VIRTIO_SCSI_T_TMF_QUERY_TASK           6 > +#define VIRTIO_SCSI_T_TMF_QUERY_TASK_SET  7 > + > +/* command-specific response values */ > +#define VIRTIO_SCSI_S_FUNCTION_COMPLETE         0 > +#define VIRTIO_SCSI_S_FUNCTION_SUCCEEDED  10 > +#define VIRTIO_SCSI_S_FUNCTION_REJECTED         11 > + > > and here above ... > > > +struct pci_vtscsi_ctrl_tmf { > +       uint32_t type; > +       uint32_t subtype; > +       uint8_t lun[8]; > +       uint64_t id; > +       uint8_t response; > +} __attribute__((packed)); > + > +#define VIRTIO_SCSI_T_AN_QUERY                 1 > +#define VIRTIO_SCSI_EVT_ASYNC_OPERATIONAL_CHANGE 2 > +#define VIRTIO_SCSI_EVT_ASYNC_POWER_MGMT  4 > +#define VIRTIO_SCSI_EVT_ASYNC_EXTERNAL_REQUEST 8 > +#define VIRTIO_SCSI_EVT_ASYNC_MEDIA_CHANGE  16 > +#define VIRTIO_SCSI_EVT_ASYNC_MULTI_HOST  32 > +#define VIRTIO_SCSI_EVT_ASYNC_DEVICE_BUSY 64 > + > +struct pci_vtscsi_ctrl_an { > +       uint32_t type; > +       uint8_t lun[8]; > +       uint32_t event_requested; > +       uint32_t event_actual; > +       uint8_t response; > +} __attribute__((packed)); > + > +/* command-specific response values */ > +#define VIRTIO_SCSI_S_OK                       0 > +#define VIRTIO_SCSI_S_OVERRUN                  1 > +#define VIRTIO_SCSI_S_ABORTED                  2 > +#define VIRTIO_SCSI_S_BAD_TARGET               3 > +#define VIRTIO_SCSI_S_RESET                    4 > +#define VIRTIO_SCSI_S_BUSY                     5 > +#define VIRTIO_SCSI_S_TRANSPORT_FAILURE         6 > +#define VIRTIO_SCSI_S_TARGET_FAILURE           7 > +#define VIRTIO_SCSI_S_NEXUS_FAILURE            8 > +#define VIRTIO_SCSI_S_FAILURE                  9 > +#define VIRTIO_SCSI_S_INCORRECT_LUN            12 > + > +/* task_attr */ > +#define VIRTIO_SCSI_S_SIMPLE                   0 > +#define VIRTIO_SCSI_S_ORDERED                  1 > +#define VIRTIO_SCSI_S_HEAD                     2 > +#define VIRTIO_SCSI_S_ACA                      3 > + > > And here ... > > Pedro. > > _______________________________________________ > 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-unsubscribe@freebsd.org > " > > > Hi Pedro, > > I think it is the email message that messed up with it. > I did check it again, usually I use 'vi' and also I checked here: > https://svnweb.freebsd.org/base/head/usr.sbin/bhyve/pci_virtio_scsi.c?view=markup&pathrev=334940 > > Seems everything is correct! Am I missing something? > > Fixed in r334950. Pedro. From owner-svn-src-head@freebsd.org Mon Jun 11 15:03:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2906D100DB2F; Mon, 11 Jun 2018 15:03:11 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 943DC69FEB; Mon, 11 Jun 2018 15:03:10 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w5BF381F028619; Mon, 11 Jun 2018 08:03:08 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w5BF3804028618; Mon, 11 Jun 2018 08:03:08 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806111503.w5BF3804028618@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r334950 - head/usr.sbin/bhyve In-Reply-To: <201806111445.w5BEjZT8097450@repo.freebsd.org> To: "Pedro F. Giffuni" Date: Mon, 11 Jun 2018 08:03:08 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 15:03:11 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: pfg > Date: Mon Jun 11 14:45:34 2018 > New Revision: 334950 > URL: https://svnweb.freebsd.org/changeset/base/334950 > > Log: > style(9): Fix tabs after #define. > > No functional change intended. Thank you. > Modified: > head/usr.sbin/bhyve/pci_virtio_scsi.c > > Modified: head/usr.sbin/bhyve/pci_virtio_scsi.c > ============================================================================== > --- head/usr.sbin/bhyve/pci_virtio_scsi.c Mon Jun 11 14:27:19 2018 (r334949) > +++ head/usr.sbin/bhyve/pci_virtio_scsi.c Mon Jun 11 14:45:34 2018 (r334950) > @@ -77,17 +77,17 @@ __FBSDID("$FreeBSD$"); > #define VTSCSI_OUT_HEADER_LEN(_sc) \ > (sizeof(struct pci_vtscsi_req_cmd_wr) + _sc->vss_config.sense_size) > > -#define VIRTIO_SCSI_MAX_CHANNEL 0 > -#define VIRTIO_SCSI_MAX_TARGET 0 > -#define VIRTIO_SCSI_MAX_LUN 16383 > +#define VIRTIO_SCSI_MAX_CHANNEL 0 > +#define VIRTIO_SCSI_MAX_TARGET 0 > +#define VIRTIO_SCSI_MAX_LUN 16383 > > #define VIRTIO_SCSI_F_INOUT (1 << 0) > #define VIRTIO_SCSI_F_HOTPLUG (1 << 1) > #define VIRTIO_SCSI_F_CHANGE (1 << 2) > > static int pci_vtscsi_debug = 0; > -#define DPRINTF(params) if (pci_vtscsi_debug) printf params > -#define WPRINTF(params) printf params > +#define DPRINTF(params) if (pci_vtscsi_debug) printf params > +#define WPRINTF(params) printf params > > struct pci_vtscsi_config { > uint32_t num_queues; > @@ -108,7 +108,7 @@ struct pci_vtscsi_queue { > int vsq_ctl_fd; > pthread_mutex_t vsq_mtx; > pthread_mutex_t vsq_qmtx; > - pthread_cond_t vsq_cv; > + pthread_cond_t vsq_cv; > STAILQ_HEAD(, pci_vtscsi_request) vsq_requests; > LIST_HEAD(, pci_vtscsi_worker) vsq_workers; > }; > @@ -117,7 +117,7 @@ struct pci_vtscsi_worker { > struct pci_vtscsi_queue * vsw_queue; > pthread_t vsw_thread; > bool vsw_exiting; > - LIST_ENTRY(pci_vtscsi_worker) vsw_link; > + LIST_ENTRY(pci_vtscsi_worker) vsw_link; > }; > > struct pci_vtscsi_request { > @@ -144,20 +144,20 @@ struct pci_vtscsi_softc { > struct pci_vtscsi_config vss_config; > }; > > -#define VIRTIO_SCSI_T_TMF 0 > -#define VIRTIO_SCSI_T_TMF_ABORT_TASK 0 > -#define VIRTIO_SCSI_T_TMF_ABORT_TASK_SET 1 > -#define VIRTIO_SCSI_T_TMF_CLEAR_ACA 2 > -#define VIRTIO_SCSI_T_TMF_CLEAR_TASK_SET 3 > -#define VIRTIO_SCSI_T_TMF_I_T_NEXUS_RESET 4 > -#define VIRTIO_SCSI_T_TMF_LOGICAL_UNIT_RESET 5 > -#define VIRTIO_SCSI_T_TMF_QUERY_TASK 6 > -#define VIRTIO_SCSI_T_TMF_QUERY_TASK_SET 7 > +#define VIRTIO_SCSI_T_TMF 0 > +#define VIRTIO_SCSI_T_TMF_ABORT_TASK 0 > +#define VIRTIO_SCSI_T_TMF_ABORT_TASK_SET 1 > +#define VIRTIO_SCSI_T_TMF_CLEAR_ACA 2 > +#define VIRTIO_SCSI_T_TMF_CLEAR_TASK_SET 3 > +#define VIRTIO_SCSI_T_TMF_I_T_NEXUS_RESET 4 > +#define VIRTIO_SCSI_T_TMF_LOGICAL_UNIT_RESET 5 > +#define VIRTIO_SCSI_T_TMF_QUERY_TASK 6 > +#define VIRTIO_SCSI_T_TMF_QUERY_TASK_SET 7 > > /* command-specific response values */ > -#define VIRTIO_SCSI_S_FUNCTION_COMPLETE 0 > -#define VIRTIO_SCSI_S_FUNCTION_SUCCEEDED 10 > -#define VIRTIO_SCSI_S_FUNCTION_REJECTED 11 > +#define VIRTIO_SCSI_S_FUNCTION_COMPLETE 0 > +#define VIRTIO_SCSI_S_FUNCTION_SUCCEEDED 10 > +#define VIRTIO_SCSI_S_FUNCTION_REJECTED 11 > > struct pci_vtscsi_ctrl_tmf { > uint32_t type; > @@ -167,13 +167,13 @@ struct pci_vtscsi_ctrl_tmf { > uint8_t response; > } __attribute__((packed)); > > -#define VIRTIO_SCSI_T_AN_QUERY 1 > -#define VIRTIO_SCSI_EVT_ASYNC_OPERATIONAL_CHANGE 2 > -#define VIRTIO_SCSI_EVT_ASYNC_POWER_MGMT 4 > -#define VIRTIO_SCSI_EVT_ASYNC_EXTERNAL_REQUEST 8 > -#define VIRTIO_SCSI_EVT_ASYNC_MEDIA_CHANGE 16 > -#define VIRTIO_SCSI_EVT_ASYNC_MULTI_HOST 32 > -#define VIRTIO_SCSI_EVT_ASYNC_DEVICE_BUSY 64 > +#define VIRTIO_SCSI_T_AN_QUERY 1 > +#define VIRTIO_SCSI_EVT_ASYNC_OPERATIONAL_CHANGE 2 > +#define VIRTIO_SCSI_EVT_ASYNC_POWER_MGMT 4 > +#define VIRTIO_SCSI_EVT_ASYNC_EXTERNAL_REQUEST 8 > +#define VIRTIO_SCSI_EVT_ASYNC_MEDIA_CHANGE 16 > +#define VIRTIO_SCSI_EVT_ASYNC_MULTI_HOST 32 > +#define VIRTIO_SCSI_EVT_ASYNC_DEVICE_BUSY 64 > > struct pci_vtscsi_ctrl_an { > uint32_t type; > @@ -184,23 +184,23 @@ struct pci_vtscsi_ctrl_an { > } __attribute__((packed)); > > /* command-specific response values */ > -#define VIRTIO_SCSI_S_OK 0 > -#define VIRTIO_SCSI_S_OVERRUN 1 > -#define VIRTIO_SCSI_S_ABORTED 2 > -#define VIRTIO_SCSI_S_BAD_TARGET 3 > -#define VIRTIO_SCSI_S_RESET 4 > -#define VIRTIO_SCSI_S_BUSY 5 > -#define VIRTIO_SCSI_S_TRANSPORT_FAILURE 6 > -#define VIRTIO_SCSI_S_TARGET_FAILURE 7 > -#define VIRTIO_SCSI_S_NEXUS_FAILURE 8 > -#define VIRTIO_SCSI_S_FAILURE 9 > -#define VIRTIO_SCSI_S_INCORRECT_LUN 12 > +#define VIRTIO_SCSI_S_OK 0 > +#define VIRTIO_SCSI_S_OVERRUN 1 > +#define VIRTIO_SCSI_S_ABORTED 2 > +#define VIRTIO_SCSI_S_BAD_TARGET 3 > +#define VIRTIO_SCSI_S_RESET 4 > +#define VIRTIO_SCSI_S_BUSY 5 > +#define VIRTIO_SCSI_S_TRANSPORT_FAILURE 6 > +#define VIRTIO_SCSI_S_TARGET_FAILURE 7 > +#define VIRTIO_SCSI_S_NEXUS_FAILURE 8 > +#define VIRTIO_SCSI_S_FAILURE 9 > +#define VIRTIO_SCSI_S_INCORRECT_LUN 12 > > /* task_attr */ > -#define VIRTIO_SCSI_S_SIMPLE 0 > -#define VIRTIO_SCSI_S_ORDERED 1 > -#define VIRTIO_SCSI_S_HEAD 2 > -#define VIRTIO_SCSI_S_ACA 3 > +#define VIRTIO_SCSI_S_SIMPLE 0 > +#define VIRTIO_SCSI_S_ORDERED 1 > +#define VIRTIO_SCSI_S_HEAD 2 > +#define VIRTIO_SCSI_S_ACA 3 > > struct pci_vtscsi_event { > uint32_t event; > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Jun 11 15:18:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E65B100F28D; Mon, 11 Jun 2018 15:18:32 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B392A6A924; Mon, 11 Jun 2018 15:18:31 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 94C741D265; Mon, 11 Jun 2018 15:18:31 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5BFIVv8012937; Mon, 11 Jun 2018 15:18:31 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5BFIVCA012936; Mon, 11 Jun 2018 15:18:31 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201806111518.w5BFIVCA012936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 11 Jun 2018 15:18:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334951 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 334951 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 15:18:32 -0000 Author: araujo Date: Mon Jun 11 15:18:31 2018 New Revision: 334951 URL: https://svnweb.freebsd.org/changeset/base/334951 Log: More style(9) fixes, space vs tab. Modified: head/usr.sbin/bhyve/pci_virtio_block.c Modified: head/usr.sbin/bhyve/pci_virtio_block.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_block.c Mon Jun 11 14:45:34 2018 (r334950) +++ head/usr.sbin/bhyve/pci_virtio_block.c Mon Jun 11 15:18:31 2018 (r334951) @@ -111,7 +111,7 @@ struct virtio_blk_hdr { #define VBH_OP_FLUSH_OUT 5 #define VBH_OP_IDENT 8 #define VBH_FLAG_BARRIER 0x80000000 /* OR'ed into vbh_type */ - uint32_t vbh_type; + uint32_t vbh_type; uint32_t vbh_ioprio; uint64_t vbh_sector; } __packed; @@ -125,8 +125,8 @@ static int pci_vtblk_debug; struct pci_vtblk_ioreq { struct blockif_req io_req; - struct pci_vtblk_softc *io_sc; - uint8_t *io_status; + struct pci_vtblk_softc *io_sc; + uint8_t *io_status; uint16_t io_idx; }; From owner-svn-src-head@freebsd.org Mon Jun 11 15:21:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BAC2100F889; Mon, 11 Jun 2018 15:21:32 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-lf0-x232.google.com (mail-lf0-x232.google.com [IPv6:2a00:1450:4010:c07::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 99F576AC0A; Mon, 11 Jun 2018 15:21:31 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-lf0-x232.google.com with SMTP id d24-v6so31123422lfa.8; Mon, 11 Jun 2018 08:21:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc; bh=cGcgU7Ehd3djoe1xVHpLszrcX8KRze5S2KcTCeG/56I=; b=hktI3weFLDXQUjE5EmBwo8wXqzgsoDq3eMAPJ0gB1UbdZtanct0CMXh34IQ7sFo9L+ M3Lqfn78IJFpCvjna8Nf1YyrIeVVzPmXp37heEYH7+gXbZprsK2cri1WtDG+jjhcGCEp UHgeqSh53G/h2rXI2yKfPI8YbpMg/zru8jH3ryvqhO+hxX7LqW89qoy+iCaRMHqxKm7U 1tfS+tLj9qDMe4/JG3zLZgZ+j8Y/75cVbMbg++QhvPGEIE/HNkrcPfZQ3ETJ5O9mdMqe wYNafHMYuIk0bj1Vt53rysnkJLyGiLyuSvmmCMTMzYpVeQJJ1qyWs4bkYqOfKEYTXl6L bhCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=cGcgU7Ehd3djoe1xVHpLszrcX8KRze5S2KcTCeG/56I=; b=eey/F08MvQT5SxrAkbnIw+4DSVAsGOI1zD17BpSeCdDN/tw7u6p85PbFrgRaqWjgdG 95reM7XVwS0Em/jS57AS6Ep8lltpAAHh5lR6s8M5KjJBXjJSdX3aaqZHNfej9pBgaO/v 32lVy4/0iJhcaM9apoC/p7WFgkhPYOmRoAaP+vYrGyFYZPXHPDxQlg6QSV1wGJfJcYNq wrzC/X7nAV02PHqlfbPRQeAVCVKmXxWJ8qJzQddOW0J50TXdxubbT7zezHfqzTWez1uC 1624t27+YVSGdIixV63uN/iBqhERJBcaGrfbECgKl/tfJG/QyZgNqXZp5bWnAbyviazn r6nw== X-Gm-Message-State: APt69E3wL4TYZ1DWda4qnVIa0eE1IAJ4SW9X1kyIqWeoI4k53ZxUpIt8 ydFP6TIrcYzlcYmWj2GYls2IOmE1z8Rky79FgkE= X-Google-Smtp-Source: ADUXVKKsY7bUeq0lhHkeUpXQK741jUlyxWonY2xCopTEvDgm/2RlTIrX8XvffEw3eV9EIQmFPMD0xpriI9lWJtQ/RGA= X-Received: by 2002:a2e:5047:: with SMTP id v7-v6mr12801814ljd.122.1528730489505; Mon, 11 Jun 2018 08:21:29 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a19:1f94:0:0:0:0:0 with HTTP; Mon, 11 Jun 2018 08:21:28 -0700 (PDT) Reply-To: araujo@freebsd.org In-Reply-To: <2b5f4141-51c8-edfa-43ad-d55d52666e7b@FreeBSD.org> References: <201806110209.w5B29Lni010557@repo.freebsd.org> <2b5f4141-51c8-edfa-43ad-d55d52666e7b@FreeBSD.org> From: Marcelo Araujo Date: Mon, 11 Jun 2018 23:21:28 +0800 Message-ID: Subject: Re: svn commit: r334940 - head/usr.sbin/bhyve To: Pedro Giffuni Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 15:21:32 -0000 2018-06-11 22:46 GMT+08:00 Pedro Giffuni : > > > On 06/10/18 21:41, Marcelo Araujo wrote: > > > > 2018-06-11 10:25 GMT+08:00 Pedro Giffuni : > >> >> >> On 10/06/2018 21:09, Marcelo Araujo wrote: >> >>> Author: araujo >>> Date: Mon Jun 11 02:09:20 2018 >>> New Revision: 334940 >>> URL: https://svnweb.freebsd.org/changeset/base/334940 >>> >>> Log: >>> - Add bhyve virtio-scsi storage backend support. >>> Example of configuration: >>> ctl.conf: >>> portal-group pg0 { >>> discovery-auth-group no-authentication >>> listen 0.0.0.0 >>> listen [::] >>> } >>> target iqn.2012-06.com.example:target0 { >>> auth-group no-authentication >>> portal-group pg0 >>> port ioctl/5/3 >>> lun 0 { >>> path /z/test.img >>> size 8G >>> } >>> lun 1 { >>> path /z/test1.img >>> size 8G >>> } >>> } >>> bhyve <...> -s 4,virtio-scsi,/dev/cam/ctl5.3,iid=3 >>> From inside guest: >>> root@:~ # zpool status test >>> pool: test >>> state: ONLINE >>> scan: none requested >>> config: >>> NAME STATE READ WRITE CKSUM >>> test ONLINE 0 0 0 >>> da0 ONLINE 0 0 0 >>> da1 ONLINE 0 0 0 >>> dmesg: >>> da0 at vtscsi0 bus 0 scbus0 target 0 lun 0 >>> da0: Fixed Direct Access SPC-5 SCSI device >>> da0: Serial Number MYSERIAL0000 >>> da0: 300.000MB/s transfers >>> da0: Command Queueing enabled >>> da0: 8192MB (16777216 512 byte sectors) >>> da1 at vtscsi0 bus 0 scbus0 target 0 lun 1 >>> da1: Fixed Direct Access SPC-5 SCSI device >>> da1: Serial Number MYSERIAL0001 >>> da1: 300.000MB/s transfers >>> da1: Command Queueing enabled >>> da1: 8192MB (16777216 512 byte sectors) >>> Discussed with: grehan >>> Reviewed by: mav >>> Obtained from: TrueOS >>> Relnotes: Yes >>> Sponsored by: iXsystems Inc. >>> Tested with: FreeBSD HEAD, Fedora 28 (Workstation) and >>> Ubuntu 18.04. >>> Differential Revision: https://reviews.freebsd.org/D15276 >>> >>> Added: >>> head/usr.sbin/bhyve/iov.c (contents, props changed) >>> head/usr.sbin/bhyve/iov.h (contents, props changed) >>> head/usr.sbin/bhyve/pci_virtio_scsi.c (contents, props changed) >>> Modified: >>> head/usr.sbin/bhyve/Makefile >>> head/usr.sbin/bhyve/bhyve.8 >>> head/usr.sbin/bhyve/virtio.h >>> >>> ... >>> >> >> Added: head/usr.sbin/bhyve/pci_virtio_scsi.c >>> ============================================================ >>> ================== >>> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >>> +++ head/usr.sbin/bhyve/pci_virtio_scsi.c Mon Jun 11 02:09:20 >>> 2018 (r334940) >>> @@ -0,0 +1,718 @@ >>> +/*- >>> + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD >>> + * >>> + * Copyright (c) 2016 Jakub Klama >>> . >>> + * Copyright (c) 2018 Marcelo Araujo >>> . >>> + * All rights reserved. >>> + * >>> + * Redistribution and use in source and binary forms, with or without >>> + * modification, are permitted provided that the following conditions >>> + * are met: >>> + * 1. Redistributions of source code must retain the above copyright >>> + * notice, this list of conditions and the following disclaimer >>> + * in this position and unchanged. >>> + * 2. Redistributions in binary form must reproduce the above copyright >>> + * notice, this list of conditions and the following disclaimer in >>> the >>> + * documentation and/or other materials provided with the >>> distribution. >>> + * >>> + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' >>> AND >>> + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >>> + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >>> PURPOSE >>> + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE >>> LIABLE >>> + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >>> CONSEQUENTIAL >>> + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE >>> GOODS >>> + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) >>> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, >>> STRICT >>> + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN >>> ANY WAY >>> + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY >>> OF >>> + * SUCH DAMAGE. >>> + */ >>> + >>> +#include >>> +__FBSDID("$FreeBSD$"); >>> + >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> + >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> + >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> + >>> +#include "bhyverun.h" >>> +#include "pci_emul.h" >>> +#include "virtio.h" >>> +#include "iov.h" >>> + >>> +#define VTSCSI_RINGSZ 64 >>> +#define VTSCSI_REQUESTQ 1 >>> +#define VTSCSI_THR_PER_Q 16 >>> +#define VTSCSI_MAXQ (VTSCSI_REQUESTQ + 2) >>> +#define VTSCSI_MAXSEG 64 >>> + >>> +#define VTSCSI_IN_HEADER_LEN(_sc) \ >>> + (sizeof(struct pci_vtscsi_req_cmd_rd) + _sc->vss_config.cdb_size) >>> + >>> +#define VTSCSI_OUT_HEADER_LEN(_sc) \ >>> + (sizeof(struct pci_vtscsi_req_cmd_wr) + >>> _sc->vss_config.sense_size) >>> + >>> +#define VIRTIO_SCSI_MAX_CHANNEL 0 >>> +#define VIRTIO_SCSI_MAX_TARGET 0 >>> +#define VIRTIO_SCSI_MAX_LUN 16383 >>> + >>> +#define VIRTIO_SCSI_F_INOUT (1 << 0) >>> +#define VIRTIO_SCSI_F_HOTPLUG (1 << 1) >>> +#define VIRTIO_SCSI_F_CHANGE (1 << 2) >>> + >>> >> TABS missing inconsistently after #define above ... >> >> >> +static int pci_vtscsi_debug = 0; >>> +#define DPRINTF(params) if (pci_vtscsi_debug) printf params >>> +#define WPRINTF(params) printf params >>> + >>> +struct pci_vtscsi_config { >>> + uint32_t num_queues; >>> + uint32_t seg_max; >>> + uint32_t max_sectors; >>> + uint32_t cmd_per_lun; >>> + uint32_t event_info_size; >>> + uint32_t sense_size; >>> + uint32_t cdb_size; >>> + uint16_t max_channel; >>> + uint16_t max_target; >>> + uint32_t max_lun; >>> +} __attribute__((packed)); >>> + >>> +struct pci_vtscsi_queue { >>> + struct pci_vtscsi_softc * vsq_sc; >>> + struct vqueue_info * vsq_vq; >>> + int vsq_ctl_fd; >>> + pthread_mutex_t vsq_mtx; >>> + pthread_mutex_t vsq_qmtx; >>> + pthread_cond_t vsq_cv; >>> + STAILQ_HEAD(, pci_vtscsi_request) vsq_requests; >>> + LIST_HEAD(, pci_vtscsi_worker) vsq_workers; >>> +}; >>> + >>> +struct pci_vtscsi_worker { >>> + struct pci_vtscsi_queue * vsw_queue; >>> + pthread_t vsw_thread; >>> + bool vsw_exiting; >>> + LIST_ENTRY(pci_vtscsi_worker) vsw_link; >>> +}; >>> + >>> +struct pci_vtscsi_request { >>> + struct pci_vtscsi_queue * vsr_queue; >>> + struct iovec vsr_iov_in[VTSCSI_MAXSEG]; >>> + int vsr_niov_in; >>> + struct iovec vsr_iov_out[VTSCSI_MAXSEG]; >>> + int vsr_niov_out; >>> + uint32_t vsr_idx; >>> + STAILQ_ENTRY(pci_vtscsi_request) vsr_link; >>> +}; >>> + >>> +/* >>> + * Per-device softc >>> + */ >>> +struct pci_vtscsi_softc { >>> + struct virtio_softc vss_vs; >>> + struct vqueue_info vss_vq[VTSCSI_MAXQ]; >>> + struct pci_vtscsi_queue vss_queues[VTSCSI_REQUESTQ]; >>> + pthread_mutex_t vss_mtx; >>> + int vss_iid; >>> + int vss_ctl_fd; >>> + uint32_t vss_features; >>> + struct pci_vtscsi_config vss_config; >>> +}; >>> + >>> +#define VIRTIO_SCSI_T_TMF 0 >>> +#define VIRTIO_SCSI_T_TMF_ABORT_TASK 0 >>> +#define VIRTIO_SCSI_T_TMF_ABORT_TASK_SET 1 >>> +#define VIRTIO_SCSI_T_TMF_CLEAR_ACA 2 >>> +#define VIRTIO_SCSI_T_TMF_CLEAR_TASK_SET 3 >>> +#define VIRTIO_SCSI_T_TMF_I_T_NEXUS_RESET 4 >>> +#define VIRTIO_SCSI_T_TMF_LOGICAL_UNIT_RESET 5 >>> +#define VIRTIO_SCSI_T_TMF_QUERY_TASK 6 >>> +#define VIRTIO_SCSI_T_TMF_QUERY_TASK_SET 7 >>> + >>> +/* command-specific response values */ >>> +#define VIRTIO_SCSI_S_FUNCTION_COMPLETE 0 >>> +#define VIRTIO_SCSI_S_FUNCTION_SUCCEEDED 10 >>> +#define VIRTIO_SCSI_S_FUNCTION_REJECTED 11 >>> + >>> >> and here above ... >> >> >> +struct pci_vtscsi_ctrl_tmf { >>> + uint32_t type; >>> + uint32_t subtype; >>> + uint8_t lun[8]; >>> + uint64_t id; >>> + uint8_t response; >>> +} __attribute__((packed)); >>> + >>> +#define VIRTIO_SCSI_T_AN_QUERY 1 >>> +#define VIRTIO_SCSI_EVT_ASYNC_OPERATIONAL_CHANGE 2 >>> +#define VIRTIO_SCSI_EVT_ASYNC_POWER_MGMT 4 >>> +#define VIRTIO_SCSI_EVT_ASYNC_EXTERNAL_REQUEST 8 >>> +#define VIRTIO_SCSI_EVT_ASYNC_MEDIA_CHANGE 16 >>> +#define VIRTIO_SCSI_EVT_ASYNC_MULTI_HOST 32 >>> +#define VIRTIO_SCSI_EVT_ASYNC_DEVICE_BUSY 64 >>> + >>> +struct pci_vtscsi_ctrl_an { >>> + uint32_t type; >>> + uint8_t lun[8]; >>> + uint32_t event_requested; >>> + uint32_t event_actual; >>> + uint8_t response; >>> +} __attribute__((packed)); >>> + >>> +/* command-specific response values */ >>> +#define VIRTIO_SCSI_S_OK 0 >>> +#define VIRTIO_SCSI_S_OVERRUN 1 >>> +#define VIRTIO_SCSI_S_ABORTED 2 >>> +#define VIRTIO_SCSI_S_BAD_TARGET 3 >>> +#define VIRTIO_SCSI_S_RESET 4 >>> +#define VIRTIO_SCSI_S_BUSY 5 >>> +#define VIRTIO_SCSI_S_TRANSPORT_FAILURE 6 >>> +#define VIRTIO_SCSI_S_TARGET_FAILURE 7 >>> +#define VIRTIO_SCSI_S_NEXUS_FAILURE 8 >>> +#define VIRTIO_SCSI_S_FAILURE 9 >>> +#define VIRTIO_SCSI_S_INCORRECT_LUN 12 >>> + >>> +/* task_attr */ >>> +#define VIRTIO_SCSI_S_SIMPLE 0 >>> +#define VIRTIO_SCSI_S_ORDERED 1 >>> +#define VIRTIO_SCSI_S_HEAD 2 >>> +#define VIRTIO_SCSI_S_ACA 3 >>> + >>> >> And here ... >> >> Pedro. >> >> _______________________________________________ >> 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-unsubscribe@freebsd.org" >> > > Hi Pedro, > > I think it is the email message that messed up with it. > I did check it again, usually I use 'vi' and also I checked here: > https://svnweb.freebsd.org/base/head/usr.sbin/bhyve/pci_ > virtio_scsi.c?view=markup&pathrev=334940 > > Seems everything is correct! Am I missing something? > > > > Fixed in r334950. > I have fixed my vimrc.. Thank you! > > Pedro. > > -- -- Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-head@freebsd.org Mon Jun 11 15:28:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60B2C101046F; Mon, 11 Jun 2018 15:28:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 169156B12D; Mon, 11 Jun 2018 15:28:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EBCD91D3F5; Mon, 11 Jun 2018 15:28:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5BFSKK3017845; Mon, 11 Jun 2018 15:28:20 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5BFSKd5017844; Mon, 11 Jun 2018 15:28:20 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201806111528.w5BFSKd5017844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 11 Jun 2018 15:28:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334952 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 334952 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 15:28:21 -0000 Author: kib Date: Mon Jun 11 15:28:20 2018 New Revision: 334952 URL: https://svnweb.freebsd.org/changeset/base/334952 Log: Fix braino in r334799. Maxmem is in pages. Reported by: ae, pho Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/mp_machdep.c Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Mon Jun 11 15:18:31 2018 (r334951) +++ head/sys/amd64/amd64/mp_machdep.c Mon Jun 11 15:28:20 2018 (r334952) @@ -122,7 +122,7 @@ mp_bootaddress(vm_paddr_t *physmap, unsigned int *phys */ if (physmap[i] >= GiB(4) || physmap[i + 1] - round_page(physmap[i]) < PAGE_SIZE * 3 || - physmap[i + 1] > Maxmem) + atop(physmap[i + 1]) > Maxmem) continue; allocated = true; From owner-svn-src-head@freebsd.org Mon Jun 11 15:42:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FB741011F39; Mon, 11 Jun 2018 15:42:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 11AA96BD41; Mon, 11 Jun 2018 15:42:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E6FC61D72A; Mon, 11 Jun 2018 15:42:29 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5BFgT3A028219; Mon, 11 Jun 2018 15:42:29 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5BFgTdu028218; Mon, 11 Jun 2018 15:42:29 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806111542.w5BFgTdu028218@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 11 Jun 2018 15:42:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334953 - head/sys/compat/linuxkpi/common/include/asm X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/asm X-SVN-Commit-Revision: 334953 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 15:42:30 -0000 Author: hselasky Date: Mon Jun 11 15:42:29 2018 New Revision: 334953 URL: https://svnweb.freebsd.org/changeset/base/334953 Log: Implement the user_access_begin(), user_access_end(), usafe_get_user() and unsafe_put_user() function macros in the LinuxKPI. Submitted by: Johannes Lundberg MFC after: 1 week Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: head/sys/compat/linuxkpi/common/include/asm/uaccess.h Modified: head/sys/compat/linuxkpi/common/include/asm/uaccess.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/uaccess.h Mon Jun 11 15:28:20 2018 (r334952) +++ head/sys/compat/linuxkpi/common/include/asm/uaccess.h Mon Jun 11 15:42:29 2018 (r334953) @@ -52,4 +52,17 @@ copy_from_user(void *to, const void *from, unsigned lo #define __copy_from_user(...) copy_from_user(__VA_ARGS__) #define __copy_in_user(...) copy_from_user(__VA_ARGS__) +#define user_access_begin() do { } while (0) +#define user_access_end() do { } while (0) + +#define unsafe_get_user(x, ptr, err) do { \ + if (unlikely(__get_user(x, ptr))) \ + goto err; \ +} while (0) + +#define unsafe_put_user(x, ptr, err) do { \ + if (unlikely(__put_user(x, ptr))) \ + goto err; \ +} while (0) + #endif /* _ASM_UACCESS_H_ */ From owner-svn-src-head@freebsd.org Mon Jun 11 16:09:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7E2F1015366; Mon, 11 Jun 2018 16:09:55 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 880D76D29D; Mon, 11 Jun 2018 16:09:55 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 648361DA68; Mon, 11 Jun 2018 16:09:55 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5BG9to0038612; Mon, 11 Jun 2018 16:09:55 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5BG9sD7038609; Mon, 11 Jun 2018 16:09:54 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201806111609.w5BG9sD7038609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Mon, 11 Jun 2018 16:09:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334957 - in head: lib/libpmc usr.sbin/pmc X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: in head: lib/libpmc usr.sbin/pmc X-SVN-Commit-Revision: 334957 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 16:09:56 -0000 Author: rlibby Date: Mon Jun 11 16:09:54 2018 New Revision: 334957 URL: https://svnweb.freebsd.org/changeset/base/334957 Log: pmc gcc fixups Fix the build of lib/libpmc and usr.sbin/pmc for gcc on amd64. Reviewed by: mmacy Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D15723 Modified: head/lib/libpmc/Makefile head/usr.sbin/pmc/Makefile head/usr.sbin/pmc/cmd_pmc_filter.cc Modified: head/lib/libpmc/Makefile ============================================================================== --- head/lib/libpmc/Makefile Mon Jun 11 15:44:53 2018 (r334956) +++ head/lib/libpmc/Makefile Mon Jun 11 16:09:54 2018 (r334957) @@ -7,6 +7,7 @@ SRCS= libpmc.c pmclog.c libpmc_pmu_util.c libpmc_json. INCS= pmc.h pmclog.h pmcformat.h CFLAGS+= -I${.CURDIR} +CWARNFLAGS.gcc+= -Wno-shadow .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" Modified: head/usr.sbin/pmc/Makefile ============================================================================== --- head/usr.sbin/pmc/Makefile Mon Jun 11 15:44:53 2018 (r334956) +++ head/usr.sbin/pmc/Makefile Mon Jun 11 16:09:54 2018 (r334957) @@ -5,7 +5,8 @@ .include PROG_CXX= pmc MAN= -CXXFLAGS+= -O0 +CXXFLAGS+= -O0 -std=c++14 +CWARNFLAGS.gcc+= -Wno-redundant-decls LIBADD= kvm pmc m ncursesw pmcstat elf Modified: head/usr.sbin/pmc/cmd_pmc_filter.cc ============================================================================== --- head/usr.sbin/pmc/cmd_pmc_filter.cc Mon Jun 11 15:44:53 2018 (r334956) +++ head/usr.sbin/pmc/cmd_pmc_filter.cc Mon Jun 11 16:09:54 2018 (r334957) @@ -68,7 +68,6 @@ __FBSDID("$FreeBSD$"); #include #include "cmd_pmc.h" -#include #include #include @@ -182,11 +181,11 @@ static void pmc_log_event(int fd, struct pmclog_ev *ev, bool json) { int len; - void *buf; + const void *buf; if (json) { string ret = event_to_json(ev); - buf = (void*)ret.c_str(); + buf = ret.c_str(); len = ret.size(); } else { len = ev->pl_len; @@ -233,7 +232,7 @@ pmc_filter_handler(uint32_t *lwplist, int lwpcount, ui pmclog_close(ps); if ((ps = static_cast < struct pmclog_parse_state *>(pmclog_open(infd)))== NULL) errx(EX_OSERR, "ERROR: Cannot allocate pmclog parse state: %s\n", strerror(errno)); - if ((pe = (typeof(pe)) malloc(sizeof(*pe) * pmccount)) == NULL) + if ((pe = (struct pmcid_ent *) malloc(sizeof(*pe) * pmccount)) == NULL) errx(EX_OSERR, "ERROR: failed to allocate pmcid map"); i = 0; while (pmclog_read(ps, &ev) == 0 && i < pmccount) { From owner-svn-src-head@freebsd.org Mon Jun 11 16:26:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0133210177A7; Mon, 11 Jun 2018 16:26:34 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A3C4A6E2F3; Mon, 11 Jun 2018 16:26:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8618A1DDA2; Mon, 11 Jun 2018 16:26:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5BGQXeE048877; Mon, 11 Jun 2018 16:26:33 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5BGQXot048876; Mon, 11 Jun 2018 16:26:33 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806111626.w5BGQXot048876@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 11 Jun 2018 16:26:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334958 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 334958 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 16:26:34 -0000 Author: hselasky Date: Mon Jun 11 16:26:33 2018 New Revision: 334958 URL: https://svnweb.freebsd.org/changeset/base/334958 Log: Implement the kstrtobool() and kstrtobool_from_user() functions in the LinuxKPI. Submitted by: Johannes Lundberg MFC after: 1 week Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/kernel.h Mon Jun 11 16:09:54 2018 (r334957) +++ head/sys/compat/linuxkpi/common/include/linux/kernel.h Mon Jun 11 16:26:33 2018 (r334958) @@ -50,7 +50,9 @@ #include #include #include + #include +#include #include @@ -370,6 +372,46 @@ kstrtou32(const char *cp, unsigned int base, u32 *res) if (temp != (u32)temp) return (-ERANGE); return (0); +} + +static inline int +kstrtobool(const char *s, bool *res) +{ + int len; + + if (s == NULL || (len = strlen(s)) == 0 || res == NULL) + return (-EINVAL); + + /* skip newline character, if any */ + if (s[len - 1] == '\n') + len--; + + if (len == 1 && strchr("yY1", s[0]) != NULL) + *res = true; + else if (len == 1 && strchr("nN0", s[0]) != NULL) + *res = false; + else if (strncasecmp("on", s, len) == 0) + *res = true; + else if (strncasecmp("off", s, len) == 0) + *res = false; + else + return (-EINVAL); + + return (0); +} + +static inline int +kstrtobool_from_user(const char __user *s, size_t count, bool *res) +{ + char buf[8] = {}; + + if (count > (sizeof(buf) - 1)) + count = (sizeof(buf) - 1); + + if (copy_from_user(buf, s, count)) + return (-EFAULT); + + return (kstrtobool(buf, res)); } #define min(x, y) ((x) < (y) ? (x) : (y)) From owner-svn-src-head@freebsd.org Mon Jun 11 16:27:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C77601017A5B; Mon, 11 Jun 2018 16:27:10 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7D54D6E4E8; Mon, 11 Jun 2018 16:27:10 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5FA7D1DDA3; Mon, 11 Jun 2018 16:27:10 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5BGRAnC048946; Mon, 11 Jun 2018 16:27:10 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5BGRA6g048945; Mon, 11 Jun 2018 16:27:10 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201806111627.w5BGRA6g048945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 11 Jun 2018 16:27:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334959 - head/sys/dev/hwpmc X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/hwpmc X-SVN-Commit-Revision: 334959 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 16:27:11 -0000 Author: markj Date: Mon Jun 11 16:27:09 2018 New Revision: 334959 URL: https://svnweb.freebsd.org/changeset/base/334959 Log: Use the cached curthread reference in pmc_process_interrupt(). Fix indentation while here. Modified: head/sys/dev/hwpmc/hwpmc_mod.c Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Mon Jun 11 16:26:33 2018 (r334958) +++ head/sys/dev/hwpmc/hwpmc_mod.c Mon Jun 11 16:27:09 2018 (r334959) @@ -4748,9 +4748,9 @@ pmc_process_interrupt(int ring, struct pmc *pm, struct td = curthread; if ((pm->pm_flags & PMC_F_USERCALLCHAIN) && - (td->td_proc->p_flag & P_KPROC) == 0 && - !TRAPF_USERMODE(tf)) { - atomic_add_int(&curthread->td_pmcpend, 1); + (td->td_proc->p_flag & P_KPROC) == 0 && + !TRAPF_USERMODE(tf)) { + atomic_add_int(&td->td_pmcpend, 1); return (pmc_add_sample(PMC_UR, pm, tf)); } return (pmc_add_sample(ring, pm, tf)); From owner-svn-src-head@freebsd.org Mon Jun 11 16:28:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67E191017F3C for ; Mon, 11 Jun 2018 16:28:47 +0000 (UTC) (envelope-from info@worldmail3.us) Received: from mail.worldmail3.us (mail.worldmail3.us [108.170.31.66]) by mx1.freebsd.org (Postfix) with ESMTP id E20C46E7F2 for ; Mon, 11 Jun 2018 16:28:46 +0000 (UTC) (envelope-from info@worldmail3.us) Received: from mail.worldmail3.us (WIN-113SAP4RMCB [108.170.31.66]) by mail.worldmail3.us with SMTP; Mon, 11 Jun 2018 09:28:25 -0700 From: "=?utf-8?Q?Information=20Update?=" To: "svn-src-head@freebsd.org" Reply-To: mrwest@o2loto.co.uk Date: Mon, 11 Jun 2018 09:28:25 -0700 Subject: =?utf-8?Q?Important=20Notification?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Message-ID: X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 16:28:47 -0000 Dear Recipent ,=0D=0A=0D=0AThis email address has won Three Million Pound= s on the o2 mobile sweepstakes=2EPlease Contact Payment Cordinator Mat on= email : mrwest=40o2loto=2Eco=2Euk for explanation and payment processin= g =2E=0D=0A=0D=0AYours Faithfully =0D=0A=0D=0ADebbie Spence =0D=0A=0D=0AC= ordinator O2 Mobile Promotional Sweepstakes=2E From owner-svn-src-head@freebsd.org Mon Jun 11 16:31:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DD941018945; Mon, 11 Jun 2018 16:31:43 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 75A026EDF0; Mon, 11 Jun 2018 16:31:43 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 56A371DEE9; Mon, 11 Jun 2018 16:31:43 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5BGVhmr051387; Mon, 11 Jun 2018 16:31:43 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5BGVh2M051386; Mon, 11 Jun 2018 16:31:43 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806111631.w5BGVh2M051386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Mon, 11 Jun 2018 16:31:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334960 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 334960 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 16:31:43 -0000 Author: mmacy Date: Mon Jun 11 16:31:42 2018 New Revision: 334960 URL: https://svnweb.freebsd.org/changeset/base/334960 Log: soreceive_stream: correctly handle edge cases - non NULL controlp is not an error, returning EINVAL would cause X forwarding to fail - MSG_PEEK and MSG_WAITALL are fairly exceptional, but we still want to handle them - punt to soreceive_generic Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Mon Jun 11 16:27:09 2018 (r334959) +++ head/sys/kern/uipc_socket.c Mon Jun 11 16:31:42 2018 (r334960) @@ -2162,7 +2162,6 @@ release: /* * Optimized version of soreceive() for stream (TCP) sockets. - * XXXAO: (MSG_WAITALL | MSG_PEEK) isn't properly handled. */ int soreceive_stream(struct socket *so, struct sockaddr **psa, struct uio *uio, @@ -2177,12 +2176,14 @@ soreceive_stream(struct socket *so, struct sockaddr ** return (EINVAL); if (psa != NULL) *psa = NULL; - if (controlp != NULL) - return (EINVAL); if (flagsp != NULL) flags = *flagsp &~ MSG_EOR; else flags = 0; + if (flags & (MSG_PEEK|MSG_WAITALL)) + return (soreceive_generic(so, psa, uio, mp0, controlp, flagsp)); + if (controlp != NULL) + *controlp = NULL; if (flags & MSG_OOB) return (soreceive_rcvoob(so, uio, flags)); if (mp0 != NULL) From owner-svn-src-head@freebsd.org Mon Jun 11 16:33:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D358A1018F1D; Mon, 11 Jun 2018 16:33:36 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 884E06F091; Mon, 11 Jun 2018 16:33:36 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6AC201DF35; Mon, 11 Jun 2018 16:33:36 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5BGXaDa053935; Mon, 11 Jun 2018 16:33:36 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5BGXaNF053934; Mon, 11 Jun 2018 16:33:36 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201806111633.w5BGXaNF053934@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 11 Jun 2018 16:33:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334961 - head/cddl/contrib/opensolaris/tools/ctf/cvt X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/tools/ctf/cvt X-SVN-Commit-Revision: 334961 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 16:33:37 -0000 Author: markj Date: Mon Jun 11 16:33:36 2018 New Revision: 334961 URL: https://svnweb.freebsd.org/changeset/base/334961 Log: Process CUs with a language attribute of DW_LANG_Mips_Assembler. At the moment ctfconvert(1) does not do much with such CUs, but that may not be true in the future, and we run ctfconvert on several assembly files during the build. X-MFC with: r334883 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 Mon Jun 11 16:31:42 2018 (r334960) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Mon Jun 11 16:33:36 2018 (r334961) @@ -1982,10 +1982,11 @@ dw_read(tdata_t *td, Elf *elf, char *filename __unused case DW_LANG_C_plus_plus_03: case DW_LANG_C_plus_plus_11: case DW_LANG_C_plus_plus_14: + case DW_LANG_Mips_Assembler: break; default: terminate("file contains DWARF for unsupported " - "language %d", lang); + "language %#x", lang); } else warning("die %llu: failed to get language attribute: %s\n", From owner-svn-src-head@freebsd.org Mon Jun 11 16:54:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06182101ABD9; Mon, 11 Jun 2018 16:54:39 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pg0-x22b.google.com (mail-pg0-x22b.google.com [IPv6:2607:f8b0:400e:c05::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 76CDC701A3; Mon, 11 Jun 2018 16:54:38 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pg0-x22b.google.com with SMTP id l65-v6so10032140pgl.8; Mon, 11 Jun 2018 09:54:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=sMBoOxIp8IpAB7LoekLLZYCTpdYAt5u5bSzYgwvonPg=; b=ERwhjg8G8evIRQWAXP0rwZ7wRy4F1ScWbcxdn3q8p4bZHqc97WpmQIbb0uPz/JdQNu omkFNELzX9/GQGidT5IXuNVD39A+skYMpU638V7ne0YnvYgRzOGy/V3zbCeP6y6Y7sG5 hi1HxEbHgI95qmcgjiPJwuvuuG+HEBhyEwgJGViBr4TVOpxgZ7mwUf4GwNFqOWdW7GBH akOI55xLu/RwhDOwRLimGE1aYU7OuwXjsKt4njQdVYAmPkUq2Kyt7cSjlC2TZAZv5fO5 /6DNHy+CXvl2uTcuaeZN2TzFEYVUfiOVA/ThlU/3xPX01R+TTWA3wyJe/xC8OD+IMYjX cS+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=sMBoOxIp8IpAB7LoekLLZYCTpdYAt5u5bSzYgwvonPg=; b=f1XdkAnQ8b/SCLxBjNGkodxJYW9102XTNsi94bBQL4IsjJIq/ey1NKnY/wKGzH7IZn vbqUVH8a21hOZOjrFaDk38sUSOXW5wClPC2SSZylmO1JQ3S25deU45vrlL0CA7J68kMv oEjpHJFO0fIT57ZmwbH4nE11EqbXBfbpVntTl+kIX5x0h5aX6v1U/eF6BTIAWaw60+Jj pvs9XCNm3XI2hwoYzA1dpHSxlCcmBNR0t58wE1hH0nHzMsDdbGXRq5oJ1pDZY/BTfp4W 5acmfH5uf2F20HL2mgqSjXmlZWrZZIxm97u7/1y1IebgxFnEzAw5Q4Jpu/K3OS9Z/8NT 5gOw== X-Gm-Message-State: APt69E1FqwadN03ZmKY8umXIN0vJdNQapCTPNTdbMDspMwSFEGVQdoH6 3Kzrs21z3nTr8Y1hXM7f6J34Op6n X-Google-Smtp-Source: ADUXVKIoZdb9YJlwJ+wRLUxBMTPrcG2HsbezPjCZZSPrZF6Tf/bdnIpppB5qWAKmY7y+OyOXm0gZTg== X-Received: by 2002:a62:c0cb:: with SMTP id g72-v6mr18355432pfk.226.1528736077250; Mon, 11 Jun 2018 09:54:37 -0700 (PDT) Received: from raichu (toroon0560w-lp140-02-70-49-169-156.dsl.bell.ca. [70.49.169.156]) by smtp.gmail.com with ESMTPSA id o77-v6sm83474796pfj.0.2018.06.11.09.54.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Jun 2018 09:54:36 -0700 (PDT) Sender: Mark Johnston Date: Mon, 11 Jun 2018 12:54:33 -0400 From: Mark Johnston To: Matt Macy Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334960 - head/sys/kern Message-ID: <20180611165433.GD55005@raichu> References: <201806111631.w5BGVh2M051386@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201806111631.w5BGVh2M051386@repo.freebsd.org> User-Agent: Mutt/1.10.0 (2018-05-17) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 16:54:39 -0000 On Mon, Jun 11, 2018 at 04:31:43PM +0000, Matt Macy wrote: > Author: mmacy > Date: Mon Jun 11 16:31:42 2018 > New Revision: 334960 > URL: https://svnweb.freebsd.org/changeset/base/334960 > > Log: > soreceive_stream: correctly handle edge cases > > - non NULL controlp is not an error, returning EINVAL > would cause X forwarding to fail > > - MSG_PEEK and MSG_WAITALL are fairly exceptional, but we still > want to handle them - punt to soreceive_generic > > Modified: > head/sys/kern/uipc_socket.c > > Modified: head/sys/kern/uipc_socket.c > ============================================================================== > --- head/sys/kern/uipc_socket.c Mon Jun 11 16:27:09 2018 (r334959) > +++ head/sys/kern/uipc_socket.c Mon Jun 11 16:31:42 2018 (r334960) > @@ -2162,7 +2162,6 @@ release: > > /* > * Optimized version of soreceive() for stream (TCP) sockets. > - * XXXAO: (MSG_WAITALL | MSG_PEEK) isn't properly handled. > */ > int > soreceive_stream(struct socket *so, struct sockaddr **psa, struct uio *uio, > @@ -2177,12 +2176,14 @@ soreceive_stream(struct socket *so, struct sockaddr ** > return (EINVAL); > if (psa != NULL) > *psa = NULL; > - if (controlp != NULL) > - return (EINVAL); > if (flagsp != NULL) > flags = *flagsp &~ MSG_EOR; > else > flags = 0; > + if (flags & (MSG_PEEK|MSG_WAITALL)) > + return (soreceive_generic(so, psa, uio, mp0, controlp, flagsp)); > + if (controlp != NULL) > + *controlp = NULL; Now soreceive_stream() contains dead code to handle MSG_WAITALL, and a bunch of always-true checks for both flags. Changes to this code should be reviewed. From owner-svn-src-head@freebsd.org Mon Jun 11 17:04:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 862A5101BAC4; Mon, 11 Jun 2018 17:04:38 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 34A4B70C20; Mon, 11 Jun 2018 17:04:38 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-it0-f42.google.com (mail-it0-f42.google.com [209.85.214.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id F29B114F69; Mon, 11 Jun 2018 17:04:37 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-it0-f42.google.com with SMTP id 76-v6so11213965itx.4; Mon, 11 Jun 2018 10:04:37 -0700 (PDT) X-Gm-Message-State: APt69E1B9VW6Y1TFv2i5+d+4z0uhK9EFYBGlZ3c/w8di9tU3JXVkLa7/ bTseZ1mGBsqB0moi1wW4PiGj61R3wXBMyTAYZLI= X-Google-Smtp-Source: ADUXVKKHj+XrSOniv1l9Q4pQKI0xIQM39w2f2ehStxRGBTDIoaVKagXcbHzzfnxmMbCkMF/yZkYSS4cWXkQtpnWxguE= X-Received: by 2002:a24:6c8a:: with SMTP id w132-v6mr35928itb.4.1528736677195; Mon, 11 Jun 2018 10:04:37 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:8cd:0:0:0:0:0 with HTTP; Mon, 11 Jun 2018 10:04:36 -0700 (PDT) In-Reply-To: <20180611165433.GD55005@raichu> References: <201806111631.w5BGVh2M051386@repo.freebsd.org> <20180611165433.GD55005@raichu> From: Matthew Macy Date: Mon, 11 Jun 2018 10:04:36 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334960 - head/sys/kern To: Mark Johnston Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 17:04:38 -0000 Fair. But it didn't actually work before. It's not clear anyone has ever used it. On Mon, Jun 11, 2018 at 9:54 AM, Mark Johnston wrote: > On Mon, Jun 11, 2018 at 04:31:43PM +0000, Matt Macy wrote: >> Author: mmacy >> Date: Mon Jun 11 16:31:42 2018 >> New Revision: 334960 >> URL: https://svnweb.freebsd.org/changeset/base/334960 >> >> Log: >> soreceive_stream: correctly handle edge cases >> >> - non NULL controlp is not an error, returning EINVAL >> would cause X forwarding to fail >> >> - MSG_PEEK and MSG_WAITALL are fairly exceptional, but we still >> want to handle them - punt to soreceive_generic >> >> Modified: >> head/sys/kern/uipc_socket.c >> >> Modified: head/sys/kern/uipc_socket.c >> ============================================================================== >> --- head/sys/kern/uipc_socket.c Mon Jun 11 16:27:09 2018 (r334959) >> +++ head/sys/kern/uipc_socket.c Mon Jun 11 16:31:42 2018 (r334960) >> @@ -2162,7 +2162,6 @@ release: >> >> /* >> * Optimized version of soreceive() for stream (TCP) sockets. >> - * XXXAO: (MSG_WAITALL | MSG_PEEK) isn't properly handled. >> */ >> int >> soreceive_stream(struct socket *so, struct sockaddr **psa, struct uio *uio, >> @@ -2177,12 +2176,14 @@ soreceive_stream(struct socket *so, struct sockaddr ** >> return (EINVAL); >> if (psa != NULL) >> *psa = NULL; >> - if (controlp != NULL) >> - return (EINVAL); >> if (flagsp != NULL) >> flags = *flagsp &~ MSG_EOR; >> else >> flags = 0; >> + if (flags & (MSG_PEEK|MSG_WAITALL)) >> + return (soreceive_generic(so, psa, uio, mp0, controlp, flagsp)); >> + if (controlp != NULL) >> + *controlp = NULL; > > Now soreceive_stream() contains dead code to handle MSG_WAITALL, and a > bunch of always-true checks for both flags. > > Changes to this code should be reviewed. From owner-svn-src-head@freebsd.org Mon Jun 11 17:10:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACFF6101C3E1; Mon, 11 Jun 2018 17:10:20 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B57D712C4; Mon, 11 Jun 2018 17:10:20 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C6171E426; Mon, 11 Jun 2018 17:10:20 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5BHAKDK069744; Mon, 11 Jun 2018 17:10:20 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5BHAKr1069743; Mon, 11 Jun 2018 17:10:20 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806111710.w5BHAKr1069743@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Mon, 11 Jun 2018 17:10:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334962 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 334962 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 17:10:20 -0000 Author: mmacy Date: Mon Jun 11 17:10:19 2018 New Revision: 334962 URL: https://svnweb.freebsd.org/changeset/base/334962 Log: limit change to fixing controlp handling pending review Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Mon Jun 11 16:33:36 2018 (r334961) +++ head/sys/kern/uipc_socket.c Mon Jun 11 17:10:19 2018 (r334962) @@ -2180,8 +2180,6 @@ soreceive_stream(struct socket *so, struct sockaddr ** flags = *flagsp &~ MSG_EOR; else flags = 0; - if (flags & (MSG_PEEK|MSG_WAITALL)) - return (soreceive_generic(so, psa, uio, mp0, controlp, flagsp)); if (controlp != NULL) *controlp = NULL; if (flags & MSG_OOB) From owner-svn-src-head@freebsd.org Mon Jun 11 17:54:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8EFE1021CB5; Mon, 11 Jun 2018 17:54:46 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D7EA73961; Mon, 11 Jun 2018 17:54:46 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [74.217.198.10] (port=54024 helo=[10.1.4.66]) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1fSI4z-0007OK-LN; Mon, 11 Jun 2018 08:21:33 +0000 From: Devin Teske Message-Id: <344AA709-2DF7-405C-AB4D-4F0978834EA1@FreeBSD.org> Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r334939 - head/stand/lua Date: Mon, 11 Jun 2018 10:54:43 -0700 In-Reply-To: Cc: Devin Teske , Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Warner Losh References: <201806110132.w5B1WI5d094546@repo.freebsd.org> X-Mailer: Apple Mail (2.3273) Sender: devin@shxd.cx Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 17:54:47 -0000 > On Jun 11, 2018, at 7:07 AM, Warner Losh wrote: >=20 >=20 >=20 > On Mon, Jun 11, 2018 at 7:36 AM, Devin Teske > wrote: >=20 >=20 > > On Jun 10, 2018, at 6:32 PM, Kyle Evans wrote: > >=20 > > Author: kevans > > Date: Mon Jun 11 01:32:18 2018 > > New Revision: 334939 > > URL: https://svnweb.freebsd.org/changeset/base/334939 = > >=20 > > Log: > > lualoader: Allow brand-*.lua for adding new brands > >=20 > > dteske@, I believe, had originally pointed out that lualoader = failed to > > allow logo-*.lua for new logos to be added. When correcting this = mistake, I > > failed to do the same for brands. > >=20 >=20 > You=E2=80=99re doing an amazing job, Kyle. >=20 > I continually see nothing but genuine effort toward feature parity = which makes me think one day I can pass the reigns. >=20 > Yeah, I will always love Forth. It will always hold a special place in = my heart as that whacky language that simultaneously exudes great power = while also having the image ability to induce vomiting =F0=9F=A4=AE by = the uninitiated. >=20 > However, all that being said, I=E2=80=99d actually like to keep the = Ficl boot stuff as an option through to 14.0 and here is why ... >=20 > Last year we were looking to update from ficl3 to ficl4. That may not = sound too exciting to most folks, but most folks don=E2=80=99t know the = power that ficl4 brings =E2=80=94 like the capability to use full = networking in the loader! Can lua do that? How cool would it be to be = able to communicate with the network from the loader before the kernel = is even loaded into memory? I had a few hair-brained schemes left for = Forth which might be exciting, lol >=20 > The current boot loader can already communicate via NFS or TFTP today. = Adding http would be easy, https would be harder due to crypto being = huge and space being small (though bear ssl might be small enough). >=20 > The last articulated plan in arch@ was that LUA will be default in 12, = and we plan to remove FORTH in 13. Last time I said it there in = February, there was only email agreeing that I could find. This matches = the in-person consensus poll I took at BSDcan as well. I think it would = take a very extraordinary set circumstance and severe problems with LUA = to change those plans. >=20 At BSD Can there was the boot working group where we discussed that an = FCP would be required to decide this. I raised my desires that I would like to be able to flip a knob in 13 = and reboot between Ficl and Lua, back and forth. Give people a choice until we have done a "shake-out" through an entire = major version. An honest-to-goodness procession would be, in my mind: 13: Has both; both are installed. End-user can boot back and forth = between the two Problems that arise in one or the other are non-critical because there = is always an "out" by running the other. 14: Has both but both are not installed. The installer media doesn't = even have it. You can't install the Forth booth stuff unless you twist a = knob in buildworld, optionally going down the path of generating release = media which has the Forth boot stuff. 15. It's removed from tree. You can't build Forth boot. Lua only. No = looking back, no way to build it with Forth, to get Ficl you need to go = to ports. A Ficl with FreeBSD boot words no longer exists and is no = longer maintained. All of bhyve userboot also therefore uses Lua. --=20 Devin= From owner-svn-src-head@freebsd.org Mon Jun 11 18:20:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 891961002E10 for ; Mon, 11 Jun 2018 18:20:22 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1EA3D7492E for ; Mon, 11 Jun 2018 18:20:21 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22c.google.com with SMTP id l25-v6so24975097ioh.12 for ; Mon, 11 Jun 2018 11:20:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=UW5UZuZQ0oCakyDm1OrIR3KnP97lSihJxj8odOMQXzg=; b=RHLQblzS6IIS2zZZAvFii/qHMP3M4LS1dSnrhG4yAuuywDbutOpR4S5fIlgyiTWq6b tZLoUXXOU6bp9qEg6B23FTQPn/JJSb3Kbh1HRssrIlWPAOKJzbetkOxe6c2YrNbTiGAg YizxRrUVV272FfdgteE8JUqX71SIM+9BlEVG5J31XskCEg9/j8YUd9/cvBUwLSH/obyT H0M13gUJF8UaoThrAjS+jelpjmTTR7wUUrQV56T65TgyYQWD72Ok/yJNqgDyh2BUw2PY BbOTi6VyG7kzGcl8IY88avAd0WciZtd061yY9SaDGkCmiVB8483BxZHYNsBjwLx9iXE6 vqdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=UW5UZuZQ0oCakyDm1OrIR3KnP97lSihJxj8odOMQXzg=; b=VXid+AkHIXfZNm39LHNzPqVhR44xgAGNh/oHYvjzjMms3oRDTk7f87Yc5jXbzhpm7J 23z6ELdJHBnt3I0fcEuKQWEbhLOugq4icgvnt8uh4VI0xrlXKoVk7hMNdux3j0HMZdwA DLIzykL0wClpFSru+Zq/XTsCJ4gNz3wCoc4Sor92wyOgGwqvwakjsiG4dc1E9WiH53zp iBfK/MnCVTGblbkBfa2YWBbnpiGMEDE1J/mUKB8tWXzFj2Po4X0Wtbuj8+q+6S0RPVxa qShqtX70HHzQZP1Hw77MKhtJhYm55vT3wpka/mlNacJz7mHTc6BBOHswUGZizXTbw4iZ yUfg== X-Gm-Message-State: APt69E2rde7HLUTXzK2cL/96BdyKOOfH+pVkabcFyNxPT3BxOjLpuytp 0lnekMYp1UfUBGAS16O2LZ87Vq+7h1f13P9i5Jh14g== X-Google-Smtp-Source: ADUXVKJH+X3Mn+v4lHnNv75WmeRks5RIKFg+MBL+i40nKNfWbkFsgFnZsRq+LM6F6X65B+4MtfpjE/84LafpIBUj5Gw= X-Received: by 2002:a6b:284b:: with SMTP id o72-v6mr289040ioo.168.1528741221295; Mon, 11 Jun 2018 11:20:21 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:d028:0:0:0:0:0 with HTTP; Mon, 11 Jun 2018 11:20:20 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <344AA709-2DF7-405C-AB4D-4F0978834EA1@FreeBSD.org> References: <201806110132.w5B1WI5d094546@repo.freebsd.org> <344AA709-2DF7-405C-AB4D-4F0978834EA1@FreeBSD.org> From: Warner Losh Date: Mon, 11 Jun 2018 12:20:20 -0600 X-Google-Sender-Auth: B7NCI5sElFOp5MOC-xPpdfLw2QI Message-ID: Subject: Re: svn commit: r334939 - head/stand/lua To: Devin Teske Cc: Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 18:20:22 -0000 On Mon, Jun 11, 2018 at 11:54 AM, Devin Teske wrote: > > On Jun 11, 2018, at 7:07 AM, Warner Losh wrote: > > > > On Mon, Jun 11, 2018 at 7:36 AM, Devin Teske wrote: > >> >> >> > On Jun 10, 2018, at 6:32 PM, Kyle Evans wrote: >> > >> > Author: kevans >> > Date: Mon Jun 11 01:32:18 2018 >> > New Revision: 334939 >> > URL: https://svnweb.freebsd.org/changeset/base/334939 >> > >> > Log: >> > lualoader: Allow brand-*.lua for adding new brands >> > >> > dteske@, I believe, had originally pointed out that lualoader failed >> to >> > allow logo-*.lua for new logos to be added. When correcting this >> mistake, I >> > failed to do the same for brands. >> > >> >> You=E2=80=99re doing an amazing job, Kyle. >> >> I continually see nothing but genuine effort toward feature parity which >> makes me think one day I can pass the reigns. >> >> Yeah, I will always love Forth. It will always hold a special place in m= y >> heart as that whacky language that simultaneously exudes great power whi= le >> also having the image ability to induce vomiting =F0=9F=A4=AE by the uni= nitiated. >> >> However, all that being said, I=E2=80=99d actually like to keep the Ficl= boot >> stuff as an option through to 14.0 and here is why ... >> >> Last year we were looking to update from ficl3 to ficl4. That may not >> sound too exciting to most folks, but most folks don=E2=80=99t know the = power that >> ficl4 brings =E2=80=94 like the capability to use full networking in the= loader! >> Can lua do that? How cool would it be to be able to communicate with the >> network from the loader before the kernel is even loaded into memory? I = had >> a few hair-brained schemes left for Forth which might be exciting, lol >> > > The current boot loader can already communicate via NFS or TFTP today. > Adding http would be easy, https would be harder due to crypto being huge > and space being small (though bear ssl might be small enough). > > The last articulated plan in arch@ was that LUA will be default in 12, > and we plan to remove FORTH in 13. Last time I said it there in February, > there was only email agreeing that I could find. This matches the in-pers= on > consensus poll I took at BSDcan as well. I think it would take a very > extraordinary set circumstance and severe problems with LUA to change tho= se > plans. > > > At BSD Can there was the boot working group where we discussed that an FC= P > would be required to decide this. > In the working group you weren't listening and being rather combative and demanding that I do stuff, so I stopped talking. It should not be taken as a sign of my consent, but more a sign of not wanting to get into a yelling match in public on a topic I thought had been settled months ago. I raised my desires that I would like to be able to flip a knob in 13 and > reboot between Ficl and Lua, back and forth. > > Give people a choice until we have done a "shake-out" through an entire > major version. > > An honest-to-goodness procession would be, in my mind: > > 13: Has both; both are installed. End-user can boot back and forth betwee= n > the two > > Problems that arise in one or the other are non-critical because there is > always an "out" by running the other. > > 14: Has both but both are not installed. The installer media doesn't even > have it. You can't install the Forth booth stuff unless you twist a knob = in > buildworld, optionally going down the path of generating release media > which has the Forth boot stuff. > > 15. It's removed from tree. You can't build Forth boot. Lua only. No > looking back, no way to build it with Forth, to get Ficl you need to go t= o > ports. A Ficl with FreeBSD boot words no longer exists and is no longer > maintained. All of bhyve userboot also therefore uses Lua. > That's way too long. 12 will have Lua by default, but you can build FORTH if you want has been the plan since February when I socialized this on arch= @. I originally pitched coexistence, but there was little appetite for that. So I think a FCP discussed in arch@ is the right path forward. Warner From owner-svn-src-head@freebsd.org Mon Jun 11 18:40:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 944AD100561B; Mon, 11 Jun 2018 18:40:55 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1247D758FB; Mon, 11 Jun 2018 18:40:54 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w5BIepGw029406; Mon, 11 Jun 2018 11:40:51 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w5BIepul029405; Mon, 11 Jun 2018 11:40:51 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806111840.w5BIepul029405@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r334962 - head/sys/kern In-Reply-To: <201806111710.w5BHAKr1069743@repo.freebsd.org> To: Matt Macy Date: Mon, 11 Jun 2018 11:40:51 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 18:40:55 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: mmacy > Date: Mon Jun 11 17:10:19 2018 > New Revision: 334962 > URL: https://svnweb.freebsd.org/changeset/base/334962 > > Log: > limit change to fixing controlp handling pending review It is best to write commit messages that stand alone, as at a later time when reading the log for this file the null relative reference here may take some one a time to figure out. limit change of rXXXXXX to fixing controlp handling... or something more direct would be better in the future as one does not usually have the mail thread handy at the time of log reading. Thanks, Rod > Modified: > head/sys/kern/uipc_socket.c > > Modified: head/sys/kern/uipc_socket.c > ============================================================================== > --- head/sys/kern/uipc_socket.c Mon Jun 11 16:33:36 2018 (r334961) > +++ head/sys/kern/uipc_socket.c Mon Jun 11 17:10:19 2018 (r334962) > @@ -2180,8 +2180,6 @@ soreceive_stream(struct socket *so, struct sockaddr ** > flags = *flagsp &~ MSG_EOR; > else > flags = 0; > - if (flags & (MSG_PEEK|MSG_WAITALL)) > - return (soreceive_generic(so, psa, uio, mp0, controlp, flagsp)); > if (controlp != NULL) > *controlp = NULL; > if (flags & MSG_OOB) > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Jun 11 18:44:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F5571005F24; Mon, 11 Jun 2018 18:44:57 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5414775DBE; Mon, 11 Jun 2018 18:44:57 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 35E851F4DC; Mon, 11 Jun 2018 18:44:57 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5BIivuL020864; Mon, 11 Jun 2018 18:44:57 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5BIiuIO020862; Mon, 11 Jun 2018 18:44:56 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806111844.w5BIiuIO020862@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 11 Jun 2018 18:44:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334964 - in head: share/man/man4 sys/dev/usb/net X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/usb/net X-SVN-Commit-Revision: 334964 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 18:44:57 -0000 Author: emaste Date: Mon Jun 11 18:44:56 2018 New Revision: 334964 URL: https://svnweb.freebsd.org/changeset/base/334964 Log: if_muge: add LAN7850 support Differences between LAN7800 and LAN7850 from the driver's perspective: * The LAN7800 muxes EEPROM signals with LEDs, so LED mode needs to be disabled when reading/writing EEPROM. The EEPROM is not muxed on the LAN7850. * The Linux driver enables automatic duplex and speed detection when there is no EEPROM, for the LAN7800 only. With this FreeBSD driver LAN7850-based adapters without a configuration EEPROM fail to link (with or without the automatic duplex and speed detection code), so I have just followed the example of the Linux driver for now. Sponsored by: The FreeBSD Foundation Sponsored by: Microchip (hardware) Modified: head/share/man/man4/muge.4 head/sys/dev/usb/net/if_muge.c Modified: head/share/man/man4/muge.4 ============================================================================== --- head/share/man/man4/muge.4 Mon Jun 11 17:22:27 2018 (r334963) +++ head/share/man/man4/muge.4 Mon Jun 11 18:44:56 2018 (r334964) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 17, 2018 +.Dd June 11, 2018 .Dt MUGE 4 .Os .Sh NAME @@ -56,6 +56,8 @@ driver supports: .It Microchip LAN7800 USB 3.1 Gigabit Ethernet controller with PHY .It +Microchip LAN7850 USB 2.0 Gigabit Ethernet controller with PHY +.It Microchip LAN7515 USB 2 hub and Gigabit Ethernet controller with PHY .El .Sh SEE ALSO @@ -68,3 +70,6 @@ The .Nm device driver first appeared in .Fx 12.0 . +.Sh BUGS +USB-Ethernet adapters that use the LAN7850 without a configuration EEPROM +will not work. Modified: head/sys/dev/usb/net/if_muge.c ============================================================================== --- head/sys/dev/usb/net/if_muge.c Mon Jun 11 17:22:27 2018 (r334963) +++ head/sys/dev/usb/net/if_muge.c Mon Jun 11 18:44:56 2018 (r334964) @@ -40,6 +40,9 @@ __FBSDID("$FreeBSD$"); * USB 3.1 to 10/100/1000 Mbps Ethernet * LAN7800 http://www.microchip.com/wwwproducts/en/LAN7800 * + * USB 2.0 to 10/100/1000 Mbps Ethernet + * LAN7850 http://www.microchip.com/wwwproducts/en/LAN7850 + * * USB 2 to 10/100/1000 Mbps Ethernet with built-in USB hub * LAN7515 (no datasheet available, but probes and functions as LAN7800) * @@ -386,11 +389,14 @@ lan78xx_eeprom_read_raw(struct muge_softc *sc, uint16_ if (!locked) MUGE_LOCK(sc); - err = lan78xx_read_reg(sc, ETH_HW_CFG, &val); - saved = val; + if (sc->chipid == ETH_ID_REV_CHIP_ID_7800_) { + /* EEDO/EECLK muxed with LED0/LED1 on LAN7800. */ + err = lan78xx_read_reg(sc, ETH_HW_CFG, &val); + saved = val; - val &= ~(ETH_HW_CFG_LEDO_EN_ | ETH_HW_CFG_LED1_EN_); - err = lan78xx_write_reg(sc, ETH_HW_CFG, val); + val &= ~(ETH_HW_CFG_LEDO_EN_ | ETH_HW_CFG_LED1_EN_); + err = lan78xx_write_reg(sc, ETH_HW_CFG, val); + } err = lan78xx_wait_for_bits(sc, ETH_E2P_CMD, ETH_E2P_CMD_BUSY_); if (err != 0) { @@ -432,7 +438,10 @@ lan78xx_eeprom_read_raw(struct muge_softc *sc, uint16_ done: if (!locked) MUGE_UNLOCK(sc); - lan78xx_write_reg(sc, ETH_HW_CFG, saved); + if (sc->chipid == ETH_ID_REV_CHIP_ID_7800_) { + /* Restore saved LED configuration. */ + lan78xx_write_reg(sc, ETH_HW_CFG, saved); + } return (err); } @@ -982,7 +991,11 @@ lan78xx_chip_init(struct muge_softc *sc) } sc->chipid = (buf & ETH_ID_REV_CHIP_ID_MASK_) >> 16; sc->chiprev = buf & ETH_ID_REV_CHIP_REV_MASK_; - if (sc->chipid != ETH_ID_REV_CHIP_ID_7800_) { + switch (sc->chipid) { + case ETH_ID_REV_CHIP_ID_7800_: + case ETH_ID_REV_CHIP_ID_7850_: + break; + default: muge_warn_printf(sc, "Chip ID 0x%04x not yet supported\n", sc->chipid); goto init_failed; @@ -1078,9 +1091,12 @@ lan78xx_chip_init(struct muge_softc *sc) goto init_failed; } - /* Enable automatic duplex detection and automatic speed detection. */ err = lan78xx_read_reg(sc, ETH_MAC_CR, &buf); - buf |= ETH_MAC_CR_AUTO_DUPLEX_ | ETH_MAC_CR_AUTO_SPEED_; + if (sc->chipid == ETH_ID_REV_CHIP_ID_7800_ && + !lan78xx_eeprom_present(sc)) { + /* Set automatic duplex and speed on LAN7800 without EEPROM. */ + buf |= ETH_MAC_CR_AUTO_DUPLEX_ | ETH_MAC_CR_AUTO_SPEED_; + } err = lan78xx_write_reg(sc, ETH_MAC_CR, buf); /* From owner-svn-src-head@freebsd.org Mon Jun 11 18:57:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AEC61007CE2; Mon, 11 Jun 2018 18:57:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 16EE076730; Mon, 11 Jun 2018 18:57:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E88C91F66B; Mon, 11 Jun 2018 18:57:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5BIveIh025793; Mon, 11 Jun 2018 18:57:40 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5BIve23025792; Mon, 11 Jun 2018 18:57:40 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806111857.w5BIve23025792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 11 Jun 2018 18:57:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334965 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 334965 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 18:57:41 -0000 Author: emaste Date: Mon Jun 11 18:57:40 2018 New Revision: 334965 URL: https://svnweb.freebsd.org/changeset/base/334965 Log: makesyscalls: simplify capenabled pipeline Replace cat + 2x grep with one grep. Sponsored by: Turing Robotic Industries Modified: head/sys/kern/makesyscalls.sh Modified: head/sys/kern/makesyscalls.sh ============================================================================== --- head/sys/kern/makesyscalls.sh Mon Jun 11 18:44:56 2018 (r334964) +++ head/sys/kern/makesyscalls.sh Mon Jun 11 18:57:40 2018 (r334965) @@ -47,7 +47,7 @@ systracetmp="systrace.$$" systraceret="systraceret.$$" if [ -r capabilities.conf ]; then - capenabled=`cat capabilities.conf | grep -v "^#" | grep -v "^$"` + capenabled=`egrep -v '^#|^$' capabilities.conf` capenabled=`echo $capenabled | sed 's/ /,/g'` else capenabled="" From owner-svn-src-head@freebsd.org Mon Jun 11 19:00:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2AAF1008279; Mon, 11 Jun 2018 19:00:08 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5A3E7695D; Mon, 11 Jun 2018 19:00:08 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D9F61F670; Mon, 11 Jun 2018 19:00:08 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5BJ08lr026001; Mon, 11 Jun 2018 19:00:08 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5BJ08to025999; Mon, 11 Jun 2018 19:00:08 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201806111900.w5BJ08to025999@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 11 Jun 2018 19:00:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334966 - in head/sys/fs: nfs nfsclient X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in head/sys/fs: nfs nfsclient X-SVN-Commit-Revision: 334966 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 19:00:09 -0000 Author: rmacklem Date: Mon Jun 11 19:00:07 2018 New Revision: 334966 URL: https://svnweb.freebsd.org/changeset/base/334966 Log: Add a couple of safety belt checks to the NFSv4.1 client related to sessions. There were a couple of cases in newnfs_request() that it assumed that it was an NFSv4.1 mount with a session. This should always be the case when a Sequence operation is in the reply or the server replies NFSERR_BADSESSION. However, if a server was broken and sent an erroneous reply, these safety belt checks should avoid trouble. The one check required a small tweak to nfsmnt_mdssession() so that it returns NULL when there is no session instead of the offset of the field in the structure (0x8 for i386). This patch should have no effect on normal operation of the client. Found by inspection during pNFS server development. MFC after: 2 weeks Modified: head/sys/fs/nfs/nfs_commonkrpc.c head/sys/fs/nfsclient/nfsmount.h Modified: head/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- head/sys/fs/nfs/nfs_commonkrpc.c Mon Jun 11 18:57:40 2018 (r334965) +++ head/sys/fs/nfs/nfs_commonkrpc.c Mon Jun 11 19:00:07 2018 (r334966) @@ -852,9 +852,9 @@ tryagain: if ((nmp != NULL && i == NFSV4OP_SEQUENCE && j != 0) || (clp != NULL && i == NFSV4OP_CBSEQUENCE && j != 0)) NFSCL_DEBUG(1, "failed seq=%d\n", j); - if ((nmp != NULL && i == NFSV4OP_SEQUENCE && j == 0) || - (clp != NULL && i == NFSV4OP_CBSEQUENCE && j == 0) - ) { + if (((nmp != NULL && i == NFSV4OP_SEQUENCE && j == 0) || + (clp != NULL && i == NFSV4OP_CBSEQUENCE && + j == 0)) && sep != NULL) { if (i == NFSV4OP_SEQUENCE) NFSM_DISSECT(tl, uint32_t *, NFSX_V4SESSIONID + @@ -896,7 +896,8 @@ tryagain: } if (nd->nd_repstat != 0) { if (nd->nd_repstat == NFSERR_BADSESSION && - nmp != NULL && dssep == NULL) { + nmp != NULL && dssep == NULL && + (nd->nd_flag & ND_NFSV41) != 0) { /* * If this is a client side MDS RPC, mark * the MDS session defunct and initiate Modified: head/sys/fs/nfsclient/nfsmount.h ============================================================================== --- head/sys/fs/nfsclient/nfsmount.h Mon Jun 11 18:57:40 2018 (r334965) +++ head/sys/fs/nfsclient/nfsmount.h Mon Jun 11 19:00:07 2018 (r334966) @@ -129,8 +129,10 @@ nfsmnt_mdssession(struct nfsmount *nmp) { struct nfsclsession *tsep; + tsep = NULL; mtx_lock(&nmp->nm_mtx); - tsep = NFSMNT_MDSSESSION(nmp); + if (TAILQ_FIRST(&nmp->nm_sess) != NULL) + tsep = NFSMNT_MDSSESSION(nmp); mtx_unlock(&nmp->nm_mtx); return (tsep); } From owner-svn-src-head@freebsd.org Mon Jun 11 19:07:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19A1A1009506 for ; Mon, 11 Jun 2018 19:07:34 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic317-27.consmr.mail.bf2.yahoo.com (sonic317-27.consmr.mail.bf2.yahoo.com [74.6.129.82]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5AA6177166 for ; Mon, 11 Jun 2018 19:07:33 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: _4FqbOYVM1nHKMwUHEq5soYjVVgFiPIKKD3cJwkj.Cs77cwh.AndWrCeWGUlgo_ 0rkUYQvbagaTdOoAt4CwTCTdu08XyEd9PJex.uUM7G.rn7QrqdbnvK4YnM7ihb.Wxa7U.sbLmd1h iL.qhWLqH6N2l6nCoiibIEQZWSoIvOI86mnssAUxkGgTrYQI0Is9KYZLudeL4Z4CFZPJvBzjDKGM qLpN1kUL0AcmuxtiAQle5dGvWJ4SZ7lwk65zNu9EI3QOTo4w3QpdZCfTcWscVfQKi4.BMk4u4N_k ZZcP8yhEN0EMbDRysxC53Uh1TgZyif_lCnOM0SIoW2LeAmDbJ8PUzbJK4HDdVbPrQ5nuKTCCqCxP uK4KraQLQihM9iLjhEKcVbXFzkyGFSQsbE2GSjoXEYDRXU_BWN3jJq5YNtrL4eXAnyTZm1IJk6wp i5gUjsyg0ekKkDAqV9Gc1sdTlFUVHUB88vKRRqqdG4PkegN.yauk1ReMG6KnrTdyJqn6A5PfAmDR OlMN5q_cgEHrFwD3FHH0.m8wbA0OEARVs0VbRWbdHI_6_cN2NBx5RpklIhSZWChrdbcbZPqeUqOr DASNViOKWLtzTnEF87TIAUPkCeQ1h3h4ZUeVVqG2mQOrvT9Vlh4sLytKN6TcfSRWm4_uhW1hx4Hj N5LV1EBteg6QHs2GDy01Y_LjiWFX8eHfz Received: from sonic.gate.mail.ne1.yahoo.com by sonic317.consmr.mail.bf2.yahoo.com with HTTP; Mon, 11 Jun 2018 19:07:32 +0000 Received: from ip70-189-131-151.lv.lv.cox.net (EHLO [192.168.0.109]) ([70.189.131.151]) by smtp431.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 90e3b025b41a688bc6bf6801b31946a2; Mon, 11 Jun 2018 19:07:28 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Subject: Re: svn commit: r334964 - in head: share/man/man4 sys/dev/usb/net broke powerpcspe builds on ci.freebsd.org Message-Id: <9AA7273A-BBE5-4739-8E60-11E043D9C9D6@yahoo.com> Date: Mon, 11 Jun 2018 12:07:26 -0700 To: Ed Maste , FreeBSD PowerPC ML , FreeBSD Current , svn-src-head@freebsd.org X-Mailer: Apple Mail (2.3445.8.2) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 19:07:34 -0000 =46rom = https://ci.freebsd.org/job/FreeBSD-head-powerpcspe-build/6174/consoleText = : --- all_subdir_usb/muge --- cc1: warnings being treated as errors /usr/src/sys/dev/usb/net/if_muge.c: In function 'lan78xx_chip_init': /usr/src/sys/dev/usb/net/if_muge.c:1096: warning: implicit declaration = of function 'lan78xx_eeprom_present' /usr/src/sys/dev/usb/net/if_muge.c:1096: warning: nested extern = declaration of 'lan78xx_eeprom_present' [-Wnested-externs] *** [if_muge.o] Error code 1 =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Mon Jun 11 19:12:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA0A0100A4DC; Mon, 11 Jun 2018 19:12:51 +0000 (UTC) (envelope-from db@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C9FB77877; Mon, 11 Jun 2018 19:12:51 +0000 (UTC) (envelope-from db@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4E2381F9A1; Mon, 11 Jun 2018 19:12:51 +0000 (UTC) (envelope-from db@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5BJCpXY036325; Mon, 11 Jun 2018 19:12:51 GMT (envelope-from db@FreeBSD.org) Received: (from db@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5BJCpob036324; Mon, 11 Jun 2018 19:12:51 GMT (envelope-from db@FreeBSD.org) Message-Id: <201806111912.w5BJCpob036324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: db set sender to db@FreeBSD.org using -f From: Diane Bruce Date: Mon, 11 Jun 2018 19:12:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334968 - head/sbin/dump X-SVN-Group: head X-SVN-Commit-Author: db X-SVN-Commit-Paths: head/sbin/dump X-SVN-Commit-Revision: 334968 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 19:12:51 -0000 Author: db (ports committer) Date: Mon Jun 11 19:12:50 2018 New Revision: 334968 URL: https://svnweb.freebsd.org/changeset/base/334968 Log: Large file systems with inodes > 512K have been silently overflowing c_addr in spcl. So check before we start dumping otherwise we can end up with a corrupted dump. PR: 228807 Submitted by: db Reviewed by: imp Approved by: imp Modified: head/sbin/dump/main.c (contents, props changed) Modified: head/sbin/dump/main.c ============================================================================== --- head/sbin/dump/main.c Mon Jun 11 19:03:49 2018 (r334967) +++ head/sbin/dump/main.c Mon Jun 11 19:12:50 2018 (r334968) @@ -103,6 +103,7 @@ main(int argc, char *argv[]) int i, ret, anydirskipped, bflag = 0, Tflag = 0, honorlevel = 1; int just_estimate = 0; ino_t maxino; + int c_count=0; char *tmsg; spcl.c_date = _time_to_time64(time(NULL)); @@ -433,7 +434,6 @@ main(int argc, char *argv[]) msgtail("to %s\n", tape); sync(); - sblock = NULL; if ((ret = sbget(diskfd, &sblock, -1)) != 0) { switch (ret) { case ENOENT: @@ -453,6 +453,9 @@ main(int argc, char *argv[]) quit("TP_BSIZE (%d) is not a power of 2", TP_BSIZE); maxino = sblock->fs_ipg * sblock->fs_ncg; mapsize = roundup(howmany(maxino, CHAR_BIT), TP_BSIZE); + c_count = howmany(mapsize * sizeof(char), TP_BSIZE); + if (c_count > TP_NINDIR) + quit("fs is too large for dump!"); usedinomap = (char *)calloc((unsigned) mapsize, sizeof(char)); dumpdirmap = (char *)calloc((unsigned) mapsize, sizeof(char)); dumpinomap = (char *)calloc((unsigned) mapsize, sizeof(char)); From owner-svn-src-head@freebsd.org Mon Jun 11 19:32:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FCB8100D9DB; Mon, 11 Jun 2018 19:32:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CF5A878AAF; Mon, 11 Jun 2018 19:32:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B1CA81FCEE; Mon, 11 Jun 2018 19:32:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5BJWaHO045927; Mon, 11 Jun 2018 19:32:36 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5BJWaL4045925; Mon, 11 Jun 2018 19:32:36 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806111932.w5BJWaL4045925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 11 Jun 2018 19:32:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334969 - head/sbin/dump X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/dump X-SVN-Commit-Revision: 334969 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 19:32:37 -0000 Author: imp Date: Mon Jun 11 19:32:36 2018 New Revision: 334969 URL: https://svnweb.freebsd.org/changeset/base/334969 Log: Add asserts to prevent overflows of c_addr. Add some asserts that prevents the overflows of c_addr. This can't happen, absent bugs. However, certain large filesystems can cause problems. These have been prevented by r334968, but a solution is needed. These asserts will help assure that solution is correct. PR: 228807 Reviewed by: db Modified: head/sbin/dump/tape.c head/sbin/dump/traverse.c Modified: head/sbin/dump/tape.c ============================================================================== --- head/sbin/dump/tape.c Mon Jun 11 19:12:50 2018 (r334968) +++ head/sbin/dump/tape.c Mon Jun 11 19:32:36 2018 (r334969) @@ -47,6 +47,7 @@ static const char rcsid[] = #include +#include #include #include #include @@ -279,6 +280,7 @@ flushtape(void) blks = 0; if (spcl.c_type != TS_END) { + assert(spcl.c_count <= TP_NINDIR); for (i = 0; i < spcl.c_count; i++) if (spcl.c_addr[i] != 0) blks++; Modified: head/sbin/dump/traverse.c ============================================================================== --- head/sbin/dump/traverse.c Mon Jun 11 19:12:50 2018 (r334968) +++ head/sbin/dump/traverse.c Mon Jun 11 19:32:36 2018 (r334969) @@ -46,6 +46,7 @@ static const char rcsid[] = #include +#include #include #include #include @@ -637,6 +638,7 @@ ufs1_blksout(ufs1_daddr_t *blkp, int frags, ino_t ino) count = blks; else count = i + TP_NINDIR; + assert(count <= TP_NINDIR + i); for (j = i; j < count; j++) if (blkp[j / tbperdb] != 0) spcl.c_addr[j - i] = 1; @@ -689,6 +691,7 @@ ufs2_blksout(union dinode *dp, ufs2_daddr_t *blkp, int count = blks; else count = i + TP_NINDIR; + assert(count <= TP_NINDIR + i); for (j = i; j < count; j++) if (blkp[j / tbperdb] != 0) spcl.c_addr[j - i] = 1; @@ -753,6 +756,7 @@ appendextdata(union dinode *dp) * data by the writeextdata() routine. */ tbperdb = sblock->fs_bsize >> tp_bshift; + assert(spcl.c_count + blks < TP_NINDIR); for (i = 0; i < blks; i++) if (&dp->dp2.di_extb[i / tbperdb] != 0) spcl.c_addr[spcl.c_count + i] = 1; From owner-svn-src-head@freebsd.org Mon Jun 11 19:32:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5E85100DA50; Mon, 11 Jun 2018 19:32:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 987B378AF6; Mon, 11 Jun 2018 19:32:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 358411FCF0; Mon, 11 Jun 2018 19:32:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5BJWfS9045994; Mon, 11 Jun 2018 19:32:41 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5BJWfCd045993; Mon, 11 Jun 2018 19:32:41 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806111932.w5BJWfCd045993@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 11 Jun 2018 19:32:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334970 - head X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 334970 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 19:32:44 -0000 Author: imp Date: Mon Jun 11 19:32:40 2018 New Revision: 334970 URL: https://svnweb.freebsd.org/changeset/base/334970 Log: Document the dump issue in UPDATING so people understand when they get a new diagnostic. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Jun 11 19:32:36 2018 (r334969) +++ head/UPDATING Mon Jun 11 19:32:40 2018 (r334970) @@ -32,6 +32,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20180611: + A bug in dump has been found where it can incorrectly dump filesystems + with more than 512k inodes and produce corrupted dump images. r334968 + closes the door by not dumping filesystems with more than 512k inodes. + While older dumps may 'work' the image they produce may or may not be + readable depending on many factors. + 20180530: The kernel / userland interface for devinfo changed, so you'll need a new kernel and userland as a pair for it to work (rebuilding From owner-svn-src-head@freebsd.org Mon Jun 11 19:32:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5789100DA64; Mon, 11 Jun 2018 19:32:45 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 88DF678B9C; Mon, 11 Jun 2018 19:32:45 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B7D21FCF2; Mon, 11 Jun 2018 19:32:45 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5BJWjQJ046045; Mon, 11 Jun 2018 19:32:45 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5BJWjFX046044; Mon, 11 Jun 2018 19:32:45 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806111932.w5BJWjFX046044@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 11 Jun 2018 19:32:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334971 - head/sbin/dump X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/dump X-SVN-Commit-Revision: 334971 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 19:32:46 -0000 Author: imp Date: Mon Jun 11 19:32:45 2018 New Revision: 334971 URL: https://svnweb.freebsd.org/changeset/base/334971 Log: Document the newly enforced 524288 inode restriction. Modified: head/sbin/dump/dump.8 Modified: head/sbin/dump/dump.8 ============================================================================== --- head/sbin/dump/dump.8 Mon Jun 11 19:32:40 2018 (r334970) +++ head/sbin/dump/dump.8 Mon Jun 11 19:32:45 2018 (r334971) @@ -29,7 +29,7 @@ .\" @(#)dump.8 8.3 (Berkeley) 5/1/95 .\" $FreeBSD$ .\" -.Dd October 3, 2016 +.Dd June 11, 2018 .Dt DUMP 8 .Os .Sh NAME @@ -566,3 +566,8 @@ This will be fixed in a later version of .Fx . Presently, it works if you set it setuid (like it used to be), but this might constitute a security risk. +.Pp +It is not possible to safely dump filesystems that use more than +524288 inodes. +.Nm +refuses to dump any filesystem that has more than 524288 inodes. From owner-svn-src-head@freebsd.org Mon Jun 11 19:32:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43045100DAE7; Mon, 11 Jun 2018 19:32:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 17A1578C85; Mon, 11 Jun 2018 19:32:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F4FE1FCF3; Mon, 11 Jun 2018 19:32:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5BJWnL2046099; Mon, 11 Jun 2018 19:32:49 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5BJWnuq046098; Mon, 11 Jun 2018 19:32:49 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806111932.w5BJWnuq046098@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 11 Jun 2018 19:32:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334972 - head/sbin/dump X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/dump X-SVN-Commit-Revision: 334972 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 19:32:52 -0000 Author: imp Date: Mon Jun 11 19:32:49 2018 New Revision: 334972 URL: https://svnweb.freebsd.org/changeset/base/334972 Log: Minor style polishing. Declare c_count and initialize it with other ints. Reported by: mjg@ Modified: head/sbin/dump/main.c Modified: head/sbin/dump/main.c ============================================================================== --- head/sbin/dump/main.c Mon Jun 11 19:32:45 2018 (r334971) +++ head/sbin/dump/main.c Mon Jun 11 19:32:49 2018 (r334972) @@ -101,9 +101,8 @@ main(int argc, char *argv[]) char *map, *mntpt; int ch, mode, mntflags; int i, ret, anydirskipped, bflag = 0, Tflag = 0, honorlevel = 1; - int just_estimate = 0; + int just_estimate = 0, c_count = 0; ino_t maxino; - int c_count=0; char *tmsg; spcl.c_date = _time_to_time64(time(NULL)); From owner-svn-src-head@freebsd.org Mon Jun 11 19:34:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BBB7100E002; Mon, 11 Jun 2018 19:34:48 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D549879072; Mon, 11 Jun 2018 19:34:47 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6D591FCF5; Mon, 11 Jun 2018 19:34:47 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5BJYlTZ046245; Mon, 11 Jun 2018 19:34:47 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5BJYlnb046244; Mon, 11 Jun 2018 19:34:47 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806111934.w5BJYlnb046244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 11 Jun 2018 19:34:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334973 - head/sys/dev/usb/net X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/dev/usb/net X-SVN-Commit-Revision: 334973 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 19:34:48 -0000 Author: emaste Date: Mon Jun 11 19:34:47 2018 New Revision: 334973 URL: https://svnweb.freebsd.org/changeset/base/334973 Log: if_muge: retire lan78xx_eeprom_read lan78xx_eeprom_read just checked for EEPROM presence then called lan78xx_eeprom_read_raw if present, and had only one caller. Introduce lan78xx_eeprom_present to check for EEPROM presence, and use it in the one place it is needed. This is used by r334964, which was accidentally committed out-of-order from my work tree. Reported by: markj Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/usb/net/if_muge.c Modified: head/sys/dev/usb/net/if_muge.c ============================================================================== --- head/sys/dev/usb/net/if_muge.c Mon Jun 11 19:32:49 2018 (r334972) +++ head/sys/dev/usb/net/if_muge.c Mon Jun 11 19:34:47 2018 (r334973) @@ -445,32 +445,14 @@ done: return (err); } -/** - * lan78xx_eeprom_read - Read EEPROM and confirm it is programmed - * @sc: soft context - * @off: the eeprom address offset - * @buf: stores the bytes - * @buflen: the number of bytes to read - * - * RETURNS: - * 0 on success, or a USB_ERR_?? error code on failure. - */ -static int -lan78xx_eeprom_read(struct muge_softc *sc, uint16_t off, uint8_t *buf, - uint16_t buflen) +static bool +lan78xx_eeprom_present(struct muge_softc *sc) { - uint8_t sig; int ret; + uint8_t sig; ret = lan78xx_eeprom_read_raw(sc, ETH_E2P_INDICATOR_OFFSET, &sig, 1); - if ((ret == 0) && (sig == ETH_E2P_INDICATOR)) { - ret = lan78xx_eeprom_read_raw(sc, off, buf, buflen); - muge_dbg_printf(sc, "EEPROM present\n"); - } else { - ret = -EINVAL; - muge_dbg_printf(sc, "EEPROM not present\n"); - } - return (ret); + return (ret == 0 && sig == ETH_E2P_INDICATOR); } /** @@ -1487,7 +1469,8 @@ muge_attach_post(struct usb_ether *ue) /* If RX_ADDRx did not provide a valid MAC address, try EEPROM. */ if (!ETHER_IS_VALID(sc->sc_ue.ue_eaddr)) { - if ((lan78xx_eeprom_read(sc, ETH_E2P_MAC_OFFSET, + if ((lan78xx_eeprom_present(sc) && + lan78xx_eeprom_read_raw(sc, ETH_E2P_MAC_OFFSET, sc->sc_ue.ue_eaddr, ETHER_ADDR_LEN) == 0) || (lan78xx_otp_read(sc, OTP_MAC_OFFSET, sc->sc_ue.ue_eaddr, ETHER_ADDR_LEN) == 0)) { From owner-svn-src-head@freebsd.org Mon Jun 11 19:35:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49F0A100E26A; Mon, 11 Jun 2018 19:35:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EF9EB7924E; Mon, 11 Jun 2018 19:35:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D0B5B1FCF6; Mon, 11 Jun 2018 19:35:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5BJZfFe046334; Mon, 11 Jun 2018 19:35:41 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5BJZfA4046333; Mon, 11 Jun 2018 19:35:41 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806111935.w5BJZfA4046333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 11 Jun 2018 19:35:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334974 - head/sbin/dump X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/dump X-SVN-Commit-Revision: 334974 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 19:35:42 -0000 Author: imp Date: Mon Jun 11 19:35:41 2018 New Revision: 334974 URL: https://svnweb.freebsd.org/changeset/base/334974 Log: Don't initialize c_count. We don't need to. Modified: head/sbin/dump/main.c Modified: head/sbin/dump/main.c ============================================================================== --- head/sbin/dump/main.c Mon Jun 11 19:34:47 2018 (r334973) +++ head/sbin/dump/main.c Mon Jun 11 19:35:41 2018 (r334974) @@ -100,8 +100,8 @@ main(int argc, char *argv[]) struct fstab *dt; char *map, *mntpt; int ch, mode, mntflags; - int i, ret, anydirskipped, bflag = 0, Tflag = 0, honorlevel = 1; - int just_estimate = 0, c_count = 0; + int i, ret, anydirskipped, c_count, bflag = 0, Tflag = 0, honorlevel = 1; + int just_estimate = 0; ino_t maxino; char *tmsg; From owner-svn-src-head@freebsd.org Mon Jun 11 19:48:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7214C1010242; Mon, 11 Jun 2018 19:48:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2437779F7B; Mon, 11 Jun 2018 19:48:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 06DAE1FE8C; Mon, 11 Jun 2018 19:48:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5BJmF29052109; Mon, 11 Jun 2018 19:48:15 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5BJmF6h052108; Mon, 11 Jun 2018 19:48:15 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806111948.w5BJmF6h052108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 11 Jun 2018 19:48:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334975 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 334975 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 19:48:16 -0000 Author: emaste Date: Mon Jun 11 19:48:15 2018 New Revision: 334975 URL: https://svnweb.freebsd.org/changeset/base/334975 Log: muge.4: correct BUGS statement The EVB-LAN7850 I have does function with the EEPROM disabled - the link / activity LEDs just do not function. Sponsored by: The FreeBSD Foundation Modified: head/share/man/man4/muge.4 Modified: head/share/man/man4/muge.4 ============================================================================== --- head/share/man/man4/muge.4 Mon Jun 11 19:35:41 2018 (r334974) +++ head/share/man/man4/muge.4 Mon Jun 11 19:48:15 2018 (r334975) @@ -72,4 +72,4 @@ device driver first appeared in .Fx 12.0 . .Sh BUGS USB-Ethernet adapters that use the LAN7850 without a configuration EEPROM -will not work. +may not activate link or activity LEDs. From owner-svn-src-head@freebsd.org Mon Jun 11 19:52:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6958C1010E84; Mon, 11 Jun 2018 19:52:28 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E68037A5BC; Mon, 11 Jun 2018 19:52:27 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w5BJqQnt029752; Mon, 11 Jun 2018 12:52:26 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w5BJqQNU029751; Mon, 11 Jun 2018 12:52:26 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806111952.w5BJqQNU029751@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r334970 - head In-Reply-To: <201806111932.w5BJWfCd045993@repo.freebsd.org> To: Warner Losh Date: Mon, 11 Jun 2018 12:52:26 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 19:52:28 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: imp > Date: Mon Jun 11 19:32:40 2018 > New Revision: 334970 > URL: https://svnweb.freebsd.org/changeset/base/334970 > > Log: > Document the dump issue in UPDATING so people understand when they > get a new diagnostic. > > Modified: > head/UPDATING > > Modified: head/UPDATING > ============================================================================== > --- head/UPDATING Mon Jun 11 19:32:36 2018 (r334969) > +++ head/UPDATING Mon Jun 11 19:32:40 2018 (r334970) > @@ -32,6 +32,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: > "ln -s 'abort:false,junk:false' /etc/malloc.conf".) > > > +20180611: > + A bug in dump has been found where it can incorrectly dump filesystems > + with more than 512k inodes and produce corrupted dump images. r334968 > + closes the door by not dumping filesystems with more than 512k inodes. > + While older dumps may 'work' the image they produce may or may not be > + readable depending on many factors. > + Does it make since to put a temporary warning in newfs to warn users of the "may bot be able to dump this fs" issue? Regards, -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Jun 11 19:53:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D648F1011159 for ; Mon, 11 Jun 2018 19:53:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22c.google.com (mail-it0-x22c.google.com [IPv6:2607:f8b0:4001:c0b::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 63F297A76F for ; Mon, 11 Jun 2018 19:53:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22c.google.com with SMTP id m194-v6so11846336itg.2 for ; Mon, 11 Jun 2018 12:53:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=ZUiEXd6kQOXD0EYzSR1q+fxjDtJvCf10XTF1sIZP5CI=; b=r4HcmUCxc4Yf54qV5IGmEONxtVDOljS5AbBk5hZag64xnCc+5EtfEQl69/qDJ3I+EV oDF9hStEwVrPbKAksexLD+3kk4RfvdfCfUvdwO1akxpv50PdnsvMBiDXzoim2bYqZWfh rhQXYZGmSAl0BBgAul1XK2CaFnNRREWbb/It0OrwGrG0Cj/pA7yD0P94oAW4Eb2JUMrC 6nqniXvZIYeuSS6QKYAN+t2lJEq8icBZXA0khMfz2e25Krlc2xvclcau1THGt0qIvYiV vPKe3k0xZ5PRnwtT/ZBeNDEFuXED5oPXFv9Mc0g+BDQmOKSaOgaHAkJavyEta1g0+V6V aiNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=ZUiEXd6kQOXD0EYzSR1q+fxjDtJvCf10XTF1sIZP5CI=; b=hWRNXvhQ09NPPJRTu+GNSHDVxfteKIKj8CBT2jlf4tQSyPz0jtAC3nlDMOpzuOh2VZ COocWiwp3xSFNjblkAGdFgdpGMknDAb4NYuEkq1945vkZDk1EISMxRE4PQf62jpd6pXQ t15JiXXsKl6pljvMUj2YaJec3w+nIeTTp8oRPwot+mgjScNntgQZXMVsoUViIZHQHVu/ u3R1fslyiNh/5O0kIpGF/CgD3a/oWGhrgREEvU3/n+gU7rSu/xqmjCdH/JMdOsLW+iFQ xqhHFINr22n3rpo9jJe8lPR+eKTiHTvs4YvjYkMF3h448lWdfAtUxDPvUVQj6BYYQ+6n i7Fw== X-Gm-Message-State: APt69E3QVq/qzaJcc+77iLgIW0N8wPJdzn1Kmb7hE1f145caLN+QeOMA ojQfrNR9CwvxuDUVCm9K9zxlk1ZW61pIaXT6ld8ijQ== X-Google-Smtp-Source: ADUXVKJ2Z+Jpr+LxW899IhAVwin3RDFnuVu2tgFrX5FBZMdUkb/Q1FJyn1qZhOR4n0M4HmcrpHKQDDfvT/0uzHysdjo= X-Received: by 2002:a24:7c8d:: with SMTP id a135-v6mr376672itd.73.1528746818719; Mon, 11 Jun 2018 12:53:38 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:d028:0:0:0:0:0 with HTTP; Mon, 11 Jun 2018 12:53:38 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <201806111952.w5BJqQNU029751@pdx.rh.CN85.dnsmgr.net> References: <201806111932.w5BJWfCd045993@repo.freebsd.org> <201806111952.w5BJqQNU029751@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Mon, 11 Jun 2018 13:53:38 -0600 X-Google-Sender-Auth: 8X6A-PpjhF4uDy8L7px_Kh3anlQ Message-ID: Subject: Re: svn commit: r334970 - head To: "Rodney W. Grimes" Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 19:53:40 -0000 On Mon, Jun 11, 2018 at 1:52 PM, Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > [ Charset UTF-8 unsupported, converting... ] > > Author: imp > > Date: Mon Jun 11 19:32:40 2018 > > New Revision: 334970 > > URL: https://svnweb.freebsd.org/changeset/base/334970 > > > > Log: > > Document the dump issue in UPDATING so people understand when they > > get a new diagnostic. > > > > Modified: > > head/UPDATING > > > > Modified: head/UPDATING > > ============================================================ > ================== > > --- head/UPDATING Mon Jun 11 19:32:36 2018 (r334969) > > +++ head/UPDATING Mon Jun 11 19:32:40 2018 (r334970) > > @@ -32,6 +32,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: > > "ln -s 'abort:false,junk:false' /etc/malloc.conf".) > > > > > > +20180611: > > + A bug in dump has been found where it can incorrectly dump > filesystems > > + with more than 512k inodes and produce corrupted dump images. > r334968 > > + closes the door by not dumping filesystems with more than 512k > inodes. > > + While older dumps may 'work' the image they produce may or may not > be > > + readable depending on many factors. > > + > > Does it make since to put a temporary warning in newfs to warn users > of the "may bot be able to dump this fs" issue? > It does. However, there may have been an error in assessment, which I'm working through now. If so, there will be a revert. Warner From owner-svn-src-head@freebsd.org Mon Jun 11 20:01:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A7701012724; Mon, 11 Jun 2018 20:01:54 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B720F7AE40; Mon, 11 Jun 2018 20:01:53 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w5BK1nmH029845; Mon, 11 Jun 2018 13:01:49 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w5BK1mGk029844; Mon, 11 Jun 2018 13:01:48 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806112001.w5BK1mGk029844@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r334970 - head In-Reply-To: To: Warner Losh Date: Mon, 11 Jun 2018 13:01:48 -0700 (PDT) CC: "Rodney W. Grimes" , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 20:01:54 -0000 [ Charset UTF-8 unsupported, converting... ] > On Mon, Jun 11, 2018 at 1:52 PM, Rodney W. Grimes < > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > [ Charset UTF-8 unsupported, converting... ] > > > Author: imp > > > Date: Mon Jun 11 19:32:40 2018 > > > New Revision: 334970 > > > URL: https://svnweb.freebsd.org/changeset/base/334970 > > > > > > Log: > > > Document the dump issue in UPDATING so people understand when they > > > get a new diagnostic. > > > > > > Modified: > > > head/UPDATING > > > > > > Modified: head/UPDATING > > > ============================================================ > > ================== > > > --- head/UPDATING Mon Jun 11 19:32:36 2018 (r334969) > > > +++ head/UPDATING Mon Jun 11 19:32:40 2018 (r334970) > > > @@ -32,6 +32,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: > > > "ln -s 'abort:false,junk:false' /etc/malloc.conf".) > > > > > > > > > +20180611: > > > + A bug in dump has been found where it can incorrectly dump > > filesystems > > > + with more than 512k inodes and produce corrupted dump images. > > r334968 > > > + closes the door by not dumping filesystems with more than 512k > > inodes. > > > + While older dumps may 'work' the image they produce may or may not > > be > > > + readable depending on many factors. > > > + > > > > Does it make since to put a temporary warning in newfs to warn users > > of the "may bot be able to dump this fs" issue? > > > > It does. > > However, there may have been an error in assessment, which I'm working > through now. If so, there will be a revert. Ok, I am wondering some about this as I have: Filesystem 1024-blocks Used Avail Capacity iused ifree %iused Mounted on /dev/ada0s2h 473659989 417657089 18110101 96% 918794 47949908 2% /mnt And have had that file system for at least a decade, and it gets dump | restore on a fairly regular basis. > Warner -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Jun 11 20:17:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 042EF1014C28 for ; Mon, 11 Jun 2018 20:17:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x230.google.com (mail-io0-x230.google.com [IPv6:2607:f8b0:4001:c06::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 812B77B90B for ; Mon, 11 Jun 2018 20:17:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x230.google.com with SMTP id d22-v6so25382787iof.13 for ; Mon, 11 Jun 2018 13:17:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=d5P1mBDVhvPYaqjhaNSHw9yml0Ac/tohChPQD8ABZdo=; b=fj/X06+5dJSDTSbAPvmU6AqlJ0YLn8n0hWZ6gEPswdI0qcloyYVLICjMPzyLYZVBCJ 4M5OZ4OTfzG7ciBZk9gm8itI/xA4dCXNO5JCVlMBl3RIZlUG306KGLoukvq6rWWONnLA ZxxE7fnMDfoY/VlGUmb+KPXK0BvWYKUdcFWiGDEqIdP54ZLzf+F+R3HYEpFL6kk5f7Y5 Am5eTGRWNwQu+abP4NFYZntbH9XbOs5gbsJrx1XGdsxg+++cKIkcQW5dExEt7wpGfSLX S3K8tH7y+1lHVQWXHg5OlS+Ndc3ZHrjV1497gjrW8rrFKhvH596lsPYY9yJvOr5lf6Rl 8K2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=d5P1mBDVhvPYaqjhaNSHw9yml0Ac/tohChPQD8ABZdo=; b=DNq4BqKeK/j9adn/1cWmDsiRODtxp2Agsc4gSHoYbx8ZNUwUS4b0LeCn/BRmTTjREn 4oK4Z7AGMj7sjZd9mXsoj/dcjD4NoMLaLs97wNul/jAdCDRN9MVJdTUPPKFYs1LNwfHH TsRs+2sss+6ux47GoRfkgOCWjGr98xXewi3O7v6WG5R1m2KuSERM95wkUqv3dC9U/dog kNPIFxoUqbMhgolvFv4+NT7ZcQd9b+oCGLX6xxTngFVRZcdetU6bIEExtEKiMm3EjwUm PINp8W53BpYlLVYe79H7iq/fnP9KxGgQXNA9fSeQxXJSrhjQvKhZVy0IP36ys0Xw+rRs fWLg== X-Gm-Message-State: APt69E04On9pXc87+A3IaMrFilBb3Jqeh+JXbMbKOqjYMZDzApoUaK2J U+c8QFhlVr2wX7ys8cKGfpDxcLo53A0OInMbzT+JrQ== X-Google-Smtp-Source: ADUXVKIuX7hStAE5GuGCtluK/ztz+Cazvqshoj077kBMaUv0wxawukBhe9PVL3TrIwJZKAyzdRJpbEs4ydU/2WRORx0= X-Received: by 2002:a6b:be01:: with SMTP id o1-v6mr600032iof.299.1528748258740; Mon, 11 Jun 2018 13:17:38 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:d028:0:0:0:0:0 with HTTP; Mon, 11 Jun 2018 13:17:38 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <201806112001.w5BK1mGk029844@pdx.rh.CN85.dnsmgr.net> References: <201806112001.w5BK1mGk029844@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Mon, 11 Jun 2018 14:17:38 -0600 X-Google-Sender-Auth: JDGIWVtIeu3Ja0ow91OdIpUflfg Message-ID: Subject: Re: svn commit: r334970 - head To: "Rodney W. Grimes" Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 20:17:40 -0000 On Mon, Jun 11, 2018 at 2:01 PM, Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > [ Charset UTF-8 unsupported, converting... ] > > On Mon, Jun 11, 2018 at 1:52 PM, Rodney W. Grimes < > > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > > [ Charset UTF-8 unsupported, converting... ] > > > > Author: imp > > > > Date: Mon Jun 11 19:32:40 2018 > > > > New Revision: 334970 > > > > URL: https://svnweb.freebsd.org/changeset/base/334970 > > > > > > > > Log: > > > > Document the dump issue in UPDATING so people understand when they > > > > get a new diagnostic. > > > > > > > > Modified: > > > > head/UPDATING > > > > > > > > Modified: head/UPDATING > > > > ============================================================ > > > ================== > > > > --- head/UPDATING Mon Jun 11 19:32:36 2018 (r334969) > > > > +++ head/UPDATING Mon Jun 11 19:32:40 2018 (r334970) > > > > @@ -32,6 +32,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS > SLOW: > > > > "ln -s 'abort:false,junk:false' /etc/malloc.conf".) > > > > > > > > > > > > +20180611: > > > > + A bug in dump has been found where it can incorrectly dump > > > filesystems > > > > + with more than 512k inodes and produce corrupted dump images. > > > r334968 > > > > + closes the door by not dumping filesystems with more than 512k > > > inodes. > > > > + While older dumps may 'work' the image they produce may or may > not > > > be > > > > + readable depending on many factors. > > > > + > > > > > > Does it make since to put a temporary warning in newfs to warn users > > > of the "may bot be able to dump this fs" issue? > > > > > > > It does. > > > > However, there may have been an error in assessment, which I'm working > > through now. If so, there will be a revert. > > Ok, I am wondering some about this as I have: > Filesystem 1024-blocks Used Avail Capacity iused > ifree %iused Mounted on > /dev/ada0s2h 473659989 417657089 18110101 96% 918794 > 47949908 2% /mnt > > And have had that file system for at least a decade, > and it gets dump | restore on a fairly regular basis. Yea. Are you in a good position to test a fix for the core dump db@ was seeing? A dump /restore (though the restore should be to a second fs to test) There's two things my fix does: (1) backs out the mistaken limit check and (2) doesn't walk through a list that's guaranteed to be bogus and fall off the end. Warner From owner-svn-src-head@freebsd.org Mon Jun 11 20:19:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FCED101505A; Mon, 11 Jun 2018 20:19:22 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AD4987BB29; Mon, 11 Jun 2018 20:19:21 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8AFF12035D; Mon, 11 Jun 2018 20:19:21 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5BKJLkP067082; Mon, 11 Jun 2018 20:19:21 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5BKJLAC067081; Mon, 11 Jun 2018 20:19:21 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806112019.w5BKJLAC067081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 11 Jun 2018 20:19:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334977 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 334977 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 20:19:22 -0000 Author: emaste Date: Mon Jun 11 20:19:20 2018 New Revision: 334977 URL: https://svnweb.freebsd.org/changeset/base/334977 Log: Connect muge.4 man page Sponsored by: The FreeBSD Foundation Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Mon Jun 11 19:51:48 2018 (r334976) +++ head/share/man/man4/Makefile Mon Jun 11 20:19:20 2018 (r334977) @@ -309,6 +309,7 @@ MAN= aac.4 \ msk.4 \ mtio.4 \ multicast.4 \ + muge.4 \ mvs.4 \ mwl.4 \ mwlfw.4 \ From owner-svn-src-head@freebsd.org Mon Jun 11 20:38:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BAE21018333; Mon, 11 Jun 2018 20:38:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E12D27CBAB; Mon, 11 Jun 2018 20:38:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C226A206AB; Mon, 11 Jun 2018 20:38:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5BKcQIT077646; Mon, 11 Jun 2018 20:38:26 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5BKcQ7T077645; Mon, 11 Jun 2018 20:38:26 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806112038.w5BKcQ7T077645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 11 Jun 2018 20:38:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334979 - head/sbin/dump X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/dump X-SVN-Commit-Revision: 334979 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 20:38:27 -0000 Author: imp Date: Mon Jun 11 20:38:26 2018 New Revision: 334979 URL: https://svnweb.freebsd.org/changeset/base/334979 Log: Fix a bug in the counting of blks. We shouldn't count the bytes set in c_addr for TS_CLRI and TS_BITS nodes. Those block overload c_count to communicate how many blocks follow, not now many c_addr spaces are used. Dump would dump core (now) because memory layout moved around and we'd access elements past the end to make a count. Reviewed by: kib@ Modified: head/sbin/dump/tape.c Modified: head/sbin/dump/tape.c ============================================================================== --- head/sbin/dump/tape.c Mon Jun 11 20:26:10 2018 (r334978) +++ head/sbin/dump/tape.c Mon Jun 11 20:38:26 2018 (r334979) @@ -279,7 +279,8 @@ flushtape(void) } blks = 0; - if (spcl.c_type != TS_END) { + if (spcl.c_type != TS_END && spcl.c_type != TS_CLRI && + spcl.c_type != TS_BITS) { assert(spcl.c_count <= TP_NINDIR); for (i = 0; i < spcl.c_count; i++) if (spcl.c_addr[i] != 0) From owner-svn-src-head@freebsd.org Mon Jun 11 20:38:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 714451018374; Mon, 11 Jun 2018 20:38:34 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E0F97CC56; Mon, 11 Jun 2018 20:38:32 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C221C206AC; Mon, 11 Jun 2018 20:38:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5BKcVWK077702; Mon, 11 Jun 2018 20:38:31 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5BKcVPc077696; Mon, 11 Jun 2018 20:38:31 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806112038.w5BKcVPc077696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 11 Jun 2018 20:38:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334980 - in head: . sbin/dump X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: . sbin/dump X-SVN-Commit-Revision: 334980 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 20:38:34 -0000 Author: imp Date: Mon Jun 11 20:38:30 2018 New Revision: 334980 URL: https://svnweb.freebsd.org/changeset/base/334980 Log: Revert size limits. The size limits came from a flawed understanding of dump records. The real issue was that dump was bogusly interpreting c_count sometimes. r334978 fixes that. Modified: head/UPDATING head/sbin/dump/dump.8 head/sbin/dump/main.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Jun 11 20:38:26 2018 (r334979) +++ head/UPDATING Mon Jun 11 20:38:30 2018 (r334980) @@ -32,13 +32,6 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: "ln -s 'abort:false,junk:false' /etc/malloc.conf".) -20180611: - A bug in dump has been found where it can incorrectly dump filesystems - with more than 512k inodes and produce corrupted dump images. r334968 - closes the door by not dumping filesystems with more than 512k inodes. - While older dumps may 'work' the image they produce may or may not be - readable depending on many factors. - 20180530: The kernel / userland interface for devinfo changed, so you'll need a new kernel and userland as a pair for it to work (rebuilding Modified: head/sbin/dump/dump.8 ============================================================================== --- head/sbin/dump/dump.8 Mon Jun 11 20:38:26 2018 (r334979) +++ head/sbin/dump/dump.8 Mon Jun 11 20:38:30 2018 (r334980) @@ -566,8 +566,3 @@ This will be fixed in a later version of .Fx . Presently, it works if you set it setuid (like it used to be), but this might constitute a security risk. -.Pp -It is not possible to safely dump filesystems that use more than -524288 inodes. -.Nm -refuses to dump any filesystem that has more than 524288 inodes. Modified: head/sbin/dump/main.c ============================================================================== --- head/sbin/dump/main.c Mon Jun 11 20:38:26 2018 (r334979) +++ head/sbin/dump/main.c Mon Jun 11 20:38:30 2018 (r334980) @@ -100,7 +100,7 @@ main(int argc, char *argv[]) struct fstab *dt; char *map, *mntpt; int ch, mode, mntflags; - int i, ret, anydirskipped, c_count, bflag = 0, Tflag = 0, honorlevel = 1; + int i, ret, anydirskipped, bflag = 0, Tflag = 0, honorlevel = 1; int just_estimate = 0; ino_t maxino; char *tmsg; @@ -452,9 +452,6 @@ main(int argc, char *argv[]) quit("TP_BSIZE (%d) is not a power of 2", TP_BSIZE); maxino = sblock->fs_ipg * sblock->fs_ncg; mapsize = roundup(howmany(maxino, CHAR_BIT), TP_BSIZE); - c_count = howmany(mapsize * sizeof(char), TP_BSIZE); - if (c_count > TP_NINDIR) - quit("fs is too large for dump!"); usedinomap = (char *)calloc((unsigned) mapsize, sizeof(char)); dumpdirmap = (char *)calloc((unsigned) mapsize, sizeof(char)); dumpinomap = (char *)calloc((unsigned) mapsize, sizeof(char)); From owner-svn-src-head@freebsd.org Mon Jun 11 20:46:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0FB4101977D; Mon, 11 Jun 2018 20:46:21 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 93FB17D5B2; Mon, 11 Jun 2018 20:46:21 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 711672084B; Mon, 11 Jun 2018 20:46:21 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5BKkLN5082728; Mon, 11 Jun 2018 20:46:21 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5BKkLSO082727; Mon, 11 Jun 2018 20:46:21 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806112046.w5BKkLSO082727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 11 Jun 2018 20:46:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334981 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 334981 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 20:46:22 -0000 Author: emaste Date: Mon Jun 11 20:46:20 2018 New Revision: 334981 URL: https://svnweb.freebsd.org/changeset/base/334981 Log: muge.4: remove BUGS section (about link/act LEDs) Lack of functioning link and activity LEDs on devices without an EEPROM is expected (not a bug). Quoting the EVB-LAN7850 User's Guide: When configured with the default internal register settings, the Ethernet Link status LEDs are not enabled. To enable Ethernet Link status LEDs, enable the EEPROM. This is an artifact of the different ways in which the evaluation board can be used. End-user USB-Ethernet adapters using the Microchip LAN78XX or LAN7515 controllers should use an EEPROM or have OTP configuration, if their product configuration does not match the boot default register configuration. Sponsored by: The FreeBSD Foundation Modified: head/share/man/man4/muge.4 Modified: head/share/man/man4/muge.4 ============================================================================== --- head/share/man/man4/muge.4 Mon Jun 11 20:38:30 2018 (r334980) +++ head/share/man/man4/muge.4 Mon Jun 11 20:46:20 2018 (r334981) @@ -70,6 +70,3 @@ The .Nm device driver first appeared in .Fx 12.0 . -.Sh BUGS -USB-Ethernet adapters that use the LAN7850 without a configuration EEPROM -may not activate link or activity LEDs. From owner-svn-src-head@freebsd.org Mon Jun 11 21:23:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B12A6101EF50; Mon, 11 Jun 2018 21:23:28 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1EE237F41E; Mon, 11 Jun 2018 21:23:27 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w5BLNKQu030095; Mon, 11 Jun 2018 14:23:20 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w5BLNKE6030094; Mon, 11 Jun 2018 14:23:20 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806112123.w5BLNKE6030094@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r334970 - head In-Reply-To: To: Warner Losh Date: Mon, 11 Jun 2018 14:23:20 -0700 (PDT) CC: "Rodney W. Grimes" , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 21:23:28 -0000 > On Mon, Jun 11, 2018 at 2:01 PM, Rodney W. Grimes < > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > [ Charset UTF-8 unsupported, converting... ] > > > On Mon, Jun 11, 2018 at 1:52 PM, Rodney W. Grimes < > > > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > > > > [ Charset UTF-8 unsupported, converting... ] > > > > > Author: imp > > > > > Date: Mon Jun 11 19:32:40 2018 > > > > > New Revision: 334970 > > > > > URL: https://svnweb.freebsd.org/changeset/base/334970 > > > > > > > > > > Log: > > > > > Document the dump issue in UPDATING so people understand when they > > > > > get a new diagnostic. > > > > > > > > > > Modified: > > > > > head/UPDATING > > > > > > > > > > Modified: head/UPDATING > > > > > ============================================================ > > > > ================== > > > > > --- head/UPDATING Mon Jun 11 19:32:36 2018 (r334969) > > > > > +++ head/UPDATING Mon Jun 11 19:32:40 2018 (r334970) > > > > > @@ -32,6 +32,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS > > SLOW: > > > > > "ln -s 'abort:false,junk:false' /etc/malloc.conf".) > > > > > > > > > > > > > > > +20180611: > > > > > + A bug in dump has been found where it can incorrectly dump > > > > filesystems > > > > > + with more than 512k inodes and produce corrupted dump images. > > > > r334968 > > > > > + closes the door by not dumping filesystems with more than 512k > > > > inodes. > > > > > + While older dumps may 'work' the image they produce may or may > > not > > > > be > > > > > + readable depending on many factors. > > > > > + > > > > > > > > Does it make since to put a temporary warning in newfs to warn users > > > > of the "may bot be able to dump this fs" issue? > > > > > > > > > > It does. > > > > > > However, there may have been an error in assessment, which I'm working > > > through now. If so, there will be a revert. > > > > Ok, I am wondering some about this as I have: > > Filesystem 1024-blocks Used Avail Capacity iused > > ifree %iused Mounted on > > /dev/ada0s2h 473659989 417657089 18110101 96% 918794 > > 47949908 2% /mnt > > > > And have had that file system for at least a decade, > > and it gets dump | restore on a fairly regular basis. > > > Yea. Are you in a good position to test a fix for the core dump db@ was > seeing? A dump /restore (though the restore should be to a second fs to > test) Yes, I have 4 spare drives that can be used as restore targets of the above mentioned file system. And actually have at least 2 copies of it already for sources, so it is just a mater of minutes for me to set up a test bed. > There's two things my fix does: (1) backs out the mistaken limit check and > (2) doesn't walk through a list that's guaranteed to be bogus and fall off > the end. > > Warner -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Jun 11 22:29:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F32A9100633D; Mon, 11 Jun 2018 22:29:37 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A13F181FD3; Mon, 11 Jun 2018 22:29:37 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 7D5ED211E6; Mon, 11 Jun 2018 18:29:36 -0400 (EDT) Received: from web4 ([10.202.2.214]) by compute3.internal (MEProxy); Mon, 11 Jun 2018 18:29:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=H+YzUA OQ3T95ZgsG4W9HdFniwN/ttp392ReVqNJuWMI=; b=MQipGrKxppjCGuccWTnABo bVFW8NHc1ya/7ovG4UQcDoe19BD6V32v8H1lwFfim3fFM3QkErPLLeBqC4BtRpGa Q/WVzznMUU8NiYnynPZAShrqZH2mgbzm0cMVvTbTs4U1tHi4boBNhEq8v1H1Lqk9 n7hKrxJHXhNmcIivi16Ahzc4+nqSCENndDWXSdSAJvAW0KCXMo81Hg9H/IpumrXD MDyxVCPYVXG9THYoR3QCnHXbNDCfpNPZbLUEYXtBerrDuQnkAIP+FOCNdq/v/H84 W9kFMV+sHjt+gqYC8F1BqcmFRe3VddG6q0G+ZY7UiJc5k30yU5mNLtWX5jUNnK1A == X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id 2B2D1BA50D; Mon, 11 Jun 2018 18:29:36 -0400 (EDT) Message-Id: <1528756176.557409.1404618352.33DD9A15@webmail.messagingengine.com> From: Mark Felder To: Alexey Dokuchaev Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-ca618090 In-Reply-To: <20180527060917.GA3179@FreeBSD.org> References: <201805251936.w4PJaQIf093393@repo.freebsd.org> <20180527060917.GA3179@FreeBSD.org> Subject: Re: svn commit: r334221 - head/etc Date: Mon, 11 Jun 2018 17:29:36 -0500 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 22:29:38 -0000 On Sun, May 27, 2018, at 01:09, Alexey Dokuchaev wrote: > On Fri, May 25, 2018 at 07:36:26PM +0000, Mark Felder wrote: > > New Revision: 334221 > > URL: https://svnweb.freebsd.org/changeset/base/334221 > > > > Log: > > rc.subr: Support loading environmental variables from a file > > > > + if [ -n "$_env_file" ] && [ -r "${_env_file}" ]; then > > Style bug: "$_env_file" vs. "${_env_file}". Also, isn't the -n check > redundant? The entire rc.subr file seems to be full of style inconsistencies. I'd take the time to fix it if there would be no objections. As per redundancy, it's copy+paste of what mat suggested. I suppose the -r will fail if the variable is not set, so it would indeed be redundant. I didn't think of it that way. > > > + set -a > > + . $_env_file > > Shouldn't it be quoted here as well (. "$_env_file")? > It wouldn't hurt Sorry about the late reply. I had a mistake in my sieve filters sending my mail to a wrong folder. -- Mark Felder ports-secteam & portmgr member feld@FreeBSD.org From owner-svn-src-head@freebsd.org Mon Jun 11 22:42:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B11D31007F5A for ; Mon, 11 Jun 2018 22:42:29 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DC3E82A5D for ; Mon, 11 Jun 2018 22:42:29 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: b2f4ad1f-6dc8-11e8-b829-b3adae557cda X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id b2f4ad1f-6dc8-11e8-b829-b3adae557cda; Mon, 11 Jun 2018 22:42:20 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w5BMgJMv055970; Mon, 11 Jun 2018 16:42:19 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1528756939.12122.40.camel@freebsd.org> Subject: Re: svn commit: r334221 - head/etc From: Ian Lepore To: Mark Felder , Alexey Dokuchaev Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 11 Jun 2018 16:42:19 -0600 In-Reply-To: <1528756176.557409.1404618352.33DD9A15@webmail.messagingengine.com> References: <201805251936.w4PJaQIf093393@repo.freebsd.org> <20180527060917.GA3179@FreeBSD.org> <1528756176.557409.1404618352.33DD9A15@webmail.messagingengine.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 22:42:29 -0000 On Mon, 2018-06-11 at 17:29 -0500, Mark Felder wrote: > > On Sun, May 27, 2018, at 01:09, Alexey Dokuchaev wrote: > > > > On Fri, May 25, 2018 at 07:36:26PM +0000, Mark Felder wrote: > > > > > > New Revision: 334221 > > > URL: https://svnweb.freebsd.org/changeset/base/334221 > > > > > > Log: > > >   rc.subr: Support loading environmental variables from a file > > >    > > > + if [ -n "$_env_file" ] && [ -r "${_env_file}" ]; then > > Style bug: "$_env_file" vs. "${_env_file}".  Also, isn't the -n > > check > > redundant? > The entire rc.subr file seems to be full of style inconsistencies. > I'd take the time to fix it if there would be no objections. As per > redundancy, it's copy+paste of what mat suggested. I suppose the -r > will fail if the variable is not set, so it would indeed be > redundant. I didn't think of it that way. > That will work as long as there are quotes around the arg to -r: $ foo="" $ [ -r ${foo} ] && echo good good $ [ -r "${foo}" ] && echo good $  Same results if $foo is unset. -- Ian From owner-svn-src-head@freebsd.org Mon Jun 11 22:48:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2296E1008BF5; Mon, 11 Jun 2018 22:48:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C878782DDD; Mon, 11 Jun 2018 22:48:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A1B6421BDD; Mon, 11 Jun 2018 22:48:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5BMmZBG044275; Mon, 11 Jun 2018 22:48:35 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5BMmZV6044273; Mon, 11 Jun 2018 22:48:35 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806112248.w5BMmZV6044273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 11 Jun 2018 22:48:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334982 - in head/etc: . devd X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/etc: . devd X-SVN-Commit-Revision: 334982 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 22:48:36 -0000 Author: imp Date: Mon Jun 11 22:48:34 2018 New Revision: 334982 URL: https://svnweb.freebsd.org/changeset/base/334982 Log: User service foo rather than /etc/rc.d/foo. devd predates service in the system. Modernize usage to use service to start/stop things in reaction to events rather than calling the rc file directly. This was pointed out in my talk at BSDcan as well as indirectly referrred to as a barrier to entry for OpenRC in that working group. Modified: head/etc/devd.conf head/etc/devd/apple.conf head/etc/devd/devmatch.conf Modified: head/etc/devd.conf ============================================================================== --- head/etc/devd.conf Mon Jun 11 20:46:20 2018 (r334981) +++ head/etc/devd.conf Mon Jun 11 22:48:34 2018 (r334982) @@ -57,7 +57,7 @@ notify 0 { match "system" "IFNET"; match "type" "LINK_UP"; media-type "ethernet"; - action "/etc/rc.d/dhclient quietstart $subsystem"; + action "service dhclient quietstart $subsystem"; }; # @@ -76,7 +76,7 @@ notify 0 { match "system" "IFNET"; match "type" "LINK_UP"; media-type "802.11"; - action "/etc/rc.d/dhclient quietstart $subsystem"; + action "service dhclient quietstart $subsystem"; }; # An entry like this might be in a different file, but is included here @@ -94,11 +94,11 @@ detach 100 { # When a USB Bluetooth dongle appears, activate it attach 100 { device-name "ubt[0-9]+"; - action "/etc/rc.d/bluetooth quietstart $device-name"; + action "service bluetooth quietstart $device-name"; }; detach 100 { device-name "ubt[0-9]+"; - action "/etc/rc.d/bluetooth quietstop $device-name"; + action "service bluetooth quietstop $device-name"; }; # Firmware downloader for Atheros AR3011 based USB Bluetooth devices @@ -111,11 +111,11 @@ detach 100 { # When a USB keyboard arrives, attach it as the console keyboard. attach 100 { device-name "ukbd0"; - action "/etc/rc.d/syscons setkeyboard /dev/ukbd0"; + action "service syscons setkeyboard /dev/ukbd0"; }; detach 100 { device-name "ukbd0"; - action "/etc/rc.d/syscons setkeyboard /dev/kbd0"; + action "service syscons setkeyboard /dev/kbd0"; }; notify 100 { @@ -124,7 +124,7 @@ notify 100 { match "type" "CREATE"; match "cdev" "atp[0-9]+"; - action "/etc/rc.d/moused quietstart $cdev"; + action "service moused quietstart $cdev"; }; notify 100 { @@ -133,7 +133,7 @@ notify 100 { match "type" "CREATE"; match "cdev" "ums[0-9]+"; - action "/etc/rc.d/moused quietstart $cdev"; + action "service moused quietstart $cdev"; }; notify 100 { @@ -142,7 +142,7 @@ notify 100 { match "type" "CREATE"; match "cdev" "wsp[0-9]+"; - action "/etc/rc.d/moused quietstart $cdev"; + action "service moused quietstart $cdev"; }; notify 100 { @@ -151,7 +151,7 @@ notify 100 { match "type" "DESTROY"; match "cdev" "ums[0-9]+"; - action "/etc/rc.d/moused stop $cdev"; + action "service moused stop $cdev"; }; # Firmware download into the ActiveWire board. After the firmware download is @@ -236,7 +236,7 @@ nomatch 10 { notify 10 { match "system" "ACPI"; match "subsystem" "ACAD"; - action "/etc/rc.d/power_profile $notify"; + action "service power_profile $notify"; }; # Notify all users before beginning emergency shutdown when we get @@ -317,7 +317,7 @@ notify 10 { notify 0 { match "system" "RCTL"; match "rule" "user:770:swap:.*"; - action "/usr/local/etc/rc.d/postgresql restart"; + action "service postgresql restart"; }; # Discard autofs caches, useful for the -media special map. Modified: head/etc/devd/apple.conf ============================================================================== --- head/etc/devd/apple.conf Mon Jun 11 20:46:20 2018 (r334981) +++ head/etc/devd/apple.conf Mon Jun 11 22:48:34 2018 (r334982) @@ -76,5 +76,5 @@ notify 10 { match "system" "PMU"; match "subsystem" "POWER"; match "type" "ACLINE"; - action "/etc/rc.d/power_profile $notify"; + action "service power_profile $notify"; }; Modified: head/etc/devd/devmatch.conf ============================================================================== --- head/etc/devd/devmatch.conf Mon Jun 11 20:46:20 2018 (r334981) +++ head/etc/devd/devmatch.conf Mon Jun 11 22:48:34 2018 (r334982) @@ -9,7 +9,7 @@ # # Generic NOMATCH event nomatch 100 { - action "/etc/rc.d/devmatch start '?$_'"; + action "service devmatch start '?$_'"; }; # Add the following to devd.conf to prevent this from running: From owner-svn-src-head@freebsd.org Mon Jun 11 23:32:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67270100E99E; Mon, 11 Jun 2018 23:32:07 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 145BE84DDE; Mon, 11 Jun 2018 23:32:07 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E9B26223E6; Mon, 11 Jun 2018 23:32:06 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5BNW6bF066565; Mon, 11 Jun 2018 23:32:06 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5BNW6FE066564; Mon, 11 Jun 2018 23:32:06 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201806112332.w5BNW6FE066564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Mon, 11 Jun 2018 23:32:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334983 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 334983 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 23:32:07 -0000 Author: jtl Date: Mon Jun 11 23:32:06 2018 New Revision: 334983 URL: https://svnweb.freebsd.org/changeset/base/334983 Log: Fix a memory leak for the BIOCSETWF ioctl on kernels with the BPF_JITTER option. The BPF code was creating a compiled filter in the common filter-creation path. However, BPF only uses compiled filters in the read direction. When creating a write filter, the common filter-creation code was creating an unneeded write filter and leaking the memory used for that. MFC after: 2 weeks Sponsored by: Netflix Modified: head/sys/net/bpf.c Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Mon Jun 11 22:48:34 2018 (r334982) +++ head/sys/net/bpf.c Mon Jun 11 23:32:06 2018 (r334983) @@ -1895,8 +1895,13 @@ bpf_setf(struct bpf_d *d, struct bpf_program *fp, u_lo return (EINVAL); } #ifdef BPF_JITTER - /* Filter is copied inside fcode and is perfectly valid. */ - jfunc = bpf_jitter(fcode, flen); + if (cmd != BIOCSETWF) { + /* + * Filter is copied inside fcode and is + * perfectly valid. + */ + jfunc = bpf_jitter(fcode, flen); + } #endif } From owner-svn-src-head@freebsd.org Tue Jun 12 00:23:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E2BA1015996; Tue, 12 Jun 2018 00:23:38 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C902F87728; Tue, 12 Jun 2018 00:23:37 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [74.217.198.10] (port=39084 helo=[10.1.4.66]) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1fSO7L-000AwI-JB; Mon, 11 Jun 2018 14:48:23 +0000 From: Devin Teske Message-Id: Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r334939 - head/stand/lua Date: Mon, 11 Jun 2018 17:23:33 -0700 In-Reply-To: Cc: Devin Teske , Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Warner Losh References: <201806110132.w5B1WI5d094546@repo.freebsd.org> <344AA709-2DF7-405C-AB4D-4F0978834EA1@FreeBSD.org> X-Mailer: Apple Mail (2.3273) Sender: devin@shxd.cx Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 00:23:38 -0000 > On Jun 11, 2018, at 11:20 AM, Warner Losh wrote: >=20 >=20 >=20 > On Mon, Jun 11, 2018 at 11:54 AM, Devin Teske > wrote: >=20 >> On Jun 11, 2018, at 7:07 AM, Warner Losh > wrote: >>=20 >>=20 >>=20 >> On Mon, Jun 11, 2018 at 7:36 AM, Devin Teske > wrote: >>=20 >>=20 >> > On Jun 10, 2018, at 6:32 PM, Kyle Evans > wrote: >> >=20 >> > Author: kevans >> > Date: Mon Jun 11 01:32:18 2018 >> > New Revision: 334939 >> > URL: https://svnweb.freebsd.org/changeset/base/334939 = >> >=20 >> > Log: >> > lualoader: Allow brand-*.lua for adding new brands >> >=20 >> > dteske@, I believe, had originally pointed out that lualoader = failed to >> > allow logo-*.lua for new logos to be added. When correcting this = mistake, I >> > failed to do the same for brands. >> >=20 >>=20 >> You=E2=80=99re doing an amazing job, Kyle. >>=20 >> I continually see nothing but genuine effort toward feature parity = which makes me think one day I can pass the reigns. >>=20 >> Yeah, I will always love Forth. It will always hold a special place = in my heart as that whacky language that simultaneously exudes great = power while also having the image ability to induce vomiting =F0=9F=A4=AE = by the uninitiated. >>=20 >> However, all that being said, I=E2=80=99d actually like to keep the = Ficl boot stuff as an option through to 14.0 and here is why ... >>=20 >> Last year we were looking to update from ficl3 to ficl4. That may not = sound too exciting to most folks, but most folks don=E2=80=99t know the = power that ficl4 brings =E2=80=94 like the capability to use full = networking in the loader! Can lua do that? How cool would it be to be = able to communicate with the network from the loader before the kernel = is even loaded into memory? I had a few hair-brained schemes left for = Forth which might be exciting, lol >>=20 >> The current boot loader can already communicate via NFS or TFTP = today. Adding http would be easy, https would be harder due to crypto = being huge and space being small (though bear ssl might be small = enough). >>=20 >> The last articulated plan in arch@ was that LUA will be default in = 12, and we plan to remove FORTH in 13. Last time I said it there in = February, there was only email agreeing that I could find. This matches = the in-person consensus poll I took at BSDcan as well. I think it would = take a very extraordinary set circumstance and severe problems with LUA = to change those plans. >>=20 >=20 > At BSD Can there was the boot working group where we discussed that an = FCP would be required to decide this. >=20 > In the working group you weren't listening and being rather combative = and demanding that I do stuff, I think that's an unfair characterization of the situation, but it = doesn't matter -- that's your opinion and you are entitled to it. > so I stopped talking. Hopefully we can _start_ talking. As the principled author of this work, = I want to have a say in its deprecation since I still maintain that body = of work. > It should not be taken as a sign of my consent, but more a sign of not = wanting to get into a yelling match in public on a topic I thought had = been settled months ago. >=20 Nobody asked *me* about how I would like to see *my* work removed from = the tree. I think I should have a say. I think I've been pretty darn helpful in the process by providing = substantive and helpful feedback to not only Kyle but also on the GSoC = project etc. I've not stood in any ones way. For being so helpful, I = would expect a level respect in this matter. > I raised my desires that I would like to be able to flip a knob in 13 = and reboot between Ficl and Lua, back and forth. >=20 > Give people a choice until we have done a "shake-out" through an = entire major version. >=20 > An honest-to-goodness procession would be, in my mind: >=20 > 13: Has both; both are installed. End-user can boot back and forth = between the two >=20 > Problems that arise in one or the other are non-critical because there = is always an "out" by running the other. >=20 > 14: Has both but both are not installed. The installer media doesn't = even have it. You can't install the Forth booth stuff unless you twist a = knob in buildworld, optionally going down the path of generating release = media which has the Forth boot stuff. >=20 > 15. It's removed from tree. You can't build Forth boot. Lua only. No = looking back, no way to build it with Forth, to get Ficl you need to go = to ports. A Ficl with FreeBSD boot words no longer exists and is no = longer maintained. All of bhyve userboot also therefore uses Lua. >=20 > That's way too long. 12 will have Lua by default, but you can build = FORTH if you want has been the plan since February when I socialized = this on arch@. I originally pitched coexistence, but there was little = appetite for that. >=20 > So I think a FCP discussed in arch@ is the right path forward. >=20 We sat on the GSoC for years. Why all of a sudden do we need to ship = this in less than 6 months? There are new features in Forth for 12 and they work and Lua has not = caught up to them (e.g., Boot Environments in the loader menu) and you = want to make Lua the default in 12? This doesn't make sense. The timeline I suggested is more amenable to actually crossing the = finish line with a fully-functional drop-in replacement. --=20 Devin= From owner-svn-src-head@freebsd.org Tue Jun 12 00:32:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82BD41016F55; Tue, 12 Jun 2018 00:32:50 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2BADF8814E; Tue, 12 Jun 2018 00:32:50 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf0-f41.google.com (mail-lf0-f41.google.com [209.85.215.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id CB64417CF1; Tue, 12 Jun 2018 00:32:49 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf0-f41.google.com with SMTP id i15-v6so23004201lfc.2; Mon, 11 Jun 2018 17:32:49 -0700 (PDT) X-Gm-Message-State: APt69E0f1OML355FljZxK0uQZr2xsUJKfahDK6h4FFUC7SgsuT5PgBrj w4xXdYwn5ONLA9VkDT8kEmKTeLb/QQYlejcHezg= X-Google-Smtp-Source: ADUXVKLWitX5HBm0o2lXWUr4s/Y0wdOBr+sBvCmXvQjZuvmUvi++jYHTYrT6ck9T4zgCFCs4aGhdafnPAt9KrQ7oMQM= X-Received: by 2002:a19:380a:: with SMTP id f10-v6mr737517lfa.47.1528763568210; Mon, 11 Jun 2018 17:32:48 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:2b92:0:0:0:0:0 with HTTP; Mon, 11 Jun 2018 17:32:27 -0700 (PDT) In-Reply-To: References: <201806110132.w5B1WI5d094546@repo.freebsd.org> <344AA709-2DF7-405C-AB4D-4F0978834EA1@FreeBSD.org> From: Kyle Evans Date: Mon, 11 Jun 2018 19:32:27 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334939 - head/stand/lua To: Devin Teske Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 00:32:50 -0000 On Mon, Jun 11, 2018 at 7:23 PM, Devin Teske wrote: > > On Jun 11, 2018, at 11:20 AM, Warner Losh wrote: > > > > On Mon, Jun 11, 2018 at 11:54 AM, Devin Teske wrote: >> >> >> On Jun 11, 2018, at 7:07 AM, Warner Losh wrote: >> >> >> >> On Mon, Jun 11, 2018 at 7:36 AM, Devin Teske wrote: >>> >>> >>> >>> > On Jun 10, 2018, at 6:32 PM, Kyle Evans wrote: >>> > >>> > Author: kevans >>> > Date: Mon Jun 11 01:32:18 2018 >>> > New Revision: 334939 >>> > URL: https://svnweb.freebsd.org/changeset/base/334939 >>> > >>> > Log: >>> > lualoader: Allow brand-*.lua for adding new brands >>> > >>> > dteske@, I believe, had originally pointed out that lualoader failed >>> > to >>> > allow logo-*.lua for new logos to be added. When correcting this >>> > mistake, I >>> > failed to do the same for brands. >>> > >>> >>> You=E2=80=99re doing an amazing job, Kyle. >>> >>> I continually see nothing but genuine effort toward feature parity whic= h >>> makes me think one day I can pass the reigns. >>> >>> Yeah, I will always love Forth. It will always hold a special place in = my >>> heart as that whacky language that simultaneously exudes great power wh= ile >>> also having the image ability to induce vomiting =F0=9F=A4=AE by the un= initiated. >>> >>> However, all that being said, I=E2=80=99d actually like to keep the Fic= l boot >>> stuff as an option through to 14.0 and here is why ... >>> >>> Last year we were looking to update from ficl3 to ficl4. That may not >>> sound too exciting to most folks, but most folks don=E2=80=99t know the= power that >>> ficl4 brings =E2=80=94 like the capability to use full networking in th= e loader! Can >>> lua do that? How cool would it be to be able to communicate with the ne= twork >>> from the loader before the kernel is even loaded into memory? I had a f= ew >>> hair-brained schemes left for Forth which might be exciting, lol >> >> >> The current boot loader can already communicate via NFS or TFTP today. >> Adding http would be easy, https would be harder due to crypto being hug= e >> and space being small (though bear ssl might be small enough). >> >> The last articulated plan in arch@ was that LUA will be default in 12, a= nd >> we plan to remove FORTH in 13. Last time I said it there in February, th= ere >> was only email agreeing that I could find. This matches the in-person >> consensus poll I took at BSDcan as well. I think it would take a very >> extraordinary set circumstance and severe problems with LUA to change th= ose >> plans. >> >> >> At BSD Can there was the boot working group where we discussed that an F= CP >> would be required to decide this. > > > In the working group you weren't listening and being rather combative and > demanding that I do stuff, > > > I think that's an unfair characterization of the situation, but it doesn'= t > matter -- that's your opinion and you are entitled to it. > > > > so I stopped talking. > > > Hopefully we can _start_ talking. As the principled author of this work, = I > want to have a say in its deprecation since I still maintain that body of > work. > > > It should not be taken as a sign of my consent, but more a sign of not > wanting to get into a yelling match in public on a topic I thought had be= en > settled months ago. > > > Nobody asked *me* about how I would like to see *my* work removed from th= e > tree. I think I should have a say. > > I think I've been pretty darn helpful in the process by providing > substantive and helpful feedback to not only Kyle but also on the GSoC > project etc. I've not stood in any ones way. For being so helpful, I woul= d > expect a level respect in this matter. > > > >> I raised my desires that I would like to be able to flip a knob in 13 an= d >> reboot between Ficl and Lua, back and forth. >> >> Give people a choice until we have done a "shake-out" through an entire >> major version. >> >> An honest-to-goodness procession would be, in my mind: >> >> 13: Has both; both are installed. End-user can boot back and forth betwe= en >> the two >> >> Problems that arise in one or the other are non-critical because there i= s >> always an "out" by running the other. >> >> 14: Has both but both are not installed. The installer media doesn't eve= n >> have it. You can't install the Forth booth stuff unless you twist a knob= in >> buildworld, optionally going down the path of generating release media w= hich >> has the Forth boot stuff. >> >> 15. It's removed from tree. You can't build Forth boot. Lua only. No >> looking back, no way to build it with Forth, to get Ficl you need to go = to >> ports. A Ficl with FreeBSD boot words no longer exists and is no longer >> maintained. All of bhyve userboot also therefore uses Lua. > > > That's way too long. 12 will have Lua by default, but you can build FORTH= if > you want has been the plan since February when I socialized this on arch@= . I > originally pitched coexistence, but there was little appetite for that. > > So I think a FCP discussed in arch@ is the right path forward. > > > We sat on the GSoC for years. Why all of a sudden do we need to ship this= in > less than 6 months? > > There are new features in Forth for 12 and they work and Lua has not caug= ht > up to them (e.g., Boot Environments in the loader menu) and you want to m= ake > Lua the default in 12? This doesn't make sense. I have no comments on the rest- this discussion should mostly occur on the FCP that will be drafted shortly. We added Boot Environment support months ago at this point, and also added some other cool feature like auto-detecting kernels in /boot/* to be presented in the kernel selector. > > The timeline I suggested is more amenable to actually crossing the finish > line with a fully-functional drop-in replacement. > -- > Devin From owner-svn-src-head@freebsd.org Tue Jun 12 00:34:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 110271017372; Tue, 12 Jun 2018 00:34:44 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A059A88330; Tue, 12 Jun 2018 00:34:43 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [74.217.198.10] (port=57236 helo=[10.1.4.66]) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1fSOI6-000B2q-HR; Mon, 11 Jun 2018 14:59:30 +0000 From: Devin Teske Message-Id: <81AF4479-3B71-420F-90C7-06ED64007F52@FreeBSD.org> Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r334939 - head/stand/lua Date: Mon, 11 Jun 2018 17:34:41 -0700 In-Reply-To: Cc: Devin Teske , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Kyle Evans References: <201806110132.w5B1WI5d094546@repo.freebsd.org> <344AA709-2DF7-405C-AB4D-4F0978834EA1@FreeBSD.org> X-Mailer: Apple Mail (2.3273) Sender: devin@shxd.cx Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 00:34:44 -0000 > On Jun 11, 2018, at 5:32 PM, Kyle Evans wrote: >=20 > On Mon, Jun 11, 2018 at 7:23 PM, Devin Teske > wrote: >>=20 >> On Jun 11, 2018, at 11:20 AM, Warner Losh wrote: >>=20 >>=20 >>=20 >> On Mon, Jun 11, 2018 at 11:54 AM, Devin Teske = wrote: >>>=20 >>>=20 >>> On Jun 11, 2018, at 7:07 AM, Warner Losh wrote: >>>=20 >>>=20 >>>=20 >>> On Mon, Jun 11, 2018 at 7:36 AM, Devin Teske = wrote: >>>>=20 >>>>=20 >>>>=20 >>>>> On Jun 10, 2018, at 6:32 PM, Kyle Evans = wrote: >>>>>=20 >>>>> Author: kevans >>>>> Date: Mon Jun 11 01:32:18 2018 >>>>> New Revision: 334939 >>>>> URL: https://svnweb.freebsd.org/changeset/base/334939 >>>>>=20 >>>>> Log: >>>>> lualoader: Allow brand-*.lua for adding new brands >>>>>=20 >>>>> dteske@, I believe, had originally pointed out that lualoader = failed >>>>> to >>>>> allow logo-*.lua for new logos to be added. When correcting this >>>>> mistake, I >>>>> failed to do the same for brands. >>>>>=20 >>>>=20 >>>> You=E2=80=99re doing an amazing job, Kyle. >>>>=20 >>>> I continually see nothing but genuine effort toward feature parity = which >>>> makes me think one day I can pass the reigns. >>>>=20 >>>> Yeah, I will always love Forth. It will always hold a special place = in my >>>> heart as that whacky language that simultaneously exudes great = power while >>>> also having the image ability to induce vomiting =F0=9F=A4=AE by = the uninitiated. >>>>=20 >>>> However, all that being said, I=E2=80=99d actually like to keep the = Ficl boot >>>> stuff as an option through to 14.0 and here is why ... >>>>=20 >>>> Last year we were looking to update from ficl3 to ficl4. That may = not >>>> sound too exciting to most folks, but most folks don=E2=80=99t know = the power that >>>> ficl4 brings =E2=80=94 like the capability to use full networking = in the loader! Can >>>> lua do that? How cool would it be to be able to communicate with = the network >>>> from the loader before the kernel is even loaded into memory? I had = a few >>>> hair-brained schemes left for Forth which might be exciting, lol >>>=20 >>>=20 >>> The current boot loader can already communicate via NFS or TFTP = today. >>> Adding http would be easy, https would be harder due to crypto being = huge >>> and space being small (though bear ssl might be small enough). >>>=20 >>> The last articulated plan in arch@ was that LUA will be default in = 12, and >>> we plan to remove FORTH in 13. Last time I said it there in = February, there >>> was only email agreeing that I could find. This matches the = in-person >>> consensus poll I took at BSDcan as well. I think it would take a = very >>> extraordinary set circumstance and severe problems with LUA to = change those >>> plans. >>>=20 >>>=20 >>> At BSD Can there was the boot working group where we discussed that = an FCP >>> would be required to decide this. >>=20 >>=20 >> In the working group you weren't listening and being rather combative = and >> demanding that I do stuff, >>=20 >>=20 >> I think that's an unfair characterization of the situation, but it = doesn't >> matter -- that's your opinion and you are entitled to it. >>=20 >>=20 >>=20 >> so I stopped talking. >>=20 >>=20 >> Hopefully we can _start_ talking. As the principled author of this = work, I >> want to have a say in its deprecation since I still maintain that = body of >> work. >>=20 >>=20 >> It should not be taken as a sign of my consent, but more a sign of = not >> wanting to get into a yelling match in public on a topic I thought = had been >> settled months ago. >>=20 >>=20 >> Nobody asked *me* about how I would like to see *my* work removed = from the >> tree. I think I should have a say. >>=20 >> I think I've been pretty darn helpful in the process by providing >> substantive and helpful feedback to not only Kyle but also on the = GSoC >> project etc. I've not stood in any ones way. For being so helpful, I = would >> expect a level respect in this matter. >>=20 >>=20 >>=20 >>> I raised my desires that I would like to be able to flip a knob in = 13 and >>> reboot between Ficl and Lua, back and forth. >>>=20 >>> Give people a choice until we have done a "shake-out" through an = entire >>> major version. >>>=20 >>> An honest-to-goodness procession would be, in my mind: >>>=20 >>> 13: Has both; both are installed. End-user can boot back and forth = between >>> the two >>>=20 >>> Problems that arise in one or the other are non-critical because = there is >>> always an "out" by running the other. >>>=20 >>> 14: Has both but both are not installed. The installer media doesn't = even >>> have it. You can't install the Forth booth stuff unless you twist a = knob in >>> buildworld, optionally going down the path of generating release = media which >>> has the Forth boot stuff. >>>=20 >>> 15. It's removed from tree. You can't build Forth boot. Lua only. No >>> looking back, no way to build it with Forth, to get Ficl you need to = go to >>> ports. A Ficl with FreeBSD boot words no longer exists and is no = longer >>> maintained. All of bhyve userboot also therefore uses Lua. >>=20 >>=20 >> That's way too long. 12 will have Lua by default, but you can build = FORTH if >> you want has been the plan since February when I socialized this on = arch@. I >> originally pitched coexistence, but there was little appetite for = that. >>=20 >> So I think a FCP discussed in arch@ is the right path forward. >>=20 >>=20 >> We sat on the GSoC for years. Why all of a sudden do we need to ship = this in >> less than 6 months? >>=20 >> There are new features in Forth for 12 and they work and Lua has not = caught >> up to them (e.g., Boot Environments in the loader menu) and you want = to make >> Lua the default in 12? This doesn't make sense. >=20 > I have no comments on the rest- this discussion should mostly occur on > the FCP that will be drafted shortly. We added Boot Environment > support months ago at this point, and also added some other cool > feature like auto-detecting kernels in /boot/* to be presented in the > kernel selector. >=20 Would you be willing to update here for the benefit of those in this = thread... Are you at feature parity yet? --=20 Devin= From owner-svn-src-head@freebsd.org Tue Jun 12 00:44:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69392101884A; Tue, 12 Jun 2018 00:44:13 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1876A88A19; Tue, 12 Jun 2018 00:44:13 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf0-f54.google.com (mail-lf0-f54.google.com [209.85.215.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id A9E3217DEF; Tue, 12 Jun 2018 00:44:12 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf0-f54.google.com with SMTP id y20-v6so33366356lfy.0; Mon, 11 Jun 2018 17:44:12 -0700 (PDT) X-Gm-Message-State: APt69E22T7VAZOoqrKzjKVaaSnjcd920qucGssDAIJe/+zxUEHIsRnUA ARiRCr21T6dWDZCI0WvFCHZtofe4Er2jEtzDFy4= X-Google-Smtp-Source: ADUXVKL4HchUtEqBEc5z1AUb1rbKI90VVx4abxCK2SPsx1LOlVjyQp1x5ASys8B6QHcrz39RH8JAHrkLGjmDgJUbTAM= X-Received: by 2002:a2e:575c:: with SMTP id r28-v6mr784328ljd.51.1528764251372; Mon, 11 Jun 2018 17:44:11 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:2b92:0:0:0:0:0 with HTTP; Mon, 11 Jun 2018 17:43:50 -0700 (PDT) In-Reply-To: <81AF4479-3B71-420F-90C7-06ED64007F52@FreeBSD.org> References: <201806110132.w5B1WI5d094546@repo.freebsd.org> <344AA709-2DF7-405C-AB4D-4F0978834EA1@FreeBSD.org> <81AF4479-3B71-420F-90C7-06ED64007F52@FreeBSD.org> From: Kyle Evans Date: Mon, 11 Jun 2018 19:43:50 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334939 - head/stand/lua To: Devin Teske Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 00:44:13 -0000 On Mon, Jun 11, 2018 at 7:34 PM, Devin Teske wrote: > > On Jun 11, 2018, at 5:32 PM, Kyle Evans wrote: > > On Mon, Jun 11, 2018 at 7:23 PM, Devin Teske wrote: > > > On Jun 11, 2018, at 11:20 AM, Warner Losh wrote: > > > > On Mon, Jun 11, 2018 at 11:54 AM, Devin Teske wrote: > > > > On Jun 11, 2018, at 7:07 AM, Warner Losh wrote: > > > > On Mon, Jun 11, 2018 at 7:36 AM, Devin Teske wrote: > > > > > On Jun 10, 2018, at 6:32 PM, Kyle Evans wrote: > > Author: kevans > Date: Mon Jun 11 01:32:18 2018 > New Revision: 334939 > URL: https://svnweb.freebsd.org/changeset/base/334939 > > Log: > lualoader: Allow brand-*.lua for adding new brands > > dteske@, I believe, had originally pointed out that lualoader failed > to > allow logo-*.lua for new logos to be added. When correcting this > mistake, I > failed to do the same for brands. > > > You=E2=80=99re doing an amazing job, Kyle. > > I continually see nothing but genuine effort toward feature parity which > makes me think one day I can pass the reigns. > > Yeah, I will always love Forth. It will always hold a special place in my > heart as that whacky language that simultaneously exudes great power whil= e > also having the image ability to induce vomiting =F0=9F=A4=AE by the unin= itiated. > > However, all that being said, I=E2=80=99d actually like to keep the Ficl = boot > stuff as an option through to 14.0 and here is why ... > > Last year we were looking to update from ficl3 to ficl4. That may not > sound too exciting to most folks, but most folks don=E2=80=99t know the p= ower that > ficl4 brings =E2=80=94 like the capability to use full networking in the = loader! Can > lua do that? How cool would it be to be able to communicate with the netw= ork > from the loader before the kernel is even loaded into memory? I had a few > hair-brained schemes left for Forth which might be exciting, lol > > > > The current boot loader can already communicate via NFS or TFTP today. > Adding http would be easy, https would be harder due to crypto being huge > and space being small (though bear ssl might be small enough). > > The last articulated plan in arch@ was that LUA will be default in 12, an= d > we plan to remove FORTH in 13. Last time I said it there in February, the= re > was only email agreeing that I could find. This matches the in-person > consensus poll I took at BSDcan as well. I think it would take a very > extraordinary set circumstance and severe problems with LUA to change tho= se > plans. > > > At BSD Can there was the boot working group where we discussed that an FC= P > would be required to decide this. > > > > In the working group you weren't listening and being rather combative and > demanding that I do stuff, > > > I think that's an unfair characterization of the situation, but it doesn'= t > matter -- that's your opinion and you are entitled to it. > > > > so I stopped talking. > > > Hopefully we can _start_ talking. As the principled author of this work, = I > want to have a say in its deprecation since I still maintain that body of > work. > > > It should not be taken as a sign of my consent, but more a sign of not > wanting to get into a yelling match in public on a topic I thought had be= en > settled months ago. > > > Nobody asked *me* about how I would like to see *my* work removed from th= e > tree. I think I should have a say. > > I think I've been pretty darn helpful in the process by providing > substantive and helpful feedback to not only Kyle but also on the GSoC > project etc. I've not stood in any ones way. For being so helpful, I woul= d > expect a level respect in this matter. > > > > I raised my desires that I would like to be able to flip a knob in 13 and > reboot between Ficl and Lua, back and forth. > > Give people a choice until we have done a "shake-out" through an entire > major version. > > An honest-to-goodness procession would be, in my mind: > > 13: Has both; both are installed. End-user can boot back and forth betwee= n > the two > > Problems that arise in one or the other are non-critical because there is > always an "out" by running the other. > > 14: Has both but both are not installed. The installer media doesn't even > have it. You can't install the Forth booth stuff unless you twist a knob = in > buildworld, optionally going down the path of generating release media wh= ich > has the Forth boot stuff. > > 15. It's removed from tree. You can't build Forth boot. Lua only. No > looking back, no way to build it with Forth, to get Ficl you need to go t= o > ports. A Ficl with FreeBSD boot words no longer exists and is no longer > maintained. All of bhyve userboot also therefore uses Lua. > > > > That's way too long. 12 will have Lua by default, but you can build FORTH= if > you want has been the plan since February when I socialized this on arch@= . I > originally pitched coexistence, but there was little appetite for that. > > So I think a FCP discussed in arch@ is the right path forward. > > > We sat on the GSoC for years. Why all of a sudden do we need to ship this= in > less than 6 months? > > There are new features in Forth for 12 and they work and Lua has not caug= ht > up to them (e.g., Boot Environments in the loader menu) and you want to m= ake > Lua the default in 12? This doesn't make sense. > > > I have no comments on the rest- this discussion should mostly occur on > the FCP that will be drafted shortly. We added Boot Environment > support months ago at this point, and also added some other cool > feature like auto-detecting kernels in /boot/* to be presented in the > kernel selector. > > > Would you be willing to update here for the benefit of those in this > thread... > > Are you at feature parity yet? Basically, yeah. There's a couple of environment variables not respected that I could easily implement given, say, an hour or two. OTOH, 'feature parity' is slightly rough to define as one has to weed out what still makes sense in the Lua-based world vs. what gets a more Lua-ish way of accomplishing the same task (e.g. with menu stuff). From owner-svn-src-head@freebsd.org Tue Jun 12 01:50:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82EE7100061F; Tue, 12 Jun 2018 01:50:59 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 306348C261; Tue, 12 Jun 2018 01:50:59 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 118DD23AEA; Tue, 12 Jun 2018 01:50:59 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5C1owvD036671; Tue, 12 Jun 2018 01:50:58 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5C1owdi036670; Tue, 12 Jun 2018 01:50:58 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201806120150.w5C1owdi036670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 12 Jun 2018 01:50:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334985 - head/sbin/geom/class/part X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/sbin/geom/class/part X-SVN-Commit-Revision: 334985 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 01:50:59 -0000 Author: lwhsu (ports committer) Date: Tue Jun 12 01:50:58 2018 New Revision: 334985 URL: https://svnweb.freebsd.org/changeset/base/334985 Log: Follow r333233, add fat32lba description to gpart(8) Reviewed by: emaste MFC after: 3 days X-MFC with: r333233 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D15767 Modified: head/sbin/geom/class/part/gpart.8 Modified: head/sbin/geom/class/part/gpart.8 ============================================================================== --- head/sbin/geom/class/part/gpart.8 Tue Jun 12 01:24:48 2018 (r334984) +++ head/sbin/geom/class/part/gpart.8 Tue Jun 12 01:50:58 2018 (r334985) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 11, 2018 +.Dd June 11, 2018 .Dt GPART 8 .Os .Sh NAME @@ -806,6 +806,11 @@ for MBR. A partition that contains a FAT32 filesystem. The scheme-specific type is .Qq Li "!11" +for MBR. +.It Cm fat32lba +A partition that contains a FAT32 (LBA) filesystem. +The scheme-specific type is +.Qq Li "!12" for MBR. .It Cm linux-data A Linux partition that contains some filesystem with data. From owner-svn-src-head@freebsd.org Tue Jun 12 02:45:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A78E1007C92 for ; Tue, 12 Jun 2018 02:45:28 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x233.google.com (mail-it0-x233.google.com [IPv6:2607:f8b0:4001:c0b::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B10038ED99 for ; Tue, 12 Jun 2018 02:45:27 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x233.google.com with SMTP id 76-v6so12866264itx.4 for ; Mon, 11 Jun 2018 19:45:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=McJUSD1aARYOcLRTap6+hLj9WNwGXIp1WFBjfRmghhk=; b=vcP1n6EVIq+4hvpDJIwVFFVwFxf8oIzIrdYGaeJrOghXFeED2BiTD3Dt9SmKOMkHxi Divz324tqPX3HZUe27cfGH3AgmQaXRrR5O2/cea0drmoGHMg0S/YxijF3bdIyPkppClW 6e5H6+7gmqcYOnP8+eDQ3PLpUDiD1SiBj0VF7CD4QyjMplxj6jkUcJoOi0RfcMb3T0bx BSOKvXO0jXJMXXi78T8j1k6Md14wkStq400NV+Cz/1f7pmXOaTXzFkQi7mqY5ch4dqTt IeSSLCx2Yx3buxpgeD3+CfKNH2PvbYhdvg0aDO8/m2K2dYplFI+fYZugGe67p3aegz6R /mTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=McJUSD1aARYOcLRTap6+hLj9WNwGXIp1WFBjfRmghhk=; b=F/Hue1OYDSTnQIroVsWxJ9hPUbllxCDISEKh555zWOk2lLqLxzZLiVpR2Md7qZ1uBl rV+tY00NcpLBrFSr8nsGvzA/vRIao+HFhw1xpoifaLdJRj/vrvrzfX4RsJ/hfdfYJUT1 wftIRCdhy8tKvYJAJdpr2FdJQgqEGXLYl5mt+CiEzPqR0kBCYFrU+fIcn/pAvYtM+jsc nTSyBG7OiUHVuMFjEWeclUo+E6/MUj3FK/V6aAgfE9CiHpV5GmjVb08XNNOUWZR/7ONV kMSR5+QxcKsuCL24FPEhlKKJXF6Jp3ofdRuvVSpFbNf0XD0Ia7Cbi1e9Z4QVESj6Vm4S DYKw== X-Gm-Message-State: APt69E0wxO1JAnnnqmbWIpH56o10loEkbEnxNzgSCmiXDFczbSMwPvJV CIXXXa2LqPe1wnEeKpcmGPlC3+hEMkoI+L8Keei1ZQ== X-Google-Smtp-Source: ADUXVKKE3ucOKlXUem7D5LGPwN1U2LrXWN0K16I+keIfSF9rB25+2VnsuCfsoy2stYkcHGQKRx+xrbN+UYMmw/PiW0I= X-Received: by 2002:a24:64ce:: with SMTP id t197-v6mr1428490itc.36.1528771527073; Mon, 11 Jun 2018 19:45:27 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:d028:0:0:0:0:0 with HTTP; Mon, 11 Jun 2018 19:45:26 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: References: <201806110132.w5B1WI5d094546@repo.freebsd.org> <344AA709-2DF7-405C-AB4D-4F0978834EA1@FreeBSD.org> <81AF4479-3B71-420F-90C7-06ED64007F52@FreeBSD.org> From: Warner Losh Date: Mon, 11 Jun 2018 20:45:26 -0600 X-Google-Sender-Auth: uneAeHsubC5s9Jm_vxqU29jlIBc Message-ID: Subject: Re: svn commit: r334939 - head/stand/lua To: Kyle Evans Cc: Devin Teske , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 02:45:28 -0000 On Mon, Jun 11, 2018 at 6:43 PM, Kyle Evans wrote: > On Mon, Jun 11, 2018 at 7:34 PM, Devin Teske wrote: > > Are you at feature parity yet? > > Basically, yeah. There's a couple of environment variables not > respected that I could easily implement given, say, an hour or two. > OTOH, 'feature parity' is slightly rough to define as one has to weed > out what still makes sense in the Lua-based world vs. what gets a more > Lua-ish way of accomplishing the same task (e.g. with menu stuff). > When the FCP thread starts in arch@, we should include these items in the list of pros/cons for Lua. Maybe they are important, or maybe not, but to decide we need to know what they are. Warner From owner-svn-src-head@freebsd.org Tue Jun 12 02:45:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C0061007DAF for ; Tue, 12 Jun 2018 02:45:59 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22e.google.com (mail-it0-x22e.google.com [IPv6:2607:f8b0:4001:c0b::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 19AE58EEED for ; Tue, 12 Jun 2018 02:45:59 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22e.google.com with SMTP id y127-v6so12954585itd.1 for ; Mon, 11 Jun 2018 19:45:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=VFo8ehchHJSidTL/xEf0E30XTFOJwOzcbyWVUJ5aDMI=; b=h8WsmmGOrTpH7/D+iyz0fi4nbzf69h64W33PlAUsbJXe+znV9pdhcVq9YzzAEBGX1V ShDYhCBsX5dmIHfyRM+IGiohPIRo9lrjqr2mGfd3ME9WKTM+g+Nh2IScTkF/n6IDFfQv WjwIfF/SVW32qvi32xFeQKtYmdAmT6r859r43pe8d+PcKBFGEHcdUA2QzN4wrPm8V0KV RH2OjpDZZhD1ku/DrNBY4giibj0KULAlVFtM2LeiDy+/Ij1SvDdz9Y8ctAtSBBdtQsbD 8zHn5676qhDlZURQ3nPkqd4fvQZTG9vgcFqdxLzcNrV3ER8WwEYsJhU6e59SXpJ063rL fEGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=VFo8ehchHJSidTL/xEf0E30XTFOJwOzcbyWVUJ5aDMI=; b=EqkJvAy2MT8PwH/9LQeDlUAmhKH1bSLJ0iPvNBA4AehR6vQz779SqAjZfMlvo+daTs ihm1BuaiM45HMeailAgVPy51XP6dz8joLhgZUh47QJb2CJ6D5nY648STGvuFyo+ZU1JK T7F/xiSAESaRfjQh1fNpW/yLqkCGC7agsQlRh9iT6pgEMSdGaqtv+snJBhPm6HSRrges WvanxantbXM8YNIjOdJ3bg1VIG95qgrV+MfgH8vDOhz4Z1Wvkmhq22pv7ovjvlwZdP6R DU5kq1kPCzVVYxhy66cfTWlhFEs+9r+ZmOzL5MJFly8+8cUtjCdnYcqmCDoDxC1riQSj 9fug== X-Gm-Message-State: APt69E0nmEpAuhHmDVpgX43LDCATG/AZdRw3tChcI7OwWAyBq8zXS2PR wLazyaCBd8LysLMzXZ2urf2LPlukdHDDLBVHRtb0bA== X-Google-Smtp-Source: ADUXVKLEtfeHLu4c13KVfDPZhZxw2NrgHvx+jYqGcNtMkedwDVoiyYL2UFIkGeA7XcC+h42cu/zSjh6T7FkNJuvkvo8= X-Received: by 2002:a24:5b81:: with SMTP id g123-v6mr1385813itb.1.1528771558454; Mon, 11 Jun 2018 19:45:58 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:d028:0:0:0:0:0 with HTTP; Mon, 11 Jun 2018 19:45:57 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: References: <201806110132.w5B1WI5d094546@repo.freebsd.org> <344AA709-2DF7-405C-AB4D-4F0978834EA1@FreeBSD.org> From: Warner Losh Date: Mon, 11 Jun 2018 20:45:57 -0600 X-Google-Sender-Auth: 5r0cW1EG4UMRVQ9KuXVoUpUZns0 Message-ID: Subject: Re: svn commit: r334939 - head/stand/lua To: Devin Teske Cc: Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 02:45:59 -0000 On Mon, Jun 11, 2018 at 6:23 PM, Devin Teske wrote: > > On Jun 11, 2018, at 11:20 AM, Warner Losh wrote: > > > > On Mon, Jun 11, 2018 at 11:54 AM, Devin Teske wrote: > >> >> On Jun 11, 2018, at 7:07 AM, Warner Losh wrote: >> >> >> >> On Mon, Jun 11, 2018 at 7:36 AM, Devin Teske wrote: >> >>> >>> >>> > On Jun 10, 2018, at 6:32 PM, Kyle Evans wrote: >>> > >>> > Author: kevans >>> > Date: Mon Jun 11 01:32:18 2018 >>> > New Revision: 334939 >>> > URL: https://svnweb.freebsd.org/changeset/base/334939 >>> > >>> > Log: >>> > lualoader: Allow brand-*.lua for adding new brands >>> > >>> > dteske@, I believe, had originally pointed out that lualoader failed >>> to >>> > allow logo-*.lua for new logos to be added. When correcting this >>> mistake, I >>> > failed to do the same for brands. >>> > >>> >>> You=E2=80=99re doing an amazing job, Kyle. >>> >>> I continually see nothing but genuine effort toward feature parity whic= h >>> makes me think one day I can pass the reigns. >>> >>> Yeah, I will always love Forth. It will always hold a special place in >>> my heart as that whacky language that simultaneously exudes great power >>> while also having the image ability to induce vomiting =F0=9F=A4=AE by = the >>> uninitiated. >>> >>> However, all that being said, I=E2=80=99d actually like to keep the Fic= l boot >>> stuff as an option through to 14.0 and here is why ... >>> >>> Last year we were looking to update from ficl3 to ficl4. That may not >>> sound too exciting to most folks, but most folks don=E2=80=99t know the= power that >>> ficl4 brings =E2=80=94 like the capability to use full networking in th= e loader! >>> Can lua do that? How cool would it be to be able to communicate with th= e >>> network from the loader before the kernel is even loaded into memory? I= had >>> a few hair-brained schemes left for Forth which might be exciting, lol >>> >> >> The current boot loader can already communicate via NFS or TFTP today. >> Adding http would be easy, https would be harder due to crypto being hug= e >> and space being small (though bear ssl might be small enough). >> >> The last articulated plan in arch@ was that LUA will be default in 12, >> and we plan to remove FORTH in 13. Last time I said it there in February= , >> there was only email agreeing that I could find. This matches the in-per= son >> consensus poll I took at BSDcan as well. I think it would take a very >> extraordinary set circumstance and severe problems with LUA to change th= ose >> plans. >> >> >> At BSD Can there was the boot working group where we discussed that an >> FCP would be required to decide this. >> > > In the working group you weren't listening and being rather combative and > demanding that I do stuff, > > > I think that's an unfair characterization of the situation, but it doesn'= t > matter -- that's your opinion and you are entitled to it. > > > > so I stopped talking. > > > Hopefully we can _start_ talking. As the principled author of this work, = I > want to have a say in its deprecation since I still maintain that body of > work. > > > It should not be taken as a sign of my consent, but more a sign of not > wanting to get into a yelling match in public on a topic I thought had be= en > settled months ago. > > > Nobody asked *me* about how I would like to see *my* work removed from th= e > tree. I think I should have a say. > > I think I've been pretty darn helpful in the process by providing > substantive and helpful feedback to not only Kyle but also on the GSoC > project etc. I've not stood in any ones way. For being so helpful, I woul= d > expect a level respect in this matter. > > > > I raised my desires that I would like to be able to flip a knob in 13 and >> reboot between Ficl and Lua, back and forth. >> >> Give people a choice until we have done a "shake-out" through an entire >> major version. >> >> An honest-to-goodness procession would be, in my mind: >> >> 13: Has both; both are installed. End-user can boot back and forth >> between the two >> >> Problems that arise in one or the other are non-critical because there i= s >> always an "out" by running the other. >> >> 14: Has both but both are not installed. The installer media doesn't eve= n >> have it. You can't install the Forth booth stuff unless you twist a knob= in >> buildworld, optionally going down the path of generating release media >> which has the Forth boot stuff. >> >> 15. It's removed from tree. You can't build Forth boot. Lua only. No >> looking back, no way to build it with Forth, to get Ficl you need to go = to >> ports. A Ficl with FreeBSD boot words no longer exists and is no longer >> maintained. All of bhyve userboot also therefore uses Lua. >> > > That's way too long. 12 will have Lua by default, but you can build FORTH > if you want has been the plan since February when I socialized this on ar= ch@. > I originally pitched coexistence, but there was little appetite for that. > > So I think a FCP discussed in arch@ is the right path forward. > > > We sat on the GSoC for years. Why all of a sudden do we need to ship this > in less than 6 months? > > There are new features in Forth for 12 and they work and Lua has not > caught up to them (e.g., Boot Environments in the loader menu) and you wa= nt > to make Lua the default in 12? This doesn't make sense. > > The timeline I suggested is more amenable to actually crossing the finish > line with a fully-functional drop-in replacement. > -- > Devin > From owner-svn-src-head@freebsd.org Tue Jun 12 03:44:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F708100ECA0; Tue, 12 Jun 2018 03:44:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0FE4F69B97; Tue, 12 Jun 2018 03:44:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E49332501C; Tue, 12 Jun 2018 03:44:34 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5C3iYet098285; Tue, 12 Jun 2018 03:44:34 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5C3iYYJ098283; Tue, 12 Jun 2018 03:44:34 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201806120344.w5C3iYYJ098283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 12 Jun 2018 03:44:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334986 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 334986 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 03:44:35 -0000 Author: kevans Date: Tue Jun 12 03:44:34 2018 New Revision: 334986 URL: https://svnweb.freebsd.org/changeset/base/334986 Log: lualoader: More black-on-white fixes To recap the problem: with a black-on-white xterm, the menu draws terribly. Ideally, we would try our best for a white-on-black context for the menu since graphics and whatnot might not be tested for other setups and there's no reasonable way to sample the terminal at this point for the used color scheme. This commit attempts to address that further in two ways: - Instead of issuing CSI bg/fg resets (CSI 39m and CSI 49m respectively for "default"), issue CSI bg/fg escape sequences for our expected color scheme - Reset to *our* default color scheme before we even attempt to load the local module, so that we personally don't have any earlier text with the console default color scheme. Reported by: emaste (again) Modified: head/stand/lua/color.lua head/stand/lua/loader.lua Modified: head/stand/lua/color.lua ============================================================================== --- head/stand/lua/color.lua Tue Jun 12 01:50:58 2018 (r334985) +++ head/stand/lua/color.lua Tue Jun 12 03:44:34 2018 (r334986) @@ -69,7 +69,7 @@ function color.resetfg() if color.disabled then return '' end - return core.KEYSTR_CSI .. "39m" + return color.escapefg(color.WHITE) end function color.escapebg(color_value) @@ -83,7 +83,7 @@ function color.resetbg() if color.disabled then return '' end - return core.KEYSTR_CSI .. "49m" + return color.escapebg(color.BLACK) end function color.escape(fg_color, bg_color, attribute) Modified: head/stand/lua/loader.lua ============================================================================== --- head/stand/lua/loader.lua Tue Jun 12 01:50:58 2018 (r334985) +++ head/stand/lua/loader.lua Tue Jun 12 03:44:34 2018 (r334986) @@ -42,6 +42,12 @@ local password = require("password") -- need it. local menu +-- Our console may have been setup for a different color scheme before we get +-- here, so make sure we set the default. +if color.isEnabled() then + printc(color.default()) +end + try_include("local") config.load() @@ -50,11 +56,6 @@ if not core.isMenuSkipped() then end if core.isUEFIBoot() then loader.perform("efi-autoresizecons") -end --- Our console may have been setup for a different color scheme before we get --- here, so make sure we set the default. -if color.isEnabled() then - printc(color.default()) end password.check() -- menu might be disabled From owner-svn-src-head@freebsd.org Tue Jun 12 05:16:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E471F1019BEB; Tue, 12 Jun 2018 05:16:39 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475186D238; Tue, 12 Jun 2018 05:16:38 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from freyja.zeit4.iv.bundesimmobilien.de ([87.138.105.249]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LjZn2-1fzkco1gj2-00beZp; Tue, 12 Jun 2018 07:16:30 +0200 Date: Tue, 12 Jun 2018 07:16:22 +0200 From: "O. Hartmann" To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334971 - head/sbin/dump Message-ID: <20180612071617.43bc6ad8@freyja.zeit4.iv.bundesimmobilien.de> In-Reply-To: <201806111932.w5BJWjFX046044@repo.freebsd.org> References: <201806111932.w5BJWjFX046044@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:I2/r7cetIqX97+wp6JeQvbiAqevNCfQ+ualsoTekIyBuUaqiPbn uZiebm1P//kIV+g1AanCJsi+8qBypsbgvEPaZjuLXTXc3LJnC0PTI4+cr+8AXcwzVOhx46m R64LJhRzjHPgJc7LDnF470V2vATed/xWjN5soODJEt9YHuZUwnp7mnHBwQcQpJyqnJqHOlz kETNWANmuoC/xMNcAGwkA== X-UI-Out-Filterresults: notjunk:1;V01:K0:uDjg+WI9IdM=:3Xi5PQTHWnO0F2QPURjhpZ xvRrqHgoT7djbJsrxDt5GVTFUHzP6pc4PhnouhRoA4FlvaeHDkm0E8l9kSfzIgUgYhHrlLd7n y5OW3tZk6k5xYIy2sKE8ulHkVJKXp3fdU60XtZpwH/915334M0XjDZyHanioqEcmKyeqOGO2f eXHWFNUoRgpFDzDWjpkI535YzzBsNY+KxAi5e+Ah+8B6ibLyKpEALAbvy05RC5UaR8gtD2tNn 2912tgjxk0G21YG49akkrZEmUK8wp+TQaQ/hyXfZJRimpahNKmud4z+B9VIg+vZgCyaSd92ne S4ZNM3X2+XFa9XUMIAMCsVe1cR8uX80yjtRYwLQ4K7+m63soHot+TD47/lvZP2r7pea/Qennz oTM047BTFL9xs4lCkqOdYlPu+L1mOArgIkpwPlqobQEMVcqtxu8leW1cSLOC9WI9Z0+Y4Eoyf ut4+ATMulR6xsO4R1k3cv7zyui0X6CoE7qolBRDc8deNu8MoSTwvxYpyV4diwkZ74tpebpCCx htQJHaqqazYxdkFDorgYQV+UujAf/nTLUdZ1VmZcBhfBJUGY1L7mh6mfEoviSo1XOXjmI4RUl HrDDyXLTJWddbMW8IidULeltC2844lum0HSm1grlxw7EKQLwMKJ/zrybOiO1OMSVD/HznYF6n ceYdrbImydgjPDyzSnSIVs0F7Go0No8g4nEhiKKzOFg8Mfd5KrYhjLpA1p+vaaJDfVCiabrfM aQL8h71XKurMMqwYkPwTPZkvN6nwap0H4JjX4Vu4t07vGXBZxXimlV6uiYzd2kmvOODs93SoF 9tZaMMx X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 05:16:40 -0000 On Mon, 11 Jun 2018 19:32:45 +0000 (UTC) Warner Losh wrote: > Author: imp > Date: Mon Jun 11 19:32:45 2018 > New Revision: 334971 > URL: https://svnweb.freebsd.org/changeset/base/334971 > > Log: > Document the newly enforced 524288 inode restriction. > > Modified: > head/sbin/dump/dump.8 > > Modified: head/sbin/dump/dump.8 > ============================================================================== > --- head/sbin/dump/dump.8 Mon Jun 11 19:32:40 2018 (r334970) > +++ head/sbin/dump/dump.8 Mon Jun 11 19:32:45 2018 (r334971) > @@ -29,7 +29,7 @@ > .\" @(#)dump.8 8.3 (Berkeley) 5/1/95 > .\" $FreeBSD$ > .\" > -.Dd October 3, 2016 > +.Dd June 11, 2018 > .Dt DUMP 8 > .Os > .Sh NAME > @@ -566,3 +566,8 @@ This will be fixed in a later version of > .Fx . > Presently, it works if you set it setuid (like it used to be), but this > might constitute a security risk. > +.Pp > +It is not possible to safely dump filesystems that use more than > +524288 inodes. > +.Nm > +refuses to dump any filesystem that has more than 524288 inodes. > _______________________________________________ > 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-unsubscribe@freebsd.org" Hello. Is this limitation going to be eternal or are efforts being made to make it possible to go beyond this limitations? Just for curiosity ... Thanks in advance, oh From owner-svn-src-head@freebsd.org Tue Jun 12 05:29:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26D5E101B3A0; Tue, 12 Jun 2018 05:29:04 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B3DF6D9B4; Tue, 12 Jun 2018 05:29:03 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w5C5T0mC031587; Mon, 11 Jun 2018 22:29:00 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w5C5T0F8031586; Mon, 11 Jun 2018 22:29:00 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806120529.w5C5T0F8031586@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r334971 - head/sbin/dump In-Reply-To: <20180612071617.43bc6ad8@freyja.zeit4.iv.bundesimmobilien.de> To: "O. Hartmann" Date: Mon, 11 Jun 2018 22:29:00 -0700 (PDT) CC: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 05:29:04 -0000 > On Mon, 11 Jun 2018 19:32:45 +0000 (UTC) > Warner Losh wrote: > > > Author: imp > > Date: Mon Jun 11 19:32:45 2018 > > New Revision: 334971 > > URL: https://svnweb.freebsd.org/changeset/base/334971 > > > > Log: > > Document the newly enforced 524288 inode restriction. > > > > Modified: > > head/sbin/dump/dump.8 > > > > Modified: head/sbin/dump/dump.8 > > ============================================================================== > > --- head/sbin/dump/dump.8 Mon Jun 11 19:32:40 2018 (r334970) > > +++ head/sbin/dump/dump.8 Mon Jun 11 19:32:45 2018 (r334971) > > @@ -29,7 +29,7 @@ > > .\" @(#)dump.8 8.3 (Berkeley) 5/1/95 > > .\" $FreeBSD$ > > .\" > > -.Dd October 3, 2016 > > +.Dd June 11, 2018 > > .Dt DUMP 8 > > .Os > > .Sh NAME > > @@ -566,3 +566,8 @@ This will be fixed in a later version of > > .Fx . > > Presently, it works if you set it setuid (like it used to be), but this > > might constitute a security risk. > > +.Pp > > +It is not possible to safely dump filesystems that use more than > > +524288 inodes. > > +.Nm > > +refuses to dump any filesystem that has more than 524288 inodes. > > _______________________________________________ > > 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-unsubscribe@freebsd.org" > > Hello. > > Is this limitation going to be eternal or are efforts being made to make it > possible to go beyond this limitations? Just for curiosity ... > > Thanks in advance, This 512k limitiation was a short lived miss understanding of the code and a correct fix that should resolve the issue has been commited, I am doing futher testing at this time on a large file system to confirm imp@'s fix. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Jun 12 06:46:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74A381001F7D; Tue, 12 Jun 2018 06:46:04 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 272337077C; Tue, 12 Jun 2018 06:46:04 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 081CE26DA0; Tue, 12 Jun 2018 06:46:04 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5C6k3G1089940; Tue, 12 Jun 2018 06:46:03 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5C6k3VB089938; Tue, 12 Jun 2018 06:46:03 GMT (envelope-from np@FreeBSD.org) Message-Id: <201806120646.w5C6k3VB089938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 12 Jun 2018 06:46:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334987 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 334987 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 06:46:04 -0000 Author: np Date: Tue Jun 12 06:46:03 2018 New Revision: 334987 URL: https://svnweb.freebsd.org/changeset/base/334987 Log: cxgbe(4): Remove homemade version of htobe32 from the driver. It was needed only for ia64 where it was implemented as a call to bswapXX, which was always a real function. htobeXX with a constant argument is calculated at compile-time everywhere else. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/osdep.h head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/osdep.h ============================================================================== --- head/sys/dev/cxgbe/osdep.h Tue Jun 12 03:44:34 2018 (r334986) +++ head/sys/dev/cxgbe/osdep.h Tue Jun 12 06:46:03 2018 (r334987) @@ -67,11 +67,8 @@ typedef uint64_t __be64; #if BYTE_ORDER == BIG_ENDIAN #define __BIG_ENDIAN_BITFIELD -#define htobe32_const(x) (x) #elif BYTE_ORDER == LITTLE_ENDIAN #define __LITTLE_ENDIAN_BITFIELD -#define htobe32_const(x) (((x) >> 24) | (((x) >> 8) & 0xff00) | \ - ((((x) & 0xffffff) << 8) & 0xff0000) | ((((x) & 0xff) << 24) & 0xff000000)) #else #error "Must set BYTE_ORDER" #endif Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Jun 12 03:44:34 2018 (r334986) +++ head/sys/dev/cxgbe/t4_main.c Tue Jun 12 06:46:03 2018 (r334987) @@ -3213,7 +3213,7 @@ struct fw_info { .fw_mod_name = "t4fw", .fw_hdr = { .chip = FW_HDR_CHIP_T4, - .fw_ver = htobe32_const(FW_VERSION(T4)), + .fw_ver = htobe32(FW_VERSION(T4)), .intfver_nic = FW_INTFVER(T4, NIC), .intfver_vnic = FW_INTFVER(T4, VNIC), .intfver_ofld = FW_INTFVER(T4, OFLD), @@ -3229,7 +3229,7 @@ struct fw_info { .fw_mod_name = "t5fw", .fw_hdr = { .chip = FW_HDR_CHIP_T5, - .fw_ver = htobe32_const(FW_VERSION(T5)), + .fw_ver = htobe32(FW_VERSION(T5)), .intfver_nic = FW_INTFVER(T5, NIC), .intfver_vnic = FW_INTFVER(T5, VNIC), .intfver_ofld = FW_INTFVER(T5, OFLD), @@ -3245,7 +3245,7 @@ struct fw_info { .fw_mod_name = "t6fw", .fw_hdr = { .chip = FW_HDR_CHIP_T6, - .fw_ver = htobe32_const(FW_VERSION(T6)), + .fw_ver = htobe32(FW_VERSION(T6)), .intfver_nic = FW_INTFVER(T6, NIC), .intfver_vnic = FW_INTFVER(T6, VNIC), .intfver_ofld = FW_INTFVER(T6, OFLD), From owner-svn-src-head@freebsd.org Tue Jun 12 06:53:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42C791002D2D; Tue, 12 Jun 2018 06:53:33 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ECCDE70D86; Tue, 12 Jun 2018 06:53:32 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF41126F56; Tue, 12 Jun 2018 06:53:32 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5C6rWUs095280; Tue, 12 Jun 2018 06:53:32 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5C6rWkw095276; Tue, 12 Jun 2018 06:53:32 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806120653.w5C6rWkw095276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Tue, 12 Jun 2018 06:53:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334988 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 334988 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 06:53:33 -0000 Author: eadler Date: Tue Jun 12 06:53:31 2018 New Revision: 334988 URL: https://svnweb.freebsd.org/changeset/base/334988 Log: top(1): move command mapping to commands.c This eliminates the difficult to follow mapping of a string list. It moves numbers from "#define" into (more) debuggable enums. More generally, it follows the trend of moving more data into a more central mechanism. The help output is a little worse: " " is not rendered well, and there are duplicate entries, but that will be fixed in a followup. Modified: head/usr.bin/top/commands.c head/usr.bin/top/commands.h head/usr.bin/top/screen.c head/usr.bin/top/top.c Modified: head/usr.bin/top/commands.c ============================================================================== --- head/usr.bin/top/commands.c Tue Jun 12 06:46:03 2018 (r334987) +++ head/usr.bin/top/commands.c Tue Jun 12 06:53:31 2018 (r334988) @@ -50,38 +50,38 @@ static int str_addarg(char *str, int len, char *arg, b * either 'h' or '?'. */ -static const struct command all_commands[] = +const struct command all_commands[] = { - {'C', "toggle the displaying of weighted CPU percentage", false }, - {'d', "change number of displays to show", false}, - {'e', "list errors generated by last \"kill\" or \"renice\" command", false}, - {'H', "toggle the displaying of threads", false}, - {'h', "show this help text", true}, - {'?', "show this help text", true}, - {'i', "toggle the displaying of idle processes", false}, - {'I', "toggle the displaying of idle processes", false}, - {'j', "toggle the displaying of jail ID", false}, - {'J', "display processes for only one jail (+ selects all jails)", false}, - {'k', "kill processes; send a signal to a list of processes", false}, - {'q', "quit" , true}, - {'m', "toggle the display between 'cpu' and 'io' modes", false}, - {'n', "change number of processes to display", false}, - {'#', "change number of processes to display", false}, - {'o', "specify the sort order", false}, - {'p', "display one process (+ selects all processes)", false}, - {'P', "toggle the displaying of per-CPU statistics", false}, - {'r', "renice a process", false}, - {'s', "change number of seconds to delay between updates", false}, - {'S', "toggle the displaying of system processes", false}, - {'a', "toggle the displaying of process titles", false}, - {'T', "toggle the displaying of thread IDs", false}, - {'t', "toggle the display of this process", false}, - {'u', "display processes for only one user (+ selects all users)", false}, - {'w', "toggle the display of swap use for each process", false}, - {'z', "toggle the displaying of the system idle process", false }, - {0, NULL, true} + {'C', "toggle the displaying of weighted CPU percentage", false, CMD_wcputog}, + {'d', "change number of displays to show", false, CMD_displays}, + {'e', "list errors generated by last \"kill\" or \"renice\" command", false, CMD_errors}, + {'H', "toggle the displaying of threads", false, CMD_thrtog}, + {'h', "show this help text", true, CMD_help}, + {'?', "show this help text", true, CMD_help}, + {'i', "toggle the displaying of idle processes", false, CMD_idletog}, + {'I', "toggle the displaying of idle processes", false, CMD_idletog}, + {'j', "toggle the displaying of jail ID", false, CMD_jidtog}, + {'J', "display processes for only one jail (+ selects all jails)", false, CMD_jail}, + {'k', "kill processes; send a signal to a list of processes", false, CMD_kill}, + {'q', "quit" , true, CMD_quit}, + {'m', "toggle the display between 'cpu' and 'io' modes", false, CMD_viewtog}, + {'n', "change number of processes to display", false, CMD_number}, + {'#', "change number of processes to display", false, CMD_number}, + {'o', "specify the sort order", false, CMD_order}, + {'p', "display one process (+ selects all processes)", false, CMD_pid}, + {'P', "toggle the displaying of per-CPU statistics", false, CMD_pcputog}, + {'r', "renice a process", false, CMD_renice}, + {'s', "change number of seconds to delay between updates", false, CMD_delay}, + {'S', "toggle the displaying of system processes", false, CMD_viewsys}, + {'a', "toggle the displaying of process titles", false, CMD_showargs}, + {'T', "toggle the displaying of thread IDs", false, CMD_toggletid}, + {'t', "toggle the display of this process", false, CMD_selftog}, + {'u', "display processes for only one user (+ selects all users)", false, CMD_user}, + {'w', "toggle the display of swap use for each process", false, CMD_swaptog}, + {'z', "toggle the displaying of the system idle process", false, CMD_kidletog}, + {' ', "update the display", false, CMD_update}, + {0, NULL, true, CMD_NONE} }; -/* XXX: eventually remove command_chars, but assert they are the same for now */ void show_help(void) Modified: head/usr.bin/top/commands.h ============================================================================== --- head/usr.bin/top/commands.h Tue Jun 12 06:46:03 2018 (r334987) +++ head/usr.bin/top/commands.h Tue Jun 12 06:53:31 2018 (r334988) @@ -18,10 +18,43 @@ void show_errors(void); int error_count(void); void show_help(void); +enum cmd_id { + CMD_NONE, + CMD_redraw, + CMD_update, + CMD_quit, + CMD_help, + CMD_errors, + CMD_number, + CMD_delay, + CMD_displays, + CMD_kill, + CMD_renice, + CMD_idletog, + CMD_user, + CMD_selftog, + CMD_thrtog, + CMD_viewtog, + CMD_viewsys, + CMD_wcputog, + CMD_showargs, + CMD_jidtog, + CMD_kidletog, + CMD_pcputog, + CMD_jail, + CMD_swaptog, + CMD_order, + CMD_pid , + CMD_toggletid, +}; + struct command { char c; const char * const desc; bool available_to_dumb; + enum cmd_id id; }; + +extern const struct command all_commands[]; #endif /* COMMANDS_H */ Modified: head/usr.bin/top/screen.c ============================================================================== --- head/usr.bin/top/screen.c Tue Jun 12 06:46:03 2018 (r334987) +++ head/usr.bin/top/screen.c Tue Jun 12 06:53:31 2018 (r334988) @@ -37,7 +37,6 @@ int screen_width; char ch_erase; char ch_kill; char smart_terminal; -char PC; static char termcap_buf[1024]; static char string_buffer[1024]; static char home[15]; Modified: head/usr.bin/top/top.c ============================================================================== --- head/usr.bin/top/top.c Tue Jun 12 06:46:03 2018 (r334987) +++ head/usr.bin/top/top.c Tue Jun 12 06:53:31 2018 (r334988) @@ -20,6 +20,7 @@ #include #include +#include #include #include #include @@ -225,7 +226,6 @@ main(int argc, char *argv[]) { int i; int active_procs; - int change; struct system_info system_info; struct statics statics; @@ -253,48 +253,12 @@ main(int argc, char *argv[]) char warnings = 0; char topn_specified = false; char ch; - char *iptr; char no_command = 1; struct timeval timeout; char *order_name = NULL; int order_index = 0; fd_set readfds; - static const char command_chars[] = "\f qh?en#sdkriIutHmSCajzPJwopT"; -/* these defines enumerate the "strchr"s of the commands in command_chars */ -#define CMD_redraw 0 -#define CMD_update 1 -#define CMD_quit 2 -#define CMD_help1 3 -#define CMD_help2 4 -#define CMD_OSLIMIT 4 /* terminals with OS can only handle commands */ -#define CMD_errors 5 /* less than or equal to CMD_OSLIMIT */ -#define CMD_number1 6 -#define CMD_number2 7 -#define CMD_delay 8 -#define CMD_displays 9 -#define CMD_kill 10 -#define CMD_renice 11 -#define CMD_idletog 12 -#define CMD_idletog2 13 -#define CMD_user 14 -#define CMD_selftog 15 -#define CMD_thrtog 16 -#define CMD_viewtog 17 -#define CMD_viewsys 18 -#define CMD_wcputog 19 -#define CMD_showargs 20 -#define CMD_jidtog 21 -#define CMD_kidletog 22 -#define CMD_pcputog 23 -#define CMD_jail 24 -#define CMD_swaptog 25 -#define CMD_order 26 -#define CMD_pid 27 -#define CMD_toggletid 28 - -_Static_assert(sizeof(command_chars) == CMD_toggletid + 2, "command chars size"); - /* set the buffer for stdout */ #ifdef DEBUG extern FILE *debug; @@ -843,6 +807,7 @@ restart: { int newval; const char *errmsg; + const struct command *cptr; /* something to read -- clear the message area first */ clear_message(); @@ -856,28 +821,30 @@ restart: putchar('\r'); quit(1); } - if ((iptr = strchr(command_chars, ch)) == NULL) - { - if (ch != '\r' && ch != '\n') - { - /* illegal command */ + if (ch == '\r' || ch == '\n') { + continue; + } + cptr = all_commands; + while (cptr->c != '\0') { + if (cptr->c == ch) { + break; + } + cptr++; + } + if (cptr->c == '\0') { new_message(MT_standout, " Command not understood"); + putchar('\r'); + no_command = true; } - putchar('\r'); - no_command = true; - } - else - { - change = iptr - command_chars; - if (overstrike && change > CMD_OSLIMIT) + if (overstrike && !cptr->available_to_dumb) { - /* error */ new_message(MT_standout, " Command cannot be handled by this terminal"); putchar('\r'); - no_command = true; + no_command = true; } - else switch(change) + if (!no_command) { + switch(cptr->id) { case CMD_redraw: /* redraw screen */ reset_display(); @@ -893,12 +860,11 @@ restart: } break; - case CMD_quit: /* quit */ + case CMD_quit: quit(0); break; - case CMD_help1: /* help */ - case CMD_help2: + case CMD_help: reset_display(); top_clear(); show_help(); @@ -926,8 +892,7 @@ restart: } break; - case CMD_number1: /* new number */ - case CMD_number2: + case CMD_number: new_message(MT_standout, "Number of processes to show: "); newval = readline(tempbuf1, 8, true); @@ -1019,7 +984,6 @@ restart: break; case CMD_idletog: - case CMD_idletog2: ps.idle = !ps.idle; new_message(MT_standout | MT_delayed, " %sisplaying idle processes.", @@ -1204,17 +1168,16 @@ restart: } else clear_message(); break; - default: - new_message(MT_standout, " BAD CASE IN SWITCH!"); - putchar('\r'); + case CMD_NONE: + assert("reached switch without command"); } + } } /* flush out stuff that may have been written */ fflush(stdout); } } - } } #ifdef DEBUG From owner-svn-src-head@freebsd.org Tue Jun 12 07:14:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5695A10054F8; Tue, 12 Jun 2018 07:14:14 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A8CA71B1E; Tue, 12 Jun 2018 07:14:14 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF919272B5; Tue, 12 Jun 2018 07:14:13 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5C7EDmE005287; Tue, 12 Jun 2018 07:14:13 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5C7ECp5005281; Tue, 12 Jun 2018 07:14:12 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806120714.w5C7ECp5005281@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Tue, 12 Jun 2018 07:14:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334989 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 334989 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 07:14:14 -0000 Author: eadler Date: Tue Jun 12 07:14:12 2018 New Revision: 334989 URL: https://svnweb.freebsd.org/changeset/base/334989 Log: top(1): style and related - style(9) - remove now-defunct comments - remove getuid check for low delay - expand range of format_k Modified: head/usr.bin/top/commands.c head/usr.bin/top/machine.h head/usr.bin/top/top.c head/usr.bin/top/top.h head/usr.bin/top/utils.c head/usr.bin/top/utils.h Modified: head/usr.bin/top/commands.c ============================================================================== --- head/usr.bin/top/commands.c Tue Jun 12 06:53:31 2018 (r334988) +++ head/usr.bin/top/commands.c Tue Jun 12 07:14:12 2018 (r334989) @@ -195,7 +195,8 @@ static char err_listem[] = #define STRMAX 80 -char *err_string(void) +char * +err_string(void) { struct errs *errp; int cnt = 0; Modified: head/usr.bin/top/machine.h ============================================================================== --- head/usr.bin/top/machine.h Tue Jun 12 06:53:31 2018 (r334988) +++ head/usr.bin/top/machine.h Tue Jun 12 07:14:12 2018 (r334989) @@ -53,10 +53,6 @@ struct system_info int ncpus; }; -/* cpu_states is an array of percentages * 10. For example, - the (integer) value 105 is 10.5% (or .105). - */ - /* * the process_select struct tells get_process_info what processes * and information we are interested in seeing Modified: head/usr.bin/top/top.c ============================================================================== --- head/usr.bin/top/top.c Tue Jun 12 06:53:31 2018 (r334988) +++ head/usr.bin/top/top.c Tue Jun 12 07:14:12 2018 (r334989) @@ -925,7 +925,7 @@ restart: new_message(MT_standout, "Seconds to delay: "); if ((i = readline(tempbuf1, 8, true)) > -1) { - if ((delay = i) == 0 && getuid() != 0) + if ((delay = i) == 0) { delay = 1; } @@ -1034,8 +1034,7 @@ restart: putchar('\r'); break; case CMD_viewtog: - if (++displaymode == DISP_MAX) - displaymode = 0; + displaymode = displaymode == DISP_IO ? DISP_CPU : DISP_IO; header_text = format_header(uname_field); display_header(true); d_header = i_header; Modified: head/usr.bin/top/top.h ============================================================================== --- head/usr.bin/top/top.h Tue Jun 12 06:53:31 2018 (r334988) +++ head/usr.bin/top/top.h Tue Jun 12 07:14:12 2018 (r334989) @@ -1,7 +1,6 @@ /*- * Top - a top users display for Berkeley Unix * - * General (global) definitions * $FreeBSD$ */ @@ -11,7 +10,7 @@ #include /* Number of lines of header information on the standard screen */ -extern int Header_lines; /* 7 */ +extern int Header_lines; /* Maximum number of columns allowed for display */ #define MAX_COLS 512 Modified: head/usr.bin/top/utils.c ============================================================================== --- head/usr.bin/top/utils.c Tue Jun 12 06:53:31 2018 (r334988) +++ head/usr.bin/top/utils.c Tue Jun 12 07:14:12 2018 (r334989) @@ -124,7 +124,7 @@ itoa7(int val) /* * digits(val) - return number of decimal digits in val. Only works for - * non-negative numbers. If val <= 0 then digits(val) == 0. + * non-negative numbers. */ int __pure2 @@ -319,7 +319,7 @@ format_time(long seconds) #define NUM_STRINGS 8 char * -format_k(int amt) +format_k(long amt) { static char retarray[NUM_STRINGS][16]; static int index = 0; Modified: head/usr.bin/top/utils.h ============================================================================== --- head/usr.bin/top/utils.h Tue Jun 12 06:53:31 2018 (r334988) +++ head/usr.bin/top/utils.h Tue Jun 12 07:14:12 2018 (r334989) @@ -19,7 +19,7 @@ int digits(int); const char * const *argparse(char *, int *); long percentages(int, int *, long *, long *, long *); char *format_time(long); -char *format_k(int); +char *format_k(long); char *format_k2(unsigned long long); int string_index(const char *string, const char * const *array); int find_pid(pid_t pid); From owner-svn-src-head@freebsd.org Tue Jun 12 07:24:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C51C81006B2B; Tue, 12 Jun 2018 07:24:36 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 42AFA7242B; Tue, 12 Jun 2018 07:24:36 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id D6950260A9F; Tue, 12 Jun 2018 09:24:33 +0200 (CEST) Subject: Re: svn commit: r334982 - in head/etc: . devd To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201806112248.w5BMmZV6044273@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <187744e0-65dc-326f-2477-057c924c2bca@selasky.org> Date: Tue, 12 Jun 2018 09:24:19 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <201806112248.w5BMmZV6044273@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 07:24:37 -0000 On 06/12/18 00:48, Warner Losh wrote: > User service foo rather than /etc/rc.d/foo. > > devd predates service in the system. Modernize usage to use service to > start/stop things in reaction to events rather than calling the rc > file directly. > > This was pointed out in my talk at BSDcan as well as indirectly > referrred to as a barrier to entry for OpenRC in that working group. Remember that the service binary is part of /usr and /usr must be mounted before it is available which might also be handled by devd. You should move the service binary to /sbin/service then? --HPS From owner-svn-src-head@freebsd.org Tue Jun 12 07:32:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F420910079F3; Tue, 12 Jun 2018 07:32:00 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A98F272AB1; Tue, 12 Jun 2018 07:32:00 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8AA25275FD; Tue, 12 Jun 2018 07:32:00 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5C7W0Vf013680; Tue, 12 Jun 2018 07:32:00 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5C7VxRl013670; Tue, 12 Jun 2018 07:31:59 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806120731.w5C7VxRl013670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Tue, 12 Jun 2018 07:31:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334990 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 334990 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 07:32:01 -0000 Author: eadler Date: Tue Jun 12 07:31:59 2018 New Revision: 334990 URL: https://svnweb.freebsd.org/changeset/base/334990 Log: top(1): remove trailing whitespace Modified: head/usr.bin/top/commands.c head/usr.bin/top/display.c head/usr.bin/top/top.c head/usr.bin/top/top.h head/usr.bin/top/utils.c Modified: head/usr.bin/top/commands.c ============================================================================== --- head/usr.bin/top/commands.c Tue Jun 12 07:14:12 2018 (r334989) +++ head/usr.bin/top/commands.c Tue Jun 12 07:31:59 2018 (r334990) @@ -171,7 +171,7 @@ scanint(char *str, int *intp) static struct errs errs[ERRMAX]; static int errcnt; static char err_toomany[] = " too many errors occurred"; -static char err_listem[] = +static char err_listem[] = " Many errors occurred. Press `e' to display the list of errors."; /* These macros get used to reset and log the errors */ @@ -403,7 +403,7 @@ kill_procs(char *str) return(invalid_signal_number); } } - else + else { signum = signame_to_signum(str + 1); Modified: head/usr.bin/top/display.c ============================================================================== --- head/usr.bin/top/display.c Tue Jun 12 07:14:12 2018 (r334989) +++ head/usr.bin/top/display.c Tue Jun 12 07:31:59 2018 (r334990) @@ -164,7 +164,7 @@ int display_updatecpus(struct statics *statics) { int lines; int i; - + /* call resize to do the dirty work */ lines = display_resize(); if (pcpu_stats) @@ -180,10 +180,10 @@ int display_updatecpus(struct statics *statics) for (i = 0; i < num_cpustates * num_cpus; ++i) { lcpustates[i] = -1; } - + return(lines); } - + int display_init(struct statics * statics) { int lines; @@ -220,7 +220,7 @@ int display_init(struct statics * statics) arc_names = statics->arc_names; carc_names = statics->carc_names; - + /* calculate starting columns where needed */ cpustate_total_length = 0; pp = cpustate_names; @@ -306,7 +306,7 @@ i_timeofday(time_t *tod) /* * Display the current time. * "ctime" always returns a string that looks like this: - * + * * Sun Sep 16 01:03:52 1973 * 012345678901234567890123 * 1 2 @@ -641,7 +641,7 @@ u_carc(int *stats) summary_format(new, stats, carc_names); line_update(carc_buffer, new, x_carc, y_carc); } - + /* * *_swap(stats) - print "Swap: " followed by the swap summary string * @@ -1095,7 +1095,7 @@ static void summary_format(char *str, int *numbers, co /* is this number a ratio? */ else if (thisname[0] == ':') { - (void) snprintf(rbuf, sizeof(rbuf), "%.2f", + (void) snprintf(rbuf, sizeof(rbuf), "%.2f", (float)*(numbers - 2) / (float)num); p = stpcpy(p, rbuf); p = stpcpy(p, thisname); @@ -1160,7 +1160,7 @@ line_update(char *old, char *new, int start, int line) lastcol = 1; } old++; - + /* * main loop -- check each character. If the old and new aren't the * same, then update the display. When the distance from the @@ -1201,7 +1201,7 @@ line_update(char *old, char *new, int start, int line) /* already there, update position */ lastcol++; } - + /* write what we need to */ if (ch == '\0') { @@ -1216,11 +1216,11 @@ line_update(char *old, char *new, int start, int line) /* put the new character in the screen buffer */ *old = ch; } - + /* update working column and screen buffer pointer */ newcol++; old++; - + } while (ch != '\0'); /* zero out the rest of the line buffer -- MUST BE DONE! */ Modified: head/usr.bin/top/top.c ============================================================================== --- head/usr.bin/top/top.c Tue Jun 12 07:14:12 2018 (r334989) +++ head/usr.bin/top/top.c Tue Jun 12 07:31:59 2018 (r334990) @@ -294,7 +294,7 @@ main(int argc, char *argv[]) ps.jail = false; ps.swap = false; ps.kidle = true; - ps.pid = -1; + ps.pid = -1; ps.command = NULL; ps.thread_id = false; @@ -548,7 +548,7 @@ main(int argc, char *argv[]) fprintf(stderr, "%s: can't allocate sufficient memory\n", myname); exit(4); } - + /* print warning if user requested more processes than we can display */ if (topn > max_topn) { @@ -617,7 +617,7 @@ restart: { int (*compare)(const void * const, const void * const); - + /* get the current stats */ get_system_info(&system_info); @@ -673,7 +673,7 @@ restart: /* update the header area */ (*d_header)(header_text); - + if (topn > 0) { /* determine number of processes to actually display */ @@ -736,7 +736,7 @@ restart: d_process = u_process; } } - + no_command = true; if (!interactive) { @@ -808,7 +808,7 @@ restart: int newval; const char *errmsg; const struct command *cptr; - + /* something to read -- clear the message area first */ clear_message(); @@ -849,7 +849,7 @@ restart: case CMD_redraw: /* redraw screen */ reset_display(); break; - + case CMD_update: /* merely update display */ /* is the load average high? */ if (system_info.load_avg[0] > LoadMax) @@ -859,11 +859,11 @@ restart: fflush(stdout); } break; - + case CMD_quit: quit(0); break; - + case CMD_help: reset_display(); top_clear(); @@ -872,7 +872,7 @@ restart: fflush(stdout); read(0, &ch, 1); break; - + case CMD_errors: /* show errors */ if (error_count() == 0) { @@ -891,7 +891,7 @@ restart: read(0, &ch, 1); } break; - + case CMD_number: new_message(MT_standout, "Number of processes to show: "); @@ -920,7 +920,7 @@ restart: topn = newval; } break; - + case CMD_delay: /* new seconds delay */ new_message(MT_standout, "Seconds to delay: "); if ((i = readline(tempbuf1, 8, true)) > -1) @@ -932,7 +932,7 @@ restart: } clear_message(); break; - + case CMD_displays: /* change display count */ new_message(MT_standout, "Displays to show (currently %s): ", @@ -948,7 +948,7 @@ restart: } clear_message(); break; - + case CMD_kill: /* kill program */ new_message(0, "kill "); if (readline(tempbuf2, sizeof(tempbuf2), false) > 0) @@ -965,7 +965,7 @@ restart: clear_message(); } break; - + case CMD_renice: /* renice program */ new_message(0, "renice "); if (readline(tempbuf2, sizeof(tempbuf2), false) > 0) @@ -1003,7 +1003,7 @@ restart: if (handle_user(tempbuf2, sizeof(tempbuf2))) no_command = true; break; - + case CMD_thrtog: ps.thread = !ps.thread; new_message(MT_standout | MT_delayed, @@ -1114,7 +1114,7 @@ restart: clear_message(); } break; - + case CMD_kidletog: ps.kidle = !ps.kidle; new_message(MT_standout | MT_delayed, Modified: head/usr.bin/top/top.h ============================================================================== --- head/usr.bin/top/top.h Tue Jun 12 07:14:12 2018 (r334989) +++ head/usr.bin/top/top.h Tue Jun 12 07:31:59 2018 (r334990) @@ -60,7 +60,7 @@ void quit(int); #define LoadMax 5.0 /* - * "Nominal_TOPN" is used as the default TOPN when + * "Nominal_TOPN" is used as the default TOPN when * the output is a dumb terminal. If we didn't do this, then * we will get every * process in the system when running top on a dumb terminal (or redirected Modified: head/usr.bin/top/utils.c ============================================================================== --- head/usr.bin/top/utils.c Tue Jun 12 07:14:12 2018 (r334989) +++ head/usr.bin/top/utils.c Tue Jun 12 07:31:59 2018 (r334990) @@ -402,6 +402,6 @@ find_pid(pid_t pid) } done: - kvm_close(kd); + kvm_close(kd); return ret; } From owner-svn-src-head@freebsd.org Tue Jun 12 07:51:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FABF100A300; Tue, 12 Jun 2018 07:51:04 +0000 (UTC) (envelope-from pi@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E470738B4; Tue, 12 Jun 2018 07:51:04 +0000 (UTC) (envelope-from pi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E518F2782E; Tue, 12 Jun 2018 07:51:03 +0000 (UTC) (envelope-from pi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5C7p3ej022162; Tue, 12 Jun 2018 07:51:03 GMT (envelope-from pi@FreeBSD.org) Received: (from pi@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5C7p3cJ022161; Tue, 12 Jun 2018 07:51:03 GMT (envelope-from pi@FreeBSD.org) Message-Id: <201806120751.w5C7p3cJ022161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pi set sender to pi@FreeBSD.org using -f From: Kurt Jaeger Date: Tue, 12 Jun 2018 07:51:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334991 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: pi X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 334991 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 07:51:04 -0000 Author: pi (ports committer) Date: Tue Jun 12 07:51:03 2018 New Revision: 334991 URL: https://svnweb.freebsd.org/changeset/base/334991 Log: Add hrs, meta and myself to share/misc/committers-ports.dot Approved by: remko Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Tue Jun 12 07:31:59 2018 (r334990) +++ head/share/misc/committers-ports.dot Tue Jun 12 07:51:03 2018 (r334991) @@ -123,6 +123,7 @@ gordon [label="Gordon Tetlow\ngordon@FreeBSD.org\n2014 grembo [label="Michael Gmelin\ngrembo@FreeBSD.org\n2014/01/21"] gnn [label="George Neville-Neil\ngnn@FreeBSD.org\n2013/09/04"] hq [label="Herve Quiroz\nhq@FreeBSD.org\n2004/08/05"] +hrs [label="Hiroki Sato\nhrs@FreeBSD.org\n2004/04/10"] ijliao [label="Ying-Chieh Liao\nijliao@FreeBSD.org\n2001/01/20"] itetcu [label="Ion-Mihai Tetcu\nitetcu@FreeBSD.org\n2006/06/07"] jacula [label="Giuseppe Pilichi\njacula@FreeBSD.org\n2010/04/05"] @@ -177,6 +178,7 @@ markus [label="Markus Brueffer\nmarkus@FreeBSD.org\n20 martymac [label="Ganael Laplanche\nmartymac@FreeBSD.org\n2010/09/24"] mat [label="Mathieu Arnold\nmat@FreeBSD.org\n2003/08/15"] matthew [label="Matthew Seaman\nmatthew@FreeBSD.org\n2012/02/07"] +meta [label="Koichiro Iwao\nmeta@FreeBSD.org\n2018/03/19"] mezz [label="Jeremy Messenger\nmezz@FreeBSD.org\n2004/04/30"] mfechner [label="Matthias Fechner\nmfechner@FreeBSD.org\n2018/03/01"] mharo [label="Michael Haro\nmharo@FreeBSD.org\n1999/04/13"] @@ -205,6 +207,7 @@ pclin [label="Po-Chien Lin\npclin@FreeBSD.org\n2013/02 pgj [label="Gabor Pali\npgj@FreeBSD.org\n2009/04/12"] pgollucci [label="Philip M. Gollucci\npgollucci@FreeBSD.org\n2008/07/21"] philip [label="Philip Paeps\nphilip@FreeBSD.org\n2005/10/19"] +pi [label="Kurt Jaeger\npi@FreeBSD.org\n2014/03/14"] pizzamig [label="Luca Pizzamiglio\npizzamig@FreeBSD.org\n2017/08/25"] rafan [label="Rong-En Fan\nrafan@FreeBSD.org\n2006/06/23"] rakuco [label="Raphael Kubo da Costa\nrakuco@FreeBSD.org\n2011/08/22"] @@ -351,6 +354,7 @@ cs -> kami culot -> danilo culot -> jase culot -> marino +culot -> pi culot -> wg db -> tj @@ -437,6 +441,8 @@ glarkin -> rm glewis -> hq glewis -> jkim +hrs -> meta + ijliao -> leeym imp -> dteske @@ -450,6 +456,7 @@ itetcu -> sylvio jadawin -> bapt jadawin -> flo jadawin -> olivier +jadawin -> pi jadawin -> riggs jadawin -> sbz jadawin -> wen @@ -491,6 +498,8 @@ ler -> leres lifanov -> ultima +linimon -> hrs + lioux -> pat lme -> pizzamig @@ -597,6 +606,7 @@ pgollucci -> swills philip -> koitsu +pi -> meta pi -> tz rafan -> chinsan From owner-svn-src-head@freebsd.org Tue Jun 12 08:43:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39CDA1011D5A; Tue, 12 Jun 2018 08:43:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E082376A63; Tue, 12 Jun 2018 08:43:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C25CE206; Tue, 12 Jun 2018 08:43:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5C8hnB2052067; Tue, 12 Jun 2018 08:43:49 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5C8hnXp052066; Tue, 12 Jun 2018 08:43:49 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806120843.w5C8hnXp052066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 12 Jun 2018 08:43:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334993 - head/sys/compat/linuxkpi/common/include/net X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/net X-SVN-Commit-Revision: 334993 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 08:43:50 -0000 Author: hselasky Date: Tue Jun 12 08:43:49 2018 New Revision: 334993 URL: https://svnweb.freebsd.org/changeset/base/334993 Log: Implement the ip_eth_mc_map() function in the LinuxKPI. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/net/ip.h Modified: head/sys/compat/linuxkpi/common/include/net/ip.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/net/ip.h Tue Jun 12 08:18:56 2018 (r334992) +++ head/sys/compat/linuxkpi/common/include/net/ip.h Tue Jun 12 08:43:49 2018 (r334993) @@ -58,6 +58,20 @@ inet_get_local_port_range(struct vnet *vnet, int *low, } static inline void +ip_eth_mc_map(uint32_t addr, char *buf) +{ + + addr = ntohl(addr); + + buf[0] = 0x01; + buf[1] = 0x00; + buf[2] = 0x5e; + buf[3] = (addr >> 16) & 0x7f; + buf[4] = (addr >> 8) & 0xff; + buf[5] = (addr & 0xff); +} + +static inline void ip_ib_mc_map(uint32_t addr, const unsigned char *bcast, char *buf) { unsigned char scope; From owner-svn-src-head@freebsd.org Tue Jun 12 10:41:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B48E0102052A; Tue, 12 Jun 2018 10:41:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 67C1E7C04A; Tue, 12 Jun 2018 10:41:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 48FC81433; Tue, 12 Jun 2018 10:41:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5CAfRtg010400; Tue, 12 Jun 2018 10:41:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5CAfRTc010399; Tue, 12 Jun 2018 10:41:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201806121041.w5CAfRTc010399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 12 Jun 2018 10:41:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334994 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 334994 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 10:41:27 -0000 Author: kib Date: Tue Jun 12 10:41:26 2018 New Revision: 334994 URL: https://svnweb.freebsd.org/changeset/base/334994 Log: Fix typo. Sponsored by: The FreeBSD Foundation Modified: head/sys/i386/i386/trap.c Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Tue Jun 12 08:43:49 2018 (r334993) +++ head/sys/i386/i386/trap.c Tue Jun 12 10:41:26 2018 (r334994) @@ -218,7 +218,7 @@ trap(struct trapframe *frame) type = frame->tf_trapno; KASSERT((read_eflags() & PSL_I) == 0, - ("trap: interrupts enaabled, type %d frame %p", type, frame)); + ("trap: interrupts enabled, type %d frame %p", type, frame)); #ifdef SMP /* Handler for NMI IPIs used for stopping CPUs. */ From owner-svn-src-head@freebsd.org Tue Jun 12 10:43:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B8ED10209A0; Tue, 12 Jun 2018 10:43:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3C2E47C319; Tue, 12 Jun 2018 10:43:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1DD47157C; Tue, 12 Jun 2018 10:43:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5CAhLRC014185; Tue, 12 Jun 2018 10:43:21 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5CAhKhd014184; Tue, 12 Jun 2018 10:43:20 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201806121043.w5CAhKhd014184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 12 Jun 2018 10:43:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334995 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 334995 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 10:43:21 -0000 Author: kib Date: Tue Jun 12 10:43:20 2018 New Revision: 334995 URL: https://svnweb.freebsd.org/changeset/base/334995 Log: All exceptions IDT descriptors must use interrupt gates on 4/4 kernel. Fix it for #MF. Noted by: rlibby Sponsored by: The FreeBSD Foundation Modified: head/sys/i386/i386/machdep.c Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Tue Jun 12 10:41:26 2018 (r334994) +++ head/sys/i386/i386/machdep.c Tue Jun 12 10:43:20 2018 (r334995) @@ -2253,7 +2253,7 @@ i386_setidt1(void) GSEL(GCODE_SEL, SEL_KPL)); setidt(IDT_PF, &IDTVEC(page), SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); - setidt(IDT_MF, &IDTVEC(fpu), SDT_SYS386TGT, SEL_KPL, + setidt(IDT_MF, &IDTVEC(fpu), SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); setidt(IDT_AC, &IDTVEC(align), SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); From owner-svn-src-head@freebsd.org Tue Jun 12 11:47:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A4E010061C6; Tue, 12 Jun 2018 11:47:22 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B357B7EAD2; Tue, 12 Jun 2018 11:47:21 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 95FBA1F47; Tue, 12 Jun 2018 11:47:21 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5CBlLiq045038; Tue, 12 Jun 2018 11:47:21 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5CBlLqY045037; Tue, 12 Jun 2018 11:47:21 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201806121147.w5CBlLqY045037@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 12 Jun 2018 11:47:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334996 - head/sys/arm64/rockchip/clk X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip/clk X-SVN-Commit-Revision: 334996 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 11:47:22 -0000 Author: manu Date: Tue Jun 12 11:47:21 2018 New Revision: 334996 URL: https://svnweb.freebsd.org/changeset/base/334996 Log: arm64: rockchip: Correctly set armclk Parent needs to be the same frequency as the armclk, not twice the freq. The real divider is incremented by one so write it with - 1 The rate can be at index 0 Pointy Hat To: myself Modified: head/sys/arm64/rockchip/clk/rk_clk_armclk.c Modified: head/sys/arm64/rockchip/clk/rk_clk_armclk.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk_clk_armclk.c Tue Jun 12 10:43:20 2018 (r334995) +++ head/sys/arm64/rockchip/clk/rk_clk_armclk.c Tue Jun 12 11:47:21 2018 (r334996) @@ -154,12 +154,13 @@ rk_clk_armclk_set_freq(struct clknode *clk, uint64_t f if (sc->rates[i].freq == *fout) { best = sc->rates[i].freq; div = sc->rates[i].div; - best_p = best * (div + 1); + best_p = best * div; rate = i; + break; } } - if (rate == 0) + if (rate == sc->nrates) return (0); err = clknode_set_freq(p_main, best_p, 0, 1); @@ -177,7 +178,7 @@ rk_clk_armclk_set_freq(struct clknode *clk, uint64_t f DEVICE_LOCK(clk); READ4(clk, sc->muxdiv_offset, &val); val &= ~sc->div_mask; - val |= div << sc->div_shift; + val |= (div - 1) << sc->div_shift; WRITE4(clk, sc->muxdiv_offset, val | RK_CLK_ARMCLK_MASK); DEVICE_UNLOCK(clk); From owner-svn-src-head@freebsd.org Tue Jun 12 11:51:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54C8C100680C; Tue, 12 Jun 2018 11:51:06 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 053E07ED60; Tue, 12 Jun 2018 11:51:06 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id EEB1022278; Tue, 12 Jun 2018 11:51:05 +0000 (UTC) Date: Tue, 12 Jun 2018 11:51:05 +0000 From: Alexey Dokuchaev To: Warner Losh Cc: Devin Teske , svn-src-head@freebsd.org, Kyle Evans , svn-src-all@freebsd.org, src-committers Subject: Re: svn commit: r334939 - head/stand/lua Message-ID: <20180612115105.GB75210@FreeBSD.org> References: <201806110132.w5B1WI5d094546@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.5 (2018-04-13) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 11:51:06 -0000 On Mon, Jun 11, 2018 at 08:07:23AM -0600, Warner Losh wrote: > ... > The last articulated plan in arch@ was that LUA will be default in 12, and > we plan to remove FORTH in 13. Last time I said it there in February, there > was only email agreeing that I could find. This matches the in-person > consensus poll I took at BSDcan as well. I think it would take a very > extraordinary set circumstance and severe problems with LUA to change those > plans. For the idiots among us, what's wrong the with FICL-based loader(8) and why is it being replaced with Lua one? ./danfe From owner-svn-src-head@freebsd.org Tue Jun 12 12:41:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51AC6100CC2E; Tue, 12 Jun 2018 12:41:24 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 02ADA81139; Tue, 12 Jun 2018 12:41:24 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf0-f46.google.com (mail-lf0-f46.google.com [209.85.215.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 97C701C704; Tue, 12 Jun 2018 12:41:23 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf0-f46.google.com with SMTP id d24-v6so35739673lfa.8; Tue, 12 Jun 2018 05:41:23 -0700 (PDT) X-Gm-Message-State: APt69E0AV/njLhaJcMmam7HSDvrEFeuTaiwVHUgPUIcfD/frD2teD7QA nsQeE9CRzt0XKHz7YL5IWGl/cW2mskCYFwMemdk= X-Google-Smtp-Source: ADUXVKJUExif0VDoe7kAsxhs4/Z2DQszenE2Ep9Wyav0mgKzpMnVf5lc4By2Dih8MrfULwcwdOenGQvr65ElYG1L4JU= X-Received: by 2002:a2e:1710:: with SMTP id l16-v6mr170746lje.74.1528807282302; Tue, 12 Jun 2018 05:41:22 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:8582:0:0:0:0:0 with HTTP; Tue, 12 Jun 2018 05:41:01 -0700 (PDT) In-Reply-To: <20180612115105.GB75210@FreeBSD.org> References: <201806110132.w5B1WI5d094546@repo.freebsd.org> <20180612115105.GB75210@FreeBSD.org> From: Kyle Evans Date: Tue, 12 Jun 2018 07:41:01 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334939 - head/stand/lua To: Alexey Dokuchaev Cc: Warner Losh , Devin Teske , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 12:41:24 -0000 On Tue, Jun 12, 2018 at 6:51 AM, Alexey Dokuchaev wrote: > On Mon, Jun 11, 2018 at 08:07:23AM -0600, Warner Losh wrote: >> ... >> The last articulated plan in arch@ was that LUA will be default in 12, and >> we plan to remove FORTH in 13. Last time I said it there in February, there >> was only email agreeing that I could find. This matches the in-person >> consensus poll I took at BSDcan as well. I think it would take a very >> extraordinary set circumstance and severe problems with LUA to change those >> plans. > > For the idiots among us, what's wrong the with FICL-based loader(8) and why > is it being replaced with Lua one? There's nothing wrong, per se, with the FICL-based loader(8). It is incredibly stable, it works well, and Devin has done a great job of maintaining it. The problem is that it's hard to get buy-in from others on FORTH and it's a harder language for "kids these days" to learn because it's so different from what's commonly used basically everywhere else. By maintaining the status quo, we're stuck in a situation where we won't get any new blood (which we already don't have much of, mind you) willing to maintain loader(8) because of this barrier to entry. Lua, on the other hand, is much much easier to pick up and grasp just by reading existing code. We've already had tons of interest from others willing to hack on the Lua since introduction, and at least one feature already added by someone who isn't me (auto-enumeration of kernel directories in /boot). From owner-svn-src-head@freebsd.org Tue Jun 12 12:45:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C52CE100D3FC for ; Tue, 12 Jun 2018 12:45:41 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B96B8159B; Tue, 12 Jun 2018 12:45:41 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w5CCja1w033631; Tue, 12 Jun 2018 05:45:36 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w5CCjasC033630; Tue, 12 Jun 2018 05:45:36 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806121245.w5CCjasC033630@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r334939 - head/stand/lua In-Reply-To: <20180612115105.GB75210@FreeBSD.org> To: Alexey Dokuchaev Date: Tue, 12 Jun 2018 05:45:36 -0700 (PDT) CC: Warner Losh , Devin Teske , svn-src-head@freebsd.org, Kyle Evans , svn-src-all@freebsd.org, src-committers Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 12:45:41 -0000 > On Mon, Jun 11, 2018 at 08:07:23AM -0600, Warner Losh wrote: > > ... > > The last articulated plan in arch@ was that LUA will be default in 12, and > > we plan to remove FORTH in 13. Last time I said it there in February, there > > was only email agreeing that I could find. This matches the in-person > > consensus poll I took at BSDcan as well. I think it would take a very > > extraordinary set circumstance and severe problems with LUA to change those > > plans. > > For the idiots among us, what's wrong the with FICL-based loader(8) and why > is it being replaced with Lua one? The number of forth programmers on the planet has diminished to the point trying to maintain and/or enhance the FreeBSD boot loader by either the project or down stream projects and vendors has sadly approached the high pain threshold. Oddly, I now have to learn lua :-) Which is probably not a bad thing. Perhaps my limited forth understanding may become useful in 2037 <:-) -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Jun 12 13:26:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B1151011BB4; Tue, 12 Jun 2018 13:26:33 +0000 (UTC) (envelope-from db@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AEA34833B4; Tue, 12 Jun 2018 13:26:32 +0000 (UTC) (envelope-from db@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 900E22FDF; Tue, 12 Jun 2018 13:26:32 +0000 (UTC) (envelope-from db@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5CDQWNo095539; Tue, 12 Jun 2018 13:26:32 GMT (envelope-from db@FreeBSD.org) Received: (from db@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5CDQV6Y095535; Tue, 12 Jun 2018 13:26:31 GMT (envelope-from db@FreeBSD.org) Message-Id: <201806121326.w5CDQV6Y095535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: db set sender to db@FreeBSD.org using -f From: Diane Bruce Date: Tue, 12 Jun 2018 13:26:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334997 - in head/sys: arm64/conf conf dev/uart modules/uart X-SVN-Group: head X-SVN-Commit-Author: db X-SVN-Commit-Paths: in head/sys: arm64/conf conf dev/uart modules/uart X-SVN-Commit-Revision: 334997 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 13:26:33 -0000 Author: db (ports committer) Date: Tue Jun 12 13:26:31 2018 New Revision: 334997 URL: https://svnweb.freebsd.org/changeset/base/334997 Log: Add a driver for the BCM2835 Mini-UART as seen on the RPi3 Reviewed by: andrew Approved by: andrew Differential Revision: https://reviews.freebsd.org/D15684 Added: head/sys/dev/uart/uart_dev_mu.c (contents, props changed) Modified: head/sys/arm64/conf/GENERIC (contents, props changed) head/sys/conf/files.arm64 (contents, props changed) head/sys/modules/uart/Makefile (contents, props changed) Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Tue Jun 12 11:47:21 2018 (r334996) +++ head/sys/arm64/conf/GENERIC Tue Jun 12 13:26:31 2018 (r334997) @@ -165,6 +165,7 @@ device dwmmc # Serial (COM) ports device uart # Generic UART driver device uart_msm # Qualcomm MSM UART driver +device uart_mu # RPI3 aux port device uart_mvebu # Armada 3700 UART driver device uart_ns8250 # ns8250-type UART driver device uart_snps Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Tue Jun 12 11:47:21 2018 (r334996) +++ head/sys/conf/files.arm64 Tue Jun 12 13:26:31 2018 (r334997) @@ -209,6 +209,7 @@ dev/pci/pci_host_generic_fdt.c optional pci fdt dev/psci/psci.c standard dev/psci/psci_arm64.S standard dev/uart/uart_cpu_arm64.c optional uart +dev/uart/uart_dev_mu.c optional uart uart_mu dev/uart/uart_dev_pl011.c optional uart pl011 dev/usb/controller/dwc_otg_hisi.c optional dwcotg fdt soc_hisi_hi6220 dev/usb/controller/ehci_mv.c optional ehci_mv fdt Added: head/sys/dev/uart/uart_dev_mu.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/uart/uart_dev_mu.c Tue Jun 12 13:26:31 2018 (r334997) @@ -0,0 +1,521 @@ +/*- + * Copyright (c) 2018 Diane Bruce + * + * 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. + */ + +/* + * Based on uart_dev_pl011.c + * Copyright (c) 2012 Semihalf. + * All rights reserved. + */ +/* + * The mini Uart has the following features: + * - 7 or 8 bit operation. + * - 1 start and 1 stop bit. + * - No parities. + * - Break generation. + * - 8 symbols deep FIFOs for receive and transmit. + * - SW controlled RTS, SW readable CTS. + * - Auto flow control with programmable FIFO level. + * - 16550 like registers. + * - Baudrate derived from system clock. + * This is a mini UART and it does NOT have the following capabilities: + * - Break detection + * - Framing errors detection. + * - Parity bit + * - Receive Time-out interrupt + * - DCD, DSR, DTR or RI signals. + * The implemented UART is not a 16650 compatible UART However as far + * as possible the first 8 control and status registers are laid out + * like a 16550 UART. All 16550 register bits which are not supported can + * be written but will be ignored and read back as 0. All control bits + * for simple UART receive/transmit operations are available. + */ + +#include "opt_acpi.h" +#include "opt_platform.h" + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#ifdef FDT +#include +#include +#endif +#include +#include "uart_if.h" + +/* BCM2835 Micro UART registers and masks*/ +#define AUX_MU_IO_REG 0x00 /* I/O register */ + +/* + * According to errata bits 1 and 2 are swapped, + * Also bits 2 and 3 are required to enable interrupts. + */ +#define AUX_MU_IER_REG 0x01 +#define IER_RXENABLE (1) +#define IER_TXENABLE (1<<1) +#define IER_REQUIRED (3<<2) +#define IER_MASK_ALL (IER_TXENABLE|IER_RXENABLE) + +#define AUX_MU_IIR_REG 0x02 +#define IIR_READY (1) +#define IIR_TXREADY (1<<1) +#define IIR_RXREADY (1<<2) +#define IIR_CLEAR (3<<1) + +#define AUX_MU_LCR_REG 0x03 +#define LCR_WLEN7 (0) +#define LCR_WLEN8 (3) + +#define AUX_MU_MCR_REG 0x04 +#define AUX_MCR_RTS (1<<1) + +#define AUX_MU_LSR_REG 0x05 +#define LSR_RXREADY (1) +#define LSR_OVRRUN (1<<1) +#define LSR_TXEMPTY (1<<5) +#define LSR_TXIDLE (1<<6) + +#define AUX_MU_MSR_REG 0x06 +#define MSR_CTS (1<<5) + +#define AUX_MU_SCRATCH_REG 0x07 + +#define AUX_MU_CNTL_REG 0x08 +#define CNTL_RXENAB (1) +#define CNTL_TXENAB (1<<1) + +#define AUX_MU_STAT_REG 0x09 +#define STAT_TX_SA (1<<1) +#define STAT_RX_SA (1) + +#define AUX_MU_BAUD_REG 0x0a + +/* + * FIXME: actual register size is SoC-dependent, we need to handle it + */ +#define __uart_getreg(bas, reg) \ + bus_space_read_4((bas)->bst, (bas)->bsh, uart_regofs(bas, reg)) +#define __uart_setreg(bas, reg, value) \ + bus_space_write_4((bas)->bst, (bas)->bsh, uart_regofs(bas, reg), value) + +/* + * Low-level UART interface. + */ +static int uart_mu_probe(struct uart_bas *bas); +static void uart_mu_init(struct uart_bas *bas, int, int, int, int); +static void uart_mu_term(struct uart_bas *bas); +static void uart_mu_putc(struct uart_bas *bas, int); +static int uart_mu_rxready(struct uart_bas *bas); +static int uart_mu_getc(struct uart_bas *bas, struct mtx *); + +static struct uart_ops uart_mu_ops = { + .probe = uart_mu_probe, + .init = uart_mu_init, + .term = uart_mu_term, + .putc = uart_mu_putc, + .rxready = uart_mu_rxready, + .getc = uart_mu_getc, +}; + +static int +uart_mu_probe(struct uart_bas *bas) +{ + + return (0); +} + +/* + * According to the docs, the cpu clock is locked to 250Mhz when + * the micro-uart is used + */ +#define CPU_CLOCK 250000000 + +static void +uart_mu_param(struct uart_bas *bas, int baudrate, int databits, int stopbits, + int parity) +{ + uint32_t line; + uint32_t baud; + + /* + * Zero all settings to make sure + * UART is disabled and not configured + */ + line = 0x0; + __uart_setreg(bas, AUX_MU_CNTL_REG, line); + + /* As I know UART is disabled I can setup the line */ + switch (databits) { + case 7: + line |= LCR_WLEN7; + break; + case 6: + case 8: + default: + line |= LCR_WLEN8; + break; + } + + __uart_setreg(bas, AUX_MU_LCR_REG, line); + + /* See 2.2.1 BCM2835-ARM-Peripherals baudrate */ + if (baudrate != 0) { + baud = CPU_CLOCK / (8 * baudrate); + /* XXX + * baud = cpu_clock() / (8 * baudrate); + */ + __uart_setreg(bas, AUX_MU_BAUD_REG, ((uint32_t)(baud & 0xFFFF))); + } + + /* re-enable UART */ + __uart_setreg(bas, AUX_MU_CNTL_REG, CNTL_RXENAB|CNTL_TXENAB); +} + +static void +uart_mu_init(struct uart_bas *bas, int baudrate, int databits, int stopbits, + int parity) +{ + + /* Mask all interrupts */ + __uart_setreg(bas, AUX_MU_IER_REG, 0); + uart_mu_param(bas, baudrate, databits, stopbits, parity); +} + +static void +uart_mu_term(struct uart_bas *bas) +{ +} + +static void +uart_mu_putc(struct uart_bas *bas, int c) +{ + + /* Wait when TX FIFO full. Push character otherwise. */ + while ((__uart_getreg(bas, AUX_MU_LSR_REG) & LSR_TXEMPTY) == 0) + ; + __uart_setreg(bas, AUX_MU_IO_REG, c & 0xff); +} + +static int +uart_mu_rxready(struct uart_bas *bas) +{ + + return ((__uart_getreg(bas, AUX_MU_LSR_REG) & LSR_RXREADY) != 0); +} + +static int +uart_mu_getc(struct uart_bas *bas, struct mtx *hwmtx) +{ + int c; + + while(!uart_mu_rxready(bas)) + ; + c = __uart_getreg(bas, AUX_MU_IO_REG) & 0xff; + return (c); +} + +/* + * High-level UART interface. + */ +struct uart_mu_softc { + struct uart_softc bas; + uint16_t aux_ier; /* Interrupt mask */ +}; + +static int uart_mu_bus_attach(struct uart_softc *); +static int uart_mu_bus_detach(struct uart_softc *); +static int uart_mu_bus_flush(struct uart_softc *, int); +static int uart_mu_bus_getsig(struct uart_softc *); +static int uart_mu_bus_ioctl(struct uart_softc *, int, intptr_t); +static int uart_mu_bus_ipend(struct uart_softc *); +static int uart_mu_bus_param(struct uart_softc *, int, int, int, int); +static int uart_mu_bus_probe(struct uart_softc *); +static int uart_mu_bus_receive(struct uart_softc *); +static int uart_mu_bus_setsig(struct uart_softc *, int); +static int uart_mu_bus_transmit(struct uart_softc *); +static void uart_mu_bus_grab(struct uart_softc *); +static void uart_mu_bus_ungrab(struct uart_softc *); + +static kobj_method_t uart_mu_methods[] = { + KOBJMETHOD(uart_attach, uart_mu_bus_attach), + KOBJMETHOD(uart_detach, uart_mu_bus_detach), + KOBJMETHOD(uart_flush, uart_mu_bus_flush), + KOBJMETHOD(uart_getsig, uart_mu_bus_getsig), + KOBJMETHOD(uart_ioctl, uart_mu_bus_ioctl), + KOBJMETHOD(uart_ipend, uart_mu_bus_ipend), + KOBJMETHOD(uart_param, uart_mu_bus_param), + KOBJMETHOD(uart_probe, uart_mu_bus_probe), + KOBJMETHOD(uart_receive, uart_mu_bus_receive), + KOBJMETHOD(uart_setsig, uart_mu_bus_setsig), + KOBJMETHOD(uart_transmit, uart_mu_bus_transmit), + KOBJMETHOD(uart_grab, uart_mu_bus_grab), + KOBJMETHOD(uart_ungrab, uart_mu_bus_ungrab), + + { 0, 0 } +}; + +static struct uart_class uart_mu_class = { + "aux-uart", + uart_mu_methods, + sizeof(struct uart_mu_softc), + .uc_ops = &uart_mu_ops, + .uc_range = 0x48, + .uc_rclk = 0, + .uc_rshift = 2 +}; + +#ifdef FDT +static struct ofw_compat_data fdt_compat_data[] = { + {"brcm,bcm2835-aux-uart" , (uintptr_t)&uart_mu_class}, + {NULL, (uintptr_t)NULL}, +}; +UART_FDT_CLASS_AND_DEVICE(fdt_compat_data); +#endif + +static int +uart_mu_bus_attach(struct uart_softc *sc) +{ + struct uart_mu_softc *psc; + struct uart_bas *bas; + + psc = (struct uart_mu_softc *)sc; + bas = &sc->sc_bas; + /* Clear interrupts */ + __uart_setreg(bas, AUX_MU_IIR_REG, IIR_CLEAR); + /* Enable interrupts */ + psc->aux_ier = (IER_RXENABLE|IER_TXENABLE|IER_REQUIRED); + __uart_setreg(bas, AUX_MU_IER_REG, psc->aux_ier); + sc->sc_txbusy = 0; + + return (0); +} + +static int +uart_mu_bus_detach(struct uart_softc *sc) +{ + + return (0); +} + +static int +uart_mu_bus_flush(struct uart_softc *sc, int what) +{ + + return (0); +} + +static int +uart_mu_bus_getsig(struct uart_softc *sc) +{ + + return (0); +} + +static int +uart_mu_bus_ioctl(struct uart_softc *sc, int request, intptr_t data) +{ + struct uart_bas *bas; + int error; + + bas = &sc->sc_bas; + error = 0; + uart_lock(sc->sc_hwmtx); + switch (request) { + case UART_IOCTL_BREAK: + break; + case UART_IOCTL_BAUD: + *(int*)data = 115200; + break; + default: + error = EINVAL; + break; + } + uart_unlock(sc->sc_hwmtx); + + return (error); +} + +static int +uart_mu_bus_ipend(struct uart_softc *sc) +{ + struct uart_mu_softc *psc; + struct uart_bas *bas; + uint32_t ints; + int ipend; + + psc = (struct uart_mu_softc *)sc; + bas = &sc->sc_bas; + + uart_lock(sc->sc_hwmtx); + ints = __uart_getreg(bas, AUX_MU_IIR_REG); + ipend = 0; + + /* + * According to docs only one of IIR_RXREADY + * or IIR_TXREADY are valid eg. Only one or the other. + */ + if (ints & IIR_RXREADY) { + ipend |= SER_INT_RXREADY; + } else if (ints & IIR_TXREADY) { + if (__uart_getreg(bas, AUX_MU_LSR_REG) & LSR_TXIDLE) { + if (sc->sc_txbusy) + ipend |= SER_INT_TXIDLE; + + /* Disable TX interrupt */ + __uart_setreg(bas, AUX_MU_IER_REG, + psc->aux_ier & ~IER_TXENABLE); + } + } + + uart_unlock(sc->sc_hwmtx); + + return (ipend); +} + +static int +uart_mu_bus_param(struct uart_softc *sc, int baudrate, int databits, + int stopbits, int parity) +{ + + uart_lock(sc->sc_hwmtx); + uart_mu_param(&sc->sc_bas, baudrate, databits, stopbits, parity); + uart_unlock(sc->sc_hwmtx); + + return (0); +} + +static int +uart_mu_bus_probe(struct uart_softc *sc) +{ + + /* MU always has 8 byte deep fifo */ + sc->sc_rxfifosz = 8; + sc->sc_txfifosz = 8; + device_set_desc(sc->sc_dev, "BCM2835 Mini-UART"); + + return (0); +} + +static int +uart_mu_bus_receive(struct uart_softc *sc) +{ + struct uart_mu_softc *psc; + struct uart_bas *bas; + uint32_t lsr, xc; + int rx; + + bas = &sc->sc_bas; + uart_lock(sc->sc_hwmtx); + psc = (struct uart_mu_softc *)sc; + + lsr = __uart_getreg(bas, AUX_MU_LSR_REG); + while (lsr & LSR_RXREADY) { + xc = __uart_getreg(bas, AUX_MU_IO_REG); + rx = xc & 0xff; + if (uart_rx_full(sc)) { + sc->sc_rxbuf[sc->sc_rxput] = UART_STAT_OVERRUN; + break; + } + uart_rx_put(sc, rx); + lsr = __uart_getreg(bas, AUX_MU_LSR_REG); + } + uart_unlock(sc->sc_hwmtx); + + return (0); +} + +static int +uart_mu_bus_setsig(struct uart_softc *sc, int sig) +{ + + return (0); +} + +static int +uart_mu_bus_transmit(struct uart_softc *sc) +{ + struct uart_mu_softc *psc; + struct uart_bas *bas; + int i; + + psc = (struct uart_mu_softc *)sc; + bas = &sc->sc_bas; + uart_lock(sc->sc_hwmtx); + + for (i = 0; i < sc->sc_txdatasz; i++) { + __uart_setreg(bas, AUX_MU_IO_REG, sc->sc_txbuf[i] & 0xff); + uart_barrier(bas); + } + + /* Mark busy and enable TX interrupt */ + sc->sc_txbusy = 1; + __uart_setreg(bas, AUX_MU_IER_REG, psc->aux_ier); + + uart_unlock(sc->sc_hwmtx); + + return (0); +} + +static void +uart_mu_bus_grab(struct uart_softc *sc) +{ + struct uart_mu_softc *psc; + struct uart_bas *bas; + + psc = (struct uart_mu_softc *)sc; + bas = &sc->sc_bas; + + /* Disable interrupts on switch to polling */ + uart_lock(sc->sc_hwmtx); + __uart_setreg(bas, AUX_MU_IER_REG, psc->aux_ier &~IER_MASK_ALL); + uart_unlock(sc->sc_hwmtx); +} + +static void +uart_mu_bus_ungrab(struct uart_softc *sc) +{ + struct uart_mu_softc *psc; + struct uart_bas *bas; + + psc = (struct uart_mu_softc *)sc; + bas = &sc->sc_bas; + + /* Switch to using interrupts while not grabbed */ + uart_lock(sc->sc_hwmtx); + __uart_setreg(bas, AUX_MU_CNTL_REG, CNTL_RXENAB|CNTL_TXENAB); + __uart_setreg(bas, AUX_MU_IER_REG, psc->aux_ier); + uart_unlock(sc->sc_hwmtx); +} Modified: head/sys/modules/uart/Makefile ============================================================================== --- head/sys/modules/uart/Makefile Tue Jun 12 11:47:21 2018 (r334996) +++ head/sys/modules/uart/Makefile Tue Jun 12 13:26:31 2018 (r334997) @@ -23,14 +23,15 @@ uart_cpu_machine= ${_uart_cpu} .if ${MACHINE} == "arm64" uart_dev_mvebu=uart_dev_mvebu.c +uart_dev_mu=uart_dev_mu.c .endif KMOD= uart SRCS= uart_bus_acpi.c ${uart_bus_ebus} uart_bus_isa.c uart_bus_pccard.c \ uart_bus_pci.c uart_bus_puc.c uart_bus_scc.c \ uart_core.c ${uart_cpu_machine} uart_dbg.c \ - ${uart_dev_mvebu} uart_dev_ns8250.c uart_dev_quicc.c \ - uart_dev_sab82532.c uart_dev_z8530.c \ + ${uart_dev_mvebu} uart_dev_ns8250.c ${uart_dev_mu} \ + uart_dev_quicc.c uart_dev_sab82532.c uart_dev_z8530.c \ uart_if.c uart_if.h uart_subr.c uart_tty.c SRCS+= acpi_if.h bus_if.h card_if.h device_if.h isa_if.h ${ofw_bus_if} \ From owner-svn-src-head@freebsd.org Tue Jun 12 13:32:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EC6E10127FE; Tue, 12 Jun 2018 13:32:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F77283A3D; Tue, 12 Jun 2018 13:32:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F2203195; Tue, 12 Jun 2018 13:32:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5CDWgHh000299; Tue, 12 Jun 2018 13:32:42 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5CDWgo9000298; Tue, 12 Jun 2018 13:32:42 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806121332.w5CDWgo9000298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 12 Jun 2018 13:32:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334998 - head/sys/modules/linux64 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/modules/linux64 X-SVN-Commit-Revision: 334998 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 13:32:43 -0000 Author: emaste Date: Tue Jun 12 13:32:42 2018 New Revision: 334998 URL: https://svnweb.freebsd.org/changeset/base/334998 Log: linux64: use linux output target for linux_vdso.so linux_vdso.so provides the vdso for the linuxulator's amd64 target and is mapped into a Linux binary's address space. Thus it should be a Linux-style .so, which has the ELF OS/ABI unset. It turns out that ELF Tool Chain elfcopy/objcopy also has a bug where the OS/ABI field is unset, regardless of the specified --output-target, so this change is a no-op with the default in-tree toolchain. This is a real fix when using external binutils, and the ELF Tool Chain bug will be fixed in the future. PR: 228934 Sponsored by: Turing Robotic Industries Modified: head/sys/modules/linux64/Makefile Modified: head/sys/modules/linux64/Makefile ============================================================================== --- head/sys/modules/linux64/Makefile Tue Jun 12 13:26:31 2018 (r334997) +++ head/sys/modules/linux64/Makefile Tue Jun 12 13:32:42 2018 (r334998) @@ -36,7 +36,7 @@ linux_locore.o: linux_locore.s linux_assym.h ${.IMPSRC} -o ${.TARGET} ${VDSO}.so: linux_locore.o - ${OBJCOPY} --input-target binary --output-target elf64-x86-64-freebsd \ + ${OBJCOPY} --input-target binary --output-target elf64-x86-64 \ -S -g --binary-architecture i386:x86-64 linux_locore.o ${.TARGET} strip -N _binary_linux_locore_o_size ${.TARGET} From owner-svn-src-head@freebsd.org Tue Jun 12 14:10:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76A4710167BC for ; Tue, 12 Jun 2018 14:10:20 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x232.google.com (mail-it0-x232.google.com [IPv6:2607:f8b0:4001:c0b::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A1C285A6C for ; Tue, 12 Jun 2018 14:10:19 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x232.google.com with SMTP id n7-v6so14719971itn.1 for ; Tue, 12 Jun 2018 07:10:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Ms4lBNgit2yCKSfPj3Mt33v9kn81wRaeDrNgvoFxOYQ=; b=N7KcfWHQ8jJsET+ftAzS/6xe4+7WpS3PaKXVgm8BKwaNAwtYgB+h0DP/qSjeX79xx4 2IGntmPYyGv5HHVgn7UN5yER/C/w/5en45TT+13l0ZcG7Ld96ipmmE02XZiZu6kbnwIv rwSqP3RxjA6YT3JVZ3gU2Nb2S8SbhnEYY9AMSwju983KiQQKCyHHbabGAscoDDEEZPOY AVrruLK4RMFm52ebv62gL5HX2IBLYiJbsnQoazQNeMUAFz4lzhTlEjNr/grIWlzNiWGz pvxqxy8aR07aCt0an52R5BeHgwTuJAsaSI6cEqiO/lgy9Nwo2HrOW+SNaxk2wIR7/7Be 2GSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Ms4lBNgit2yCKSfPj3Mt33v9kn81wRaeDrNgvoFxOYQ=; b=qimlVFf4K0DHEqbuEwXZvY0aiJ9I/9f35Dt8Xf/KEV7e1qjqw+KNegtGwP00+Tt6Qd +uuPlmBuyVsinLYeaQa7cYrTWzZ3iVz3Bzuq74UPERWFvGIr+F0EiVL4ztOsJ2taEIF+ q/pGoLJE5qMbs/WcWhXnksODPL5omIByD8ZzZrqs7+2UbeghHLypWaciX8gwbf7ZRGC3 UKwcnJY7wEFgRd4TE6JkiwhPNiTnT9B3dawvBITY1Wdoh6RvFSNn6yngg2iIfr7kr8kP O+80j4PUjEbhP3vQCsNtUZPXKtOQndBXsCP/BpKroqJfNNKsve2NzSFMDrg079w4cXtB EsHg== X-Gm-Message-State: APt69E2K23NHxwitKJS5pQxf/gMMi1QdA6hLL6I+bhMpPxl3qCQG6yYu 38I4qrWymGdojQkPpGk/s5juy3Riv/D9y/OBE5b6Dw== X-Google-Smtp-Source: ADUXVKJteADLwXGaw+CqiJzEMqR8wbl8t52ls6uv1ADiaZi8fo4Tid4M+ikTeuoyuXGErvnkVOwJGSBHJoHaw3m1qFI= X-Received: by 2002:a24:7c8d:: with SMTP id a135-v6mr566593itd.73.1528812619175; Tue, 12 Jun 2018 07:10:19 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:d028:0:0:0:0:0 with HTTP; Tue, 12 Jun 2018 07:10:18 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: References: <201806110132.w5B1WI5d094546@repo.freebsd.org> <344AA709-2DF7-405C-AB4D-4F0978834EA1@FreeBSD.org> From: Warner Losh Date: Tue, 12 Jun 2018 08:10:18 -0600 X-Google-Sender-Auth: TNnHm2szG9WPODlYmhbqYHGvjdw Message-ID: Subject: Re: svn commit: r334939 - head/stand/lua To: Devin Teske Cc: Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 14:10:20 -0000 On Mon, Jun 11, 2018 at 6:23 PM, Devin Teske wrote: > > On Jun 11, 2018, at 11:20 AM, Warner Losh wrote: > > > > On Mon, Jun 11, 2018 at 11:54 AM, Devin Teske wrote: > >> >> On Jun 11, 2018, at 7:07 AM, Warner Losh wrote: >> >> >> >> On Mon, Jun 11, 2018 at 7:36 AM, Devin Teske wrote: >> >>> >>> >> At BSD Can there was the boot working group where we discussed that an >> FCP would be required to decide this. >> > > In the working group you weren't listening and being rather combative and > demanding that I do stuff, > > > I think that's an unfair characterization of the situation, but it doesn't > matter -- that's your opinion and you are entitled to it. > I would like to unconditionally apologize for my harsh words to Devin here. I let my frustration get the better of me, which I should not have done. Devin has been quite helpful for a long time with the boot loader and things related to FORTH, and I should not have lashed out like this. I hope she can forgive my ill-chosen words. > so I stopped talking. > > > Hopefully we can _start_ talking. As the principled author of this work, I > want to have a say in its deprecation since I still maintain that body of > work. > Yes. Work is underway to get a draft of a FCP together to start a discussion in arch to come to a data-driven decision. There's no desire to exclude you from this process. Warner From owner-svn-src-head@freebsd.org Tue Jun 12 14:35:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39A4B10195B1; Tue, 12 Jun 2018 14:35:04 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D079787275; Tue, 12 Jun 2018 14:35:03 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [64.201.244.132] (port=49978 helo=[10.0.0.112]) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1fSbPF-000Inn-Lc; Tue, 12 Jun 2018 04:59:45 +0000 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r334939 - head/stand/lua From: Devin Teske X-Mailer: iPhone Mail (15D60) In-Reply-To: Date: Tue, 12 Jun 2018 07:34:56 -0700 Cc: Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, dteske@FreeBSD.org Message-Id: <5F2C1321-ABD5-4065-8C3C-261CC575767C@freebsd.org> References: <201806110132.w5B1WI5d094546@repo.freebsd.org> <344AA709-2DF7-405C-AB4D-4F0978834EA1@FreeBSD.org> To: Warner Losh Sender: devin@shxd.cx Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 14:35:04 -0000 > On Jun 12, 2018, at 7:10 AM, Warner Losh wrote: >=20 >=20 >=20 >> On Mon, Jun 11, 2018 at 6:23 PM, Devin Teske wrote: >>=20 >>> On Jun 11, 2018, at 11:20 AM, Warner Losh wrote: >>>=20 >>>=20 >>>=20 >>> On Mon, Jun 11, 2018 at 11:54 AM, Devin Teske wrote= : >>>>=20 >>>>> On Jun 11, 2018, at 7:07 AM, Warner Losh wrote: >>>>>=20 >>>>>=20 >>>>>=20 >>>>> On Mon, Jun 11, 2018 at 7:36 AM, Devin Teske wrot= e: >>>>>>=20 >>>>=20 >>>> At BSD Can there was the boot working group where we discussed that an = FCP would be required to decide this. >>>=20 >>> In the working group you weren't listening and being rather combative an= d demanding that I do stuff, >>=20 >> I think that's an unfair characterization of the situation, but it doesn'= t matter -- that's your opinion and you are entitled to it. >=20 > I would like to unconditionally apologize for my harsh words to Devin here= . I let my frustration get the better of me, which I should not have done. D= evin has been quite helpful for a long time with the boot loader and things r= elated to FORTH, and I should not have lashed out like this. I hope she can f= orgive my ill-chosen words. Thanks Warner. Forgiven if you can forgive any harshness from me at BSDCan. I also have to apologize for my performance in the working group. It could h= ave been better and I kind of monopolized the conversation. Apologies. >>> so I stopped talking. >>=20 >> Hopefully we can _start_ talking. As the principled author of this work, I= want to have a say in its deprecation since I still maintain that body of w= ork. >=20 > Yes. Work is underway to get a draft of a FCP together to start a discussi= on in arch to come to a data-driven decision. There's no desire to exclude y= ou from this process. >=20 Excellent. Looking forward to helping strike a good balance for the path for= ward for a smooth transition between boot languages. Devin= From owner-svn-src-head@freebsd.org Tue Jun 12 14:54:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0740101B649; Tue, 12 Jun 2018 14:54:17 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A262C6819A; Tue, 12 Jun 2018 14:54:17 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 84D8842F3; Tue, 12 Jun 2018 14:54:17 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5CEsHbE043014; Tue, 12 Jun 2018 14:54:17 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5CEsHbJ043013; Tue, 12 Jun 2018 14:54:17 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201806121454.w5CEsHbJ043013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 12 Jun 2018 14:54:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334999 - head/sys/dev/psci X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/dev/psci X-SVN-Commit-Revision: 334999 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 14:54:18 -0000 Author: andrew Date: Tue Jun 12 14:54:17 2018 New Revision: 334999 URL: https://svnweb.freebsd.org/changeset/base/334999 Log: Rework PSCI so it only searches for the call function once. This is in preperation for supporting newer smccc functions that also use the same call method. Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D15745 Modified: head/sys/dev/psci/psci.c Modified: head/sys/dev/psci/psci.c ============================================================================== --- head/sys/dev/psci/psci.c Tue Jun 12 13:32:42 2018 (r334998) +++ head/sys/dev/psci/psci.c Tue Jun 12 14:54:17 2018 (r334999) @@ -74,7 +74,6 @@ __FBSDID("$FreeBSD$"); struct psci_softc { device_t dev; - psci_callfn_t psci_call; uint32_t psci_fnids[PSCI_FN_MAX]; }; @@ -107,6 +106,41 @@ static struct ofw_compat_data compat_data[] = { static int psci_attach(device_t, psci_initfn_t); static void psci_shutdown(void *, int); +static int psci_find_callfn(psci_callfn_t *); +static int psci_def_callfn(register_t, register_t, register_t, register_t); + +static psci_callfn_t psci_callfn = psci_def_callfn; + +static inline int +psci_call(register_t a, register_t b, register_t c, register_t d) +{ + + return (psci_callfn(a, b, c, d)); +} + +static void +psci_init(void *dummy) +{ + psci_callfn_t new_callfn; + + if (psci_find_callfn(&new_callfn) != PSCI_RETVAL_SUCCESS) { + printf("No PSCI/SMCCC call function found"); + return; + } + + psci_callfn = new_callfn; +} +/* This needs to be before cpu_mp at SI_SUB_CPU, SI_ORDER_THIRD */ +SYSINIT(psci_start, SI_SUB_CPU, SI_ORDER_FIRST, psci_init, NULL); + +static int +psci_def_callfn(register_t a __unused, register_t b __unused, + register_t c __unused, register_t d __unused) +{ + + panic("No PSCI/SMCCC call function set"); +} + #ifdef FDT static int psci_fdt_probe(device_t dev); static int psci_fdt_attach(device_t dev); @@ -169,17 +203,12 @@ psci_fdt_probe(device_t dev) static int psci_fdt_attach(device_t dev) { - struct psci_softc *sc = device_get_softc(dev); const struct ofw_compat_data *ocd; psci_initfn_t psci_init; - phandle_t node; ocd = ofw_bus_search_compatible(dev, compat_data); psci_init = (psci_initfn_t)ocd->ocd_data; - node = ofw_bus_get_node(dev); - sc->psci_call = psci_fdt_get_callfn(node); - return (psci_attach(dev, psci_init)); } #endif @@ -280,15 +309,7 @@ psci_acpi_probe(device_t dev) static int psci_acpi_attach(device_t dev) { - struct psci_softc *sc = device_get_softc(dev); - uintptr_t flags; - flags = (uintptr_t)acpi_get_private(dev); - if ((flags & ACPI_FADT_PSCI_USE_HVC) != 0) - sc->psci_call = psci_hvc_despatch; - else - sc->psci_call = psci_smc_despatch; - return (psci_attach(dev, psci_v0_2_init)); } #endif @@ -301,9 +322,6 @@ psci_attach(device_t dev, psci_initfn_t psci_init) if (psci_softc != NULL) return (ENXIO); - if (sc->psci_call == NULL) - return (ENXIO); - KASSERT(psci_init != NULL, ("PSCI init function cannot be NULL")); if (psci_init(dev)) return (ENXIO); @@ -321,7 +339,7 @@ _psci_get_version(struct psci_softc *sc) /* PSCI version wasn't supported in v0.1. */ fnid = sc->psci_fnids[PSCI_FN_VERSION]; if (fnid) - return (sc->psci_call(fnid, 0, 0, 0)); + return (psci_call(fnid, 0, 0, 0)); return (PSCI_RETVAL_NOT_SUPPORTED); } @@ -368,40 +386,44 @@ psci_acpi_callfn(psci_callfn_t *callfn) } #endif -int -psci_cpu_on(unsigned long cpu, unsigned long entry, unsigned long context_id) +static int +psci_find_callfn(psci_callfn_t *callfn) { - psci_callfn_t callfn; - uint32_t fnid; int error; - if (psci_softc == NULL) { - fnid = PSCI_FNID_CPU_ON; - callfn = NULL; + *callfn = NULL; #ifdef FDT - if (USE_FDT) { - error = psci_fdt_callfn(&callfn); - if (error != 0) - return (error); - } + if (USE_FDT) { + error = psci_fdt_callfn(callfn); + if (error != 0) + return (error); + } #endif #ifdef DEV_ACPI - if (callfn == NULL && USE_ACPI) { - error = psci_acpi_callfn(&callfn); - if (error != 0) - return (error); - } + if (*callfn == NULL && USE_ACPI) { + error = psci_acpi_callfn(callfn); + if (error != 0) + return (error); + } #endif - if (callfn == NULL) - return (PSCI_MISSING); - } else { - callfn = psci_softc->psci_call; + if (*callfn == NULL) + return (PSCI_MISSING); + + return (PSCI_RETVAL_SUCCESS); +} + +int +psci_cpu_on(unsigned long cpu, unsigned long entry, unsigned long context_id) +{ + uint32_t fnid; + + fnid = PSCI_FNID_CPU_ON; + if (psci_softc != NULL) fnid = psci_softc->psci_fnids[PSCI_FN_CPU_ON]; - } /* PSCI v0.1 and v0.2 both support cpu_on. */ - return (callfn(fnid, cpu, entry, context_id)); + return (psci_call(fnid, cpu, entry, context_id)); } static void @@ -419,7 +441,7 @@ psci_shutdown(void *xsc, int howto) fn = psci_softc->psci_fnids[PSCI_FN_SYSTEM_RESET]; if (fn) - psci_softc->psci_call(fn, 0, 0, 0); + psci_call(fn, 0, 0, 0); /* System reset and off do not return. */ } From owner-svn-src-head@freebsd.org Tue Jun 12 16:19:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A908B10025FA; Tue, 12 Jun 2018 16:19:28 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4AAF06BE82; Tue, 12 Jun 2018 16:19:28 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 26CCD4FE9; Tue, 12 Jun 2018 16:19:28 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5CGJRVm083862; Tue, 12 Jun 2018 16:19:27 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5CGJRna083861; Tue, 12 Jun 2018 16:19:27 GMT (envelope-from br@FreeBSD.org) Message-Id: <201806121619.w5CGJRna083861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 12 Jun 2018 16:19:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335000 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 335000 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 16:19:28 -0000 Author: br Date: Tue Jun 12 16:19:27 2018 New Revision: 335000 URL: https://svnweb.freebsd.org/changeset/base/335000 Log: Align virtual addressing entries. This is required due to C-compressed ISA extension option being turned on. This fixes SMP operation in QEMU. Sponsored by: DARPA, AFRL Modified: head/sys/riscv/riscv/locore.S Modified: head/sys/riscv/riscv/locore.S ============================================================================== --- head/sys/riscv/riscv/locore.S Tue Jun 12 14:54:17 2018 (r334999) +++ head/sys/riscv/riscv/locore.S Tue Jun 12 16:19:27 2018 (r335000) @@ -156,6 +156,8 @@ _start: or s2, s2, t0 sfence.vma csrw sptbr, s2 + + .align 2 va: /* Setup supervisor trap vector */ @@ -284,6 +286,8 @@ ENTRY(mpentry) or s2, s2, t0 sfence.vma csrw sptbr, s2 + + .align 2 mpva: /* Setup supervisor trap vector */ la t0, cpu_exception_handler From owner-svn-src-head@freebsd.org Tue Jun 12 16:40:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C46B1004AC9; Tue, 12 Jun 2018 16:40:23 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BE2D66D01C; Tue, 12 Jun 2018 16:40:22 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A09F1532C; Tue, 12 Jun 2018 16:40:22 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5CGeMXg094511; Tue, 12 Jun 2018 16:40:22 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5CGeMmH094510; Tue, 12 Jun 2018 16:40:22 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201806121640.w5CGeMmH094510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 12 Jun 2018 16:40:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335001 - head/usr.bin/diff X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/usr.bin/diff X-SVN-Commit-Revision: 335001 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 16:40:23 -0000 Author: bapt Date: Tue Jun 12 16:40:22 2018 New Revision: 335001 URL: https://svnweb.freebsd.org/changeset/base/335001 Log: Correctly test return value of pipe(2) CID: 1393351 Modified: head/usr.bin/diff/pr.c Modified: head/usr.bin/diff/pr.c ============================================================================== --- head/usr.bin/diff/pr.c Tue Jun 12 16:19:27 2018 (r335000) +++ head/usr.bin/diff/pr.c Tue Jun 12 16:40:22 2018 (r335001) @@ -58,7 +58,8 @@ start_pr(char *file1, char *file2) signal(SIGPIPE, SIG_IGN); fflush(stdout); rewind(stdout); - pipe(pfd); + if (pipe(pfd) == -1) + err(2, "pipe"); switch ((pid = pdfork(&pr_pd, PD_CLOEXEC))) { case -1: status |= 2; From owner-svn-src-head@freebsd.org Tue Jun 12 16:42:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A5B9100519B; Tue, 12 Jun 2018 16:42:12 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E449D6D650; Tue, 12 Jun 2018 16:42:11 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C59D654A4; Tue, 12 Jun 2018 16:42:11 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5CGgBus099107; Tue, 12 Jun 2018 16:42:11 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5CGgBVc099106; Tue, 12 Jun 2018 16:42:11 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201806121642.w5CGgBVc099106@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 12 Jun 2018 16:42:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335002 - head/usr.bin/diff X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/usr.bin/diff X-SVN-Commit-Revision: 335002 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 16:42:12 -0000 Author: bapt Date: Tue Jun 12 16:42:11 2018 New Revision: 335002 URL: https://svnweb.freebsd.org/changeset/base/335002 Log: Fix memory leak CID: 1393352 Modified: head/usr.bin/diff/pr.c Modified: head/usr.bin/diff/pr.c ============================================================================== --- head/usr.bin/diff/pr.c Tue Jun 12 16:40:22 2018 (r335001) +++ head/usr.bin/diff/pr.c Tue Jun 12 16:42:11 2018 (r335002) @@ -117,6 +117,7 @@ stop_pr(struct pr *pr) err(2, "kevent"); wstatus = pr->e[0].data; close(pr->kq); + free(pr); if (WIFEXITED(wstatus) && WEXITSTATUS(wstatus) != 0) errx(2, "pr exited abnormally"); else if (WIFSIGNALED(wstatus)) From owner-svn-src-head@freebsd.org Tue Jun 12 16:44:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2148510056B9; Tue, 12 Jun 2018 16:44:14 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AEB0F6D99D; Tue, 12 Jun 2018 16:44:13 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8FED854BE; Tue, 12 Jun 2018 16:44:13 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5CGiDjN099250; Tue, 12 Jun 2018 16:44:13 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5CGiD1m099249; Tue, 12 Jun 2018 16:44:13 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201806121644.w5CGiD1m099249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 12 Jun 2018 16:44:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335003 - head/bin/chflags X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/bin/chflags X-SVN-Commit-Revision: 335003 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 16:44:14 -0000 Author: trasz Date: Tue Jun 12 16:44:13 2018 New Revision: 335003 URL: https://svnweb.freebsd.org/changeset/base/335003 Log: Add an example to the chflags(1) man page. MFC after: 2 weeks Modified: head/bin/chflags/chflags.1 Modified: head/bin/chflags/chflags.1 ============================================================================== --- head/bin/chflags/chflags.1 Tue Jun 12 16:42:11 2018 (r335002) +++ head/bin/chflags/chflags.1 Tue Jun 12 16:44:13 2018 (r335003) @@ -32,7 +32,7 @@ .\" @(#)chflags.1 8.4 (Berkeley) 5/2/95 .\" $FreeBSD$ .\" -.Dd March 6, 2018 +.Dd June 12, 2018 .Dt CHFLAGS 1 .Os .Sh NAME @@ -229,6 +229,11 @@ argument for then the current filename as well as the old and new flags are displayed. .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +Recursively clear all flags on files and directories contained within the +.Fa foobar +directory hierarchy: +.Dl Nm Fl R Ar 0 Ar foobar .Sh SEE ALSO .Xr ls 1 , .Xr chflags 2 , From owner-svn-src-head@freebsd.org Tue Jun 12 16:45:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C248B1005A0E; Tue, 12 Jun 2018 16:45:53 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 67D056DBD0; Tue, 12 Jun 2018 16:45:53 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45B0154BF; Tue, 12 Jun 2018 16:45:53 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5CGjru7099366; Tue, 12 Jun 2018 16:45:53 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5CGjrMM099365; Tue, 12 Jun 2018 16:45:53 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201806121645.w5CGjrMM099365@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 12 Jun 2018 16:45:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335004 - head/release/tools X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/release/tools X-SVN-Commit-Revision: 335004 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 16:45:54 -0000 Author: trasz Date: Tue Jun 12 16:45:52 2018 New Revision: 335004 URL: https://svnweb.freebsd.org/changeset/base/335004 Log: Enable USB OTG serial terminal on ARM SD card images. This configures the system to make use of USB device mode / USB OTG to provide a "virtual serial port" on release images. Reviewed by: gjb@ MFC after: 2 weeks Relnotes: yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D15602 Modified: head/release/tools/arm.subr Modified: head/release/tools/arm.subr ============================================================================== --- head/release/tools/arm.subr Tue Jun 12 16:44:13 2018 (r335003) +++ head/release/tools/arm.subr Tue Jun 12 16:45:52 2018 (r335004) @@ -92,6 +92,41 @@ arm_create_user() { return 0 } +arm_setup_usb_otg() { + # Set up virtual serial port over USB OTG / device mode. + echo >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf + echo '# Required for USB OTG virtual serial port.' \ + >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf + echo 'notify 100 {' \ + >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf + echo ' match "system" "DEVFS";' \ + >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf + echo ' match "subsystem" "CDEV";' \ + >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf + echo ' match "type" "CREATE";' \ + >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf + echo ' match "cdev" "ttyU[0-9]+";' \ + >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf + echo ' action "/sbin/init q";' \ + >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf + echo '};' \ + >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf + + echo '# USB OTG virtual serial port' \ + >> ${CHROOTDIR}/${DESTDIR}/etc/ttys + echo 'ttyU0 "/usr/libexec/getty 3wire" vt100 onifconsole secure' \ + >> ${CHROOTDIR}/${DESTDIR}/etc/ttys + echo 'ttyU1 "/usr/libexec/getty 3wire" vt100 onifconsole secure' \ + >> ${CHROOTDIR}/${DESTDIR}/etc/ttys + + echo '# Configure USB OTG; see usb_template(4).' \ + >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf + echo 'hw.usb.template=3' \ + >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf + echo 'umodem_load="YES"' \ + >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf +} + arm_install_base() { chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${DESTDIR} eval chroot ${CHROOTDIR} make -C ${WORLDDIR} \ @@ -102,6 +137,7 @@ arm_install_base() { chroot ${CHROOTDIR} mkdir -p ${DESTDIR}/boot/msdos arm_create_user + arm_setup_usb_otg echo '# Custom /etc/fstab for FreeBSD embedded images' \ > ${CHROOTDIR}/${DESTDIR}/etc/fstab From owner-svn-src-head@freebsd.org Tue Jun 12 16:47:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CF111005E47; Tue, 12 Jun 2018 16:47:34 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 392B26DE45; Tue, 12 Jun 2018 16:47:34 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1AB7C54C6; Tue, 12 Jun 2018 16:47:34 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5CGlXPB099476; Tue, 12 Jun 2018 16:47:33 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5CGlX9j099475; Tue, 12 Jun 2018 16:47:33 GMT (envelope-from br@FreeBSD.org) Message-Id: <201806121647.w5CGlX9j099475@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 12 Jun 2018 16:47:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335005 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 335005 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 16:47:34 -0000 Author: br Date: Tue Jun 12 16:47:33 2018 New Revision: 335005 URL: https://svnweb.freebsd.org/changeset/base/335005 Log: Release secondary cores from WFI (wait for interrupt) by sending them an IPI. This does not work however yet in QEMU. As a temporary workaround set software interrupt pending bit manually on a local core to ensure WFI doesn't halt the hart. This is required to smpboot in QEMU. Sponsored by: DARPA, AFRL Modified: head/sys/riscv/riscv/mp_machdep.c Modified: head/sys/riscv/riscv/mp_machdep.c ============================================================================== --- head/sys/riscv/riscv/mp_machdep.c Tue Jun 12 16:45:52 2018 (r335004) +++ head/sys/riscv/riscv/mp_machdep.c Tue Jun 12 16:47:33 2018 (r335005) @@ -181,6 +181,7 @@ riscv64_cpu_attach(device_t dev) static void release_aps(void *dummy __unused) { + uintptr_t mask; int cpu, i; if (mp_ncpus == 1) @@ -191,6 +192,14 @@ release_aps(void *dummy __unused) atomic_store_rel_int(&aps_ready, 1); + /* Wake up the other CPUs */ + mask = 0; + + for (i = 1; i < mp_ncpus; i++) + mask |= (1 << i); + + sbi_send_ipi(&mask); + printf("Release APs\n"); for (i = 0; i < 2000; i++) { @@ -216,6 +225,11 @@ init_secondary(uint64_t cpu) /* Setup the pcpu pointer */ pcpup = &__pcpu[cpu]; __asm __volatile("mv gp, %0" :: "r"(pcpup)); + + /* Workaround: make sure wfi doesn't halt the hart */ + intr_disable(); + csr_set(sie, SIE_SSIE); + csr_set(sip, SIE_SSIE); /* Spin until the BSP releases the APs */ while (!aps_ready) From owner-svn-src-head@freebsd.org Tue Jun 12 17:07:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22BB110083F1; Tue, 12 Jun 2018 17:07:32 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C65746F12E; Tue, 12 Jun 2018 17:07:31 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A350857FE; Tue, 12 Jun 2018 17:07:31 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5CH7Vg8009838; Tue, 12 Jun 2018 17:07:31 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5CH7VnT009837; Tue, 12 Jun 2018 17:07:31 GMT (envelope-from br@FreeBSD.org) Message-Id: <201806121707.w5CH7VnT009837@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 12 Jun 2018 17:07:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335006 - in head/sys: conf riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: conf riscv/riscv X-SVN-Commit-Revision: 335006 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 17:07:32 -0000 Author: br Date: Tue Jun 12 17:07:30 2018 New Revision: 335006 URL: https://svnweb.freebsd.org/changeset/base/335006 Log: Add simplebus-like RISC-V SoC bus. This is required in order to probe and attach devices described under "riscv-virtio-soc" node of DTS. Sponsored by: DARPA, AFRL Added: head/sys/riscv/riscv/soc.c (contents, props changed) Modified: head/sys/conf/files.riscv Modified: head/sys/conf/files.riscv ============================================================================== --- head/sys/conf/files.riscv Tue Jun 12 16:47:33 2018 (r335005) +++ head/sys/conf/files.riscv Tue Jun 12 17:07:30 2018 (r335006) @@ -46,6 +46,7 @@ riscv/riscv/nexus.c standard riscv/riscv/ofw_machdep.c optional fdt riscv/riscv/pmap.c standard riscv/riscv/riscv_console.c optional rcons +riscv/riscv/soc.c standard riscv/riscv/stack_machdep.c optional ddb | stack riscv/riscv/support.S standard riscv/riscv/swtch.S standard Added: head/sys/riscv/riscv/soc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/riscv/riscv/soc.c Tue Jun 12 17:07:30 2018 (r335006) @@ -0,0 +1,111 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Ruslan Bukin + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include + +struct soc_softc { + device_t dev; +}; + +static int +soc_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "riscv-virtio-soc")) + return (ENXIO); + + device_set_desc(dev, "RISC-V SoC"); + + return (BUS_PROBE_DEFAULT); +} + +static int +soc_attach(device_t dev) +{ + struct soc_softc *sc; + phandle_t node; + + sc = device_get_softc(dev); + sc->dev = dev; + + node = ofw_bus_get_node(dev); + if (node == -1) + return (ENXIO); + + simplebus_init(dev, node); + + /* + * Allow devices to identify. + */ + bus_generic_probe(dev); + + /* + * Now walk the OFW tree and attach top-level devices. + */ + for (node = OF_child(node); node > 0; node = OF_peer(node)) + simplebus_add_device(dev, node, 0, NULL, -1, NULL); + + return (bus_generic_attach(dev)); +} + +static int +soc_detach(device_t dev) +{ + + return (0); +} + +static device_method_t soc_methods[] = { + DEVMETHOD(device_probe, soc_probe), + DEVMETHOD(device_attach, soc_attach), + DEVMETHOD(device_detach, soc_detach), + DEVMETHOD_END +}; + +DEFINE_CLASS_1(soc, soc_driver, soc_methods, sizeof(struct soc_softc), + simplebus_driver); +static devclass_t soc_devclass; +EARLY_DRIVER_MODULE(soc, simplebus, soc_driver, soc_devclass, 0, 0, + BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); +MODULE_VERSION(soc, 1); From owner-svn-src-head@freebsd.org Tue Jun 12 17:45:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8023A100BDE5; Tue, 12 Jun 2018 17:45:18 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2CF3B70D64; Tue, 12 Jun 2018 17:45:18 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E823E5E88; Tue, 12 Jun 2018 17:45:17 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5CHjHuh030128; Tue, 12 Jun 2018 17:45:17 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5CHjFR7030117; Tue, 12 Jun 2018 17:45:15 GMT (envelope-from br@FreeBSD.org) Message-Id: <201806121745.w5CHjFR7030117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 12 Jun 2018 17:45:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335007 - in head/sys: conf riscv/conf riscv/include riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: conf riscv/conf riscv/include riscv/riscv X-SVN-Commit-Revision: 335007 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 17:45:18 -0000 Author: br Date: Tue Jun 12 17:45:15 2018 New Revision: 335007 URL: https://svnweb.freebsd.org/changeset/base/335007 Log: o Add driver for PLIC (Platform-Level Interrupt Controller) device. o Convert interrupt machdep support to use INTRNG code. Sponsored by: DARPA, AFRL Added: head/sys/riscv/riscv/plic.c (contents, props changed) Modified: head/sys/conf/files.riscv head/sys/conf/options.riscv head/sys/riscv/conf/GENERIC head/sys/riscv/include/intr.h head/sys/riscv/include/riscvreg.h head/sys/riscv/include/smp.h head/sys/riscv/riscv/intr_machdep.c head/sys/riscv/riscv/machdep.c head/sys/riscv/riscv/mp_machdep.c head/sys/riscv/riscv/nexus.c head/sys/riscv/riscv/timer.c Modified: head/sys/conf/files.riscv ============================================================================== --- head/sys/conf/files.riscv Tue Jun 12 17:07:30 2018 (r335006) +++ head/sys/conf/files.riscv Tue Jun 12 17:45:15 2018 (r335007) @@ -9,8 +9,11 @@ dev/ofw/ofw_cpu.c optional fdt dev/uart/uart_cpu_fdt.c optional uart fdt dev/xilinx/axi_quad_spi.c optional xilinx_spi kern/kern_clocksource.c standard +kern/msi_if.m standard +kern/pic_if.m standard kern/subr_devmap.c standard kern/subr_dummy_vdso_tc.c standard +kern/subr_intr.c standard libkern/bcmp.c standard libkern/bcopy.c standard libkern/ffs.c standard @@ -44,6 +47,7 @@ riscv/riscv/mp_machdep.c optional smp riscv/riscv/mem.c standard riscv/riscv/nexus.c standard riscv/riscv/ofw_machdep.c optional fdt +riscv/riscv/plic.c standard riscv/riscv/pmap.c standard riscv/riscv/riscv_console.c optional rcons riscv/riscv/soc.c standard Modified: head/sys/conf/options.riscv ============================================================================== --- head/sys/conf/options.riscv Tue Jun 12 17:07:30 2018 (r335006) +++ head/sys/conf/options.riscv Tue Jun 12 17:45:15 2018 (r335007) @@ -2,3 +2,4 @@ RISCV opt_global.h FPE opt_global.h +INTRNG opt_global.h Modified: head/sys/riscv/conf/GENERIC ============================================================================== --- head/sys/riscv/conf/GENERIC Tue Jun 12 17:07:30 2018 (r335006) +++ head/sys/riscv/conf/GENERIC Tue Jun 12 17:45:15 2018 (r335007) @@ -76,6 +76,7 @@ options RACCT # Resource accounting framework options RACCT_DEFAULT_TO_DISABLED # Set kern.racct.enable=0 by default options RCTL # Resource limits options SMP +options INTRNG # RISC-V SBI console device rcons Modified: head/sys/riscv/include/intr.h ============================================================================== --- head/sys/riscv/include/intr.h Tue Jun 12 17:07:30 2018 (r335006) +++ head/sys/riscv/include/intr.h Tue Jun 12 17:45:15 2018 (r335007) @@ -37,11 +37,19 @@ #ifndef _MACHINE_INTR_MACHDEP_H_ #define _MACHINE_INTR_MACHDEP_H_ +#define RISCV_NIRQ 1024 + +#ifndef NIRQ +#define NIRQ RISCV_NIRQ +#endif + +#ifdef INTRNG +#include +#endif + struct trapframe; -void riscv_init_interrupts(void); int riscv_teardown_intr(void *); -int riscv_config_intr(u_int, enum intr_trigger, enum intr_polarity); int riscv_setup_intr(const char *, driver_filter_t *, driver_intr_t *, void *, int, int, void **); void riscv_cpu_intr(struct trapframe *); @@ -69,12 +77,7 @@ enum { IRQ_EXTERNAL_SUPERVISOR, IRQ_EXTERNAL_HYPERVISOR, IRQ_EXTERNAL_MACHINE, -#if 0 - /* lowRISC TODO */ - IRQ_COP, /* lowRISC only */ - IRQ_UART, /* lowRISC only */ -#endif - NIRQS + INTC_NIRQS }; #endif /* !_MACHINE_INTR_MACHDEP_H_ */ Modified: head/sys/riscv/include/riscvreg.h ============================================================================== --- head/sys/riscv/include/riscvreg.h Tue Jun 12 17:07:30 2018 (r335006) +++ head/sys/riscv/include/riscvreg.h Tue Jun 12 17:45:15 2018 (r335007) @@ -137,6 +137,8 @@ #define SIE_SSIE (1 << 1) #define SIE_UTIE (1 << 4) #define SIE_STIE (1 << 5) +#define SIE_UEIE (1 << 8) +#define SIE_SEIE (1 << 9) #define MIP_SEIP (1 << 9) Modified: head/sys/riscv/include/smp.h ============================================================================== --- head/sys/riscv/include/smp.h Tue Jun 12 17:07:30 2018 (r335006) +++ head/sys/riscv/include/smp.h Tue Jun 12 17:45:15 2018 (r335007) @@ -46,6 +46,8 @@ #define IPI_STOP_HARD (1 << 4) #define IPI_HARDCLOCK (1 << 5) +#define INTR_IPI_COUNT 1 + void ipi_all_but_self(u_int ipi); void ipi_cpu(int cpu, u_int ipi); void ipi_selected(cpuset_t cpus, u_int ipi); Modified: head/sys/riscv/riscv/intr_machdep.c ============================================================================== --- head/sys/riscv/riscv/intr_machdep.c Tue Jun 12 17:07:30 2018 (r335006) +++ head/sys/riscv/riscv/intr_machdep.c Tue Jun 12 17:45:15 2018 (r335007) @@ -38,11 +38,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include -#include +#include #include #include #include @@ -50,45 +52,23 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include + #ifdef SMP #include #endif -u_long intrcnt[NIRQS]; -size_t sintrcnt = sizeof(intrcnt); +void intr_irq_handler(struct trapframe *tf); -char intrnames[NIRQS * (MAXCOMLEN + 1) * 2]; -size_t sintrnames = sizeof(intrnames); +struct intc_irqsrc { + struct intr_irqsrc isrc; + u_int irq; +}; -static struct intr_event *intr_events[NIRQS]; -static riscv_intrcnt_t riscv_intr_counters[NIRQS]; +struct intc_irqsrc isrcs[INTC_NIRQS]; -static int intrcnt_index; - -riscv_intrcnt_t -riscv_intrcnt_create(const char* name) -{ - riscv_intrcnt_t counter; - - counter = &intrcnt[intrcnt_index++]; - riscv_intrcnt_setname(counter, name); - - return (counter); -} - -void -riscv_intrcnt_setname(riscv_intrcnt_t counter, const char *name) -{ - int i; - - i = (counter - intrcnt); - - KASSERT(counter != NULL, ("riscv_intrcnt_setname: NULL counter")); - - snprintf(intrnames + (MAXCOMLEN + 1) * i, - MAXCOMLEN + 1, "%-*s", MAXCOMLEN, name); -} - static void riscv_mask_irq(void *source) { @@ -102,15 +82,10 @@ riscv_mask_irq(void *source) break; case IRQ_SOFTWARE_USER: csr_clear(sie, SIE_USIE); + break; case IRQ_SOFTWARE_SUPERVISOR: csr_clear(sie, SIE_SSIE); break; -#if 0 - /* lowRISC TODO */ - case IRQ_UART: - machine_command(ECALL_IO_IRQ_MASK, 0); - break; -#endif default: panic("Unknown irq %d\n", irq); } @@ -133,60 +108,37 @@ riscv_unmask_irq(void *source) case IRQ_SOFTWARE_SUPERVISOR: csr_set(sie, SIE_SSIE); break; -#if 0 - /* lowRISC TODO */ - case IRQ_UART: - machine_command(ECALL_IO_IRQ_MASK, 1); - break; -#endif default: panic("Unknown irq %d\n", irq); } } -void -riscv_init_interrupts(void) -{ - char name[MAXCOMLEN + 1]; - int i; - - for (i = 0; i < NIRQS; i++) { - snprintf(name, MAXCOMLEN + 1, "int%d:", i); - riscv_intr_counters[i] = riscv_intrcnt_create(name); - } -} - int riscv_setup_intr(const char *name, driver_filter_t *filt, void (*handler)(void*), void *arg, int irq, int flags, void **cookiep) { - struct intr_event *event; + struct intr_irqsrc *isrc; int error; - if (irq < 0 || irq >= NIRQS) + if (irq < 0 || irq >= INTC_NIRQS) panic("%s: unknown intr %d", __func__, irq); - event = intr_events[irq]; - if (event == NULL) { - error = intr_event_create(&event, (void *)(uintptr_t)irq, 0, - irq, riscv_mask_irq, riscv_unmask_irq, - NULL, NULL, "int%d", irq); + isrc = &isrcs[irq].isrc; + if (isrc->isrc_event == NULL) { + error = intr_event_create(&isrc->isrc_event, isrc, 0, irq, + riscv_mask_irq, riscv_unmask_irq, NULL, NULL, "int%d", irq); if (error) return (error); - intr_events[irq] = event; riscv_unmask_irq((void*)(uintptr_t)irq); } - error = intr_event_add_handler(event, name, filt, handler, arg, - intr_priority(flags), flags, cookiep); + error = intr_event_add_handler(isrc->isrc_event, name, + filt, handler, arg, intr_priority(flags), flags, cookiep); if (error) { printf("Failed to setup intr: %d\n", irq); return (error); } - riscv_intrcnt_setname(riscv_intr_counters[irq], - event->ie_fullname); - return (0); } @@ -199,19 +151,10 @@ riscv_teardown_intr(void *ih) return (0); } -int -riscv_config_intr(u_int irq, enum intr_trigger trig, enum intr_polarity pol) -{ - - /* There is no configuration for interrupts */ - - return (0); -} - void riscv_cpu_intr(struct trapframe *frame) { - struct intr_event *event; + struct intr_irqsrc *isrc; int active_irq; critical_enter(); @@ -222,26 +165,20 @@ riscv_cpu_intr(struct trapframe *frame) active_irq = (frame->tf_scause & EXCP_MASK); switch (active_irq) { -#if 0 - /* lowRISC TODO */ - case IRQ_UART: -#endif case IRQ_SOFTWARE_USER: case IRQ_SOFTWARE_SUPERVISOR: case IRQ_TIMER_SUPERVISOR: - event = intr_events[active_irq]; - /* Update counters */ - atomic_add_long(riscv_intr_counters[active_irq], 1); - VM_CNT_INC(v_intr); + isrc = &isrcs[active_irq].isrc; + if (intr_isrc_dispatch(isrc, frame) != 0) + printf("stray interrupt %d\n", active_irq); break; + case IRQ_EXTERNAL_SUPERVISOR: + intr_irq_handler(frame); + break; default: - event = NULL; + break; } - if (!event || TAILQ_EMPTY(&event->ie_handlers) || - (intr_event_handle(event, frame) != 0)) - printf("stray interrupt %d\n", active_irq); - critical_exit(); } @@ -320,5 +257,22 @@ ipi_selected(cpuset_t cpus, u_int ipi) } sbi_send_ipi(&mask); } - #endif + +/* Interrupt machdep initialization routine. */ +static void +intc_init(void *dummy __unused) +{ + int error; + int i; + + for (i = 0; i < INTC_NIRQS; i++) { + isrcs[i].irq = i; + error = intr_isrc_register(&isrcs[i].isrc, NULL, + 0, "intc,%u", i); + if (error != 0) + printf("Can't register interrupt %d\n", i); + } +} + +SYSINIT(intc_init, SI_SUB_INTR, SI_ORDER_MIDDLE, intc_init, NULL); Modified: head/sys/riscv/riscv/machdep.c ============================================================================== --- head/sys/riscv/riscv/machdep.c Tue Jun 12 17:07:30 2018 (r335006) +++ head/sys/riscv/riscv/machdep.c Tue Jun 12 17:45:15 2018 (r335007) @@ -872,8 +872,6 @@ initriscv(struct riscv_bootparams *rvbp) init_param2(physmem); kdb_init(); - riscv_init_interrupts(); - early_boot = 0; } Modified: head/sys/riscv/riscv/mp_machdep.c ============================================================================== --- head/sys/riscv/riscv/mp_machdep.c Tue Jun 12 17:07:30 2018 (r335006) +++ head/sys/riscv/riscv/mp_machdep.c Tue Jun 12 17:45:15 2018 (r335007) @@ -256,6 +256,9 @@ init_secondary(uint64_t cpu) /* Enable interrupts */ intr_enable(); + /* Enable external (PLIC) interrupts */ + csr_set(sie, SIE_SEIE); + mtx_lock_spin(&ap_boot_mtx); atomic_add_rel_32(&smp_cpus, 1); Modified: head/sys/riscv/riscv/nexus.c ============================================================================== --- head/sys/riscv/riscv/nexus.c Tue Jun 12 17:07:30 2018 (r335006) +++ head/sys/riscv/riscv/nexus.c Tue Jun 12 17:45:15 2018 (r335007) @@ -38,6 +38,7 @@ * ISA code but it's easier to do it here for now), I/O port addresses, * and I/O memory address space. */ +#include "opt_platform.h" #include __FBSDID("$FreeBSD$"); @@ -48,22 +49,18 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include -#include -#include -#include -#include - +#include #include #include -#include "opt_platform.h" - -#include +#ifdef FDT +#include +#include #include "ofw_bus_if.h" +#endif extern struct bus_space memmap_bus; @@ -265,7 +262,7 @@ nexus_config_intr(device_t dev, int irq, enum intr_tri enum intr_polarity pol) { - return (riscv_config_intr(irq, trig, pol)); + return (EOPNOTSUPP); } static int @@ -282,8 +279,7 @@ nexus_setup_intr(device_t dev, device_t child, struct if (error) return (error); - error = riscv_setup_intr(device_get_nameunit(child), filt, intr, - arg, rman_get_start(res), flags, cookiep); + error = intr_setup_irq(child, res, filt, intr, arg, flags, cookiep); return (error); } @@ -292,7 +288,7 @@ static int nexus_teardown_intr(device_t dev, device_t child, struct resource *r, void *ih) { - return (riscv_teardown_intr(ih)); + return (intr_teardown_irq(child, r, ih)); } static int @@ -321,7 +317,14 @@ nexus_activate_resource(device_t bus, device_t child, rman_set_bustag(r, &memmap_bus); rman_set_virtual(r, (void *)vaddr); rman_set_bushandle(r, vaddr); + } else if (type == SYS_RES_IRQ) { + err = intr_activate_irq(child, r); + if (err != 0) { + rman_deactivate_resource(r); + return (err); + } } + return (0); } @@ -375,16 +378,17 @@ static int nexus_ofw_map_intr(device_t dev, device_t child, phandle_t iparent, int icells, pcell_t *intr) { - int irq; + struct intr_map_data_fdt *fdt_data; + size_t len; + u_int irq; - if (icells == 3) { - irq = intr[1]; - if (intr[0] == 0) - irq += 32; /* SPI */ - else - irq += 16; /* PPI */ - } else - irq = intr[0]; + len = sizeof(*fdt_data) + icells * sizeof(pcell_t); + fdt_data = (struct intr_map_data_fdt *)intr_alloc_map_data( + INTR_MAP_DATA_FDT, len, M_WAITOK | M_ZERO); + fdt_data->iparent = iparent; + fdt_data->ncells = icells; + memcpy(fdt_data->cells, intr, icells * sizeof(pcell_t)); + irq = intr_map_irq(NULL, iparent, (struct intr_map_data *)fdt_data); return (irq); } Added: head/sys/riscv/riscv/plic.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/riscv/riscv/plic.c Tue Jun 12 17:45:15 2018 (r335007) @@ -0,0 +1,254 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Ruslan Bukin + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include "pic_if.h" + +#define PLIC_NIRQS 32 +#define PLIC_PRIORITY(n) (0x000000 + (n) * 0x4) +#define PLIC_ENABLE(n, h) (0x002000 + (h) * 0x80 + (n) / 32) +#define PLIC_THRESHOLD(h) (0x200000 + (h) * 0x1000 + 0x0) +#define PLIC_CLAIM(h) (0x200000 + (h) * 0x1000 + 0x4) + +struct plic_irqsrc { + struct intr_irqsrc isrc; + u_int irq; +}; + +struct plic_softc { + device_t dev; + struct resource * intc_res; + struct plic_irqsrc isrcs[PLIC_NIRQS]; +}; + +#define RD4(sc, reg) \ + bus_read_4(sc->intc_res, (reg)) +#define WR4(sc, reg, val) \ + bus_write_4(sc->intc_res, (reg), (val)) + +static inline void +plic_irq_dispatch(struct plic_softc *sc, u_int irq, + struct trapframe *tf) +{ + struct plic_irqsrc *src; + + src = &sc->isrcs[irq]; + + if (intr_isrc_dispatch(&src->isrc, tf) != 0) + device_printf(sc->dev, "Stray irq %u detected\n", irq); +} + +static int +plic_intr(void *arg) +{ + struct plic_softc *sc; + struct trapframe *tf; + uint32_t pending; + uint32_t cpu; + + sc = arg; + cpu = PCPU_GET(cpuid); + + pending = RD4(sc, PLIC_CLAIM(cpu)); + if (pending) { + tf = curthread->td_intr_frame; + plic_irq_dispatch(sc, pending, tf); + WR4(sc, PLIC_CLAIM(cpu), pending); + } + + return (FILTER_HANDLED); +} + +static void +plic_disable_intr(device_t dev, struct intr_irqsrc *isrc) +{ + struct plic_softc *sc; + struct plic_irqsrc *src; + uint32_t reg; + uint32_t cpu; + + sc = device_get_softc(dev); + src = (struct plic_irqsrc *)isrc; + + cpu = PCPU_GET(cpuid); + + reg = RD4(sc, PLIC_ENABLE(src->irq, cpu)); + reg &= ~(1 << (src->irq % 32)); + WR4(sc, PLIC_ENABLE(src->irq, cpu), reg); +} + +static void +plic_enable_intr(device_t dev, struct intr_irqsrc *isrc) +{ + struct plic_softc *sc; + struct plic_irqsrc *src; + uint32_t reg; + uint32_t cpu; + + sc = device_get_softc(dev); + src = (struct plic_irqsrc *)isrc; + + WR4(sc, PLIC_PRIORITY(src->irq), 1); + + cpu = PCPU_GET(cpuid); + + reg = RD4(sc, PLIC_ENABLE(src->irq, cpu)); + reg |= (1 << (src->irq % 32)); + WR4(sc, PLIC_ENABLE(src->irq, cpu), reg); +} + +static int +plic_map_intr(device_t dev, struct intr_map_data *data, + struct intr_irqsrc **isrcp) +{ + struct intr_map_data_fdt *daf; + struct plic_softc *sc; + + sc = device_get_softc(dev); + + if (data->type != INTR_MAP_DATA_FDT) + return (ENOTSUP); + + daf = (struct intr_map_data_fdt *)data; + if (daf->ncells != 1 || daf->cells[0] >= PLIC_NIRQS) + return (EINVAL); + + *isrcp = &sc->isrcs[daf->cells[0]].isrc; + + return (0); +} + +static int +plic_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "riscv,plic0")) + return (ENXIO); + + device_set_desc(dev, "RISC-V PLIC"); + + return (BUS_PROBE_DEFAULT); +} + +static int +plic_attach(device_t dev) +{ + struct plic_irqsrc *isrcs; + struct plic_softc *sc; + struct intr_pic *pic; + uint32_t irq; + const char *name; + phandle_t xref; + uint32_t cpu; + int error; + int rid; + + sc = device_get_softc(dev); + + sc->dev = dev; + + /* Request memory resources */ + rid = 0; + sc->intc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->intc_res == NULL) { + device_printf(dev, + "Error: could not allocate memory resources\n"); + return (ENXIO); + } + + isrcs = sc->isrcs; + name = device_get_nameunit(sc->dev); + cpu = PCPU_GET(cpuid); + for (irq = 0; irq < PLIC_NIRQS; irq++) { + isrcs[irq].irq = irq; + error = intr_isrc_register(&isrcs[irq].isrc, sc->dev, + 0, "%s,%u", name, irq); + if (error != 0) + return (error); + + WR4(sc, PLIC_ENABLE(irq, cpu), 0); + } + WR4(sc, PLIC_THRESHOLD(cpu), 0); + + xref = OF_xref_from_node(ofw_bus_get_node(sc->dev)); + pic = intr_pic_register(sc->dev, xref); + if (pic == NULL) + return (ENXIO); + + csr_set(sie, SIE_SEIE); + + return (intr_pic_claim_root(sc->dev, xref, plic_intr, sc, 0)); +} + +static device_method_t plic_methods[] = { + DEVMETHOD(device_probe, plic_probe), + DEVMETHOD(device_attach, plic_attach), + + DEVMETHOD(pic_disable_intr, plic_disable_intr), + DEVMETHOD(pic_enable_intr, plic_enable_intr), + DEVMETHOD(pic_map_intr, plic_map_intr), + + DEVMETHOD_END +}; + +static driver_t plic_driver = { + "plic", + plic_methods, + sizeof(struct plic_softc), +}; + +static devclass_t plic_devclass; + +EARLY_DRIVER_MODULE(plic, simplebus, plic_driver, plic_devclass, + 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); Modified: head/sys/riscv/riscv/timer.c ============================================================================== --- head/sys/riscv/riscv/timer.c Tue Jun 12 17:07:30 2018 (r335006) +++ head/sys/riscv/riscv/timer.c Tue Jun 12 17:45:15 2018 (r335007) @@ -70,8 +70,6 @@ struct riscv_timer_softc { void *ih; uint32_t clkfreq; struct eventtimer et; - int intr_rid; - struct resource *intr_res; }; static struct riscv_timer_softc *riscv_timer_sc = NULL; @@ -188,18 +186,9 @@ riscv_timer_attach(device_t dev) riscv_timer_sc = sc; - sc->intr_rid = 0; - sc->intr_res = bus_alloc_resource(dev, - SYS_RES_IRQ, &sc->intr_rid, IRQ_TIMER_SUPERVISOR, - IRQ_TIMER_SUPERVISOR, 1, RF_ACTIVE); - if (sc->intr_res == NULL) { - device_printf(dev, "failed to allocate irq\n"); - return (ENXIO); - } - /* Setup IRQs handler */ - error = bus_setup_intr(dev, sc->intr_res, INTR_TYPE_CLK, - riscv_timer_intr, NULL, sc, &sc->ih); + error = riscv_setup_intr(device_get_nameunit(dev), riscv_timer_intr, + NULL, sc, IRQ_TIMER_SUPERVISOR, INTR_TYPE_CLK, &sc->ih); if (error) { device_printf(dev, "Unable to alloc int resource.\n"); return (ENXIO); From owner-svn-src-head@freebsd.org Tue Jun 12 17:51:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C57BC100C9E7; Tue, 12 Jun 2018 17:51:53 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 832C97147F; Tue, 12 Jun 2018 17:51:53 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 41DDE2601A1; Tue, 12 Jun 2018 19:51:51 +0200 (CEST) Subject: Re: svn commit: r330711 - head/sbin/sysctl To: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201803092337.w29NbJSX093826@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <62e6ac8a-90d0-4877-9303-7a61ee192b0a@selasky.org> Date: Tue, 12 Jun 2018 19:51:35 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <201803092337.w29NbJSX093826@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 17:51:54 -0000 On 03/10/18 00:37, John Baldwin wrote: > Author: jhb > Date: Fri Mar 9 23:37:19 2018 > New Revision: 330711 > URL: https://svnweb.freebsd.org/changeset/base/330711 > > Log: > Permit sysctl(8) to set an array of numeric values for a single node. > > Most sysctl nodes only return a single value, but some nodes return an > array of values (e.g. kern.cp_time). sysctl(8) understand how to display > the values of a node that returns multiple values (it prints out each > numeric value separated by spaces). However, until now sysctl(8) has > only been able to set sysctl nodes to a single value. This change > allows sysctl to accept a new value for a numeric sysctl node that contains > multiple values separated by either spaces or commas. sysctl(8) parses > this list into an array of values and passes the array as the "new" value > to sysctl(2). Hi, Was support added to handle such settings through the kernel environment aswell, like /boot/loader.conf. See the XXX_RWTUN and XXX_RDTUN flags for sysctls. --HPS From owner-svn-src-head@freebsd.org Tue Jun 12 17:55:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E37BD100D1B2; Tue, 12 Jun 2018 17:55:41 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E7E9718B8; Tue, 12 Jun 2018 17:55:41 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D1106016; Tue, 12 Jun 2018 17:55:41 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5CHtfvm035198; Tue, 12 Jun 2018 17:55:41 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5CHtfd3035197; Tue, 12 Jun 2018 17:55:41 GMT (envelope-from br@FreeBSD.org) Message-Id: <201806121755.w5CHtfd3035197@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 12 Jun 2018 17:55:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335008 - head/sys/riscv/conf X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/riscv/conf X-SVN-Commit-Revision: 335008 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 17:55:42 -0000 Author: br Date: Tue Jun 12 17:55:40 2018 New Revision: 335008 URL: https://svnweb.freebsd.org/changeset/base/335008 Log: Include VirtIO devices to the GENERIC configuration file. These are now available in QEMU/RISC-V. Sponsored by: DARPA, AFRL Modified: head/sys/riscv/conf/GENERIC Modified: head/sys/riscv/conf/GENERIC ============================================================================== --- head/sys/riscv/conf/GENERIC Tue Jun 12 17:45:15 2018 (r335007) +++ head/sys/riscv/conf/GENERIC Tue Jun 12 17:55:40 2018 (r335008) @@ -81,11 +81,21 @@ options INTRNG # RISC-V SBI console device rcons +# VirtIO support +device virtio # Generic VirtIO bus (required) +device virtio_pci # VirtIO PCI device +device vtnet # VirtIO Ethernet device +device virtio_blk # VirtIO Block device +device virtio_mmio # VirtIO MMIO bus + # Uncomment for memory disk # options MD_ROOT # options MD_ROOT_SIZE=32768 # 32MB ram disk # makeoptions MFS_IMAGE=/path/to/img # options ROOTDEVNAME=\"ufs:/dev/md0\" + +# Uncomment for virtio block device +# options ROOTDEVNAME=\"ufs:/dev/vtbd0\" # Debugging support. Always need this: options KDB # Enable kernel debugger support. From owner-svn-src-head@freebsd.org Tue Jun 12 18:42:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 515201011858; Tue, 12 Jun 2018 18:42:42 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 02A8674026; Tue, 12 Jun 2018 18:42:42 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D7D6C681D; Tue, 12 Jun 2018 18:42:41 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5CIgfcW060672; Tue, 12 Jun 2018 18:42:41 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5CIgfAF060671; Tue, 12 Jun 2018 18:42:41 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201806121842.w5CIgfAF060671@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 12 Jun 2018 18:42:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335009 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 335009 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 18:42:42 -0000 Author: kevans Date: Tue Jun 12 18:42:41 2018 New Revision: 335009 URL: https://svnweb.freebsd.org/changeset/base/335009 Log: lualoader: Match Forth module-loading behavior w.r.t flags Also as documented in loader.conf(5), ${module}_flags are actually flags to be passed to the module, not to `load` as was done thus far. Modified: head/stand/lua/config.lua Modified: head/stand/lua/config.lua ============================================================================== --- head/stand/lua/config.lua Tue Jun 12 17:55:40 2018 (r335008) +++ head/stand/lua/config.lua Tue Jun 12 18:42:41 2018 (r335009) @@ -226,9 +226,6 @@ local function loadModule(mod, silent) for k, v in pairs(mod) do if v.load ~= nil and v.load:lower() == "yes" then local str = "load " - if v.flags ~= nil then - str = str .. v.flags .. " " - end if v.type ~= nil then str = str .. "-t " .. v.type .. " " end @@ -236,6 +233,9 @@ local function loadModule(mod, silent) str = str .. v.name else str = str .. k + end + if v.flags ~= nil then + str = str .. " " .. v.flags end if v.before ~= nil then pstatus = cli_execute_unparsed(v.before) == 0 From owner-svn-src-head@freebsd.org Tue Jun 12 18:58:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4B8C1012D16; Tue, 12 Jun 2018 18:58:57 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 720627487A; Tue, 12 Jun 2018 18:58:57 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4F6AA69C1; Tue, 12 Jun 2018 18:58:57 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5CIwvW7066103; Tue, 12 Jun 2018 18:58:57 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5CIwvwB066102; Tue, 12 Jun 2018 18:58:57 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201806121858.w5CIwvwB066102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 12 Jun 2018 18:58:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335010 - head/usr.sbin/cpucontrol X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/usr.sbin/cpucontrol X-SVN-Commit-Revision: 335010 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 18:58:58 -0000 Author: sbruno Date: Tue Jun 12 18:58:56 2018 New Revision: 335010 URL: https://svnweb.freebsd.org/changeset/base/335010 Log: cpucontrol: - fix debugging for family on AMD cpus and add useful debugging for which file is being selected for update. Reviewed by: cem Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D15574 Modified: head/usr.sbin/cpucontrol/amd10h.c Modified: head/usr.sbin/cpucontrol/amd10h.c ============================================================================== --- head/usr.sbin/cpucontrol/amd10h.c Tue Jun 12 18:42:41 2018 (r335009) +++ head/usr.sbin/cpucontrol/amd10h.c Tue Jun 12 18:58:56 2018 (r335010) @@ -139,7 +139,8 @@ amd10h_update(const char *dev, const char *path) WARNX(1, "found cpu family %#x model %#x " "stepping %#x extfamily %#x extmodel %#x.", - (signature >> 8) & 0x0f, (signature >> 4) & 0x0f, + ((signature >> 8) & 0x0f) + ((signature >> 20) & 0xff), + (signature >> 4) & 0x0f, (signature >> 0) & 0x0f, (signature >> 20) & 0xff, (signature >> 16) & 0x0f); WARNX(1, "microcode revision %#x", revision); @@ -147,6 +148,7 @@ amd10h_update(const char *dev, const char *path) /* * Open the firmware file. */ + WARNX(1, "checking %s for update.", path); fd = open(path, O_RDONLY, 0); if (fd < 0) { WARN(0, "open(%s)", path); @@ -215,7 +217,9 @@ amd10h_update(const char *dev, const char *path) for (i = 0; equiv_cpu_table[i].installed_cpu != 0; i++) { if (signature == equiv_cpu_table[i].installed_cpu) { equiv_id = equiv_cpu_table[i].equiv_cpu; - WARNX(3, "equiv_id: %x", equiv_id); + WARNX(3, "equiv_id: %x, signature %8x," + " equiv_cpu_table[%d] %8x", equiv_id, signature, + i, equiv_cpu_table[i].installed_cpu); break; } } @@ -249,10 +253,16 @@ amd10h_update(const char *dev, const char *path) fw_data += section_header->size; fw_size -= section_header->size; - if (fw_header->processor_rev_id != equiv_id) + if (fw_header->processor_rev_id != equiv_id) { + WARNX(1, "firmware processort_rev_id %x, equiv_id %x", + fw_header->processor_rev_id, equiv_id); continue; /* different cpu */ - if (fw_header->patch_id <= revision) + } + if (fw_header->patch_id <= revision) { + WARNX(1, "patch_id %x, revision %x", + fw_header->patch_id, revision); continue; /* not newer revision */ + } if (fw_header->nb_dev_id != 0 || fw_header->sb_dev_id != 0) { WARNX(2, "Chipset-specific microcode is not supported"); } From owner-svn-src-head@freebsd.org Tue Jun 12 19:26:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B9591015537; Tue, 12 Jun 2018 19:26:26 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 28733759D0; Tue, 12 Jun 2018 19:26:26 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 044826EB5; Tue, 12 Jun 2018 19:26:26 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5CJQPC5081439; Tue, 12 Jun 2018 19:26:25 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5CJQPl7081438; Tue, 12 Jun 2018 19:26:25 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201806121926.w5CJQPl7081438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 12 Jun 2018 19:26:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335011 - head/tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/tools/build/mk X-SVN-Commit-Revision: 335011 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 19:26:26 -0000 Author: sbruno Date: Tue Jun 12 19:26:25 2018 New Revision: 335011 URL: https://svnweb.freebsd.org/changeset/base/335011 Log: WITHOUT_NLS cleanup of more empty dirs. Reviewed by: emaste Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D15626 Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Tue Jun 12 18:58:56 2018 (r335010) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Tue Jun 12 19:26:25 2018 (r335011) @@ -6253,104 +6253,262 @@ OLD_FILES+=var/yp/Makefile.dist .endif .if ${MK_NLS} == no +OLD_DIRS+=usr/share/nls/ +OLD_DIRS+=usr/share/nls/C +OLD_FILES+=usr/share/mk/bsd.nls.mk OLD_FILES+=usr/share/nls/C/ee.cat +OLD_DIRS+=usr/share/nls/af_ZA.ISO8859-1 +OLD_DIRS+=usr/share/nls/af_ZA.ISO8859-15 +OLD_DIRS+=usr/share/nls/af_ZA.UTF-8 +OLD_DIRS+=usr/share/nls/am_ET.UTF-8 +OLD_DIRS+=usr/share/nls/be_BY.CP1131 +OLD_DIRS+=usr/share/nls/be_BY.CP1251 +OLD_DIRS+=usr/share/nls/be_BY.ISO8859-5 +OLD_DIRS+=usr/share/nls/be_BY.UTF-8 OLD_FILES+=usr/share/nls/be_BY.UTF-8/libc.cat +OLD_DIRS+=usr/share/nls/bg_BG.CP1251 +OLD_DIRS+=usr/share/nls/bg_BG.UTF-8 +OLD_DIRS+=usr/share/nls/ca_ES.ISO8859-1 OLD_FILES+=usr/share/nls/ca_ES.ISO8859-1/libc.cat +OLD_DIRS+=usr/share/nls/ca_ES.ISO8859-15 +OLD_DIRS+=usr/share/nls/ca_ES.UTF-8 +OLD_DIRS+=usr/share/nls/cs_CZ.ISO8859-2 +OLD_DIRS+=usr/share/nls/cs_CZ.UTF-8 +OLD_DIRS+=usr/share/nls/da_DK.ISO8859-1 +OLD_DIRS+=usr/share/nls/da_DK.ISO8859-15 +OLD_DIRS+=usr/share/nls/da_DK.UTF-8 +OLD_DIRS+=usr/share/nls/de_AT.ISO8859-1 OLD_FILES+=usr/share/nls/de_AT.ISO8859-1/ee.cat OLD_FILES+=usr/share/nls/de_AT.ISO8859-1/tcsh.cat +OLD_DIRS+=usr/share/nls/de_AT.ISO8859-15 OLD_FILES+=usr/share/nls/de_AT.ISO8859-15/ee.cat OLD_FILES+=usr/share/nls/de_AT.ISO8859-15/tcsh.cat +OLD_DIRS+=usr/share/nls/de_AT.UTF-8 OLD_FILES+=usr/share/nls/de_AT.UTF-8/tcsh.cat +OLD_DIRS+=usr/share/nls/de_CH.ISO8859-1 OLD_FILES+=usr/share/nls/de_CH.ISO8859-1/ee.cat OLD_FILES+=usr/share/nls/de_CH.ISO8859-1/tcsh.cat +OLD_DIRS+=usr/share/nls/de_CH.ISO8859-15 OLD_FILES+=usr/share/nls/de_CH.ISO8859-15/ee.cat OLD_FILES+=usr/share/nls/de_CH.ISO8859-15/tcsh.cat +OLD_DIRS+=usr/share/nls/de_CH.UTF-8 OLD_FILES+=usr/share/nls/de_CH.UTF-8/tcsh.cat +OLD_DIRS+=usr/share/nls/de_DE.ISO8859-1 OLD_FILES+=usr/share/nls/de_DE.ISO8859-1/ee.cat OLD_FILES+=usr/share/nls/de_DE.ISO8859-1/libc.cat OLD_FILES+=usr/share/nls/de_DE.ISO8859-1/tcsh.cat +OLD_DIRS+=usr/share/nls/de_DE.ISO8859-15 OLD_FILES+=usr/share/nls/de_DE.ISO8859-15/ee.cat OLD_FILES+=usr/share/nls/de_DE.ISO8859-15/tcsh.cat +OLD_DIRS+=usr/share/nls/de_DE.UTF-8 OLD_FILES+=usr/share/nls/de_DE.UTF-8/tcsh.cat +OLD_DIRS+=usr/share/nls/el_GR.ISO8859-7 OLD_FILES+=usr/share/nls/el_GR.ISO8859-7/libc.cat OLD_FILES+=usr/share/nls/el_GR.ISO8859-7/tcsh.cat +OLD_DIRS+=usr/share/nls/el_GR.UTF-8 OLD_FILES+=usr/share/nls/el_GR.UTF-8/tcsh.cat +OLD_DIRS+=usr/share/nls/en_AU.ISO8859-1 +OLD_DIRS+=usr/share/nls/en_AU.ISO8859-15 +OLD_DIRS+=usr/share/nls/en_AU.US-ASCII +OLD_DIRS+=usr/share/nls/en_AU.UTF-8 +OLD_DIRS+=usr/share/nls/en_CA.ISO8859-1 OLD_FILES+=usr/share/nls/en_US.ISO8859-1/ee.cat +OLD_DIRS+=usr/share/nls/en_CA.ISO8859-15 +OLD_DIRS+=usr/share/nls/en_CA.US-ASCII +OLD_DIRS+=usr/share/nls/en_CA.UTF-8 +OLD_DIRS+=usr/share/nls/en_GB.ISO8859-1 +OLD_DIRS+=usr/share/nls/en_GB.ISO8859-15 +OLD_DIRS+=usr/share/nls/en_GB.US-ASCII +OLD_DIRS+=usr/share/nls/en_GB.UTF-8 +OLD_DIRS+=usr/share/nls/en_IE.UTF-8 +OLD_DIRS+=usr/share/nls/en_NZ.ISO8859-1 +OLD_DIRS+=usr/share/nls/en_NZ.ISO8859-15 +OLD_DIRS+=usr/share/nls/en_NZ.US-ASCII +OLD_DIRS+=usr/share/nls/en_NZ.UTF-8 +OLD_DIRS+=usr/share/nls/en_US.ISO8859-1 +OLD_DIRS+=usr/share/nls/en_US.ISO8859-15 OLD_FILES+=usr/share/nls/en_US.ISO8859-15/ee.cat +OLD_DIRS+=usr/share/nls/en_US.UTF-8 +OLD_DIRS+=usr/share/nls/es_ES.UTF-8 +OLD_FILES+=usr/share/nls/es_ES.ISO8859-1/grep.cat OLD_FILES+=usr/share/nls/es_ES.ISO8859-1/libc.cat OLD_FILES+=usr/share/nls/es_ES.ISO8859-1/tcsh.cat +OLD_DIRS+=usr/share/nls/es_ES.ISO8859-1 +OLD_DIRS+=usr/share/nls/es_ES.ISO8859-15 OLD_FILES+=usr/share/nls/es_ES.ISO8859-15/tcsh.cat OLD_FILES+=usr/share/nls/es_ES.UTF-8/tcsh.cat +OLD_DIRS+=usr/share/nls/et_EE.ISO8859-15 OLD_FILES+=usr/share/nls/et_EE.ISO8859-15/tcsh.cat +OLD_DIRS+=usr/share/nls/et_EE.UTF-8 OLD_FILES+=usr/share/nls/et_EE.UTF-8/tcsh.cat +OLD_DIRS+=usr/share/nls/fi_FI.ISO8859-1 OLD_FILES+=usr/share/nls/fi_FI.ISO8859-1/libc.cat OLD_FILES+=usr/share/nls/fi_FI.ISO8859-1/tcsh.cat +OLD_DIRS+=usr/share/nls/fi_FI.ISO8859-15 OLD_FILES+=usr/share/nls/fi_FI.ISO8859-15/tcsh.cat +OLD_DIRS+=usr/share/nls/fi_FI.UTF-8 OLD_FILES+=usr/share/nls/fi_FI.UTF-8/tcsh.cat +OLD_DIRS+=usr/share/nls/fr_BE.ISO8859-1 OLD_FILES+=usr/share/nls/fr_BE.ISO8859-1/ee.cat OLD_FILES+=usr/share/nls/fr_BE.ISO8859-1/tcsh.cat +OLD_DIRS+=usr/share/nls/fr_BE.ISO8859-15 OLD_FILES+=usr/share/nls/fr_BE.ISO8859-15/ee.cat OLD_FILES+=usr/share/nls/fr_BE.ISO8859-15/tcsh.cat +OLD_DIRS+=usr/share/nls/fr_BE.UTF-8 OLD_FILES+=usr/share/nls/fr_BE.UTF-8/tcsh.cat +OLD_DIRS+=usr/share/nls/fr_CA.ISO8859-1 OLD_FILES+=usr/share/nls/fr_CA.ISO8859-1/ee.cat OLD_FILES+=usr/share/nls/fr_CA.ISO8859-1/tcsh.cat +OLD_DIRS+=usr/share/nls/fr_CA.ISO8859-15 OLD_FILES+=usr/share/nls/fr_CA.ISO8859-15/ee.cat OLD_FILES+=usr/share/nls/fr_CA.ISO8859-15/tcsh.cat +OLD_DIRS+=usr/share/nls/fr_CA.UTF-8 OLD_FILES+=usr/share/nls/fr_CA.UTF-8/tcsh.cat +OLD_DIRS+=usr/share/nls/fr_CH.ISO8859-1 OLD_FILES+=usr/share/nls/fr_CH.ISO8859-1/ee.cat OLD_FILES+=usr/share/nls/fr_CH.ISO8859-1/tcsh.cat +OLD_DIRS+=usr/share/nls/fr_CH.ISO8859-15 OLD_FILES+=usr/share/nls/fr_CH.ISO8859-15/ee.cat OLD_FILES+=usr/share/nls/fr_CH.ISO8859-15/tcsh.cat +OLD_DIRS+=usr/share/nls/fr_CH.UTF-8 OLD_FILES+=usr/share/nls/fr_CH.UTF-8/tcsh.cat +OLD_DIRS+=usr/share/nls/fr_FR.ISO8859-1 OLD_FILES+=usr/share/nls/fr_FR.ISO8859-1/ee.cat OLD_FILES+=usr/share/nls/fr_FR.ISO8859-1/libc.cat OLD_FILES+=usr/share/nls/fr_FR.ISO8859-1/tcsh.cat +OLD_DIRS+=usr/share/nls/fr_FR.ISO8859-15 OLD_FILES+=usr/share/nls/fr_FR.ISO8859-15/ee.cat OLD_FILES+=usr/share/nls/fr_FR.ISO8859-15/tcsh.cat +OLD_DIRS+=usr/share/nls/fr_FR.UTF-8 OLD_FILES+=usr/share/nls/fr_FR.UTF-8/tcsh.cat +OLD_DIRS+=usr/share/nls/gl_ES.ISO8859-1 +OLD_FILES+=usr/share/nls/gl_ES.ISO8859-1/grep.cat OLD_FILES+=usr/share/nls/gl_ES.ISO8859-1/libc.cat +OLD_DIRS+=usr/share/nls/he_IL.UTF-8 +OLD_DIRS+=usr/share/nls/hi_IN.ISCII-DEV +OLD_DIRS+=usr/share/nls/hr_HR.ISO8859-2 +OLD_DIRS+=usr/share/nls/hu_HU.ISO8859-2 OLD_FILES+=usr/share/nls/hu_HU.ISO8859-2/ee.cat +OLD_FILES+=usr/share/nls/hu_HU.ISO8859-2/grep.cat OLD_FILES+=usr/share/nls/hu_HU.ISO8859-2/libc.cat OLD_FILES+=usr/share/nls/hu_HU.ISO8859-2/sort.cat +OLD_DIRS+=usr/share/nls/hr_HR.UTF-8 +OLD_DIRS+=usr/share/nls/hu_HU.UTF-8 +OLD_DIRS+=usr/share/nls/hy_AM.ARMSCII-8 +OLD_DIRS+=usr/share/nls/hy_AM.UTF-8 +OLD_DIRS+=usr/share/nls/is_IS.ISO8859-1 +OLD_DIRS+=usr/share/nls/is_IS.ISO8859-15 +OLD_DIRS+=usr/share/nls/is_IS.UTF-8 +OLD_DIRS+=usr/share/nls/it_CH.ISO8859-1 OLD_FILES+=usr/share/nls/it_CH.ISO8859-1/tcsh.cat +OLD_DIRS+=usr/share/nls/it_CH.ISO8859-15 OLD_FILES+=usr/share/nls/it_CH.ISO8859-15/tcsh.cat +OLD_DIRS+=usr/share/nls/it_CH.UTF-8 OLD_FILES+=usr/share/nls/it_CH.UTF-8/tcsh.cat +OLD_DIRS+=usr/share/nls/it_IT.ISO8859-1 OLD_FILES+=usr/share/nls/it_IT.ISO8859-1/tcsh.cat +OLD_DIRS+=usr/share/nls/it_IT.ISO8859-15 OLD_FILES+=usr/share/nls/it_IT.ISO8859-15/libc.cat OLD_FILES+=usr/share/nls/it_IT.ISO8859-15/tcsh.cat +OLD_DIRS+=usr/share/nls/it_IT.UTF-8 OLD_FILES+=usr/share/nls/it_IT.UTF-8/tcsh.cat +OLD_DIRS+=usr/share/nls/ja_JP.SJIS +OLD_FILES+=usr/share/nls/ja_JP.SJIS/grep.cat OLD_FILES+=usr/share/nls/ja_JP.SJIS/tcsh.cat +OLD_DIRS+=usr/share/nls/ja_JP.UTF-8 +OLD_FILES+=usr/share/nls/ja_JP.UTF-8/grep.cat OLD_FILES+=usr/share/nls/ja_JP.UTF-8/libc.cat OLD_FILES+=usr/share/nls/ja_JP.UTF-8/tcsh.cat +OLD_DIRS+=usr/share/nls/ja_JP.eucJP +OLD_FILES+=usr/share/nls/ja_JP.eucJP/grep.cat OLD_FILES+=usr/share/nls/ja_JP.eucJP/libc.cat OLD_FILES+=usr/share/nls/ja_JP.eucJP/tcsh.cat +OLD_DIRS+=usr/share/nls/kk_KZ.PT154 +OLD_DIRS+=usr/share/nls/kk_KZ.UTF-8 +OLD_DIRS+=usr/share/nls/ko_KR.CP949 +OLD_DIRS+=usr/share/nls/ko_KR.UTF-8 OLD_FILES+=usr/share/nls/ko_KR.UTF-8/libc.cat +OLD_DIRS+=usr/share/nls/ko_KR.eucKR OLD_FILES+=usr/share/nls/ko_KR.eucKR/libc.cat +OLD_DIRS+=usr/share/nls/lv_LV.UTF-8 +OLD_DIRS+=usr/share/nls/lt_LT.ISO8859-13 +OLD_DIRS+=usr/share/nls/lt_LT.UTF-8 +OLD_DIRS+=usr/share/nls/lv_LV.ISO8859-13 +OLD_DIRS+=usr/share/nls/mn_MN.UTF-8 OLD_FILES+=usr/share/nls/mn_MN.UTF-8/libc.cat +OLD_DIRS+=usr/share/nls/nl_BE.ISO8859-1 +OLD_DIRS+=usr/share/nls/nl_BE.ISO8859-15 +OLD_DIRS+=usr/share/nls/nl_BE.UTF-8 +OLD_DIRS+=usr/share/nls/no_NO.ISO8859-1 OLD_FILES+=usr/share/nls/nl_NL.ISO8859-1/libc.cat +OLD_DIRS+=usr/share/nls/nl_NL.ISO8859-15 +OLD_DIRS+=usr/share/nls/nl_NL.ISO8859-1 OLD_FILES+=usr/share/nls/no_NO.ISO8859-1/libc.cat +OLD_DIRS+=usr/share/nls/no_NO.ISO8859-15 +OLD_DIRS+=usr/share/nls/nl_NL.UTF-8 +OLD_DIRS+=usr/share/nls/no_NO.UTF-8 +OLD_DIRS+=usr/share/nls/pl_PL.ISO8859-2 OLD_FILES+=usr/share/nls/pl_PL.ISO8859-2/ee.cat OLD_FILES+=usr/share/nls/pl_PL.ISO8859-2/libc.cat +OLD_DIRS+=usr/share/nls/pl_PL.UTF-8 +OLD_DIRS+=usr/share/nls/pt_BR.ISO8859-1 +OLD_DIRS+=usr/share/nls/pt_BR.UTF-8 +OLD_DIRS+=usr/share/nls/pt_PT.ISO8859-1 OLD_FILES+=usr/share/nls/pt_BR.ISO8859-1/ee.cat +OLD_FILES+=usr/share/nls/pt_BR.ISO8859-1/grep.cat OLD_FILES+=usr/share/nls/pt_BR.ISO8859-1/libc.cat OLD_FILES+=usr/share/nls/pt_PT.ISO8859-1/ee.cat +OLD_DIRS+=usr/share/nls/pt_PT.ISO8859-15 +OLD_DIRS+=usr/share/nls/pt_PT.UTF-8 +OLD_DIRS+=usr/share/nls/ro_RO.ISO8859-2 +OLD_DIRS+=usr/share/nls/ro_RO.UTF-8 +OLD_DIRS+=usr/share/nls/ru_RU.CP1251 OLD_FILES+=usr/share/nls/ru_RU.CP1251/tcsh.cat +OLD_DIRS+=usr/share/nls/ru_RU.CP866 OLD_FILES+=usr/share/nls/ru_RU.CP866/tcsh.cat +OLD_DIRS+=usr/share/nls/ru_RU.ISO8859-5 OLD_FILES+=usr/share/nls/ru_RU.ISO8859-5/tcsh.cat +OLD_DIRS+=usr/share/nls/ru_RU.KOI8-R OLD_FILES+=usr/share/nls/ru_RU.KOI8-R/ee.cat +OLD_FILES+=usr/share/nls/ru_RU.KOI8-R/grep.cat OLD_FILES+=usr/share/nls/ru_RU.KOI8-R/libc.cat OLD_FILES+=usr/share/nls/ru_RU.KOI8-R/tcsh.cat +OLD_DIRS+=usr/share/nls/ru_RU.UTF-8 OLD_FILES+=usr/share/nls/ru_RU.UTF-8/tcsh.cat +OLD_DIRS+=usr/share/nls/sk_SK.ISO8859-2 OLD_FILES+=usr/share/nls/sk_SK.ISO8859-2/libc.cat +OLD_DIRS+=usr/share/nls/sk_SK.UTF-8 +OLD_DIRS+=usr/share/nls/sl_SI.ISO8859-2 +OLD_DIRS+=usr/share/nls/sl_SI.UTF-8 +OLD_DIRS+=usr/share/nls/sr_YU.ISO8859-2 +OLD_DIRS+=usr/share/nls/sr_YU.ISO8859-5 +OLD_DIRS+=usr/share/nls/sr_YU.UTF-8 +OLD_DIRS+=usr/share/nls/sv_SE.ISO8859-1 OLD_FILES+=usr/share/nls/sv_SE.ISO8859-1/libc.cat +OLD_DIRS+=usr/share/nls/sv_SE.ISO8859-15 +OLD_DIRS+=usr/share/nls/sv_SE.UTF-8 +OLD_DIRS+=usr/share/nls/tr_TR.ISO8859-9 +OLD_DIRS+=usr/share/nls/tr_TR.UTF-8 +OLD_DIRS+=usr/share/nls/uk_UA.ISO8859-5 OLD_FILES+=usr/share/nls/uk_UA.ISO8859-5/tcsh.cat +OLD_DIRS+=usr/share/nls/uk_UA.KOI8-U OLD_FILES+=usr/share/nls/uk_UA.KOI8-U/ee.cat OLD_FILES+=usr/share/nls/uk_UA.KOI8-U/tcsh.cat +OLD_DIRS+=usr/share/nls/uk_UA.UTF-8 +OLD_FILES+=usr/share/nls/uk_UA.UTF-8/grep.cat OLD_FILES+=usr/share/nls/uk_UA.UTF-8/libc.cat OLD_FILES+=usr/share/nls/uk_UA.UTF-8/tcsh.cat +OLD_DIRS+=usr/share/nls/zh_CN.GB18030 OLD_FILES+=usr/share/nls/zh_CN.GB18030/libc.cat +OLD_DIRS+=usr/share/nls/zh_CN.GBK +OLD_DIRS+=usr/share/nls/zh_CN.GB2312 OLD_FILES+=usr/share/nls/zh_CN.GB2312/libc.cat +OLD_DIRS+=usr/share/nls/zh_CN.UTF-8 +OLD_FILES+=usr/share/nls/zh_CN.UTF-8/grep.cat OLD_FILES+=usr/share/nls/zh_CN.UTF-8/libc.cat +OLD_DIRS+=usr/share/nls/zh_CN.eucCN +OLD_DIRS+=usr/share/nls/zh_HK.UTF-8 +OLD_DIRS+=usr/share/nls/zh_TW.UTF-8 OLD_FILES+=usr/tests/bin/sh/builtins/locale1.0 .endif From owner-svn-src-head@freebsd.org Tue Jun 12 19:36:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 057081016232; Tue, 12 Jun 2018 19:36:36 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA42775FBF; Tue, 12 Jun 2018 19:36:35 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 86E0C704E; Tue, 12 Jun 2018 19:36:35 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5CJaZtp086633; Tue, 12 Jun 2018 19:36:35 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5CJaXFs086620; Tue, 12 Jun 2018 19:36:33 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201806121936.w5CJaXFs086620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 12 Jun 2018 19:36:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335012 - in head/sys: fs/nfs fs/nfsclient fs/nfsserver nfs X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in head/sys: fs/nfs fs/nfsclient fs/nfsserver nfs X-SVN-Commit-Revision: 335012 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 19:36:36 -0000 Author: rmacklem Date: Tue Jun 12 19:36:32 2018 New Revision: 335012 URL: https://svnweb.freebsd.org/changeset/base/335012 Log: Merge the pNFS server code from projects/pnfs-planb-server into head. This code merge adds a pNFS service to the NFSv4.1 server. Although it is a large commit it should not affect behaviour for a non-pNFS NFS server. Some documentation on how this works can be found at: http://people.freebsd.org/~rmacklem/pnfs-planb-setup.txt and will hopefully be turned into a proper document soon. This is a merge of the kernel code. Userland and man page changes will come soon, once the dust settles on this merge. It has passed a "make universe", so I hope it will not cause build problems. It also adds NFSv4.1 server support for the "current stateid". Here is a brief overview of the pNFS service: A pNFS service separates the Read/Write oeprations from all the other NFSv4.1 Metadata operations. It is hoped that this separation allows a pNFS service to be configured that exceeds the limits of a single NFS server for either storage capacity and/or I/O bandwidth. It is possible to configure mirroring within the data servers (DSs) so that the data storage file for an MDS file will be mirrored on two or more of the DSs. When this is used, failure of a DS will not stop the pNFS service and a failed DS can be recovered once repaired while the pNFS service continues to operate. Although two way mirroring would be the norm, it is possible to set a mirroring level of up to four or the number of DSs, whichever is less. The Metadata server will always be a single point of failure, just as a single NFS server is. A Plan B pNFS service consists of a single MetaData Server (MDS) and K Data Servers (DS), all of which are recent FreeBSD systems. Clients will mount the MDS as they would a single NFS server. When files are created, the MDS creates a file tree identical to what a single NFS server creates, except that all the regular (VREG) files will be empty. As such, if you look at the exported tree on the MDS directly on the MDS server (not via an NFS mount), the files will all be of size 0. Each of these files will also have two extended attributes in the system attribute name space: pnfsd.dsfile - This extended attrbute stores the information that the MDS needs to find the data storage file(s) on DS(s) for this file. pnfsd.dsattr - This extended attribute stores the Size, AccessTime, ModifyTime and Change attributes for the file, so that the MDS doesn't need to acquire the attributes from the DS for every Getattr operation. For each regular (VREG) file, the MDS creates a data storage file on one (or more if mirroring is enabled) of the DSs in one of the "dsNN" subdirectories. The name of this file is the file handle of the file on the MDS in hexadecimal so that the name is unique. The DSs use subdirectories named "ds0" to "dsN" so that no one directory gets too large. The value of "N" is set via the sysctl vfs.nfsd.dsdirsize on the MDS, with the default being 20. For production servers that will store a lot of files, this value should probably be much larger. It can be increased when the "nfsd" daemon is not running on the MDS, once the "dsK" directories are created. For pNFS aware NFSv4.1 clients, the FreeBSD server will return two pieces of information to the client that allows it to do I/O directly to the DS. DeviceInfo - This is relatively static information that defines what a DS is. The critical bits of information returned by the FreeBSD server is the IP address of the DS and, for the Flexible File layout, that NFSv4.1 is to be used and that it is "tightly coupled". There is a "deviceid" which identifies the DeviceInfo. Layout - This is per file and can be recalled by the server when it is no longer valid. For the FreeBSD server, there is support for two types of layout, call File and Flexible File layout. Both allow the client to do I/O on the DS via NFSv4.1 I/O operations. The Flexible File layout is a more recent variant that allows specification of mirrors, where the client is expected to do writes to all mirrors to maintain them in a consistent state. The Flexible File layout also allows the client to report I/O errors for a DS back to the MDS. The Flexible File layout supports two variants referred to as "tightly coupled" vs "loosely coupled". The FreeBSD server always uses the "tightly coupled" variant where the client uses the same credentials to do I/O on the DS as it would on the MDS. For the "loosely coupled" variant, the layout specifies a synthetic user/group that the client uses to do I/O on the DS. The FreeBSD server does not do striping and always returns layouts for the entire file. The critical information in a layout is Read vs Read/Writea and DeviceID(s) that identify which DS(s) the data is stored on. At this time, the MDS generates File Layout layouts to NFSv4.1 clients that know how to do pNFS for the non-mirrored DS case unless the sysctl vfs.nfsd.default_flexfile is set non-zero, in which case Flexible File layouts are generated. The mirrored DS configuration always generates Flexible File layouts. For NFS clients that do not support NFSv4.1 pNFS, all I/O operations are done against the MDS which acts as a proxy for the appropriate DS(s). When the MDS receives an I/O RPC, it will do the RPC on the DS as a proxy. If the DS is on the same machine, the MDS/DS will do the RPC on the DS as a proxy and so on, until the machine runs out of some resource, such as session slots or mbufs. As such, DSs must be separate systems from the MDS. Tested by: james.rose@framestore.com Relnotes: yes Modified: head/sys/fs/nfs/nfs.h head/sys/fs/nfs/nfs_commonacl.c head/sys/fs/nfs/nfs_commonport.c head/sys/fs/nfs/nfs_commonsubs.c head/sys/fs/nfs/nfs_var.h head/sys/fs/nfs/nfsport.h head/sys/fs/nfs/nfsproto.h head/sys/fs/nfs/nfsrvstate.h head/sys/fs/nfsclient/nfs_clport.c head/sys/fs/nfsclient/nfs_clrpcops.c head/sys/fs/nfsclient/nfs_clstate.c head/sys/fs/nfsclient/nfs_clvfsops.c head/sys/fs/nfsserver/nfs_nfsdkrpc.c head/sys/fs/nfsserver/nfs_nfsdport.c head/sys/fs/nfsserver/nfs_nfsdserv.c head/sys/fs/nfsserver/nfs_nfsdsocket.c head/sys/fs/nfsserver/nfs_nfsdstate.c head/sys/fs/nfsserver/nfs_nfsdsubs.c head/sys/nfs/nfs_nfssvc.c head/sys/nfs/nfssvc.h Modified: head/sys/fs/nfs/nfs.h ============================================================================== --- head/sys/fs/nfs/nfs.h Tue Jun 12 19:26:25 2018 (r335011) +++ head/sys/fs/nfs/nfs.h Tue Jun 12 19:36:32 2018 (r335012) @@ -98,6 +98,7 @@ #define NFSSESSIONHASHSIZE 20 /* Size of server session hash table */ #endif #define NFSSTATEHASHSIZE 10 /* Size of server stateid hash table */ +#define NFSLAYOUTHIGHWATER 1000000 /* Upper limit for # of layouts */ #ifndef NFSCLDELEGHIGHWATER #define NFSCLDELEGHIGHWATER 10000 /* limit for client delegations */ #endif @@ -171,11 +172,20 @@ struct nfsd_addsock_args { /* * nfsd argument for new krpc. + * (New version supports pNFS, indicated by NFSSVC_NEWSTRUCT flag.) */ struct nfsd_nfsd_args { const char *principal; /* GSS-API service principal name */ int minthreads; /* minimum service thread count */ int maxthreads; /* maximum service thread count */ + int version; /* Allow multiple variants */ + char *addr; /* pNFS DS addresses */ + int addrlen; /* Length of addrs */ + char *dnshost; /* DNS names for DS addresses */ + int dnshostlen; /* Length of DNS names */ + char *dspath; /* DS Mount path on MDS */ + int dspathlen; /* Length of DS Mount path on MDS */ + int mirrorcnt; /* Number of mirrors to create on DSs */ }; /* @@ -186,6 +196,23 @@ struct nfsd_nfsd_args { #define NFSDEV_MAXMIRRORS 4 #define NFSDEV_MAXVERS 4 +struct nfsd_pnfsd_args { + int op; /* Which pNFSd op to perform. */ + char *mdspath; /* Path of MDS file. */ + char *dspath; /* Path of recovered DS mounted on dir. */ + char *curdspath; /* Path of current DS mounted on dir. */ +}; + +#define PNFSDOP_DELDSSERVER 1 +#define PNFSDOP_COPYMR 2 + +/* Old version. */ +struct nfsd_nfsd_oargs { + const char *principal; /* GSS-API service principal name */ + int minthreads; /* minimum service thread count */ + int maxthreads; /* maximum service thread count */ +}; + /* * Arguments for use by the callback daemon. */ @@ -593,8 +620,8 @@ struct nfsrv_descript { NFSSOCKADDR_T nd_nam2; /* return socket addr */ caddr_t nd_dpos; /* Current dissect pos */ caddr_t nd_bpos; /* Current build pos */ + u_int64_t nd_flag; /* nd_flag */ u_int16_t nd_procnum; /* RPC # */ - u_int32_t nd_flag; /* nd_flag */ u_int32_t nd_repstat; /* Reply status */ int *nd_errp; /* Pointer to ret status */ u_int32_t nd_retxid; /* Reply xid */ @@ -613,6 +640,8 @@ struct nfsrv_descript { uint32_t nd_slotid; /* Slotid for this RPC */ SVCXPRT *nd_xprt; /* Server RPC handle */ uint32_t *nd_sequence; /* Sequence Op. ptr */ + nfsv4stateid_t nd_curstateid; /* Current StateID */ + nfsv4stateid_t nd_savedcurstateid; /* Saved Current StateID */ }; #define nd_princlen nd_gssnamelen @@ -649,6 +678,9 @@ struct nfsrv_descript { #define ND_CACHETHIS 0x08000000 #define ND_LASTOP 0x10000000 #define ND_LOOPBADSESS 0x20000000 +#define ND_DSSERVER 0x40000000 +#define ND_CURSTATEID 0x80000000 +#define ND_SAVEDCURSTATEID 0x100000000 /* * ND_GSS should be the "or" of all GSS type authentications. Modified: head/sys/fs/nfs/nfs_commonacl.c ============================================================================== --- head/sys/fs/nfs/nfs_commonacl.c Tue Jun 12 19:26:25 2018 (r335011) +++ head/sys/fs/nfs/nfs_commonacl.c Tue Jun 12 19:36:32 2018 (r335012) @@ -450,36 +450,6 @@ nfsrv_buildacl(struct nfsrv_descript *nd, NFSACL_T *ac } /* - * Set an NFSv4 acl. - */ -APPLESTATIC int -nfsrv_setacl(vnode_t vp, NFSACL_T *aclp, struct ucred *cred, - NFSPROC_T *p) -{ - int error; - - if (nfsrv_useacl == 0 || nfs_supportsnfsv4acls(vp) == 0) { - error = NFSERR_ATTRNOTSUPP; - goto out; - } - /* - * With NFSv4 ACLs, chmod(2) may need to add additional entries. - * Make sure it has enough room for that - splitting every entry - * into two and appending "canonical six" entries at the end. - * Cribbed out of kern/vfs_acl.c - Rick M. - */ - if (aclp->acl_cnt > (ACL_MAX_ENTRIES - 6) / 2) { - error = NFSERR_ATTRNOTSUPP; - goto out; - } - error = VOP_SETACL(vp, ACL_TYPE_NFS4, aclp, cred, p); - -out: - NFSEXITCODE(error); - return (error); -} - -/* * Compare two NFSv4 acls. * Return 0 if they are the same, 1 if not the same. */ Modified: head/sys/fs/nfs/nfs_commonport.c ============================================================================== --- head/sys/fs/nfs/nfs_commonport.c Tue Jun 12 19:26:25 2018 (r335011) +++ head/sys/fs/nfs/nfs_commonport.c Tue Jun 12 19:36:32 2018 (r335012) @@ -69,6 +69,9 @@ int nfscl_debuglevel = 0; char nfsv4_callbackaddr[INET6_ADDRSTRLEN]; struct callout newnfsd_callout; int nfsrv_lughashsize = 100; +struct mtx nfsrv_dslock_mtx; +struct nfsdevicehead nfsrv_devidhead; +volatile int nfsrv_devidcnt = 0; void (*nfsd_call_servertimer)(void) = NULL; void (*ncl_call_invalcaches)(struct vnode *) = NULL; @@ -768,6 +771,8 @@ nfscommon_modevent(module_t mod, int type, void *data) mtx_init(&nfs_req_mutex, "nfs_req_mutex", NULL, MTX_DEF); mtx_init(&nfsrv_nfsuserdsock.nr_mtx, "nfsuserd", NULL, MTX_DEF); + mtx_init(&nfsrv_dslock_mtx, "nfs4ds", NULL, MTX_DEF); + TAILQ_INIT(&nfsrv_devidhead); callout_init(&newnfsd_callout, 1); newnfs_init(); nfsd_call_nfscommon = nfssvc_nfscommon; @@ -794,6 +799,7 @@ nfscommon_modevent(module_t mod, int type, void *data) mtx_destroy(&nfs_slock_mutex); mtx_destroy(&nfs_req_mutex); mtx_destroy(&nfsrv_nfsuserdsock.nr_mtx); + mtx_destroy(&nfsrv_dslock_mtx); loaded = 0; break; default: Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Tue Jun 12 19:26:25 2018 (r335011) +++ head/sys/fs/nfs/nfs_commonsubs.c Tue Jun 12 19:36:32 2018 (r335012) @@ -70,15 +70,24 @@ gid_t nfsrv_defaultgid = GID_NOGROUP; int nfsrv_lease = NFSRV_LEASE; int ncl_mbuf_mlen = MLEN; int nfsd_enable_stringtouid = 0; +int nfsrv_doflexfile = 0; static int nfs_enable_uidtostring = 0; NFSNAMEIDMUTEX; NFSSOCKMUTEX; extern int nfsrv_lughashsize; +extern struct mtx nfsrv_dslock_mtx; +extern volatile int nfsrv_devidcnt; +extern int nfscl_debuglevel; +extern struct nfsdevicehead nfsrv_devidhead; SYSCTL_DECL(_vfs_nfs); SYSCTL_INT(_vfs_nfs, OID_AUTO, enable_uidtostring, CTLFLAG_RW, &nfs_enable_uidtostring, 0, "Make nfs always send numeric owner_names"); +int nfsrv_maxpnfsmirror = 1; +SYSCTL_INT(_vfs_nfs, OID_AUTO, pnfsmirror, CTLFLAG_RD, + &nfsrv_maxpnfsmirror, 0, "Mirror level for pNFS service"); + /* * This array of structures indicates, for V4: * retfh - which of 3 types of calling args are used @@ -487,7 +496,7 @@ nfsm_fhtom(struct nfsrv_descript *nd, u_int8_t *fhp, i { u_int32_t *tl; u_int8_t *cp; - int fullsiz, bytesize = 0; + int fullsiz, rem, bytesize = 0; if (size == 0) size = NFSX_MYFH; @@ -504,6 +513,7 @@ nfsm_fhtom(struct nfsrv_descript *nd, u_int8_t *fhp, i case ND_NFSV3: case ND_NFSV4: fullsiz = NFSM_RNDUP(size); + rem = fullsiz - size; if (set_true) { bytesize = 2 * NFSX_UNSIGNED + fullsiz; NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); @@ -1768,6 +1778,40 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp, } attrsum += cnt; break; + case NFSATTRBIT_FSLAYOUTTYPE: + case NFSATTRBIT_LAYOUTTYPE: + NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); + attrsum += NFSX_UNSIGNED; + i = fxdr_unsigned(int, *tl); + if (i > 0) { + NFSM_DISSECT(tl, u_int32_t *, i * + NFSX_UNSIGNED); + attrsum += i * NFSX_UNSIGNED; + j = fxdr_unsigned(int, *tl); + if (i == 1 && compare && !(*retcmpp) && + (((nfsrv_doflexfile != 0 || + nfsrv_maxpnfsmirror > 1) && + j != NFSLAYOUT_FLEXFILE) || + (nfsrv_doflexfile == 0 && + j != NFSLAYOUT_NFSV4_1_FILES))) + *retcmpp = NFSERR_NOTSAME; + } + if (nfsrv_devidcnt == 0) { + if (compare && !(*retcmpp) && i > 0) + *retcmpp = NFSERR_NOTSAME; + } else { + if (compare && !(*retcmpp) && i != 1) + *retcmpp = NFSERR_NOTSAME; + } + break; + case NFSATTRBIT_LAYOUTALIGNMENT: + case NFSATTRBIT_LAYOUTBLKSIZE: + NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); + attrsum += NFSX_UNSIGNED; + i = fxdr_unsigned(int, *tl); + if (compare && !(*retcmpp) && i != NFS_SRVMAXIO) + *retcmpp = NFSERR_NOTSAME; + break; default: printf("EEK! nfsv4_loadattr unknown attr=%d\n", bitpos); @@ -2024,7 +2068,8 @@ APPLESTATIC int nfsv4_fillattr(struct nfsrv_descript *nd, struct mount *mp, vnode_t vp, NFSACL_T *saclp, struct vattr *vap, fhandle_t *fhp, int rderror, nfsattrbit_t *attrbitp, struct ucred *cred, NFSPROC_T *p, int isdgram, - int reterr, int supports_nfsv4acls, int at_root, uint64_t mounted_on_fileno) + int reterr, int supports_nfsv4acls, int at_root, uint64_t mounted_on_fileno, + struct statfs *pnfssf) { int bitpos, retnum = 0; u_int32_t *tl; @@ -2426,25 +2471,45 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount break; case NFSATTRBIT_SPACEAVAIL: NFSM_BUILD(tl, u_int32_t *, NFSX_HYPER); - if (priv_check_cred(cred, PRIV_VFS_BLOCKRESERVE, 0)) - uquad = (u_int64_t)fs->f_bfree; + if (priv_check_cred(cred, PRIV_VFS_BLOCKRESERVE, 0)) { + if (pnfssf != NULL) + uquad = (u_int64_t)pnfssf->f_bfree; + else + uquad = (u_int64_t)fs->f_bfree; + } else { + if (pnfssf != NULL) + uquad = (u_int64_t)pnfssf->f_bavail; + else + uquad = (u_int64_t)fs->f_bavail; + } + if (pnfssf != NULL) + uquad *= pnfssf->f_bsize; else - uquad = (u_int64_t)fs->f_bavail; - uquad *= fs->f_bsize; + uquad *= fs->f_bsize; txdr_hyper(uquad, tl); retnum += NFSX_HYPER; break; case NFSATTRBIT_SPACEFREE: NFSM_BUILD(tl, u_int32_t *, NFSX_HYPER); - uquad = (u_int64_t)fs->f_bfree; - uquad *= fs->f_bsize; + if (pnfssf != NULL) { + uquad = (u_int64_t)pnfssf->f_bfree; + uquad *= pnfssf->f_bsize; + } else { + uquad = (u_int64_t)fs->f_bfree; + uquad *= fs->f_bsize; + } txdr_hyper(uquad, tl); retnum += NFSX_HYPER; break; case NFSATTRBIT_SPACETOTAL: NFSM_BUILD(tl, u_int32_t *, NFSX_HYPER); - uquad = (u_int64_t)fs->f_blocks; - uquad *= fs->f_bsize; + if (pnfssf != NULL) { + uquad = (u_int64_t)pnfssf->f_blocks; + uquad *= pnfssf->f_bsize; + } else { + uquad = (u_int64_t)fs->f_blocks; + uquad *= fs->f_bsize; + } txdr_hyper(uquad, tl); retnum += NFSX_HYPER; break; @@ -2514,6 +2579,33 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount NFSCLRBIT_ATTRBIT(&attrbits, NFSATTRBIT_TIMEACCESSSET); retnum += nfsrv_putattrbit(nd, &attrbits); break; + case NFSATTRBIT_FSLAYOUTTYPE: + case NFSATTRBIT_LAYOUTTYPE: + if (nfsrv_devidcnt == 0) + siz = 1; + else + siz = 2; + if (siz == 2) { + NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); + *tl++ = txdr_unsigned(1); /* One entry. */ + if (nfsrv_doflexfile != 0 || + nfsrv_maxpnfsmirror > 1) + *tl = txdr_unsigned(NFSLAYOUT_FLEXFILE); + else + *tl = txdr_unsigned( + NFSLAYOUT_NFSV4_1_FILES); + } else { + NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); + *tl = 0; + } + retnum += siz * NFSX_UNSIGNED; + break; + case NFSATTRBIT_LAYOUTALIGNMENT: + case NFSATTRBIT_LAYOUTBLKSIZE: + NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); + *tl = txdr_unsigned(NFS_SRVMAXIO); + retnum += NFSX_UNSIGNED; + break; default: printf("EEK! Bad V4 attribute bitpos=%d\n", bitpos); } @@ -4238,5 +4330,40 @@ nfsv4_freeslot(struct nfsclsession *sep, int slot) sep->nfsess_slots &= ~bitval; wakeup(&sep->nfsess_slots); mtx_unlock(&sep->nfsess_mtx); +} + +/* + * Search for a matching pnfsd mirror device structure, base on the nmp arg. + * Return one if found, NULL otherwise. + */ +struct nfsdevice * +nfsv4_findmirror(struct nfsmount *nmp) +{ + struct nfsdevice *ds, *fndds; + int fndmirror; + + mtx_assert(NFSDDSMUTEXPTR, MA_OWNED); + /* + * Search the DS server list for a match with nmp. + * Remove the DS entry if found and there is a mirror. + */ + fndds = NULL; + fndmirror = 0; + if (nfsrv_devidcnt == 0) + return (fndds); + TAILQ_FOREACH(ds, &nfsrv_devidhead, nfsdev_list) { + if (ds->nfsdev_nmp == nmp) { + NFSCL_DEBUG(4, "fnd main ds\n"); + fndds = ds; + } else if (ds->nfsdev_nmp != NULL) + fndmirror = 1; + if (fndds != NULL && fndmirror != 0) + break; + } + if (fndmirror == 0) { + NFSCL_DEBUG(4, "no mirror for DS\n"); + return (NULL); + } + return (fndds); } Modified: head/sys/fs/nfs/nfs_var.h ============================================================================== --- head/sys/fs/nfs/nfs_var.h Tue Jun 12 19:26:25 2018 (r335011) +++ head/sys/fs/nfs/nfs_var.h Tue Jun 12 19:36:32 2018 (r335012) @@ -63,6 +63,7 @@ union nethostaddr; struct nfsstate; struct nfslock; struct nfsclient; +struct nfslayout; struct nfsdsession; struct nfslockconflict; struct nfsd_idargs; @@ -82,6 +83,9 @@ struct nfsv4lock; struct nfsvattr; struct nfs_vattr; struct NFSSVCARGS; +struct nfsdevice; +struct pnfsdsfile; +struct pnfsdsattr; #ifdef __FreeBSD__ NFS_ACCESS_ARGS; NFS_OPEN_ARGS; @@ -112,9 +116,9 @@ int nfsrv_openctrl(struct nfsrv_descript *, vnode_t, int nfsrv_opencheck(nfsquad_t, nfsv4stateid_t *, struct nfsstate *, vnode_t, struct nfsrv_descript *, NFSPROC_T *, int); int nfsrv_openupdate(vnode_t, struct nfsstate *, nfsquad_t, - nfsv4stateid_t *, struct nfsrv_descript *, NFSPROC_T *); + nfsv4stateid_t *, struct nfsrv_descript *, NFSPROC_T *, int *); int nfsrv_delegupdate(struct nfsrv_descript *, nfsquad_t, nfsv4stateid_t *, - vnode_t, int, struct ucred *, NFSPROC_T *); + vnode_t, int, struct ucred *, NFSPROC_T *, int *); int nfsrv_releaselckown(struct nfsstate *, nfsquad_t, NFSPROC_T *); void nfsrv_zapclient(struct nfsclient *, NFSPROC_T *); int nfssvc_idname(struct nfsd_idargs *); @@ -131,7 +135,7 @@ int nfsrv_checksetattr(vnode_t, struct nfsrv_descript nfsv4stateid_t *, struct nfsvattr *, nfsattrbit_t *, struct nfsexstuff *, NFSPROC_T *); int nfsrv_checkgetattr(struct nfsrv_descript *, vnode_t, - struct nfsvattr *, nfsattrbit_t *, struct ucred *, NFSPROC_T *); + struct nfsvattr *, nfsattrbit_t *, NFSPROC_T *); int nfsrv_nfsuserdport(struct sockaddr *, u_short, NFSPROC_T *); void nfsrv_nfsuserddelport(void); void nfsrv_throwawayallstate(NFSPROC_T *); @@ -140,6 +144,30 @@ int nfsrv_checksequence(struct nfsrv_descript *, uint3 int nfsrv_checkreclaimcomplete(struct nfsrv_descript *); void nfsrv_cache_session(uint8_t *, uint32_t, int, struct mbuf **); void nfsrv_freeallbackchannel_xprts(void); +int nfsrv_layoutcommit(struct nfsrv_descript *, vnode_t, int, int, uint64_t, + uint64_t, uint64_t, int, struct timespec *, int, nfsv4stateid_t *, + int, char *, int *, uint64_t *, struct ucred *, NFSPROC_T *); +int nfsrv_layoutget(struct nfsrv_descript *, vnode_t, struct nfsexstuff *, + int, int *, uint64_t *, uint64_t *, uint64_t, nfsv4stateid_t *, int, int *, + int *, char *, struct ucred *, NFSPROC_T *); +void nfsrv_flexmirrordel(char *, NFSPROC_T *); +void nfsrv_recalloldlayout(NFSPROC_T *); +int nfsrv_layoutreturn(struct nfsrv_descript *, vnode_t, int, int, uint64_t, + uint64_t, int, int, nfsv4stateid_t *, int, uint32_t *, int *, + struct ucred *, NFSPROC_T *); +int nfsrv_getdevinfo(char *, int, uint32_t *, uint32_t *, int *, char **); +void nfsrv_freeonedevid(struct nfsdevice *); +void nfsrv_freealllayoutsanddevids(void); +void nfsrv_freefilelayouts(fhandle_t *); +int nfsrv_deldsserver(char *, NFSPROC_T *); +struct nfsdevice *nfsrv_deldsnmp(struct nfsmount *, NFSPROC_T *); +int nfsrv_createdevids(struct nfsd_nfsd_args *, NFSPROC_T *); +int nfsrv_checkdsattr(struct nfsrv_descript *, vnode_t, NFSPROC_T *); +int nfsrv_copymr(vnode_t, vnode_t, vnode_t, struct nfsdevice *, + struct pnfsdsfile *, struct pnfsdsfile *, int, struct ucred *, NFSPROC_T *); +int nfsrv_mdscopymr(char *, char *, char *, char *, int *, char *, NFSPROC_T *, + struct vnode **, struct vnode **, struct pnfsdsfile **, struct nfsdevice **, + struct nfsdevice **); /* nfs_nfsdserv.c */ int nfsrvd_access(struct nfsrv_descript *, int, @@ -240,6 +268,14 @@ int nfsrvd_destroysession(struct nfsrv_descript *, int vnode_t, NFSPROC_T *, struct nfsexstuff *); int nfsrvd_freestateid(struct nfsrv_descript *, int, vnode_t, NFSPROC_T *, struct nfsexstuff *); +int nfsrvd_layoutget(struct nfsrv_descript *, int, + vnode_t, NFSPROC_T *, struct nfsexstuff *); +int nfsrvd_getdevinfo(struct nfsrv_descript *, int, + vnode_t, NFSPROC_T *, struct nfsexstuff *); +int nfsrvd_layoutcommit(struct nfsrv_descript *, int, + vnode_t, NFSPROC_T *, struct nfsexstuff *); +int nfsrvd_layoutreturn(struct nfsrv_descript *, int, + vnode_t, NFSPROC_T *, struct nfsexstuff *); int nfsrvd_teststateid(struct nfsrv_descript *, int, vnode_t, NFSPROC_T *, struct nfsexstuff *); int nfsrvd_notsupp(struct nfsrv_descript *, int, @@ -306,6 +342,7 @@ int nfsv4_sequencelookup(struct nfsmount *, struct nfs int *, uint32_t *, uint8_t *); void nfsv4_freeslot(struct nfsclsession *, int); struct ucred *nfsrv_getgrpscred(struct ucred *); +struct nfsdevice *nfsv4_findmirror(struct nfsmount *); /* nfs_clcomsubs.c */ void nfsm_uiombuf(struct nfsrv_descript *, struct uio *, int); @@ -339,7 +376,7 @@ void nfsrv_wcc(struct nfsrv_descript *, int, struct nf struct nfsvattr *); int nfsv4_fillattr(struct nfsrv_descript *, struct mount *, vnode_t, NFSACL_T *, struct vattr *, fhandle_t *, int, nfsattrbit_t *, - struct ucred *, NFSPROC_T *, int, int, int, int, uint64_t); + struct ucred *, NFSPROC_T *, int, int, int, int, uint64_t, struct statfs *); void nfsrv_fillattr(struct nfsrv_descript *, struct nfsvattr *); void nfsrv_adj(mbuf_t, int, int); void nfsrv_postopattr(struct nfsrv_descript *, int, struct nfsvattr *); @@ -387,8 +424,6 @@ int nfsrv_dissectace(struct nfsrv_descript *, struct a int *, int *, NFSPROC_T *); int nfsrv_buildacl(struct nfsrv_descript *, NFSACL_T *, enum vtype, NFSPROC_T *); -int nfsrv_setacl(vnode_t, NFSACL_T *, struct ucred *, - NFSPROC_T *); int nfsrv_compareacl(NFSACL_T *, NFSACL_T *); /* nfs_clrpcops.c */ @@ -603,8 +638,8 @@ int ncl_flush(vnode_t, int, NFSPROC_T *, int, int); void ncl_invalcaches(vnode_t); /* nfs_nfsdport.c */ -int nfsvno_getattr(vnode_t, struct nfsvattr *, struct ucred *, - NFSPROC_T *, int); +int nfsvno_getattr(vnode_t, struct nfsvattr *, struct nfsrv_descript *, + NFSPROC_T *, int, nfsattrbit_t *); int nfsvno_setattr(vnode_t, struct nfsvattr *, struct ucred *, NFSPROC_T *, struct nfsexstuff *); int nfsvno_getfh(vnode_t, fhandle_t *, NFSPROC_T *); @@ -618,7 +653,7 @@ int nfsvno_readlink(vnode_t, struct ucred *, NFSPROC_T mbuf_t *, int *); int nfsvno_read(vnode_t, off_t, int, struct ucred *, NFSPROC_T *, mbuf_t *, mbuf_t *); -int nfsvno_write(vnode_t, off_t, int, int, int, mbuf_t, +int nfsvno_write(vnode_t, off_t, int, int, int *, mbuf_t, char *, struct ucred *, NFSPROC_T *); int nfsvno_createsub(struct nfsrv_descript *, struct nameidata *, vnode_t *, struct nfsvattr *, int *, int32_t *, NFSDEV_T, NFSPROC_T *, @@ -647,7 +682,7 @@ void nfsvno_open(struct nfsrv_descript *, struct namei nfsv4stateid_t *, struct nfsstate *, int *, struct nfsvattr *, int32_t *, int, NFSACL_T *, nfsattrbit_t *, struct ucred *, NFSPROC_T *, struct nfsexstuff *, vnode_t *); -int nfsvno_updfilerev(vnode_t, struct nfsvattr *, struct ucred *, +int nfsvno_updfilerev(vnode_t, struct nfsvattr *, struct nfsrv_descript *, NFSPROC_T *); int nfsvno_fillattr(struct nfsrv_descript *, struct mount *, vnode_t, struct nfsvattr *, fhandle_t *, int, nfsattrbit_t *, @@ -667,6 +702,17 @@ int nfsvno_testexp(struct nfsrv_descript *, struct nfs uint32_t nfsrv_hashfh(fhandle_t *); uint32_t nfsrv_hashsessionid(uint8_t *); void nfsrv_backupstable(void); +int nfsrv_dsgetdevandfh(struct vnode *, NFSPROC_T *, int *, fhandle_t *, + char *); +int nfsrv_dsgetsockmnt(struct vnode *, int, char *, int *, int *, + NFSPROC_T *, struct vnode **, fhandle_t *, char *, char *, + struct vnode **, struct nfsmount **, struct nfsmount *, int *, int *); +int nfsrv_dscreate(struct vnode *, struct vattr *, struct vattr *, + fhandle_t *, struct pnfsdsfile *, struct pnfsdsattr *, char *, + struct ucred *, NFSPROC_T *, struct vnode **); +int nfsrv_updatemdsattr(struct vnode *, struct nfsvattr *, NFSPROC_T *); +void nfsrv_killrpcs(struct nfsmount *); +int nfsrv_setacl(struct vnode *, NFSACL_T *, struct ucred *, NFSPROC_T *); /* nfs_commonkrpc.c */ int newnfs_nmcancelreqs(struct nfsmount *); Modified: head/sys/fs/nfs/nfsport.h ============================================================================== --- head/sys/fs/nfs/nfsport.h Tue Jun 12 19:26:25 2018 (r335011) +++ head/sys/fs/nfs/nfsport.h Tue Jun 12 19:36:32 2018 (r335012) @@ -701,10 +701,18 @@ void nfsrvd_rcv(struct socket *, void *, int); #define NFSSESSIONMUTEXPTR(s) (&((s)->mtx)) #define NFSLOCKSESSION(s) mtx_lock(&((s)->mtx)) #define NFSUNLOCKSESSION(s) mtx_unlock(&((s)->mtx)) +#define NFSLAYOUTMUTEXPTR(l) (&((l)->mtx)) #define NFSLOCKLAYOUT(l) mtx_lock(&((l)->mtx)) #define NFSUNLOCKLAYOUT(l) mtx_unlock(&((l)->mtx)) +#define NFSDDSMUTEXPTR (&nfsrv_dslock_mtx) #define NFSDDSLOCK() mtx_lock(&nfsrv_dslock_mtx) #define NFSDDSUNLOCK() mtx_unlock(&nfsrv_dslock_mtx) +#define NFSDDONTLISTMUTEXPTR (&nfsrv_dontlistlock_mtx) +#define NFSDDONTLISTLOCK() mtx_lock(&nfsrv_dontlistlock_mtx) +#define NFSDDONTLISTUNLOCK() mtx_unlock(&nfsrv_dontlistlock_mtx) +#define NFSDRECALLMUTEXPTR (&nfsrv_recalllock_mtx) +#define NFSDRECALLLOCK() mtx_lock(&nfsrv_recalllock_mtx) +#define NFSDRECALLUNLOCK() mtx_unlock(&nfsrv_recalllock_mtx) /* * Use these macros to initialize/free a mutex. @@ -1036,6 +1044,15 @@ struct nfsreq { * used in both places that call getnewvnode(). */ extern const char nfs_vnode_tag[]; + +/* + * Check for the errors that indicate a DS should be disabled. + * ENXIO indicates that the krpc cannot do an RPC on the DS. + * EIO is returned by the RPC as an indication of I/O problems on the + * server. + * Are there other fatal errors? + */ +#define nfsds_failerr(e) ((e) == ENXIO || (e) == EIO) #endif /* _KERNEL */ Modified: head/sys/fs/nfs/nfsproto.h ============================================================================== --- head/sys/fs/nfs/nfsproto.h Tue Jun 12 19:26:25 2018 (r335011) +++ head/sys/fs/nfs/nfsproto.h Tue Jun 12 19:36:32 2018 (r335012) @@ -260,6 +260,12 @@ #define NFSX_V4SETTIME (NFSX_UNSIGNED + NFSX_V4TIME) #define NFSX_V4SESSIONID 16 #define NFSX_V4DEVICEID 16 +#define NFSX_V4PNFSFH (sizeof(fhandle_t) + 1) +#define NFSX_V4FILELAYOUT (4 * NFSX_UNSIGNED + NFSX_V4DEVICEID + \ + NFSX_HYPER + NFSM_RNDUP(NFSX_V4PNFSFH)) +#define NFSX_V4FLEXLAYOUT(m) (NFSX_HYPER + 3 * NFSX_UNSIGNED + \ + ((m) * (NFSX_V4DEVICEID + NFSX_STATEID + NFSM_RNDUP(NFSX_V4PNFSFH) + \ + 8 * NFSX_UNSIGNED))) /* sizes common to multiple NFS versions */ #define NFSX_FHMAX (NFSX_V4FHMAX) @@ -272,6 +278,11 @@ /* variants for multiple versions */ #define NFSX_STATFS(v3) ((v3) ? NFSX_V3STATFS : NFSX_V2STATFS) +/* + * Beware. NFSPROC_NULL and friends are defined in + * as well and the numbers are different. + */ +#ifndef NFSPROC_NULL /* nfs rpc procedure numbers (before version mapping) */ #define NFSPROC_NULL 0 #define NFSPROC_GETATTR 1 @@ -295,6 +306,7 @@ #define NFSPROC_FSINFO 19 #define NFSPROC_PATHCONF 20 #define NFSPROC_COMMIT 21 +#endif /* NFSPROC_NULL */ /* * The lower numbers -> 21 are used by NFSv2 and v3. These define higher @@ -652,6 +664,7 @@ /* Flags for File Layout. */ #define NFSFLAYUTIL_DENSE 0x1 #define NFSFLAYUTIL_COMMIT_THRU_MDS 0x2 +#define NFSFLAYUTIL_STRIPE_MASK 0xffffffc0 /* Flags for Flex File Layout. */ #define NFSFLEXFLAG_NO_LAYOUTCOMMIT 0x00000001 @@ -668,6 +681,7 @@ #define NFSCDFS4_BACK 0x2 #define NFSCDFS4_BOTH 0x3 +#if defined(_KERNEL) || defined(KERNEL) /* Conversion macros */ #define vtonfsv2_mode(t,m) \ txdr_unsigned(((t) == VFIFO) ? MAKEIMODE(VCHR, (m)) : \ @@ -819,6 +833,7 @@ struct nfsv3_sattr { u_int32_t sa_mtimetype; nfstime3 sa_mtime; }; +#endif /* _KERNEL */ /* * The attribute bits used for V4. @@ -1046,7 +1061,8 @@ struct nfsv3_sattr { NFSATTRBM_MOUNTEDONFILEID | \ NFSATTRBM_QUOTAHARD | \ NFSATTRBM_QUOTASOFT | \ - NFSATTRBM_QUOTAUSED) + NFSATTRBM_QUOTAUSED | \ + NFSATTRBM_FSLAYOUTTYPE) #ifdef QUOTA @@ -1062,7 +1078,11 @@ struct nfsv3_sattr { #define NFSATTRBIT_SUPP1 NFSATTRBIT_S1 #endif -#define NFSATTRBIT_SUPP2 NFSATTRBM_SUPPATTREXCLCREAT +#define NFSATTRBIT_SUPP2 \ + (NFSATTRBM_LAYOUTTYPE | \ + NFSATTRBM_LAYOUTBLKSIZE | \ + NFSATTRBM_LAYOUTALIGNMENT | \ + NFSATTRBM_SUPPATTREXCLCREAT) /* * NFSATTRBIT_SUPPSETONLY is the OR of NFSATTRBIT_TIMEACCESSSET and @@ -1378,5 +1398,15 @@ struct nfsv4stateid { u_int32_t other[NFSX_STATEIDOTHER / NFSX_UNSIGNED]; }; typedef struct nfsv4stateid nfsv4stateid_t; + +/* Notify bits and notify bitmap size. */ +#define NFSV4NOTIFY_CHANGE 1 +#define NFSV4NOTIFY_DELETE 2 +#define NFSV4_NOTIFYBITMAP 1 /* # of 32bit values needed for bits */ + +/* Layoutreturn kinds. */ +#define NFSV4LAYOUTRET_FILE 1 +#define NFSV4LAYOUTRET_FSID 2 +#define NFSV4LAYOUTRET_ALL 3 #endif /* _NFS_NFSPROTO_H_ */ Modified: head/sys/fs/nfs/nfsrvstate.h ============================================================================== --- head/sys/fs/nfs/nfsrvstate.h Tue Jun 12 19:26:25 2018 (r335011) +++ head/sys/fs/nfs/nfsrvstate.h Tue Jun 12 19:36:32 2018 (r335012) @@ -31,6 +31,7 @@ #ifndef _NFS_NFSRVSTATE_H_ #define _NFS_NFSRVSTATE_H_ +#if defined(_KERNEL) || defined(KERNEL) /* * Definitions for NFS V4 server state handling. */ @@ -46,6 +47,10 @@ LIST_HEAD(nfslockhead, nfslock); LIST_HEAD(nfslockhashhead, nfslockfile); LIST_HEAD(nfssessionhead, nfsdsession); LIST_HEAD(nfssessionhashhead, nfsdsession); +TAILQ_HEAD(nfslayouthead, nfslayout); +SLIST_HEAD(nfsdsdirhead, nfsdsdir); +TAILQ_HEAD(nfsdevicehead, nfsdevice); +LIST_HEAD(nfsdontlisthead, nfsdontlist); /* * List head for nfsusrgrp. @@ -74,6 +79,13 @@ struct nfssessionhash { #define NFSSESSIONHASH(f) \ (&nfssessionhash[nfsrv_hashsessionid(f) % nfsrv_sessionhashsize]) +struct nfslayouthash { + struct mtx mtx; + struct nfslayouthead list; +}; +#define NFSLAYOUTHASH(f) \ + (&nfslayouthash[nfsrv_hashfh(f) % nfsrv_layouthashsize]) + /* * Client server structure for V4. It is doubly linked into two lists. * The first is a hash table based on the clientid and the second is a @@ -112,6 +124,31 @@ struct nfsclient { #define CLOPS_RENEWOP 0x0004 /* + * Structure for NFSv4.1 Layouts. + * Malloc'd to correct size for the lay_xdr. + */ +struct nfslayout { + TAILQ_ENTRY(nfslayout) lay_list; + nfsv4stateid_t lay_stateid; + nfsquad_t lay_clientid; + fhandle_t lay_fh; + fsid_t lay_fsid; + uint32_t lay_layoutlen; + uint16_t lay_mirrorcnt; + uint16_t lay_trycnt; + uint16_t lay_type; + uint16_t lay_flags; + uint32_t lay_xdr[0]; +}; + +/* Flags for lay_flags. */ +#define NFSLAY_READ 0x0001 +#define NFSLAY_RW 0x0002 +#define NFSLAY_RECALL 0x0004 +#define NFSLAY_RETURNED 0x0008 +#define NFSLAY_CALLB 0x0010 + +/* * Structure for an NFSv4.1 session. * Locking rules for this structure. * To add/delete one of these structures from the lists, you must lock @@ -290,9 +327,72 @@ struct nfsf_rec { u_int32_t numboots; /* Number of boottimes */ }; -#if defined(_KERNEL) || defined(KERNEL) void nfsrv_cleanclient(struct nfsclient *, NFSPROC_T *); void nfsrv_freedeleglist(struct nfsstatehead *); -#endif + +/* + * This structure is used to create the list of device info entries for + * a GetDeviceInfo operation and stores the DS server info. + * The nfsdev_addrandhost field has the fully qualified host domain name + * followed by the network address in XDR. + * It is allocated with nfsrv_dsdirsize nfsdev_dsdir[] entries. + */ +struct nfsdevice { + TAILQ_ENTRY(nfsdevice) nfsdev_list; + vnode_t nfsdev_dvp; + struct nfsmount *nfsdev_nmp; + char nfsdev_deviceid[NFSX_V4DEVICEID]; + uint16_t nfsdev_hostnamelen; + uint16_t nfsdev_fileaddrlen; + uint16_t nfsdev_flexaddrlen; + char *nfsdev_fileaddr; + char *nfsdev_flexaddr; + char *nfsdev_host; + uint32_t nfsdev_nextdir; + vnode_t nfsdev_dsdir[0]; +}; + +/* + * This structure holds the va_size, va_filerev, va_atime and va_mtime for the + * DS file and is stored in the metadata file's extended attribute pnfsd.dsattr. + */ +struct pnfsdsattr { + uint64_t dsa_filerev; + uint64_t dsa_size; + struct timespec dsa_atime; + struct timespec dsa_mtime; +}; + +/* + * This structure is a list element for a list the pNFS server uses to + * mark that the recovery of a mirror file is in progress. + */ +struct nfsdontlist { + LIST_ENTRY(nfsdontlist) nfsmr_list; + uint32_t nfsmr_flags; + fhandle_t nfsmr_fh; +}; + +/* nfsmr_flags bits. */ +#define NFSMR_DONTLAYOUT 0x00000001 + +#endif /* defined(_KERNEL) || defined(KERNEL) */ + +/* + * This structure holds the information about the DS file and is stored + * in the metadata file's extended attribute called pnfsd.dsfile. + */ +#define PNFS_FILENAME_LEN (2 * sizeof(fhandle_t)) +struct pnfsdsfile { + fhandle_t dsf_fh; + uint32_t dsf_dir; + union { + struct sockaddr_in sin; + struct sockaddr_in6 sin6; + } dsf_nam; + char dsf_filename[PNFS_FILENAME_LEN + 1]; +}; +#define dsf_sin dsf_nam.sin +#define dsf_sin6 dsf_nam.sin6 #endif /* _NFS_NFSRVSTATE_H_ */ Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Tue Jun 12 19:26:25 2018 (r335011) +++ head/sys/fs/nfsclient/nfs_clport.c Tue Jun 12 19:36:32 2018 (r335012) @@ -86,6 +86,7 @@ extern int nfs_numnfscbd; extern int nfscl_inited; struct mtx ncl_iod_mutex; NFSDLOCKMUTEX; +extern struct mtx nfsrv_dslock_mtx; extern void (*ncl_call_invalcaches)(struct vnode *); @@ -930,7 +931,7 @@ nfscl_fillsattr(struct nfsrv_descript *nd, struct vatt if (vap->va_mtime.tv_sec != VNOVAL) NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_TIMEMODIFYSET); (void) nfsv4_fillattr(nd, vp->v_mount, vp, NULL, vap, NULL, 0, - &attrbits, NULL, NULL, 0, 0, 0, 0, (uint64_t)0); + &attrbits, NULL, NULL, 0, 0, 0, 0, (uint64_t)0, NULL); break; } } @@ -1383,6 +1384,13 @@ nfssvc_nfscl(struct thread *td, struct nfssvc_args *ua 0 && strcmp(mp->mnt_stat.f_fstypename, "nfs") == 0 && mp->mnt_data != NULL) { nmp = VFSTONFS(mp); + NFSDDSLOCK(); + if (nfsv4_findmirror(nmp) != NULL) { + NFSDDSUNLOCK(); + error = ENXIO; + nmp = NULL; + break; + } mtx_lock(&nmp->nm_mtx); if ((nmp->nm_privflag & NFSMNTP_FORCEDISM) == 0) { @@ -1394,6 +1402,7 @@ nfssvc_nfscl(struct thread *td, struct nfssvc_args *ua mtx_unlock(&nmp->nm_mtx); nmp = NULL; } + NFSDDSUNLOCK(); break; } } @@ -1418,7 +1427,7 @@ nfssvc_nfscl(struct thread *td, struct nfssvc_args *ua nmp->nm_privflag &= ~NFSMNTP_CANCELRPCS; wakeup(nmp); mtx_unlock(&nmp->nm_mtx); - } else + } else if (error == 0) error = EINVAL; } free(buf, M_TEMP); Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Tue Jun 12 19:26:25 2018 (r335011) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Tue Jun 12 19:36:32 2018 (r335012) @@ -4620,7 +4620,7 @@ nfsrpc_setaclrpc(vnode_t vp, struct ucred *cred, NFSPR NFSZERO_ATTRBIT(&attrbits); NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_ACL); (void) nfsv4_fillattr(nd, vnode_mount(vp), vp, aclp, NULL, NULL, 0, - &attrbits, NULL, NULL, 0, 0, 0, 0, (uint64_t)0); + &attrbits, NULL, NULL, 0, 0, 0, 0, (uint64_t)0, NULL); error = nfscl_request(nd, vp, p, cred, stuff); if (error) return (error); Modified: head/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c Tue Jun 12 19:26:25 2018 (r335011) +++ head/sys/fs/nfsclient/nfs_clstate.c Tue Jun 12 19:36:32 2018 (r335012) @@ -3373,7 +3373,7 @@ nfscl_docb(struct nfsrv_descript *nd, NFSPROC_T *p) if (!error) (void) nfsv4_fillattr(nd, NULL, NULL, NULL, &va, NULL, 0, &rattrbits, NULL, p, 0, 0, 0, 0, - (uint64_t)0); + (uint64_t)0, NULL); break; case NFSV4OP_CBRECALL: NFSCL_DEBUG(4, "cbrecall\n"); Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Tue Jun 12 19:26:25 2018 (r335011) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Tue Jun 12 19:36:32 2018 (r335012) @@ -86,6 +86,7 @@ extern enum nfsiod_state ncl_iodwant[NFS_MAXASYNCDAEMO extern struct nfsmount *ncl_iodmount[NFS_MAXASYNCDAEMON]; extern struct mtx ncl_iod_mutex; NFSCLSTATEMUTEX; +extern struct mtx nfsrv_dslock_mtx; MALLOC_DEFINE(M_NEWNFSREQ, "newnfsclient_req", "NFS request header"); MALLOC_DEFINE(M_NEWNFSMNT, "newnfsmnt", "NFS mount struct"); @@ -1672,6 +1673,7 @@ nfs_unmount(struct mount *mp, int mntflags) if (mntflags & MNT_FORCE) flags |= FORCECLOSE; nmp = VFSTONFS(mp); + error = 0; /* * Goes something like this.. * - Call vflush() to clear out vnodes for this filesystem @@ -1680,6 +1682,12 @@ nfs_unmount(struct mount *mp, int mntflags) */ /* In the forced case, cancel any outstanding requests. */ if (mntflags & MNT_FORCE) { + NFSDDSLOCK(); + if (nfsv4_findmirror(nmp) != NULL) + error = ENXIO; + NFSDDSUNLOCK(); + if (error) + goto out; error = newnfs_nmcancelreqs(nmp); if (error) goto out; Modified: head/sys/fs/nfsserver/nfs_nfsdkrpc.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdkrpc.c Tue Jun 12 19:26:25 2018 (r335011) +++ head/sys/fs/nfsserver/nfs_nfsdkrpc.c Tue Jun 12 19:36:32 2018 (r335012) @@ -105,6 +105,7 @@ static int nfs_proc(struct nfsrv_descript *, u_int32_t extern u_long sb_max_adj; extern int newnfs_numnfsd; extern struct proc *nfsd_master_proc; +extern time_t nfsdev_time; /* * NFS server system calls @@ -495,6 +496,7 @@ nfsrvd_nfsd(struct thread *td, struct nfsd_nfsd_args * */ NFSD_LOCK(); if (newnfs_numnfsd == 0) { + nfsdev_time = time_second; p = td->td_proc; PROC_LOCK(p); p->p_flag2 |= P2_AST_SU; @@ -502,31 +504,36 @@ nfsrvd_nfsd(struct thread *td, struct nfsd_nfsd_args * newnfs_numnfsd++; NFSD_UNLOCK(); - - /* An empty string implies AUTH_SYS only. */ - if (principal[0] != '\0') { - ret2 = rpc_gss_set_svc_name_call(principal, - "kerberosv5", GSS_C_INDEFINITE, NFS_PROG, NFS_VER2); - ret3 = rpc_gss_set_svc_name_call(principal, - "kerberosv5", GSS_C_INDEFINITE, NFS_PROG, NFS_VER3); - ret4 = rpc_gss_set_svc_name_call(principal, - "kerberosv5", GSS_C_INDEFINITE, NFS_PROG, NFS_VER4); - - if (!ret2 || !ret3 || !ret4) - printf("nfsd: can't register svc name\n"); + error = nfsrv_createdevids(args, td); + if (error == 0) { + /* An empty string implies AUTH_SYS only. */ + if (principal[0] != '\0') { + ret2 = rpc_gss_set_svc_name_call(principal, + "kerberosv5", GSS_C_INDEFINITE, NFS_PROG, + NFS_VER2); + ret3 = rpc_gss_set_svc_name_call(principal, + "kerberosv5", GSS_C_INDEFINITE, NFS_PROG, + NFS_VER3); + ret4 = rpc_gss_set_svc_name_call(principal, + "kerberosv5", GSS_C_INDEFINITE, NFS_PROG, + NFS_VER4); + + if (!ret2 || !ret3 || !ret4) + printf( + "nfsd: can't register svc name\n"); + } + + nfsrvd_pool->sp_minthreads = args->minthreads; + nfsrvd_pool->sp_maxthreads = args->maxthreads; + + svc_run(nfsrvd_pool); + + if (principal[0] != '\0') { + rpc_gss_clear_svc_name_call(NFS_PROG, NFS_VER2); + rpc_gss_clear_svc_name_call(NFS_PROG, NFS_VER3); + rpc_gss_clear_svc_name_call(NFS_PROG, NFS_VER4); + } } - - nfsrvd_pool->sp_minthreads = args->minthreads; - nfsrvd_pool->sp_maxthreads = args->maxthreads; - - svc_run(nfsrvd_pool); - - if (principal[0] != '\0') { - rpc_gss_clear_svc_name_call(NFS_PROG, NFS_VER2); - rpc_gss_clear_svc_name_call(NFS_PROG, NFS_VER3); - rpc_gss_clear_svc_name_call(NFS_PROG, NFS_VER4); - } - NFSD_LOCK(); newnfs_numnfsd--; nfsrvd_init(1); @@ -555,6 +562,7 @@ nfsrvd_init(int terminating) if (terminating) { nfsd_master_proc = NULL; NFSD_UNLOCK(); + nfsrv_freealllayoutsanddevids(); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Jun 12 19:50:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 457431017482; Tue, 12 Jun 2018 19:50:34 +0000 (UTC) (envelope-from leitao@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E7CBF768AE; Tue, 12 Jun 2018 19:50:33 +0000 (UTC) (envelope-from leitao@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C8E3572E9; Tue, 12 Jun 2018 19:50:33 +0000 (UTC) (envelope-from leitao@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5CJoXqi091698; Tue, 12 Jun 2018 19:50:33 GMT (envelope-from leitao@FreeBSD.org) Received: (from leitao@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5CJoXn5091697; Tue, 12 Jun 2018 19:50:33 GMT (envelope-from leitao@FreeBSD.org) Message-Id: <201806121950.w5CJoXn5091697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: leitao set sender to leitao@FreeBSD.org using -f From: Breno Leitao Date: Tue, 12 Jun 2018 19:50:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335013 - head/sys/powerpc/powernv X-SVN-Group: head X-SVN-Commit-Author: leitao X-SVN-Commit-Paths: head/sys/powerpc/powernv X-SVN-Commit-Revision: 335013 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 19:50:34 -0000 Author: leitao Date: Tue Jun 12 19:50:33 2018 New Revision: 335013 URL: https://svnweb.freebsd.org/changeset/base/335013 Log: powerpc64/powernv: Avoid type promotion There is a type promotion that transform count = -1 into a unsigned int causing the default TCE SEG SIZE not being returned on a Boston POWER9 machine. This machine does not have the 'ibm,supported-tce-sizes' entries, thus, count is set to -1, and the function continue to execute instead of returning. Reviewed by: jhibbits, wma Approved by: jhibbits (mentor) Differential Revision: https://reviews.freebsd.org/D15763 Modified: head/sys/powerpc/powernv/opal_pci.c Modified: head/sys/powerpc/powernv/opal_pci.c ============================================================================== --- head/sys/powerpc/powernv/opal_pci.c Tue Jun 12 19:36:32 2018 (r335012) +++ head/sys/powerpc/powernv/opal_pci.c Tue Jun 12 19:50:33 2018 (r335013) @@ -221,7 +221,7 @@ max_tce_size(device_t dev) count = OF_getencprop(node, "ibm,supported-tce-sizes", sizes, sizeof(sizes)); - if (count < sizeof(cell_t)) + if (count < (int) sizeof(cell_t)) return OPAL_PCI_TCE_DEFAULT_SEG_SIZE; count /= sizeof(cell_t); From owner-svn-src-head@freebsd.org Tue Jun 12 20:03:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2484210188A7; Tue, 12 Jun 2018 20:03:01 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CB3FF77367; Tue, 12 Jun 2018 20:03:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC06E755F; Tue, 12 Jun 2018 20:03:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5CK30IM001654; Tue, 12 Jun 2018 20:03:00 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5CK30Lx001653; Tue, 12 Jun 2018 20:03:00 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201806122003.w5CK30Lx001653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 12 Jun 2018 20:03:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335014 - head/sys/dev/ofw X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/ofw X-SVN-Commit-Revision: 335014 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 20:03:01 -0000 Author: manu Date: Tue Jun 12 20:03:00 2018 New Revision: 335014 URL: https://svnweb.freebsd.org/changeset/base/335014 Log: simplebus pnp: Do not generate pnp info is the bus status is not okay Generating the pnp info have the side effect to include all nodes even if the status isn't "okay". That means that loading the module will load but not attach as it checks the status in the probe function. On pine64 before : root@pine64-lts:~ # devmatch -u unattached on ofwbus pnpinfo name=memory unattached on ofwbus pnpinfo name=chosen unattached on ofwbus pnpinfo name=sound_spdif compat=simple-audio-card unattached on ofwbus pnpinfo name=spdif-out compat=linux,spdif-dit unattached on simplebus pnpinfo name=dma-controller@1c02000 compat=allwinner,sun50i-a64-dma unattached on simplebus pnpinfo name=mmc@1c10000 compat=allwinner,sun50i-a64-mmc unattached on simplebus pnpinfo name=usb@1c19000 compat=allwinner,sun8i-a33-musb unattached on simplebus pnpinfo name=spdif@1c21000 compat=allwinner,sun50i-a64-spdif unattached on simplebus pnpinfo name=i2s@1c22000 compat=allwinner,sun50i-a64-i2s unattached on simplebus pnpinfo name=i2s@1c22400 compat=allwinner,sun50i-a64-i2s unattached on simplebus pnpinfo name=serial@1c28400 compat=snps,dw-apb-uart unattached on simplebus pnpinfo name=serial@1c28800 compat=snps,dw-apb-uart unattached on simplebus pnpinfo name=serial@1c28c00 compat=snps,dw-apb-uart unattached on simplebus pnpinfo name=serial@1c29000 compat=snps,dw-apb-uart unattached on simplebus pnpinfo name=i2c@1c2ac00 compat=allwinner,sun6i-a31-i2c unattached on simplebus pnpinfo name=i2c@1c2b000 compat=allwinner,sun6i-a31-i2c unattached on simplebus pnpinfo name=i2c@1c2b400 compat=allwinner,sun6i-a31-i2c unattached on ofwbus pnpinfo name=aliases unattached on ofwbus pnpinfo name=symbols All simplebus node are disabled After : root@pine64-lts:~ # devmatch -u unattached on ofwbus pnpinfo name=memory unattached on ofwbus pnpinfo name=chosen unattached on ofwbus pnpinfo name=sound_spdif compat=simple-audio-card unattached on ofwbus pnpinfo name=spdif-out compat=linux,spdif-dit unattached on simplebus pnpinfo name=dma-controller@1c02000 compat=allwinner,sun50i-a64-dma unattached on simplebus pnpinfo name=usb@1c19000 compat=allwinner,sun8i-a33-musb unattached on ofwbus pnpinfo name=aliases unattached on ofwbus pnpinfo name=symbols Reviewed by: imp (with some objection) Differential Revision: https://reviews.freebsd.org/D15770 Modified: head/sys/dev/ofw/ofw_bus_subr.c Modified: head/sys/dev/ofw/ofw_bus_subr.c ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.c Tue Jun 12 19:50:33 2018 (r335013) +++ head/sys/dev/ofw/ofw_bus_subr.c Tue Jun 12 20:03:00 2018 (r335014) @@ -91,6 +91,9 @@ ofw_bus_gen_child_pnpinfo_str(device_t cbdev, device_t { *buf = '\0'; + if (!ofw_bus_status_okay(child)) + return (0); + if (ofw_bus_get_name(child) != NULL) { strlcat(buf, "name=", buflen); strlcat(buf, ofw_bus_get_name(child), buflen); @@ -100,6 +103,7 @@ ofw_bus_gen_child_pnpinfo_str(device_t cbdev, device_t strlcat(buf, " compat=", buflen); strlcat(buf, ofw_bus_get_compat(child), buflen); } + return (0); }; From owner-svn-src-head@freebsd.org Tue Jun 12 22:05:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2751410023E3 for ; Tue, 12 Jun 2018 22:05:28 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-yb0-x233.google.com (mail-yb0-x233.google.com [IPv6:2607:f8b0:4002:c09::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6CA607BFFF for ; Tue, 12 Jun 2018 22:05:27 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-yb0-x233.google.com with SMTP id u11-v6so191961ybi.8 for ; Tue, 12 Jun 2018 15:05:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=dfKvm5RlaJzHrd2I5Np0mhwmN83Ikl0Y/QAtZI09HKo=; b=miyaeYcmOtCEGcXh4N2S6vKjeLyYGOpsLf0zF8Jdtcj6wZR8d67PYfGDRNjlpDsbM2 IpVOUG5I7UDzNEt6cGMINZ4t9Amjo8gg7MVE6zq5/P9PDrYi9R18H3YVxlF4RRnttnDk Qo4+ZQcF5dl3LV81Ic9K5tzvq3Pa1MRXOlAzXm/DaccltD6pZjG3N98f6O95bS1T2JMI 37nEH7mGRYAwBOCRsO/Br2hfh22njL95R2IWCBeo6iDE0498cc3WnZjiQ5hlJnlQBqaS jXBrHN1z3FpOjzDEMoVNGjPKjy3pasXSu8YkaLkTGdjX0EEidtPW8H9BYYNOLvkocC2n raZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=dfKvm5RlaJzHrd2I5Np0mhwmN83Ikl0Y/QAtZI09HKo=; b=e0QdKqDnwOnD//OJOJSeBueubRd5Bm/gVA/t/RZAOBm/Sa1F/tFtTRgPZad4u2GEx2 o+AvIjrg7v8BeeErcw9nLEhbLHvWafBqXOiuc4ClY4lL1CpBGFuM6tgxyppbS29Cd7R2 5Fwshc4SoH/m8EqH+jvVPyyH3mxaTv77b4EL1Q6115pulfS3C6C6rpZzg9bJIR6Qds49 jVttof4ikSUudaGe2pn/+rZN4F8+vwaKVaf13Sw9vBgbizBs8fwdulPiyGRY05k4/a5c Z/6zHnqMrSwfngJOWnkuM521ujaaiVOwYuyCWGTlmoPQ4FbmbWeL5lfTH/dFVbc+WrY2 9AHw== X-Gm-Message-State: APt69E1Z+DeHQryqr62haUoHjVo2VCTK/s3kJtkgOioZC9EBGIcevbnF Kg7qWBw1H7MUnrbv+18UgGQS6duqpWtEdIXcH8RtBQ== X-Google-Smtp-Source: ADUXVKIP0RN9AXHh3CBF+2RWcP4C0vyA1KgdEepMeJhT7m+XEVmIyOoSNaNThZpZVpT5BnETg9HZ6BfXkplQOVjsl7Q= X-Received: by 2002:a25:55d4:: with SMTP id j203-v6mr1132670ybb.199.1528841126855; Tue, 12 Jun 2018 15:05:26 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:db86:0:0:0:0:0 with HTTP; Tue, 12 Jun 2018 15:05:26 -0700 (PDT) In-Reply-To: <201805221435.w4MEZXnW041963@repo.freebsd.org> References: <201805221435.w4MEZXnW041963@repo.freebsd.org> From: Oliver Pinter Date: Wed, 13 Jun 2018 00:05:26 +0200 Message-ID: Subject: Re: svn commit: r334046 - head/tools/tools/intel-ucode-split To: Ed Maste Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 22:05:28 -0000 On 5/22/18, Ed Maste wrote: > Author: emaste > Date: Tue May 22 14:35:33 2018 > New Revision: 334046 > URL: https://svnweb.freebsd.org/changeset/base/334046 > > Log: > intel-ucode-split: add -n flag to skip creating output files > > Sponsored by: The FreeBSD Foundation > > Modified: > head/tools/tools/intel-ucode-split/intel-ucode-split.c Hi! Could you please MFC the intel-ucode-split related commits to 11-STABLE? Thanks, op > > Modified: head/tools/tools/intel-ucode-split/intel-ucode-split.c > ============================================================================== > --- head/tools/tools/intel-ucode-split/intel-ucode-split.c Tue May 22 > 14:26:58 2018 (r334045) > +++ head/tools/tools/intel-ucode-split/intel-ucode-split.c Tue May 22 > 14:35:33 2018 (r334046) > @@ -112,7 +112,7 @@ static void > usage(void) > { > > - printf("ucode-split [-v] microcode_file\n"); > + printf("ucode-split [-nv] microcode_file\n"); > exit(1); > } > > @@ -124,11 +124,14 @@ main(int argc, char *argv[]) > size_t len, resid; > ssize_t rv; > int c, ifd, ofd; > - bool vflag; > + bool nflag, vflag; > > - vflag = false; > - while ((c = getopt(argc, argv, "v")) != -1) { > + nflag = vflag = false; > + while ((c = getopt(argc, argv, "nv")) != -1) { > switch (c) { > + case 'n': > + nflag = true; > + break; > case 'v': > vflag = true; > break; > @@ -166,40 +169,48 @@ main(int argc, char *argv[]) > if (vflag) > dump_header(&hdr); > > - sig_str = format_signature(hdr.processor_signature); > - asprintf(&output_file, "%s.%02x", sig_str, > - hdr.processor_flags & 0xff); > - free(sig_str); > - if (output_file == NULL) > - err(1, "asprintf"); > - ofd = open(output_file, O_WRONLY | O_CREAT | O_TRUNC, 0600); > - if (ofd < 0) > - err(1, "open"); > - > - /* Write header. */ > - rv = write(ofd, &hdr, sizeof(hdr)); > - if (rv < (ssize_t)sizeof(hdr)) > - err(1, "write"); > - > - /* Copy data. */ > resid = (hdr.total_size != 0 ? hdr.total_size : 2048) - > sizeof(hdr); > if (resid > 1 << 24) /* Arbitrary chosen maximum size. */ > errx(1, "header total_size too large"); > - while (resid > 0) { > - len = resid < bufsize ? resid : bufsize; > - rv = read(ifd, buf, len); > - if (rv < 0) > - err(1, "read"); > - else if (rv < (ssize_t)len) > - errx(1, "truncated microcode data"); > - if (write(ofd, buf, len) < (ssize_t)len) > + > + if (nflag) { > + if (lseek(ifd, resid, SEEK_CUR) == -1) > + err(1, "lseek"); > + printf("\n"); > + } else { > + sig_str = format_signature(hdr.processor_signature); > + asprintf(&output_file, "%s.%02x", sig_str, > + hdr.processor_flags & 0xff); > + free(sig_str); > + if (output_file == NULL) > + err(1, "asprintf"); > + ofd = open(output_file, O_WRONLY | O_CREAT | O_TRUNC, > + 0600); > + if (ofd < 0) > + err(1, "open"); > + > + /* Write header. */ > + rv = write(ofd, &hdr, sizeof(hdr)); > + if (rv < (ssize_t)sizeof(hdr)) > err(1, "write"); > - resid -= len; > + > + /* Copy data. */ > + while (resid > 0) { > + len = resid < bufsize ? resid : bufsize; > + rv = read(ifd, buf, len); > + if (rv < 0) > + err(1, "read"); > + else if (rv < (ssize_t)len) > + errx(1, "truncated microcode data"); > + if (write(ofd, buf, len) < (ssize_t)len) > + err(1, "write"); > + resid -= len; > + } > + if (vflag) > + printf("written to %s\n\n", output_file); > + close(ofd); > + free(output_file); > } > - if (vflag) > - printf("written to %s\n\n", output_file); > - close(ofd); > - free(output_file); > } > } > _______________________________________________ > 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-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Tue Jun 12 22:17:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2AA41003481; Tue, 12 Jun 2018 22:17:19 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B1AD7C862; Tue, 12 Jun 2018 22:17:19 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from [192.168.0.6] (67-0-245-183.albq.qwest.net [67.0.245.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id 1293C1941DB; Tue, 12 Jun 2018 14:23:12 +0000 (UTC) Subject: Re: svn commit: r334046 - head/tools/tools/intel-ucode-split To: Oliver Pinter , Ed Maste Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201805221435.w4MEZXnW041963@repo.freebsd.org> From: Sean Bruno Openpgp: preference=signencrypt Autocrypt: addr=sbruno@freebsd.org; prefer-encrypt=mutual; keydata= xsBNBFk+0UEBCADaf4bgxxKvMOhRV5NPoGWRCCGm49d6+1VFNlQ77WsY/+Zvf95TPULdRlnG w648KfxWt7+O3kdKhdRwnqlXWC7zA2Qt0dRE1yIqOGJ4jp4INvp/bcxWzgr0aoKOjrlnfxRV bh+s0rzdZt6TsNL3cVYxkC8oezjaUkHdW4mFJU249U1QJogkF8g0FeKNfEcjEkwJNX6lQJH+ EzCWT0NCk6J+Xyo+zOOljxPp1OUfdvZi3ulkU/qTZstGVWxFVsP8xQklV/y3AFcbIYx6iGJ4 5L7WuB0IWhO7Z4yHENr8wFaNYwpod9i4egX2BugbrM8pOfhN2/qqdeG1L5LMtXw3yyAhABEB AAHNN1NlYW4gQnJ1bm8gKEZyZWVCU0QgRGV2ZWxvcGVyIEtleSkgPHNicnVub0BmcmVlYnNk Lm9yZz7CwJQEEwEKAD4WIQToxOn4gDUE4eP0ujS95PX+ibX8tgUCWT7RQQIbAwUJBaOagAUL CQgHAwUVCgkICwUWAwIBAAIeAQIXgAAKCRC95PX+ibX8ttKTCACFKzRc56EBAlVotq02EjZP SfX+unlk6AuPBzShxqRxeK+bGYVCigrYd1M8nnskv0dEiZ5iYeND9HIxbpEyopqgpVTibA7w gBXaZ7SOEhNX1wXwg14JrralfSmPFMYni+sWegPMX/zwfAsn1z4mG1Nn44Xqo3o7CfpkMPy6 M5Bow2IDzIhEYISLR+urxs74/aHU35PLtBSDtu18914SEMDdva27MARN8mbeCDbuJVfGCPWy YHuy2t+9u2Zn5Dd+t3sBXLM9gpeaMm+4x6TNPpESygbVdh4tDdjVZ9DK/bWFg0kMgfZoaq6J l0jNsQXrZV3bzYNFbVw04pFcvA2GIJ7xzsBNBFk+0UEBCADIXBmQOaKMHGbc9vwjhV4Oj5aZ DdhNedn12FVeTdOXJvuTOusgxS29lla0RenHGDsgD08UiFpasBXWq/E+BhQ19d+iRbLLR17O KKc1ZGefoVbLARLXD68J5j4XAyK+6k2KqBLlqzAEpHTzsksM9naARkVXiEVcrt6ciw0FSm8n kuK3gDKKe93XfzfP+TQdbvvzJc7Fa+appLbXz61TM1aikaQlda8bWubDegwXbuoJdB34xU1m yjr/N4o+raL0x7QrzdH+wwgrTTo+H4S2c1972Skt5K5tbxLowfHicRl23V8itVQr3sBtlX4+ 66q+Apm7+R36bUS/k+G45Sp6iPpxABEBAAHCwHwEGAEKACYWIQToxOn4gDUE4eP0ujS95PX+ ibX8tgUCWT7RQQIbDAUJBaOagAAKCRC95PX+ibX8trrIB/9Pljqt/JGamD9tx4dOVmxSyFg9 z2xzgklTLuDgS73MM120mM7ao9AQUeWiSle/H0UCK7xPOzC/aeUC4oygDQKAfkkNbCNTo3+A qDjBRA8qx0e9a/QjDL+RFgD4L5kLT4tToY8T8HaBp8h03LBfk510IaI8oL/Jg7vpM3PDtJMW tUi2H+yNFmL3NfM2oBToWKLFsoP54f/eeeImrNnrlLjLHPzqS+/9apgYqX2Jwiv3tHBc4FTO GuY8VvF7BpixJs8Pc2RUuCfSyodrp1YG1kRGlXAH0cqwwr0Zmk4+7dZvtVQMCl6kS6q1+84q JwtItxS2eXSEA4NO0sQ3BXUywANh Message-ID: Date: Tue, 12 Jun 2018 16:17:14 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="sJBJrMrAtpdioyyrg472gI7eVqhCn4n92" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 22:17:20 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --sJBJrMrAtpdioyyrg472gI7eVqhCn4n92 Content-Type: multipart/mixed; boundary="pfgT0y1F5MMDZXd5biKShu31qZap67Jf3"; protected-headers="v1" From: Sean Bruno To: Oliver Pinter , Ed Maste Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r334046 - head/tools/tools/intel-ucode-split References: <201805221435.w4MEZXnW041963@repo.freebsd.org> In-Reply-To: --pfgT0y1F5MMDZXd5biKShu31qZap67Jf3 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 06/12/18 16:05, Oliver Pinter wrote: > On 5/22/18, Ed Maste wrote: >> Author: emaste >> Date: Tue May 22 14:35:33 2018 >> New Revision: 334046 >> URL: https://svnweb.freebsd.org/changeset/base/334046 >> >> Log: >> intel-ucode-split: add -n flag to skip creating output files >> >> Sponsored by: The FreeBSD Foundation >> >> Modified: >> head/tools/tools/intel-ucode-split/intel-ucode-split.c >=20 > Hi! >=20 > Could you please MFC the intel-ucode-split related commits to 11-STABLE= ? >=20 >=20 > Thanks, > op >=20 Do you need it in base for some reason? This code is already in the devcpu-data port and is used when the port is built. Its not needed for anything AFAIK. sean >> >> Modified: head/tools/tools/intel-ucode-split/intel-ucode-split.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/tools/tools/intel-ucode-split/intel-ucode-split.c Tue May 22 >> 14:26:58 2018 (r334045) >> +++ head/tools/tools/intel-ucode-split/intel-ucode-split.c Tue May 22 >> 14:35:33 2018 (r334046) >> @@ -112,7 +112,7 @@ static void >> usage(void) >> { >> >> - printf("ucode-split [-v] microcode_file\n"); >> + printf("ucode-split [-nv] microcode_file\n"); >> exit(1); >> } >> >> @@ -124,11 +124,14 @@ main(int argc, char *argv[]) >> size_t len, resid; >> ssize_t rv; >> int c, ifd, ofd; >> - bool vflag; >> + bool nflag, vflag; >> >> - vflag =3D false; >> - while ((c =3D getopt(argc, argv, "v")) !=3D -1) { >> + nflag =3D vflag =3D false; >> + while ((c =3D getopt(argc, argv, "nv")) !=3D -1) { >> switch (c) { >> + case 'n': >> + nflag =3D true; >> + break; >> case 'v': >> vflag =3D true; >> break; >> @@ -166,40 +169,48 @@ main(int argc, char *argv[]) >> if (vflag) >> dump_header(&hdr); >> >> - sig_str =3D format_signature(hdr.processor_signature); >> - asprintf(&output_file, "%s.%02x", sig_str, >> - hdr.processor_flags & 0xff); >> - free(sig_str); >> - if (output_file =3D=3D NULL) >> - err(1, "asprintf"); >> - ofd =3D open(output_file, O_WRONLY | O_CREAT | O_TRUNC, 0600); >> - if (ofd < 0) >> - err(1, "open"); >> - >> - /* Write header. */ >> - rv =3D write(ofd, &hdr, sizeof(hdr)); >> - if (rv < (ssize_t)sizeof(hdr)) >> - err(1, "write"); >> - >> - /* Copy data. */ >> resid =3D (hdr.total_size !=3D 0 ? hdr.total_size : 2048) - >> sizeof(hdr); >> if (resid > 1 << 24) /* Arbitrary chosen maximum size. */ >> errx(1, "header total_size too large"); >> - while (resid > 0) { >> - len =3D resid < bufsize ? resid : bufsize; >> - rv =3D read(ifd, buf, len); >> - if (rv < 0) >> - err(1, "read"); >> - else if (rv < (ssize_t)len) >> - errx(1, "truncated microcode data"); >> - if (write(ofd, buf, len) < (ssize_t)len) >> + >> + if (nflag) { >> + if (lseek(ifd, resid, SEEK_CUR) =3D=3D -1) >> + err(1, "lseek"); >> + printf("\n"); >> + } else { >> + sig_str =3D format_signature(hdr.processor_signature); >> + asprintf(&output_file, "%s.%02x", sig_str, >> + hdr.processor_flags & 0xff); >> + free(sig_str); >> + if (output_file =3D=3D NULL) >> + err(1, "asprintf"); >> + ofd =3D open(output_file, O_WRONLY | O_CREAT | O_TRUNC, >> + 0600); >> + if (ofd < 0) >> + err(1, "open"); >> +=09 >> + /* Write header. */ >> + rv =3D write(ofd, &hdr, sizeof(hdr)); >> + if (rv < (ssize_t)sizeof(hdr)) >> err(1, "write"); >> - resid -=3D len; >> +=09 >> + /* Copy data. */ >> + while (resid > 0) { >> + len =3D resid < bufsize ? resid : bufsize; >> + rv =3D read(ifd, buf, len); >> + if (rv < 0) >> + err(1, "read"); >> + else if (rv < (ssize_t)len) >> + errx(1, "truncated microcode data"); >> + if (write(ofd, buf, len) < (ssize_t)len) >> + err(1, "write"); >> + resid -=3D len; >> + } >> + if (vflag) >> + printf("written to %s\n\n", output_file); >> + close(ofd); >> + free(output_file); >> } >> - if (vflag) >> - printf("written to %s\n\n", output_file); >> - close(ofd); >> - free(output_file); >> } >> } >> _______________________________________________ >> 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-unsubscribe@freebsd.org= " >> >=20 >=20 --pfgT0y1F5MMDZXd5biKShu31qZap67Jf3-- --sJBJrMrAtpdioyyrg472gI7eVqhCn4n92 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEE6MTp+IA1BOHj9Lo0veT1/om1/LYFAlsgRmpfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEU4 QzRFOUY4ODAzNTA0RTFFM0Y0QkEzNEJERTRGNUZFODlCNUZDQjYACgkQveT1/om1 /LanLwgAyfodKf0OCwxfPJooFyED2AhTsPGAaVpjn4pQ477mU4+4jZMOvI8b6XXk zIjahFpP6QLj2e8rne1OpHY7SwbGFZ+xVfPhu5PSOTcwcXxndNVcbYxaG9GpehiY CArkMvyqmg05hawaK/Zz2vJ3o/LNOxhYLP+XBjCLC/zUycdrjFkBo8VPjzFitvvg okxl6r7ERYqKmxXul9UoRC8MZ3xNG7q6i51yM6EXZuE2AGvA69w7pHKh+6MgUmVf o12N0GWWpE/WTUstMXNTL7hZ8e+8d5uwORDBOEmbq3P4vQloUMvfwKXPlb7suKZ2 bRh07eaJQt4LPPkZWjFWv1kZiFJ6YQ== =Ebyp -----END PGP SIGNATURE----- --sJBJrMrAtpdioyyrg472gI7eVqhCn4n92-- From owner-svn-src-head@freebsd.org Tue Jun 12 22:18:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E8BE10035FA; Tue, 12 Jun 2018 22:18:16 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 132CE7C9C8; Tue, 12 Jun 2018 22:18:16 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E8DCE10AA8; Tue, 12 Jun 2018 22:18:15 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5CMIFHO067686; Tue, 12 Jun 2018 22:18:15 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5CMIFRS067684; Tue, 12 Jun 2018 22:18:15 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806122218.w5CMIFRS067684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Tue, 12 Jun 2018 22:18:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335015 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 335015 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 22:18:16 -0000 Author: mmacy Date: Tue Jun 12 22:18:15 2018 New Revision: 335015 URL: https://svnweb.freebsd.org/changeset/base/335015 Log: Defer inpcb deletion until after a grace period has elapsed Deferring the actual free of the inpcb until after a grace period has elapsed will allow us to convert the inpcbinfo info and hash read locks to epoch. Reviewed by: gallatin, jtl Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D15510 Modified: head/sys/netinet/in_pcb.c head/sys/netinet/in_pcb.h Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Tue Jun 12 20:03:00 2018 (r335014) +++ head/sys/netinet/in_pcb.c Tue Jun 12 22:18:15 2018 (r335015) @@ -1569,6 +1569,45 @@ in_pcblist_rele_rlocked(epoch_context_t ctx) free(il, M_TEMP); } +static void +in_pcbfree_deferred(epoch_context_t ctx) +{ + struct inpcb *inp; + struct inpcbinfo *pcbinfo; + int released __unused; + + inp = __containerof(ctx, struct inpcb, inp_epoch_ctx); + pcbinfo = inp->inp_pcbinfo; + + INP_WLOCK(inp); +#ifdef INET + inp_freemoptions(inp->inp_moptions); + inp->inp_moptions = NULL; +#endif + /* XXXRW: Do as much as possible here. */ +#if defined(IPSEC) || defined(IPSEC_SUPPORT) + if (inp->inp_sp != NULL) + ipsec_delete_pcbpolicy(inp); +#endif +#ifdef INET6 + if (inp->inp_vflag & INP_IPV6PROTO) { + ip6_freepcbopts(inp->in6p_outputopts); + ip6_freemoptions(inp->in6p_moptions); + inp->in6p_moptions = NULL; + } +#endif + if (inp->inp_options) + (void)m_free(inp->inp_options); + + inp->inp_vflag = 0; + crfree(inp->inp_cred); +#ifdef MAC + mac_inpcb_destroy(inp); +#endif + released = in_pcbrele_wlocked(inp); + MPASS(released); +} + /* * Unconditionally schedule an inpcb to be freed by decrementing its * reference count, which should occur only after the inpcb has been detached @@ -1583,14 +1622,7 @@ in_pcbfree(struct inpcb *inp) { struct inpcbinfo *pcbinfo = inp->inp_pcbinfo; -#ifdef INET6 - struct ip6_moptions *im6o = NULL; -#endif -#ifdef INET - struct ip_moptions *imo = NULL; -#endif KASSERT(inp->inp_socket == NULL, ("%s: inp_socket != NULL", __func__)); - KASSERT((inp->inp_flags2 & INP_FREED) == 0, ("%s: called twice for pcb %p", __func__, inp)); if (inp->inp_flags2 & INP_FREED) { @@ -1606,45 +1638,14 @@ in_pcbfree(struct inpcb *inp) } #endif INP_WLOCK_ASSERT(inp); - -#ifdef INET - imo = inp->inp_moptions; - inp->inp_moptions = NULL; -#endif - /* XXXRW: Do as much as possible here. */ -#if defined(IPSEC) || defined(IPSEC_SUPPORT) - if (inp->inp_sp != NULL) - ipsec_delete_pcbpolicy(inp); -#endif INP_LIST_WLOCK(pcbinfo); - inp->inp_gencnt = ++pcbinfo->ipi_gencnt; in_pcbremlists(inp); INP_LIST_WUNLOCK(pcbinfo); -#ifdef INET6 - if (inp->inp_vflag & INP_IPV6PROTO) { - ip6_freepcbopts(inp->in6p_outputopts); - im6o = inp->in6p_moptions; - inp->in6p_moptions = NULL; - } -#endif - if (inp->inp_options) - (void)m_free(inp->inp_options); RO_INVALIDATE_CACHE(&inp->inp_route); - - inp->inp_vflag = 0; + /* mark as destruction in progress */ inp->inp_flags2 |= INP_FREED; - crfree(inp->inp_cred); -#ifdef MAC - mac_inpcb_destroy(inp); -#endif -#ifdef INET6 - ip6_freemoptions(im6o); -#endif -#ifdef INET - inp_freemoptions(imo); -#endif - if (!in_pcbrele_wlocked(inp)) - INP_WUNLOCK(inp); + INP_WUNLOCK(inp); + epoch_call(net_epoch_preempt, &inp->inp_epoch_ctx, in_pcbfree_deferred); } /* Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Tue Jun 12 20:03:00 2018 (r335014) +++ head/sys/netinet/in_pcb.h Tue Jun 12 22:18:15 2018 (r335015) @@ -325,6 +325,7 @@ struct inpcb { LIST_ENTRY(inpcb) inp_list; /* (p/l) list for all PCBs for proto */ /* (p[w]) for list iteration */ /* (p[r]/l) for addition/removal */ + struct epoch_context inp_epoch_ctx; }; #endif /* _KERNEL */ From owner-svn-src-head@freebsd.org Tue Jun 12 22:18:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC10E100364F; Tue, 12 Jun 2018 22:18:23 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 871757CA97; Tue, 12 Jun 2018 22:18:23 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5131910AA9; Tue, 12 Jun 2018 22:18:23 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5CMINXL067749; Tue, 12 Jun 2018 22:18:23 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5CMIKDt067737; Tue, 12 Jun 2018 22:18:20 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806122218.w5CMIKDt067737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Tue, 12 Jun 2018 22:18:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335016 - in head/sys: netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys: netinet netinet6 X-SVN-Commit-Revision: 335016 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 22:18:24 -0000 Author: mmacy Date: Tue Jun 12 22:18:20 2018 New Revision: 335016 URL: https://svnweb.freebsd.org/changeset/base/335016 Log: mechanical CK macro conversion of inpcbinfo lists This is a dependency for converting the inpcbinfo hash and info rlocks to epoch. Modified: head/sys/netinet/in_pcb.c head/sys/netinet/in_pcb.h head/sys/netinet/ip_divert.c head/sys/netinet/raw_ip.c head/sys/netinet/tcp_subr.c head/sys/netinet/udp_usrreq.c head/sys/netinet6/icmp6.c head/sys/netinet6/in6_pcb.c head/sys/netinet6/raw_ip6.c head/sys/netinet6/udp6_usrreq.c Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Tue Jun 12 22:18:15 2018 (r335015) +++ head/sys/netinet/in_pcb.c Tue Jun 12 22:18:20 2018 (r335016) @@ -456,7 +456,7 @@ in_pcbinfo_init(struct inpcbinfo *pcbinfo, const char pcbinfo->ipi_vnet = curvnet; #endif pcbinfo->ipi_listhead = listhead; - LIST_INIT(pcbinfo->ipi_listhead); + CK_LIST_INIT(pcbinfo->ipi_listhead); pcbinfo->ipi_count = 0; pcbinfo->ipi_hashbase = hashinit(hash_nelements, M_PCB, &pcbinfo->ipi_hashmask); @@ -549,7 +549,7 @@ in_pcballoc(struct socket *so, struct inpcbinfo *pcbin #endif INP_WLOCK(inp); INP_LIST_WLOCK(pcbinfo); - LIST_INSERT_HEAD(pcbinfo->ipi_listhead, inp, inp_list); + CK_LIST_INSERT_HEAD(pcbinfo->ipi_listhead, inp, inp_list); pcbinfo->ipi_count++; so->so_pcb = (caddr_t)inp; #ifdef INET6 @@ -1678,10 +1678,10 @@ in_pcbdrop(struct inpcb *inp) INP_HASH_WLOCK(inp->inp_pcbinfo); in_pcbremlbgrouphash(inp); - LIST_REMOVE(inp, inp_hash); - LIST_REMOVE(inp, inp_portlist); - if (LIST_FIRST(&phd->phd_pcblist) == NULL) { - LIST_REMOVE(phd, phd_hash); + CK_LIST_REMOVE(inp, inp_hash); + CK_LIST_REMOVE(inp, inp_portlist); + if (CK_LIST_FIRST(&phd->phd_pcblist) == NULL) { + CK_LIST_REMOVE(phd, phd_hash); free(phd, M_PCB); } INP_HASH_WUNLOCK(inp->inp_pcbinfo); @@ -1756,7 +1756,7 @@ in_pcbnotifyall(struct inpcbinfo *pcbinfo, struct in_a struct inpcb *inp, *inp_temp; INP_INFO_WLOCK(pcbinfo); - LIST_FOREACH_SAFE(inp, pcbinfo->ipi_listhead, inp_list, inp_temp) { + CK_LIST_FOREACH_SAFE(inp, pcbinfo->ipi_listhead, inp_list, inp_temp) { INP_WLOCK(inp); #ifdef INET6 if ((inp->inp_vflag & INP_IPV4) == 0) { @@ -1783,7 +1783,7 @@ in_pcbpurgeif0(struct inpcbinfo *pcbinfo, struct ifnet int i, gap; INP_INFO_WLOCK(pcbinfo); - LIST_FOREACH(inp, pcbinfo->ipi_listhead, inp_list) { + CK_LIST_FOREACH(inp, pcbinfo->ipi_listhead, inp_list) { INP_WLOCK(inp); imo = inp->inp_moptions; if ((inp->inp_vflag & INP_IPV4) && @@ -1848,7 +1848,7 @@ in_pcblookup_local(struct inpcbinfo *pcbinfo, struct i */ head = &pcbinfo->ipi_hashbase[INP_PCBHASH(INADDR_ANY, lport, 0, pcbinfo->ipi_hashmask)]; - LIST_FOREACH(inp, head, inp_hash) { + CK_LIST_FOREACH(inp, head, inp_hash) { #ifdef INET6 /* XXX inp locking */ if ((inp->inp_vflag & INP_IPV4) == 0) @@ -1882,7 +1882,7 @@ in_pcblookup_local(struct inpcbinfo *pcbinfo, struct i */ porthash = &pcbinfo->ipi_porthashbase[INP_PCBPORTHASH(lport, pcbinfo->ipi_porthashmask)]; - LIST_FOREACH(phd, porthash, phd_hash) { + CK_LIST_FOREACH(phd, porthash, phd_hash) { if (phd->phd_port == lport) break; } @@ -1891,7 +1891,7 @@ in_pcblookup_local(struct inpcbinfo *pcbinfo, struct i * Port is in use by one or more PCBs. Look for best * fit. */ - LIST_FOREACH(inp, &phd->phd_pcblist, inp_portlist) { + CK_LIST_FOREACH(inp, &phd->phd_pcblist, inp_portlist) { wildcard = 0; if (cred != NULL && !prison_equal_ip4(inp->inp_cred->cr_prison, @@ -2250,7 +2250,7 @@ in_pcblookup_hash_locked(struct inpcbinfo *pcbinfo, st tmpinp = NULL; head = &pcbinfo->ipi_hashbase[INP_PCBHASH(faddr.s_addr, lport, fport, pcbinfo->ipi_hashmask)]; - LIST_FOREACH(inp, head, inp_hash) { + CK_LIST_FOREACH(inp, head, inp_hash) { #ifdef INET6 /* XXX inp locking */ if ((inp->inp_vflag & INP_IPV4) == 0) @@ -2307,7 +2307,7 @@ in_pcblookup_hash_locked(struct inpcbinfo *pcbinfo, st head = &pcbinfo->ipi_hashbase[INP_PCBHASH(INADDR_ANY, lport, 0, pcbinfo->ipi_hashmask)]; - LIST_FOREACH(inp, head, inp_hash) { + CK_LIST_FOREACH(inp, head, inp_hash) { #ifdef INET6 /* XXX inp locking */ if ((inp->inp_vflag & INP_IPV4) == 0) @@ -2540,7 +2540,7 @@ in_pcbinshash_internal(struct inpcb *inp, int do_pcbgr /* * Go through port list and look for a head for this lport. */ - LIST_FOREACH(phd, pcbporthash, phd_hash) { + CK_LIST_FOREACH(phd, pcbporthash, phd_hash) { if (phd->phd_port == inp->inp_lport) break; } @@ -2553,12 +2553,12 @@ in_pcbinshash_internal(struct inpcb *inp, int do_pcbgr return (ENOBUFS); /* XXX */ } phd->phd_port = inp->inp_lport; - LIST_INIT(&phd->phd_pcblist); - LIST_INSERT_HEAD(pcbporthash, phd, phd_hash); + CK_LIST_INIT(&phd->phd_pcblist); + CK_LIST_INSERT_HEAD(pcbporthash, phd, phd_hash); } inp->inp_phd = phd; - LIST_INSERT_HEAD(&phd->phd_pcblist, inp, inp_portlist); - LIST_INSERT_HEAD(pcbhash, inp, inp_hash); + CK_LIST_INSERT_HEAD(&phd->phd_pcblist, inp, inp_portlist); + CK_LIST_INSERT_HEAD(pcbhash, inp, inp_hash); inp->inp_flags |= INP_INHASHLIST; #ifdef PCBGROUP if (do_pcbgroup_update) @@ -2621,8 +2621,8 @@ in_pcbrehash_mbuf(struct inpcb *inp, struct mbuf *m) head = &pcbinfo->ipi_hashbase[INP_PCBHASH(hashkey_faddr, inp->inp_lport, inp->inp_fport, pcbinfo->ipi_hashmask)]; - LIST_REMOVE(inp, inp_hash); - LIST_INSERT_HEAD(head, inp, inp_hash); + CK_LIST_REMOVE(inp, inp_hash); + CK_LIST_INSERT_HEAD(head, inp, inp_hash); #ifdef PCBGROUP if (m != NULL) @@ -2667,16 +2667,16 @@ in_pcbremlists(struct inpcb *inp) /* XXX: Only do if SO_REUSEPORT_LB set? */ in_pcbremlbgrouphash(inp); - LIST_REMOVE(inp, inp_hash); - LIST_REMOVE(inp, inp_portlist); - if (LIST_FIRST(&phd->phd_pcblist) == NULL) { - LIST_REMOVE(phd, phd_hash); + CK_LIST_REMOVE(inp, inp_hash); + CK_LIST_REMOVE(inp, inp_portlist); + if (CK_LIST_FIRST(&phd->phd_pcblist) == NULL) { + CK_LIST_REMOVE(phd, phd_hash); free(phd, M_PCB); } INP_HASH_WUNLOCK(pcbinfo); inp->inp_flags &= ~INP_INHASHLIST; } - LIST_REMOVE(inp, inp_list); + CK_LIST_REMOVE(inp, inp_list); pcbinfo->ipi_count--; #ifdef PCBGROUP in_pcbgroup_remove(inp); @@ -2820,7 +2820,7 @@ inp_apply_all(void (*func)(struct inpcb *, void *), vo struct inpcb *inp; INP_INFO_WLOCK(&V_tcbinfo); - LIST_FOREACH(inp, V_tcbinfo.ipi_listhead, inp_list) { + CK_LIST_FOREACH(inp, V_tcbinfo.ipi_listhead, inp_list) { INP_WLOCK(inp); func(inp, arg); INP_WUNLOCK(inp); Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Tue Jun 12 22:18:15 2018 (r335015) +++ head/sys/netinet/in_pcb.h Tue Jun 12 22:18:20 2018 (r335016) @@ -53,6 +53,7 @@ #include #include #endif +#include #define in6pcb inpcb /* for KAME src sync over BSD*'s */ #define in6p_sp inp_sp /* for KAME src sync over BSD*'s */ @@ -65,8 +66,8 @@ * numbers, and pointers up (to a socket structure) and down (to a * protocol-specific control block) are stored here. */ -LIST_HEAD(inpcbhead, inpcb); -LIST_HEAD(inpcbporthead, inpcbport); +CK_LIST_HEAD(inpcbhead, inpcb); +CK_LIST_HEAD(inpcbporthead, inpcbport); typedef uint64_t inp_gen_t; /* @@ -230,8 +231,8 @@ struct inpcbpolicy; struct m_snd_tag; struct inpcb { /* Cache line #1 (amd64) */ - LIST_ENTRY(inpcb) inp_hash; /* (h/i) hash list */ - LIST_ENTRY(inpcb) inp_pcbgrouphash; /* (g/i) hash list */ + CK_LIST_ENTRY(inpcb) inp_hash; /* (h/i) hash list */ + CK_LIST_ENTRY(inpcb) inp_pcbgrouphash; /* (g/i) hash list */ struct rwlock inp_lock; /* Cache line #2 (amd64) */ #define inp_start_zero inp_hpts @@ -313,7 +314,7 @@ struct inpcb { int in6p_cksum; short in6p_hops; }; - LIST_ENTRY(inpcb) inp_portlist; /* (i/h) */ + CK_LIST_ENTRY(inpcb) inp_portlist; /* (i/h) */ struct inpcbport *inp_phd; /* (i/h) head of this list */ inp_gen_t inp_gencnt; /* (c) generation count */ struct llentry *inp_lle; /* cached L2 information */ @@ -322,7 +323,7 @@ struct inpcb { struct route inp_route; struct route_in6 inp_route6; }; - LIST_ENTRY(inpcb) inp_list; /* (p/l) list for all PCBs for proto */ + CK_LIST_ENTRY(inpcb) inp_list; /* (p/l) list for all PCBs for proto */ /* (p[w]) for list iteration */ /* (p[r]/l) for addition/removal */ struct epoch_context inp_epoch_ctx; @@ -401,7 +402,7 @@ void in_pcbtoxinpcb(const struct inpcb *, struct xinpc #endif /* _SYS_SOCKETVAR_H_ */ struct inpcbport { - LIST_ENTRY(inpcbport) phd_hash; + CK_LIST_ENTRY(inpcbport) phd_hash; struct inpcbhead phd_pcblist; u_short phd_port; }; Modified: head/sys/netinet/ip_divert.c ============================================================================== --- head/sys/netinet/ip_divert.c Tue Jun 12 22:18:15 2018 (r335015) +++ head/sys/netinet/ip_divert.c Tue Jun 12 22:18:20 2018 (r335016) @@ -273,7 +273,7 @@ divert_packet(struct mbuf *m, int incoming) sa = NULL; nport = htons((u_int16_t)(((struct ipfw_rule_ref *)(mtag+1))->info)); INP_INFO_RLOCK(&V_divcbinfo); - LIST_FOREACH(inp, &V_divcb, inp_list) { + CK_LIST_FOREACH(inp, &V_divcb, inp_list) { /* XXX why does only one socket match? */ if (inp->inp_lport == nport) { INP_RLOCK(inp); @@ -676,8 +676,8 @@ div_pcblist(SYSCTL_HANDLER_ARGS) inp_list = il->il_inp_list; INP_INFO_RLOCK(&V_divcbinfo); - for (inp = LIST_FIRST(V_divcbinfo.ipi_listhead), i = 0; inp && i < n; - inp = LIST_NEXT(inp, inp_list)) { + for (inp = CK_LIST_FIRST(V_divcbinfo.ipi_listhead), i = 0; inp && i < n; + inp = CK_LIST_NEXT(inp, inp_list)) { INP_WLOCK(inp); if (inp->inp_gencnt <= gencnt && cr_canseeinpcb(req->td->td_ucred, inp) == 0) { Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Tue Jun 12 22:18:15 2018 (r335015) +++ head/sys/netinet/raw_ip.c Tue Jun 12 22:18:20 2018 (r335016) @@ -170,7 +170,7 @@ rip_inshash(struct inpcb *inp) } else hash = 0; pcbhash = &pcbinfo->ipi_hashbase[hash]; - LIST_INSERT_HEAD(pcbhash, inp, inp_hash); + CK_LIST_INSERT_HEAD(pcbhash, inp, inp_hash); } static void @@ -180,7 +180,7 @@ rip_delhash(struct inpcb *inp) INP_INFO_WLOCK_ASSERT(inp->inp_pcbinfo); INP_WLOCK_ASSERT(inp); - LIST_REMOVE(inp, inp_hash); + CK_LIST_REMOVE(inp, inp_hash); } #endif /* INET */ @@ -300,7 +300,7 @@ rip_input(struct mbuf **mp, int *offp, int proto) hash = INP_PCBHASH_RAW(proto, ip->ip_src.s_addr, ip->ip_dst.s_addr, V_ripcbinfo.ipi_hashmask); INP_INFO_RLOCK(&V_ripcbinfo); - LIST_FOREACH(inp, &V_ripcbinfo.ipi_hashbase[hash], inp_hash) { + CK_LIST_FOREACH(inp, &V_ripcbinfo.ipi_hashbase[hash], inp_hash) { if (inp->inp_ip_p != proto) continue; #ifdef INET6 @@ -332,7 +332,7 @@ rip_input(struct mbuf **mp, int *offp, int proto) INP_RLOCK(inp); last = inp; } - LIST_FOREACH(inp, &V_ripcbinfo.ipi_hashbase[0], inp_hash) { + CK_LIST_FOREACH(inp, &V_ripcbinfo.ipi_hashbase[0], inp_hash) { if (inp->inp_ip_p && inp->inp_ip_p != proto) continue; #ifdef INET6 @@ -1060,8 +1060,8 @@ rip_pcblist(SYSCTL_HANDLER_ARGS) inp_list = il->il_inp_list; INP_INFO_RLOCK(&V_ripcbinfo); - for (inp = LIST_FIRST(V_ripcbinfo.ipi_listhead), i = 0; inp && i < n; - inp = LIST_NEXT(inp, inp_list)) { + for (inp = CK_LIST_FIRST(V_ripcbinfo.ipi_listhead), i = 0; inp && i < n; + inp = CK_LIST_NEXT(inp, inp_list)) { INP_WLOCK(inp); if (inp->inp_gencnt <= gencnt && cr_canseeinpcb(req->td->td_ucred, inp) == 0) { Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Tue Jun 12 22:18:15 2018 (r335015) +++ head/sys/netinet/tcp_subr.c Tue Jun 12 22:18:20 2018 (r335016) @@ -947,7 +947,7 @@ deregister_tcp_functions(struct tcp_function_block *bl VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); INP_INFO_WLOCK(&V_tcbinfo); - LIST_FOREACH(inp, V_tcbinfo.ipi_listhead, inp_list) { + CK_LIST_FOREACH(inp, V_tcbinfo.ipi_listhead, inp_list) { INP_WLOCK(inp); if (inp->inp_flags & INP_TIMEWAIT) { INP_WUNLOCK(inp); @@ -1717,7 +1717,7 @@ tcp_ccalgounload(struct cc_algo *unload_algo) * therefore don't enter the loop below until the connection * list has stabilised. */ - LIST_FOREACH(inp, &V_tcb, inp_list) { + CK_LIST_FOREACH(inp, &V_tcb, inp_list) { INP_WLOCK(inp); /* Important to skip tcptw structs. */ if (!(inp->inp_flags & INP_TIMEWAIT) && @@ -2018,7 +2018,7 @@ tcp_drain(void) * useful. */ INP_INFO_WLOCK(&V_tcbinfo); - LIST_FOREACH(inpb, V_tcbinfo.ipi_listhead, inp_list) { + CK_LIST_FOREACH(inpb, V_tcbinfo.ipi_listhead, inp_list) { if (inpb->inp_flags & INP_TIMEWAIT) continue; INP_WLOCK(inpb); @@ -2155,8 +2155,8 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) inp_list = il->il_inp_list; INP_INFO_WLOCK(&V_tcbinfo); - for (inp = LIST_FIRST(V_tcbinfo.ipi_listhead), i = 0; - inp != NULL && i < n; inp = LIST_NEXT(inp, inp_list)) { + for (inp = CK_LIST_FIRST(V_tcbinfo.ipi_listhead), i = 0; + inp != NULL && i < n; inp = CK_LIST_NEXT(inp, inp_list)) { INP_WLOCK(inp); if (inp->inp_gencnt <= gencnt) { /* Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Tue Jun 12 22:18:15 2018 (r335015) +++ head/sys/netinet/udp_usrreq.c Tue Jun 12 22:18:20 2018 (r335016) @@ -532,7 +532,7 @@ udp_input(struct mbuf **mp, int *offp, int proto) INP_INFO_RLOCK(pcbinfo); pcblist = udp_get_pcblist(proto); last = NULL; - LIST_FOREACH(inp, pcblist, inp_list) { + CK_LIST_FOREACH(inp, pcblist, inp_list) { if (inp->inp_lport != uh->uh_dport) continue; #ifdef INET6 @@ -878,8 +878,8 @@ udp_pcblist(SYSCTL_HANDLER_ARGS) inp_list = il->il_inp_list; INP_INFO_RLOCK(&V_udbinfo); - for (inp = LIST_FIRST(V_udbinfo.ipi_listhead), i = 0; inp && i < n; - inp = LIST_NEXT(inp, inp_list)) { + for (inp = CK_LIST_FIRST(V_udbinfo.ipi_listhead), i = 0; inp && i < n; + inp = CK_LIST_NEXT(inp, inp_list)) { INP_WLOCK(inp); if (inp->inp_gencnt <= gencnt && cr_canseeinpcb(req->td->td_ucred, inp) == 0) { Modified: head/sys/netinet6/icmp6.c ============================================================================== --- head/sys/netinet6/icmp6.c Tue Jun 12 22:18:15 2018 (r335015) +++ head/sys/netinet6/icmp6.c Tue Jun 12 22:18:20 2018 (r335016) @@ -1923,7 +1923,7 @@ icmp6_rip6_input(struct mbuf **mp, int off) } INP_INFO_RLOCK(&V_ripcbinfo); - LIST_FOREACH(in6p, &V_ripcb, inp_list) { + CK_LIST_FOREACH(in6p, &V_ripcb, inp_list) { if ((in6p->inp_vflag & INP_IPV6) == 0) continue; if (in6p->inp_ip_p != IPPROTO_ICMPV6) Modified: head/sys/netinet6/in6_pcb.c ============================================================================== --- head/sys/netinet6/in6_pcb.c Tue Jun 12 22:18:15 2018 (r335015) +++ head/sys/netinet6/in6_pcb.c Tue Jun 12 22:18:20 2018 (r335016) @@ -649,7 +649,7 @@ in6_pcbnotify(struct inpcbinfo *pcbinfo, struct sockad } errno = inet6ctlerrmap[cmd]; INP_INFO_WLOCK(pcbinfo); - LIST_FOREACH_SAFE(inp, pcbinfo->ipi_listhead, inp_list, inp_temp) { + CK_LIST_FOREACH_SAFE(inp, pcbinfo->ipi_listhead, inp_list, inp_temp) { INP_WLOCK(inp); if ((inp->inp_vflag & INP_IPV6) == 0) { INP_WUNLOCK(inp); @@ -726,7 +726,7 @@ in6_pcblookup_local(struct inpcbinfo *pcbinfo, struct head = &pcbinfo->ipi_hashbase[INP_PCBHASH( INP6_PCBHASHKEY(&in6addr_any), lport, 0, pcbinfo->ipi_hashmask)]; - LIST_FOREACH(inp, head, inp_hash) { + CK_LIST_FOREACH(inp, head, inp_hash) { /* XXX inp locking */ if ((inp->inp_vflag & INP_IPV6) == 0) continue; @@ -756,7 +756,7 @@ in6_pcblookup_local(struct inpcbinfo *pcbinfo, struct */ porthash = &pcbinfo->ipi_porthashbase[INP_PCBPORTHASH(lport, pcbinfo->ipi_porthashmask)]; - LIST_FOREACH(phd, porthash, phd_hash) { + CK_LIST_FOREACH(phd, porthash, phd_hash) { if (phd->phd_port == lport) break; } @@ -765,7 +765,7 @@ in6_pcblookup_local(struct inpcbinfo *pcbinfo, struct * Port is in use by one or more PCBs. Look for best * fit. */ - LIST_FOREACH(inp, &phd->phd_pcblist, inp_portlist) { + CK_LIST_FOREACH(inp, &phd->phd_pcblist, inp_portlist) { wildcard = 0; if (cred != NULL && !prison_equal_ip6(cred->cr_prison, @@ -807,7 +807,7 @@ in6_pcbpurgeif0(struct inpcbinfo *pcbinfo, struct ifne int i, gap; INP_INFO_WLOCK(pcbinfo); - LIST_FOREACH(in6p, pcbinfo->ipi_listhead, inp_list) { + CK_LIST_FOREACH(in6p, pcbinfo->ipi_listhead, inp_list) { INP_WLOCK(in6p); im6o = in6p->in6p_moptions; if ((in6p->inp_vflag & INP_IPV6) && im6o != NULL) { @@ -1149,7 +1149,7 @@ in6_pcblookup_hash_locked(struct inpcbinfo *pcbinfo, s tmpinp = NULL; head = &pcbinfo->ipi_hashbase[INP_PCBHASH( INP6_PCBHASHKEY(faddr), lport, fport, pcbinfo->ipi_hashmask)]; - LIST_FOREACH(inp, head, inp_hash) { + CK_LIST_FOREACH(inp, head, inp_hash) { /* XXX inp locking */ if ((inp->inp_vflag & INP_IPV6) == 0) continue; @@ -1201,7 +1201,7 @@ in6_pcblookup_hash_locked(struct inpcbinfo *pcbinfo, s head = &pcbinfo->ipi_hashbase[INP_PCBHASH( INP6_PCBHASHKEY(&in6addr_any), lport, 0, pcbinfo->ipi_hashmask)]; - LIST_FOREACH(inp, head, inp_hash) { + CK_LIST_FOREACH(inp, head, inp_hash) { /* XXX inp locking */ if ((inp->inp_vflag & INP_IPV6) == 0) continue; Modified: head/sys/netinet6/raw_ip6.c ============================================================================== --- head/sys/netinet6/raw_ip6.c Tue Jun 12 22:18:15 2018 (r335015) +++ head/sys/netinet6/raw_ip6.c Tue Jun 12 22:18:20 2018 (r335016) @@ -173,7 +173,7 @@ rip6_input(struct mbuf **mp, int *offp, int proto) ifp = m->m_pkthdr.rcvif; INP_INFO_RLOCK(&V_ripcbinfo); - LIST_FOREACH(in6p, &V_ripcb, inp_list) { + CK_LIST_FOREACH(in6p, &V_ripcb, inp_list) { /* XXX inp locking */ if ((in6p->inp_vflag & INP_IPV6) == 0) continue; Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Tue Jun 12 22:18:15 2018 (r335015) +++ head/sys/netinet6/udp6_usrreq.c Tue Jun 12 22:18:20 2018 (r335016) @@ -318,7 +318,7 @@ udp6_input(struct mbuf **mp, int *offp, int proto) */ pcblist = udp_get_pcblist(nxt); last = NULL; - LIST_FOREACH(inp, pcblist, inp_list) { + CK_LIST_FOREACH(inp, pcblist, inp_list) { if ((inp->inp_vflag & INP_IPV6) == 0) continue; if (inp->inp_lport != uh->uh_dport) From owner-svn-src-head@freebsd.org Tue Jun 12 22:18:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9317210036AD; Tue, 12 Jun 2018 22:18:32 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2C3867CB9B; Tue, 12 Jun 2018 22:18:30 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8552710AB3; Tue, 12 Jun 2018 22:18:28 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5CMISw2067804; Tue, 12 Jun 2018 22:18:28 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5CMIRe5067802; Tue, 12 Jun 2018 22:18:27 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806122218.w5CMIRe5067802@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Tue, 12 Jun 2018 22:18:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335017 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 335017 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 22:18:32 -0000 Author: mmacy Date: Tue Jun 12 22:18:27 2018 New Revision: 335017 URL: https://svnweb.freebsd.org/changeset/base/335017 Log: Defer inpcbport free until after a grace period has elapsed This is a dependency for inpcbinfo rlock conversion to epoch Modified: head/sys/netinet/in_pcb.c head/sys/netinet/in_pcb.h Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Tue Jun 12 22:18:20 2018 (r335016) +++ head/sys/netinet/in_pcb.c Tue Jun 12 22:18:27 2018 (r335017) @@ -1570,6 +1570,15 @@ in_pcblist_rele_rlocked(epoch_context_t ctx) } static void +inpcbport_free(epoch_context_t ctx) +{ + struct inpcbport *phd; + + phd = __containerof(ctx, struct inpcbport, phd_epoch_ctx); + free(phd, M_PCB); +} + +static void in_pcbfree_deferred(epoch_context_t ctx) { struct inpcb *inp; @@ -1598,7 +1607,6 @@ in_pcbfree_deferred(epoch_context_t ctx) #endif if (inp->inp_options) (void)m_free(inp->inp_options); - inp->inp_vflag = 0; crfree(inp->inp_cred); #ifdef MAC @@ -1682,7 +1690,7 @@ in_pcbdrop(struct inpcb *inp) CK_LIST_REMOVE(inp, inp_portlist); if (CK_LIST_FIRST(&phd->phd_pcblist) == NULL) { CK_LIST_REMOVE(phd, phd_hash); - free(phd, M_PCB); + epoch_call(net_epoch_preempt, &phd->phd_epoch_ctx, inpcbport_free); } INP_HASH_WUNLOCK(inp->inp_pcbinfo); inp->inp_flags &= ~INP_INHASHLIST; @@ -2552,6 +2560,7 @@ in_pcbinshash_internal(struct inpcb *inp, int do_pcbgr if (phd == NULL) { return (ENOBUFS); /* XXX */ } + bzero(&phd->phd_epoch_ctx, sizeof(struct epoch_context)); phd->phd_port = inp->inp_lport; CK_LIST_INIT(&phd->phd_pcblist); CK_LIST_INSERT_HEAD(pcbporthash, phd, phd_hash); Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Tue Jun 12 22:18:20 2018 (r335016) +++ head/sys/netinet/in_pcb.h Tue Jun 12 22:18:27 2018 (r335017) @@ -402,6 +402,7 @@ void in_pcbtoxinpcb(const struct inpcb *, struct xinpc #endif /* _SYS_SOCKETVAR_H_ */ struct inpcbport { + struct epoch_context phd_epoch_ctx; CK_LIST_ENTRY(inpcbport) phd_hash; struct inpcbhead phd_pcblist; u_short phd_port; From owner-svn-src-head@freebsd.org Tue Jun 12 22:48:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38B4F1006430; Tue, 12 Jun 2018 22:48:20 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF8C17DCF2; Tue, 12 Jun 2018 22:48:19 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C040510F7D; Tue, 12 Jun 2018 22:48:19 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5CMmJ3b083026; Tue, 12 Jun 2018 22:48:19 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5CMmJ3q083025; Tue, 12 Jun 2018 22:48:19 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201806122248.w5CMmJ3q083025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 12 Jun 2018 22:48:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335018 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 335018 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 22:48:20 -0000 Author: rmacklem Date: Tue Jun 12 22:48:19 2018 New Revision: 335018 URL: https://svnweb.freebsd.org/changeset/base/335018 Log: Version bump since r334930 changed the interface between the NFS modules, so they all need to be rebuilt. Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Tue Jun 12 22:18:27 2018 (r335017) +++ head/sys/sys/param.h Tue Jun 12 22:48:19 2018 (r335018) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200067 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200068 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Tue Jun 12 22:52:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E980E1006B84; Tue, 12 Jun 2018 22:52:27 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 97C8E7E1D4; Tue, 12 Jun 2018 22:52:27 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 790D51113A; Tue, 12 Jun 2018 22:52:27 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5CMqRHI087651; Tue, 12 Jun 2018 22:52:27 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5CMqRh8087650; Tue, 12 Jun 2018 22:52:27 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201806122252.w5CMqRh8087650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 12 Jun 2018 22:52:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335019 - head X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 335019 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 22:52:28 -0000 Author: rmacklem Date: Tue Jun 12 22:52:27 2018 New Revision: 335019 URL: https://svnweb.freebsd.org/changeset/base/335019 Log: Explain why a __FreeBSD_version bump was done for r334930. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue Jun 12 22:48:19 2018 (r335018) +++ head/UPDATING Tue Jun 12 22:52:27 2018 (r335019) @@ -32,6 +32,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20180612: + r334930 changed the interface between the NFS modules, so they all + need to be rebuilt. r335018 did a __FreeBSD_version bump for this. + 20180530: The kernel / userland interface for devinfo changed, so you'll need a new kernel and userland as a pair for it to work (rebuilding From owner-svn-src-head@freebsd.org Tue Jun 12 22:54:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 578561006E71; Tue, 12 Jun 2018 22:54:49 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C45D7E3CB; Tue, 12 Jun 2018 22:54:49 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DED4411149; Tue, 12 Jun 2018 22:54:48 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5CMsmBv087784; Tue, 12 Jun 2018 22:54:48 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5CMsmNG087783; Tue, 12 Jun 2018 22:54:48 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201806122254.w5CMsmNG087783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 12 Jun 2018 22:54:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335020 - head/sys/amd64/linux32 X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: head/sys/amd64/linux32 X-SVN-Commit-Revision: 335020 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 22:54:49 -0000 Author: jkim Date: Tue Jun 12 22:54:48 2018 New Revision: 335020 URL: https://svnweb.freebsd.org/changeset/base/335020 Log: Fix number of auxargs entries to copy out for 32-bit Linuxulator. PR: 228790 Modified: head/sys/amd64/linux32/linux32_sysvec.c Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Tue Jun 12 22:52:27 2018 (r335019) +++ head/sys/amd64/linux32/linux32_sysvec.c Tue Jun 12 22:54:48 2018 (r335020) @@ -249,9 +249,10 @@ linux_fixup_elf(register_t **stack_base, struct image_ free(imgp->auxargs, M_TEMP); imgp->auxargs = NULL; - KASSERT(pos - argarray <= AT_COUNT, ("Too many auxargs")); + KASSERT(pos - argarray <= LINUX_AT_COUNT, ("Too many auxargs")); - error = copyout(&argarray[0], auxbase, sizeof(*argarray) * AT_COUNT); + error = copyout(&argarray[0], auxbase, + sizeof(*argarray) * LINUX_AT_COUNT); free(argarray, M_TEMP); if (error != 0) return (error); From owner-svn-src-head@freebsd.org Tue Jun 12 23:21:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02EEA1009142; Tue, 12 Jun 2018 23:21:28 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it0-f68.google.com (mail-it0-f68.google.com [209.85.214.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D01F7F0EA; Tue, 12 Jun 2018 23:21:27 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-f68.google.com with SMTP id v83-v6so1531977itc.3; Tue, 12 Jun 2018 16:21:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5x9lg8cRobl7bkbkBuf0AJM0ETk3yK7ApDKmHK6QKLE=; b=eoow/lyDWQnfZsnTtan0npm9ienkD7010EoHR7uzmocQOd1084OIDG4db+arW/fvPY Sd4OueATmJKEXFRS2HWyuQqJucgI/0eh8rLOKZ/64eLsTZbBkEox9dqirDWTrOaNdC8C 6eJyPZVsLuBq0MIwHnVl1wYZrP/P202oFahuzvaswjcUrhOPZJnN4lA4km3Dc1W5tFQl IUDwQROybpeejpctELYijvm1MRshtuDFJlVGvew5rg8Uj+5cZGnk/wmHKnITthFaahZQ dVHgBQrz8/ZYAd/xHegVByLWblbBWrpOM6KAYC0nUfzAx48sG/cPmy+edPUMIB8jSjgz vlwQ== X-Gm-Message-State: APt69E26m4LEW4jji+r5Z2NkTK5+Pu0HWowe1kePKJl42jOQe27+RW25 DMk/CNaKavzou86g6k5Yz6fEy6i1IJJWaJ6CZSmqXw== X-Google-Smtp-Source: ADUXVKLMoHSX8GvLDZEdD8E7Qs12wmwtavUecG3/mUlfexiuECz0WMMtOgdGFUtgWF9p7TI37AnBn22fa56QuPk5xSg= X-Received: by 2002:a24:d984:: with SMTP id p126-v6mr2418616itg.49.1528845350772; Tue, 12 Jun 2018 16:15:50 -0700 (PDT) MIME-Version: 1.0 References: <201805221435.w4MEZXnW041963@repo.freebsd.org> In-Reply-To: From: Ed Maste Date: Tue, 12 Jun 2018 19:15:38 -0400 Message-ID: Subject: Re: svn commit: r334046 - head/tools/tools/intel-ucode-split To: Sean Bruno Cc: Oliver Pinter , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 23:21:28 -0000 On Tue, 12 Jun 2018 at 18:17, Sean Bruno wrote: > > On 06/12/18 16:05, Oliver Pinter wrote: > > On 5/22/18, Ed Maste wrote: > >> Author: emaste > >> Date: Tue May 22 14:35:33 2018 > >> New Revision: 334046 > >> URL: https://svnweb.freebsd.org/changeset/base/334046 > >> > >> Log: > >> intel-ucode-split: add -n flag to skip creating output files > >> > >> Sponsored by: The FreeBSD Foundation > >> > >> Modified: > >> head/tools/tools/intel-ucode-split/intel-ucode-split.c > > > > Hi! > > > > Could you please MFC the intel-ucode-split related commits to 11-STABLE? > > > > Thanks, > > op > > Do you need it in base for some reason? This code is already in the > devcpu-data port and is used when the port is built. Its not needed for > anything AFAIK. Indeed, the real use in FreeBSD is via the devcpu-data port; I committed it to src/tools/ for collaboration and testing. I'll merge it to stable/11 if it will be useful for someone, but am curious about the use case. From owner-svn-src-head@freebsd.org Tue Jun 12 23:26:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCC621009808; Tue, 12 Jun 2018 23:26:26 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8EF5E7F569; Tue, 12 Jun 2018 23:26:26 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C09411617; Tue, 12 Jun 2018 23:26:26 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5CNQQUB003270; Tue, 12 Jun 2018 23:26:26 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5CNQQnl003269; Tue, 12 Jun 2018 23:26:26 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806122326.w5CNQQnl003269@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Tue, 12 Jun 2018 23:26:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335021 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 335021 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 23:26:27 -0000 Author: mmacy Date: Tue Jun 12 23:26:25 2018 New Revision: 335021 URL: https://svnweb.freebsd.org/changeset/base/335021 Log: Defer inpcbport free in in_pcbremlists as well Modified: head/sys/netinet/in_pcb.c Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Tue Jun 12 22:54:48 2018 (r335020) +++ head/sys/netinet/in_pcb.c Tue Jun 12 23:26:25 2018 (r335021) @@ -2680,7 +2680,7 @@ in_pcbremlists(struct inpcb *inp) CK_LIST_REMOVE(inp, inp_portlist); if (CK_LIST_FIRST(&phd->phd_pcblist) == NULL) { CK_LIST_REMOVE(phd, phd_hash); - free(phd, M_PCB); + epoch_call(net_epoch_preempt, &phd->phd_epoch_ctx, inpcbport_free); } INP_HASH_WUNLOCK(pcbinfo); inp->inp_flags &= ~INP_INHASHLIST; From owner-svn-src-head@freebsd.org Tue Jun 12 23:46:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4DA6100B4B1 for ; Tue, 12 Jun 2018 23:46:35 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-yb0-x244.google.com (mail-yb0-x244.google.com [IPv6:2607:f8b0:4002:c09::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 603FF80110 for ; Tue, 12 Jun 2018 23:46:35 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-yb0-x244.google.com with SMTP id m137-v6so264797ybm.6 for ; Tue, 12 Jun 2018 16:46:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=r7S0C9CDH1PeGFXzMNv8gNmSXKUtRJluAuu7oOZlDOA=; b=rtx/0rx2jS1PYYHOnbVmewjhC21tzQ1qidYHPreka0AZ6tREloHZ9HWmcz0TdLq5sy 0jWcm9Zf8extWIRaAuitAkv8houOo8QPJR/X83t2a/L4gWvclg1/EBFeFvRdiTXVrSi1 0GU92mNlS03sHs8LVJ1eClWoKCDTzbCaAuSo1InNLh96UNK/hHg7/HbqWo4fY+BFFyCy tagyw9G/mwONGUDDECw/fY4opT4Ea1cID124bflP0GbPDATTjWa0uYB2fKJXo/r/IKFw gBeUGinXgUliWqCYDNHscce8iMa8eR6PuWFIIf3Z505EEc8eJ8ax8D4MoD/154HduT7O Ch7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=r7S0C9CDH1PeGFXzMNv8gNmSXKUtRJluAuu7oOZlDOA=; b=RTJ6GH65DNFFKfYU9pOh6XL2Eu3ydQLKp2AIq3qja6o4jBgyailECdVfgVJy1JZ+9U 50WEOOWiClM+lR2F4uA7MS4VNbsY0kNhMyNJt/o93RJsqMxEFXsnRLdcXv7b8S4Hibns lVGT5StU0FKi/JYUYm4eN2kQcUFx7nI1o7hUkJ0MvqamWBL3lqoMHiFR5pRX1fSI2583 dVA5B34ipTWj0iPrEUiP9vuYZtOPQJTmxjdX85zxy5KMgVc+bzBEuAMVQ/HkMhuQY7+I P8aZxr0eLjLSN5n5LMoWtCIsSTRf0ljaKmOU30K2/f3uMgHYMNNbIcrtYOogm4Vu4iZ0 MrWg== X-Gm-Message-State: APt69E2oHEMoCdqhzjCdgjWCuu/nkKNoCi/iEwi9vYDUzvFkFBqYFaqm JTts9JWz7+DThkWaV1Kx6DlNWZjyeRljWunshiHYkQ== X-Google-Smtp-Source: ADUXVKKi2rvcdsKZHkzaIdLpBgQgGoE5Su4dvtCDdrYZw04vJBHJ7e1X+jr2ILOjM6aSuFT2xtQZeoCNGPA11aqbxHU= X-Received: by 2002:a25:5c85:: with SMTP id q127-v6mr1327932ybb.29.1528847194654; Tue, 12 Jun 2018 16:46:34 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:db86:0:0:0:0:0 with HTTP; Tue, 12 Jun 2018 16:46:34 -0700 (PDT) In-Reply-To: References: <201805221435.w4MEZXnW041963@repo.freebsd.org> From: Oliver Pinter Date: Wed, 13 Jun 2018 01:46:34 +0200 Message-ID: Subject: Re: svn commit: r334046 - head/tools/tools/intel-ucode-split To: Ed Maste Cc: Sean Bruno , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 23:46:36 -0000 On Wednesday, June 13, 2018, Ed Maste wrote: > On Tue, 12 Jun 2018 at 18:17, Sean Bruno wrote: > > > > On 06/12/18 16:05, Oliver Pinter wrote: > > > On 5/22/18, Ed Maste wrote: > > >> Author: emaste > > >> Date: Tue May 22 14:35:33 2018 > > >> New Revision: 334046 > > >> URL: https://svnweb.freebsd.org/changeset/base/334046 > > >> > > >> Log: > > >> intel-ucode-split: add -n flag to skip creating output files > > >> > > >> Sponsored by: The FreeBSD Foundation > > >> > > >> Modified: > > >> head/tools/tools/intel-ucode-split/intel-ucode-split.c > > > > > > Hi! > > > > > > Could you please MFC the intel-ucode-split related commits to > 11-STABLE? > > > > > > Thanks, > > > op > > > > Do you need it in base for some reason? This code is already in the > > devcpu-data port and is used when the port is built. Its not needed for > > anything AFAIK. > > Indeed, the real use in FreeBSD is via the devcpu-data port; I > committed it to src/tools/ for collaboration and testing. I'll merge > it to stable/11 if it will be useful for someone, but am curious about > the use case. > I'm considering to write an in kernel microcode update facility, based on firmware(9), and in first idea it would be nice during the generation of firmware modules. From owner-svn-src-head@freebsd.org Tue Jun 12 23:47:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE839100B6FD; Tue, 12 Jun 2018 23:47:52 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f169.google.com (mail-io0-f169.google.com [209.85.223.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 60EE3802B6; Tue, 12 Jun 2018 23:47:52 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f169.google.com with SMTP id f1-v6so1455752ioh.6; Tue, 12 Jun 2018 16:47:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=4G/O1GWiuqrYgbrxjU71LqlEPySueLyZHMNFOtwD59k=; b=Dwdw336tCeyJA56tLI7smv6AOE/CuXNHLDTz8Nrwp27vsqrizhS8h9DmkjpDaJ49jM 90mzzZSifZ/u0VNINpWRyA3aOHMxPhnwkwZV7esMLFZLn8226qYKxVteM4e66ekRQvhc 37AOJ+Yaq/uzffM82OC/R9CH8RRC2fRZLmBua6//KdSIdSrQv4u5KZ1lCi2EeM5ECptq PcthMa2iFKAd+qNRL7+ELJaod5Y3Gzch0THZAyWABLx0j2Lm8RqDhhJ3OhaW2UvERtb/ 4AvfxjIq+DYyGfqveBMJFTBp3W3u/sHApP2NtAGOejNunRpYiOvhppwj7COIW5fgZm4+ ZUgw== X-Gm-Message-State: APt69E0Ea6pQUzvD6nI2+b4epknzZIulT0Vv7Qjcx3LLBFKRcH2u8FIC GOlvUeM1lFnLKwZsCOs5/ZEaoa/l X-Google-Smtp-Source: ADUXVKKj5KNWKbl8SJz5qE4skFbB4esOLOX5k0TgHC3FJX6CaSrKYYxh3VzZ4mCNot3S3jpyIpUXxA== X-Received: by 2002:a6b:ee17:: with SMTP id i23-v6mr2451246ioh.52.1528846801964; Tue, 12 Jun 2018 16:40:01 -0700 (PDT) Received: from mail-it0-f49.google.com (mail-it0-f49.google.com. [209.85.214.49]) by smtp.gmail.com with ESMTPSA id e92-v6sm479213iod.29.2018.06.12.16.40.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Jun 2018 16:40:01 -0700 (PDT) Received: by mail-it0-f49.google.com with SMTP id j135-v6so1590794itj.1; Tue, 12 Jun 2018 16:40:01 -0700 (PDT) X-Received: by 2002:a24:ed4a:: with SMTP id r71-v6mr2547402ith.53.1528846801728; Tue, 12 Jun 2018 16:40:01 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:5995:0:0:0:0:0 with HTTP; Tue, 12 Jun 2018 16:40:01 -0700 (PDT) In-Reply-To: <201806121858.w5CIwvwB066102@repo.freebsd.org> References: <201806121858.w5CIwvwB066102@repo.freebsd.org> From: Conrad Meyer Date: Tue, 12 Jun 2018 16:40:01 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335010 - head/usr.sbin/cpucontrol To: Sean Bruno Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 23:47:53 -0000 On Tue, Jun 12, 2018 at 11:58 AM, Sean Bruno wrote: > Author: sbruno > Date: Tue Jun 12 18:58:56 2018 > New Revision: 335010 > URL: https://svnweb.freebsd.org/changeset/base/335010 > > Log: > cpucontrol: > - fix debugging for family on AMD cpus and add useful debugging for > which file is being selected for update. > > Reviewed by: cem > Sponsored by: Limelight Networks > Differential Revision: https://reviews.freebsd.org/D15574 > > Modified: > head/usr.sbin/cpucontrol/amd10h.c > > Modified: head/usr.sbin/cpucontrol/amd10h.c > ============================================================================== > --- head/usr.sbin/cpucontrol/amd10h.c Tue Jun 12 18:42:41 2018 (r335009) > +++ head/usr.sbin/cpucontrol/amd10h.c Tue Jun 12 18:58:56 2018 (r335010) > @@ -139,7 +139,8 @@ amd10h_update(const char *dev, const char *path) > > WARNX(1, "found cpu family %#x model %#x " > "stepping %#x extfamily %#x extmodel %#x.", > - (signature >> 8) & 0x0f, (signature >> 4) & 0x0f, > + ((signature >> 8) & 0x0f) + ((signature >> 20) & 0xff), > + (signature >> 4) & 0x0f, Hm, I suggested using CPUID_TO_FAMILY() here and would still suggest that. At least some of the other shifts and masks can probably also be replaced with existing named macros. Best, Conrad From owner-svn-src-head@freebsd.org Tue Jun 12 23:52:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FD65100BF71; Tue, 12 Jun 2018 23:52:55 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0AEDF80810; Tue, 12 Jun 2018 23:52:54 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 342785A9F12; Tue, 12 Jun 2018 23:52:53 +0000 (UTC) Date: Tue, 12 Jun 2018 23:52:53 +0000 From: Brooks Davis To: Jung-uk Kim Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335020 - head/sys/amd64/linux32 Message-ID: <20180612235253.GA49401@spindle.one-eyed-alien.net> References: <201806122254.w5CMsmNG087783@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SUOF0GtieIMvvwua" Content-Disposition: inline In-Reply-To: <201806122254.w5CMsmNG087783@repo.freebsd.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 23:52:55 -0000 --SUOF0GtieIMvvwua Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 12, 2018 at 10:54:48PM +0000, Jung-uk Kim wrote: > Author: jkim > Date: Tue Jun 12 22:54:48 2018 > New Revision: 335020 > URL: https://svnweb.freebsd.org/changeset/base/335020 >=20 > Log: > Fix number of auxargs entries to copy out for 32-bit Linuxulator. > =20 > PR: 228790 >=20 > Modified: > head/sys/amd64/linux32/linux32_sysvec.c >=20 > Modified: head/sys/amd64/linux32/linux32_sysvec.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/amd64/linux32/linux32_sysvec.c Tue Jun 12 22:52:27 2018 (r33= 5019) > +++ head/sys/amd64/linux32/linux32_sysvec.c Tue Jun 12 22:54:48 2018 (r33= 5020) > @@ -249,9 +249,10 @@ linux_fixup_elf(register_t **stack_base, struct imag= e_ > =20 > free(imgp->auxargs, M_TEMP); > imgp->auxargs =3D NULL; > - KASSERT(pos - argarray <=3D AT_COUNT, ("Too many auxargs")); > + KASSERT(pos - argarray <=3D LINUX_AT_COUNT, ("Too many auxargs")); > =20 > - error =3D copyout(&argarray[0], auxbase, sizeof(*argarray) * AT_COUNT); > + error =3D copyout(&argarray[0], auxbase, > + sizeof(*argarray) * LINUX_AT_COUNT); > free(argarray, M_TEMP); > if (error !=3D 0) > return (error); Thanks for tracking this down! Sorry for the breakage. -- Brooks --SUOF0GtieIMvvwua Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJbIFzUAAoJEKzQXbSebgfAuWsH/1va6wz4X44jX0/astnWQQEe 1ov8oIz05TG2p6xGtxtsTRDeEELf7/tIQ5wr3VLnmOwOvSnHRlXlTIxxXvDqEJ04 NFCw73jumkLGnvTHD69rMmCHUC1tkHvxh2eSoUYE2EjdjpCDyKBi/LHsZzlMHZ2B fmqmG7hGtl6VbAWfRwLBwvudrQdPOLsuFO7T9APHIZ84T8j/oCWHtYLtULfYHDUj fQEvq9ZVM8NSqCP6QOu/9Vhw6kELfTpdWNnw0Lyjeww2EPhgERFycW/lRUwfeG8v UUu0SKogqGK3vswvhscqkxhJx/2Ruav3sVrvJ7f1ARQUkgBx+vecVeN0XKfslAA= =kTp3 -----END PGP SIGNATURE----- --SUOF0GtieIMvvwua-- From owner-svn-src-head@freebsd.org Tue Jun 12 23:54:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD2AF100C134; Tue, 12 Jun 2018 23:54:09 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 60159809DD; Tue, 12 Jun 2018 23:54:09 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 412B811B2E; Tue, 12 Jun 2018 23:54:09 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5CNs99s018103; Tue, 12 Jun 2018 23:54:09 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5CNs9gO018102; Tue, 12 Jun 2018 23:54:09 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201806122354.w5CNs9gO018102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Tue, 12 Jun 2018 23:54:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335022 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: rrs X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 335022 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 23:54:09 -0000 Author: rrs Date: Tue Jun 12 23:54:08 2018 New Revision: 335022 URL: https://svnweb.freebsd.org/changeset/base/335022 Log: This fixes missing VNET sets in the hpts system. Basically without this and running vnets with a TCP stack that uses some of the features is a recipe for panic (without this commit). Reported by: Larry Rosenman Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D15757 Modified: head/sys/netinet/tcp_hpts.c Modified: head/sys/netinet/tcp_hpts.c ============================================================================== --- head/sys/netinet/tcp_hpts.c Tue Jun 12 23:26:25 2018 (r335021) +++ head/sys/netinet/tcp_hpts.c Tue Jun 12 23:54:08 2018 (r335022) @@ -1215,7 +1215,9 @@ tcp_input_data(struct tcp_hpts_entry *hpts, struct tim hpts->p_inp = inp; drop_reason = inp->inp_hpts_drop_reas; inp->inp_in_input = 0; + tp = intotcpcb(inp); mtx_unlock(&hpts->p_mtx); + CURVNET_SET(tp->t_vnet); if (drop_reason) { INP_INFO_RLOCK(&V_tcbinfo); ti_locked = TI_RLOCKED; @@ -1234,10 +1236,10 @@ out: INP_WUNLOCK(inp); } ti_locked = TI_UNLOCKED; + CURVNET_RESTORE(); mtx_lock(&hpts->p_mtx); continue; } - tp = intotcpcb(inp); if ((tp == NULL) || (tp->t_inpcb == NULL)) { goto out; } @@ -1262,6 +1264,7 @@ out: } if (in_pcbrele_wlocked(inp) == 0) INP_WUNLOCK(inp); + CURVNET_RESTORE(); mtx_lock(&hpts->p_mtx); continue; } @@ -1282,7 +1285,6 @@ out: */ tcp_set_hpts(inp); } - CURVNET_SET(tp->t_vnet); m = tp->t_in_pkt; n = NULL; if (m != NULL && @@ -1366,7 +1368,6 @@ out: if (m) n = m->m_nextpkt; } - CURVNET_RESTORE(); goto out; } /* From owner-svn-src-head@freebsd.org Wed Jun 13 00:45:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA1351010A42; Wed, 13 Jun 2018 00:45:36 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9FF8A82790; Wed, 13 Jun 2018 00:45:36 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8131F1236C; Wed, 13 Jun 2018 00:45:36 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5D0ja3s043624; Wed, 13 Jun 2018 00:45:36 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5D0jaVk043623; Wed, 13 Jun 2018 00:45:36 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806130045.w5D0jaVk043623@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Wed, 13 Jun 2018 00:45:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335023 - head/bin/ps X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/bin/ps X-SVN-Commit-Revision: 335023 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 00:45:37 -0000 Author: eadler Date: Wed Jun 13 00:45:35 2018 New Revision: 335023 URL: https://svnweb.freebsd.org/changeset/base/335023 Log: ps(1): fix some nits - fracmem and mempages are double. ki_rssize should be too - remove default case that is fully covered by all existing cases - mark usage as dead Modified: head/bin/ps/print.c head/bin/ps/ps.c Modified: head/bin/ps/print.c ============================================================================== --- head/bin/ps/print.c Tue Jun 12 23:54:08 2018 (r335022) +++ head/bin/ps/print.c Wed Jun 13 00:45:35 2018 (r335023) @@ -662,7 +662,7 @@ getpmem(KINFO *k) return (0.0); /* XXX want pmap ptpages, segtab, etc. (per architecture) */ /* XXX don't have info about shared */ - fracmem = ((float)k->ki_p->ki_rssize) / mempages; + fracmem = ((double)k->ki_p->ki_rssize) / mempages; return (100.0 * fracmem); } @@ -771,8 +771,6 @@ printval(void *bp, VAR *v) case PGTOK: (void)asprintf(&str, ofmt, ps_pgtok(*(u_long *)bp)); break; - default: - xo_errx(1, "unknown type %d", v->type); } return (str); Modified: head/bin/ps/ps.c ============================================================================== --- head/bin/ps/ps.c Tue Jun 12 23:54:08 2018 (r335022) +++ head/bin/ps/ps.c Wed Jun 13 00:45:35 2018 (r335023) @@ -689,7 +689,7 @@ main(int argc, char *argv[]) (STAILQ_NEXT(vent, next_ve) == NULL && (vent->var->flag & LJUST))) ? 0 : vent->var->width; snprintf(fmtbuf, sizeof(fmtbuf), "{:%s/%%%s%d..%ds}", - vent->var->field ?: vent->var->name, + vent->var->field ? vent->var->field : vent->var->name, (vent->var->flag & LJUST) ? "-" : "", fwidthmin, fwidthmax); xo_emit(fmtbuf, str); @@ -1448,7 +1448,7 @@ pidmax_init(void) } } -static void +static void __dead2 usage(void) { #define SINGLE_OPTS "[-aCcde" OPT_LAZY_f "HhjlmrSTuvwXxZ]" From owner-svn-src-head@freebsd.org Wed Jun 13 00:45:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C4FC1010A6D; Wed, 13 Jun 2018 00:45:40 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 04C80827A8; Wed, 13 Jun 2018 00:45:40 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D00171236D; Wed, 13 Jun 2018 00:45:39 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5D0jdtd043670; Wed, 13 Jun 2018 00:45:39 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5D0jdO1043666; Wed, 13 Jun 2018 00:45:39 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806130045.w5D0jdO1043666@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Wed, 13 Jun 2018 00:45:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335024 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 335024 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 00:45:40 -0000 Author: eadler Date: Wed Jun 13 00:45:38 2018 New Revision: 335024 URL: https://svnweb.freebsd.org/changeset/base/335024 Log: top(1): several small bugfixes and nits - initialize all maybe uninitialized vars with bogus values. This shuts up the compiler, and causes crashes if it changes later. - mark noreturn as noreturn - removed unused macro - handle x_procstate as runtime rather than pre-processor - avoid using void functions in condtionals Tested with clang, gcc 7, gcc 9 Modified: head/usr.bin/top/Makefile head/usr.bin/top/display.c head/usr.bin/top/machine.c head/usr.bin/top/top.c Modified: head/usr.bin/top/Makefile ============================================================================== --- head/usr.bin/top/Makefile Wed Jun 13 00:45:35 2018 (r335023) +++ head/usr.bin/top/Makefile Wed Jun 13 00:45:38 2018 (r335024) @@ -9,8 +9,7 @@ MAN= top.1 .if ${COMPILER_TYPE} == "gcc" .if ${COMPILER_VERSION} >= 50000 -CFLAGS.gcc=-Wno-error=cast-qual -Wno-error=discarded-qualifiers -Wno-error=incompatible-pointer-types \ - -Wno-error=maybe-uninitialized +CFLAGS.gcc=-Wno-error=cast-qual -Wno-error=discarded-qualifiers -Wno-error=incompatible-pointer-types .else #base gcc NO_WERROR= .endif Modified: head/usr.bin/top/display.c ============================================================================== --- head/usr.bin/top/display.c Wed Jun 13 00:45:35 2018 (r335023) +++ head/usr.bin/top/display.c Wed Jun 13 00:45:38 2018 (r335024) @@ -377,12 +377,13 @@ u_procstates(int total, int *brkdn) if (ltotal != total) { /* move and overwrite */ -#if (x_procstate == 0) +if (x_procstate == 0) { Move_to(x_procstate, y_procstate); -#else +} +else { /* cursor is already there...no motion needed */ - /* assert(lastline == 1); */ -#endif + assert(lastline == 1); +} printf("%d", total); /* if number of digits differs, rewrite the label */ @@ -955,11 +956,14 @@ new_message(int type, const char *msgfmt, ...) i = strlen(next_msg); if ((type & MT_delayed) == 0) { - type & MT_standout ? top_standout(next_msg) : - fputs(next_msg, stdout); - (void) clear_eol(msglen - i); - msglen = i; - next_msg[0] = '\0'; + if (type & MT_standout) { + top_standout(next_msg); + } else { + fputs(next_msg, stdout); + } + clear_eol(msglen - i); + msglen = i; + next_msg[0] = '\0'; } } } @@ -967,7 +971,11 @@ new_message(int type, const char *msgfmt, ...) { if ((type & MT_delayed) == 0) { - type & MT_standout ? top_standout(next_msg) : fputs(next_msg, stdout); + if (type & MT_standout) { + top_standout(next_msg); + } else { + fputs(next_msg, stdout); + } msglen = strlen(next_msg); next_msg[0] = '\0'; } Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Wed Jun 13 00:45:35 2018 (r335023) +++ head/usr.bin/top/machine.c Wed Jun 13 00:45:38 2018 (r335024) @@ -79,8 +79,6 @@ struct handle { #define PROCSIZE(pp) ((pp)->ki_size / 1024) #define RU(pp) (&(pp)->ki_rusage) -#define RUTOT(pp) \ - (RU(pp)->ru_inblock + RU(pp)->ru_oublock + RU(pp)->ru_majflt) #define PCTCPU(pp) (pcpu[pp - pbase]) Modified: head/usr.bin/top/top.c ============================================================================== --- head/usr.bin/top/top.c Wed Jun 13 00:45:35 2018 (r335023) +++ head/usr.bin/top/top.c Wed Jun 13 00:45:38 2018 (r335024) @@ -245,8 +245,8 @@ main(int argc, char *argv[]) char *env_top; const char **preset_argv; int preset_argc = 0; - const char **av; - int ac; + const char **av = NULL; + int ac = -1; bool dostates = false; bool do_unames = true; char interactive = 2; @@ -1230,7 +1230,7 @@ top_winch(int i __unused) /* SIGWINCH handler */ winchflag = 1; } -void +void __dead2 quit(int status) /* exit under duress */ { end_screen(); From owner-svn-src-head@freebsd.org Wed Jun 13 03:22:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7680101CEBD; Wed, 13 Jun 2018 03:22:15 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 770876843C; Wed, 13 Jun 2018 03:22:15 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E2EC13DB0; Wed, 13 Jun 2018 03:22:15 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5D3MFNk025756; Wed, 13 Jun 2018 03:22:15 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5D3M8is025029; Wed, 13 Jun 2018 03:22:08 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201806130322.w5D3M8is025029@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Wed, 13 Jun 2018 03:22:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335025 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 335025 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 03:22:16 -0000 Author: araujo Date: Wed Jun 13 03:22:08 2018 New Revision: 335025 URL: https://svnweb.freebsd.org/changeset/base/335025 Log: Add SPDX tags to bhyve(8). Discussed with: rgrimes, pfg and mav. Obtained from: TrueOS MFC after: 4 weeks. Sponsored by: iXsystems Inc. Modified: head/usr.sbin/bhyve/atkbdc.c head/usr.sbin/bhyve/bhyvegc.h head/usr.sbin/bhyve/bootrom.c head/usr.sbin/bhyve/bootrom.h head/usr.sbin/bhyve/console.c head/usr.sbin/bhyve/console.h head/usr.sbin/bhyve/fwctl.c head/usr.sbin/bhyve/fwctl.h head/usr.sbin/bhyve/pci_e82545.c head/usr.sbin/bhyve/pci_fbuf.c head/usr.sbin/bhyve/pci_irq.c head/usr.sbin/bhyve/pci_irq.h head/usr.sbin/bhyve/pci_virtio_console.c head/usr.sbin/bhyve/pci_virtio_rnd.c head/usr.sbin/bhyve/pci_xhci.c head/usr.sbin/bhyve/pci_xhci.h head/usr.sbin/bhyve/ps2kbd.c head/usr.sbin/bhyve/ps2kbd.h head/usr.sbin/bhyve/ps2mouse.c head/usr.sbin/bhyve/ps2mouse.h head/usr.sbin/bhyve/rfb.c head/usr.sbin/bhyve/rfb.h head/usr.sbin/bhyve/sockstream.c head/usr.sbin/bhyve/sockstream.h head/usr.sbin/bhyve/task_switch.c head/usr.sbin/bhyve/usb_emul.c head/usr.sbin/bhyve/usb_emul.h head/usr.sbin/bhyve/usb_mouse.c head/usr.sbin/bhyve/vga.c head/usr.sbin/bhyve/vga.h Modified: head/usr.sbin/bhyve/atkbdc.c ============================================================================== --- head/usr.sbin/bhyve/atkbdc.c Wed Jun 13 00:45:38 2018 (r335024) +++ head/usr.sbin/bhyve/atkbdc.c Wed Jun 13 03:22:08 2018 (r335025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2014 Tycho Nightingale * Copyright (c) 2015 Nahanni Systems Inc. * All rights reserved. Modified: head/usr.sbin/bhyve/bhyvegc.h ============================================================================== --- head/usr.sbin/bhyve/bhyvegc.h Wed Jun 13 00:45:38 2018 (r335024) +++ head/usr.sbin/bhyve/bhyvegc.h Wed Jun 13 03:22:08 2018 (r335025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2015 Tycho Nightingale * All rights reserved. * Modified: head/usr.sbin/bhyve/bootrom.c ============================================================================== --- head/usr.sbin/bhyve/bootrom.c Wed Jun 13 00:45:38 2018 (r335024) +++ head/usr.sbin/bhyve/bootrom.c Wed Jun 13 03:22:08 2018 (r335025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2015 Neel Natu * All rights reserved. * Modified: head/usr.sbin/bhyve/bootrom.h ============================================================================== --- head/usr.sbin/bhyve/bootrom.h Wed Jun 13 00:45:38 2018 (r335024) +++ head/usr.sbin/bhyve/bootrom.h Wed Jun 13 03:22:08 2018 (r335025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2015 Neel Natu * All rights reserved. * Modified: head/usr.sbin/bhyve/console.c ============================================================================== --- head/usr.sbin/bhyve/console.c Wed Jun 13 00:45:38 2018 (r335024) +++ head/usr.sbin/bhyve/console.c Wed Jun 13 03:22:08 2018 (r335025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2015 Tycho Nightingale * All rights reserved. * Modified: head/usr.sbin/bhyve/console.h ============================================================================== --- head/usr.sbin/bhyve/console.h Wed Jun 13 00:45:38 2018 (r335024) +++ head/usr.sbin/bhyve/console.h Wed Jun 13 03:22:08 2018 (r335025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2015 Tycho Nightingale * All rights reserved. * Modified: head/usr.sbin/bhyve/fwctl.c ============================================================================== --- head/usr.sbin/bhyve/fwctl.c Wed Jun 13 00:45:38 2018 (r335024) +++ head/usr.sbin/bhyve/fwctl.c Wed Jun 13 03:22:08 2018 (r335025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2015 Peter Grehan * All rights reserved. * Modified: head/usr.sbin/bhyve/fwctl.h ============================================================================== --- head/usr.sbin/bhyve/fwctl.h Wed Jun 13 00:45:38 2018 (r335024) +++ head/usr.sbin/bhyve/fwctl.h Wed Jun 13 03:22:08 2018 (r335025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2015 Peter Grehan * All rights reserved. * Modified: head/usr.sbin/bhyve/pci_e82545.c ============================================================================== --- head/usr.sbin/bhyve/pci_e82545.c Wed Jun 13 00:45:38 2018 (r335024) +++ head/usr.sbin/bhyve/pci_e82545.c Wed Jun 13 03:22:08 2018 (r335025) @@ -1,4 +1,6 @@ /* + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2016 Alexander Motin * Copyright (c) 2015 Peter Grehan * Copyright (c) 2013 Jeremiah Lott, Avere Systems Modified: head/usr.sbin/bhyve/pci_fbuf.c ============================================================================== --- head/usr.sbin/bhyve/pci_fbuf.c Wed Jun 13 00:45:38 2018 (r335024) +++ head/usr.sbin/bhyve/pci_fbuf.c Wed Jun 13 03:22:08 2018 (r335025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2015 Nahanni Systems, Inc. * All rights reserved. * Modified: head/usr.sbin/bhyve/pci_irq.c ============================================================================== --- head/usr.sbin/bhyve/pci_irq.c Wed Jun 13 00:45:38 2018 (r335024) +++ head/usr.sbin/bhyve/pci_irq.c Wed Jun 13 03:22:08 2018 (r335025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2014 Hudson River Trading LLC * Written by: John H. Baldwin * All rights reserved. Modified: head/usr.sbin/bhyve/pci_irq.h ============================================================================== --- head/usr.sbin/bhyve/pci_irq.h Wed Jun 13 00:45:38 2018 (r335024) +++ head/usr.sbin/bhyve/pci_irq.h Wed Jun 13 03:22:08 2018 (r335025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2014 Hudson River Trading LLC * Written by: John H. Baldwin * All rights reserved. Modified: head/usr.sbin/bhyve/pci_virtio_console.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_console.c Wed Jun 13 00:45:38 2018 (r335024) +++ head/usr.sbin/bhyve/pci_virtio_console.c Wed Jun 13 03:22:08 2018 (r335025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2016 iXsystems Inc. * All rights reserved. * Modified: head/usr.sbin/bhyve/pci_virtio_rnd.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_rnd.c Wed Jun 13 00:45:38 2018 (r335024) +++ head/usr.sbin/bhyve/pci_virtio_rnd.c Wed Jun 13 03:22:08 2018 (r335025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2014 Nahanni Systems Inc. * All rights reserved. * Modified: head/usr.sbin/bhyve/pci_xhci.c ============================================================================== --- head/usr.sbin/bhyve/pci_xhci.c Wed Jun 13 00:45:38 2018 (r335024) +++ head/usr.sbin/bhyve/pci_xhci.c Wed Jun 13 03:22:08 2018 (r335025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2014 Leon Dang * All rights reserved. * Modified: head/usr.sbin/bhyve/pci_xhci.h ============================================================================== --- head/usr.sbin/bhyve/pci_xhci.h Wed Jun 13 00:45:38 2018 (r335024) +++ head/usr.sbin/bhyve/pci_xhci.h Wed Jun 13 03:22:08 2018 (r335025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2014 Leon Dang * All rights reserved. * Modified: head/usr.sbin/bhyve/ps2kbd.c ============================================================================== --- head/usr.sbin/bhyve/ps2kbd.c Wed Jun 13 00:45:38 2018 (r335024) +++ head/usr.sbin/bhyve/ps2kbd.c Wed Jun 13 03:22:08 2018 (r335025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2015 Tycho Nightingale * Copyright (c) 2015 Nahanni Systems Inc. * All rights reserved. Modified: head/usr.sbin/bhyve/ps2kbd.h ============================================================================== --- head/usr.sbin/bhyve/ps2kbd.h Wed Jun 13 00:45:38 2018 (r335024) +++ head/usr.sbin/bhyve/ps2kbd.h Wed Jun 13 03:22:08 2018 (r335025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2015 Tycho Nightingale * All rights reserved. * Modified: head/usr.sbin/bhyve/ps2mouse.c ============================================================================== --- head/usr.sbin/bhyve/ps2mouse.c Wed Jun 13 00:45:38 2018 (r335024) +++ head/usr.sbin/bhyve/ps2mouse.c Wed Jun 13 03:22:08 2018 (r335025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2015 Tycho Nightingale * Copyright (c) 2015 Nahanni Systems Inc. * All rights reserved. Modified: head/usr.sbin/bhyve/ps2mouse.h ============================================================================== --- head/usr.sbin/bhyve/ps2mouse.h Wed Jun 13 00:45:38 2018 (r335024) +++ head/usr.sbin/bhyve/ps2mouse.h Wed Jun 13 03:22:08 2018 (r335025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2015 Tycho Nightingale * All rights reserved. * Modified: head/usr.sbin/bhyve/rfb.c ============================================================================== --- head/usr.sbin/bhyve/rfb.c Wed Jun 13 00:45:38 2018 (r335024) +++ head/usr.sbin/bhyve/rfb.c Wed Jun 13 03:22:08 2018 (r335025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2015 Tycho Nightingale * Copyright (c) 2015 Leon Dang * All rights reserved. Modified: head/usr.sbin/bhyve/rfb.h ============================================================================== --- head/usr.sbin/bhyve/rfb.h Wed Jun 13 00:45:38 2018 (r335024) +++ head/usr.sbin/bhyve/rfb.h Wed Jun 13 03:22:08 2018 (r335025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2015 Tycho Nightingale * All rights reserved. * Modified: head/usr.sbin/bhyve/sockstream.c ============================================================================== --- head/usr.sbin/bhyve/sockstream.c Wed Jun 13 00:45:38 2018 (r335024) +++ head/usr.sbin/bhyve/sockstream.c Wed Jun 13 03:22:08 2018 (r335025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2015 Nahanni Systems, Inc. * All rights reserved. * Modified: head/usr.sbin/bhyve/sockstream.h ============================================================================== --- head/usr.sbin/bhyve/sockstream.h Wed Jun 13 00:45:38 2018 (r335024) +++ head/usr.sbin/bhyve/sockstream.h Wed Jun 13 03:22:08 2018 (r335025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2015 Nahanni Systems, Inc. * All rights reserved. * Modified: head/usr.sbin/bhyve/task_switch.c ============================================================================== --- head/usr.sbin/bhyve/task_switch.c Wed Jun 13 00:45:38 2018 (r335024) +++ head/usr.sbin/bhyve/task_switch.c Wed Jun 13 03:22:08 2018 (r335025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2014 Neel Natu * All rights reserved. * Modified: head/usr.sbin/bhyve/usb_emul.c ============================================================================== --- head/usr.sbin/bhyve/usb_emul.c Wed Jun 13 00:45:38 2018 (r335024) +++ head/usr.sbin/bhyve/usb_emul.c Wed Jun 13 03:22:08 2018 (r335025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2014 Nahanni Systems Inc. * All rights reserved. * Modified: head/usr.sbin/bhyve/usb_emul.h ============================================================================== --- head/usr.sbin/bhyve/usb_emul.h Wed Jun 13 00:45:38 2018 (r335024) +++ head/usr.sbin/bhyve/usb_emul.h Wed Jun 13 03:22:08 2018 (r335025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2014 Leon Dang * All rights reserved. * Modified: head/usr.sbin/bhyve/usb_mouse.c ============================================================================== --- head/usr.sbin/bhyve/usb_mouse.c Wed Jun 13 00:45:38 2018 (r335024) +++ head/usr.sbin/bhyve/usb_mouse.c Wed Jun 13 03:22:08 2018 (r335025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2014 Leon Dang * All rights reserved. * Modified: head/usr.sbin/bhyve/vga.c ============================================================================== --- head/usr.sbin/bhyve/vga.c Wed Jun 13 00:45:38 2018 (r335024) +++ head/usr.sbin/bhyve/vga.c Wed Jun 13 03:22:08 2018 (r335025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2015 Tycho Nightingale * All rights reserved. * Modified: head/usr.sbin/bhyve/vga.h ============================================================================== --- head/usr.sbin/bhyve/vga.h Wed Jun 13 00:45:38 2018 (r335024) +++ head/usr.sbin/bhyve/vga.h Wed Jun 13 03:22:08 2018 (r335025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2015 Tycho Nightingale * All rights reserved. * From owner-svn-src-head@freebsd.org Wed Jun 13 03:35:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A695E101DDD9; Wed, 13 Jun 2018 03:35:25 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B3E268C63; Wed, 13 Jun 2018 03:35:25 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C7F713F90; Wed, 13 Jun 2018 03:35:25 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5D3ZPrs031091; Wed, 13 Jun 2018 03:35:25 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5D3ZO9W031089; Wed, 13 Jun 2018 03:35:24 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201806130335.w5D3ZO9W031089@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Wed, 13 Jun 2018 03:35:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335026 - in head/usr.sbin: bhyvectl bhyveload X-SVN-Group: head X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: in head/usr.sbin: bhyvectl bhyveload X-SVN-Commit-Revision: 335026 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 03:35:25 -0000 Author: araujo Date: Wed Jun 13 03:35:24 2018 New Revision: 335026 URL: https://svnweb.freebsd.org/changeset/base/335026 Log: style(9) remove unnecessary blank tabs. Obtained from: TrueOS MFC after: 4 weeks. Sponsored by: iXsystems Inc. Modified: head/usr.sbin/bhyvectl/bhyvectl.c head/usr.sbin/bhyveload/bhyveload.c Modified: head/usr.sbin/bhyvectl/bhyvectl.c ============================================================================== --- head/usr.sbin/bhyvectl/bhyvectl.c Wed Jun 13 03:22:08 2018 (r335025) +++ head/usr.sbin/bhyvectl/bhyvectl.c Wed Jun 13 03:35:24 2018 (r335026) @@ -848,7 +848,7 @@ get_all_registers(struct vmctx *ctx, int vcpu) if (error == 0) printf("rflags[%d]\t0x%016lx\n", vcpu, rflags); } - + return (error); } @@ -1115,7 +1115,7 @@ get_misc_vmcs(struct vmctx *ctx, int vcpu) vcpu, u64); } } - + if (!error && (get_tpr_threshold || get_all)) { uint64_t threshold; error = vm_get_vmcs_field(ctx, vcpu, VMCS_TPR_THRESHOLD, @@ -1133,7 +1133,7 @@ get_misc_vmcs(struct vmctx *ctx, int vcpu) vcpu, insterr); } } - + if (!error && (get_exit_ctls || get_all)) { error = vm_get_vmcs_field(ctx, vcpu, VMCS_EXIT_CTLS, &ctl); if (error == 0) @@ -1181,7 +1181,7 @@ get_misc_vmcs(struct vmctx *ctx, int vcpu) if (error == 0) printf("host_rsp[%d]\t\t0x%016lx\n", vcpu, rsp); } - + if (!error && (get_vmcs_link || get_all)) { error = vm_get_vmcs_field(ctx, vcpu, VMCS_LINK_POINTER, &addr); if (error == 0) Modified: head/usr.sbin/bhyveload/bhyveload.c ============================================================================== --- head/usr.sbin/bhyveload/bhyveload.c Wed Jun 13 03:22:08 2018 (r335025) +++ head/usr.sbin/bhyveload/bhyveload.c Wed Jun 13 03:35:24 2018 (r335026) @@ -365,7 +365,7 @@ cb_setreg(void *arg, int r, uint64_t v) { int error; enum vm_reg_name vmreg; - + vmreg = VM_REG_LAST; switch (r) { From owner-svn-src-head@freebsd.org Wed Jun 13 04:00:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6F53101FAF0; Wed, 13 Jun 2018 04:00:22 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6716B6987B; Wed, 13 Jun 2018 04:00:22 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4787C14305; Wed, 13 Jun 2018 04:00:22 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5D40M68041227; Wed, 13 Jun 2018 04:00:22 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5D40MCe041226; Wed, 13 Jun 2018 04:00:22 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201806130400.w5D40MCe041226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Wed, 13 Jun 2018 04:00:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335027 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 335027 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 04:00:22 -0000 Author: araujo Date: Wed Jun 13 04:00:21 2018 New Revision: 335027 URL: https://svnweb.freebsd.org/changeset/base/335027 Log: When this code was introduced at r300829 the author forgot to add the BSD license header that is the same as in its C header file. MFC after: 4 weeks. Sponsored by: iXsystems Inc. Modified: head/usr.sbin/bhyve/bhyvegc.c Modified: head/usr.sbin/bhyve/bhyvegc.c ============================================================================== --- head/usr.sbin/bhyve/bhyvegc.c Wed Jun 13 03:35:24 2018 (r335026) +++ head/usr.sbin/bhyve/bhyvegc.c Wed Jun 13 04:00:21 2018 (r335027) @@ -1,3 +1,31 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2015 Tycho Nightingale + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + #include __FBSDID("$FreeBSD$"); From owner-svn-src-head@freebsd.org Wed Jun 13 04:23:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 883BD1021B78; Wed, 13 Jun 2018 04:23:50 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3B1F86A97A; Wed, 13 Jun 2018 04:23:50 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1DD50147DE; Wed, 13 Jun 2018 04:23:50 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5D4NnJl056279; Wed, 13 Jun 2018 04:23:49 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5D4Nnmp056278; Wed, 13 Jun 2018 04:23:49 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806130423.w5D4Nnmp056278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Wed, 13 Jun 2018 04:23:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335028 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 335028 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 04:23:50 -0000 Author: mmacy Date: Wed Jun 13 04:23:49 2018 New Revision: 335028 URL: https://svnweb.freebsd.org/changeset/base/335028 Log: Handle INP_FREED when looking up an inpcb When hash table lookups are not serialized with in_pcbfree it will be possible for callers to find an inpcb that has been marked free. We need to check for this and return NULL. Modified: head/sys/netinet/in_pcb.c Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Wed Jun 13 04:00:21 2018 (r335027) +++ head/sys/netinet/in_pcb.c Wed Jun 13 04:23:49 2018 (r335028) @@ -2209,7 +2209,14 @@ found: locked = INP_TRY_RLOCK(inp); else panic("%s: locking bug", __func__); - if (!locked) + if (__predict_false(locked && (inp->inp_flags2 & INP_FREED))) { + if (lookupflags & INPLOOKUP_WLOCKPCB) + INP_WUNLOCK(inp); + else + INP_RUNLOCK(inp); + INP_HASH_RUNLOCK(pcbinfo); + return (NULL); + } else if (!locked) in_pcbref(inp); INP_GROUP_UNLOCK(pcbgroup); if (!locked) { From owner-svn-src-head@freebsd.org Wed Jun 13 06:11:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 064731007B5F; Wed, 13 Jun 2018 06:11:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE14D6E067; Wed, 13 Jun 2018 06:11:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F0DB15856; Wed, 13 Jun 2018 06:11:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5D6B4Pu007862; Wed, 13 Jun 2018 06:11:04 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5D6B4wd007861; Wed, 13 Jun 2018 06:11:04 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806130611.w5D6B4wd007861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 13 Jun 2018 06:11:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335029 - head/usr.sbin/service X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.sbin/service X-SVN-Commit-Revision: 335029 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 06:11:05 -0000 Author: imp Date: Wed Jun 13 06:11:04 2018 New Revision: 335029 URL: https://svnweb.freebsd.org/changeset/base/335029 Log: Use "$@" instead of $* to cope with parameters that have spaces in them. "$@" preserves the args with spaces properly. Differential Revision: https://reviews.freebsd.org/D15784 Modified: head/usr.sbin/service/service.sh Modified: head/usr.sbin/service/service.sh ============================================================================== --- head/usr.sbin/service/service.sh Wed Jun 13 04:23:49 2018 (r335028) +++ head/usr.sbin/service/service.sh Wed Jun 13 06:11:04 2018 (r335029) @@ -165,7 +165,7 @@ cd / for dir in /etc/rc.d $local_startup; do if [ -x "$dir/$script" ]; then [ -n "$VERBOSE" ] && echo "$script is located in $dir" - exec env -i HOME=/ PATH=/sbin:/bin:/usr/sbin:/usr/bin $dir/$script $* + exec env -i HOME=/ PATH=/sbin:/bin:/usr/sbin:/usr/bin $dir/$script "$@" fi done From owner-svn-src-head@freebsd.org Wed Jun 13 07:03:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 609DE100BC2C; Wed, 13 Jun 2018 07:03:04 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C0DC700A0; Wed, 13 Jun 2018 07:03:04 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E16F816208; Wed, 13 Jun 2018 07:03:03 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5D733Xc038355; Wed, 13 Jun 2018 07:03:03 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5D72w0Y038325; Wed, 13 Jun 2018 07:02:58 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201806130702.w5D72w0Y038325@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Wed, 13 Jun 2018 07:02:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335030 - in head/sys/amd64/vmm: . amd intel io X-SVN-Group: head X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: in head/sys/amd64/vmm: . amd intel io X-SVN-Commit-Revision: 335030 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 07:03:04 -0000 Author: araujo Date: Wed Jun 13 07:02:58 2018 New Revision: 335030 URL: https://svnweb.freebsd.org/changeset/base/335030 Log: Add SPDX tags to vmm(4). MFC after: 4 weeks. Sponsored by: iXsystems Inc. Modified: head/sys/amd64/vmm/amd/amdvi_hw.c head/sys/amd64/vmm/amd/amdvi_priv.h head/sys/amd64/vmm/amd/ivrs_drv.c head/sys/amd64/vmm/amd/npt.c head/sys/amd64/vmm/amd/npt.h head/sys/amd64/vmm/amd/svm.c head/sys/amd64/vmm/amd/svm.h head/sys/amd64/vmm/amd/svm_genassym.c head/sys/amd64/vmm/amd/svm_msr.c head/sys/amd64/vmm/amd/svm_msr.h head/sys/amd64/vmm/amd/svm_softc.h head/sys/amd64/vmm/amd/svm_support.S head/sys/amd64/vmm/amd/vmcb.c head/sys/amd64/vmm/amd/vmcb.h head/sys/amd64/vmm/intel/vmx_support.S head/sys/amd64/vmm/io/vatpic.c head/sys/amd64/vmm/io/vatpit.h head/sys/amd64/vmm/io/vpmtmr.c head/sys/amd64/vmm/io/vpmtmr.h head/sys/amd64/vmm/io/vrtc.c head/sys/amd64/vmm/io/vrtc.h head/sys/amd64/vmm/vmm_ioport.c head/sys/amd64/vmm/vmm_ioport.h Modified: head/sys/amd64/vmm/amd/amdvi_hw.c ============================================================================== --- head/sys/amd64/vmm/amd/amdvi_hw.c Wed Jun 13 06:11:04 2018 (r335029) +++ head/sys/amd64/vmm/amd/amdvi_hw.c Wed Jun 13 07:02:58 2018 (r335030) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2016, Anish Gupta (anish@freebsd.org) * All rights reserved. * Modified: head/sys/amd64/vmm/amd/amdvi_priv.h ============================================================================== --- head/sys/amd64/vmm/amd/amdvi_priv.h Wed Jun 13 06:11:04 2018 (r335029) +++ head/sys/amd64/vmm/amd/amdvi_priv.h Wed Jun 13 07:02:58 2018 (r335030) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2016 Anish Gupta (anish@freebsd.org) * All rights reserved. * Modified: head/sys/amd64/vmm/amd/ivrs_drv.c ============================================================================== --- head/sys/amd64/vmm/amd/ivrs_drv.c Wed Jun 13 06:11:04 2018 (r335029) +++ head/sys/amd64/vmm/amd/ivrs_drv.c Wed Jun 13 07:02:58 2018 (r335030) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2016, Anish Gupta (anish@freebsd.org) * All rights reserved. * Modified: head/sys/amd64/vmm/amd/npt.c ============================================================================== --- head/sys/amd64/vmm/amd/npt.c Wed Jun 13 06:11:04 2018 (r335029) +++ head/sys/amd64/vmm/amd/npt.c Wed Jun 13 07:02:58 2018 (r335030) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2013 Anish Gupta (akgupt3@gmail.com) * All rights reserved. * Modified: head/sys/amd64/vmm/amd/npt.h ============================================================================== --- head/sys/amd64/vmm/amd/npt.h Wed Jun 13 06:11:04 2018 (r335029) +++ head/sys/amd64/vmm/amd/npt.h Wed Jun 13 07:02:58 2018 (r335030) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2013 Anish Gupta (akgupt3@gmail.com) * All rights reserved. * Modified: head/sys/amd64/vmm/amd/svm.c ============================================================================== --- head/sys/amd64/vmm/amd/svm.c Wed Jun 13 06:11:04 2018 (r335029) +++ head/sys/amd64/vmm/amd/svm.c Wed Jun 13 07:02:58 2018 (r335030) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2013, Anish Gupta (akgupt3@gmail.com) * All rights reserved. * Modified: head/sys/amd64/vmm/amd/svm.h ============================================================================== --- head/sys/amd64/vmm/amd/svm.h Wed Jun 13 06:11:04 2018 (r335029) +++ head/sys/amd64/vmm/amd/svm.h Wed Jun 13 07:02:58 2018 (r335030) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2013 Anish Gupta (akgupt3@gmail.com) * All rights reserved. * Modified: head/sys/amd64/vmm/amd/svm_genassym.c ============================================================================== --- head/sys/amd64/vmm/amd/svm_genassym.c Wed Jun 13 06:11:04 2018 (r335029) +++ head/sys/amd64/vmm/amd/svm_genassym.c Wed Jun 13 07:02:58 2018 (r335030) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2013 Anish Gupta (akgupt3@gmail.com) * All rights reserved. * Modified: head/sys/amd64/vmm/amd/svm_msr.c ============================================================================== --- head/sys/amd64/vmm/amd/svm_msr.c Wed Jun 13 06:11:04 2018 (r335029) +++ head/sys/amd64/vmm/amd/svm_msr.c Wed Jun 13 07:02:58 2018 (r335030) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2014, Neel Natu (neel@freebsd.org) * All rights reserved. * Modified: head/sys/amd64/vmm/amd/svm_msr.h ============================================================================== --- head/sys/amd64/vmm/amd/svm_msr.h Wed Jun 13 06:11:04 2018 (r335029) +++ head/sys/amd64/vmm/amd/svm_msr.h Wed Jun 13 07:02:58 2018 (r335030) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2014 Neel Natu (neel@freebsd.org) * All rights reserved. * Modified: head/sys/amd64/vmm/amd/svm_softc.h ============================================================================== --- head/sys/amd64/vmm/amd/svm_softc.h Wed Jun 13 06:11:04 2018 (r335029) +++ head/sys/amd64/vmm/amd/svm_softc.h Wed Jun 13 07:02:58 2018 (r335030) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2013 Anish Gupta (akgupt3@gmail.com) * All rights reserved. * Modified: head/sys/amd64/vmm/amd/svm_support.S ============================================================================== --- head/sys/amd64/vmm/amd/svm_support.S Wed Jun 13 06:11:04 2018 (r335029) +++ head/sys/amd64/vmm/amd/svm_support.S Wed Jun 13 07:02:58 2018 (r335030) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2013, Anish Gupta (akgupt3@gmail.com) * All rights reserved. * Modified: head/sys/amd64/vmm/amd/vmcb.c ============================================================================== --- head/sys/amd64/vmm/amd/vmcb.c Wed Jun 13 06:11:04 2018 (r335029) +++ head/sys/amd64/vmm/amd/vmcb.c Wed Jun 13 07:02:58 2018 (r335030) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2013 Anish Gupta (akgupt3@gmail.com) * All rights reserved. * Modified: head/sys/amd64/vmm/amd/vmcb.h ============================================================================== --- head/sys/amd64/vmm/amd/vmcb.h Wed Jun 13 06:11:04 2018 (r335029) +++ head/sys/amd64/vmm/amd/vmcb.h Wed Jun 13 07:02:58 2018 (r335030) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2013 Anish Gupta (akgupt3@gmail.com) * All rights reserved. * Modified: head/sys/amd64/vmm/intel/vmx_support.S ============================================================================== --- head/sys/amd64/vmm/intel/vmx_support.S Wed Jun 13 06:11:04 2018 (r335029) +++ head/sys/amd64/vmm/intel/vmx_support.S Wed Jun 13 07:02:58 2018 (r335030) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2011 NetApp, Inc. * Copyright (c) 2013 Neel Natu * All rights reserved. Modified: head/sys/amd64/vmm/io/vatpic.c ============================================================================== --- head/sys/amd64/vmm/io/vatpic.c Wed Jun 13 06:11:04 2018 (r335029) +++ head/sys/amd64/vmm/io/vatpic.c Wed Jun 13 07:02:58 2018 (r335030) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2014 Tycho Nightingale * All rights reserved. * Modified: head/sys/amd64/vmm/io/vatpit.h ============================================================================== --- head/sys/amd64/vmm/io/vatpit.h Wed Jun 13 06:11:04 2018 (r335029) +++ head/sys/amd64/vmm/io/vatpit.h Wed Jun 13 07:02:58 2018 (r335030) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2014 Tycho Nightingale * Copyright (c) 2011 NetApp, Inc. * All rights reserved. Modified: head/sys/amd64/vmm/io/vpmtmr.c ============================================================================== --- head/sys/amd64/vmm/io/vpmtmr.c Wed Jun 13 06:11:04 2018 (r335029) +++ head/sys/amd64/vmm/io/vpmtmr.c Wed Jun 13 07:02:58 2018 (r335030) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2014, Neel Natu (neel@freebsd.org) * All rights reserved. * Modified: head/sys/amd64/vmm/io/vpmtmr.h ============================================================================== --- head/sys/amd64/vmm/io/vpmtmr.h Wed Jun 13 06:11:04 2018 (r335029) +++ head/sys/amd64/vmm/io/vpmtmr.h Wed Jun 13 07:02:58 2018 (r335030) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2014 Neel Natu (neel@freebsd.org) * All rights reserved. * Modified: head/sys/amd64/vmm/io/vrtc.c ============================================================================== --- head/sys/amd64/vmm/io/vrtc.c Wed Jun 13 06:11:04 2018 (r335029) +++ head/sys/amd64/vmm/io/vrtc.c Wed Jun 13 07:02:58 2018 (r335030) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2014, Neel Natu (neel@freebsd.org) * All rights reserved. * Modified: head/sys/amd64/vmm/io/vrtc.h ============================================================================== --- head/sys/amd64/vmm/io/vrtc.h Wed Jun 13 06:11:04 2018 (r335029) +++ head/sys/amd64/vmm/io/vrtc.h Wed Jun 13 07:02:58 2018 (r335030) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2014 Neel Natu (neel@freebsd.org) * All rights reserved. * Modified: head/sys/amd64/vmm/vmm_ioport.c ============================================================================== --- head/sys/amd64/vmm/vmm_ioport.c Wed Jun 13 06:11:04 2018 (r335029) +++ head/sys/amd64/vmm/vmm_ioport.c Wed Jun 13 07:02:58 2018 (r335030) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2014 Tycho Nightingale * All rights reserved. * Modified: head/sys/amd64/vmm/vmm_ioport.h ============================================================================== --- head/sys/amd64/vmm/vmm_ioport.h Wed Jun 13 06:11:04 2018 (r335029) +++ head/sys/amd64/vmm/vmm_ioport.h Wed Jun 13 07:02:58 2018 (r335030) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2014 Tycho Nightingale * All rights reserved. * From owner-svn-src-head@freebsd.org Wed Jun 13 07:19:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 212B8100D06A; Wed, 13 Jun 2018 07:19:57 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward102o.mail.yandex.net (forward102o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::602]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D44270D1A; Wed, 13 Jun 2018 07:19:55 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from mxback8g.mail.yandex.net (mxback8g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:169]) by forward102o.mail.yandex.net (Yandex) with ESMTP id BD5A35A061FF; Wed, 13 Jun 2018 10:19:52 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback8g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id fBgAywmVDG-JqHeGgjE; Wed, 13 Jun 2018 10:19:52 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1528874392; bh=0eBwnPVqZi0OjgtCSLsuNUmhUiKDG1f8WfwUo2LERAY=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=Q4Gw+yEwxGrq1/S3wP1gs48FauZ5ln+w84jSzFPUXIUrS4vu0V/tHBTjReostyS3+ LbWrXlVY2/DsXyA9Zh+KQhy4vWcJG6CCyD0OOGgIasQkofAsnkrjLgjFDBIceN/E7D 4cG7TPiVHjlIsgJXW1S34r6aUzgciHfeyotb5jI4= Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id MyGuV6eCef-JkoWUNhI; Wed, 13 Jun 2018 10:19:47 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1528874387; bh=0eBwnPVqZi0OjgtCSLsuNUmhUiKDG1f8WfwUo2LERAY=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=O7P8Ab55F5OPJCIKW8C2UZ5CxobhsAH8XS3sQtF+171ai6Y5KTAcM7I9hLe9paFh9 uY4BckXBQ6dmBx+M/M64jyXnEyh63O4vq8/jV9zCJTIzwa61I2azkyiQpyzbb0xrWK Z/Dx7axmseAAL1rte/ulyFTZwR0eucZWQKc13ZZk= Authentication-Results: smtp2p.mail.yandex.net; dkim=pass header.i=@yandex.ru Subject: Re: svn commit: r334875 - head/sys/net To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201806091226.w59CQDSb018933@pdx.rh.CN85.dnsmgr.net> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Autocrypt: addr=bu7cher@yandex.ru; prefer-encrypt=mutual; keydata= xsBNBEwBF1kBCADB9sXFhBEUy8qQ4X63Y8eBatYMHGEFWN9ypS5lI3RE6qQW2EYbxNk7qUC5 21YIIS1mMFVBEfvR7J9uc7yaYgFCEb6Sce1RSO4ULN2mRKGHP3/Sl0ijZEjWHV91hY1YTHEF ZW/0GYinDf56sYpDDehaBF5wkWIo1+QK5nmj3vl0DIDCMNd7QEiWpyLVwECgLX2eOAXByT8B bCqVhJGcG6iFP7/B9Ll6uX5gb8thM9LM+ibwErDBVDGiOgvfxqidab7fdkh893IBCXa82H9N CNwnEtcgzh+BSKK5BgvPohFMgRwjti37TSxwLu63QejRGbZWSz3OK3jMOoF63tCgn7FvABEB AAHNIkFuZHJleSBWLiBFbHN1a292IDxhZUBmcmVlYnNkLm9yZz7CwHsEEwECACUCGwMGCwkI BwMCBhUIAgkKCwQWAgMBAh4BAheABQJMB/ruAhkBAAoJEAHF6gQQyKF6MLwH/3Ri/TZl9uo0 SepYWXOnxL6EaDVXDA+dLb1eLKC4PRBBjX29ttQ0KaWapiE6y5/AfzOPmRtHLrHYHjd/aiHX GMLHcYRXD+5GvdkK8iMALrZ28X0JXyuuZa8rAxWIWmCbYHNSBy2unqWgTI04Erodk90IALgM 9JeHN9sFqTM6zalrMnTzlcmel4kcjT3lyYw3vOKgoYLtsLhKZSbJoVVVlvRlGBpHFJI5AoYJ SyfXoN0rcX6k9X7Isp2K50YjqxV4v78xluh1puhwZyC0p8IShPrmrp9Oy9JkMX90o6UAXdGU KfdExJuGJfUZOFBTtNIMNIAKfMTjhpRhxONIr0emxxDOwE0ETAEXWQEIAJ2p6l9LBoqdH/0J PEFDY2t2gTvAuzz+8zs3R03dFuHcNbOwjvWCG0aOmVpAzkRa8egn5JB4sZaFUtKPYJEQ1Iu+ LUBwgvtXf4vWpzC67zs2dDuiW4LamH5p6xkTD61aHR7mCB3bg2TUjrDWn2Jt44cvoYxj3dz4 S49U1rc9ZPgD5axCNv45j72tggWlZvpefThP7xT1OlNTUqye2gAwQravXpZkl5JG4eOqJVIU X316iE3qso0iXRUtO7OseBf0PiVmk+wCahdreHOeOxK5jMhYkPKVn7z1sZiB7W2H2TojbmcK HZC22sz7Z/H36Lhg1+/RCnGzdEcjGc8oFHXHCxUAEQEAAcLAXwQYAQIACQUCTAEXWQIbDAAK CRABxeoEEMihegkYCAC3ivGYNe2taNm/4Nx5GPdzuaAJGKWksV+w9mo7dQvU+NmI2az5w8vw 98OmX7G0OV9snxMW+6cyNqBrVFTu33VVNzz9pnqNCHxGvj5dL5ltP160JV2zw2bUwJBYsgYQ WfyJJIM7l3gv5ZS3DGqaGIm9gOK1ANxfrR5PgPzvI9VxDhlr2juEVMZYAqPLEJe+SSxbwLoz BcFCNdDAyXcaAzXsx/E02YWm1hIWNRxanAe7Vlg7OL+gvLpdtrYCMg28PNqKNyrQ87LQ49O9 50IIZDOtNFeR0FGucjcLPdS9PiEqCoH7/waJxWp6ydJ+g4OYRBYNM0EmMgy1N85JJrV1mi5i Message-ID: Date: Wed, 13 Jun 2018 10:17:06 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <201806091226.w59CQDSb018933@pdx.rh.CN85.dnsmgr.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="g6BMwXcbPiB6Lmsw2vprqidkiofrwEEIl" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 07:19:57 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --g6BMwXcbPiB6Lmsw2vprqidkiofrwEEIl Content-Type: multipart/mixed; boundary="npdWcDhDIqPwT0xGtS5HRSU47XXLeAEJN"; protected-headers="v1" From: "Andrey V. Elsukov" To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r334875 - head/sys/net References: <201806091226.w59CQDSb018933@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201806091226.w59CQDSb018933@pdx.rh.CN85.dnsmgr.net> --npdWcDhDIqPwT0xGtS5HRSU47XXLeAEJN Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 09.06.2018 15:26, Rodney W. Grimes wrote: >> 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. >> =20 >> Since we are setting IFF_UP flag on SIOCSIFADDR, it is possible, tha= t >> 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). >=20 > 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. >=20 > 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=20 > are used for management purposes. This was one of the main reasons of this change. > How does Cisco, Juniper, etc at handle this? > Do any of them or all of them allow you to "down" loopback? AFAIK, they allow this. --=20 WBR, Andrey V. Elsukov --npdWcDhDIqPwT0xGtS5HRSU47XXLeAEJN-- --g6BMwXcbPiB6Lmsw2vprqidkiofrwEEIl Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAlsgxPIACgkQAcXqBBDI oXq7Kgf+JsmByV3u2e2rZR7QwiNxXmXfYOXzrQZ7dgAvguHur7fWHpBb5JIL9XE8 w83DDBXqyq2pc6QjoKZ6D4qc44dss070yUCSY+lEGxIY4JvKylmXSy3rZyU92wD9 RtmTDzdvyoiEfBSLsOAvDvZmcURODeaf42jHNvnMDVcFSPZU8dPLClYQYbiFcI8M 58o/e3a3etyruZ3Eh/U6Dju4hRi61SScP2uhRF5M1xMmXOcHVtj9IZKPMs/o0rlA OLjcyZ30Aktj6aJ91ktSA0alIqcozfNnRRdUgfkh45pxf29BgeeGeuOmR8q9PFB1 sDnWGyxLuiqJQqktwN7IA7v9i8tcXA== =XSJY -----END PGP SIGNATURE----- --g6BMwXcbPiB6Lmsw2vprqidkiofrwEEIl-- From owner-svn-src-head@freebsd.org Wed Jun 13 07:30:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25A8A100DE11; Wed, 13 Jun 2018 07:30:01 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78D84714AA; Wed, 13 Jun 2018 07:30:00 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w5D7Tu0m038158; Wed, 13 Jun 2018 00:29:56 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w5D7TuFx038157; Wed, 13 Jun 2018 00:29:56 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806130729.w5D7TuFx038157@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r334875 - head/sys/net In-Reply-To: To: "Andrey V. Elsukov" Date: Wed, 13 Jun 2018 00:29:56 -0700 (PDT) CC: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 07:30:01 -0000 > On 09.06.2018 15:26, Rodney W. Grimes wrote: > >> 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. > > This was one of the main reasons of this change. > > > How does Cisco, Juniper, etc at handle this? > > Do any of them or all of them allow you to "down" loopback? > > AFAIK, they allow this. Confirmed as far as you can "shutdown/no shutdown" a loopback device on Cisco, but I am not sure that is the same as the LINK_STATE_UP/DOWN. I am fine with it as it is now, but we need to keep an eye on it for any issues. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Wed Jun 13 07:55:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7A011010437; Wed, 13 Jun 2018 07:55:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6F7057295D; Wed, 13 Jun 2018 07:55:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5088E16A3B; Wed, 13 Jun 2018 07:55:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5D7tw1q063387; Wed, 13 Jun 2018 07:55:58 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5D7tw7L063386; Wed, 13 Jun 2018 07:55:58 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201806130755.w5D7tw7L063386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 13 Jun 2018 07:55:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335034 - head/sys/dev/liquidio X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/sys/dev/liquidio X-SVN-Commit-Revision: 335034 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 07:55:59 -0000 Author: dim Date: Wed Jun 13 07:55:57 2018 New Revision: 335034 URL: https://svnweb.freebsd.org/changeset/base/335034 Log: Fix build of liquidio with base gcc on i386 Some casts from pointers to uint64_t and back in lio_main.c cause base gcc on i386 to warn "cast from pointer to integer of different size", and vice versa. Add additional casts to uintptr_t to suppress these. Reviewed by: sbruno MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D15754 Modified: head/sys/dev/liquidio/lio_main.c Modified: head/sys/dev/liquidio/lio_main.c ============================================================================== --- head/sys/dev/liquidio/lio_main.c Wed Jun 13 07:17:10 2018 (r335033) +++ head/sys/dev/liquidio/lio_main.c Wed Jun 13 07:55:57 2018 (r335034) @@ -1770,8 +1770,8 @@ lio_setup_glists(struct octeon_device *oct, struct lio if (g == NULL) break; - g->sg = (struct lio_sg_entry *) - ((uint64_t)lio->glists_virt_base[i] + + g->sg = (struct lio_sg_entry *)(uintptr_t) + ((uint64_t)(uintptr_t)lio->glists_virt_base[i] + (j * lio->glist_entry_size)); g->sg_dma_ptr = (uint64_t)lio->glists_dma_base[i] + (j * lio->glist_entry_size); From owner-svn-src-head@freebsd.org Wed Jun 13 08:50:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FB351014E3F; Wed, 13 Jun 2018 08:50:44 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4146974E17; Wed, 13 Jun 2018 08:50:44 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 225621725D; Wed, 13 Jun 2018 08:50:44 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5D8oiMl090107; Wed, 13 Jun 2018 08:50:44 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5D8ohl2090103; Wed, 13 Jun 2018 08:50:43 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201806130850.w5D8ohl2090103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Wed, 13 Jun 2018 08:50:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335035 - in head/sys: compat/freebsd32 compat/linux kern X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: in head/sys: compat/freebsd32 compat/linux kern X-SVN-Commit-Revision: 335035 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 08:50:44 -0000 Author: bde Date: Wed Jun 13 08:50:43 2018 New Revision: 335035 URL: https://svnweb.freebsd.org/changeset/base/335035 Log: Fix some bugs found while fixing the representation and translation of 64-bit dev_t's (but not ones involving dev_t's). st_size was supposed to be clamped in cvtstat() and linux's copy_stat(), but the clamping code wasn't aware that st_size is signed, and also had an obfuscated off-by-1 value for the unsigned limit, so its effect was to produce a bizarre negative size instead of clamping. Change freebsd32's copy_ostat() to be no worse than cvtstat(). It was missing clamping and bzero()ing of padding. Reviewed by: kib (except a final fix of the clamp to the signed maximum) Modified: head/sys/compat/freebsd32/freebsd32_misc.c head/sys/compat/linux/linux_stats.c head/sys/kern/vfs_syscalls.c Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Wed Jun 13 07:55:57 2018 (r335034) +++ head/sys/compat/freebsd32/freebsd32_misc.c Wed Jun 13 08:50:43 2018 (r335035) @@ -1972,6 +1972,7 @@ static void copy_ostat(struct stat *in, struct ostat32 *out) { + bzero(out, sizeof(*out)); CP(*in, *out, st_dev); CP(*in, *out, st_ino); CP(*in, *out, st_mode); @@ -1979,7 +1980,7 @@ copy_ostat(struct stat *in, struct ostat32 *out) CP(*in, *out, st_uid); CP(*in, *out, st_gid); CP(*in, *out, st_rdev); - CP(*in, *out, st_size); + out->st_size = MIN(in->st_size, INT32_MAX); TS_CP(*in, *out, st_atim); TS_CP(*in, *out, st_mtim); TS_CP(*in, *out, st_ctim); Modified: head/sys/compat/linux/linux_stats.c ============================================================================== --- head/sys/compat/linux/linux_stats.c Wed Jun 13 07:55:57 2018 (r335034) +++ head/sys/compat/linux/linux_stats.c Wed Jun 13 08:50:43 2018 (r335035) @@ -229,10 +229,7 @@ stat_copyout(struct stat *buf, void *ubuf) lbuf.st_uid = buf->st_uid; lbuf.st_gid = buf->st_gid; lbuf.st_rdev = buf->st_rdev; - if (buf->st_size < (quad_t)1 << 32) - lbuf.st_size = buf->st_size; - else - lbuf.st_size = -2; + lbuf.st_size = MIN(buf->st_size, INT32_MAX); lbuf.st_atim.tv_sec = buf->st_atim.tv_sec; lbuf.st_atim.tv_nsec = buf->st_atim.tv_nsec; lbuf.st_mtim.tv_sec = buf->st_mtim.tv_sec; Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Wed Jun 13 07:55:57 2018 (r335034) +++ head/sys/kern/vfs_syscalls.c Wed Jun 13 08:50:43 2018 (r335035) @@ -2065,6 +2065,7 @@ olstat(struct thread *td, struct olstat_args *uap) /* * Convert from an old to a new stat structure. + * XXX: many values are blindly truncated. */ void cvtstat(struct stat *st, struct ostat *ost) @@ -2078,10 +2079,7 @@ cvtstat(struct stat *st, struct ostat *ost) ost->st_uid = st->st_uid; ost->st_gid = st->st_gid; ost->st_rdev = st->st_rdev; - if (st->st_size < (quad_t)1 << 32) - ost->st_size = st->st_size; - else - ost->st_size = -2; + ost->st_size = MIN(st->st_size, INT32_MAX); ost->st_atim = st->st_atim; ost->st_mtim = st->st_mtim; ost->st_ctim = st->st_ctim; From owner-svn-src-head@freebsd.org Wed Jun 13 08:52:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B39E101503F; Wed, 13 Jun 2018 08:52:05 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A1A3751BA; Wed, 13 Jun 2018 08:52:05 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D5BB6172CC; Wed, 13 Jun 2018 08:52:04 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5D8q4pK093534; Wed, 13 Jun 2018 08:52:04 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5D8q4l0093532; Wed, 13 Jun 2018 08:52:04 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806130852.w5D8q4l0093532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Wed, 13 Jun 2018 08:52:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335036 - head/usr.bin/vmstat X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/vmstat X-SVN-Commit-Revision: 335036 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 08:52:05 -0000 Author: eadler Date: Wed Jun 13 08:52:04 2018 New Revision: 335036 URL: https://svnweb.freebsd.org/changeset/base/335036 Log: vmstat(1): various nits Continue my parade on introspection tools by fixing: - failed to check for null after reallocf - avoid the comma operator - mark usage as dead - correct size of len Modified: head/usr.bin/vmstat/Makefile head/usr.bin/vmstat/vmstat.c Modified: head/usr.bin/vmstat/Makefile ============================================================================== --- head/usr.bin/vmstat/Makefile Wed Jun 13 08:50:43 2018 (r335035) +++ head/usr.bin/vmstat/Makefile Wed Jun 13 08:52:04 2018 (r335036) @@ -7,8 +7,6 @@ PROG= vmstat MAN= vmstat.8 LIBADD= devstat kvm memstat xo util -WARNS?= 6 - HAS_TESTS= SUBDIR.${MK_TESTS}+= tests Modified: head/usr.bin/vmstat/vmstat.c ============================================================================== --- head/usr.bin/vmstat/vmstat.c Wed Jun 13 08:50:43 2018 (r335035) +++ head/usr.bin/vmstat/vmstat.c Wed Jun 13 08:52:04 2018 (r335036) @@ -218,7 +218,8 @@ main(int argc, char *argv[]) { char *bp, *buf, *memf, *nlistf; float f; - int bufsize, c, len, reps, todo; + int bufsize, c, reps, todo; + size_t len; unsigned int interval; char errbuf[_POSIX2_LINE_MAX]; @@ -318,7 +319,8 @@ main(int argc, char *argv[]) retry_nlist: if (kd != NULL && (c = kvm_nlist(kd, namelist)) != 0) { if (c > 0) { - bufsize = 0, len = 0; + bufsize = 0; + len = 0; /* * 'cnt' was renamed to 'vm_cnt'. If 'vm_cnt' is not @@ -436,8 +438,11 @@ getdrivedata(char **argv) if (isdigit(**argv)) break; num_devices_specified++; - specified_devices = realloc(specified_devices, + specified_devices = reallocf(specified_devices, sizeof(char *) * num_devices_specified); + if (specified_devices == NULL) { + xo_errx(1, "%s", "reallocf (specified_devices)"); + } specified_devices[num_devices_specified - 1] = *argv; } dev_select = NULL; @@ -1206,7 +1211,7 @@ cpustats(void) total = 0; for (state = 0; state < CPUSTATES; ++state) total += cur.cp_time[state]; - if (total) + if (total > 0) lpct = 100.0 / total; else lpct = 0.0; @@ -1682,7 +1687,7 @@ kread(int nlx, void *addr, size_t size) kreado(nlx, addr, size, 0); } -static void +static void __dead2 usage(void) { xo_error("%s%s", From owner-svn-src-head@freebsd.org Wed Jun 13 08:52:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A64DE101505D; Wed, 13 Jun 2018 08:52:07 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7A428751D2; Wed, 13 Jun 2018 08:52:07 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4384B172CF; Wed, 13 Jun 2018 08:52:07 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5D8q7dA093577; Wed, 13 Jun 2018 08:52:07 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5D8q7tV093576; Wed, 13 Jun 2018 08:52:07 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806130852.w5D8q7tV093576@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Wed, 13 Jun 2018 08:52:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335037 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 335037 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 08:52:07 -0000 Author: eadler Date: Wed Jun 13 08:52:06 2018 New Revision: 335037 URL: https://svnweb.freebsd.org/changeset/base/335037 Log: top(1): format help more nicely For entries that are duplicates present them nicely rather than showing two identical help entries. For ' ' present it as SPC Modified: head/usr.bin/top/commands.c Modified: head/usr.bin/top/commands.c ============================================================================== --- head/usr.bin/top/commands.c Wed Jun 13 08:52:04 2018 (r335036) +++ head/usr.bin/top/commands.c Wed Jun 13 08:52:06 2018 (r335037) @@ -57,16 +57,16 @@ const struct command all_commands[] = {'e', "list errors generated by last \"kill\" or \"renice\" command", false, CMD_errors}, {'H', "toggle the displaying of threads", false, CMD_thrtog}, {'h', "show this help text", true, CMD_help}, - {'?', "show this help text", true, CMD_help}, + {'?', NULL, true, CMD_help}, {'i', "toggle the displaying of idle processes", false, CMD_idletog}, - {'I', "toggle the displaying of idle processes", false, CMD_idletog}, + {'I', NULL, false, CMD_idletog}, {'j', "toggle the displaying of jail ID", false, CMD_jidtog}, {'J', "display processes for only one jail (+ selects all jails)", false, CMD_jail}, {'k', "kill processes; send a signal to a list of processes", false, CMD_kill}, {'q', "quit" , true, CMD_quit}, {'m', "toggle the display between 'cpu' and 'io' modes", false, CMD_viewtog}, {'n', "change number of processes to display", false, CMD_number}, - {'#', "change number of processes to display", false, CMD_number}, + {'#', NULL, false, CMD_number}, {'o', "specify the sort order", false, CMD_order}, {'p', "display one process (+ selects all processes)", false, CMD_pid}, {'P', "toggle the displaying of per-CPU statistics", false, CMD_pcputog}, @@ -86,7 +86,9 @@ const struct command all_commands[] = void show_help(void) { - const struct command *curcmd; + const struct command *curcmd, *nextcmd; + char keys[8] = ""; + _Static_assert(sizeof(keys) >= sizeof("a or b"), "keys right size"); printf("Top version FreeBSD, %s\n", copyright); curcmd = all_commands; @@ -95,7 +97,22 @@ show_help(void) ++curcmd; continue; } - printf("%c\t- %s\n", curcmd->c, curcmd->desc); + if (curcmd->desc == NULL) { + /* we already printed this */ + ++curcmd; + continue; + } + nextcmd = curcmd + 1; + if (nextcmd->desc == NULL && nextcmd->c != '\0') { + sprintf(keys, "%c or %c", curcmd->c, nextcmd->c); + } else if (curcmd->c == ' '){ + /* special case space rather than introducing a "display string" to + * the struct */ + sprintf(keys, "SPC"); + } else { + sprintf(keys, "%c", curcmd->c); + } + printf("%s\t- %s\n", keys, curcmd->desc); ++curcmd; } if (overstrike) From owner-svn-src-head@freebsd.org Wed Jun 13 08:52:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE8CF1015107; Wed, 13 Jun 2018 08:52:15 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 71F9C75324; Wed, 13 Jun 2018 08:52:13 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E156E172D4; Wed, 13 Jun 2018 08:52:12 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5D8qCHC093669; Wed, 13 Jun 2018 08:52:12 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5D8qC6R093668; Wed, 13 Jun 2018 08:52:12 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806130852.w5D8qC6R093668@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Wed, 13 Jun 2018 08:52:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335039 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 335039 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 08:52:16 -0000 Author: eadler Date: Wed Jun 13 08:52:12 2018 New Revision: 335039 URL: https://svnweb.freebsd.org/changeset/base/335039 Log: top(1): replace homegrown itoa with sprintf Much of this should be inlined to the callsite, but leave it here for now to make it easier to make it easier bisect later. Modified: head/usr.bin/top/utils.c Modified: head/usr.bin/top/utils.c ============================================================================== --- head/usr.bin/top/utils.c Wed Jun 13 08:52:09 2018 (r335038) +++ head/usr.bin/top/utils.c Wed Jun 13 08:52:12 2018 (r335039) @@ -70,24 +70,13 @@ _Static_assert(sizeof(int) <= 4, "buffer too small for char * itoa(unsigned int val) { - char *ptr; static char buffer[16]; /* result is built here */ /* 16 is sufficient since the largest number we will ever convert will be 2^32-1, which is 10 digits. */ - ptr = buffer + sizeof(buffer); - *--ptr = '\0'; - if (val == 0) - { - *--ptr = '0'; - } - else while (val != 0) - { - *--ptr = (val % 10) + '0'; - val /= 10; - } - return(ptr); + sprintf(buffer, "%u", val); + return (buffer); } /* @@ -99,28 +88,13 @@ itoa(unsigned int val) char * itoa7(int val) { - char *ptr; static char buffer[16]; /* result is built here */ /* 16 is sufficient since the largest number we will ever convert will be 2^32-1, which is 10 digits. */ - ptr = buffer + sizeof(buffer); - *--ptr = '\0'; - if (val == 0) - { - *--ptr = '0'; - } - else while (val != 0) - { - *--ptr = (val % 10) + '0'; - val /= 10; - } - while (ptr > buffer + sizeof(buffer) - 7) - { - *--ptr = ' '; - } - return(ptr); + sprintf(buffer, "%6u", val); + return (buffer); } /* From owner-svn-src-head@freebsd.org Wed Jun 13 08:52:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 646EB10150F8; Wed, 13 Jun 2018 08:52:14 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0680F752B0; Wed, 13 Jun 2018 08:52:11 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8AD1A172D2; Wed, 13 Jun 2018 08:52:10 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5D8qAi7093626; Wed, 13 Jun 2018 08:52:10 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5D8q9Qs093623; Wed, 13 Jun 2018 08:52:09 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806130852.w5D8q9Qs093623@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Wed, 13 Jun 2018 08:52:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335038 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 335038 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 08:52:14 -0000 Author: eadler Date: Wed Jun 13 08:52:09 2018 New Revision: 335038 URL: https://svnweb.freebsd.org/changeset/base/335038 Log: top(1): format_time, format_k, etc. - Use humanize_number for format_k and format_k2 - Fix some style nits in format_time Modified: head/usr.bin/top/Makefile head/usr.bin/top/machine.c head/usr.bin/top/utils.c head/usr.bin/top/utils.h Modified: head/usr.bin/top/Makefile ============================================================================== --- head/usr.bin/top/Makefile Wed Jun 13 08:52:06 2018 (r335037) +++ head/usr.bin/top/Makefile Wed Jun 13 08:52:09 2018 (r335038) @@ -16,5 +16,5 @@ NO_WERROR= .endif CFLAGS.clang=-Wno-error=incompatible-pointer-types-discards-qualifiers -Wno-error=cast-qual -LIBADD= ncursesw m kvm jail +LIBADD= ncursesw m kvm jail util .include Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Wed Jun 13 08:52:06 2018 (r335037) +++ head/usr.bin/top/machine.c Wed Jun 13 08:52:09 2018 (r335038) @@ -1087,7 +1087,7 @@ format_next_process(void* xhandle, char *(*get_userid) else snprintf(swap_buf, sizeof(swap_buf), "%*s", swaplength - 1, - format_k2(pagetok(ki_swap(pp)))); /* XXX */ + format_k(pagetok(ki_swap(pp)))); /* XXX */ if (displaymode == DISP_IO) { oldp = get_old_proc(pp); @@ -1148,8 +1148,8 @@ format_next_process(void* xhandle, char *(*get_userid) thr_buf, pp->ki_pri.pri_level - PZERO, format_nice(pp), - format_k2(PROCSIZE(pp)), - format_k2(pagetok(pp->ki_rssize)), + format_k(PROCSIZE(pp)), + format_k(pagetok(pp->ki_rssize)), swaplength, swaplength, swap_buf, status, cpu, Modified: head/usr.bin/top/utils.c ============================================================================== --- head/usr.bin/top/utils.c Wed Jun 13 08:52:06 2018 (r335037) +++ head/usr.bin/top/utils.c Wed Jun 13 08:52:09 2018 (r335038) @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -262,35 +263,34 @@ percentages(int cnt, int *out, long *new, long *old, l exceed 9999.9, we use "???". */ -char * +const char * format_time(long seconds) { - static char result[10]; + static char result[10]; - /* sanity protection */ - if (seconds < 0 || seconds > (99999l * 360l)) - { - strcpy(result, " ???"); - } - else if (seconds >= (1000l * 60l)) - { - /* alternate (slow) method displaying hours and tenths */ - sprintf(result, "%5.1fH", (double)seconds / (double)(60l * 60l)); + /* sanity protection */ + if (seconds < 0 || seconds > (99999l * 360l)) + { + strcpy(result, " ???"); + } + else if (seconds >= (1000l * 60l)) + { + /* alternate (slow) method displaying hours and tenths */ + sprintf(result, "%5.1fH", (double)seconds / (double)(60l * 60l)); - /* It is possible that the sprintf took more than 6 characters. - If so, then the "H" appears as result[6]. If not, then there - is a \0 in result[6]. Either way, it is safe to step on. - */ - result[6] = '\0'; - } - else - { - /* standard method produces MMM:SS */ - /* we avoid printf as must as possible to make this quick */ - sprintf(result, "%3ld:%02ld", - (long)(seconds / 60), (long)(seconds % 60)); - } - return(result); + /* It is possible that the sprintf took more than 6 characters. + If so, then the "H" appears as result[6]. If not, then there + is a \0 in result[6]. Either way, it is safe to step on. + */ + result[6] = '\0'; + } + else + { + /* standard method produces MMM:SS */ + sprintf(result, "%3ld:%02ld", + seconds / 60l, seconds % 60l); + } + return(result); } /* @@ -319,63 +319,16 @@ format_time(long seconds) #define NUM_STRINGS 8 char * -format_k(long amt) +format_k(int64_t amt) { static char retarray[NUM_STRINGS][16]; static int index = 0; - char *p; char *ret; - char tag = 'K'; - p = ret = retarray[index]; - index = (index + 1) % NUM_STRINGS; - - if (amt >= 10000) - { - amt = (amt + 512) / 1024; - tag = 'M'; - if (amt >= 10000) - { - amt = (amt + 512) / 1024; - tag = 'G'; - } - } - - p = stpcpy(p, itoa(amt)); - *p++ = tag; - *p = '\0'; - - return(ret); -} - -char * -format_k2(unsigned long long amt) -{ - static char retarray[NUM_STRINGS][16]; - static int index = 0; - char *p; - char *ret; - char tag = 'K'; - - p = ret = retarray[index]; - index = (index + 1) % NUM_STRINGS; - - if (amt >= 100000) - { - amt = (amt + 512) / 1024; - tag = 'M'; - if (amt >= 100000) - { - amt = (amt + 512) / 1024; - tag = 'G'; - } - } - - p = stpcpy(p, itoa((int)amt)); - *p++ = tag; - *p = '\0'; - - return(ret); + ret = retarray[index]; + index = (index + 1) % NUM_STRINGS; + humanize_number(ret, 6, amt * 1024, "", HN_AUTOSCALE, HN_NOSPACE); + return (ret); } int Modified: head/usr.bin/top/utils.h ============================================================================== --- head/usr.bin/top/utils.h Wed Jun 13 08:52:06 2018 (r335037) +++ head/usr.bin/top/utils.h Wed Jun 13 08:52:09 2018 (r335038) @@ -18,9 +18,8 @@ char *itoa7(int); int digits(int); const char * const *argparse(char *, int *); long percentages(int, int *, long *, long *, long *); -char *format_time(long); -char *format_k(long); -char *format_k2(unsigned long long); +const char *format_time(long); +char *format_k(int64_t); int string_index(const char *string, const char * const *array); int find_pid(pid_t pid); From owner-svn-src-head@freebsd.org Wed Jun 13 08:52:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9C44101511C; Wed, 13 Jun 2018 08:52:17 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A7A7C7538A; Wed, 13 Jun 2018 08:52:15 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 32ADC172D7; Wed, 13 Jun 2018 08:52:15 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5D8qFct093713; Wed, 13 Jun 2018 08:52:15 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5D8qFr4093712; Wed, 13 Jun 2018 08:52:15 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806130852.w5D8qFr4093712@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Wed, 13 Jun 2018 08:52:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335040 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 335040 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 08:52:17 -0000 Author: eadler Date: Wed Jun 13 08:52:14 2018 New Revision: 335040 URL: https://svnweb.freebsd.org/changeset/base/335040 Log: top(1): shift from atoi to non-deprecated function Modified: head/usr.bin/top/utils.c Modified: head/usr.bin/top/utils.c ============================================================================== --- head/usr.bin/top/utils.c Wed Jun 13 08:52:12 2018 (r335039) +++ head/usr.bin/top/utils.c Wed Jun 13 08:52:14 2018 (r335040) @@ -47,7 +47,7 @@ atoiwi(const char *str) } else { - return(atoi(str)); + return((int)strtol(str, NULL, 10)); } } return(0); From owner-svn-src-head@freebsd.org Wed Jun 13 08:52:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01608101512F; Wed, 13 Jun 2018 08:52:19 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 88EE4753E7; Wed, 13 Jun 2018 08:52:18 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D729D172DC; Wed, 13 Jun 2018 08:52:17 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5D8qHlg093759; Wed, 13 Jun 2018 08:52:17 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5D8qH9a093758; Wed, 13 Jun 2018 08:52:17 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806130852.w5D8qH9a093758@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Wed, 13 Jun 2018 08:52:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335041 - head/lib/libc/stdlib X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/lib/libc/stdlib X-SVN-Commit-Revision: 335041 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 08:52:19 -0000 Author: eadler Date: Wed Jun 13 08:52:17 2018 New Revision: 335041 URL: https://svnweb.freebsd.org/changeset/base/335041 Log: libc: remove explicit cast NULL in atoi There isn't any reason to cast NULL so just remove it. Noticed when cleaning up top. Reviewed by: pstef Modified: head/lib/libc/stdlib/atoi.3 head/lib/libc/stdlib/atoi.c Modified: head/lib/libc/stdlib/atoi.3 ============================================================================== --- head/lib/libc/stdlib/atoi.3 Wed Jun 13 08:52:14 2018 (r335040) +++ head/lib/libc/stdlib/atoi.3 Wed Jun 13 08:52:17 2018 (r335041) @@ -57,7 +57,7 @@ representation. .Pp It is equivalent to: .Bd -literal -offset indent -(int)strtol(nptr, (char **)NULL, 10); +(int)strtol(nptr, NULL, 10); .Ed .Pp The Modified: head/lib/libc/stdlib/atoi.c ============================================================================== --- head/lib/libc/stdlib/atoi.c Wed Jun 13 08:52:14 2018 (r335040) +++ head/lib/libc/stdlib/atoi.c Wed Jun 13 08:52:17 2018 (r335041) @@ -46,11 +46,11 @@ __FBSDID("$FreeBSD$"); int atoi(const char *str) { - return (int)strtol(str, (char **)NULL, 10); + return (int)strtol(str, NULL, 10); } int atoi_l(const char *str, locale_t locale) { - return (int)strtol_l(str, (char **)NULL, 10, locale); + return (int)strtol_l(str, NULL, 10, locale); } From owner-svn-src-head@freebsd.org Wed Jun 13 08:52:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93C5310151AD; Wed, 13 Jun 2018 08:52:28 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A6057543F; Wed, 13 Jun 2018 08:52:20 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 60B18172E0; Wed, 13 Jun 2018 08:52:20 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5D8qKGx094585; Wed, 13 Jun 2018 08:52:20 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5D8qKd4094584; Wed, 13 Jun 2018 08:52:20 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806130852.w5D8qKd4094584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Wed, 13 Jun 2018 08:52:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335042 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 335042 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 08:52:28 -0000 Author: eadler Date: Wed Jun 13 08:52:19 2018 New Revision: 335042 URL: https://svnweb.freebsd.org/changeset/base/335042 Log: top(1): add myself to authors At this point I've mucked enough with top(1) that all bugs should be blamed on me rather than William LeFebvre. Modified: head/usr.bin/top/top.1 head/usr.bin/top/utils.c Modified: head/usr.bin/top/top.1 ============================================================================== --- head/usr.bin/top/top.1 Wed Jun 13 08:52:17 2018 (r335041) +++ head/usr.bin/top/top.1 Wed Jun 13 08:52:19 2018 (r335042) @@ -360,6 +360,7 @@ process is waiting. Lock names are prefixed with an asterisk \*(lq*\*(rq while sleep events are not. .Sh AUTHORS +.An Eitan Adler Aq Mt eadler@FreeBSD.org .An William LeFebvre, EECS Department, Northwestern University .Sh BUGS The command name for swapped processes should be tracked down, but this Modified: head/usr.bin/top/utils.c ============================================================================== --- head/usr.bin/top/utils.c Wed Jun 13 08:52:17 2018 (r335041) +++ head/usr.bin/top/utils.c Wed Jun 13 08:52:19 2018 (r335042) @@ -2,6 +2,7 @@ * This program may be freely redistributed, * but this entire comment MUST remain intact. * + * Copyright (c) 2018, Eitan Adler * Copyright (c) 1984, 1989, William LeFebvre, Rice University * Copyright (c) 1989, 1990, 1992, William LeFebvre, Northwestern University * From owner-svn-src-head@freebsd.org Wed Jun 13 08:52:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEF5D10151EC; Wed, 13 Jun 2018 08:52:33 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8680E754F8; Wed, 13 Jun 2018 08:52:23 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 275AA172E4; Wed, 13 Jun 2018 08:52:23 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5D8qNKT094630; Wed, 13 Jun 2018 08:52:23 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5D8qMin094627; Wed, 13 Jun 2018 08:52:22 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806130852.w5D8qMin094627@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Wed, 13 Jun 2018 08:52:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335043 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 335043 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 08:52:34 -0000 Author: eadler Date: Wed Jun 13 08:52:22 2018 New Revision: 335043 URL: https://svnweb.freebsd.org/changeset/base/335043 Log: top(1): style(9) - split return type from function name - Sprinkle a __pure where possible. Modified: head/usr.bin/top/display.c head/usr.bin/top/username.c head/usr.bin/top/utils.c Modified: head/usr.bin/top/display.c ============================================================================== --- head/usr.bin/top/display.c Wed Jun 13 08:52:19 2018 (r335042) +++ head/usr.bin/top/display.c Wed Jun 13 08:52:22 2018 (r335043) @@ -160,7 +160,8 @@ display_resize(void) return(smart_terminal ? lines : Largest); } -int display_updatecpus(struct statics *statics) +int +display_updatecpus(struct statics *statics) { int lines; int i; @@ -184,7 +185,8 @@ int display_updatecpus(struct statics *statics) return(lines); } -int display_init(struct statics * statics) +int +display_init(struct statics * statics) { int lines; char **pp; @@ -1074,7 +1076,8 @@ readline(char *buffer, int size, int numeric) /* internal support routines */ -static void summary_format(char *str, int *numbers, const char * const *names) +static void +summary_format(char *str, int *numbers, const char * const *names) { char *p; int num; Modified: head/usr.bin/top/username.c ============================================================================== --- head/usr.bin/top/username.c Wed Jun 13 08:52:19 2018 (r335042) +++ head/usr.bin/top/username.c Wed Jun 13 08:52:22 2018 (r335043) @@ -55,7 +55,8 @@ struct hash_el { static struct hash_el hash_table[Table_size]; -char *username(int uid) +char * +username(int uid) { int hashindex; @@ -68,7 +69,8 @@ char *username(int uid) return(hash_table[hashindex].name); } -int userid(char username[]) +int +userid(char username[]) { struct passwd *pwd; @@ -89,7 +91,8 @@ int userid(char username[]) } /* wecare 1 = enter it always, 0 = nice to have */ -int enter_user(int uid, char name[], bool wecare) +int +enter_user(int uid, char name[], bool wecare) { int hashindex; Modified: head/usr.bin/top/utils.c ============================================================================== --- head/usr.bin/top/utils.c Wed Jun 13 08:52:19 2018 (r335042) +++ head/usr.bin/top/utils.c Wed Jun 13 08:52:22 2018 (r335043) @@ -122,7 +122,7 @@ digits(int val) * string_index(string, array) - find string in array and return index */ -int +int __pure string_index(const char *string, const char * const *array) { size_t i = 0; @@ -175,7 +175,7 @@ argparse(char *line, int *cntp) * useful on for calculating cpu state percentages. */ -long +long __pure percentages(int cnt, int *out, long *new, long *old, long *diffs) { int i; From owner-svn-src-head@freebsd.org Wed Jun 13 09:07:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8C3110167DE; Wed, 13 Jun 2018 09:07:25 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7AC7976432; Wed, 13 Jun 2018 09:07:25 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5052217595; Wed, 13 Jun 2018 09:07:25 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5D97PZ9099806; Wed, 13 Jun 2018 09:07:25 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5D97PJm099805; Wed, 13 Jun 2018 09:07:25 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806130907.w5D97PJm099805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Wed, 13 Jun 2018 09:07:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335044 - head/lib/libc/stdlib X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/lib/libc/stdlib X-SVN-Commit-Revision: 335044 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 09:07:26 -0000 Author: eadler Date: Wed Jun 13 09:07:24 2018 New Revision: 335044 URL: https://svnweb.freebsd.org/changeset/base/335044 Log: atoi.3: bump .Dd I touched the man page. Bump Dd by just over 15 years. Modified: head/lib/libc/stdlib/atoi.3 Modified: head/lib/libc/stdlib/atoi.3 ============================================================================== --- head/lib/libc/stdlib/atoi.3 Wed Jun 13 08:52:22 2018 (r335043) +++ head/lib/libc/stdlib/atoi.3 Wed Jun 13 09:07:24 2018 (r335044) @@ -32,7 +32,7 @@ .\" @(#)atoi.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd June 13, 2018 .Dt ATOI 3 .Os .Sh NAME From owner-svn-src-head@freebsd.org Wed Jun 13 09:17:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2550B10175E4; Wed, 13 Jun 2018 09:17:05 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C95DE76B00; Wed, 13 Jun 2018 09:17:04 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A9FBC17728; Wed, 13 Jun 2018 09:17:04 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5D9H4c1004751; Wed, 13 Jun 2018 09:17:04 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5D9H48o004750; Wed, 13 Jun 2018 09:17:04 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806130917.w5D9H48o004750@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Wed, 13 Jun 2018 09:17:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335045 - head/usr.sbin/pmc X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.sbin/pmc X-SVN-Commit-Revision: 335045 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 09:17:05 -0000 Author: eadler Date: Wed Jun 13 09:17:04 2018 New Revision: 335045 URL: https://svnweb.freebsd.org/changeset/base/335045 Log: pmc: remove trailing whitespace Reported by: swills Modified: head/usr.sbin/pmc/pmc.c Modified: head/usr.sbin/pmc/pmc.c ============================================================================== --- head/usr.sbin/pmc/pmc.c Wed Jun 13 09:07:24 2018 (r335044) +++ head/usr.sbin/pmc/pmc.c Wed Jun 13 09:17:04 2018 (r335045) @@ -71,7 +71,7 @@ static struct cmd_handler disp_table[] = { }; static void __dead2 -usage(void) +usage(void) { errx(EX_USAGE, "\t pmc management utility\n" From owner-svn-src-head@freebsd.org Wed Jun 13 09:28:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 326AD10187E5; Wed, 13 Jun 2018 09:28:48 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D99117732E; Wed, 13 Jun 2018 09:28:47 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BAB7B178BB; Wed, 13 Jun 2018 09:28:47 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5D9SlBg010225; Wed, 13 Jun 2018 09:28:47 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5D9SlFh010224; Wed, 13 Jun 2018 09:28:47 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806130928.w5D9SlFh010224@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Wed, 13 Jun 2018 09:28:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335046 - head/sbin/dumpon X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/sbin/dumpon X-SVN-Commit-Revision: 335046 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 09:28:48 -0000 Author: eadler Date: Wed Jun 13 09:28:47 2018 New Revision: 335046 URL: https://svnweb.freebsd.org/changeset/base/335046 Log: dumpon(8): improve the examples a bit While here, remove extraneous extraneous Pp Reviewed by: jhb (older version) Modified: head/sbin/dumpon/dumpon.8 Modified: head/sbin/dumpon/dumpon.8 ============================================================================== --- head/sbin/dumpon/dumpon.8 Wed Jun 13 09:17:04 2018 (r335045) +++ head/sbin/dumpon/dumpon.8 Wed Jun 13 09:28:47 2018 (r335046) @@ -28,7 +28,7 @@ .\" From: @(#)swapon.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd March 6, 2018 +.Dd June 13, 2018 .Dt DUMPON 8 .Os .Sh NAME @@ -181,7 +181,6 @@ or .Dv ZSTDIO kernel options. .Pp -.Pp The .Fl l flag causes @@ -311,15 +310,17 @@ The can be now examined using .Xr kgdb 1 : .Pp -.Dl # kgdb /usr/lib/debug/boot/kernel/kernel.debug vmcore.# +.Dl # kgdb /boot/kernel/kernel vmcore.# .Pp or shorter: .Pp -.Dl # kgdb -n # /usr/lib/debug/boot/kernel/kernel.debug +.Dl # kgdb -n # .Pp The core was decrypted properly if .Xr kgdb 1 does not print any errors. +Note that the live kernel might be at a different path +which can be examined by looking at the kern.bootfile sysctl. .Sh SEE ALSO .Xr gzip 1 , .Xr kgdb 1 , From owner-svn-src-head@freebsd.org Wed Jun 13 10:03:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F236E101B705; Wed, 13 Jun 2018 10:03:24 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id C2E7D78B9E; Wed, 13 Jun 2018 10:03:23 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 977671062BC; Wed, 13 Jun 2018 20:03:14 +1000 (AEST) Date: Wed, 13 Jun 2018 20:03:13 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Eitan Adler cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335041 - head/lib/libc/stdlib In-Reply-To: <201806130852.w5D8qH9a093758@repo.freebsd.org> Message-ID: <20180613194008.W2003@besplex.bde.org> References: <201806130852.w5D8qH9a093758@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=cIaQihWN c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=bJuSaEbL97EEYz8fo-IA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 10:03:25 -0000 On Wed, 13 Jun 2018, Eitan Adler wrote: > Log: > libc: remove explicit cast NULL in atoi > > There isn't any reason to cast NULL so just remove it. Noticed when > cleaning up top. There are many reasons to cast NULL for all members of the ato*() family: - it is required if no prototype is in scope - C99 specifies ato*() in terms of strtol*() and uses the cast to NULL, probably because this is simplest. Omitting the cast is just wrong if no prototype is in scope. Writing the explicit cast is simpler than writing caveats that the stated equivalence is only valid if a prototype is in scope. - POSIX specifies ato*() in terms of strtol*() and uses the cast to NULL, exactly as in C99, probably because it defers to the C standard and doesn't and doesn't risk breaking it by changing its wording except when extending it. FreeBSD used to do the same here, and should do the same here and elsewhere by copying better wording from POSIX whenever possible. Bruce From owner-svn-src-head@freebsd.org Wed Jun 13 10:32:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11BC6101DD50; Wed, 13 Jun 2018 10:32:22 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BB87879D7A; Wed, 13 Jun 2018 10:32:21 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9CB19183F8; Wed, 13 Jun 2018 10:32:21 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DAWLr2045248; Wed, 13 Jun 2018 10:32:21 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DAWLCR045247; Wed, 13 Jun 2018 10:32:21 GMT (envelope-from br@FreeBSD.org) Message-Id: <201806131032.w5DAWLCR045247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 13 Jun 2018 10:32:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335047 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 335047 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 10:32:22 -0000 Author: br Date: Wed Jun 13 10:32:21 2018 New Revision: 335047 URL: https://svnweb.freebsd.org/changeset/base/335047 Log: Don't jump to VA space until kernel is ready. This fixes the race when first core sets up the pagetables, while secondary cores do translating the address of __riscv_boot_ap. This now allows us to smpboot in QEMU with 8 cores just fine. Sponsored by: DARPA, AFRL Modified: head/sys/riscv/riscv/locore.S Modified: head/sys/riscv/riscv/locore.S ============================================================================== --- head/sys/riscv/riscv/locore.S Wed Jun 13 09:28:47 2018 (r335046) +++ head/sys/riscv/riscv/locore.S Wed Jun 13 10:32:21 2018 (r335047) @@ -263,6 +263,21 @@ END(mpentry) * Called by a core when it is being brought online. */ ENTRY(mpentry) + /* + * Calculate the offset to __riscv_boot_ap + * for the current core, cpuid is in a0. + */ + li t1, 4 + mulw t1, t1, a0 + /* Get the pointer */ + la t0, __riscv_boot_ap + add t0, t0, t1 + +1: + /* Wait the kernel to be ready */ + lw t1, 0(t0) + beqz t1, 1b + /* Setup stack pointer */ la t0, secondary_stacks li t1, (PAGE_SIZE * KSTACK_PAGES) @@ -296,20 +311,6 @@ mpva: /* Ensure sscratch is zero */ li t0, 0 csrw sscratch, t0 - /* - * Calculate the offset to __riscv_boot_ap - * for current core, cpuid in a0. - */ - li t1, 4 - mulw t1, t1, a0 - /* Get pointer */ - la t0, __riscv_boot_ap - add t0, t0, t1 - -1: - /* Wait the kernel to be ready */ - lw t1, 0(t0) - beqz t1, 1b call init_secondary END(mpentry) From owner-svn-src-head@freebsd.org Wed Jun 13 11:11:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1490D102137C; Wed, 13 Jun 2018 11:11:35 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA4797B712; Wed, 13 Jun 2018 11:11:34 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C7DD18956; Wed, 13 Jun 2018 11:11:34 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DBBYFi065653; Wed, 13 Jun 2018 11:11:34 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DBBYg5065649; Wed, 13 Jun 2018 11:11:34 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201806131111.w5DBBYg5065649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 13 Jun 2018 11:11:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335048 - in head/sys: net netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in head/sys: net netinet netinet6 X-SVN-Commit-Revision: 335048 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 11:11:35 -0000 Author: ae Date: Wed Jun 13 11:11:33 2018 New Revision: 335048 URL: https://svnweb.freebsd.org/changeset/base/335048 Log: Rework if_gre(4) to use encap_lookup_t method to speedup lookup of needed interface when many gre interfaces are present. Remove rmlock from gre_softc, use epoch(9) and CK_LIST instead. Move more AF-related code into AF-related locations. Use hash table to speedup lookup of needed softc. Modified: head/sys/net/if_gre.c head/sys/net/if_gre.h head/sys/netinet/ip_gre.c head/sys/netinet6/ip6_gre.c Modified: head/sys/net/if_gre.c ============================================================================== --- head/sys/net/if_gre.c Wed Jun 13 10:32:21 2018 (r335047) +++ head/sys/net/if_gre.c Wed Jun 13 11:11:33 2018 (r335048) @@ -2,7 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 1998 The NetBSD Foundation, Inc. - * Copyright (c) 2014 Andrey V. Elsukov + * Copyright (c) 2014, 2018 Andrey V. Elsukov * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -41,17 +41,13 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" #include -#include #include #include -#include #include #include #include #include #include -#include -#include #include #include #include @@ -70,7 +66,6 @@ __FBSDID("$FreeBSD$"); #include #ifdef INET -#include #include #include #include @@ -80,7 +75,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #endif #include @@ -91,18 +85,10 @@ __FBSDID("$FreeBSD$"); #include #define GREMTU 1476 + static const char grename[] = "gre"; -static MALLOC_DEFINE(M_GRE, grename, "Generic Routing Encapsulation"); -static VNET_DEFINE(struct mtx, gre_mtx); -#define V_gre_mtx VNET(gre_mtx) -#define GRE_LIST_LOCK_INIT(x) mtx_init(&V_gre_mtx, "gre_mtx", NULL, \ - MTX_DEF) -#define GRE_LIST_LOCK_DESTROY(x) mtx_destroy(&V_gre_mtx) -#define GRE_LIST_LOCK(x) mtx_lock(&V_gre_mtx) -#define GRE_LIST_UNLOCK(x) mtx_unlock(&V_gre_mtx) +MALLOC_DEFINE(M_GRE, grename, "Generic Routing Encapsulation"); -static VNET_DEFINE(LIST_HEAD(, gre_softc), gre_softc_list); -#define V_gre_softc_list VNET(gre_softc_list) static struct sx gre_ioctl_sx; SX_SYSINIT(gre_ioctl_sx, &gre_ioctl_sx, "gre_ioctl"); @@ -116,12 +102,8 @@ static int gre_transmit(struct ifnet *, struct mbuf *) static int gre_ioctl(struct ifnet *, u_long, caddr_t); static int gre_output(struct ifnet *, struct mbuf *, const struct sockaddr *, struct route *); +static void gre_delete_tunnel(struct gre_softc *); -static void gre_updatehdr(struct gre_softc *); -static int gre_set_tunnel(struct ifnet *, struct sockaddr *, - struct sockaddr *); -static void gre_delete_tunnel(struct ifnet *); - SYSCTL_DECL(_net_link); static SYSCTL_NODE(_net_link, IFT_TUNNEL, gre, CTLFLAG_RW, 0, "Generic Routing Encapsulation"); @@ -145,10 +127,15 @@ SYSCTL_INT(_net_link_gre, OID_AUTO, max_nesting, CTLFL static void vnet_gre_init(const void *unused __unused) { - LIST_INIT(&V_gre_softc_list); - GRE_LIST_LOCK_INIT(); + V_gre_cloner = if_clone_simple(grename, gre_clone_create, gre_clone_destroy, 0); +#ifdef INET + in_gre_init(); +#endif +#ifdef INET6 + in6_gre_init(); +#endif } VNET_SYSINIT(vnet_gre_init, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, vnet_gre_init, NULL); @@ -158,7 +145,12 @@ vnet_gre_uninit(const void *unused __unused) { if_clone_detach(V_gre_cloner); - GRE_LIST_LOCK_DESTROY(); +#ifdef INET + in_gre_uninit(); +#endif +#ifdef INET6 + in6_gre_uninit(); +#endif } VNET_SYSUNINIT(vnet_gre_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, vnet_gre_uninit, NULL); @@ -171,7 +163,6 @@ gre_clone_create(struct if_clone *ifc, int unit, caddr sc = malloc(sizeof(struct gre_softc), M_GRE, M_WAITOK | M_ZERO); sc->gre_fibnum = curthread->td_proc->p_fibnum; GRE2IFP(sc) = if_alloc(IFT_TUNNEL); - GRE_LOCK_INIT(sc); GRE2IFP(sc)->if_softc = sc; if_initname(GRE2IFP(sc), grename, unit); @@ -185,9 +176,6 @@ gre_clone_create(struct if_clone *ifc, int unit, caddr GRE2IFP(sc)->if_capenable |= IFCAP_LINKSTATE; if_attach(GRE2IFP(sc)); bpfattach(GRE2IFP(sc), DLT_NULL, sizeof(u_int32_t)); - GRE_LIST_LOCK(); - LIST_INSERT_HEAD(&V_gre_softc_list, sc, gre_list); - GRE_LIST_UNLOCK(); return (0); } @@ -198,33 +186,22 @@ gre_clone_destroy(struct ifnet *ifp) sx_xlock(&gre_ioctl_sx); sc = ifp->if_softc; - gre_delete_tunnel(ifp); - GRE_LIST_LOCK(); - LIST_REMOVE(sc, gre_list); - GRE_LIST_UNLOCK(); + gre_delete_tunnel(sc); bpfdetach(ifp); if_detach(ifp); ifp->if_softc = NULL; sx_xunlock(&gre_ioctl_sx); + GRE_WAIT(); if_free(ifp); - GRE_LOCK_DESTROY(sc); free(sc, M_GRE); } static int gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { - GRE_RLOCK_TRACKER; struct ifreq *ifr = (struct ifreq *)data; - struct sockaddr *src, *dst; struct gre_softc *sc; -#ifdef INET - struct sockaddr_in *sin = NULL; -#endif -#ifdef INET6 - struct sockaddr_in6 *sin6 = NULL; -#endif uint32_t opt; int error; @@ -249,7 +226,6 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) case GREGPROTO: return (EOPNOTSUPP); } - src = dst = NULL; sx_xlock(&gre_ioctl_sx); sc = ifp->if_softc; if (sc == NULL) { @@ -258,189 +234,25 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } error = 0; switch (cmd) { - case SIOCSIFPHYADDR: -#ifdef INET6 - case SIOCSIFPHYADDR_IN6: -#endif - error = EINVAL; - switch (cmd) { -#ifdef INET - case SIOCSIFPHYADDR: - src = (struct sockaddr *) - &(((struct in_aliasreq *)data)->ifra_addr); - dst = (struct sockaddr *) - &(((struct in_aliasreq *)data)->ifra_dstaddr); + case SIOCDIFPHYADDR: + if (sc->gre_family == 0) break; -#endif -#ifdef INET6 - case SIOCSIFPHYADDR_IN6: - src = (struct sockaddr *) - &(((struct in6_aliasreq *)data)->ifra_addr); - dst = (struct sockaddr *) - &(((struct in6_aliasreq *)data)->ifra_dstaddr); - break; -#endif - default: - error = EAFNOSUPPORT; - goto end; - } - /* sa_family must be equal */ - if (src->sa_family != dst->sa_family || - src->sa_len != dst->sa_len) - goto end; - - /* validate sa_len */ - switch (src->sa_family) { -#ifdef INET - case AF_INET: - if (src->sa_len != sizeof(struct sockaddr_in)) - goto end; - break; -#endif -#ifdef INET6 - case AF_INET6: - if (src->sa_len != sizeof(struct sockaddr_in6)) - goto end; - break; -#endif - default: - error = EAFNOSUPPORT; - goto end; - } - /* check sa_family looks sane for the cmd */ - error = EAFNOSUPPORT; - switch (cmd) { -#ifdef INET - case SIOCSIFPHYADDR: - if (src->sa_family == AF_INET) - break; - goto end; -#endif -#ifdef INET6 - case SIOCSIFPHYADDR_IN6: - if (src->sa_family == AF_INET6) - break; - goto end; -#endif - } - error = EADDRNOTAVAIL; - switch (src->sa_family) { -#ifdef INET - case AF_INET: - if (satosin(src)->sin_addr.s_addr == INADDR_ANY || - satosin(dst)->sin_addr.s_addr == INADDR_ANY) - goto end; - break; -#endif -#ifdef INET6 - case AF_INET6: - if (IN6_IS_ADDR_UNSPECIFIED(&satosin6(src)->sin6_addr) - || - IN6_IS_ADDR_UNSPECIFIED(&satosin6(dst)->sin6_addr)) - goto end; - /* - * Check validity of the scope zone ID of the - * addresses, and convert it into the kernel - * internal form if necessary. - */ - error = sa6_embedscope(satosin6(src), 0); - if (error != 0) - goto end; - error = sa6_embedscope(satosin6(dst), 0); - if (error != 0) - goto end; -#endif - } - error = gre_set_tunnel(ifp, src, dst); + gre_delete_tunnel(sc); break; - case SIOCDIFPHYADDR: - gre_delete_tunnel(ifp); - break; +#ifdef INET + case SIOCSIFPHYADDR: case SIOCGIFPSRCADDR: case SIOCGIFPDSTADDR: + error = in_gre_ioctl(sc, cmd, data); + break; +#endif #ifdef INET6 + case SIOCSIFPHYADDR_IN6: case SIOCGIFPSRCADDR_IN6: case SIOCGIFPDSTADDR_IN6: -#endif - if (sc->gre_family == 0) { - error = EADDRNOTAVAIL; - break; - } - GRE_RLOCK(sc); - switch (cmd) { -#ifdef INET - case SIOCGIFPSRCADDR: - case SIOCGIFPDSTADDR: - if (sc->gre_family != AF_INET) { - error = EADDRNOTAVAIL; - break; - } - sin = (struct sockaddr_in *)&ifr->ifr_addr; - memset(sin, 0, sizeof(*sin)); - sin->sin_family = AF_INET; - sin->sin_len = sizeof(*sin); - break; -#endif -#ifdef INET6 - case SIOCGIFPSRCADDR_IN6: - case SIOCGIFPDSTADDR_IN6: - if (sc->gre_family != AF_INET6) { - error = EADDRNOTAVAIL; - break; - } - sin6 = (struct sockaddr_in6 *) - &(((struct in6_ifreq *)data)->ifr_addr); - memset(sin6, 0, sizeof(*sin6)); - sin6->sin6_family = AF_INET6; - sin6->sin6_len = sizeof(*sin6); - break; -#endif - } - if (error == 0) { - switch (cmd) { -#ifdef INET - case SIOCGIFPSRCADDR: - sin->sin_addr = sc->gre_oip.ip_src; - break; - case SIOCGIFPDSTADDR: - sin->sin_addr = sc->gre_oip.ip_dst; - break; -#endif -#ifdef INET6 - case SIOCGIFPSRCADDR_IN6: - sin6->sin6_addr = sc->gre_oip6.ip6_src; - break; - case SIOCGIFPDSTADDR_IN6: - sin6->sin6_addr = sc->gre_oip6.ip6_dst; - break; -#endif - } - } - GRE_RUNLOCK(sc); - if (error != 0) - break; - switch (cmd) { -#ifdef INET - case SIOCGIFPSRCADDR: - case SIOCGIFPDSTADDR: - error = prison_if(curthread->td_ucred, - (struct sockaddr *)sin); - if (error != 0) - memset(sin, 0, sizeof(*sin)); - break; -#endif -#ifdef INET6 - case SIOCGIFPSRCADDR_IN6: - case SIOCGIFPDSTADDR_IN6: - error = prison_if(curthread->td_ucred, - (struct sockaddr *)sin6); - if (error == 0) - error = sa6_recoverscope(sin6); - if (error != 0) - memset(sin6, 0, sizeof(*sin6)); -#endif - } + error = in6_gre_ioctl(sc, cmd, data); break; +#endif case SIOCGTUNFIB: ifr->ifr_fib = sc->gre_fibnum; break; @@ -453,40 +265,50 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) sc->gre_fibnum = ifr->ifr_fib; break; case GRESKEY: + case GRESOPTS: if ((error = priv_check(curthread, PRIV_NET_GRE)) != 0) break; if ((error = copyin(ifr_data_get_ptr(ifr), &opt, sizeof(opt))) != 0) break; - if (sc->gre_key != opt) { - GRE_WLOCK(sc); - sc->gre_key = opt; - gre_updatehdr(sc); - GRE_WUNLOCK(sc); + if (cmd == GRESKEY) { + if (sc->gre_key == opt) + break; + } else if (cmd == GRESOPTS) { + if (opt & ~GRE_OPTMASK) { + error = EINVAL; + break; + } + if (sc->gre_options == opt) + break; } - break; - case GREGKEY: - error = copyout(&sc->gre_key, ifr_data_get_ptr(ifr), - sizeof(sc->gre_key)); - break; - case GRESOPTS: - if ((error = priv_check(curthread, PRIV_NET_GRE)) != 0) + switch (sc->gre_family) { +#ifdef INET + case AF_INET: + in_gre_setopts(sc, cmd, opt); break; - if ((error = copyin(ifr_data_get_ptr(ifr), &opt, - sizeof(opt))) != 0) +#endif +#ifdef INET6 + case AF_INET6: + in6_gre_setopts(sc, cmd, opt); break; - if (opt & ~GRE_OPTMASK) - error = EINVAL; - else { - if (sc->gre_options != opt) { - GRE_WLOCK(sc); +#endif + default: + if (cmd == GRESKEY) + sc->gre_key = opt; + else sc->gre_options = opt; - gre_updatehdr(sc); - GRE_WUNLOCK(sc); - } + break; } + /* + * XXX: Do we need to initiate change of interface + * state here? + */ break; - + case GREGKEY: + error = copyout(&sc->gre_key, ifr_data_get_ptr(ifr), + sizeof(sc->gre_key)); + break; case GREGOPTS: error = copyout(&sc->gre_options, ifr_data_get_ptr(ifr), sizeof(sc->gre_options)); @@ -495,40 +317,68 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) error = EINVAL; break; } + if (error == 0 && sc->gre_family != 0) { + if ( +#ifdef INET + cmd == SIOCSIFPHYADDR || +#endif +#ifdef INET6 + cmd == SIOCSIFPHYADDR_IN6 || +#endif + 0) { + ifp->if_drv_flags |= IFF_DRV_RUNNING; + if_link_state_change(ifp, LINK_STATE_UP); + } + } end: sx_xunlock(&gre_ioctl_sx); return (error); } static void -gre_updatehdr(struct gre_softc *sc) +gre_delete_tunnel(struct gre_softc *sc) { - struct grehdr *gh = NULL; + + sx_assert(&gre_ioctl_sx, SA_XLOCKED); + if (sc->gre_family != 0) { + CK_LIST_REMOVE(sc, chain); + GRE_WAIT(); + free(sc->gre_hdr, M_GRE); + sc->gre_family = 0; + } + GRE2IFP(sc)->if_drv_flags &= ~IFF_DRV_RUNNING; + if_link_state_change(GRE2IFP(sc), LINK_STATE_DOWN); +} + +struct gre_list * +gre_hashinit(void) +{ + struct gre_list *hash; + int i; + + hash = malloc(sizeof(struct gre_list) * GRE_HASH_SIZE, + M_GRE, M_WAITOK); + for (i = 0; i < GRE_HASH_SIZE; i++) + CK_LIST_INIT(&hash[i]); + + return (hash); +} + +void +gre_hashdestroy(struct gre_list *hash) +{ + + free(hash, M_GRE); +} + +void +gre_updatehdr(struct gre_softc *sc, struct grehdr *gh) +{ uint32_t *opts; uint16_t flags; - GRE_WLOCK_ASSERT(sc); - switch (sc->gre_family) { -#ifdef INET - case AF_INET: - sc->gre_hlen = sizeof(struct greip); - sc->gre_oip.ip_v = IPPROTO_IPV4; - sc->gre_oip.ip_hl = sizeof(struct ip) >> 2; - sc->gre_oip.ip_p = IPPROTO_GRE; - gh = &sc->gre_gihdr->gi_gre; - break; -#endif -#ifdef INET6 - case AF_INET6: - sc->gre_hlen = sizeof(struct greip6); - sc->gre_oip6.ip6_vfc = IPV6_VERSION; - sc->gre_oip6.ip6_nxt = IPPROTO_GRE; - gh = &sc->gre_gi6hdr->gi6_gre; - break; -#endif - default: - return; - } + sx_assert(&gre_ioctl_sx, SA_XLOCKED); + flags = 0; opts = gh->gre_opts; if (sc->gre_options & GRE_ENABLE_CSUM) { @@ -550,141 +400,6 @@ gre_updatehdr(struct gre_softc *sc) gh->gre_flags = htons(flags); } -static void -gre_detach(struct gre_softc *sc, int family) -{ - - sx_assert(&gre_ioctl_sx, SA_XLOCKED); - if (sc->gre_ecookie != NULL) { - switch (family) { -#ifdef INET - case AF_INET: - ip_encap_detach(sc->gre_ecookie); - break; -#endif -#ifdef INET6 - case AF_INET6: - ip6_encap_detach(sc->gre_ecookie); - break; -#endif - } - } - sc->gre_ecookie = NULL; -} - -static int -gre_set_tunnel(struct ifnet *ifp, struct sockaddr *src, - struct sockaddr *dst) -{ - struct gre_softc *sc, *tsc; -#ifdef INET6 - struct ip6_hdr *ip6; -#endif -#ifdef INET - struct ip *ip; -#endif - void *hdr; - int error; - - sx_assert(&gre_ioctl_sx, SA_XLOCKED); - GRE_LIST_LOCK(); - sc = ifp->if_softc; - LIST_FOREACH(tsc, &V_gre_softc_list, gre_list) { - if (tsc == sc || tsc->gre_family != src->sa_family) - continue; -#ifdef INET - if (tsc->gre_family == AF_INET && - tsc->gre_oip.ip_src.s_addr == - satosin(src)->sin_addr.s_addr && - tsc->gre_oip.ip_dst.s_addr == - satosin(dst)->sin_addr.s_addr) { - GRE_LIST_UNLOCK(); - return (EADDRNOTAVAIL); - } -#endif -#ifdef INET6 - if (tsc->gre_family == AF_INET6 && - IN6_ARE_ADDR_EQUAL(&tsc->gre_oip6.ip6_src, - &satosin6(src)->sin6_addr) && - IN6_ARE_ADDR_EQUAL(&tsc->gre_oip6.ip6_dst, - &satosin6(dst)->sin6_addr)) { - GRE_LIST_UNLOCK(); - return (EADDRNOTAVAIL); - } -#endif - } - GRE_LIST_UNLOCK(); - - switch (src->sa_family) { -#ifdef INET - case AF_INET: - hdr = ip = malloc(sizeof(struct greip) + - 3 * sizeof(uint32_t), M_GRE, M_WAITOK | M_ZERO); - ip->ip_src = satosin(src)->sin_addr; - ip->ip_dst = satosin(dst)->sin_addr; - break; -#endif -#ifdef INET6 - case AF_INET6: - hdr = ip6 = malloc(sizeof(struct greip6) + - 3 * sizeof(uint32_t), M_GRE, M_WAITOK | M_ZERO); - ip6->ip6_src = satosin6(src)->sin6_addr; - ip6->ip6_dst = satosin6(dst)->sin6_addr; - break; -#endif - default: - return (EAFNOSUPPORT); - } - if (sc->gre_family != 0) - gre_detach(sc, sc->gre_family); - GRE_WLOCK(sc); - if (sc->gre_family != 0) - free(sc->gre_hdr, M_GRE); - sc->gre_family = src->sa_family; - sc->gre_hdr = hdr; - sc->gre_oseq = 0; - sc->gre_iseq = UINT32_MAX; - gre_updatehdr(sc); - GRE_WUNLOCK(sc); - - error = 0; - switch (src->sa_family) { -#ifdef INET - case AF_INET: - error = in_gre_attach(sc); - break; -#endif -#ifdef INET6 - case AF_INET6: - error = in6_gre_attach(sc); - break; -#endif - } - if (error == 0) { - ifp->if_drv_flags |= IFF_DRV_RUNNING; - if_link_state_change(ifp, LINK_STATE_UP); - } - return (error); -} - -static void -gre_delete_tunnel(struct ifnet *ifp) -{ - struct gre_softc *sc = ifp->if_softc; - int family; - - GRE_WLOCK(sc); - family = sc->gre_family; - sc->gre_family = 0; - GRE_WUNLOCK(sc); - if (family != 0) { - gre_detach(sc, family); - free(sc->gre_hdr, M_GRE); - } - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - if_link_state_change(ifp, LINK_STATE_DOWN); -} - int gre_input(struct mbuf *m, int off, int proto, void *arg) { @@ -823,35 +538,18 @@ gre_output(struct ifnet *ifp, struct mbuf *m, const st struct route *ro) { uint32_t af; - int error; -#ifdef MAC - error = mac_ifnet_check_transmit(ifp, m); - if (error != 0) - goto drop; -#endif - if ((ifp->if_flags & IFF_MONITOR) != 0 || - (ifp->if_flags & IFF_UP) == 0) { - error = ENETDOWN; - goto drop; - } - - error = gre_check_nesting(ifp, m); - if (error != 0) - goto drop; - - m->m_flags &= ~(M_BCAST|M_MCAST); if (dst->sa_family == AF_UNSPEC) bcopy(dst->sa_data, &af, sizeof(af)); else af = dst->sa_family; - BPF_MTAP2(ifp, &af, sizeof(af), m); - m->m_pkthdr.csum_data = af; /* save af for if_transmit */ + /* + * Now save the af in the inbound pkt csum data, this is a cheat since + * we are using the inbound csum_data field to carry the af over to + * the gre_transmit() routine, avoiding using yet another mtag. + */ + m->m_pkthdr.csum_data = af; return (ifp->if_transmit(ifp, m)); -drop: - m_freem(m); - if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); - return (error); } static void @@ -874,92 +572,90 @@ gre_setseqn(struct grehdr *gh, uint32_t seq) static int gre_transmit(struct ifnet *ifp, struct mbuf *m) { - GRE_RLOCK_TRACKER; struct gre_softc *sc; struct grehdr *gh; - uint32_t iaf, oaf, oseq; - int error, hlen, olen, plen; - int want_seq, want_csum; + uint32_t af; + int error, len; + uint16_t proto; - plen = 0; - sc = ifp->if_softc; - if (sc == NULL) { - error = ENETDOWN; + len = 0; +#ifdef MAC + error = mac_ifnet_check_transmit(ifp, m); + if (error) { m_freem(m); goto drop; } - GRE_RLOCK(sc); - if (sc->gre_family == 0) { - GRE_RUNLOCK(sc); - error = ENETDOWN; +#endif + error = ENETDOWN; + GRE_RLOCK(); + sc = ifp->if_softc; + if ((ifp->if_flags & IFF_MONITOR) != 0 || + (ifp->if_flags & IFF_UP) == 0 || + sc->gre_family == 0 || + (error = gre_check_nesting(ifp, m)) != 0) { m_freem(m); goto drop; } - iaf = m->m_pkthdr.csum_data; - oaf = sc->gre_family; - hlen = sc->gre_hlen; - want_seq = (sc->gre_options & GRE_ENABLE_SEQ) != 0; - if (want_seq) - oseq = sc->gre_oseq++; /* XXX */ - else - oseq = 0; /* Make compiler happy. */ - want_csum = (sc->gre_options & GRE_ENABLE_CSUM) != 0; + af = m->m_pkthdr.csum_data; M_SETFIB(m, sc->gre_fibnum); - M_PREPEND(m, hlen, M_NOWAIT); + M_PREPEND(m, sc->gre_hlen, M_NOWAIT); if (m == NULL) { - GRE_RUNLOCK(sc); error = ENOBUFS; goto drop; } - bcopy(sc->gre_hdr, mtod(m, void *), hlen); - GRE_RUNLOCK(sc); - switch (oaf) { + bcopy(sc->gre_hdr, mtod(m, void *), sc->gre_hlen); + /* Determine GRE proto */ + switch (af) { #ifdef INET case AF_INET: - olen = sizeof(struct ip); + proto = htons(ETHERTYPE_IP); break; #endif #ifdef INET6 case AF_INET6: - olen = sizeof(struct ip6_hdr); + proto = htons(ETHERTYPE_IPV6); break; #endif default: + m_freem(m); error = ENETDOWN; goto drop; } - gh = (struct grehdr *)mtodo(m, olen); - switch (iaf) { + /* Determine offset of GRE header */ + switch (sc->gre_family) { #ifdef INET case AF_INET: - gh->gre_proto = htons(ETHERTYPE_IP); + len = sizeof(struct ip); break; #endif #ifdef INET6 case AF_INET6: - gh->gre_proto = htons(ETHERTYPE_IPV6); + len = sizeof(struct ip6_hdr); break; #endif default: + m_freem(m); error = ENETDOWN; goto drop; } - if (want_seq) - gre_setseqn(gh, oseq); - if (want_csum) { + gh = (struct grehdr *)mtodo(m, len); + gh->gre_proto = proto; + if (sc->gre_options & GRE_ENABLE_SEQ) + gre_setseqn(gh, sc->gre_oseq++); + if (sc->gre_options & GRE_ENABLE_CSUM) { *(uint16_t *)gh->gre_opts = in_cksum_skip(m, - m->m_pkthdr.len, olen); + m->m_pkthdr.len, len); } - plen = m->m_pkthdr.len - hlen; - switch (oaf) { + len = m->m_pkthdr.len - len; + switch (sc->gre_family) { #ifdef INET case AF_INET: - error = in_gre_output(m, iaf, hlen); + error = in_gre_output(m, af, sc->gre_hlen); break; #endif #ifdef INET6 case AF_INET6: - error = in6_gre_output(m, iaf, hlen); + error = in6_gre_output(m, af, sc->gre_hlen); break; #endif default: @@ -971,8 +667,9 @@ drop: if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); else { if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); - if_inc_counter(ifp, IFCOUNTER_OBYTES, plen); + if_inc_counter(ifp, IFCOUNTER_OBYTES, len); } + GRE_RUNLOCK(); return (error); } Modified: head/sys/net/if_gre.h ============================================================================== --- head/sys/net/if_gre.h Wed Jun 13 10:32:21 2018 (r335047) +++ head/sys/net/if_gre.h Wed Jun 13 11:11:33 2018 (r335048) @@ -64,8 +64,6 @@ struct greip6 { struct gre_softc { struct ifnet *gre_ifp; - LIST_ENTRY(gre_softc) gre_list; - struct rmlock gre_lock; int gre_family; /* AF of delivery header */ uint32_t gre_iseq; uint32_t gre_oseq; @@ -82,18 +80,20 @@ struct gre_softc { struct greip6 *gi6hdr; #endif } gre_uhdr; - const struct encaptab *gre_ecookie; + + CK_LIST_ENTRY(gre_softc) chain; }; +CK_LIST_HEAD(gre_list, gre_softc); +MALLOC_DECLARE(M_GRE); + +#ifndef GRE_HASH_SIZE +#define GRE_HASH_SIZE (1 << 4) +#endif + #define GRE2IFP(sc) ((sc)->gre_ifp) -#define GRE_LOCK_INIT(sc) rm_init(&(sc)->gre_lock, "gre softc") -#define GRE_LOCK_DESTROY(sc) rm_destroy(&(sc)->gre_lock) -#define GRE_RLOCK_TRACKER struct rm_priotracker gre_tracker -#define GRE_RLOCK(sc) rm_rlock(&(sc)->gre_lock, &gre_tracker) -#define GRE_RUNLOCK(sc) rm_runlock(&(sc)->gre_lock, &gre_tracker) -#define GRE_RLOCK_ASSERT(sc) rm_assert(&(sc)->gre_lock, RA_RLOCKED) -#define GRE_WLOCK(sc) rm_wlock(&(sc)->gre_lock) -#define GRE_WUNLOCK(sc) rm_wunlock(&(sc)->gre_lock) -#define GRE_WLOCK_ASSERT(sc) rm_assert(&(sc)->gre_lock, RA_WLOCKED) +#define GRE_RLOCK() epoch_enter_preempt(net_epoch_preempt) +#define GRE_RUNLOCK() epoch_exit_preempt(net_epoch_preempt) +#define GRE_WAIT() epoch_wait_preempt(net_epoch_preempt) #define gre_hdr gre_uhdr.hdr #define gre_gihdr gre_uhdr.gihdr @@ -101,15 +101,23 @@ struct gre_softc { #define gre_oip gre_gihdr->gi_ip #define gre_oip6 gre_gi6hdr->gi6_ip6 +struct gre_list *gre_hashinit(void); +void gre_hashdestroy(struct gre_list *); + int gre_input(struct mbuf *, int, int, void *); -#ifdef INET -int in_gre_attach(struct gre_softc *); +void gre_updatehdr(struct gre_softc *, struct grehdr *); + +void in_gre_init(void); +void in_gre_uninit(void); +void in_gre_setopts(struct gre_softc *, u_long, uint32_t); +int in_gre_ioctl(struct gre_softc *, u_long, caddr_t); int in_gre_output(struct mbuf *, int, int); -#endif -#ifdef INET6 -int in6_gre_attach(struct gre_softc *); + +void in6_gre_init(void); +void in6_gre_uninit(void); +void in6_gre_setopts(struct gre_softc *, u_long, uint32_t); +int in6_gre_ioctl(struct gre_softc *, u_long, caddr_t); int in6_gre_output(struct mbuf *, int, int); -#endif /* * CISCO uses special type for GRE tunnel created as part of WCCP * connection, while in fact those packets are just IPv4 encapsulated Modified: head/sys/netinet/ip_gre.c ============================================================================== --- head/sys/netinet/ip_gre.c Wed Jun 13 10:32:21 2018 (r335047) +++ head/sys/netinet/ip_gre.c Wed Jun 13 11:11:33 2018 (r335048) @@ -2,7 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause-NetBSD * * Copyright (c) 1998 The NetBSD Foundation, Inc. - * Copyright (c) 2014 Andrey V. Elsukov + * Copyright (c) 2014, 2018 Andrey V. Elsukov * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -41,17 +41,16 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" #include +#include #include -#include #include -#include +#include +#include #include -#include #include -#include -#include #include -#include +#include + #include #include #include @@ -74,39 +73,171 @@ VNET_DEFINE(int, ip_gre_ttl) = GRE_TTL; SYSCTL_INT(_net_inet_ip, OID_AUTO, grettl, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip_gre_ttl), 0, "Default TTL value for encapsulated packets"); +static VNET_DEFINE(struct gre_list *, ipv4_hashtbl) = NULL; +#define V_ipv4_hashtbl VNET(ipv4_hashtbl) +#define GRE_HASH(src, dst) (V_ipv4_hashtbl[\ + in_gre_hashval((src), (dst)) & (GRE_HASH_SIZE - 1)]) +#define GRE_HASH_SC(sc) GRE_HASH((sc)->gre_oip.ip_src.s_addr,\ + (sc)->gre_oip.ip_dst.s_addr) + +static uint32_t +in_gre_hashval(in_addr_t src, in_addr_t dst) +{ + uint32_t ret; + + ret = fnv_32_buf(&src, sizeof(src), FNV1_32_INIT); + return (fnv_32_buf(&dst, sizeof(dst), ret)); +} + static int -in_gre_encapcheck(const struct mbuf *m, int off, int proto, void *arg) +in_gre_checkdup(const struct gre_softc *sc, in_addr_t src, in_addr_t dst) { - GRE_RLOCK_TRACKER; + struct gre_softc *tmp; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Jun 13 11:12:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC46310216CE; Wed, 13 Jun 2018 11:12:53 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 297AF7B9D2; Wed, 13 Jun 2018 11:12:53 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B53418A8E; Wed, 13 Jun 2018 11:12:53 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DBCqlR066428; Wed, 13 Jun 2018 11:12:52 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DBCqo2066427; Wed, 13 Jun 2018 11:12:52 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806131112.w5DBCqo2066427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Wed, 13 Jun 2018 11:12:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335049 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 335049 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 11:12:54 -0000 Author: eadler Date: Wed Jun 13 11:12:52 2018 New Revision: 335049 URL: https://svnweb.freebsd.org/changeset/base/335049 Log: top(1): remove unneeded logic - remove __pure annotations I added earlier for some functions. One writes to the the arguments as "out" pointers. The other reads from an array, which while const within the function might be mutated externally. - total_change is modified to be at 1, if previously 0, so no if check is needed. Modified: head/usr.bin/top/utils.c Modified: head/usr.bin/top/utils.c ============================================================================== --- head/usr.bin/top/utils.c Wed Jun 13 11:11:33 2018 (r335048) +++ head/usr.bin/top/utils.c Wed Jun 13 11:12:52 2018 (r335049) @@ -122,7 +122,7 @@ digits(int val) * string_index(string, array) - find string in array and return index */ -int __pure +int string_index(const char *string, const char * const *array) { size_t i = 0; @@ -175,7 +175,7 @@ argparse(char *line, int *cntp) * useful on for calculating cpu state percentages. */ -long __pure +long percentages(int cnt, int *out, long *new, long *old, long *diffs) { int i; @@ -210,13 +210,10 @@ percentages(int cnt, int *out, long *new, long *old, l /* calculate percentages based on overall change, rounding up */ half_total = total_change / 2l; - /* Do not divide by 0. Causes Floating point exception */ - if(total_change) { - for (i = 0; i < cnt; i++) - { - *out++ = (int)((*diffs++ * 1000 + half_total) / total_change); - } - } + for (i = 0; i < cnt; i++) + { + *out++ = (int)((*diffs++ * 1000 + half_total) / total_change); + } /* return the total in case the caller wants to use it */ return(total_change); From owner-svn-src-head@freebsd.org Wed Jun 13 11:43:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99B8E1000F39; Wed, 13 Jun 2018 11:43:48 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B66A97CEA9; Wed, 13 Jun 2018 11:43:47 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id cdfdc417; Wed, 13 Jun 2018 13:43:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h= mime-version:content-type:content-transfer-encoding:date:from:to :cc:subject:in-reply-to:references:message-id; s=mail; bh=tHW+4m YewQn2nQlxxGcVQyGN4qw=; b=hOIvNCh6lICN68BtJX9K72l/jKEuZJAfmncBBr N8ulLtQZWGtj2unIGhhuVMdbmLwBrGP7FMT3gdnZ73Kd3j5RWjCHhfyQJJ8KNMIo bmKhoLDpXfRZLA15QXLgJSPo32CZr1EOcGbAJLfKySIrPruPhlpebC+/lfSm7x4g XyYFY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h= mime-version:content-type:content-transfer-encoding:date:from:to :cc:subject:in-reply-to:references:message-id; q=dns; s=mail; b= eTKmgxAGOZVJbqE/jnhtd8molSk5X6SqmX7o5+k9RGLr9dEbfD14/5k8lJQ7JpFR cwQOxBRuy8n/oj6P0DmOD23ssl/F51ZAJcK+cZQdRhbeD9OWWW0ojqtGgvd47H2V fG8UGW+PI4YGoqzzJjZHCMFvAmI2AuMUSUPXEPOPmuY= Received: from webmail.megadrive.org (www1.blih.net [212.83.177.180]) by mail.blih.net (OpenSMTPD) with ESMTP id 3a00b1de; Wed, 13 Jun 2018 13:43:44 +0200 (CEST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 13 Jun 2018 13:43:44 +0200 From: Emmanuel Vadot To: Edward Tomasz Napierala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, owner-src-committers@freebsd.org Subject: Re: svn commit: r335004 - head/release/tools Organization: Bidouilliste In-Reply-To: <201806121645.w5CGjrMM099365@repo.freebsd.org> References: <201806121645.w5CGjrMM099365@repo.freebsd.org> Message-ID: <941a15be461602ae3d723c3f30804248@megadrive.org> X-Sender: manu@bidouilliste.com User-Agent: Roundcube Webmail/1.1.1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 11:43:48 -0000 On 2018-06-12 18:45, Edward Tomasz Napierala wrote: > Author: trasz > Date: Tue Jun 12 16:45:52 2018 > New Revision: 335004 > URL: https://svnweb.freebsd.org/changeset/base/335004 > > Log: > Enable USB OTG serial terminal on ARM SD card images. This > configures > the system to make use of USB device mode / USB OTG to provide a > "virtual > serial port" on release images. > > Reviewed by: gjb@ > MFC after: 2 weeks > Relnotes: yes > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D15602 > > Modified: > head/release/tools/arm.subr > > Modified: head/release/tools/arm.subr > ============================================================================== > --- head/release/tools/arm.subr Tue Jun 12 16:44:13 2018 (r335003) > +++ head/release/tools/arm.subr Tue Jun 12 16:45:52 2018 (r335004) > @@ -92,6 +92,41 @@ arm_create_user() { > return 0 > } > > +arm_setup_usb_otg() { > + # Set up virtual serial port over USB OTG / device mode. > + echo >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf > + echo '# Required for USB OTG virtual serial port.' \ > + >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf > + echo 'notify 100 {' \ > + >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf > + echo ' match "system" "DEVFS";' \ > + >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf > + echo ' match "subsystem" "CDEV";' \ > + >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf > + echo ' match "type" "CREATE";' \ > + >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf > + echo ' match "cdev" "ttyU[0-9]+";' \ > + >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf > + echo ' action "/sbin/init q";' \ > + >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf > + echo '};' \ > + >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf This will be wiped after the first update, better create /etc/devd/otg_serial.conf > + echo '# USB OTG virtual serial port' \ > + >> ${CHROOTDIR}/${DESTDIR}/etc/ttys > + echo 'ttyU0 "/usr/libexec/getty 3wire" vt100 onifconsole secure' \ > + >> ${CHROOTDIR}/${DESTDIR}/etc/ttys > + echo 'ttyU1 "/usr/libexec/getty 3wire" vt100 onifconsole secure' \ > + >> ${CHROOTDIR}/${DESTDIR}/etc/ttys If I have no OTG port and a usb<->uart plugged into my board that will give weird result no ? > + echo '# Configure USB OTG; see usb_template(4).' \ > + >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf > + echo 'hw.usb.template=3' \ > + >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf > + echo 'umodem_load="YES"' \ > + >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf I'm not a big fan of always enabling this functionality. Do you have a board that have no uart but an otg port ? > +} > + > arm_install_base() { > chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${DESTDIR} > eval chroot ${CHROOTDIR} make -C ${WORLDDIR} \ > @@ -102,6 +137,7 @@ arm_install_base() { > chroot ${CHROOTDIR} mkdir -p ${DESTDIR}/boot/msdos > > arm_create_user > + arm_setup_usb_otg > > echo '# Custom /etc/fstab for FreeBSD embedded images' \ > > ${CHROOTDIR}/${DESTDIR}/etc/fstab -- Emmanuel Vadot From owner-svn-src-head@freebsd.org Wed Jun 13 11:49:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0799D10016D5; Wed, 13 Jun 2018 11:49:35 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B16707D362; Wed, 13 Jun 2018 11:49:34 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9376218F95; Wed, 13 Jun 2018 11:49:34 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DBnYZ5082279; Wed, 13 Jun 2018 11:49:34 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DBnYE2082278; Wed, 13 Jun 2018 11:49:34 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201806131149.w5DBnYE2082278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Wed, 13 Jun 2018 11:49:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335050 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 335050 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 11:49:35 -0000 Author: araujo Date: Wed Jun 13 11:49:34 2018 New Revision: 335050 URL: https://svnweb.freebsd.org/changeset/base/335050 Log: While I was investigating CID 1194192 related with a resource leak on mrp memory allocation, I could identify that actually we use this pointer on pci_emul.c as well as on vga.c source file. I have reworked the logic here to make it more readable and also add a warn to explicit show the function where the memory allocation error could happen, also sort headers. Also CID 1194192 was marked as "Intentional". Obtained from: TrueOS MFC after: 4 weeks. Sponsored by: iXsystems Inc. Modified: head/usr.sbin/bhyve/mem.c Modified: head/usr.sbin/bhyve/mem.c ============================================================================== --- head/usr.sbin/bhyve/mem.c Wed Jun 13 11:12:52 2018 (r335049) +++ head/usr.sbin/bhyve/mem.c Wed Jun 13 11:49:34 2018 (r335050) @@ -38,15 +38,16 @@ __FBSDID("$FreeBSD$"); #include -#include #include +#include #include #include -#include -#include #include +#include #include +#include +#include #include "mem.h" @@ -285,8 +286,11 @@ register_mem_int(struct mmio_rb_tree *rbt, struct mem_ err = 0; mrp = malloc(sizeof(struct mmio_rb_range)); - - if (mrp != NULL) { + if (mrp == NULL) { + warn("%s: couldn't allocate memory for mrp\n", + __func__); + err = ENOMEM; + } else { mrp->mr_param = *memp; mrp->mr_base = memp->base; mrp->mr_end = memp->base + memp->size - 1; @@ -297,8 +301,7 @@ register_mem_int(struct mmio_rb_tree *rbt, struct mem_ assert(perror == 0); if (err) free(mrp); - } else - err = ENOMEM; + } return (err); } From owner-svn-src-head@freebsd.org Wed Jun 13 11:58:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4104A10023F0; Wed, 13 Jun 2018 11:58:42 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E5DB87DB5A; Wed, 13 Jun 2018 11:58:41 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C72A719168; Wed, 13 Jun 2018 11:58:41 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DBwfWd087259; Wed, 13 Jun 2018 11:58:41 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DBwfh4087258; Wed, 13 Jun 2018 11:58:41 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201806131158.w5DBwfh4087258@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 13 Jun 2018 11:58:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335051 - head/sys/arm64/include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/include X-SVN-Commit-Revision: 335051 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 11:58:42 -0000 Author: andrew Date: Wed Jun 13 11:58:41 2018 New Revision: 335051 URL: https://svnweb.freebsd.org/changeset/base/335051 Log: Add more Cavium CPU part numbers. While here split the lists by vendor. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/include/cpu.h Modified: head/sys/arm64/include/cpu.h ============================================================================== --- head/sys/arm64/include/cpu.h Wed Jun 13 11:49:34 2018 (r335050) +++ head/sys/arm64/include/cpu.h Wed Jun 13 11:58:41 2018 (r335051) @@ -78,7 +78,7 @@ #define CPU_IMPL_MARVELL 0x56 #define CPU_IMPL_INTEL 0x69 -#define CPU_PART_THUNDER 0x0A1 +/* ARM Part numbers */ #define CPU_PART_FOUNDATION 0xD00 #define CPU_PART_CORTEX_A35 0xD04 #define CPU_PART_CORTEX_A53 0xD03 @@ -87,6 +87,12 @@ #define CPU_PART_CORTEX_A72 0xD08 #define CPU_PART_CORTEX_A73 0xD09 #define CPU_PART_CORTEX_A75 0xD0A + +/* Cavium Part numbers */ +#define CPU_PART_THUNDER 0x0A1 +#define CPU_PART_THUNDERX_81XX 0x0A2 +#define CPU_PART_THUNDERX_83XX 0x0A3 +#define CPU_PART_THUNDERX2 0x0AF #define CPU_REV_THUNDER_1_0 0x00 #define CPU_REV_THUNDER_1_1 0x01 From owner-svn-src-head@freebsd.org Wed Jun 13 12:17:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A3CB10045AD; Wed, 13 Jun 2018 12:17:13 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46E517EAEF; Wed, 13 Jun 2018 12:17:13 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 128EA194A5; Wed, 13 Jun 2018 12:17:13 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DCHCTh097810; Wed, 13 Jun 2018 12:17:12 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DCHC87097805; Wed, 13 Jun 2018 12:17:12 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201806131217.w5DCHC87097805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 13 Jun 2018 12:17:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335052 - in head/sys/arm64: arm64 cavium include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys/arm64: arm64 cavium include X-SVN-Commit-Revision: 335052 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 12:17:13 -0000 Author: andrew Date: Wed Jun 13 12:17:11 2018 New Revision: 335052 URL: https://svnweb.freebsd.org/changeset/base/335052 Log: Rename the ThunderX CPU identification macros to include the X. This is the name people know the product by, and is consistent with the later SoC ID macros. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/gic_v3.c head/sys/arm64/arm64/identcpu.c head/sys/arm64/cavium/thunder_pcie_common.c head/sys/arm64/cavium/thunder_pcie_fdt.c head/sys/arm64/include/cpu.h Modified: head/sys/arm64/arm64/gic_v3.c ============================================================================== --- head/sys/arm64/arm64/gic_v3.c Wed Jun 13 11:58:41 2018 (r335051) +++ head/sys/arm64/arm64/gic_v3.c Wed Jun 13 12:17:11 2018 (r335052) @@ -418,7 +418,7 @@ arm_gic_v3_intr(void *arg) pic = sc->gic_pic; while (1) { - if (CPU_MATCH_ERRATA_CAVIUM_THUNDER_1_1) { + if (CPU_MATCH_ERRATA_CAVIUM_THUNDERX_1_1) { /* * Hardware: Cavium ThunderX * Chip revision: Pass 1.0 (early version) Modified: head/sys/arm64/arm64/identcpu.c ============================================================================== --- head/sys/arm64/arm64/identcpu.c Wed Jun 13 11:58:41 2018 (r335051) +++ head/sys/arm64/arm64/identcpu.c Wed Jun 13 12:17:11 2018 (r335052) @@ -133,7 +133,7 @@ static const struct cpu_parts cpu_parts_arm[] = { }; /* Cavium */ static const struct cpu_parts cpu_parts_cavium[] = { - { CPU_PART_THUNDER, "Thunder" }, + { CPU_PART_THUNDERX, "ThunderX" }, CPU_PART_NONE, }; @@ -212,11 +212,11 @@ print_cpu_features(u_int cpu) * https://lkml.org/lkml/2016/8/4/722 */ /* - * XXX: CPU_MATCH_ERRATA_CAVIUM_THUNDER_1_1 on its own also + * XXX: CPU_MATCH_ERRATA_CAVIUM_THUNDERX_1_1 on its own also * triggers on pass 2.0+. */ if (cpu == 0 && CPU_VAR(PCPU_GET(midr)) == 0 && - CPU_MATCH_ERRATA_CAVIUM_THUNDER_1_1) + CPU_MATCH_ERRATA_CAVIUM_THUNDERX_1_1) printf("WARNING: ThunderX Pass 1.1 detected.\nThis has known " "hardware bugs that may cause the incorrect operation of " "atomic operations.\n"); Modified: head/sys/arm64/cavium/thunder_pcie_common.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_common.c Wed Jun 13 11:58:41 2018 (r335051) +++ head/sys/arm64/cavium/thunder_pcie_common.c Wed Jun 13 12:17:11 2018 (r335052) @@ -159,7 +159,7 @@ thunder_pcie_identify_ecam(device_t dev, int *ecam) /* Check if we're running on Cavium ThunderX */ if (!CPU_MATCH(CPU_IMPL_MASK | CPU_PART_MASK, - CPU_IMPL_CAVIUM, CPU_PART_THUNDER, 0, 0)) + CPU_IMPL_CAVIUM, CPU_PART_THUNDERX, 0, 0)) return (EINVAL); start = bus_get_resource_start(dev, SYS_RES_MEMORY, 0); Modified: head/sys/arm64/cavium/thunder_pcie_fdt.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_fdt.c Wed Jun 13 11:58:41 2018 (r335051) +++ head/sys/arm64/cavium/thunder_pcie_fdt.c Wed Jun 13 12:17:11 2018 (r335052) @@ -97,7 +97,7 @@ thunder_pcie_fdt_probe(device_t dev) /* Check if we're running on Cavium ThunderX */ if (!CPU_MATCH(CPU_IMPL_MASK | CPU_PART_MASK, - CPU_IMPL_CAVIUM, CPU_PART_THUNDER, 0, 0)) + CPU_IMPL_CAVIUM, CPU_PART_THUNDERX, 0, 0)) return (ENXIO); if (!ofw_bus_status_okay(dev)) Modified: head/sys/arm64/include/cpu.h ============================================================================== --- head/sys/arm64/include/cpu.h Wed Jun 13 11:58:41 2018 (r335051) +++ head/sys/arm64/include/cpu.h Wed Jun 13 12:17:11 2018 (r335052) @@ -89,13 +89,13 @@ #define CPU_PART_CORTEX_A75 0xD0A /* Cavium Part numbers */ -#define CPU_PART_THUNDER 0x0A1 +#define CPU_PART_THUNDERX 0x0A1 #define CPU_PART_THUNDERX_81XX 0x0A2 #define CPU_PART_THUNDERX_83XX 0x0A3 #define CPU_PART_THUNDERX2 0x0AF -#define CPU_REV_THUNDER_1_0 0x00 -#define CPU_REV_THUNDER_1_1 0x01 +#define CPU_REV_THUNDERX_1_0 0x00 +#define CPU_REV_THUNDERX_1_1 0x01 #define CPU_IMPL(midr) (((midr) >> 24) & 0xff) #define CPU_PART(midr) (((midr) >> 4) & 0xfff) @@ -137,13 +137,13 @@ * Revision(s): Pass 1.0, Pass 1.1 */ #ifdef THUNDERX_PASS_1_1_ERRATA -#define CPU_MATCH_ERRATA_CAVIUM_THUNDER_1_1 \ +#define CPU_MATCH_ERRATA_CAVIUM_THUNDERX_1_1 \ (CPU_MATCH(CPU_IMPL_MASK | CPU_PART_MASK | CPU_REV_MASK, \ - CPU_IMPL_CAVIUM, CPU_PART_THUNDER, 0, CPU_REV_THUNDER_1_0) || \ + CPU_IMPL_CAVIUM, CPU_PART_THUNDERX, 0, CPU_REV_THUNDERX_1_0) || \ CPU_MATCH(CPU_IMPL_MASK | CPU_PART_MASK | CPU_REV_MASK, \ - CPU_IMPL_CAVIUM, CPU_PART_THUNDER, 0, CPU_REV_THUNDER_1_1)) + CPU_IMPL_CAVIUM, CPU_PART_THUNDERX, 0, CPU_REV_THUNDERX_1_1)) #else -#define CPU_MATCH_ERRATA_CAVIUM_THUNDER_1_1 0 +#define CPU_MATCH_ERRATA_CAVIUM_THUNDERX_1_1 0 #endif From owner-svn-src-head@freebsd.org Wed Jun 13 12:22:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BA671004CF8; Wed, 13 Jun 2018 12:22:02 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 932977F19A; Wed, 13 Jun 2018 12:22:01 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 72A2B19615; Wed, 13 Jun 2018 12:22:01 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DCM1QP001084; Wed, 13 Jun 2018 12:22:01 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DCM00c001080; Wed, 13 Jun 2018 12:22:00 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201806131222.w5DCM00c001080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Wed, 13 Jun 2018 12:22:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335053 - in head/sys: compat/freebsd32 compat/linux fs/nfsclient kern sys X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: in head/sys: compat/freebsd32 compat/linux fs/nfsclient kern sys X-SVN-Commit-Revision: 335053 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 12:22:02 -0000 Author: bde Date: Wed Jun 13 12:22:00 2018 New Revision: 335053 URL: https://svnweb.freebsd.org/changeset/base/335053 Log: Fix the encoding of major and minor numbers in 64-bit dev_t by restoring the old encodings for the lower 16 and 32 bits and only using the higher 32 bits for unusually large major and minor numbers. This change breaks compatibility with the previous encoding (which was only used in -current). Fix truncation to (essentially) 16-bit dev_t in newnfs v3. Any encoding of device numbers gives an ABI, so it can't be changed without translations for compatibility. Extra bits give the much larger complication that the translations need to compress into fewer bits. Fortunately, more than 32 bits are rarely needed, so compression is rarely needed except for 16-bit linux dev_t where it was always needed but never done. The previous encoding moved the major number into the top 32 bits. Almost no translation code handled this, so the major number was blindly truncated away in most 32-bit encodings. E.g., for ffs, mknod(8) with major = 1 and minor = 2 gave dev_t = 0x10000002; ffs cannot represent this and blindly truncated it to 2. But if this mknod was run on any released version of FreeBSD, it gives dev_t = 0x102. ffs can represent this, but in the previous encoding it was not decoded, giving major = 0, minor = 0x102. The presence of bugs was most obvious for exporting dev_t's from an old system to -current, since bugs in newnfs augment them. I fixed oldnfs to support 32-bit dev_t in 1996 (r16634), but this regressed to 16-bit dev_t in newnfs, first to the old 16-bit encoding and then further in -current. E.g., old ad0 with major = 234, minor = 0x10002 had the correct (major, minor) number on the wire, but newnfs truncated this to (234, 2) and then the previous encoding shifted the major number into oblivion as seen by ffs or old applications. I first tried to fix this by translating on every ABI/API boundary, but there are too many boundaries and too many sloppy translations by blind truncation. So use the old encoding for the low 32 bits so that sloppy translations work no worse than before provided the high 32 bits are not set. Add some error checking for when bits are lost. Keep not doing any error checking for translations for almost everything in compat/linux. compat/freebsd32/freebsd32_misc.c: Optionally check for losing bits after possibly-truncating assignments as before. compat/linux/linux_stats.c: Depend on the representation being compatible with Linux's (or just with itself for local use) and spell some of the translations as assignments in a macro that hides the details. fs/nfsclient/nfs_clcomsubs.c: Essentially the same fix as in 1996, except there is now no possible truncation in makedev() itself. Also fix nearby style bugs. kern/vfs_syscalls.c: As for freebsd32. Also update the sysctl description to include file numbers, and change it to describe device ids as device numbers. sys/types.h: Use inline functions (wrapped by macros) since the expressions are now a bit too complicated for plain macros. Describe the encoding and some of the reasons for it. 16-bit compatibility didn't leave many reasonable choices for the 32-bit encoding, and 32-bit compatibility doesn't leave many reasonable choices for the 64-bit encoding. My choice is to put the 8 new minor bits in the low 8 bits of the top 32 bits. This minimizes discontiguities. Reviewed by: kib (except for rewrite of the comment in linux_stats.c) Modified: head/sys/compat/freebsd32/freebsd32_misc.c head/sys/compat/linux/linux_stats.c head/sys/fs/nfsclient/nfs_clcomsubs.c head/sys/kern/vfs_syscalls.c head/sys/sys/types.h Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Wed Jun 13 12:17:11 2018 (r335052) +++ head/sys/compat/freebsd32/freebsd32_misc.c Wed Jun 13 12:22:00 2018 (r335053) @@ -2127,11 +2127,27 @@ freebsd11_cvtstat32(struct stat *in, struct freebsd11_ break; } } - CP(*in, *out, st_dev); + out->st_dev = in->st_dev; + if (out->st_dev != in->st_dev) { + switch (ino64_trunc_error) { + default: + break; + case 1: + return (EOVERFLOW); + } + } CP(*in, *out, st_mode); CP(*in, *out, st_uid); CP(*in, *out, st_gid); - CP(*in, *out, st_rdev); + out->st_rdev = in->st_rdev; + if (out->st_rdev != in->st_rdev) { + switch (ino64_trunc_error) { + default: + break; + case 1: + return (EOVERFLOW); + } + } TS_CP(*in, *out, st_atim); TS_CP(*in, *out, st_mtim); TS_CP(*in, *out, st_ctim); Modified: head/sys/compat/linux/linux_stats.c ============================================================================== --- head/sys/compat/linux/linux_stats.c Wed Jun 13 12:17:11 2018 (r335052) +++ head/sys/compat/linux/linux_stats.c Wed Jun 13 12:22:00 2018 (r335053) @@ -128,13 +128,30 @@ translate_fd_major_minor(struct thread *td, int fd, st fdrop(fp, td); } +/* + * l_dev_t has the same encoding as dev_t in the latter's low 16 bits, so + * don't bother going through major() and minor(). Keep doing blind + * truncation, as for other fields. The previous version didn't even do + * blind truncation after dev_t was expanded to 64 bits. It failed to + * mask out bits 8-15 in minor(). These bits can only be nonzero in th + * 64-bit version. + * + * This is only used for st_dev. st_dev is for the mounted-on device so + * it can't be a device that needs very special translation. The translation + * of blind truncation is done here. st_rdev is supposed to be specially + * translated in callers, with the blind truncation done there too and + * st_rdev in the native struct state abused to hold the linux st_rdev. + * Callers do the last step using an open-coded Linux makedev(). + */ +#define dev_to_ldev(d) ((uint16_t)(d)) + static int newstat_copyout(struct stat *buf, void *ubuf) { struct l_newstat tbuf; bzero(&tbuf, sizeof(tbuf)); - tbuf.st_dev = minor(buf->st_dev) | (major(buf->st_dev) << 8); + tbuf.st_dev = dev_to_ldev(buf->st_dev); tbuf.st_ino = buf->st_ino; tbuf.st_mode = buf->st_mode; tbuf.st_nlink = buf->st_nlink; @@ -222,7 +239,7 @@ stat_copyout(struct stat *buf, void *ubuf) struct l_stat lbuf; bzero(&lbuf, sizeof(lbuf)); - lbuf.st_dev = buf->st_dev; + lbuf.st_dev = dev_to_ldev(buf->st_dev); lbuf.st_ino = buf->st_ino; lbuf.st_mode = buf->st_mode; lbuf.st_nlink = buf->st_nlink; @@ -524,7 +541,7 @@ stat64_copyout(struct stat *buf, void *ubuf) struct l_stat64 lbuf; bzero(&lbuf, sizeof(lbuf)); - lbuf.st_dev = minor(buf->st_dev) | (major(buf->st_dev) << 8); + lbuf.st_dev = dev_to_ldev(buf->st_dev); lbuf.st_ino = buf->st_ino; lbuf.st_mode = buf->st_mode; lbuf.st_nlink = buf->st_nlink; Modified: head/sys/fs/nfsclient/nfs_clcomsubs.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clcomsubs.c Wed Jun 13 12:17:11 2018 (r335052) +++ head/sys/fs/nfsclient/nfs_clcomsubs.c Wed Jun 13 12:22:00 2018 (r335053) @@ -430,8 +430,9 @@ nfsm_loadattr(struct nfsrv_descript *nd, struct nfsvat NFSM_DISSECT(fp, struct nfs_fattr *, NFSX_V3FATTR); nap->na_type = nfsv34tov_type(fp->fa_type); nap->na_mode = fxdr_unsigned(u_short, fp->fa_mode); - nap->na_rdev = makedev(fxdr_unsigned(u_char, fp->fa3_rdev.specdata1), - fxdr_unsigned(u_char, fp->fa3_rdev.specdata2)); + nap->na_rdev = NFSMAKEDEV( + fxdr_unsigned(int, fp->fa3_rdev.specdata1), + fxdr_unsigned(int, fp->fa3_rdev.specdata2)); nap->na_nlink = fxdr_unsigned(uint32_t, fp->fa_nlink); nap->na_uid = fxdr_unsigned(uid_t, fp->fa_uid); nap->na_gid = fxdr_unsigned(gid_t, fp->fa_gid); Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Wed Jun 13 12:17:11 2018 (r335052) +++ head/sys/kern/vfs_syscalls.c Wed Jun 13 12:22:00 2018 (r335053) @@ -2094,12 +2094,25 @@ cvtstat(struct stat *st, struct ostat *ost) int ino64_trunc_error; SYSCTL_INT(_vfs, OID_AUTO, ino64_trunc_error, CTLFLAG_RW, &ino64_trunc_error, 0, - "Error on truncation of inode number, device id or link count"); + "Error on truncation of device, file or inode number, or link count"); + int freebsd11_cvtstat(struct stat *st, struct freebsd11_stat *ost) { ost->st_dev = st->st_dev; + if (ost->st_dev != st->st_dev) { + switch (ino64_trunc_error) { + default: + /* + * Since dev_t is almost raw, don't clamp to the + * maximum for case 2, but ignore the error. + */ + break; + case 1: + return (EOVERFLOW); + } + } ost->st_ino = st->st_ino; if (ost->st_ino != st->st_ino) { switch (ino64_trunc_error) { @@ -2130,6 +2143,14 @@ freebsd11_cvtstat(struct stat *st, struct freebsd11_st ost->st_uid = st->st_uid; ost->st_gid = st->st_gid; ost->st_rdev = st->st_rdev; + if (ost->st_rdev != st->st_rdev) { + switch (ino64_trunc_error) { + default: + break; + case 1: + return (EOVERFLOW); + } + } ost->st_atim = st->st_atim; ost->st_mtim = st->st_mtim; ost->st_ctim = st->st_ctim; Modified: head/sys/sys/types.h ============================================================================== --- head/sys/sys/types.h Wed Jun 13 12:17:11 2018 (r335052) +++ head/sys/sys/types.h Wed Jun 13 12:22:00 2018 (r335053) @@ -366,9 +366,36 @@ __bitcount64(__uint64_t _x) #include -#define major(x) ((int)((dev_t)(x) >> 32)) -#define minor(x) ((int)(x)) -#define makedev(x, y) (((dev_t)(x) << 32) | (unsigned)(y)) +/* + * The major and minor numbers are encoded in dev_t as MMMmmmMm (where + * letters correspond to bytes). The encoding of the lower 4 bytes is + * constrained by compatibility with 16-bit and 32-bit dev_t's. The + * encoding of of the upper 4 bytes is the least unnatural one consistent + * with this and other constraints. Also, the decoding of the m bytes by + * minor() is unnatural to maximize compatibility subject to not discarding + * bits. The upper m byte is shifted into the position of the lower M byte + * instead of shifting 3 upper m bytes to close the gap. Compatibility for + * minor() is achieved iff the upper m byte is 0. + */ +#define major(d) __major(d) +static __inline int +__major(dev_t _d) +{ + return (((_d >> 32) & 0xffffff00) | ((_d >> 8) & 0xff)); +} +#define minor(d) __minor(d) +static __inline int +__minor(dev_t _d) +{ + return (((_d >> 24) & 0xff00) | (_d & 0xffff00ff)); +} +#define makedev(M, m) __makedev((M), (m)) +static __inline dev_t +__makedev(int _M, int _m) +{ + return (((dev_t)(_M & 0xffffff00) << 32) | ((_M & 0xff) << 8) | + ((dev_t)(_m & 0xff00) << 24) | (_m & 0xffff00ff)); +} /* * These declarations belong elsewhere, but are repeated here and in From owner-svn-src-head@freebsd.org Wed Jun 13 12:26:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9777110054F6; Wed, 13 Jun 2018 12:26:38 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 495357F784; Wed, 13 Jun 2018 12:26:38 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B7FB19649; Wed, 13 Jun 2018 12:26:38 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DCQcJt003199; Wed, 13 Jun 2018 12:26:38 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DCQcw0003198; Wed, 13 Jun 2018 12:26:38 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201806131226.w5DCQcw0003198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 13 Jun 2018 12:26:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335054 - head/sys/dev/psci X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/dev/psci X-SVN-Commit-Revision: 335054 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 12:26:38 -0000 Author: andrew Date: Wed Jun 13 12:26:37 2018 New Revision: 335054 URL: https://svnweb.freebsd.org/changeset/base/335054 Log: Add the PSCI_FEATURES function ID. This is found in PSCI 1.0 and is used to query if a given function is implemented and its features. Sponsored by: DARPA, AFRL Modified: head/sys/dev/psci/psci.h Modified: head/sys/dev/psci/psci.h ============================================================================== --- head/sys/dev/psci/psci.h Wed Jun 13 12:22:00 2018 (r335053) +++ head/sys/dev/psci/psci.h Wed Jun 13 12:26:37 2018 (r335054) @@ -74,6 +74,7 @@ int psci_get_version(void); #define PSCI_FNID_MIGRATE_INFO_UP_CPU 0xc4000007 #define PSCI_FNID_SYSTEM_OFF 0x84000008 #define PSCI_FNID_SYSTEM_RESET 0x84000009 +#define PSCI_FNID_FEATURES 0x8400000a #else #define PSCI_FNID_VERSION 0x84000000 #define PSCI_FNID_CPU_SUSPEND 0x84000001 @@ -85,6 +86,7 @@ int psci_get_version(void); #define PSCI_FNID_MIGRATE_INFO_UP_CPU 0x84000007 #define PSCI_FNID_SYSTEM_OFF 0x84000008 #define PSCI_FNID_SYSTEM_RESET 0x84000009 +#define PSCI_FNID_FEATURES 0x8400000a #endif #define PSCI_VER_MAJOR(v) (((v) >> 16) & 0xFF) From owner-svn-src-head@freebsd.org Wed Jun 13 12:32:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDF951005E42; Wed, 13 Jun 2018 12:32:05 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B0137FD78; Wed, 13 Jun 2018 12:32:05 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 47E16197B7; Wed, 13 Jun 2018 12:32:05 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DCW5UE006573; Wed, 13 Jun 2018 12:32:05 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DCW5Qk006572; Wed, 13 Jun 2018 12:32:05 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201806131232.w5DCW5Qk006572@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 13 Jun 2018 12:32:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335055 - head/sys/dev/psci X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/dev/psci X-SVN-Commit-Revision: 335055 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 12:32:05 -0000 Author: andrew Date: Wed Jun 13 12:32:04 2018 New Revision: 335055 URL: https://svnweb.freebsd.org/changeset/base/335055 Log: Find and cache the PSCI version on driver attach. Sponsored by: DARPA, AFRL Modified: head/sys/dev/psci/psci.c Modified: head/sys/dev/psci/psci.c ============================================================================== --- head/sys/dev/psci/psci.c Wed Jun 13 12:26:37 2018 (r335054) +++ head/sys/dev/psci/psci.c Wed Jun 13 12:32:04 2018 (r335055) @@ -74,6 +74,7 @@ __FBSDID("$FreeBSD$"); struct psci_softc { device_t dev; + uint32_t psci_version; uint32_t psci_fnids[PSCI_FN_MAX]; }; @@ -493,6 +494,7 @@ psci_v0_1_init(device_t dev) sc->psci_fnids[PSCI_FN_MIGRATE] = psci_fnid; } + sc->psci_version = (0 << 16) | 1; if (bootverbose) device_printf(dev, "PSCI version 0.1 available\n"); @@ -523,6 +525,7 @@ psci_v0_2_init(device_t dev) if (version == PSCI_RETVAL_NOT_SUPPORTED) return (1); + sc->psci_version = version; if ((PSCI_VER_MAJOR(version) == 0 && PSCI_VER_MINOR(version) == 2) || PSCI_VER_MAJOR(version) == 1) { if (bootverbose) From owner-svn-src-head@freebsd.org Wed Jun 13 12:33:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 395801006338; Wed, 13 Jun 2018 12:33:48 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E187B801A2; Wed, 13 Jun 2018 12:33:47 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C29FC197E8; Wed, 13 Jun 2018 12:33:47 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DCXl6w008479; Wed, 13 Jun 2018 12:33:47 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DCXldN008477; Wed, 13 Jun 2018 12:33:47 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201806131233.w5DCXldN008477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 13 Jun 2018 12:33:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335056 - head/sys/dev/psci X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/dev/psci X-SVN-Commit-Revision: 335056 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 12:33:48 -0000 Author: andrew Date: Wed Jun 13 12:33:47 2018 New Revision: 335056 URL: https://svnweb.freebsd.org/changeset/base/335056 Log: Add a handler for the PSCI_FEATURES function. This needs PSCI 1.0, so check for this, returning an error if the version is too old. Sponsored by: DARPA, AFRL Modified: head/sys/dev/psci/psci.c head/sys/dev/psci/psci.h Modified: head/sys/dev/psci/psci.c ============================================================================== --- head/sys/dev/psci/psci.c Wed Jun 13 12:32:04 2018 (r335055) +++ head/sys/dev/psci/psci.c Wed Jun 13 12:33:47 2018 (r335056) @@ -414,6 +414,20 @@ psci_find_callfn(psci_callfn_t *callfn) return (PSCI_RETVAL_SUCCESS); } +int32_t +psci_features(uint32_t psci_func_id) +{ + + if (psci_softc == NULL) + return (PSCI_RETVAL_NOT_SUPPORTED); + + /* The feature flags were added to PSCI 1.0 */ + if (PSCI_VER_MAJOR(psci_softc->psci_version) < 1) + return (PSCI_RETVAL_NOT_SUPPORTED); + + return (psci_call(PSCI_FNID_FEATURES, psci_func_id, 0, 0)); +} + int psci_cpu_on(unsigned long cpu, unsigned long entry, unsigned long context_id) { Modified: head/sys/dev/psci/psci.h ============================================================================== --- head/sys/dev/psci/psci.h Wed Jun 13 12:32:04 2018 (r335055) +++ head/sys/dev/psci/psci.h Wed Jun 13 12:33:47 2018 (r335056) @@ -36,12 +36,15 @@ typedef int (*psci_callfn_t)(register_t, register_t, r extern int psci_present; -void psci_reset(void); int psci_cpu_on(unsigned long, unsigned long, unsigned long); +void psci_reset(void); +int32_t psci_features(uint32_t); +int psci_get_version(void); + +/* One of these handlers will be selected during the boot */ int psci_hvc_despatch(register_t, register_t, register_t, register_t); int psci_smc_despatch(register_t, register_t, register_t, register_t); -int psci_get_version(void); /* * PSCI return codes. From owner-svn-src-head@freebsd.org Wed Jun 13 12:39:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA3171006B6C; Wed, 13 Jun 2018 12:39:54 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-vk0-x244.google.com (mail-vk0-x244.google.com [IPv6:2607:f8b0:400c:c05::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 60B1D80570; Wed, 13 Jun 2018 12:39:54 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-vk0-x244.google.com with SMTP id s187-v6so1397945vke.9; Wed, 13 Jun 2018 05:39:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=BaiyBaKuEkmuC18w062ceVfWQGi4S1WnX1t2nZW6rlA=; b=eK+2m3zHcWQ2p+jJom33tL09erVIdsFybzNeJXlDsmW1HH5+ODOC5NMrqUuxbeXt6X MQfA1/8w54uxZMrQNhFkx6byQ/6oU2f90FB1+ztjH7xCX8330zvdP/vQLAC/cqK5FrXc 1a0wYTw/fJIPVY0eREIE+Dyv1jlv0VneA98FTX7cfFtBzISy/Run6cxem6/5g/Kei/D9 lqIV4MWUZHp9JTs3lGqAPyeeSuFi+pPEmCXZis6vl0Oaq7A9rM2D6L9OHNbAGYmxRFwW UYjps26XmQ3gy6AUN2xRLqRWn2tGFdetjEwWRNeTB8CiN6baGejcaZpeR4K8rFQ1F9Pb Cvrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=BaiyBaKuEkmuC18w062ceVfWQGi4S1WnX1t2nZW6rlA=; b=iVufCiCrkIU7ISfYxtuar5huAnMbcBEC/0gY0fizXbCx2S+IclTlz/hk2XccgYFxT1 64nIvLrFkET6NLHOih+kKwPQ63n7Yb+IEtePWgcz0pd0RYoT64QhMoteSA8YS0EoSjWx JxoZAPvGitEX0BTbN+8d9tNRusPLg8DrxuKeIDNkOMNd6uvI9aQBYQuGUSJjFYn89OKY p4cL9QMLqJXps8+Pn+4DOYDBMe0tPNUfSzQqgQRJKFznOy45ucRgoND4GH4Ysk29IyPg yH3UHF/n2+UXvxcEnSKUTnqVriX86h+Odo+lwZUgSOctqDfBo5CZxi0dTzgCdoY5RFbM Ad/w== X-Gm-Message-State: APt69E1Qtlpao4eJfCIKn0jPEb0yafni/tbrrhfhsJnWQHZ2ZzuUScrN Ww+DC3WlcgPIeTgrGYkas2dixhiEh6CWRgUydcY= X-Google-Smtp-Source: ADUXVKKcd3LBBp6oLPiHCozTkLYinAQyAs8oAF/tQSxybws+snXdOTnSdqijHcTX6jJtEuTAsrJk9WNzeQ/HjZfTqzs= X-Received: by 2002:a1f:1c15:: with SMTP id c21-v6mr2925652vkc.137.1528893593712; Wed, 13 Jun 2018 05:39:53 -0700 (PDT) MIME-Version: 1.0 Sender: etnapierala@gmail.com Received: by 2002:ab0:12c2:0:0:0:0:0 with HTTP; Wed, 13 Jun 2018 05:39:52 -0700 (PDT) In-Reply-To: <941a15be461602ae3d723c3f30804248@megadrive.org> References: <201806121645.w5CGjrMM099365@repo.freebsd.org> <941a15be461602ae3d723c3f30804248@megadrive.org> From: Edward Napierala Date: Wed, 13 Jun 2018 13:39:52 +0100 X-Google-Sender-Auth: SsIQnQGJtuoqMEkcPDHLEWAvKok Message-ID: Subject: Re: svn commit: r335004 - head/release/tools To: Emmanuel Vadot Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, owner-src-committers@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 12:39:55 -0000 2018-06-13 12:43 GMT+01:00 Emmanuel Vadot : > On 2018-06-12 18:45, Edward Tomasz Napierala wrote: > >> Author: trasz >> Date: Tue Jun 12 16:45:52 2018 >> New Revision: 335004 >> URL: https://svnweb.freebsd.org/changeset/base/335004 >> >> Log: >> Enable USB OTG serial terminal on ARM SD card images. This configures >> the system to make use of USB device mode / USB OTG to provide a >> "virtual >> serial port" on release images. >> >> Reviewed by: gjb@ >> MFC after: 2 weeks >> Relnotes: yes >> Sponsored by: The FreeBSD Foundation >> Differential Revision: https://reviews.freebsd.org/D15602 >> >> Modified: >> head/release/tools/arm.subr >> >> Modified: head/release/tools/arm.subr >> ============================================================ >> ================== >> --- head/release/tools/arm.subr Tue Jun 12 16:44:13 2018 (r335003) >> +++ head/release/tools/arm.subr Tue Jun 12 16:45:52 2018 (r335004) >> @@ -92,6 +92,41 @@ arm_create_user() { >> return 0 >> } >> >> +arm_setup_usb_otg() { >> + # Set up virtual serial port over USB OTG / device mode. >> + echo >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf >> + echo '# Required for USB OTG virtual serial port.' \ >> + >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf >> + echo 'notify 100 {' \ >> + >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf >> + echo ' match "system" "DEVFS";' \ >> + >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf >> + echo ' match "subsystem" "CDEV";' \ >> + >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf >> + echo ' match "type" "CREATE";' \ >> + >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf >> + echo ' match "cdev" "ttyU[0-9]+";' \ >> + >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf >> + echo ' action "/sbin/init q";' \ >> + >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf >> + echo '};' \ >> + >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf >> > > This will be wiped after the first update, better create > /etc/devd/otg_serial.conf > Thanks, I'll look into that. > + echo '# USB OTG virtual serial port' \ >> + >> ${CHROOTDIR}/${DESTDIR}/etc/ttys >> + echo 'ttyU0 "/usr/libexec/getty 3wire" vt100 >> onifconsole secure' \ >> + >> ${CHROOTDIR}/${DESTDIR}/etc/ttys >> + echo 'ttyU1 "/usr/libexec/getty 3wire" vt100 >> onifconsole secure' \ >> + >> ${CHROOTDIR}/${DESTDIR}/etc/ttys >> > > If I have no OTG port and a usb<->uart plugged into my board that will > give weird result no ? > No, because that port won't be marked as console. This only applies to the "virtual" OTG serial ports. > + echo '# Configure USB OTG; see usb_template(4).' \ >> + >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf >> + echo 'hw.usb.template=3' \ >> + >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf >> + echo 'umodem_load="YES"' \ >> + >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf >> > > I'm not a big fan of always enabling this functionality. Do you have a > board that have no uart but an otg port ? > I don't, but this makes it possible to use OTG-enabled boards without using the console cable - having to check the pinouts, making sure the voltage is right etc. Do you see some problems this might cause? From owner-svn-src-head@freebsd.org Wed Jun 13 12:44:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 174CA1007369; Wed, 13 Jun 2018 12:44:46 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C0ED480B0D; Wed, 13 Jun 2018 12:44:45 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E16F199A9; Wed, 13 Jun 2018 12:44:45 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DCijxn013784; Wed, 13 Jun 2018 12:44:45 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DCijH8013783; Wed, 13 Jun 2018 12:44:45 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201806131244.w5DCijH8013783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Wed, 13 Jun 2018 12:44:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335057 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 335057 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 12:44:46 -0000 Author: bde Date: Wed Jun 13 12:44:45 2018 New Revision: 335057 URL: https://svnweb.freebsd.org/changeset/base/335057 Log: Oops, r335053 had an old version of the comment about 16-bit linux dev_t translation. Modified: head/sys/compat/linux/linux_stats.c Modified: head/sys/compat/linux/linux_stats.c ============================================================================== --- head/sys/compat/linux/linux_stats.c Wed Jun 13 12:33:47 2018 (r335056) +++ head/sys/compat/linux/linux_stats.c Wed Jun 13 12:44:45 2018 (r335057) @@ -130,18 +130,20 @@ translate_fd_major_minor(struct thread *td, int fd, st /* * l_dev_t has the same encoding as dev_t in the latter's low 16 bits, so - * don't bother going through major() and minor(). Keep doing blind - * truncation, as for other fields. The previous version didn't even do - * blind truncation after dev_t was expanded to 64 bits. It failed to - * mask out bits 8-15 in minor(). These bits can only be nonzero in th - * 64-bit version. + * truncation of a dev_t to 16 bits gives the same result as unpacking + * using major() and minor() and repacking in the l_dev_t format. This + * detail is hidden in dev_to_ldev(). Overflow in conversions of dev_t's + * are not checked for, as for other fields. * - * This is only used for st_dev. st_dev is for the mounted-on device so - * it can't be a device that needs very special translation. The translation - * of blind truncation is done here. st_rdev is supposed to be specially - * translated in callers, with the blind truncation done there too and - * st_rdev in the native struct state abused to hold the linux st_rdev. - * Callers do the last step using an open-coded Linux makedev(). + * dev_to_ldev() is only used for translating st_dev. When we convert + * st_rdev for copying it out, it isn't really a dev_t, but has already + * been translated to an l_dev_t in a nontrivial way. Translating it + * again would be illogical but would have no effect since the low 16 + * bits have the same encoding. + * + * The nontrivial translation for st_rdev renumbers some devices, but not + * ones that can be mounted on, so it is consistent with the translation + * for st_dev except when the renumbering or truncation causes conflicts. */ #define dev_to_ldev(d) ((uint16_t)(d)) From owner-svn-src-head@freebsd.org Wed Jun 13 13:30:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C14F2100B463 for ; Wed, 13 Jun 2018 13:30:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x236.google.com (mail-it0-x236.google.com [IPv6:2607:f8b0:4001:c0b::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 51C778328E for ; Wed, 13 Jun 2018 13:30:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x236.google.com with SMTP id j135-v6so3864307itj.1 for ; Wed, 13 Jun 2018 06:30:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=J1sMxIAwDBO3alSLuVfb4JrbmY7i904BAu0jM/Ecd04=; b=sNqNb5VKT04PvYI+8ApFcozjh7bePgoTfHuSYgPqzEm2gpba/3VdQWS44D5xH5b9uH mS2ne0k2rHpgh7SbFaJ/dubD7JdPhyiP68CTT4omY43nIdJ6Ir5zH4Agvz7nkSfhww0c OXlfw8akQqBWDH7xZ+/v3bSPw9SN6L9bulp32CgaHymy9CVb13usMUmSL/ZW5UFJFuuW jLh0jd3+pVjzxnWZjKIWJ4GzhikfG4+bkhLxwkQbYN1CnpSIY301IyFCLXn8mexTczH/ 4rE1JcOk7q5lRg5DVJ1S2QKJeK/Le/VudxohNks+5VfTeh/iXOVDupWMqerMn3I+v+c6 LnNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=J1sMxIAwDBO3alSLuVfb4JrbmY7i904BAu0jM/Ecd04=; b=jR2+qGu8RkqUpmKQ6vGFCeIbTEHQd8i7ScaN9H2QlbScTofExuDTkr557+uki1vbO8 9hkD8UNUJ2/lnaxeju+w8aNl3XRN/CRC06HDgEpeoWUHUx98jwM8SFU1L+YgwC1jK4s0 AqRHK01s9dTs5zhEGfv3yrxgULh1wrq3smnS+RSCMVWm8lwNF/QJAIR1QSg8fH9cPMix MHknzuOL+sEzrgZPuUV6wLaofpFxlgLUb+njQJM5qbcc7sPJxOc6zm/9UGEC3lA/f6Vv w5XAyYWZeR+xh1aLcqQd8CqdyvGe+DzD4djKco3JF9WTHY4LBOZB/Uxy1X5dJCWtfwpJ ZzaQ== X-Gm-Message-State: APt69E2skGKzIxeO2Nk3b0ElCRFuvfYBle7f3KA5SBZ5LLf0pdZCo7EB aMvtNenI+1B0H088mdDAvvlOLvJb3CH9n/BkGmX1Sg== X-Google-Smtp-Source: ADUXVKIDJM7s+RWD89SdwiMF0yjUj69jC84P/7tIjQCPs9uj5f3TqHaHR1Z+pUhDY3eaw6KDEY8tQy6zZwP8A0Yd6Y0= X-Received: by 2002:a24:7c8d:: with SMTP id a135-v6mr4600571itd.73.1528896645550; Wed, 13 Jun 2018 06:30:45 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:d028:0:0:0:0:0 with HTTP; Wed, 13 Jun 2018 06:30:44 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: References: <201806121645.w5CGjrMM099365@repo.freebsd.org> <941a15be461602ae3d723c3f30804248@megadrive.org> From: Warner Losh Date: Wed, 13 Jun 2018 07:30:44 -0600 X-Google-Sender-Auth: 3oKCDpfCHV0-vrwB9F6oXiDqEO8 Message-ID: Subject: Re: svn commit: r335004 - head/release/tools To: Edward Napierala Cc: Emmanuel Vadot , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, owner-src-committers@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 13:30:47 -0000 On Wed, Jun 13, 2018 at 6:39 AM, Edward Napierala wrote: > 2018-06-13 12:43 GMT+01:00 Emmanuel Vadot : > >> On 2018-06-12 18:45, Edward Tomasz Napierala wrote: >> >>> Author: trasz >>> Date: Tue Jun 12 16:45:52 2018 >>> New Revision: 335004 >>> URL: https://svnweb.freebsd.org/changeset/base/335004 >>> >>> Log: >>> Enable USB OTG serial terminal on ARM SD card images. This configures >>> the system to make use of USB device mode / USB OTG to provide a >>> "virtual >>> serial port" on release images. >>> >>> Reviewed by: gjb@ >>> MFC after: 2 weeks >>> Relnotes: yes >>> Sponsored by: The FreeBSD Foundation >>> Differential Revision: https://reviews.freebsd.org/D15602 >>> >>> Modified: >>> head/release/tools/arm.subr >>> >>> Modified: head/release/tools/arm.subr >>> ============================================================ >>> ================== >>> --- head/release/tools/arm.subr Tue Jun 12 16:44:13 2018 (r335003) >>> +++ head/release/tools/arm.subr Tue Jun 12 16:45:52 2018 (r335004) >>> @@ -92,6 +92,41 @@ arm_create_user() { >>> return 0 >>> } >>> >>> +arm_setup_usb_otg() { >>> + # Set up virtual serial port over USB OTG / device mode. >>> + echo >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf >>> + echo '# Required for USB OTG virtual serial port.' \ >>> + >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf >>> + echo 'notify 100 {' \ >>> + >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf >>> + echo ' match "system" "DEVFS";' \ >>> + >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf >>> + echo ' match "subsystem" "CDEV";' \ >>> + >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf >>> + echo ' match "type" "CREATE";' \ >>> + >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf >>> + echo ' match "cdev" "ttyU[0-9]+";' \ >>> + >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf >>> + echo ' action "/sbin/init q";' \ >>> + >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf >>> + echo '};' \ >>> + >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf >>> >> >> This will be wiped after the first update, better create >> /etc/devd/otg_serial.conf >> > > Thanks, I'll look into that. > > >> + echo '# USB OTG virtual serial port' \ >>> + >> ${CHROOTDIR}/${DESTDIR}/etc/ttys >>> + echo 'ttyU0 "/usr/libexec/getty 3wire" vt100 >>> onifconsole secure' \ >>> + >> ${CHROOTDIR}/${DESTDIR}/etc/ttys >>> + echo 'ttyU1 "/usr/libexec/getty 3wire" vt100 >>> onifconsole secure' \ >>> + >> ${CHROOTDIR}/${DESTDIR}/etc/ttys >>> >> >> If I have no OTG port and a usb<->uart plugged into my board that will >> give weird result no ? >> > > No, because that port won't be marked as console. This only applies > to the "virtual" OTG serial ports. > Right, and console is an overloaded term. Here it just means 'tty marked by the kernel that gets a getty started on it automatically after it shows up' not 'the device that gets all the kernel I/O.' > + echo '# Configure USB OTG; see usb_template(4).' \ >>> + >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf >>> + echo 'hw.usb.template=3' \ >>> + >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf >>> + echo 'umodem_load="YES"' \ >>> + >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf >>> >> >> I'm not a big fan of always enabling this functionality. Do you have a >> board that have no uart but an otg port ? >> > > I don't, but this makes it possible to use OTG-enabled boards without > using the console cable - having to check the pinouts, making sure the > voltage > is right etc. Do you see some problems this might cause? > I don't, but I still have the same reservations at the name overloading... Warner From owner-svn-src-head@freebsd.org Wed Jun 13 14:07:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37F4C100EAC2; Wed, 13 Jun 2018 14:07:42 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pg0-x244.google.com (mail-pg0-x244.google.com [IPv6:2607:f8b0:400e:c05::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA7EB851AC; Wed, 13 Jun 2018 14:07:41 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pg0-x244.google.com with SMTP id l65-v6so1335222pgl.8; Wed, 13 Jun 2018 07:07:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=NwT1IFeeknopa+38siD5WfgstQM88InTeLJg0T0Al+w=; b=X3vEcruSgiVBMqgV42e7lE4tPp8aQos/DYZCKZTpHBHHkN2uDTFdgt7Oaky8xJYtkc /c7SdKsgg/BG0hiN5buwUjsKJYq+0Mj1inXKmIxhJU7lBi+dzsvNdLZ1ad+DqGs7/2TS QbKSbcPE00c5wTsdpFRkaBSP+e2LYkmDKIz2oNYVGPv1Blk14sYCnfocAKs62d8x0DW4 GM2nCZi9YDjc3thFwyj2VueMxi0jFFkdtXQY1BgK4LQILkqEgxz/FpgMDTKQmNI155hO Aato5RYqWE01K9LX3Cvg+KxPU5ClN9yBgYtjvnXHKUN9zDHtUuGL58sZ7hZEKFEjwdaV WE+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=NwT1IFeeknopa+38siD5WfgstQM88InTeLJg0T0Al+w=; b=YIHTsOI5emKaoA4ePcklBx9NmzQDn5dqGbeiiP/ZZbzshDMqwBkh5kOe9EQFW3dN+9 iv88z200bLnRo3qc7lRHgsrcR1mUYt+z7Qinnop+VXFCO0LZoLrExTEvI/kpG7Zr03Zv XDlyc+3UBfb/azfE19gOAj6KVwKDDB/CeY22HcD6RtsUHVrKFoRs1jsXG7sAwVrQPEBy Ho/0JrpeQd2LBLW3Pkpb2xx27t9tdrjZHtg+tjy2YzRzypOv1ML7rDZtlTEx65IK5zt2 T05kh3NYOfprxeUHL/4MZO2kz9Nazkqfdxg+GXJTvTXFVkbQqoN28I3XAwGm86bR/pwj fM+A== X-Gm-Message-State: APt69E3KhRf3B+uykiurN8PvUailhREWmiHH6rl70QEU2IhPsVKSxsfQ fesTQmrQ15Ls2np3UrIrcfKG8nwU X-Google-Smtp-Source: ADUXVKLNRez4I9lT4DYBfCkQxLsP3r2vnUbDp1hKwOjJ4Celw19peXaBi98WSv5GzDLvVUtXMKbAtA== X-Received: by 2002:a65:578c:: with SMTP id b12-v6mr4309762pgr.315.1528898860724; Wed, 13 Jun 2018 07:07:40 -0700 (PDT) Received: from raichu (toroon0560w-lp140-02-70-49-169-156.dsl.bell.ca. [70.49.169.156]) by smtp.gmail.com with ESMTPSA id a18-v6sm3957508pfn.117.2018.06.13.07.07.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Jun 2018 07:07:39 -0700 (PDT) Sender: Mark Johnston Date: Wed, 13 Jun 2018 10:07:31 -0400 From: Mark Johnston To: Oliver Pinter Cc: Ed Maste , Sean Bruno , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r334046 - head/tools/tools/intel-ucode-split Message-ID: <20180613140731.GA54540@raichu> References: <201805221435.w4MEZXnW041963@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 14:07:42 -0000 On Wed, Jun 13, 2018 at 01:46:34AM +0200, Oliver Pinter wrote: > On Wednesday, June 13, 2018, Ed Maste wrote: > > > On Tue, 12 Jun 2018 at 18:17, Sean Bruno wrote: > > > > > > On 06/12/18 16:05, Oliver Pinter wrote: > > > > On 5/22/18, Ed Maste wrote: > > > >> Author: emaste > > > >> Date: Tue May 22 14:35:33 2018 > > > >> New Revision: 334046 > > > >> URL: https://svnweb.freebsd.org/changeset/base/334046 > > > >> > > > >> Log: > > > >> intel-ucode-split: add -n flag to skip creating output files > > > >> > > > >> Sponsored by: The FreeBSD Foundation > > > >> > > > >> Modified: > > > >> head/tools/tools/intel-ucode-split/intel-ucode-split.c > > > > > > > > Hi! > > > > > > > > Could you please MFC the intel-ucode-split related commits to > > 11-STABLE? > > > > > > > > Thanks, > > > > op > > > > > > Do you need it in base for some reason? This code is already in the > > > devcpu-data port and is used when the port is built. Its not needed for > > > anything AFAIK. > > > > Indeed, the real use in FreeBSD is via the devcpu-data port; I > > committed it to src/tools/ for collaboration and testing. I'll merge > > it to stable/11 if it will be useful for someone, but am curious about > > the use case. > > > > > I'm considering to write an in kernel microcode update facility, based on > firmware(9), and in first idea it would be nice during the generation of > firmware modules. FWIW, I'm working on this for 12.0 and was planning to describe my proposal on -arch in the next couple of weeks. For my purposes at least, firmware(9) isn't suitable. We'd like to ensure that updates are applied before the kernel does CPU identification, and that happens quite early during boot. This places some constraints on the implementation which exclude firmware(9). From owner-svn-src-head@freebsd.org Wed Jun 13 14:55:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC4F41012D5B; Wed, 13 Jun 2018 14:55:32 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 61EBE876E6; Wed, 13 Jun 2018 14:55:32 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 423B61AEED; Wed, 13 Jun 2018 14:55:32 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DEtWiS081185; Wed, 13 Jun 2018 14:55:32 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DEtWPA081184; Wed, 13 Jun 2018 14:55:32 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201806131455.w5DEtWPA081184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 13 Jun 2018 14:55:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335060 - head/sys/security/audit X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sys/security/audit X-SVN-Commit-Revision: 335060 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 14:55:32 -0000 Author: asomers Date: Wed Jun 13 14:55:31 2018 New Revision: 335060 URL: https://svnweb.freebsd.org/changeset/base/335060 Log: audit(4): fix the definition of ARG_TERMID_ADDR Due to a copy/paste error in r168688, ARG_TERMID_ADDR has the same definition as ARG_SADDRUNIX. Fix it. The header change, while publicly visible, is guarded by #ifdef KERNEL, and I can't find any kmod ports that use it. So I'm not bumping __FreeBSD_version. PR: 228820 Submitted by: aniketp Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15702 Modified: head/sys/security/audit/audit_private.h Modified: head/sys/security/audit/audit_private.h ============================================================================== --- head/sys/security/audit/audit_private.h Wed Jun 13 13:41:23 2018 (r335059) +++ head/sys/security/audit/audit_private.h Wed Jun 13 14:55:31 2018 (r335060) @@ -275,7 +275,7 @@ struct audit_record { #define ARG_SADDRINET 0x0000000000100000ULL #define ARG_SADDRINET6 0x0000000000200000ULL #define ARG_SADDRUNIX 0x0000000000400000ULL -#define ARG_TERMID_ADDR 0x0000000000400000ULL +#define ARG_TERMID_ADDR 0x0000000000800000ULL #define ARG_UNUSED2 0x0000000001000000ULL #define ARG_UPATH1 0x0000000002000000ULL #define ARG_UPATH2 0x0000000004000000ULL From owner-svn-src-head@freebsd.org Wed Jun 13 15:24:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D16971015324; Wed, 13 Jun 2018 15:24:08 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 82C3168CFF; Wed, 13 Jun 2018 15:24:08 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 645341B3DE; Wed, 13 Jun 2018 15:24:08 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DFO8N3096625; Wed, 13 Jun 2018 15:24:08 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DFO8Yd096623; Wed, 13 Jun 2018 15:24:08 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201806131524.w5DFO8Yd096623@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 13 Jun 2018 15:24:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335061 - head/sys/dev/psci X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/dev/psci X-SVN-Commit-Revision: 335061 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 15:24:09 -0000 Author: andrew Date: Wed Jun 13 15:24:07 2018 New Revision: 335061 URL: https://svnweb.freebsd.org/changeset/base/335061 Log: Move psci_call to a header file so we can use it in other files to communicate with the firmware. Sponsored by: DARPA, AFRL Modified: head/sys/dev/psci/psci.c head/sys/dev/psci/psci.h Modified: head/sys/dev/psci/psci.c ============================================================================== --- head/sys/dev/psci/psci.c Wed Jun 13 14:55:31 2018 (r335060) +++ head/sys/dev/psci/psci.c Wed Jun 13 15:24:07 2018 (r335061) @@ -110,14 +110,7 @@ static void psci_shutdown(void *, int); static int psci_find_callfn(psci_callfn_t *); static int psci_def_callfn(register_t, register_t, register_t, register_t); -static psci_callfn_t psci_callfn = psci_def_callfn; - -static inline int -psci_call(register_t a, register_t b, register_t c, register_t d) -{ - - return (psci_callfn(a, b, c, d)); -} +psci_callfn_t psci_callfn = psci_def_callfn; static void psci_init(void *dummy) Modified: head/sys/dev/psci/psci.h ============================================================================== --- head/sys/dev/psci/psci.h Wed Jun 13 14:55:31 2018 (r335060) +++ head/sys/dev/psci/psci.h Wed Jun 13 15:24:07 2018 (r335061) @@ -41,6 +41,14 @@ void psci_reset(void); int32_t psci_features(uint32_t); int psci_get_version(void); +/* Handler to let us call into the PSCI/SMCCC firmware */ +extern psci_callfn_t psci_callfn; +static inline int +psci_call(register_t a, register_t b, register_t c, register_t d) +{ + + return (psci_callfn(a, b, c, d)); +} /* One of these handlers will be selected during the boot */ int psci_hvc_despatch(register_t, register_t, register_t, register_t); int psci_smc_despatch(register_t, register_t, register_t, register_t); From owner-svn-src-head@freebsd.org Wed Jun 13 15:32:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96AF31015EB8; Wed, 13 Jun 2018 15:32:01 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462D7694A6; Wed, 13 Jun 2018 15:32:01 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 277721B555; Wed, 13 Jun 2018 15:32:01 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DFW0Ge098400; Wed, 13 Jun 2018 15:32:00 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DFW0oN098397; Wed, 13 Jun 2018 15:32:00 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201806131532.w5DFW0oN098397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 13 Jun 2018 15:32:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335062 - in head/sys: conf dev/psci X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys: conf dev/psci X-SVN-Commit-Revision: 335062 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 15:32:01 -0000 Author: andrew Date: Wed Jun 13 15:32:00 2018 New Revision: 335062 URL: https://svnweb.freebsd.org/changeset/base/335062 Log: Add support for the ARM SMC Calling Convention (SMCCC). This is a method to call into the firmware in a similar way to the existing PSCI, and used PSCI to detect when SMCCC is enabled. There is a function ID space we can use. Currently we only support 3 functions in the ARM Architecture Calls region, however it is expected we will expend these in the future. Sponsored by: DARPA, AFRL Added: head/sys/dev/psci/smccc.c (contents, props changed) head/sys/dev/psci/smccc.h (contents, props changed) Modified: head/sys/conf/files.arm64 Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Wed Jun 13 15:24:07 2018 (r335061) +++ head/sys/conf/files.arm64 Wed Jun 13 15:32:00 2018 (r335062) @@ -208,6 +208,7 @@ dev/pci/pci_host_generic_acpi.c optional pci acpi dev/pci/pci_host_generic_fdt.c optional pci fdt dev/psci/psci.c standard dev/psci/psci_arm64.S standard +dev/psci/smccc.c standard dev/uart/uart_cpu_arm64.c optional uart dev/uart/uart_dev_mu.c optional uart uart_mu dev/uart/uart_dev_pl011.c optional uart pl011 Added: head/sys/dev/psci/smccc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/psci/smccc.c Wed Jun 13 15:32:00 2018 (r335062) @@ -0,0 +1,93 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2018 Andrew Turner + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "opt_acpi.h" +#include "opt_platform.h" + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include + +#define SMCCC_VERSION_1_0 0x10000 + +/* Assume 1.0 until we detect a later version */ +static uint32_t smccc_version = SMCCC_VERSION_1_0; + +static void +smccc_init(void *dummy) +{ + int32_t features; + uint32_t ret; + + features = psci_features(SMCCC_VERSION); + if (features != PSCI_RETVAL_NOT_SUPPORTED) { + ret = psci_call(SMCCC_VERSION, 0, 0, 0); + /* This should always be the case as we checked it above */ + if (ret > 0) + smccc_version = ret; + } + + if (bootverbose) { + printf("Found SMCCC version %u.%u\n", + SMCCC_VERSION_MAJOR(smccc_version), + SMCCC_VERSION_MINOR(smccc_version)); + } +} +SYSINIT(smccc_start, SI_SUB_DRIVERS, SI_ORDER_ANY, smccc_init, NULL); + +int32_t +smccc_arch_features(uint32_t smccc_func_id) +{ + + if (smccc_version == SMCCC_VERSION_1_0) + return (PSCI_RETVAL_NOT_SUPPORTED); + + return (psci_call(SMCCC_ARCH_FEATURES, smccc_func_id, 0, 0)); +} + +/* + * The SMCCC handler for Spectre variant 2: Branch target injection. + * (CVE-2017-5715) + */ +int +smccc_arch_workaround_1(void) +{ + + KASSERT(smccc_version != SMCCC_VERSION_1_0, + ("SMCCC arch workaround 1 called with an invalid SMCCC interface")); + return (psci_call(SMCCC_ARCH_WORKAROUND_1, 0, 0, 0)); +} Added: head/sys/dev/psci/smccc.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/psci/smccc.h Wed Jun 13 15:32:00 2018 (r335062) @@ -0,0 +1,63 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2018 Andrew Turner + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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$ + */ + +#ifndef _PSCI_SMCCC_H_ +#define _PSCI_SMCCC_H_ + +#define SMCCC_VERSION_MAJOR(ver) (((ver) >> 16) & 0x7fff) +#define SMCCC_VERSION_MINOR(ver) ((ver) & 0xffff) + +#define SMCCC_FUNC_ID(type, call_conv, range, func) \ + (((type) << 31) | \ + ((call_conv) << 30) | \ + (((range) & 0x3f) << 24) | \ + ((func) & 0xffff)) + +#define SMCCC_YIELDING_CALL 0 +#define SMCCC_FAST_CALL 1 + +#define SMCCC_32BIT_CALL 0 +#define SMCCC_64BIT_CALL 1 + +#define SMCCC_VERSION \ + SMCCC_FUNC_ID(SMCCC_FAST_CALL, SMCCC_64BIT_CALL, 0, 0) +#define SMCCC_ARCH_FEATURES \ + SMCCC_FUNC_ID(SMCCC_FAST_CALL, SMCCC_64BIT_CALL, 0, 1) +#define SMCCC_ARCH_WORKAROUND_1 \ + SMCCC_FUNC_ID(SMCCC_FAST_CALL, SMCCC_64BIT_CALL, 0, 0x8000) + +int32_t smccc_arch_features(uint32_t); +int smccc_arch_workaround_1(void); + + +#endif /* _PSCI_SMCCC_H_ */ From owner-svn-src-head@freebsd.org Wed Jun 13 15:41:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3320D1016A89; Wed, 13 Jun 2018 15:41:23 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DC58B699A3; Wed, 13 Jun 2018 15:41:22 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD9ED1B5D5; Wed, 13 Jun 2018 15:41:22 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DFfMbD004853; Wed, 13 Jun 2018 15:41:22 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DFfMAj004852; Wed, 13 Jun 2018 15:41:22 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201806131541.w5DFfMAj004852@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 13 Jun 2018 15:41:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335063 - head/sys/dev/psci X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/dev/psci X-SVN-Commit-Revision: 335063 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 15:41:23 -0000 Author: andrew Date: Wed Jun 13 15:41:22 2018 New Revision: 335063 URL: https://svnweb.freebsd.org/changeset/base/335063 Log: Add the SMCCC return codes from ARM DEN 0070A. While here add a comment with the document the function IDs come from. Sponsored by: DARPA, AFRL Modified: head/sys/dev/psci/smccc.h Modified: head/sys/dev/psci/smccc.h ============================================================================== --- head/sys/dev/psci/smccc.h Wed Jun 13 15:32:00 2018 (r335062) +++ head/sys/dev/psci/smccc.h Wed Jun 13 15:41:22 2018 (r335063) @@ -49,12 +49,21 @@ #define SMCCC_32BIT_CALL 0 #define SMCCC_64BIT_CALL 1 +/* + * Arm Architecture Calls. + * These are documented in the document ARM DEN 0070A. + */ #define SMCCC_VERSION \ SMCCC_FUNC_ID(SMCCC_FAST_CALL, SMCCC_64BIT_CALL, 0, 0) #define SMCCC_ARCH_FEATURES \ SMCCC_FUNC_ID(SMCCC_FAST_CALL, SMCCC_64BIT_CALL, 0, 1) #define SMCCC_ARCH_WORKAROUND_1 \ SMCCC_FUNC_ID(SMCCC_FAST_CALL, SMCCC_64BIT_CALL, 0, 0x8000) + +/* The return values from ARM DEN 0070A. */ +#define SMCCC_RET_SUCCESS 0 +#define SMCCC_RET_NOT_SUPPORTED -1 +#define SMCCC_RET_NOT_REQUIRED -2 int32_t smccc_arch_features(uint32_t); int smccc_arch_workaround_1(void); From owner-svn-src-head@freebsd.org Wed Jun 13 15:56:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AD2B10180CC; Wed, 13 Jun 2018 15:56:25 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1AEBB6A898; Wed, 13 Jun 2018 15:56:25 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F03C01B8E7; Wed, 13 Jun 2018 15:56:24 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DFuOi1012187; Wed, 13 Jun 2018 15:56:24 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DFuOcc012186; Wed, 13 Jun 2018 15:56:24 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201806131556.w5DFuOcc012186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 13 Jun 2018 15:56:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335064 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 335064 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 15:56:25 -0000 Author: andrew Date: Wed Jun 13 15:56:24 2018 New Revision: 335064 URL: https://svnweb.freebsd.org/changeset/base/335064 Log: Switch to the SMCCC function for branch predictor hardening. The previous method may not have worked as the firmware checks for the ARCH_WORKAROUND_1 function ID. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/cpu_errata.c Modified: head/sys/arm64/arm64/cpu_errata.c ============================================================================== --- head/sys/arm64/arm64/cpu_errata.c Wed Jun 13 15:41:22 2018 (r335063) +++ head/sys/arm64/arm64/cpu_errata.c Wed Jun 13 15:56:24 2018 (r335064) @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include typedef void (cpu_quirk_install)(void); struct cpu_quirks { @@ -79,7 +79,10 @@ static void install_psci_bp_hardening(void) { - PCPU_SET(bp_harden, psci_get_version); + if (smccc_arch_features(SMCCC_ARCH_WORKAROUND_1) != SMCCC_RET_SUCCESS) + return; + + PCPU_SET(bp_harden, smccc_arch_workaround_1); } void From owner-svn-src-head@freebsd.org Wed Jun 13 15:58:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E78171018414; Wed, 13 Jun 2018 15:58:33 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A30E6AACA; Wed, 13 Jun 2018 15:58:33 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7829C1B8EA; Wed, 13 Jun 2018 15:58:33 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DFwXqf012313; Wed, 13 Jun 2018 15:58:33 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DFwXdZ012312; Wed, 13 Jun 2018 15:58:33 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201806131558.w5DFwXdZ012312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 13 Jun 2018 15:58:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335065 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 335065 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 15:58:34 -0000 Author: andrew Date: Wed Jun 13 15:58:33 2018 New Revision: 335065 URL: https://svnweb.freebsd.org/changeset/base/335065 Log: Add ThunderX2 to the list of CPUs we need to apply the branch predictor hardening to. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/cpu_errata.c Modified: head/sys/arm64/arm64/cpu_errata.c ============================================================================== --- head/sys/arm64/arm64/cpu_errata.c Wed Jun 13 15:56:24 2018 (r335064) +++ head/sys/arm64/arm64/cpu_errata.c Wed Jun 13 15:58:33 2018 (r335065) @@ -73,6 +73,12 @@ static struct cpu_quirks cpu_quirks[] = { .midr_value = CPU_ID_RAW(CPU_IMPL_ARM, CPU_PART_CORTEX_A75,0,0), .quirk_install = install_psci_bp_hardening, }, + { + .midr_mask = CPU_IMPL_MASK | CPU_PART_MASK, + .midr_value = + CPU_ID_RAW(CPU_IMPL_CAVIUM, CPU_PART_THUNDERX2, 0,0), + .quirk_install = install_psci_bp_hardening, + }, }; static void From owner-svn-src-head@freebsd.org Wed Jun 13 16:48:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4515C101C90E; Wed, 13 Jun 2018 16:48:08 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E38876D232; Wed, 13 Jun 2018 16:48:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A82C01C1E1; Wed, 13 Jun 2018 16:48:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DGm71M037717; Wed, 13 Jun 2018 16:48:07 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DGm7i4037714; Wed, 13 Jun 2018 16:48:07 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806131648.w5DGm7i4037714@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 13 Jun 2018 16:48:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335066 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 335066 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 16:48:08 -0000 Author: imp Date: Wed Jun 13 16:48:07 2018 New Revision: 335066 URL: https://svnweb.freebsd.org/changeset/base/335066 Log: Implement a 'car limit' for bioq. Allow one to implement a 'car limit' for bioq_disksort. debug.bioq_batchsize sets the size of car limit. Every time we queue that many requests, we start over so that we limit the latency for requests when the software queue depths are large. A value of '0', the default, means to revert to the old behavior. Sponsored by: Netflix Modified: head/sys/kern/subr_disk.c head/sys/sys/bio.h Modified: head/sys/kern/subr_disk.c ============================================================================== --- head/sys/kern/subr_disk.c Wed Jun 13 15:58:33 2018 (r335065) +++ head/sys/kern/subr_disk.c Wed Jun 13 16:48:07 2018 (r335066) @@ -23,8 +23,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +static int bioq_batchsize = 0; +SYSCTL_INT(_debug, OID_AUTO, bioq_batchsize, CTLFLAG_RW, + &bioq_batchsize, 0, "BIOQ batch size"); + /*- * Disk error is the preface to plaintive error messages * about failing disk transfers. It prints messages of the form @@ -152,6 +157,8 @@ bioq_init(struct bio_queue_head *head) TAILQ_INIT(&head->queue); head->last_offset = 0; head->insert_point = NULL; + head->total = 0; + head->batched = 0; } void @@ -165,6 +172,7 @@ bioq_remove(struct bio_queue_head *head, struct bio *b head->insert_point = NULL; TAILQ_REMOVE(&head->queue, bp, bio_queue); + head->total--; } void @@ -183,6 +191,8 @@ bioq_insert_head(struct bio_queue_head *head, struct b if (head->insert_point == NULL) head->last_offset = bp->bio_offset; TAILQ_INSERT_HEAD(&head->queue, bp, bio_queue); + head->total++; + head->batched = 0; } void @@ -190,6 +200,7 @@ bioq_insert_tail(struct bio_queue_head *head, struct b { TAILQ_INSERT_TAIL(&head->queue, bp, bio_queue); + head->total++; head->insert_point = bp; head->last_offset = bp->bio_offset; } @@ -248,6 +259,11 @@ bioq_disksort(struct bio_queue_head *head, struct bio return; } + if (bioq_batchsize > 0 && head->batched > bioq_batchsize) { + bioq_insert_tail(head, bp); + return; + } + prev = NULL; key = bioq_bio_key(head, bp); cur = TAILQ_FIRST(&head->queue); @@ -266,4 +282,6 @@ bioq_disksort(struct bio_queue_head *head, struct bio TAILQ_INSERT_HEAD(&head->queue, bp, bio_queue); else TAILQ_INSERT_AFTER(&head->queue, prev, bp, bio_queue); + head->total++; + head->batched++; } Modified: head/sys/sys/bio.h ============================================================================== --- head/sys/sys/bio.h Wed Jun 13 15:58:33 2018 (r335065) +++ head/sys/sys/bio.h Wed Jun 13 16:48:07 2018 (r335066) @@ -138,6 +138,8 @@ struct bio_queue_head { TAILQ_HEAD(bio_queue, bio) queue; off_t last_offset; struct bio *insert_point; + int total; + int batched; }; extern struct vm_map *bio_transient_map; From owner-svn-src-head@freebsd.org Wed Jun 13 17:02:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC880101DC14; Wed, 13 Jun 2018 17:01:59 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B1FBC6DE69; Wed, 13 Jun 2018 17:01:59 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 93C7E1C4FF; Wed, 13 Jun 2018 17:01:59 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DH1xa0047664; Wed, 13 Jun 2018 17:01:59 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DH1wma047146; Wed, 13 Jun 2018 17:01:58 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201806131701.w5DH1wma047146@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 13 Jun 2018 17:01:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335067 - head/tests/sys/audit X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/audit X-SVN-Commit-Revision: 335067 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 17:02:00 -0000 Author: asomers Date: Wed Jun 13 17:01:57 2018 New Revision: 335067 URL: https://svnweb.freebsd.org/changeset/base/335067 Log: audit(4): Fix file descriptor leaks in ATF tests Submitted by: aniketp Reported by: Coverity CID: 1393343 1393346 1392695 1392781 1391709 1392078 1392413 CID: 1392014 1392521 1393344 1393345 1393347 1393348 1393349 CID: 1393354 1393355 1393356 1393357 1393358 1393360 1393362 CID: 1393368 1393369 1393370 1393371 1393372 1393373 1393376 CID: 1393380 1393384 1393387 1393388 1393389 MFC after: 2 weeks Sponsored by: Google, Inc (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15782 Modified: head/tests/sys/audit/file-attribute-access.c head/tests/sys/audit/file-close.c head/tests/sys/audit/file-create.c head/tests/sys/audit/file-delete.c head/tests/sys/audit/file-write.c head/tests/sys/audit/open.c head/tests/sys/audit/utils.c Modified: head/tests/sys/audit/file-attribute-access.c ============================================================================== --- head/tests/sys/audit/file-attribute-access.c Wed Jun 13 16:48:07 2018 (r335066) +++ head/tests/sys/audit/file-attribute-access.c Wed Jun 13 17:01:57 2018 (r335067) @@ -36,6 +36,7 @@ static struct pollfd fds[1]; static mode_t mode = 0777; +static int filedesc; static char extregex[80]; static struct stat statbuff; static const char *auclass = "fa"; @@ -55,10 +56,11 @@ ATF_TC_HEAD(stat_success, tc) ATF_TC_BODY(stat_success, tc) { /* File needs to exist to call stat(2) */ - ATF_REQUIRE(open(path, O_CREAT, mode) != -1); + ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); FILE *pipefd = setup(fds, auclass); ATF_REQUIRE_EQ(0, stat(path, &statbuff)); check_audit(fds, successreg, pipefd); + close(filedesc); } ATF_TC_CLEANUP(stat_success, tc) @@ -140,7 +142,6 @@ ATF_TC_HEAD(fstat_success, tc) ATF_TC_BODY(fstat_success, tc) { - int filedesc; /* File needs to exist to call fstat(2) */ ATF_REQUIRE((filedesc = open(path, O_CREAT | O_RDWR, mode)) != -1); FILE *pipefd = setup(fds, auclass); @@ -149,6 +150,7 @@ ATF_TC_BODY(fstat_success, tc) snprintf(extregex, sizeof(extregex), "fstat.*%jd.*return,success", (intmax_t)statbuff.st_ino); check_audit(fds, extregex, pipefd); + close(filedesc); } ATF_TC_CLEANUP(fstat_success, tc) Modified: head/tests/sys/audit/file-close.c ============================================================================== --- head/tests/sys/audit/file-close.c Wed Jun 13 16:48:07 2018 (r335066) +++ head/tests/sys/audit/file-close.c Wed Jun 13 17:01:57 2018 (r335067) @@ -40,6 +40,7 @@ static pid_t pid; static struct pollfd fds[1]; static mode_t mode = 0777; +static int filedesc; static char extregex[80]; static struct stat statbuff; static const char *auclass = "cl"; @@ -103,7 +104,6 @@ ATF_TC_HEAD(close_success, tc) ATF_TC_BODY(close_success, tc) { - int filedesc; /* File needs to exist to call close(2) */ ATF_REQUIRE((filedesc = open(path, O_CREAT | O_RDWR, mode)) != -1); /* Call stat(2) to store the Inode number of 'path' */ @@ -176,7 +176,6 @@ ATF_TC_HEAD(revoke_success, tc) ATF_TC_BODY(revoke_success, tc) { - int filedesc; char *ptyname; pid = getpid(); snprintf(extregex, sizeof(extregex), "revoke.*%d.*return,success", pid); @@ -188,9 +187,7 @@ ATF_TC_BODY(revoke_success, tc) FILE *pipefd = setup(fds, auclass); ATF_REQUIRE_EQ(0, revoke(ptyname)); check_audit(fds, extregex, pipefd); - - /* Close the file descriptor to pseudo terminal */ - ATF_REQUIRE_EQ(0, close(filedesc)); + close(filedesc); } ATF_TC_CLEANUP(revoke_success, tc) Modified: head/tests/sys/audit/file-create.c ============================================================================== --- head/tests/sys/audit/file-create.c Wed Jun 13 16:48:07 2018 (r335066) +++ head/tests/sys/audit/file-create.c Wed Jun 13 17:01:57 2018 (r335067) @@ -37,6 +37,7 @@ static struct pollfd fds[1]; static mode_t mode = 0777; +static int filedesc; static dev_t dev = 0; static const char *auclass = "fc"; static const char *path = "fileforaudit"; @@ -305,10 +306,11 @@ ATF_TC_HEAD(rename_success, tc) ATF_TC_BODY(rename_success, tc) { - ATF_REQUIRE(open(path, O_CREAT, mode) != -1); + ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); FILE *pipefd = setup(fds, auclass); ATF_REQUIRE_EQ(0, rename(path, "renamed")); check_audit(fds, successreg, pipefd); + close(filedesc); } ATF_TC_CLEANUP(rename_success, tc) @@ -347,10 +349,11 @@ ATF_TC_HEAD(renameat_success, tc) ATF_TC_BODY(renameat_success, tc) { - ATF_REQUIRE(open(path, O_CREAT, mode) != -1); + ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); FILE *pipefd = setup(fds, auclass); ATF_REQUIRE_EQ(0, renameat(AT_FDCWD, path, AT_FDCWD, "renamed")); check_audit(fds, successreg, pipefd); + close(filedesc); } ATF_TC_CLEANUP(renameat_success, tc) @@ -389,10 +392,11 @@ ATF_TC_HEAD(link_success, tc) ATF_TC_BODY(link_success, tc) { - ATF_REQUIRE(open(path, O_CREAT, mode) != -1); + ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); FILE *pipefd = setup(fds, auclass); ATF_REQUIRE_EQ(0, link(path, "hardlink")); check_audit(fds, successreg, pipefd); + close(filedesc); } ATF_TC_CLEANUP(link_success, tc) @@ -431,10 +435,11 @@ ATF_TC_HEAD(linkat_success, tc) ATF_TC_BODY(linkat_success, tc) { - ATF_REQUIRE(open(path, O_CREAT, mode) != -1); + ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); FILE *pipefd = setup(fds, auclass); ATF_REQUIRE_EQ(0, linkat(AT_FDCWD, path, AT_FDCWD, "hardlink", 0)); check_audit(fds, successreg, pipefd); + close(filedesc); } ATF_TC_CLEANUP(linkat_success, tc) Modified: head/tests/sys/audit/file-delete.c ============================================================================== --- head/tests/sys/audit/file-delete.c Wed Jun 13 16:48:07 2018 (r335066) +++ head/tests/sys/audit/file-delete.c Wed Jun 13 17:01:57 2018 (r335067) @@ -35,6 +35,7 @@ static struct pollfd fds[1]; static mode_t mode = 0777; +static int filedesc; static const char *path = "fileforaudit"; static const char *errpath = "dirdoesnotexist/fileforaudit"; static const char *successreg = "fileforaudit.*return,success"; @@ -92,10 +93,11 @@ ATF_TC_HEAD(rename_success, tc) ATF_TC_BODY(rename_success, tc) { - ATF_REQUIRE(open(path, O_CREAT, mode) != -1); + ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); FILE *pipefd = setup(fds, "fd"); ATF_REQUIRE_EQ(0, rename(path, "renamed")); check_audit(fds, successreg, pipefd); + close(filedesc); } ATF_TC_CLEANUP(rename_success, tc) @@ -134,10 +136,11 @@ ATF_TC_HEAD(renameat_success, tc) ATF_TC_BODY(renameat_success, tc) { - ATF_REQUIRE(open(path, O_CREAT, mode) != -1); + ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); FILE *pipefd = setup(fds, "fd"); ATF_REQUIRE_EQ(0, renameat(AT_FDCWD, path, AT_FDCWD, "renamed")); check_audit(fds, successreg, pipefd); + close(filedesc); } ATF_TC_CLEANUP(renameat_success, tc) @@ -176,10 +179,11 @@ ATF_TC_HEAD(unlink_success, tc) ATF_TC_BODY(unlink_success, tc) { - ATF_REQUIRE(open(path, O_CREAT, mode) != -1); + ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); FILE *pipefd = setup(fds, "fd"); ATF_REQUIRE_EQ(0, unlink(path)); check_audit(fds, successreg, pipefd); + close(filedesc); } ATF_TC_CLEANUP(unlink_success, tc) Modified: head/tests/sys/audit/file-write.c ============================================================================== --- head/tests/sys/audit/file-write.c Wed Jun 13 16:48:07 2018 (r335066) +++ head/tests/sys/audit/file-write.c Wed Jun 13 17:01:57 2018 (r335067) @@ -32,6 +32,7 @@ static struct pollfd fds[1]; static mode_t mode = 0777; +static int filedesc; static off_t offlen = 0; static const char *path = "fileforaudit"; static const char *errpath = "dirdoesnotexist/fileforaudit"; @@ -49,10 +50,11 @@ ATF_TC_HEAD(truncate_success, tc) ATF_TC_BODY(truncate_success, tc) { /* File needs to exist to call truncate(2) */ - ATF_REQUIRE(open(path, O_CREAT, mode) != -1); + ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); FILE *pipefd = setup(fds, "fw"); ATF_REQUIRE_EQ(0, truncate(path, offlen)); check_audit(fds, successreg, pipefd); + close(filedesc); } ATF_TC_CLEANUP(truncate_success, tc) @@ -91,13 +93,13 @@ ATF_TC_HEAD(ftruncate_success, tc) ATF_TC_BODY(ftruncate_success, tc) { - int filedesc; const char *regex = "ftruncate.*return,success"; /* Valid file descriptor needs to exist to call ftruncate(2) */ ATF_REQUIRE((filedesc = open(path, O_CREAT | O_RDWR)) != -1); FILE *pipefd = setup(fds, "fw"); ATF_REQUIRE_EQ(0, ftruncate(filedesc, offlen)); check_audit(fds, regex, pipefd); + close(filedesc); } ATF_TC_CLEANUP(ftruncate_success, tc) Modified: head/tests/sys/audit/open.c ============================================================================== --- head/tests/sys/audit/open.c Wed Jun 13 16:48:07 2018 (r335066) +++ head/tests/sys/audit/open.c Wed Jun 13 17:01:57 2018 (r335067) @@ -52,6 +52,7 @@ static struct pollfd fds[1]; static mode_t o_mode = 0777; +static int filedesc; static char extregex[80]; static const char *path = "fileforaudit"; static const char *errpath = "adirhasnoname/fileforaudit"; @@ -71,10 +72,11 @@ ATF_TC_BODY(open_ ## mode ## _success, tc) \ snprintf(extregex, sizeof(extregex), \ "open.*%s.*fileforaudit.*return,success", regex); \ /* File needs to exist for successful open(2) invocation */ \ - ATF_REQUIRE(open(path, O_CREAT, o_mode) != -1); \ + ATF_REQUIRE((filedesc = open(path, O_CREAT, o_mode)) != -1); \ FILE *pipefd = setup(fds, class); \ ATF_REQUIRE(syscall(SYS_open, path, flag) != -1); \ check_audit(fds, extregex, pipefd); \ + close(filedesc); \ } \ ATF_TC_CLEANUP(open_ ## mode ## _success, tc) \ { \ @@ -106,13 +108,16 @@ ATF_TC_HEAD(openat_ ## mode ## _success, tc) \ } \ ATF_TC_BODY(openat_ ## mode ## _success, tc) \ { \ + int filedesc2; \ snprintf(extregex, sizeof(extregex), \ "openat.*%s.*fileforaudit.*return,success", regex); \ /* File needs to exist for successful openat(2) invocation */ \ - ATF_REQUIRE(open(path, O_CREAT, o_mode) != -1); \ + ATF_REQUIRE((filedesc = open(path, O_CREAT, o_mode)) != -1); \ FILE *pipefd = setup(fds, class); \ - ATF_REQUIRE(openat(AT_FDCWD, path, flag) != -1); \ + ATF_REQUIRE((filedesc2 = openat(AT_FDCWD, path, flag)) != -1); \ check_audit(fds, extregex, pipefd); \ + close(filedesc2); \ + close(filedesc); \ } \ ATF_TC_CLEANUP(openat_ ## mode ## _success, tc) \ { \ Modified: head/tests/sys/audit/utils.c ============================================================================== --- head/tests/sys/audit/utils.c Wed Jun 13 16:48:07 2018 (r335066) +++ head/tests/sys/audit/utils.c Wed Jun 13 17:01:57 2018 (r335067) @@ -27,15 +27,16 @@ #include -#include +#include +#include + +#include #include #include -#include -#include #include +#include +#include #include -#include -#include #include "utils.h" @@ -79,7 +80,7 @@ get_records(const char *auditregex, FILE *pipestream) } free(buff); - fclose(memstream); + ATF_REQUIRE_EQ(0, fclose(memstream)); return (atf_utils_grep_string("%s", membuff, auditregex)); } @@ -194,9 +195,8 @@ void check_audit(struct pollfd fd[], const char *auditrgx, FILE *pipestream) { check_auditpipe(fd, auditrgx, pipestream); - /* Cleanup */ - fclose(pipestream); - close(fd[0].fd); + /* Teardown: /dev/auditpipe's instance opened for this test-suite */ + ATF_REQUIRE_EQ(0, fclose(pipestream)); } FILE @@ -207,9 +207,9 @@ FILE nomask = get_audit_mask("no"); FILE *pipestream; - fd[0].fd = open("/dev/auditpipe", O_RDONLY); + ATF_REQUIRE((fd[0].fd = open("/dev/auditpipe", O_RDONLY)) != -1); + ATF_REQUIRE((pipestream = fdopen(fd[0].fd, "r")) != NULL); fd[0].events = POLLIN; - pipestream = fdopen(fd[0].fd, "r"); /* Set local preselection audit_class as "no" for audit startup */ set_preselect_mode(fd[0].fd, &nomask); From owner-svn-src-head@freebsd.org Wed Jun 13 17:04:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA2D3101E19B; Wed, 13 Jun 2018 17:04:45 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 83F456E265; Wed, 13 Jun 2018 17:04:45 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6664A1C538; Wed, 13 Jun 2018 17:04:45 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DH4jgt048153; Wed, 13 Jun 2018 17:04:45 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DH4gLv048134; Wed, 13 Jun 2018 17:04:42 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201806131704.w5DH4gLv048134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Wed, 13 Jun 2018 17:04:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335068 - in head: share/man/man9 sys/amd64/amd64 sys/i386/i386 sys/kern sys/net sys/sys sys/vm X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: in head: share/man/man9 sys/amd64/amd64 sys/i386/i386 sys/kern sys/net sys/sys sys/vm X-SVN-Commit-Revision: 335068 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 17:04:46 -0000 Author: jtl Date: Wed Jun 13 17:04:41 2018 New Revision: 335068 URL: https://svnweb.freebsd.org/changeset/base/335068 Log: Make UMA and malloc(9) return non-executable memory in most cases. Most kernel memory that is allocated after boot does not need to be executable. There are a few exceptions. For example, kernel modules do need executable memory, but they don't use UMA or malloc(9). The BPF JIT compiler also needs executable memory and did use malloc(9) until r317072. (Note that a side effect of r316767 was that the "small allocation" path in UMA on amd64 already returned non-executable memory. This meant that some calls to malloc(9) or the UMA zone(9) allocator could return executable memory, while others could return non-executable memory. This change makes the behavior consistent.) This change makes malloc(9) return non-executable memory unless the new M_EXEC flag is specified. After this change, the UMA zone(9) allocator will always return non-executable memory, and a KASSERT will catch attempts to use the M_EXEC flag to allocate executable memory using uma_zalloc() or its variants. Allocations that do need executable memory have various choices. They may use the M_EXEC flag to malloc(9), or they may use a different VM interfact to obtain executable pages. Now that malloc(9) again allows executable allocations, this change also reverts most of r317072. PR: 228927 Reviewed by: alc, kib, markj, jhb (previous version) Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D15691 Modified: head/share/man/man9/malloc.9 head/share/man/man9/zone.9 head/sys/amd64/amd64/bpf_jit_machdep.c head/sys/i386/i386/bpf_jit_machdep.c head/sys/kern/kern_malloc.c head/sys/kern/subr_vmem.c head/sys/net/bpf_jitter.c head/sys/net/bpf_jitter.h head/sys/sys/malloc.h head/sys/vm/uma.h head/sys/vm/uma_core.c head/sys/vm/vm_extern.h head/sys/vm/vm_init.c head/sys/vm/vm_kern.c head/sys/vm/vm_kern.h head/sys/vm/vm_pagequeue.h Modified: head/share/man/man9/malloc.9 ============================================================================== --- head/share/man/man9/malloc.9 Wed Jun 13 17:01:57 2018 (r335067) +++ head/share/man/man9/malloc.9 Wed Jun 13 17:04:41 2018 (r335068) @@ -29,7 +29,7 @@ .\" $NetBSD: malloc.9,v 1.3 1996/11/11 00:05:11 lukem Exp $ .\" $FreeBSD$ .\" -.Dd January 24, 2018 +.Dd June 13, 2018 .Dt MALLOC 9 .Os .Sh NAME @@ -189,6 +189,11 @@ This option should only be used in combination with .Dv M_NOWAIT when an allocation failure cannot be tolerated by the caller without catastrophic effects on the system. +.It Dv M_EXEC +Indicates that the system should allocate executable memory. +If this flag is not set, the system will not allocate executable memory. +Not all platforms enforce a distinction between executable and +non-executable memory. .El .Pp Exactly one of either Modified: head/share/man/man9/zone.9 ============================================================================== --- head/share/man/man9/zone.9 Wed Jun 13 17:01:57 2018 (r335067) +++ head/share/man/man9/zone.9 Wed Jun 13 17:04:41 2018 (r335068) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 26, 2017 +.Dd June 13, 2018 .Dt ZONE 9 .Os .Sh NAME @@ -375,6 +375,15 @@ if the zone ran out of unused items and .Dv M_NOWAIT was specified. +.Sh IMPLEMENTATION NOTES +The memory that these allocation calls return is not executable. +The +.Fn uma_zalloc +function does not support the +.Dv M_EXEC +flag to allocate executable memory. +Not all platforms enforce a distinction between executable and +non-executable memory. .Sh SEE ALSO .Xr malloc 9 .Sh HISTORY Modified: head/sys/amd64/amd64/bpf_jit_machdep.c ============================================================================== --- head/sys/amd64/amd64/bpf_jit_machdep.c Wed Jun 13 17:01:57 2018 (r335067) +++ head/sys/amd64/amd64/bpf_jit_machdep.c Wed Jun 13 17:04:41 2018 (r335068) @@ -44,9 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include #else #include #include @@ -605,11 +602,7 @@ bpf_jit_compile(struct bpf_insn *prog, u_int nins, siz *size = stream.cur_ip; #ifdef _KERNEL - /* - * We cannot use malloc(9) because DMAP is mapped as NX. - */ - stream.ibuf = (void *)kmem_malloc(kernel_arena, *size, - M_NOWAIT); + stream.ibuf = malloc(*size, M_BPFJIT, M_EXEC | M_NOWAIT); if (stream.ibuf == NULL) break; #else @@ -657,15 +650,4 @@ bpf_jit_compile(struct bpf_insn *prog, u_int nins, siz #endif return ((bpf_filter_func)(void *)stream.ibuf); -} - -void -bpf_jit_free(void *func, size_t size) -{ - -#ifdef _KERNEL - kmem_free(kernel_arena, (vm_offset_t)func, size); -#else - munmap(func, size); -#endif } Modified: head/sys/i386/i386/bpf_jit_machdep.c ============================================================================== --- head/sys/i386/i386/bpf_jit_machdep.c Wed Jun 13 17:01:57 2018 (r335067) +++ head/sys/i386/i386/bpf_jit_machdep.c Wed Jun 13 17:04:41 2018 (r335068) @@ -632,7 +632,7 @@ bpf_jit_compile(struct bpf_insn *prog, u_int nins, siz *size = stream.cur_ip; #ifdef _KERNEL - stream.ibuf = malloc(*size, M_BPFJIT, M_NOWAIT); + stream.ibuf = malloc(*size, M_BPFJIT, M_EXEC | M_NOWAIT); if (stream.ibuf == NULL) break; #else @@ -680,15 +680,4 @@ bpf_jit_compile(struct bpf_insn *prog, u_int nins, siz #endif return ((bpf_filter_func)(void *)stream.ibuf); -} - -void -bpf_jit_free(void *func, size_t size) -{ - -#ifdef _KERNEL - free(func, M_BPFJIT); -#else - munmap(func, size); -#endif } Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Wed Jun 13 17:01:57 2018 (r335067) +++ head/sys/kern/kern_malloc.c Wed Jun 13 17:04:41 2018 (r335068) @@ -564,7 +564,7 @@ void * return (va); #endif - if (size <= kmem_zmax) { + if (size <= kmem_zmax && (flags & M_EXEC) == 0) { if (size & KMEM_ZMASK) size = (size & ~KMEM_ZMASK) + KMEM_ZBASE; indx = kmemsize[size >> KMEM_ZSHIFT]; @@ -609,7 +609,7 @@ malloc_domain(size_t size, struct malloc_type *mtp, in if (malloc_dbg(&va, &size, mtp, flags) != 0) return (va); #endif - if (size <= kmem_zmax) { + if (size <= kmem_zmax && (flags & M_EXEC) == 0) { if (size & KMEM_ZMASK) size = (size & ~KMEM_ZMASK) + KMEM_ZBASE; indx = kmemsize[size >> KMEM_ZSHIFT]; Modified: head/sys/kern/subr_vmem.c ============================================================================== --- head/sys/kern/subr_vmem.c Wed Jun 13 17:01:57 2018 (r335067) +++ head/sys/kern/subr_vmem.c Wed Jun 13 17:04:41 2018 (r335068) @@ -241,6 +241,9 @@ static struct vmem buffer_arena_storage; static struct vmem transient_arena_storage; /* kernel and kmem arenas are aliased for backwards KPI compat. */ vmem_t *kernel_arena = &kernel_arena_storage; +#if VM_NRESERVLEVEL > 0 +vmem_t *kernel_rwx_arena = NULL; +#endif vmem_t *kmem_arena = &kernel_arena_storage; vmem_t *buffer_arena = &buffer_arena_storage; vmem_t *transient_arena = &transient_arena_storage; Modified: head/sys/net/bpf_jitter.c ============================================================================== --- head/sys/net/bpf_jitter.c Wed Jun 13 17:01:57 2018 (r335067) +++ head/sys/net/bpf_jitter.c Wed Jun 13 17:04:41 2018 (r335068) @@ -101,11 +101,13 @@ void bpf_destroy_jit_filter(bpf_jit_filter *filter) { - if (filter->func != bpf_jit_accept_all) - bpf_jit_free(filter->func, filter->size); #ifdef _KERNEL + if (filter->func != bpf_jit_accept_all) + free(filter->func, M_BPFJIT); free(filter, M_BPFJIT); #else + if (filter->func != bpf_jit_accept_all) + munmap(filter->func, filter->size); free(filter); #endif } Modified: head/sys/net/bpf_jitter.h ============================================================================== --- head/sys/net/bpf_jitter.h Wed Jun 13 17:01:57 2018 (r335067) +++ head/sys/net/bpf_jitter.h Wed Jun 13 17:04:41 2018 (r335068) @@ -88,6 +88,5 @@ void bpf_destroy_jit_filter(bpf_jit_filter *filter); struct bpf_insn; bpf_filter_func bpf_jit_compile(struct bpf_insn *, u_int, size_t *); -void bpf_jit_free(void *, size_t); #endif /* _NET_BPF_JITTER_H_ */ Modified: head/sys/sys/malloc.h ============================================================================== --- head/sys/sys/malloc.h Wed Jun 13 17:01:57 2018 (r335067) +++ head/sys/sys/malloc.h Wed Jun 13 17:04:41 2018 (r335068) @@ -49,7 +49,7 @@ #define MINALLOCSIZE UMA_SMALLEST_UNIT /* - * flags to malloc. + * Flags to memory allocation functions. */ #define M_NOWAIT 0x0001 /* do not block */ #define M_WAITOK 0x0002 /* ok to block */ @@ -59,6 +59,7 @@ #define M_NODUMP 0x0800 /* don't dump pages in this allocation */ #define M_FIRSTFIT 0x1000 /* Only for vmem, fast fit. */ #define M_BESTFIT 0x2000 /* Only for vmem, low fragmentation. */ +#define M_EXEC 0x4000 /* allocate executable space. */ #define M_MAGIC 877983977 /* time when first defined :-) */ Modified: head/sys/vm/uma.h ============================================================================== --- head/sys/vm/uma.h Wed Jun 13 17:01:57 2018 (r335067) +++ head/sys/vm/uma.h Wed Jun 13 17:04:41 2018 (r335068) @@ -617,11 +617,12 @@ void uma_zone_set_freef(uma_zone_t zone, uma_free free * These flags are setable in the allocf and visible in the freef. */ #define UMA_SLAB_BOOT 0x01 /* Slab alloced from boot pages */ +#define UMA_SLAB_KRWX 0x02 /* Slab alloced from kernel_rwx_arena */ #define UMA_SLAB_KERNEL 0x04 /* Slab alloced from kernel_map */ #define UMA_SLAB_PRIV 0x08 /* Slab alloced from priv allocator */ #define UMA_SLAB_OFFP 0x10 /* Slab is managed separately */ #define UMA_SLAB_MALLOC 0x20 /* Slab is a large malloc slab */ -/* 0x02, 0x40 and 0x80 are available */ +/* 0x40 and 0x80 are available */ /* * Used to pre-fill a zone with some number of items Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Wed Jun 13 17:01:57 2018 (r335067) +++ head/sys/vm/uma_core.c Wed Jun 13 17:04:41 2018 (r335068) @@ -1167,7 +1167,7 @@ page_alloc(uma_zone_t zone, vm_size_t bytes, int domai void *p; /* Returned page */ *pflag = UMA_SLAB_KERNEL; - p = (void *) kmem_malloc_domain(domain, bytes, wait); + p = (void *) kmem_malloc_domain(kernel_arena, domain, bytes, wait); return (p); } @@ -2280,6 +2280,7 @@ uma_zalloc_arg(uma_zone_t zone, void *udata, int flags WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "uma_zalloc_arg: zone \"%s\"", zone->uz_name); } + KASSERT((flags & M_EXEC) == 0, ("uma_zalloc_arg: called with M_EXEC")); KASSERT(curthread->td_critnest == 0 || SCHEDULER_STOPPED(), ("uma_zalloc_arg: called with spinlock or critical section held")); if (zone->uz_flags & UMA_ZONE_PCPU) @@ -3587,20 +3588,34 @@ uma_zone_exhausted_nolock(uma_zone_t zone) void * uma_large_malloc_domain(vm_size_t size, int domain, int wait) { + struct vmem *arena; vm_offset_t addr; uma_slab_t slab; +#if VM_NRESERVLEVEL > 0 + if (__predict_true((wait & M_EXEC) == 0)) + arena = kernel_arena; + else + arena = kernel_rwx_arena; +#else + arena = kernel_arena; +#endif + slab = zone_alloc_item(slabzone, NULL, domain, wait); if (slab == NULL) return (NULL); if (domain == UMA_ANYDOMAIN) - addr = kmem_malloc(kernel_arena, size, wait); + addr = kmem_malloc(arena, size, wait); else - addr = kmem_malloc_domain(domain, size, wait); + addr = kmem_malloc_domain(arena, domain, size, wait); if (addr != 0) { vsetslab(addr, slab); slab->us_data = (void *)addr; slab->us_flags = UMA_SLAB_KERNEL | UMA_SLAB_MALLOC; +#if VM_NRESERVLEVEL > 0 + if (__predict_false(arena == kernel_rwx_arena)) + slab->us_flags |= UMA_SLAB_KRWX; +#endif slab->us_size = size; slab->us_domain = vm_phys_domain(PHYS_TO_VM_PAGE( pmap_kextract(addr))); @@ -3622,10 +3637,19 @@ uma_large_malloc(vm_size_t size, int wait) void uma_large_free(uma_slab_t slab) { + struct vmem *arena; KASSERT((slab->us_flags & UMA_SLAB_KERNEL) != 0, ("uma_large_free: Memory not allocated with uma_large_malloc.")); - kmem_free(kernel_arena, (vm_offset_t)slab->us_data, slab->us_size); +#if VM_NRESERVLEVEL > 0 + if (__predict_true((slab->us_flags & UMA_SLAB_KRWX) == 0)) + arena = kernel_arena; + else + arena = kernel_rwx_arena; +#else + arena = kernel_arena; +#endif + kmem_free(arena, (vm_offset_t)slab->us_data, slab->us_size); uma_total_dec(slab->us_size); zone_free_item(slabzone, slab, NULL, SKIP_NONE); } Modified: head/sys/vm/vm_extern.h ============================================================================== --- head/sys/vm/vm_extern.h Wed Jun 13 17:01:57 2018 (r335067) +++ head/sys/vm/vm_extern.h Wed Jun 13 17:04:41 2018 (r335068) @@ -65,7 +65,8 @@ vm_offset_t kmem_alloc_contig_domain(int domain, vm_si vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary, vm_memattr_t memattr); vm_offset_t kmem_malloc(struct vmem *, vm_size_t size, int flags); -vm_offset_t kmem_malloc_domain(int domain, vm_size_t size, int flags); +vm_offset_t kmem_malloc_domain(struct vmem *, int domain, vm_size_t size, + int flags); void kmem_free(struct vmem *, vm_offset_t, vm_size_t); /* This provides memory for previously allocated address space. */ Modified: head/sys/vm/vm_init.c ============================================================================== --- head/sys/vm/vm_init.c Wed Jun 13 17:01:57 2018 (r335067) +++ head/sys/vm/vm_init.c Wed Jun 13 17:04:41 2018 (r335068) @@ -135,7 +135,24 @@ kva_import(void *unused, vmem_size_t size, int flags, return (0); } +#if VM_NRESERVLEVEL > 0 /* + * Import a superpage from the normal kernel arena into the special + * arena for allocations with different permissions. + */ +static int +kernel_rwx_alloc(void *arena, vmem_size_t size, int flags, vmem_addr_t *addrp) +{ + + KASSERT((size % KVA_QUANTUM) == 0, + ("kernel_rwx_alloc: Size %jd is not a multiple of %d", + (intmax_t)size, (int)KVA_QUANTUM)); + return (vmem_xalloc(arena, size, KVA_QUANTUM, 0, 0, VMEM_ADDR_MIN, + VMEM_ADDR_MAX, flags, addrp)); +} +#endif + +/* * vm_init initializes the virtual memory system. * This is done only by the first cpu up. * @@ -173,12 +190,31 @@ vm_mem_init(dummy) vmem_init(kernel_arena, "kernel arena", 0, 0, PAGE_SIZE, 0, 0); vmem_set_import(kernel_arena, kva_import, NULL, NULL, KVA_QUANTUM); +#if VM_NRESERVLEVEL > 0 + /* + * In an architecture with superpages, maintain a separate arena + * for allocations with permissions that differ from the "standard" + * read/write permissions used for memory in the kernel_arena. + */ + kernel_rwx_arena = vmem_create("kernel rwx arena", 0, 0, PAGE_SIZE, + 0, M_WAITOK); + vmem_set_import(kernel_rwx_arena, kernel_rwx_alloc, + (vmem_release_t *)vmem_xfree, kernel_arena, KVA_QUANTUM); +#endif + for (domain = 0; domain < vm_ndomains; domain++) { vm_dom[domain].vmd_kernel_arena = vmem_create( "kernel arena domain", 0, 0, PAGE_SIZE, 0, M_WAITOK); vmem_set_import(vm_dom[domain].vmd_kernel_arena, (vmem_import_t *)vmem_alloc, NULL, kernel_arena, KVA_QUANTUM); +#if VM_NRESERVLEVEL > 0 + vm_dom[domain].vmd_kernel_rwx_arena = vmem_create( + "kernel rwx arena domain", 0, 0, PAGE_SIZE, 0, M_WAITOK); + vmem_set_import(vm_dom[domain].vmd_kernel_rwx_arena, + kernel_rwx_alloc, (vmem_release_t *)vmem_xfree, + vm_dom[domain].vmd_kernel_arena, KVA_QUANTUM); +#endif } #ifndef UMA_MD_SMALL_ALLOC Modified: head/sys/vm/vm_kern.c ============================================================================== --- head/sys/vm/vm_kern.c Wed Jun 13 17:01:57 2018 (r335067) +++ head/sys/vm/vm_kern.c Wed Jun 13 17:04:41 2018 (r335068) @@ -212,8 +212,8 @@ retry: if ((flags & M_ZERO) && (m->flags & PG_ZERO) == 0) pmap_zero_page(m); m->valid = VM_PAGE_BITS_ALL; - pmap_enter(kernel_pmap, addr + i, m, VM_PROT_ALL, - VM_PROT_ALL | PMAP_ENTER_WIRED, 0); + pmap_enter(kernel_pmap, addr + i, m, VM_PROT_RW, + VM_PROT_RW | PMAP_ENTER_WIRED, 0); } VM_OBJECT_WUNLOCK(object); return (addr); @@ -298,8 +298,8 @@ retry: if ((flags & M_ZERO) && (m->flags & PG_ZERO) == 0) pmap_zero_page(m); m->valid = VM_PAGE_BITS_ALL; - pmap_enter(kernel_pmap, tmp, m, VM_PROT_ALL, - VM_PROT_ALL | PMAP_ENTER_WIRED, 0); + pmap_enter(kernel_pmap, tmp, m, VM_PROT_RW, + VM_PROT_RW | PMAP_ENTER_WIRED, 0); tmp += PAGE_SIZE; } VM_OBJECT_WUNLOCK(object); @@ -372,20 +372,32 @@ kmem_suballoc(vm_map_t parent, vm_offset_t *min, vm_of * Allocate wired-down pages in the kernel's address space. */ vm_offset_t -kmem_malloc_domain(int domain, vm_size_t size, int flags) +kmem_malloc_domain(struct vmem *vmem, int domain, vm_size_t size, int flags) { - vmem_t *vmem; + vmem_t *arena; vm_offset_t addr; int rv; - vmem = vm_dom[domain].vmd_kernel_arena; +#if VM_NRESERVLEVEL > 0 + KASSERT(vmem == kernel_arena || vmem == kernel_rwx_arena, + ("kmem_malloc_domain: Only kernel_arena or kernel_rwx_arena " + "are supported.")); + if (__predict_true(vmem == kernel_arena)) + arena = vm_dom[domain].vmd_kernel_arena; + else + arena = vm_dom[domain].vmd_kernel_rwx_arena; +#else + KASSERT(vmem == kernel_arena, + ("kmem_malloc_domain: Only kernel_arena is supported.")); + arena = vm_dom[domain].vmd_kernel_arena; +#endif size = round_page(size); - if (vmem_alloc(vmem, size, flags | M_BESTFIT, &addr)) + if (vmem_alloc(arena, size, flags | M_BESTFIT, &addr)) return (0); rv = kmem_back_domain(domain, kernel_object, addr, size, flags); if (rv != KERN_SUCCESS) { - vmem_free(vmem, addr, size); + vmem_free(arena, addr, size); return (0); } return (addr); @@ -398,12 +410,9 @@ kmem_malloc(struct vmem *vmem, vm_size_t size, int fla vm_offset_t addr; int domain; - KASSERT(vmem == kernel_arena, - ("kmem_malloc: Only kernel_arena is supported.")); - vm_domainset_iter_malloc_init(&di, kernel_object, &domain, &flags); do { - addr = kmem_malloc_domain(domain, size, flags); + addr = kmem_malloc_domain(vmem, domain, size, flags); if (addr != 0) break; } while (vm_domainset_iter_malloc(&di, &domain, &flags) == 0); @@ -422,6 +431,7 @@ kmem_back_domain(int domain, vm_object_t object, vm_of { vm_offset_t offset, i; vm_page_t m, mpred; + vm_prot_t prot; int pflags; KASSERT(object == kernel_object, @@ -432,6 +442,7 @@ kmem_back_domain(int domain, vm_object_t object, vm_of pflags &= ~(VM_ALLOC_NOWAIT | VM_ALLOC_WAITOK | VM_ALLOC_WAITFAIL); if (flags & M_WAITOK) pflags |= VM_ALLOC_WAITFAIL; + prot = (flags & M_EXEC) != 0 ? VM_PROT_ALL : VM_PROT_RW; i = 0; VM_OBJECT_WLOCK(object); @@ -461,8 +472,8 @@ retry: KASSERT((m->oflags & VPO_UNMANAGED) != 0, ("kmem_malloc: page %p is managed", m)); m->valid = VM_PAGE_BITS_ALL; - pmap_enter(kernel_pmap, addr + i, m, VM_PROT_ALL, - VM_PROT_ALL | PMAP_ENTER_WIRED, 0); + pmap_enter(kernel_pmap, addr + i, m, prot, + prot | PMAP_ENTER_WIRED, 0); } VM_OBJECT_WUNLOCK(object); @@ -542,13 +553,28 @@ kmem_unback(vm_object_t object, vm_offset_t addr, vm_s void kmem_free(struct vmem *vmem, vm_offset_t addr, vm_size_t size) { + struct vmem *arena; int domain; +#if VM_NRESERVLEVEL > 0 + KASSERT(vmem == kernel_arena || vmem == kernel_rwx_arena, + ("kmem_free: Only kernel_arena or kernel_rwx_arena are supported.")); +#else KASSERT(vmem == kernel_arena, ("kmem_free: Only kernel_arena is supported.")); +#endif + size = round_page(size); domain = _kmem_unback(kernel_object, addr, size); - vmem_free(vm_dom[domain].vmd_kernel_arena, addr, size); +#if VM_NRESERVLEVEL > 0 + if (__predict_true(vmem == kernel_arena)) + arena = vm_dom[domain].vmd_kernel_arena; + else + arena = vm_dom[domain].vmd_kernel_rwx_arena; +#else + arena = vm_dom[domain].vmd_kernel_arena; +#endif + vmem_free(arena, addr, size); } /* Modified: head/sys/vm/vm_kern.h ============================================================================== --- head/sys/vm/vm_kern.h Wed Jun 13 17:01:57 2018 (r335067) +++ head/sys/vm/vm_kern.h Wed Jun 13 17:04:41 2018 (r335068) @@ -70,6 +70,7 @@ extern vm_map_t kernel_map; extern vm_map_t exec_map; extern vm_map_t pipe_map; extern struct vmem *kernel_arena; +extern struct vmem *kernel_rwx_arena; extern struct vmem *kmem_arena; extern struct vmem *buffer_arena; extern struct vmem *transient_arena; Modified: head/sys/vm/vm_pagequeue.h ============================================================================== --- head/sys/vm/vm_pagequeue.h Wed Jun 13 17:01:57 2018 (r335067) +++ head/sys/vm/vm_pagequeue.h Wed Jun 13 17:04:41 2018 (r335068) @@ -103,7 +103,8 @@ struct vm_domain { struct mtx_padalign vmd_free_mtx; struct mtx_padalign vmd_pageout_mtx; uma_zone_t vmd_pgcache; /* (c) page free cache. */ - struct vmem *vmd_kernel_arena; /* (c) per-domain kva arena. */ + struct vmem *vmd_kernel_arena; /* (c) per-domain kva R/W arena. */ + struct vmem *vmd_kernel_rwx_arena; /* (c) per-domain kva R/W/X arena. */ u_int vmd_domain; /* (c) Domain number. */ u_int vmd_page_count; /* (c) Total page count. */ long vmd_segs; /* (c) bitmask of the segments */ From owner-svn-src-head@freebsd.org Wed Jun 13 17:28:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A70AC1020379; Wed, 13 Jun 2018 17:28:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5CCFC6F2C0; Wed, 13 Jun 2018 17:28:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F3991C897; Wed, 13 Jun 2018 17:28:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DHS7C2058142; Wed, 13 Jun 2018 17:28:07 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DHS7Mo058141; Wed, 13 Jun 2018 17:28:07 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806131728.w5DHS7Mo058141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 13 Jun 2018 17:28:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335069 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 335069 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 17:28:07 -0000 Author: imp Date: Wed Jun 13 17:28:06 2018 New Revision: 335069 URL: https://svnweb.freebsd.org/changeset/base/335069 Log: Remove fail: label. It's unused. Sponsored by: Netflix Modified: head/stand/libsa/open.c Modified: head/stand/libsa/open.c ============================================================================== --- head/stand/libsa/open.c Wed Jun 13 17:04:41 2018 (r335068) +++ head/stand/libsa/open.c Wed Jun 13 17:28:06 2018 (r335069) @@ -141,7 +141,6 @@ open(const char *fname, int mode) } error = besterror; - fail: if ((f->f_flags & F_NODEV) == 0 && f->f_dev != NULL) f->f_dev->dv_close(f); if (error) From owner-svn-src-head@freebsd.org Wed Jun 13 17:42:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3EFD61021860; Wed, 13 Jun 2018 17:42:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C5EDD6FFE1; Wed, 13 Jun 2018 17:42:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A7C5F1CBCE; Wed, 13 Jun 2018 17:42:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DHgoUW068075; Wed, 13 Jun 2018 17:42:50 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DHgo2k068073; Wed, 13 Jun 2018 17:42:50 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806131742.w5DHgo2k068073@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 13 Jun 2018 17:42:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335070 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 335070 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 17:42:51 -0000 Author: imp Date: Wed Jun 13 17:42:50 2018 New Revision: 335070 URL: https://svnweb.freebsd.org/changeset/base/335070 Log: Remove unused variables. Sponsored by: Netflix Modified: head/stand/libsa/tftp.c head/stand/libsa/ufs.c Modified: head/stand/libsa/tftp.c ============================================================================== --- head/stand/libsa/tftp.c Wed Jun 13 17:28:06 2018 (r335069) +++ head/stand/libsa/tftp.c Wed Jun 13 17:42:50 2018 (r335070) @@ -186,7 +186,6 @@ recvtftp(struct iodesc *d, void **pkt, void **payload, struct tftprecv_extra *extra; struct tftp_handle *h; struct tftphdr *t; - unsigned short *rtype; void *ptr = NULL; ssize_t len; Modified: head/stand/libsa/ufs.c ============================================================================== --- head/stand/libsa/ufs.c Wed Jun 13 17:28:06 2018 (r335069) +++ head/stand/libsa/ufs.c Wed Jun 13 17:42:50 2018 (r335070) @@ -506,8 +506,7 @@ ufs_open(upath, f) ino_t inumber, parent_inumber; struct file *fp; struct fs *fs; - int i, rc; - size_t buf_size; + int rc; int nlinks = 0; char namebuf[MAXPATHLEN+1]; char *buf = NULL; From owner-svn-src-head@freebsd.org Wed Jun 13 17:42:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB0EE10218D7; Wed, 13 Jun 2018 17:42:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C861700B0; Wed, 13 Jun 2018 17:42:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A1321CBCF; Wed, 13 Jun 2018 17:42:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DHgtsq068128; Wed, 13 Jun 2018 17:42:55 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DHgtLD068127; Wed, 13 Jun 2018 17:42:55 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806131742.w5DHgtLD068127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 13 Jun 2018 17:42:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335071 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 335071 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 17:42:56 -0000 Author: imp Date: Wed Jun 13 17:42:55 2018 New Revision: 335071 URL: https://svnweb.freebsd.org/changeset/base/335071 Log: Initialize variables we later free so they aren't used uninitialized in the error path. Remove unused variables. Sponsored by: Netflix Modified: head/stand/libsa/nfs.c Modified: head/stand/libsa/nfs.c ============================================================================== --- head/stand/libsa/nfs.c Wed Jun 13 17:42:50 2018 (r335070) +++ head/stand/libsa/nfs.c Wed Jun 13 17:42:55 2018 (r335071) @@ -249,7 +249,7 @@ int nfs_lookupfh(struct nfs_iodesc *d, const char *name, struct nfs_iodesc *newfd) { void *pkt = NULL; - int len, rlen, pos; + int len, pos; struct args { uint32_t fhsize; uint32_t fhplusname[1 + @@ -465,14 +465,13 @@ int nfs_open(const char *upath, struct open_file *f) { struct iodesc *desc; - struct nfs_iodesc *currfd; + struct nfs_iodesc *currfd = NULL; char buf[2 * NFS_V3MAXFHSIZE + 3]; u_char *fh; char *cp; int i; #ifndef NFS_NOSYMLINK - struct nfs_iodesc *newfd; - struct nfsv3_fattrs *fa; + struct nfs_iodesc *newfd = NULL; char *ncp; int c; char namebuf[NFS_MAXPATHLEN + 1]; @@ -480,7 +479,7 @@ nfs_open(const char *upath, struct open_file *f) int nlinks = 0; #endif int error; - char *path; + char *path = NULL; if (netproto != NET_NFS) return (EINVAL); From owner-svn-src-head@freebsd.org Wed Jun 13 17:55:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBE1C1000B64; Wed, 13 Jun 2018 17:55:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D51870B41; Wed, 13 Jun 2018 17:55:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6E9C71CD66; Wed, 13 Jun 2018 17:55:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DHtAPZ073316; Wed, 13 Jun 2018 17:55:10 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DHtAwo073314; Wed, 13 Jun 2018 17:55:10 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201806131755.w5DHtAwo073314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 13 Jun 2018 17:55:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335072 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 335072 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 17:55:11 -0000 Author: kib Date: Wed Jun 13 17:55:09 2018 New Revision: 335072 URL: https://svnweb.freebsd.org/changeset/base/335072 Log: Enable eager FPU context switch by default on amd64. With compilers making increasing use of vector instructions the performance benefit of lazily switching FPU state is no longer a desirable tradeoff. Linux switched to eager FPU context switch some time ago, and the idea was floated on the FreeBSD-current mailing list some years ago[1]. Enable eager FPU context switch by default on amd64, with a tunable/sysctl available to turn it back off. [1] https://lists.freebsd.org/pipermail/freebsd-current/2015-March/055198.html Reviewed by: jhb Tested by: pho Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/amd64/cpu_switch.S head/sys/amd64/amd64/fpu.c Modified: head/sys/amd64/amd64/cpu_switch.S ============================================================================== --- head/sys/amd64/amd64/cpu_switch.S Wed Jun 13 17:42:55 2018 (r335071) +++ head/sys/amd64/amd64/cpu_switch.S Wed Jun 13 17:55:09 2018 (r335072) @@ -128,10 +128,10 @@ done_store_dr: /* have we used fp, and need a save? */ cmpq %rdi,PCPU(FPCURTHREAD) - jne 3f + jne 2f movq PCB_SAVEFPU(%r8),%r8 clts - cmpl $0,use_xsave + cmpl $0,use_xsave(%rip) jne 1f fxsave (%r8) jmp 2f @@ -143,12 +143,7 @@ ctx_switch_xsave: /* This is patched to xsaveopt if supported, see fpuinit_bsp1() */ xsave (%r8) movq %rcx,%rdx -2: smsw %ax - orb $CR0_TS,%al - lmsw %ax - xorl %eax,%eax - movq %rax,PCPU(FPCURTHREAD) -3: +2: /* Save is done. Now fire up new thread. Leave old vmspace. */ movq %rsi,%r12 movq %rdi,%r13 @@ -238,6 +233,8 @@ done_load_dr: movq PCB_RBX(%r8),%rbx movq PCB_RIP(%r8),%rax movq %rax,(%rsp) + movq PCPU(CURTHREAD),%rdi + call fpu_activate_sw ret /* Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Wed Jun 13 17:42:55 2018 (r335071) +++ head/sys/amd64/amd64/fpu.c Wed Jun 13 17:55:09 2018 (r335072) @@ -142,6 +142,11 @@ static void fpu_clean_state(void); SYSCTL_INT(_hw, HW_FLOATINGPT, floatingpoint, CTLFLAG_RD, SYSCTL_NULL_INT_PTR, 1, "Floating point instructions executed in hardware"); +int lazy_fpu_switch = 0; +SYSCTL_INT(_hw, OID_AUTO, lazy_fpu_switch, CTLFLAG_RWTUN | CTLFLAG_NOFETCH, + &lazy_fpu_switch, 0, + "Lazily load FPU context after context switch"); + int use_xsave; /* non-static for cpu_switch.S */ uint64_t xsave_mask; /* the same */ static uma_zone_t fpu_save_area_zone; @@ -242,6 +247,7 @@ fpuinit_bsp1(void) uint64_t xsave_mask_user; bool old_wp; + TUNABLE_INT_FETCH("hw.lazy_fpu_switch", &lazy_fpu_switch); if (!use_xsave) return; cpuid_count(0xd, 0x0, cp); @@ -651,6 +657,45 @@ fputrap_sse(void) return (fpetable[(mxcsr & (~mxcsr >> 7)) & 0x3f]); } +static void +restore_fpu_curthread(struct thread *td) +{ + struct pcb *pcb; + + /* + * Record new context early in case frstor causes a trap. + */ + PCPU_SET(fpcurthread, td); + + stop_emulating(); + fpu_clean_state(); + pcb = td->td_pcb; + + if ((pcb->pcb_flags & PCB_FPUINITDONE) == 0) { + /* + * This is the first time this thread has used the FPU or + * the PCB doesn't contain a clean FPU state. Explicitly + * load an initial state. + * + * We prefer to restore the state from the actual save + * area in PCB instead of directly loading from + * fpu_initialstate, to ignite the XSAVEOPT + * tracking engine. + */ + bcopy(fpu_initialstate, pcb->pcb_save, + cpu_max_ext_state_size); + fpurestore(pcb->pcb_save); + if (pcb->pcb_initial_fpucw != __INITIAL_FPUCW__) + fldcw(pcb->pcb_initial_fpucw); + if (PCB_USER_FPU(pcb)) + set_pcb_flags(pcb, PCB_FPUINITDONE | + PCB_USERFPUINITDONE); + else + set_pcb_flags(pcb, PCB_FPUINITDONE); + } else + fpurestore(pcb->pcb_save); +} + /* * Device Not Available (DNA, #NM) exception handler. * @@ -661,7 +706,9 @@ fputrap_sse(void) void fpudna(void) { + struct thread *td; + td = curthread; /* * This handler is entered with interrupts enabled, so context * switches may occur before critical_enter() is executed. If @@ -675,7 +722,7 @@ fpudna(void) KASSERT((curpcb->pcb_flags & PCB_FPUNOSAVE) == 0, ("fpudna while in fpu_kern_enter(FPU_KERN_NOCTX)")); - if (PCPU_GET(fpcurthread) == curthread) { + if (PCPU_GET(fpcurthread) == td) { printf("fpudna: fpcurthread == curthread\n"); stop_emulating(); critical_exit(); @@ -684,40 +731,24 @@ fpudna(void) if (PCPU_GET(fpcurthread) != NULL) { panic("fpudna: fpcurthread = %p (%d), curthread = %p (%d)\n", PCPU_GET(fpcurthread), PCPU_GET(fpcurthread)->td_tid, - curthread, curthread->td_tid); + td, td->td_tid); } - stop_emulating(); - /* - * Record new context early in case frstor causes a trap. - */ - PCPU_SET(fpcurthread, curthread); + restore_fpu_curthread(td); + critical_exit(); +} - fpu_clean_state(); +void fpu_activate_sw(struct thread *td); /* Called from the context switch */ +void +fpu_activate_sw(struct thread *td) +{ - if ((curpcb->pcb_flags & PCB_FPUINITDONE) == 0) { - /* - * This is the first time this thread has used the FPU or - * the PCB doesn't contain a clean FPU state. Explicitly - * load an initial state. - * - * We prefer to restore the state from the actual save - * area in PCB instead of directly loading from - * fpu_initialstate, to ignite the XSAVEOPT - * tracking engine. - */ - bcopy(fpu_initialstate, curpcb->pcb_save, - cpu_max_ext_state_size); - fpurestore(curpcb->pcb_save); - if (curpcb->pcb_initial_fpucw != __INITIAL_FPUCW__) - fldcw(curpcb->pcb_initial_fpucw); - if (PCB_USER_FPU(curpcb)) - set_pcb_flags(curpcb, - PCB_FPUINITDONE | PCB_USERFPUINITDONE); - else - set_pcb_flags(curpcb, PCB_FPUINITDONE); - } else - fpurestore(curpcb->pcb_save); - critical_exit(); + if (lazy_fpu_switch || (td->td_pflags & TDP_KTHREAD) != 0 || + !PCB_USER_FPU(td->td_pcb)) { + PCPU_SET(fpcurthread, NULL); + start_emulating(); + } else if (PCPU_GET(fpcurthread) != td) { + restore_fpu_curthread(td); + } } void From owner-svn-src-head@freebsd.org Wed Jun 13 18:26:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79DA41003CBF for ; Wed, 13 Jun 2018 18:26:03 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-yw0-x242.google.com (mail-yw0-x242.google.com [IPv6:2607:f8b0:4002:c05::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0ED607240F for ; Wed, 13 Jun 2018 18:26:03 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-yw0-x242.google.com with SMTP id s201-v6so1213495ywg.8 for ; Wed, 13 Jun 2018 11:26:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=qDKuEZBAyR4eUEcG1ltskoSFEnyhYsbBbB2BAIQJ5PY=; b=18ff+0n1gVj2wZN9EszQq6hBMNNi/Xbr4IhKwl70mm9PekPlDYZ7KfFPV1g+WMywCo eKHcqqpBO1fxsRnhiJFZBl/JdflHWGpFFCzH6Ro+aZtrAwPkMvbLIgnVaDLQxcJjOezQ HZf9fgAXlfljU0gEXAsUB0weVBEzHLbu04Cxxw0Egi/v5YjtO0wKF0uC7KhZ8meYbk9w 96jbe9/Wyq0WXEOl658pJ9V9eUPb5vgIcNefVaKO4QrZ//nqAjFfbGFzGpQ6alKXvc0N Ybtr8zwGN3wLu5f+YC+4jHz18ycZ8xvCMKeDVW4pYwBCD5g9e9+ISdcm7oQqAzMwYABL thiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=qDKuEZBAyR4eUEcG1ltskoSFEnyhYsbBbB2BAIQJ5PY=; b=i/5tJyqW88mzAFhLaszNSNrfFoOgAyyK9RWq/5i6eiwchWPNaRHhhFhUE42jMYGEw1 vdyIzxx9nbMA9pQaOFubHjRtE8yHTSYrxO1tsuPP9K1ZVRu89dm4dcADRk3+f4MvO0KZ Bfjoke6IjaRSE/ijk8NNN2NkcanUyxrGVRM4FNkv3I3/y2KYAGAWtblPl1EA9OJZMFVL KQKyVfxfsvSLuNxwZoxJ30TQAwaaQDIzOD0+MiLI442bOaCJv6mVzOQBfth88WS4AKhp cAP4zQa+ryc49O9M5USqvt1CAtH+c5R1AgTosPPKn3npQ4E9DVHZ27Bez7QmQPC/s5I9 pLCw== X-Gm-Message-State: APt69E1Sd5kGKCJqjUtaG3Jy5RhgPpzvczp1gm5KUixTxkEwS138/Uoh /zAhz0NFGm49cWFf8fyAeSzVdVW/eUukoCS5LNxVlQ== X-Google-Smtp-Source: ADUXVKJjo/gvtyr57Bmv/aQm+wp9VjT6j42/5ZM6Y9UxOiElGkMFv/Hnx4flx1v/E8XnwjaaDHPb91N5cIUPXgsLu80= X-Received: by 2002:a81:5f55:: with SMTP id t82-v6mr2938389ywb.382.1528914362514; Wed, 13 Jun 2018 11:26:02 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:db86:0:0:0:0:0 with HTTP; Wed, 13 Jun 2018 11:26:02 -0700 (PDT) In-Reply-To: <201806131755.w5DHtAwo073314@repo.freebsd.org> References: <201806131755.w5DHtAwo073314@repo.freebsd.org> From: Oliver Pinter Date: Wed, 13 Jun 2018 20:26:02 +0200 Message-ID: Subject: Re: svn commit: r335072 - head/sys/amd64/amd64 To: Konstantin Belousov Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 18:26:03 -0000 On Wednesday, June 13, 2018, Konstantin Belousov wrote: > Author: kib > Date: Wed Jun 13 17:55:09 2018 > New Revision: 335072 > URL: https://svnweb.freebsd.org/changeset/base/335072 > > Log: > Enable eager FPU context switch by default on amd64. > > With compilers making increasing use of vector instructions the > performance benefit of lazily switching FPU state is no longer a > desirable tradeoff. Linux switched to eager FPU context switch some > time ago, and the idea was floated on the FreeBSD-current mailing list > some years ago[1]. > > Enable eager FPU context switch by default on amd64, with a > tunable/sysctl > available to turn it back off. > > [1] https://lists.freebsd.org/pipermail/freebsd-current/ > 2015-March/055198.html > > http://www.openwall.com/lists/oss-security/2018/06/13/7 > Reviewed by: jhb > Tested by: pho > Sponsored by: The FreeBSD Foundation > > Modified: > head/sys/amd64/amd64/cpu_switch.S > head/sys/amd64/amd64/fpu.c > > Modified: head/sys/amd64/amd64/cpu_switch.S > ============================================================ > ================== > --- head/sys/amd64/amd64/cpu_switch.S Wed Jun 13 17:42:55 2018 > (r335071) > +++ head/sys/amd64/amd64/cpu_switch.S Wed Jun 13 17:55:09 2018 > (r335072) > @@ -128,10 +128,10 @@ done_store_dr: > > /* have we used fp, and need a save? */ > cmpq %rdi,PCPU(FPCURTHREAD) > - jne 3f > + jne 2f > movq PCB_SAVEFPU(%r8),%r8 > clts > - cmpl $0,use_xsave > + cmpl $0,use_xsave(%rip) > jne 1f > fxsave (%r8) > jmp 2f > @@ -143,12 +143,7 @@ ctx_switch_xsave: > /* This is patched to xsaveopt if supported, see fpuinit_bsp1() */ > xsave (%r8) > movq %rcx,%rdx > -2: smsw %ax > - orb $CR0_TS,%al > - lmsw %ax > - xorl %eax,%eax > - movq %rax,PCPU(FPCURTHREAD) > -3: > +2: > /* Save is done. Now fire up new thread. Leave old vmspace. */ > movq %rsi,%r12 > movq %rdi,%r13 > @@ -238,6 +233,8 @@ done_load_dr: > movq PCB_RBX(%r8),%rbx > movq PCB_RIP(%r8),%rax > movq %rax,(%rsp) > + movq PCPU(CURTHREAD),%rdi > + call fpu_activate_sw > ret > > /* > > Modified: head/sys/amd64/amd64/fpu.c > ============================================================ > ================== > --- head/sys/amd64/amd64/fpu.c Wed Jun 13 17:42:55 2018 (r335071) > +++ head/sys/amd64/amd64/fpu.c Wed Jun 13 17:55:09 2018 (r335072) > @@ -142,6 +142,11 @@ static void fpu_clean_state(void); > SYSCTL_INT(_hw, HW_FLOATINGPT, floatingpoint, CTLFLAG_RD, > SYSCTL_NULL_INT_PTR, 1, "Floating point instructions executed in > hardware"); > > +int lazy_fpu_switch = 0; > +SYSCTL_INT(_hw, OID_AUTO, lazy_fpu_switch, CTLFLAG_RWTUN | > CTLFLAG_NOFETCH, > + &lazy_fpu_switch, 0, > + "Lazily load FPU context after context switch"); > + > int use_xsave; /* non-static for cpu_switch.S */ > uint64_t xsave_mask; /* the same */ > static uma_zone_t fpu_save_area_zone; > @@ -242,6 +247,7 @@ fpuinit_bsp1(void) > uint64_t xsave_mask_user; > bool old_wp; > > + TUNABLE_INT_FETCH("hw.lazy_fpu_switch", &lazy_fpu_switch); > if (!use_xsave) > return; > cpuid_count(0xd, 0x0, cp); > @@ -651,6 +657,45 @@ fputrap_sse(void) > return (fpetable[(mxcsr & (~mxcsr >> 7)) & 0x3f]); > } > > +static void > +restore_fpu_curthread(struct thread *td) > +{ > + struct pcb *pcb; > + > + /* > + * Record new context early in case frstor causes a trap. > + */ > + PCPU_SET(fpcurthread, td); > + > + stop_emulating(); > + fpu_clean_state(); > + pcb = td->td_pcb; > + > + if ((pcb->pcb_flags & PCB_FPUINITDONE) == 0) { > + /* > + * This is the first time this thread has used the FPU or > + * the PCB doesn't contain a clean FPU state. Explicitly > + * load an initial state. > + * > + * We prefer to restore the state from the actual save > + * area in PCB instead of directly loading from > + * fpu_initialstate, to ignite the XSAVEOPT > + * tracking engine. > + */ > + bcopy(fpu_initialstate, pcb->pcb_save, > + cpu_max_ext_state_size); > + fpurestore(pcb->pcb_save); > + if (pcb->pcb_initial_fpucw != __INITIAL_FPUCW__) > + fldcw(pcb->pcb_initial_fpucw); > + if (PCB_USER_FPU(pcb)) > + set_pcb_flags(pcb, PCB_FPUINITDONE | > + PCB_USERFPUINITDONE); > + else > + set_pcb_flags(pcb, PCB_FPUINITDONE); > + } else > + fpurestore(pcb->pcb_save); > +} > + > /* > * Device Not Available (DNA, #NM) exception handler. > * > @@ -661,7 +706,9 @@ fputrap_sse(void) > void > fpudna(void) > { > + struct thread *td; > > + td = curthread; > /* > * This handler is entered with interrupts enabled, so context > * switches may occur before critical_enter() is executed. If > @@ -675,7 +722,7 @@ fpudna(void) > > KASSERT((curpcb->pcb_flags & PCB_FPUNOSAVE) == 0, > ("fpudna while in fpu_kern_enter(FPU_KERN_NOCTX)")); > - if (PCPU_GET(fpcurthread) == curthread) { > + if (PCPU_GET(fpcurthread) == td) { > printf("fpudna: fpcurthread == curthread\n"); > stop_emulating(); > critical_exit(); > @@ -684,40 +731,24 @@ fpudna(void) > if (PCPU_GET(fpcurthread) != NULL) { > panic("fpudna: fpcurthread = %p (%d), curthread = %p > (%d)\n", > PCPU_GET(fpcurthread), PCPU_GET(fpcurthread)->td_tid, > - curthread, curthread->td_tid); > + td, td->td_tid); > } > - stop_emulating(); > - /* > - * Record new context early in case frstor causes a trap. > - */ > - PCPU_SET(fpcurthread, curthread); > + restore_fpu_curthread(td); > + critical_exit(); > +} > > - fpu_clean_state(); > +void fpu_activate_sw(struct thread *td); /* Called from the context > switch */ > +void > +fpu_activate_sw(struct thread *td) > +{ > > - if ((curpcb->pcb_flags & PCB_FPUINITDONE) == 0) { > - /* > - * This is the first time this thread has used the FPU or > - * the PCB doesn't contain a clean FPU state. Explicitly > - * load an initial state. > - * > - * We prefer to restore the state from the actual save > - * area in PCB instead of directly loading from > - * fpu_initialstate, to ignite the XSAVEOPT > - * tracking engine. > - */ > - bcopy(fpu_initialstate, curpcb->pcb_save, > - cpu_max_ext_state_size); > - fpurestore(curpcb->pcb_save); > - if (curpcb->pcb_initial_fpucw != __INITIAL_FPUCW__) > - fldcw(curpcb->pcb_initial_fpucw); > - if (PCB_USER_FPU(curpcb)) > - set_pcb_flags(curpcb, > - PCB_FPUINITDONE | PCB_USERFPUINITDONE); > - else > - set_pcb_flags(curpcb, PCB_FPUINITDONE); > - } else > - fpurestore(curpcb->pcb_save); > - critical_exit(); > + if (lazy_fpu_switch || (td->td_pflags & TDP_KTHREAD) != 0 || > + !PCB_USER_FPU(td->td_pcb)) { > + PCPU_SET(fpcurthread, NULL); > + start_emulating(); > + } else if (PCPU_GET(fpcurthread) != td) { > + restore_fpu_curthread(td); > + } > } > > void > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Wed Jun 13 18:34:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04F5410049C8; Wed, 13 Jun 2018 18:34:51 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AB75372C23; Wed, 13 Jun 2018 18:34:50 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 739CB1D405; Wed, 13 Jun 2018 18:34:50 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DIYoNp093670; Wed, 13 Jun 2018 18:34:50 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DIYoMX093668; Wed, 13 Jun 2018 18:34:50 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201806131834.w5DIYoMX093668@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 13 Jun 2018 18:34:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335073 - in head: lib/libc/gen share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head: lib/libc/gen share/man/man7 X-SVN-Commit-Revision: 335073 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 18:34:51 -0000 Author: trasz Date: Wed Jun 13 18:34:49 2018 New Revision: 335073 URL: https://svnweb.freebsd.org/changeset/base/335073 Log: Get rid of references to /usr/share/doc/ from ports(7) and getosreldate(3). The handbooks are not installed there anymore. While here, improve the URLs markup a bit. Reviewed by: allanjude@ MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D15793 Modified: head/lib/libc/gen/getosreldate.3 head/share/man/man7/ports.7 Modified: head/lib/libc/gen/getosreldate.3 ============================================================================== --- head/lib/libc/gen/getosreldate.3 Wed Jun 13 17:55:09 2018 (r335072) +++ head/lib/libc/gen/getosreldate.3 Wed Jun 13 18:34:49 2018 (r335073) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 30, 2008 +.Dd June 13, 2018 .Dt GETOSRELDATE 3 .Os .Sh NAME @@ -45,9 +45,9 @@ currently running .Fx kernel. Definitions of the values can be found in -.%B "The Porter's Handbook" -which is usually installed at -.Pa /usr/share/doc/en_US.ISO8859-1/books/porters-handbook/ . +.%B "The Porter's Handbook": +.Pp +.Lk https://www.FreeBSD.org/doc/en/books/porters-handbook/ .Sh RETURN VALUES Upon successful completion, .Fn getosreldate @@ -77,7 +77,6 @@ for any of the errors specified for the library functi .Sh SEE ALSO .Rs .%B "The Porter's Handbook" -.%O /usr/share/doc/en_US.ISO8859-1/books/porters\-handbook/ .Re .Sh HISTORY The Modified: head/share/man/man7/ports.7 ============================================================================== --- head/share/man/man7/ports.7 Wed Jun 13 17:55:09 2018 (r335072) +++ head/share/man/man7/ports.7 Wed Jun 13 18:34:49 2018 (r335073) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 6, 2014 +.Dd June 13, 2018 .Dt PORTS 7 .Os .Sh NAME @@ -56,18 +56,17 @@ simply type .Nm make Cm install to install the application. .Pp -For more information about using ports, see -.Dq "Packages and Ports" +For more information about using ports, see the +.Dq "Packages and Ports" section in -.%B "The FreeBSD Handbook" , -.Pa ( file:/usr/share/doc/en_US.ISO8859-1/books/handbook/ports.html -or -.Pa https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/ports.html ) . -For information about creating new ports, see -.%B "The Porter's Handbook" -.Pa ( file:/usr/share/doc/en_US.ISO8859-1/books/porters-handbook/index.html -or -.Pa https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/porters-handbook/ ) . +.%B "The FreeBSD Handbook": +.Pp +.Lk https://www.FreeBSD.org/doc/en/books/handbook/ports.html +.Pp +For information about creating new ports, see: +.%B "The Porter's Handbook": +.Pp +.Lk https://www.FreeBSD.org/doc/en/books/porters-handbook/ .Sh TARGETS Some of the targets work recursively through subdirectories. This lets you, for example, install all of the From owner-svn-src-head@freebsd.org Wed Jun 13 18:47:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FFF41005CF7; Wed, 13 Jun 2018 18:47:38 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0488073672; Wed, 13 Jun 2018 18:47:38 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm0-x241.google.com with SMTP id z6-v6so327039wma.0; Wed, 13 Jun 2018 11:47:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=ldFIBYA2ORncIVJ+evYHLHZ5/42II9B9QwuCNrSimOY=; b=pTEbDljcOT9Asp2kbctxQg087Xbt3amb32Nf+YJcJcS7wk7y860c1Igld9IhbbDtHA YW0Pl3ZlDUX42X4j1yDZ9I+I1Lu7ePa98iJHocW105uBdNIxWVglOU0npjR5fT/nV0U0 s/6z2PPN4F3uOVcl0fxvaXTFidc6Q4Gth3co2WeOunxD8yNv1eJvFDA1ju8sEGcwe965 GSBJW2TBCfddvBGgLukyJy3Ul7wVuYCEwYQtwvrfyBYfrIYBeSxMaU/cibbXtt+XjBOt lBDH7inXfwRr4aobmCrIrH3gdcXwYK45n+E5/HNDO34NuwPglfRJoE5jkh4spZHHrHTg GEkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=ldFIBYA2ORncIVJ+evYHLHZ5/42II9B9QwuCNrSimOY=; b=ucYAJ7yBc+Zs2VswZbSbvoLJpqU+ZhmEAacEpGszhS0uw702Y9FDqoxDI9fS1VG6x+ AoOPrCZkkshnYP39h8DMWiagfCSh3ovkN4MQZyc9/dQDdjKSTQr94sG8om05X6PTPXE1 Sr0saVt+QecypFq6bFIzgg8pvIthsT9rnSoLTLeAsmjtobB0peb/xEad+gfWleZFWLHR btC9NF7XP6eVlxrIcC7dIup7DNkgLEnFyYpylCqP86g3E50CWSgcQu2Mf1Yl8xP/M9qZ 4p0J2hHElAG6ahdGtlg4jkf3t6UdYKOYqHwngJ9ng5yLzCF3aNsEhFsth5hUjwPgxlvb 9RcA== X-Gm-Message-State: APt69E3diNS5ERodWYtD4uK42C2hD9bcvsN9POQdpu6NfkU6aaPwysUJ bPUNQT4wl076pv+xu+SSqiccKA== X-Google-Smtp-Source: ADUXVKKUyFjPgyr+NQX3zgSEd/xgTEgXBJF77RoYEnu9dbZ5v9ayJijjO1N09h0BdjM0rLB6ALIpdw== X-Received: by 2002:a1c:dac2:: with SMTP id r185-v6mr4150311wmg.31.1528915657031; Wed, 13 Jun 2018 11:47:37 -0700 (PDT) Received: from brick (cpc92302-cmbg19-2-0-cust461.5-4.cable.virginm.net. [82.1.209.206]) by smtp.gmail.com with ESMTPSA id e63-v6sm5365880wma.46.2018.06.13.11.47.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Jun 2018 11:47:36 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Wed, 13 Jun 2018 19:47:34 +0100 From: Edward Napierala To: Warner Losh Cc: Emmanuel Vadot , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, owner-src-committers@freebsd.org Subject: Re: svn commit: r335004 - head/release/tools Message-ID: <20180613184734.GA71415@brick> Mail-Followup-To: Warner Losh , Emmanuel Vadot , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, owner-src-committers@freebsd.org References: <201806121645.w5CGjrMM099365@repo.freebsd.org> <941a15be461602ae3d723c3f30804248@megadrive.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 18:47:38 -0000 On 0613T0730, Warner Losh wrote: > On Wed, Jun 13, 2018 at 6:39 AM, Edward Napierala wrote: > > > 2018-06-13 12:43 GMT+01:00 Emmanuel Vadot : > > > >> On 2018-06-12 18:45, Edward Tomasz Napierala wrote: [..] > >> + echo '# USB OTG virtual serial port' \ > >>> + >> ${CHROOTDIR}/${DESTDIR}/etc/ttys > >>> + echo 'ttyU0 "/usr/libexec/getty 3wire" vt100 > >>> onifconsole secure' \ > >>> + >> ${CHROOTDIR}/${DESTDIR}/etc/ttys > >>> + echo 'ttyU1 "/usr/libexec/getty 3wire" vt100 > >>> onifconsole secure' \ > >>> + >> ${CHROOTDIR}/${DESTDIR}/etc/ttys > >>> > >> > >> If I have no OTG port and a usb<->uart plugged into my board that will > >> give weird result no ? > >> > > > > No, because that port won't be marked as console. This only applies > > to the "virtual" OTG serial ports. > > > > Right, and console is an overloaded term. Here it just means 'tty marked > by the kernel that gets a getty started on it automatically after it shows > up' not 'the device that gets all the kernel I/O.' Yup. But again - this reuses the functionality that's already there in init(8), while avoiding the renaming of device nodes. And eventually, those ports might become actual consoles, making things nicely aligned. [..] From owner-svn-src-head@freebsd.org Wed Jun 13 18:50:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57CB7100635D; Wed, 13 Jun 2018 18:50:52 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 09B9A73A96; Wed, 13 Jun 2018 18:50:52 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF0B31D5E4; Wed, 13 Jun 2018 18:50:51 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DIopHB099064; Wed, 13 Jun 2018 18:50:51 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DIopIn099063; Wed, 13 Jun 2018 18:50:51 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201806131850.w5DIopIn099063@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 13 Jun 2018 18:50:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335074 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 335074 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 18:50:52 -0000 Author: trasz Date: Wed Jun 13 18:50:51 2018 New Revision: 335074 URL: https://svnweb.freebsd.org/changeset/base/335074 Log: Mention that ports are used to build packages, this fact - obvious to the developers, but much less so to users - seems to be rather weakly documented. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/share/man/man7/ports.7 Modified: head/share/man/man7/ports.7 ============================================================================== --- head/share/man/man7/ports.7 Wed Jun 13 18:34:49 2018 (r335073) +++ head/share/man/man7/ports.7 Wed Jun 13 18:50:51 2018 (r335074) @@ -37,6 +37,8 @@ The Ports Collection offers a simple way for users and administrators to install applications. +It is also used to build the packages, to be installed using +.Xr pkg 8 . Each .Em port contains any patches necessary to make the original From owner-svn-src-head@freebsd.org Wed Jun 13 19:12:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6230510089D3; Wed, 13 Jun 2018 19:12:31 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 19C4075145; Wed, 13 Jun 2018 19:12:31 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [172.17.3.106] (dip-pa.panasas.com [65.205.22.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id D45B98085; Wed, 13 Jun 2018 19:12:30 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/10.e.0.180610 Date: Wed, 13 Jun 2018 15:12:29 -0400 Subject: Re: svn commit: r335066 - in head/sys: kern sys From: Ravi Pokala To: Warner Losh , , , Message-ID: <7D695D8A-D273-4914-9980-F4BD096A80A2@panasas.com> Thread-Topic: svn commit: r335066 - in head/sys: kern sys References: <201806131648.w5DGm7i4037714@repo.freebsd.org> In-Reply-To: <201806131648.w5DGm7i4037714@repo.freebsd.org> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 19:12:31 -0000 Hi Warner, I have many questions... "Car limit"? I'm not sure what you mean by that? This change starts tracking the total number of BIOs on the queue, but doesn't actually do anything with that value. When there are more requests batched than the limit, your comment say you "start over", and the code says you bioq_insert_tail(). Why does the latter imply "start(ing) over"? Thanks, Ravi (rpokala@) -----Original Message----- From: on behalf of Warner Losh Date: 2018-06-13, Wednesday at 12:48 To: , , Subject: svn commit: r335066 - in head/sys: kern sys Author: imp Date: Wed Jun 13 16:48:07 2018 New Revision: 335066 URL: https://svnweb.freebsd.org/changeset/base/335066 Log: Implement a 'car limit' for bioq. Allow one to implement a 'car limit' for bioq_disksort. debug.bioq_batchsize sets the size of car limit. Every time we queue that many requests, we start over so that we limit the latency for requests when the software queue depths are large. A value of '0', the default, means to revert to the old behavior. Sponsored by: Netflix Modified: head/sys/kern/subr_disk.c head/sys/sys/bio.h Modified: head/sys/kern/subr_disk.c ============================================================================== --- head/sys/kern/subr_disk.c Wed Jun 13 15:58:33 2018 (r335065) +++ head/sys/kern/subr_disk.c Wed Jun 13 16:48:07 2018 (r335066) @@ -23,8 +23,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +static int bioq_batchsize = 0; +SYSCTL_INT(_debug, OID_AUTO, bioq_batchsize, CTLFLAG_RW, + &bioq_batchsize, 0, "BIOQ batch size"); + /*- * Disk error is the preface to plaintive error messages * about failing disk transfers. It prints messages of the form @@ -152,6 +157,8 @@ bioq_init(struct bio_queue_head *head) TAILQ_INIT(&head->queue); head->last_offset = 0; head->insert_point = NULL; + head->total = 0; + head->batched = 0; } void @@ -165,6 +172,7 @@ bioq_remove(struct bio_queue_head *head, struct bio *b head->insert_point = NULL; TAILQ_REMOVE(&head->queue, bp, bio_queue); + head->total--; } void @@ -183,6 +191,8 @@ bioq_insert_head(struct bio_queue_head *head, struct b if (head->insert_point == NULL) head->last_offset = bp->bio_offset; TAILQ_INSERT_HEAD(&head->queue, bp, bio_queue); + head->total++; + head->batched = 0; } void @@ -190,6 +200,7 @@ bioq_insert_tail(struct bio_queue_head *head, struct b { TAILQ_INSERT_TAIL(&head->queue, bp, bio_queue); + head->total++; head->insert_point = bp; head->last_offset = bp->bio_offset; } @@ -248,6 +259,11 @@ bioq_disksort(struct bio_queue_head *head, struct bio return; } + if (bioq_batchsize > 0 && head->batched > bioq_batchsize) { + bioq_insert_tail(head, bp); + return; + } + prev = NULL; key = bioq_bio_key(head, bp); cur = TAILQ_FIRST(&head->queue); @@ -266,4 +282,6 @@ bioq_disksort(struct bio_queue_head *head, struct bio TAILQ_INSERT_HEAD(&head->queue, bp, bio_queue); else TAILQ_INSERT_AFTER(&head->queue, prev, bp, bio_queue); + head->total++; + head->batched++; } Modified: head/sys/sys/bio.h ============================================================================== --- head/sys/sys/bio.h Wed Jun 13 15:58:33 2018 (r335065) +++ head/sys/sys/bio.h Wed Jun 13 16:48:07 2018 (r335066) @@ -138,6 +138,8 @@ struct bio_queue_head { TAILQ_HEAD(bio_queue, bio) queue; off_t last_offset; struct bio *insert_point; + int total; + int batched; }; extern struct vm_map *bio_transient_map; From owner-svn-src-head@freebsd.org Wed Jun 13 19:22:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AC771009814 for ; Wed, 13 Jun 2018 19:22:09 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22c.google.com (mail-it0-x22c.google.com [IPv6:2607:f8b0:4001:c0b::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0AB0275875 for ; Wed, 13 Jun 2018 19:22:09 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22c.google.com with SMTP id 188-v6so5431431ita.5 for ; Wed, 13 Jun 2018 12:22:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=P4uac3RzoXw4OQ5Uj1DwCQpQzNp9waJkeTa6g6NpMYA=; b=m4EOl4j17nWTfHu8vl6bP1AGFtzItuQSk3pOffdy9WKNCJ94owgDxYVR1HFh4QRhtn wJv/zmYKDzWSMF3LkbaULaFu+GZxFw49QtPCs1uITxaHzomfrxeYJOXHiePGRm0QqawJ G/w8YbiT6t8T6mu44lonxR7wFaU/6XgNYVrL0+geD6t+qHDIOEyumgg4E+4DKiC3CL0Z jHInFeHVXnKri0bdOTOv2Co7rmad7KGfbsOljlNk2yYwVX3zLenHqzmvEYgeWpScEOmA QcqNa44AqyggQXEMZUzu9o6bux/4xAaX8DxKYGuYmHc/JdlVuePDbyxzpE+OFaIMvqda pTVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=P4uac3RzoXw4OQ5Uj1DwCQpQzNp9waJkeTa6g6NpMYA=; b=dJ0LJCrlMILLkChj+UIT/lVc6vMypSX+MoCspDZdlegcqZS1CAwZ2pG8eMnUMpCg6u vvYqZbLAHKmibol8WI8iLKJmNRLVMc6JHMQDdYqgUHNPqlAWGvGaicFuU7QophS5HFJF c6Tz+vugr4ZHgKvfUWqSmCIWLAds/oHdzfbbPj1lO6sJQSlgNNgZiGQubdBd/+R+ZtL+ 5Mu5Bq9CC4U0X9RSBu+T5AQ4rujA3Qb0oYHenkjpJzmM8LcqqHVy0MsJ8rUoQp6B+Jkx NxMQZdOCnZiw5/jAd7tuE2YMmaoAs1oJEQmMTJET/UA+AUa4oPwcxrAXTv9XadU9XedZ ryOA== X-Gm-Message-State: APt69E1iJissvZhcthI2krCP7piY2rz5qlqryp93Y/FOPiaaJuj+oLaK xeHkpHXNfc+5ktTUnooA26HiHzNpPlcvihWK2h4ANQ== X-Google-Smtp-Source: ADUXVKIqYPCMPin3RjdILALdzk+x7T4APlllcdy2P4uYUVcbyqZU9esJ5Uyl1SwprFKS6RzGGtxJfW0PmbVwRATUenY= X-Received: by 2002:a24:64ce:: with SMTP id t197-v6mr5861637itc.36.1528917728328; Wed, 13 Jun 2018 12:22:08 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:d028:0:0:0:0:0 with HTTP; Wed, 13 Jun 2018 12:22:07 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <7D695D8A-D273-4914-9980-F4BD096A80A2@panasas.com> References: <201806131648.w5DGm7i4037714@repo.freebsd.org> <7D695D8A-D273-4914-9980-F4BD096A80A2@panasas.com> From: Warner Losh Date: Wed, 13 Jun 2018 13:22:07 -0600 X-Google-Sender-Auth: JBf3wyG9OztSEb0qrJ8lMhcmU7g Message-ID: Subject: Re: svn commit: r335066 - in head/sys: kern sys To: Ravi Pokala Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 19:22:09 -0000 On Wed, Jun 13, 2018 at 1:12 PM, Ravi Pokala wrote: > Hi Warner, > > I have many questions... > > "Car limit"? I'm not sure what you mean by that? > So we implement the elevator algorithm, but limit the number of requests that we can put in each 'car'. Elevators themselves are sometimes call 'cars' for reasons I have no clue about. So we only put N requests into the sorting algorithm. We put the next request at the end, unsorted, and that has the side effect of starting over so the net request after that is sorted against the last one, but not the first N. This is to help bound software queuing latency. > This change starts tracking the total number of BIOs on the queue, but > doesn't actually do anything with that value. > Oh, you're right. We have a sysctl that counts them, I think, in Netflix's code base (or did, I can't find it in the current sources)... I should remove that from here. I'm surprised I didn't notice that before. > When there are more requests batched than the limit, your comment say you > "start over", and the code says you bioq_insert_tail(). Why does the latter > imply "start(ing) over"? > Because that also sets a new sorting point for inserting sorted. Warner > Thanks, > > Ravi (rpokala@) > > -----Original Message----- > From: on behalf of Warner Losh > > Date: 2018-06-13, Wednesday at 12:48 > To: , , < > svn-src-head@freebsd.org> > Subject: svn commit: r335066 - in head/sys: kern sys > > Author: imp > Date: Wed Jun 13 16:48:07 2018 > New Revision: 335066 > URL: https://svnweb.freebsd.org/changeset/base/335066 > > Log: > Implement a 'car limit' for bioq. > > Allow one to implement a 'car limit' for > bioq_disksort. debug.bioq_batchsize sets the size of car limit. Every > time we queue that many requests, we start over so that we limit the > latency for requests when the software queue depths are large. A value > of '0', the default, means to revert to the old behavior. > > Sponsored by: Netflix > > Modified: > head/sys/kern/subr_disk.c > head/sys/sys/bio.h > > Modified: head/sys/kern/subr_disk.c > ============================================================ > ================== > --- head/sys/kern/subr_disk.c Wed Jun 13 15:58:33 2018 (r335065) > +++ head/sys/kern/subr_disk.c Wed Jun 13 16:48:07 2018 (r335066) > @@ -23,8 +23,13 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > > +static int bioq_batchsize = 0; > +SYSCTL_INT(_debug, OID_AUTO, bioq_batchsize, CTLFLAG_RW, > + &bioq_batchsize, 0, "BIOQ batch size"); > + > /*- > * Disk error is the preface to plaintive error messages > * about failing disk transfers. It prints messages of the form > @@ -152,6 +157,8 @@ bioq_init(struct bio_queue_head *head) > TAILQ_INIT(&head->queue); > head->last_offset = 0; > head->insert_point = NULL; > + head->total = 0; > + head->batched = 0; > } > > void > @@ -165,6 +172,7 @@ bioq_remove(struct bio_queue_head *head, struct bio *b > head->insert_point = NULL; > > TAILQ_REMOVE(&head->queue, bp, bio_queue); > + head->total--; > } > > void > @@ -183,6 +191,8 @@ bioq_insert_head(struct bio_queue_head *head, struct b > if (head->insert_point == NULL) > head->last_offset = bp->bio_offset; > TAILQ_INSERT_HEAD(&head->queue, bp, bio_queue); > + head->total++; > + head->batched = 0; > } > > void > @@ -190,6 +200,7 @@ bioq_insert_tail(struct bio_queue_head *head, struct b > { > > TAILQ_INSERT_TAIL(&head->queue, bp, bio_queue); > + head->total++; > head->insert_point = bp; > head->last_offset = bp->bio_offset; > } > @@ -248,6 +259,11 @@ bioq_disksort(struct bio_queue_head *head, struct bio > return; > } > > + if (bioq_batchsize > 0 && head->batched > bioq_batchsize) { > + bioq_insert_tail(head, bp); > + return; > + } > + > prev = NULL; > key = bioq_bio_key(head, bp); > cur = TAILQ_FIRST(&head->queue); > @@ -266,4 +282,6 @@ bioq_disksort(struct bio_queue_head *head, struct bio > TAILQ_INSERT_HEAD(&head->queue, bp, bio_queue); > else > TAILQ_INSERT_AFTER(&head->queue, prev, bp, bio_queue); > + head->total++; > + head->batched++; > } > > Modified: head/sys/sys/bio.h > ============================================================ > ================== > --- head/sys/sys/bio.h Wed Jun 13 15:58:33 2018 (r335065) > +++ head/sys/sys/bio.h Wed Jun 13 16:48:07 2018 (r335066) > @@ -138,6 +138,8 @@ struct bio_queue_head { > TAILQ_HEAD(bio_queue, bio) queue; > off_t last_offset; > struct bio *insert_point; > + int total; > + int batched; > }; > > extern struct vm_map *bio_transient_map; > > > > From owner-svn-src-head@freebsd.org Wed Jun 13 19:35:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3ECA100ADCE for ; Wed, 13 Jun 2018 19:35:58 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4627E76382 for ; Wed, 13 Jun 2018 19:35:58 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: f9a7a48d-6f40-11e8-b829-b3adae557cda X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id f9a7a48d-6f40-11e8-b829-b3adae557cda; Wed, 13 Jun 2018 19:35:50 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w5DJZmUu061259; Wed, 13 Jun 2018 13:35:48 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1528918548.12122.74.camel@freebsd.org> Subject: Re: svn commit: r335066 - in head/sys: kern sys From: Ian Lepore To: Warner Losh , Ravi Pokala Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Wed, 13 Jun 2018 13:35:48 -0600 In-Reply-To: References: <201806131648.w5DGm7i4037714@repo.freebsd.org> <7D695D8A-D273-4914-9980-F4BD096A80A2@panasas.com> Content-Type: text/plain; charset="ASCII" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 19:35:58 -0000 On Wed, 2018-06-13 at 13:22 -0600, Warner Losh wrote: > So we implement the elevator algorithm, but limit the number of requests > that we can put in each 'car'. Elevators themselves are sometimes call > 'cars' for reasons I have no clue about. An "elevator" is an entire system for moving something vertically. It includes a lift mechanism, guide system (rails, etc), control mechanisms, etc. When the portion of the system that moves is an enclosed space (not a simple platform or bucket) which carries people and/or goods, that part is called a "carriage" or "car". -- Ian (who was oddly fascinated by elevators as a child) From owner-svn-src-head@freebsd.org Wed Jun 13 19:57:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBE8D100D8FE; Wed, 13 Jun 2018 19:57:04 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8927B77405; Wed, 13 Jun 2018 19:57:04 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 679121E10D; Wed, 13 Jun 2018 19:57:04 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DJv4OU035209; Wed, 13 Jun 2018 19:57:04 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DJv46i035208; Wed, 13 Jun 2018 19:57:04 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201806131957.w5DJv46i035208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Wed, 13 Jun 2018 19:57:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335076 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 335076 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 19:57:05 -0000 Author: rlibby Date: Wed Jun 13 19:57:03 2018 New Revision: 335076 URL: https://svnweb.freebsd.org/changeset/base/335076 Log: i386: copyin/copyout error is EFAULT Discussed with: kib MFC with: r332489 Sponsored by: Dell EMC Isilon Modified: head/sys/i386/i386/copyout.c Modified: head/sys/i386/i386/copyout.c ============================================================================== --- head/sys/i386/i386/copyout.c Wed Jun 13 18:58:36 2018 (r335075) +++ head/sys/i386/i386/copyout.c Wed Jun 13 19:57:03 2018 (r335076) @@ -226,7 +226,7 @@ copyin(const void *udaddr, void *kaddr, size_t len) if ((uintptr_t)udaddr + len < (uintptr_t)udaddr || (uintptr_t)udaddr + len > VM_MAXUSER_ADDRESS) - return (-1); + return (EFAULT); if (len == 0 || (fast_copyout && len <= TRAMP_COPYOUT_SZ && copyin_fast_tramp(udaddr, kaddr, len, KCR3) == 0)) return (0); @@ -261,7 +261,7 @@ copyout(const void *kaddr, void *udaddr, size_t len) if ((uintptr_t)udaddr + len < (uintptr_t)udaddr || (uintptr_t)udaddr + len > VM_MAXUSER_ADDRESS) - return (-1); + return (EFAULT); if (len == 0 || (fast_copyout && len <= TRAMP_COPYOUT_SZ && copyout_fast_tramp(kaddr, udaddr, len, KCR3) == 0)) return (0); From owner-svn-src-head@freebsd.org Wed Jun 13 20:24:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47CF610111EE; Wed, 13 Jun 2018 20:24:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F103178A4C; Wed, 13 Jun 2018 20:24:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D2AD81E5E4; Wed, 13 Jun 2018 20:24:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DKOn8n049912; Wed, 13 Jun 2018 20:24:49 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DKOn3j049911; Wed, 13 Jun 2018 20:24:49 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806132024.w5DKOn3j049911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 13 Jun 2018 20:24:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335077 - head/sys/dev/ncr X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/ncr X-SVN-Commit-Revision: 335077 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 20:24:50 -0000 Author: imp Date: Wed Jun 13 20:24:49 2018 New Revision: 335077 URL: https://svnweb.freebsd.org/changeset/base/335077 Log: Add PNP info to the PCI attachment of the ncr driver. Reviewed by: imp, chuck Submitted by: Lakhan Shiva Kamireddy Sponsored by: Google, Inc. (GSoC 2018) Modified: head/sys/dev/ncr/ncr.c Modified: head/sys/dev/ncr/ncr.c ============================================================================== --- head/sys/dev/ncr/ncr.c Wed Jun 13 19:57:03 2018 (r335076) +++ head/sys/dev/ncr/ncr.c Wed Jun 13 20:24:49 2018 (r335077) @@ -3169,8 +3169,8 @@ u_int32_t ncr_info (int unit) **---------------------------------------------------------- */ typedef struct { - unsigned long device_id; - unsigned short minrevid; + uint32_t device_id; + uint16_t minrevid; char *name; unsigned char maxburst; unsigned char maxoffs; @@ -3225,7 +3225,7 @@ static ncr_chip ncr_chip_table[] = { FE_WIDE|FE_ULTRA2|FE_QUAD|FE_CACHE_SET|FE_DFS|FE_LDSTR|FE_PFEN|FE_RAM} }; -static int ncr_chip_lookup(u_long device_id, u_char revision_id) +static int ncr_chip_lookup(uint32_t device_id, u_char revision_id) { int i, found; @@ -7108,6 +7108,8 @@ static driver_t ncr_driver = { static devclass_t ncr_devclass; DRIVER_MODULE(ncr, pci, ncr_driver, ncr_devclass, 0, 0); +MODULE_PNP_INFO("W32:vendor/device;U16:#;D:#", pci, ncr, ncr_chip_table, + sizeof(ncr_chip_table[0]), nitems(ncr_chip_table)); MODULE_DEPEND(ncr, cam, 1, 1, 1); MODULE_DEPEND(ncr, pci, 1, 1, 1); From owner-svn-src-head@freebsd.org Wed Jun 13 20:25:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23CEC1011262; Wed, 13 Jun 2018 20:25:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BE77B78B4A; Wed, 13 Jun 2018 20:25:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A05271E5E5; Wed, 13 Jun 2018 20:25:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DKP0pC049981; Wed, 13 Jun 2018 20:25:00 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DKP0wN049980; Wed, 13 Jun 2018 20:25:00 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806132025.w5DKP0wN049980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 13 Jun 2018 20:25:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335078 - head/sys/dev/aacraid X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/aacraid X-SVN-Commit-Revision: 335078 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 20:25:01 -0000 Author: imp Date: Wed Jun 13 20:25:00 2018 New Revision: 335078 URL: https://svnweb.freebsd.org/changeset/base/335078 Log: Add PNP info to the PCI attachment of the aacraid driver. Reviewed by: imp, chuck Submitted by: Lakhan Shiva Kamireddy Sponsored by: Google, Inc. (GSoC 2018) Modified: head/sys/dev/aacraid/aacraid_pci.c Modified: head/sys/dev/aacraid/aacraid_pci.c ============================================================================== --- head/sys/dev/aacraid/aacraid_pci.c Wed Jun 13 20:24:49 2018 (r335077) +++ head/sys/dev/aacraid/aacraid_pci.c Wed Jun 13 20:25:00 2018 (r335078) @@ -85,9 +85,6 @@ static driver_t aacraid_pci_driver = { static devclass_t aacraid_devclass; -DRIVER_MODULE(aacraid, pci, aacraid_pci_driver, aacraid_devclass, 0, 0); -MODULE_DEPEND(aacraid, pci, 1, 1, 1); - struct aac_ident { u_int16_t vendor; @@ -106,6 +103,12 @@ struct aac_ident "Adaptec RAID Controller"}, {0, 0, 0, 0, 0, 0, 0} }; + +DRIVER_MODULE(aacraid, pci, aacraid_pci_driver, aacraid_devclass, 0, 0); +MODULE_PNP_INFO("U16:vendor;U16:device", pci, aacraid, + aacraid_family_identifiers, sizeof(aacraid_family_identifiers[0]), + nitems(aacraid_family_identifiers) - 1); +MODULE_DEPEND(aacraid, pci, 1, 1, 1); static struct aac_ident * aac_find_ident(device_t dev) From owner-svn-src-head@freebsd.org Wed Jun 13 20:25:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E55A1101129C; Wed, 13 Jun 2018 20:25:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B32AD78BBB; Wed, 13 Jun 2018 20:25:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4F32F1E5E6; Wed, 13 Jun 2018 20:25:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DKP56U050034; Wed, 13 Jun 2018 20:25:05 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DKP5Gj050033; Wed, 13 Jun 2018 20:25:05 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806132025.w5DKP5Gj050033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 13 Jun 2018 20:25:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335079 - head/sys/dev/ahci X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/ahci X-SVN-Commit-Revision: 335079 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 20:25:07 -0000 Author: imp Date: Wed Jun 13 20:25:04 2018 New Revision: 335079 URL: https://svnweb.freebsd.org/changeset/base/335079 Log: Add PNP info to the PCI attachment of the ahci driver Mark the PNP table, but still need to handle the CLASS / SUBCLASS / REVID matching. Reviewed by: imp, chuck Submitted by: Lakhan Shiva Kamireddy Sponsored by: Google, Inc. (GSoC 2018) Modified: head/sys/dev/ahci/ahci_pci.c Modified: head/sys/dev/ahci/ahci_pci.c ============================================================================== --- head/sys/dev/ahci/ahci_pci.c Wed Jun 13 20:25:00 2018 (r335078) +++ head/sys/dev/ahci/ahci_pci.c Wed Jun 13 20:25:04 2018 (r335079) @@ -664,6 +664,9 @@ static driver_t ahci_driver = { sizeof(struct ahci_controller) }; DRIVER_MODULE(ahci, pci, ahci_driver, ahci_devclass, NULL, NULL); +/* Also matches class / subclass / progid XXX need to add when we have masking support */ +MODULE_PNP_INFO("W32:vendor/device", pci, ahci, ahci_ids, + sizeof(ahci_ids[0]), nitems(ahci_ids) - 1); static device_method_t ahci_ata_methods[] = { DEVMETHOD(device_probe, ahci_ata_probe), DEVMETHOD(device_attach, ahci_pci_attach), From owner-svn-src-head@freebsd.org Wed Jun 13 20:25:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D94710112D3; Wed, 13 Jun 2018 20:25:10 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C752378C48; Wed, 13 Jun 2018 20:25:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A83991E5E7; Wed, 13 Jun 2018 20:25:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DKP93I050086; Wed, 13 Jun 2018 20:25:09 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DKP9eP050085; Wed, 13 Jun 2018 20:25:09 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806132025.w5DKP9eP050085@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 13 Jun 2018 20:25:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335080 - head/sys/dev/an X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/an X-SVN-Commit-Revision: 335080 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 20:25:10 -0000 Author: imp Date: Wed Jun 13 20:25:09 2018 New Revision: 335080 URL: https://svnweb.freebsd.org/changeset/base/335080 Log: Add PNP info to PCI attachment of an driver Reviewed by: imp, chuck Submitted by: Lakhan Shiva Kamireddy Sponsored by: Google, Inc. (GSoC 2018) Modified: head/sys/dev/an/if_an_pci.c Modified: head/sys/dev/an/if_an_pci.c ============================================================================== --- head/sys/dev/an/if_an_pci.c Wed Jun 13 20:25:04 2018 (r335079) +++ head/sys/dev/an/if_an_pci.c Wed Jun 13 20:25:09 2018 (r335080) @@ -273,5 +273,7 @@ static driver_t an_pci_driver = { static devclass_t an_devclass; DRIVER_MODULE(an, pci, an_pci_driver, an_devclass, 0, 0); +MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, an, + an_devs, sizeof(an_devs[0]), nitems(an_devs) - 1); MODULE_DEPEND(an, pci, 1, 1, 1); MODULE_DEPEND(an, wlan, 1, 1, 1); From owner-svn-src-head@freebsd.org Wed Jun 13 20:25:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8385101131C; Wed, 13 Jun 2018 20:25:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BAEBD78D35; Wed, 13 Jun 2018 20:25:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F0D81E5E8; Wed, 13 Jun 2018 20:25:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DKPEc2050142; Wed, 13 Jun 2018 20:25:14 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DKPEta050141; Wed, 13 Jun 2018 20:25:14 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806132025.w5DKPEta050141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 13 Jun 2018 20:25:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335081 - head/sys/dev/bwn X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/bwn X-SVN-Commit-Revision: 335081 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 20:25:16 -0000 Author: imp Date: Wed Jun 13 20:25:13 2018 New Revision: 335081 URL: https://svnweb.freebsd.org/changeset/base/335081 Log: Add PNP info to PCI attachment of bwn driver Reviewed by: imp, chuck Submitted by: Lakhan Shiva Kamireddy Sponsored by: Google, Inc. (GSoC 2018) Modified: head/sys/dev/bwn/if_bwn_pci.c Modified: head/sys/dev/bwn/if_bwn_pci.c ============================================================================== --- head/sys/dev/bwn/if_bwn_pci.c Wed Jun 13 20:25:09 2018 (r335080) +++ head/sys/dev/bwn/if_bwn_pci.c Wed Jun 13 20:25:13 2018 (r335081) @@ -295,6 +295,10 @@ DEFINE_CLASS_0(bwn_pci, bwn_pci_driver, bwn_pci_method sizeof(struct bwn_pci_softc)); DRIVER_MODULE_ORDERED(bwn_pci, pci, bwn_pci_driver, bwn_pci_devclass, NULL, NULL, SI_ORDER_ANY); +MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, bwn_siba, + siba_devices, sizeof(siba_devices[0]), nitems(siba_devices) - 1); +MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, bwn_bcma, + bcma_devices, sizeof(bcma_devices[0]), nitems(bcma_devices) - 1); DRIVER_MODULE(bhndb, bwn_pci, bhndb_pci_driver, bhndb_devclass, NULL, NULL); MODULE_DEPEND(bwn_pci, bwn, 1, 1, 1); From owner-svn-src-head@freebsd.org Wed Jun 13 20:25:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57B5F1011373; Wed, 13 Jun 2018 20:25:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 372ED78E27; Wed, 13 Jun 2018 20:25:18 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BCF571E5E9; Wed, 13 Jun 2018 20:25:18 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DKPIAc050196; Wed, 13 Jun 2018 20:25:18 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DKPIbZ050195; Wed, 13 Jun 2018 20:25:18 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806132025.w5DKPIbZ050195@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 13 Jun 2018 20:25:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335082 - head/sys/dev/bwi X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/bwi X-SVN-Commit-Revision: 335082 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 20:25:21 -0000 Author: imp Date: Wed Jun 13 20:25:18 2018 New Revision: 335082 URL: https://svnweb.freebsd.org/changeset/base/335082 Log: Add PNP info to PCI attachment of bwi driver Reviewed by: imp, chuck Submitted by: Lakhan Shiva Kamireddy Sponsored by: Google, Inc. (GSoC 2018) Modified: head/sys/dev/bwi/if_bwi_pci.c Modified: head/sys/dev/bwi/if_bwi_pci.c ============================================================================== --- head/sys/dev/bwi/if_bwi_pci.c Wed Jun 13 20:25:13 2018 (r335081) +++ head/sys/dev/bwi/if_bwi_pci.c Wed Jun 13 20:25:18 2018 (r335082) @@ -256,6 +256,8 @@ static driver_t bwi_driver = { }; static devclass_t bwi_devclass; DRIVER_MODULE(bwi, pci, bwi_driver, bwi_devclass, 0, 0); +MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, bwi, bwi_devices, + sizeof(bwi_devices[0]), nitems(bwi_devices) - 1); MODULE_DEPEND(bwi, wlan, 1, 1, 1); /* 802.11 media layer */ MODULE_DEPEND(bwi, firmware, 1, 1, 1); /* firmware support */ MODULE_DEPEND(bwi, wlan_amrr, 1, 1, 1); From owner-svn-src-head@freebsd.org Wed Jun 13 20:25:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8662810113A8; Wed, 13 Jun 2018 20:25:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C995778F04; Wed, 13 Jun 2018 20:25:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA8FB1E5EA; Wed, 13 Jun 2018 20:25:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DKPNbQ050250; Wed, 13 Jun 2018 20:25:23 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DKPNVZ050249; Wed, 13 Jun 2018 20:25:23 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806132025.w5DKPNVZ050249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 13 Jun 2018 20:25:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335083 - head/sys/dev/ale X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/ale X-SVN-Commit-Revision: 335083 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 20:25:26 -0000 Author: imp Date: Wed Jun 13 20:25:23 2018 New Revision: 335083 URL: https://svnweb.freebsd.org/changeset/base/335083 Log: Add PNP info to PCI attachment of ale driver Reviewed by: imp, chuck Submitted by: Lakhan Shiva Kamireddy Sponsored by: Google, Inc. (GSoC 2018) Modified: head/sys/dev/ale/if_ale.c Modified: head/sys/dev/ale/if_ale.c ============================================================================== --- head/sys/dev/ale/if_ale.c Wed Jun 13 20:25:18 2018 (r335082) +++ head/sys/dev/ale/if_ale.c Wed Jun 13 20:25:23 2018 (r335083) @@ -178,6 +178,8 @@ static driver_t ale_driver = { static devclass_t ale_devclass; DRIVER_MODULE(ale, pci, ale_driver, ale_devclass, NULL, NULL); +MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, ale, ale_devs, + sizeof(ale_devs[0]), nitems(ale_devs)); DRIVER_MODULE(miibus, ale, miibus_driver, miibus_devclass, NULL, NULL); static struct resource_spec ale_res_spec_mem[] = { From owner-svn-src-head@freebsd.org Wed Jun 13 20:25:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAE3510113D5; Wed, 13 Jun 2018 20:25:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E352B78FD4; Wed, 13 Jun 2018 20:25:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5D8761E5EB; Wed, 13 Jun 2018 20:25:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DKPSmE050303; Wed, 13 Jun 2018 20:25:28 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DKPSZY050302; Wed, 13 Jun 2018 20:25:28 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806132025.w5DKPSZY050302@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 13 Jun 2018 20:25:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335084 - head/sys/dev/amr X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/amr X-SVN-Commit-Revision: 335084 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 20:25:31 -0000 Author: imp Date: Wed Jun 13 20:25:27 2018 New Revision: 335084 URL: https://svnweb.freebsd.org/changeset/base/335084 Log: Add PNP info to PCI attachment of amr driver Reviewed by: imp, chuck Submitted by: Lakhan Shiva Kamireddy Sponsored by: Google, Inc. (GSoC 2018) Modified: head/sys/dev/amr/amr_pci.c Modified: head/sys/dev/amr/amr_pci.c ============================================================================== --- head/sys/dev/amr/amr_pci.c Wed Jun 13 20:25:23 2018 (r335083) +++ head/sys/dev/amr/amr_pci.c Wed Jun 13 20:25:27 2018 (r335084) @@ -116,15 +116,10 @@ static driver_t amr_pci_driver = { sizeof(struct amr_softc) }; -static devclass_t amr_devclass; -DRIVER_MODULE(amr, pci, amr_pci_driver, amr_devclass, 0, 0); -MODULE_DEPEND(amr, pci, 1, 1, 1); -MODULE_DEPEND(amr, cam, 1, 1, 1); - static struct amr_ident { - int vendor; - int device; + uint16_t vendor; + uint16_t device; int flags; #define AMR_ID_PROBE_SIG (1<<0) /* generic i960RD, check signature */ #define AMR_ID_DO_SG64 (1<<1) @@ -143,6 +138,13 @@ static struct amr_ident {0x1028, 0x0013, AMR_ID_QUARTZ | AMR_ID_DO_SG64}, /* perc4/di */ {0, 0, 0} }; + +static devclass_t amr_devclass; +DRIVER_MODULE(amr, pci, amr_pci_driver, amr_devclass, 0, 0); +MODULE_PNP_INFO("U16:vendor;U16:device", pci, amr, amr_device_ids, + sizeof(amr_device_ids[0]), nitems(amr_device_ids) - 1); +MODULE_DEPEND(amr, pci, 1, 1, 1); +MODULE_DEPEND(amr, cam, 1, 1, 1); static struct amr_ident * amr_find_ident(device_t dev) From owner-svn-src-head@freebsd.org Wed Jun 13 20:25:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F2F81011400; Wed, 13 Jun 2018 20:25:34 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A991779054; Wed, 13 Jun 2018 20:25:33 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED0901E5EC; Wed, 13 Jun 2018 20:25:32 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DKPWKL050357; Wed, 13 Jun 2018 20:25:32 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DKPW41050356; Wed, 13 Jun 2018 20:25:32 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806132025.w5DKPW41050356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 13 Jun 2018 20:25:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335085 - head/sys/dev/age X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/age X-SVN-Commit-Revision: 335085 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 20:25:34 -0000 Author: imp Date: Wed Jun 13 20:25:32 2018 New Revision: 335085 URL: https://svnweb.freebsd.org/changeset/base/335085 Log: Add PNP info to PCI attachments of age driver Reviewed by: imp, chuck Submitted by: Lakhan Shiva Kamireddy Sponsored by: Google, Inc. (GSoC 2018) Modified: head/sys/dev/age/if_age.c Modified: head/sys/dev/age/if_age.c ============================================================================== --- head/sys/dev/age/if_age.c Wed Jun 13 20:25:27 2018 (r335084) +++ head/sys/dev/age/if_age.c Wed Jun 13 20:25:32 2018 (r335085) @@ -183,6 +183,8 @@ static driver_t age_driver = { static devclass_t age_devclass; DRIVER_MODULE(age, pci, age_driver, age_devclass, 0, 0); +MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, age, age_devs, + sizeof(age_devs[0]), nitems(age_devs)); DRIVER_MODULE(miibus, age, miibus_driver, miibus_devclass, 0, 0); static struct resource_spec age_res_spec_mem[] = { From owner-svn-src-head@freebsd.org Wed Jun 13 20:25:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B30D4101142D; Wed, 13 Jun 2018 20:25:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E5A3F7911C; Wed, 13 Jun 2018 20:25:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 85D8A1E5ED; Wed, 13 Jun 2018 20:25:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DKPbtg050411; Wed, 13 Jun 2018 20:25:37 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DKPbTV050410; Wed, 13 Jun 2018 20:25:37 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806132025.w5DKPbTV050410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 13 Jun 2018 20:25:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335086 - head/sys/dev/ae X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/ae X-SVN-Commit-Revision: 335086 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 20:25:38 -0000 Author: imp Date: Wed Jun 13 20:25:36 2018 New Revision: 335086 URL: https://svnweb.freebsd.org/changeset/base/335086 Log: Add PNP info to PCI attachment of ae driver Reviewed by: imp, chuck Submitted by: Lakhan Shiva Kamireddy Sponsored by: Google, Inc. (GSoC 2018) Modified: head/sys/dev/ae/if_ae.c Modified: head/sys/dev/ae/if_ae.c ============================================================================== --- head/sys/dev/ae/if_ae.c Wed Jun 13 20:25:32 2018 (r335085) +++ head/sys/dev/ae/if_ae.c Wed Jun 13 20:25:36 2018 (r335086) @@ -177,6 +177,8 @@ static driver_t ae_driver = { static devclass_t ae_devclass; DRIVER_MODULE(ae, pci, ae_driver, ae_devclass, 0, 0); +MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, ae, ae_devs, + sizeof(ae_devs[0]), nitems(ae_devs)); DRIVER_MODULE(miibus, ae, miibus_driver, miibus_devclass, 0, 0); MODULE_DEPEND(ae, pci, 1, 1, 1); MODULE_DEPEND(ae, ether, 1, 1, 1); From owner-svn-src-head@freebsd.org Wed Jun 13 21:10:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C33A1017692; Wed, 13 Jun 2018 21:10:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F3477C5AE; Wed, 13 Jun 2018 21:10:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 31D9A1EC70; Wed, 13 Jun 2018 21:10:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DLAOXC071519; Wed, 13 Jun 2018 21:10:24 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DLANi8071518; Wed, 13 Jun 2018 21:10:23 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201806132110.w5DLANi8071518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 13 Jun 2018 21:10:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335089 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 335089 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 21:10:24 -0000 Author: kib Date: Wed Jun 13 21:10:23 2018 New Revision: 335089 URL: https://svnweb.freebsd.org/changeset/base/335089 Log: Enable eager FPU context switch by default on i386 too, based on amd64 r335072. Security: CVE-2018-3665 Sponsored by: The FreeBSD Foundation Modified: head/sys/i386/i386/npx.c head/sys/i386/i386/swtch.s Modified: head/sys/i386/i386/npx.c ============================================================================== --- head/sys/i386/i386/npx.c Wed Jun 13 20:35:56 2018 (r335088) +++ head/sys/i386/i386/npx.c Wed Jun 13 21:10:23 2018 (r335089) @@ -191,6 +191,11 @@ int hw_float; SYSCTL_INT(_hw, HW_FLOATINGPT, floatingpoint, CTLFLAG_RD, &hw_float, 0, "Floating point instructions executed in hardware"); +int lazy_fpu_switch = 0; +SYSCTL_INT(_hw, OID_AUTO, lazy_fpu_switch, CTLFLAG_RWTUN | CTLFLAG_NOFETCH, + &lazy_fpu_switch, 0, + "Lazily load FPU context after context switch"); + int use_xsave; uint64_t xsave_mask; static uma_zone_t fpu_save_area_zone; @@ -319,6 +324,7 @@ npxinit_bsp1(void) u_int cp[4]; uint64_t xsave_mask_user; + TUNABLE_INT_FETCH("hw.lazy_fpu_switch", &lazy_fpu_switch); if (cpu_fxsr && (cpu_feature2 & CPUID2_XSAVE) != 0) { use_xsave = 1; TUNABLE_INT_FETCH("hw.use_xsave", &use_xsave); @@ -777,6 +783,42 @@ npxtrap_sse(void) return (fpetable[(mxcsr & (~mxcsr >> 7)) & 0x3f]); } +static void +restore_npx_curthread(struct thread *td, struct pcb *pcb) +{ + + /* + * Record new context early in case frstor causes a trap. + */ + PCPU_SET(fpcurthread, td); + + stop_emulating(); + if (cpu_fxsr) + fpu_clean_state(); + + if ((pcb->pcb_flags & PCB_NPXINITDONE) == 0) { + /* + * This is the first time this thread has used the FPU or + * the PCB doesn't contain a clean FPU state. Explicitly + * load an initial state. + * + * We prefer to restore the state from the actual save + * area in PCB instead of directly loading from + * npx_initialstate, to ignite the XSAVEOPT + * tracking engine. + */ + bcopy(npx_initialstate, pcb->pcb_save, cpu_max_ext_state_size); + fpurstor(pcb->pcb_save); + if (pcb->pcb_initial_npxcw != __INITIAL_NPXCW__) + fldcw(pcb->pcb_initial_npxcw); + pcb->pcb_flags |= PCB_NPXINITDONE; + if (PCB_USER_FPU(pcb)) + pcb->pcb_flags |= PCB_NPXUSERINITDONE; + } else { + fpurstor(pcb->pcb_save); + } +} + /* * Implement device not available (DNA) exception * @@ -790,11 +832,13 @@ static int err_count = 0; int npxdna(void) { + struct thread *td; if (!hw_float) return (0); + td = curthread; critical_enter(); - if (PCPU_GET(fpcurthread) == curthread) { + if (PCPU_GET(fpcurthread) == td) { printf("npxdna: fpcurthread == curthread %d times\n", ++err_count); stop_emulating(); @@ -805,39 +849,10 @@ npxdna(void) printf("npxdna: fpcurthread = %p (%d), curthread = %p (%d)\n", PCPU_GET(fpcurthread), PCPU_GET(fpcurthread)->td_proc->p_pid, - curthread, curthread->td_proc->p_pid); + td, td->td_proc->p_pid); panic("npxdna"); } - stop_emulating(); - /* - * Record new context early in case frstor causes a trap. - */ - PCPU_SET(fpcurthread, curthread); - - if (cpu_fxsr) - fpu_clean_state(); - - if ((curpcb->pcb_flags & PCB_NPXINITDONE) == 0) { - /* - * This is the first time this thread has used the FPU or - * the PCB doesn't contain a clean FPU state. Explicitly - * load an initial state. - * - * We prefer to restore the state from the actual save - * area in PCB instead of directly loading from - * npx_initialstate, to ignite the XSAVEOPT - * tracking engine. - */ - bcopy(npx_initialstate, curpcb->pcb_save, cpu_max_ext_state_size); - fpurstor(curpcb->pcb_save); - if (curpcb->pcb_initial_npxcw != __INITIAL_NPXCW__) - fldcw(curpcb->pcb_initial_npxcw); - curpcb->pcb_flags |= PCB_NPXINITDONE; - if (PCB_USER_FPU(curpcb)) - curpcb->pcb_flags |= PCB_NPXUSERINITDONE; - } else { - fpurstor(curpcb->pcb_save); - } + restore_npx_curthread(td, td->td_pcb); critical_exit(); return (1); @@ -861,8 +876,20 @@ npxsave(addr) xsaveopt((char *)addr, xsave_mask); else fpusave(addr); - start_emulating(); - PCPU_SET(fpcurthread, NULL); +} + +void npxswitch(struct thread *td, struct pcb *pcb); +void +npxswitch(struct thread *td, struct pcb *pcb) +{ + + if (lazy_fpu_switch || (td->td_pflags & TDP_KTHREAD) != 0 || + !PCB_USER_FPU(pcb)) { + start_emulating(); + PCPU_SET(fpcurthread, NULL); + } else if (PCPU_GET(fpcurthread) != td) { + restore_npx_curthread(td, pcb); + } } /* Modified: head/sys/i386/i386/swtch.s ============================================================================== --- head/sys/i386/i386/swtch.s Wed Jun 13 20:35:56 2018 (r335088) +++ head/sys/i386/i386/swtch.s Wed Jun 13 21:10:23 2018 (r335089) @@ -283,6 +283,12 @@ sw1: cpu_switch_load_gs: mov PCB_GS(%edx),%gs + pushl %edx + pushl PCPU(CURTHREAD) + call npxswitch + popl %edx + popl %edx + /* Test if debug registers should be restored. */ testl $PCB_DBREGS,PCB_FLAGS(%edx) jz 1f From owner-svn-src-head@freebsd.org Wed Jun 13 21:14:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1D751017E96; Wed, 13 Jun 2018 21:14:52 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mailout.stack.nl (mailout05.stack.nl [IPv6:2001:610:1108:5010::202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.stack.nl", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5CC857CC74; Wed, 13 Jun 2018 21:14:52 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from toad2.stack.nl (toad2.stack.nl [IPv6:2001:610:1108:5010::161]) by mailout.stack.nl (Postfix) with ESMTP id BDDC038; Wed, 13 Jun 2018 23:14:43 +0200 (CEST) Received: by toad2.stack.nl (Postfix, from userid 1677) id B429F892AA; Wed, 13 Jun 2018 23:14:43 +0200 (CEST) Date: Wed, 13 Jun 2018 23:14:43 +0200 From: Jilles Tjoelker To: Bruce Evans Cc: Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335041 - head/lib/libc/stdlib Message-ID: <20180613211443.GA57326@stack.nl> References: <201806130852.w5D8qH9a093758@repo.freebsd.org> <20180613194008.W2003@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180613194008.W2003@besplex.bde.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 21:14:53 -0000 On Wed, Jun 13, 2018 at 08:03:13PM +1000, Bruce Evans wrote: > On Wed, 13 Jun 2018, Eitan Adler wrote: > > Log: > > libc: remove explicit cast NULL in atoi > > There isn't any reason to cast NULL so just remove it. Noticed when > > cleaning up top. > There are many reasons to cast NULL for all members of the ato*() family: > - it is required if no prototype is in scope > - C99 specifies ato*() in terms of strtol*() and uses the cast to NULL, > probably because this is simplest. Omitting the cast is just wrong > if no prototype is in scope. Writing the explicit cast is simpler than > writing caveats that the stated equivalence is only valid if a prototype > is in scope. > - POSIX specifies ato*() in terms of strtol*() and uses the cast to NULL, > exactly as in C99, probably because it defers to the C standard and > doesn't and doesn't risk breaking it by changing its wording except when > extending it. These reasons can be summarized to a single reason: the cast is required if no prototype is in scope. I think it is unwise to call any function without a prototype in scope, since this runs a risk of undefined behaviour if you get the types wrong. For the code in libc, we ensure a prototype is in scope and no cast is required. For the code in the man page, I doubt we should allow for programmers that play tricks by declaring system functions manually using K&R-style declarations or (even worse) call functions without declaring them at all. Note that NULL may still need a cast when passed to a function with variable number of parameters. Ideally these types are also checked using attributes. > FreeBSD used to do the same here, and should do the same here and > elsewhere by copying better wording from POSIX whenever possible. For some reason, the FreeBSD text does not have the exception about error handling. This exception permits an implementation like musl's which calculates using int and hard-codes base 10, even if the compiler documents a cast from long to int as truncating bits. I don't think we should take advantage of this, though, since making atoi() faster than strtol() may encourage people to use atoi(). -- Jilles Tjoelker From owner-svn-src-head@freebsd.org Wed Jun 13 22:00:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 874A0101C046; Wed, 13 Jun 2018 22:00:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3C89E7E8AF; Wed, 13 Jun 2018 22:00:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D7E31F49A; Wed, 13 Jun 2018 22:00:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DM04Ic097198; Wed, 13 Jun 2018 22:00:04 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DM03bF097193; Wed, 13 Jun 2018 22:00:03 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806132200.w5DM03bF097193@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 13 Jun 2018 22:00:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335091 - head/sbin/nvmecontrol X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/nvmecontrol X-SVN-Commit-Revision: 335091 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 22:00:04 -0000 Author: imp Date: Wed Jun 13 22:00:02 2018 New Revision: 335091 URL: https://svnweb.freebsd.org/changeset/base/335091 Log: Make it possible to use print_controller from another program Rename print_controller to nvme_print_controller. Put it in its own file for easy inclusion. Move util.c to be nc_util.c to not conflict with camcontrol. add nvecontrol_ext.h to define shared interfaces. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D15371 Added: head/sbin/nvmecontrol/identify_ext.c - copied, changed from r335089, head/sbin/nvmecontrol/identify.c head/sbin/nvmecontrol/nc_util.c - copied, changed from r335089, head/sbin/nvmecontrol/util.c head/sbin/nvmecontrol/nvmecontrol_ext.h (contents, props changed) - copied, changed from r335089, head/sbin/nvmecontrol/util.c Deleted: head/sbin/nvmecontrol/util.c Modified: head/sbin/nvmecontrol/Makefile head/sbin/nvmecontrol/identify.c Modified: head/sbin/nvmecontrol/Makefile ============================================================================== --- head/sbin/nvmecontrol/Makefile Wed Jun 13 21:10:33 2018 (r335090) +++ head/sbin/nvmecontrol/Makefile Wed Jun 13 22:00:02 2018 (r335091) @@ -2,8 +2,8 @@ PACKAGE=runtime PROG= nvmecontrol -SRCS= nvmecontrol.c devlist.c firmware.c format.c identify.c logpage.c \ - perftest.c reset.c ns.c nvme_util.c power.c util.c wdc.c +SRCS= nvmecontrol.c devlist.c firmware.c format.c identify.c identify_ext.c logpage.c \ + perftest.c reset.c ns.c nvme_util.c power.c nc_util.c wdc.c MAN= nvmecontrol.8 .PATH: ${SRCTOP}/sys/dev/nvme Modified: head/sbin/nvmecontrol/identify.c ============================================================================== --- head/sbin/nvmecontrol/identify.c Wed Jun 13 21:10:33 2018 (r335090) +++ head/sbin/nvmecontrol/identify.c Wed Jun 13 22:00:02 2018 (r335091) @@ -41,187 +41,9 @@ __FBSDID("$FreeBSD$"); #include #include "nvmecontrol.h" +#include "nvmecontrol_ext.h" static void -print_controller(struct nvme_controller_data *cdata) -{ - uint8_t str[128]; - char cbuf[UINT128_DIG + 1]; - uint16_t oncs, oacs; - uint8_t compare, write_unc, dsm, vwc_present; - uint8_t security, fmt, fw, nsmgmt; - uint8_t fw_slot1_ro, fw_num_slots; - uint8_t ns_smart; - uint8_t sqes_max, sqes_min; - uint8_t cqes_max, cqes_min; - - oncs = cdata->oncs; - compare = (oncs >> NVME_CTRLR_DATA_ONCS_COMPARE_SHIFT) & - NVME_CTRLR_DATA_ONCS_COMPARE_MASK; - write_unc = (oncs >> NVME_CTRLR_DATA_ONCS_WRITE_UNC_SHIFT) & - NVME_CTRLR_DATA_ONCS_WRITE_UNC_MASK; - dsm = (oncs >> NVME_CTRLR_DATA_ONCS_DSM_SHIFT) & - NVME_CTRLR_DATA_ONCS_DSM_MASK; - vwc_present = (cdata->vwc >> NVME_CTRLR_DATA_VWC_PRESENT_SHIFT) & - NVME_CTRLR_DATA_VWC_PRESENT_MASK; - - oacs = cdata->oacs; - security = (oacs >> NVME_CTRLR_DATA_OACS_SECURITY_SHIFT) & - NVME_CTRLR_DATA_OACS_SECURITY_MASK; - fmt = (oacs >> NVME_CTRLR_DATA_OACS_FORMAT_SHIFT) & - NVME_CTRLR_DATA_OACS_FORMAT_MASK; - fw = (oacs >> NVME_CTRLR_DATA_OACS_FIRMWARE_SHIFT) & - NVME_CTRLR_DATA_OACS_FIRMWARE_MASK; - nsmgmt = (oacs >> NVME_CTRLR_DATA_OACS_NSMGMT_SHIFT) & - NVME_CTRLR_DATA_OACS_NSMGMT_MASK; - - fw_num_slots = (cdata->frmw >> NVME_CTRLR_DATA_FRMW_NUM_SLOTS_SHIFT) & - NVME_CTRLR_DATA_FRMW_NUM_SLOTS_MASK; - fw_slot1_ro = (cdata->frmw >> NVME_CTRLR_DATA_FRMW_SLOT1_RO_SHIFT) & - NVME_CTRLR_DATA_FRMW_SLOT1_RO_MASK; - - ns_smart = (cdata->lpa >> NVME_CTRLR_DATA_LPA_NS_SMART_SHIFT) & - NVME_CTRLR_DATA_LPA_NS_SMART_MASK; - - sqes_min = (cdata->sqes >> NVME_CTRLR_DATA_SQES_MIN_SHIFT) & - NVME_CTRLR_DATA_SQES_MIN_MASK; - sqes_max = (cdata->sqes >> NVME_CTRLR_DATA_SQES_MAX_SHIFT) & - NVME_CTRLR_DATA_SQES_MAX_MASK; - - cqes_min = (cdata->cqes >> NVME_CTRLR_DATA_CQES_MIN_SHIFT) & - NVME_CTRLR_DATA_CQES_MIN_MASK; - cqes_max = (cdata->cqes >> NVME_CTRLR_DATA_CQES_MAX_SHIFT) & - NVME_CTRLR_DATA_CQES_MAX_MASK; - - printf("Controller Capabilities/Features\n"); - printf("================================\n"); - printf("Vendor ID: %04x\n", cdata->vid); - printf("Subsystem Vendor ID: %04x\n", cdata->ssvid); - nvme_strvis(str, cdata->sn, sizeof(str), NVME_SERIAL_NUMBER_LENGTH); - printf("Serial Number: %s\n", str); - nvme_strvis(str, cdata->mn, sizeof(str), NVME_MODEL_NUMBER_LENGTH); - printf("Model Number: %s\n", str); - nvme_strvis(str, cdata->fr, sizeof(str), NVME_FIRMWARE_REVISION_LENGTH); - printf("Firmware Version: %s\n", str); - printf("Recommended Arb Burst: %d\n", cdata->rab); - printf("IEEE OUI Identifier: %02x %02x %02x\n", - cdata->ieee[0], cdata->ieee[1], cdata->ieee[2]); - printf("Multi-Path I/O Capabilities: %s%s%s%s\n", - (cdata->mic == 0) ? "Not Supported" : "", - ((cdata->mic >> NVME_CTRLR_DATA_MIC_SRIOVVF_SHIFT) & - NVME_CTRLR_DATA_MIC_SRIOVVF_MASK) ? "SR-IOV VF, " : "", - ((cdata->mic >> NVME_CTRLR_DATA_MIC_MCTRLRS_SHIFT) & - NVME_CTRLR_DATA_MIC_MCTRLRS_MASK) ? "Multiple controllers, " : "", - ((cdata->mic >> NVME_CTRLR_DATA_MIC_MPORTS_SHIFT) & - NVME_CTRLR_DATA_MIC_MPORTS_MASK) ? "Multiple ports" : ""); - /* TODO: Use CAP.MPSMIN to determine true memory page size. */ - printf("Max Data Transfer Size: "); - if (cdata->mdts == 0) - printf("Unlimited\n"); - else - printf("%ld\n", PAGE_SIZE * (1L << cdata->mdts)); - printf("Controller ID: 0x%02x\n", cdata->ctrlr_id); - printf("Version: %d.%d.%d\n", - (cdata->ver >> 16) & 0xffff, (cdata->ver >> 8) & 0xff, - cdata->ver & 0xff); - printf("\n"); - - printf("Admin Command Set Attributes\n"); - printf("============================\n"); - printf("Security Send/Receive: %s\n", - security ? "Supported" : "Not Supported"); - printf("Format NVM: %s\n", - fmt ? "Supported" : "Not Supported"); - printf("Firmware Activate/Download: %s\n", - fw ? "Supported" : "Not Supported"); - printf("Namespace Managment: %s\n", - nsmgmt ? "Supported" : "Not Supported"); - printf("Device Self-test: %sSupported\n", - ((oacs >> NVME_CTRLR_DATA_OACS_SELFTEST_SHIFT) & - NVME_CTRLR_DATA_OACS_SELFTEST_MASK) ? "" : "Not "); - printf("Directives: %sSupported\n", - ((oacs >> NVME_CTRLR_DATA_OACS_DIRECTIVES_SHIFT) & - NVME_CTRLR_DATA_OACS_DIRECTIVES_MASK) ? "" : "Not "); - printf("NVMe-MI Send/Receive: %sSupported\n", - ((oacs >> NVME_CTRLR_DATA_OACS_NVMEMI_SHIFT) & - NVME_CTRLR_DATA_OACS_NVMEMI_MASK) ? "" : "Not "); - printf("Virtualization Management: %sSupported\n", - ((oacs >> NVME_CTRLR_DATA_OACS_VM_SHIFT) & - NVME_CTRLR_DATA_OACS_VM_MASK) ? "" : "Not "); - printf("Doorbell Buffer Config %sSupported\n", - ((oacs >> NVME_CTRLR_DATA_OACS_DBBUFFER_SHIFT) & - NVME_CTRLR_DATA_OACS_DBBUFFER_MASK) ? "" : "Not "); - printf("Abort Command Limit: %d\n", cdata->acl+1); - printf("Async Event Request Limit: %d\n", cdata->aerl+1); - printf("Number of Firmware Slots: "); - if (fw != 0) - printf("%d\n", fw_num_slots); - else - printf("N/A\n"); - printf("Firmware Slot 1 Read-Only: "); - if (fw != 0) - printf("%s\n", fw_slot1_ro ? "Yes" : "No"); - else - printf("N/A\n"); - printf("Per-Namespace SMART Log: %s\n", - ns_smart ? "Yes" : "No"); - printf("Error Log Page Entries: %d\n", cdata->elpe+1); - printf("Number of Power States: %d\n", cdata->npss+1); - - printf("\n"); - printf("NVM Command Set Attributes\n"); - printf("==========================\n"); - printf("Submission Queue Entry Size\n"); - printf(" Max: %d\n", 1 << sqes_max); - printf(" Min: %d\n", 1 << sqes_min); - printf("Completion Queue Entry Size\n"); - printf(" Max: %d\n", 1 << cqes_max); - printf(" Min: %d\n", 1 << cqes_min); - printf("Number of Namespaces: %d\n", cdata->nn); - printf("Compare Command: %s\n", - compare ? "Supported" : "Not Supported"); - printf("Write Uncorrectable Command: %s\n", - write_unc ? "Supported" : "Not Supported"); - printf("Dataset Management Command: %s\n", - dsm ? "Supported" : "Not Supported"); - printf("Write Zeroes Command: %sSupported\n", - ((oncs >> NVME_CTRLR_DATA_ONCS_WRZERO_SHIFT) & - NVME_CTRLR_DATA_ONCS_WRZERO_MASK) ? "" : "Not "); - printf("Save Features: %sSupported\n", - ((oncs >> NVME_CTRLR_DATA_ONCS_SAVEFEAT_SHIFT) & - NVME_CTRLR_DATA_ONCS_SAVEFEAT_MASK) ? "" : "Not "); - printf("Reservations: %sSupported\n", - ((oncs >> NVME_CTRLR_DATA_ONCS_RESERV_SHIFT) & - NVME_CTRLR_DATA_ONCS_RESERV_MASK) ? "" : "Not "); - printf("Timestamp feature: %sSupported\n", - ((oncs >> NVME_CTRLR_DATA_ONCS_TIMESTAMP_SHIFT) & - NVME_CTRLR_DATA_ONCS_TIMESTAMP_MASK) ? "" : "Not "); - printf("Fused Operation Support: %s%s\n", - (cdata->fuses == 0) ? "Not Supported" : "", - ((cdata->fuses >> NVME_CTRLR_DATA_FUSES_CNW_SHIFT) & - NVME_CTRLR_DATA_FUSES_CNW_MASK) ? "Compare and Write" : ""); - printf("Format NVM Attributes: %s%s Erase, %s Format\n", - ((cdata->fna >> NVME_CTRLR_DATA_FNA_CRYPTO_ERASE_SHIFT) & - NVME_CTRLR_DATA_FNA_CRYPTO_ERASE_MASK) ? "Crypto Erase, " : "", - ((cdata->fna >> NVME_CTRLR_DATA_FNA_ERASE_ALL_SHIFT) & - NVME_CTRLR_DATA_FNA_ERASE_ALL_MASK) ? "All-NVM" : "Per-NS", - ((cdata->fna >> NVME_CTRLR_DATA_FNA_FORMAT_ALL_SHIFT) & - NVME_CTRLR_DATA_FNA_FORMAT_ALL_MASK) ? "All-NVM" : "Per-NS"); - printf("Volatile Write Cache: %s\n", - vwc_present ? "Present" : "Not Present"); - - if (nsmgmt) { - printf("\n"); - printf("Namespace Drive Attributes\n"); - printf("==========================\n"); - printf("NVM total cap: %s\n", - uint128_to_str(to128(cdata->untncap.tnvmcap), cbuf, sizeof(cbuf))); - printf("NVM unallocated cap: %s\n", - uint128_to_str(to128(cdata->untncap.unvmcap), cbuf, sizeof(cbuf))); - } -} - -static void print_namespace(struct nvme_namespace_data *nsdata) { uint32_t i; @@ -375,7 +197,7 @@ identify_ctrlr(int argc, char *argv[]) identify_usage(); } - print_controller(&cdata); + nvme_print_controller(&cdata); exit(0); } Copied and modified: head/sbin/nvmecontrol/identify_ext.c (from r335089, head/sbin/nvmecontrol/identify.c) ============================================================================== --- head/sbin/nvmecontrol/identify.c Wed Jun 13 21:10:23 2018 (r335089, copy source) +++ head/sbin/nvmecontrol/identify_ext.c Wed Jun 13 22:00:02 2018 (r335091) @@ -41,9 +41,10 @@ __FBSDID("$FreeBSD$"); #include #include "nvmecontrol.h" +#include "nvmecontrol_ext.h" -static void -print_controller(struct nvme_controller_data *cdata) +void +nvme_print_controller(struct nvme_controller_data *cdata) { uint8_t str[128]; char cbuf[UINT128_DIG + 1]; @@ -219,255 +220,4 @@ print_controller(struct nvme_controller_data *cdata) printf("NVM unallocated cap: %s\n", uint128_to_str(to128(cdata->untncap.unvmcap), cbuf, sizeof(cbuf))); } -} - -static void -print_namespace(struct nvme_namespace_data *nsdata) -{ - uint32_t i; - uint32_t lbaf, lbads, ms, rp; - uint8_t thin_prov, ptype; - uint8_t flbas_fmt; - - thin_prov = (nsdata->nsfeat >> NVME_NS_DATA_NSFEAT_THIN_PROV_SHIFT) & - NVME_NS_DATA_NSFEAT_THIN_PROV_MASK; - - flbas_fmt = (nsdata->flbas >> NVME_NS_DATA_FLBAS_FORMAT_SHIFT) & - NVME_NS_DATA_FLBAS_FORMAT_MASK; - - printf("Size (in LBAs): %lld (%lldM)\n", - (long long)nsdata->nsze, - (long long)nsdata->nsze / 1024 / 1024); - printf("Capacity (in LBAs): %lld (%lldM)\n", - (long long)nsdata->ncap, - (long long)nsdata->ncap / 1024 / 1024); - printf("Utilization (in LBAs): %lld (%lldM)\n", - (long long)nsdata->nuse, - (long long)nsdata->nuse / 1024 / 1024); - printf("Thin Provisioning: %s\n", - thin_prov ? "Supported" : "Not Supported"); - printf("Number of LBA Formats: %d\n", nsdata->nlbaf+1); - printf("Current LBA Format: LBA Format #%02d\n", flbas_fmt); - printf("Data Protection Caps: %s%s%s%s%s%s\n", - (nsdata->dpc == 0) ? "Not Supported" : "", - ((nsdata->dpc >> NVME_NS_DATA_DPC_MD_END_SHIFT) & - NVME_NS_DATA_DPC_MD_END_MASK) ? "Last Bytes, " : "", - ((nsdata->dpc >> NVME_NS_DATA_DPC_MD_START_SHIFT) & - NVME_NS_DATA_DPC_MD_START_MASK) ? "First Bytes, " : "", - ((nsdata->dpc >> NVME_NS_DATA_DPC_PIT3_SHIFT) & - NVME_NS_DATA_DPC_PIT3_MASK) ? "Type 3, " : "", - ((nsdata->dpc >> NVME_NS_DATA_DPC_PIT2_SHIFT) & - NVME_NS_DATA_DPC_PIT2_MASK) ? "Type 2, " : "", - ((nsdata->dpc >> NVME_NS_DATA_DPC_PIT2_MASK) & - NVME_NS_DATA_DPC_PIT1_MASK) ? "Type 1" : ""); - printf("Data Protection Settings: "); - ptype = (nsdata->dps >> NVME_NS_DATA_DPS_PIT_SHIFT) & - NVME_NS_DATA_DPS_PIT_MASK; - if (ptype) { - printf("Type %d, %s Bytes\n", ptype, - ((nsdata->dps >> NVME_NS_DATA_DPS_MD_START_SHIFT) & - NVME_NS_DATA_DPS_MD_START_MASK) ? "First" : "Last"); - } else { - printf("Not Enabled\n"); - } - printf("Multi-Path I/O Capabilities: %s%s\n", - (nsdata->nmic == 0) ? "Not Supported" : "", - ((nsdata->nmic >> NVME_NS_DATA_NMIC_MAY_BE_SHARED_SHIFT) & - NVME_NS_DATA_NMIC_MAY_BE_SHARED_MASK) ? "May be shared" : ""); - printf("Reservation Capabilities: %s%s%s%s%s%s%s%s%s\n", - (nsdata->rescap == 0) ? "Not Supported" : "", - ((nsdata->rescap >> NVME_NS_DATA_RESCAP_IEKEY13_SHIFT) & - NVME_NS_DATA_RESCAP_IEKEY13_MASK) ? "IEKEY13, " : "", - ((nsdata->rescap >> NVME_NS_DATA_RESCAP_EX_AC_AR_SHIFT) & - NVME_NS_DATA_RESCAP_EX_AC_AR_MASK) ? "EX_AC_AR, " : "", - ((nsdata->rescap >> NVME_NS_DATA_RESCAP_WR_EX_AR_SHIFT) & - NVME_NS_DATA_RESCAP_WR_EX_AR_MASK) ? "WR_EX_AR, " : "", - ((nsdata->rescap >> NVME_NS_DATA_RESCAP_EX_AC_RO_SHIFT) & - NVME_NS_DATA_RESCAP_EX_AC_RO_MASK) ? "EX_AC_RO, " : "", - ((nsdata->rescap >> NVME_NS_DATA_RESCAP_WR_EX_RO_SHIFT) & - NVME_NS_DATA_RESCAP_WR_EX_RO_MASK) ? "WR_EX_RO, " : "", - ((nsdata->rescap >> NVME_NS_DATA_RESCAP_EX_AC_SHIFT) & - NVME_NS_DATA_RESCAP_EX_AC_MASK) ? "EX_AC, " : "", - ((nsdata->rescap >> NVME_NS_DATA_RESCAP_WR_EX_SHIFT) & - NVME_NS_DATA_RESCAP_WR_EX_MASK) ? "WR_EX, " : "", - ((nsdata->rescap >> NVME_NS_DATA_RESCAP_PTPL_SHIFT) & - NVME_NS_DATA_RESCAP_PTPL_MASK) ? "PTPL" : ""); - printf("Format Progress Indicator: "); - if ((nsdata->fpi >> NVME_NS_DATA_FPI_SUPP_SHIFT) & - NVME_NS_DATA_FPI_SUPP_MASK) { - printf("%u%% remains\n", - (nsdata->fpi >> NVME_NS_DATA_FPI_PERC_SHIFT) & - NVME_NS_DATA_FPI_PERC_MASK); - } else - printf("Not Supported\n"); - printf("Optimal I/O Boundary (LBAs): %u\n", nsdata->noiob); - printf("Globally Unique Identifier: "); - for (i = 0; i < sizeof(nsdata->nguid); i++) - printf("%02x", nsdata->nguid[i]); - printf("\n"); - printf("IEEE EUI64: "); - for (i = 0; i < sizeof(nsdata->eui64); i++) - printf("%02x", nsdata->eui64[i]); - printf("\n"); - for (i = 0; i <= nsdata->nlbaf; i++) { - lbaf = nsdata->lbaf[i]; - lbads = (lbaf >> NVME_NS_DATA_LBAF_LBADS_SHIFT) & - NVME_NS_DATA_LBAF_LBADS_MASK; - ms = (lbaf >> NVME_NS_DATA_LBAF_MS_SHIFT) & - NVME_NS_DATA_LBAF_MS_MASK; - rp = (lbaf >> NVME_NS_DATA_LBAF_RP_SHIFT) & - NVME_NS_DATA_LBAF_RP_MASK; - printf("LBA Format #%02d: Data Size: %5d Metadata Size: %5d" - " Performance: %s\n", - i, 1 << lbads, ms, (rp == 0) ? "Best" : - (rp == 1) ? "Better" : (rp == 2) ? "Good" : "Degraded"); - } -} - -static void -identify_usage(void) -{ - fprintf(stderr, "usage:\n"); - fprintf(stderr, IDENTIFY_USAGE); - exit(1); -} - -static void -identify_ctrlr(int argc, char *argv[]) -{ - struct nvme_controller_data cdata; - int ch, fd, hexflag = 0, hexlength; - int verboseflag = 0; - - while ((ch = getopt(argc, argv, "vx")) != -1) { - switch ((char)ch) { - case 'v': - verboseflag = 1; - break; - case 'x': - hexflag = 1; - break; - default: - identify_usage(); - } - } - - /* Check that a controller was specified. */ - if (optind >= argc) - identify_usage(); - - open_dev(argv[optind], &fd, 1, 1); - read_controller_data(fd, &cdata); - close(fd); - - if (hexflag == 1) { - if (verboseflag == 1) - hexlength = sizeof(struct nvme_controller_data); - else - hexlength = offsetof(struct nvme_controller_data, - reserved8); - print_hex(&cdata, hexlength); - exit(0); - } - - if (verboseflag == 1) { - fprintf(stderr, "-v not currently supported without -x\n"); - identify_usage(); - } - - print_controller(&cdata); - exit(0); -} - -static void -identify_ns(int argc, char *argv[]) -{ - struct nvme_namespace_data nsdata; - char path[64]; - int ch, fd, hexflag = 0, hexlength; - int verboseflag = 0; - uint32_t nsid; - - while ((ch = getopt(argc, argv, "vx")) != -1) { - switch ((char)ch) { - case 'v': - verboseflag = 1; - break; - case 'x': - hexflag = 1; - break; - default: - identify_usage(); - } - } - - /* Check that a namespace was specified. */ - if (optind >= argc) - identify_usage(); - - /* - * Check if the specified device node exists before continuing. - * This is a cleaner check for cases where the correct controller - * is specified, but an invalid namespace on that controller. - */ - open_dev(argv[optind], &fd, 1, 1); - close(fd); - - /* - * We send IDENTIFY commands to the controller, not the namespace, - * since it is an admin cmd. The namespace ID will be specified in - * the IDENTIFY command itself. So parse the namespace's device node - * string to get the controller substring and namespace ID. - */ - parse_ns_str(argv[optind], path, &nsid); - open_dev(path, &fd, 1, 1); - read_namespace_data(fd, nsid, &nsdata); - close(fd); - - if (hexflag == 1) { - if (verboseflag == 1) - hexlength = sizeof(struct nvme_namespace_data); - else - hexlength = offsetof(struct nvme_namespace_data, - reserved6); - print_hex(&nsdata, hexlength); - exit(0); - } - - if (verboseflag == 1) { - fprintf(stderr, "-v not currently supported without -x\n"); - identify_usage(); - } - - print_namespace(&nsdata); - exit(0); -} - -void -identify(int argc, char *argv[]) -{ - char *target; - - if (argc < 2) - identify_usage(); - - while (getopt(argc, argv, "vx") != -1) ; - - /* Check that a controller or namespace was specified. */ - if (optind >= argc) - identify_usage(); - - target = argv[optind]; - - optreset = 1; - optind = 1; - - /* - * If device node contains "ns", we consider it a namespace, - * otherwise, consider it a controller. - */ - if (strstr(target, NVME_NS_PREFIX) == NULL) - identify_ctrlr(argc, argv); - else - identify_ns(argc, argv); } Copied and modified: head/sbin/nvmecontrol/nc_util.c (from r335089, head/sbin/nvmecontrol/util.c) ============================================================================== Copied and modified: head/sbin/nvmecontrol/nvmecontrol_ext.h (from r335089, head/sbin/nvmecontrol/util.c) ============================================================================== --- head/sbin/nvmecontrol/util.c Wed Jun 13 21:10:23 2018 (r335089, copy source) +++ head/sbin/nvmecontrol/nvmecontrol_ext.h Wed Jun 13 22:00:02 2018 (r335091) @@ -1,7 +1,8 @@ /*- - * Copyright (c) 2017 Netflix, Inc - * All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * + * Copyright (C) 2018 Netflix + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -22,38 +23,8 @@ * 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$ */ -#include -__FBSDID("$FreeBSD$"); - -#include -#include "nvmecontrol.h" - -char * -uint128_to_str(uint128_t u, char *buf, size_t buflen) -{ - char *end = buf + buflen - 1; - - *end-- = '\0'; - if (u == 0) - *end-- = '0'; - while (u && end >= buf) { - *end-- = u % 10 + '0'; - u /= 10; - } - end++; - if (u != 0) - return NULL; - - return end; -} - -/* "Missing" from endian.h */ -uint64_t -le48dec(const void *pp) -{ - uint8_t const *p = (uint8_t const *)pp; - - return (((uint64_t)le16dec(p + 4) << 32) | le32dec(p)); -} +void nvme_print_controller(struct nvme_controller_data *cdata); From owner-svn-src-head@freebsd.org Wed Jun 13 22:00:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7291101C099; Wed, 13 Jun 2018 22:00:10 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF6267E923; Wed, 13 Jun 2018 22:00:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5AD971F49B; Wed, 13 Jun 2018 22:00:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DM096O097257; Wed, 13 Jun 2018 22:00:09 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DM08iB097255; Wed, 13 Jun 2018 22:00:08 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806132200.w5DM08iB097255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 13 Jun 2018 22:00:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335092 - head/sbin/camcontrol X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/camcontrol X-SVN-Commit-Revision: 335092 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 22:00:11 -0000 Author: imp Date: Wed Jun 13 22:00:08 2018 New Revision: 335092 URL: https://svnweb.freebsd.org/changeset/base/335092 Log: Make camcontrol identify work with nda devices Both ATA and NVME have an identify command. They are completely different, but to the user they are the same. Leverage nvmecontrol's print_controller code to provide that functionality to camcontrol identify. Query the path to see what kind of protocol it supports, and send the most appropriate command down. Refactor nvme_print_dev a little to make it easy to get the nvme cdata. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D15371 Modified: head/sbin/camcontrol/Makefile head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/Makefile ============================================================================== --- head/sbin/camcontrol/Makefile Wed Jun 13 22:00:02 2018 (r335091) +++ head/sbin/camcontrol/Makefile Wed Jun 13 22:00:08 2018 (r335092) @@ -8,6 +8,11 @@ SRCS+= attrib.c epc.c fwdownload.c modeedit.c persist. .else CFLAGS+= -DMINIMALISTIC .endif +.PATH: ${SRCTOP}/sbin/nvmecontrol +CFLAGS+= -I${SRCTOP}/sbin/nvmecontrol +SRCS+= identify_ext.c nc_util.c +.PATH: ${SRCTOP}/sys/dev/nvme +SRCS+= nvme_util.c # This is verboten .if ${MACHINE_CPUARCH} == "arm" WARNS?= 3 Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Wed Jun 13 22:00:02 2018 (r335091) +++ head/sbin/camcontrol/camcontrol.c Wed Jun 13 22:00:08 2018 (r335092) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include "camcontrol.h" +#include "nvmecontrol_ext.h" typedef enum { CAM_CMD_NONE = 0x00000000, @@ -763,21 +764,11 @@ print_dev_mmcsd(struct device_match_result *dev_result } static int -print_dev_nvme(struct device_match_result *dev_result, char *tmpstr) +nvme_get_cdata(struct cam_device *dev, struct nvme_controller_data *cdata) { union ccb *ccb; struct ccb_dev_advinfo *advi; - struct cam_device *dev; - struct nvme_controller_data cdata; - char vendor[64], product[64]; - dev = cam_open_btl(dev_result->path_id, dev_result->target_id, - dev_result->target_lun, O_RDWR, NULL); - if (dev == NULL) { - warnx("%s", cam_errbuf); - return (1); - } - ccb = cam_getccb(dev); if (ccb == NULL) { warnx("couldn't allocate CCB"); @@ -791,7 +782,7 @@ print_dev_nvme(struct device_match_result *dev_result, advi->flags = CDAI_FLAG_NONE; advi->buftype = CDAI_TYPE_NVME_CNTRL; advi->bufsiz = sizeof(struct nvme_controller_data); - advi->buf = (uint8_t *)&cdata; + advi->buf = (uint8_t *)cdata; if (cam_send_ccb(dev, ccb) < 0) { warn("error sending CAMIOCOMMAND ioctl"); @@ -805,11 +796,31 @@ print_dev_nvme(struct device_match_result *dev_result, cam_close_device(dev); return(1); } + cam_freeccb(ccb); + return 0; +} + +static int +print_dev_nvme(struct device_match_result *dev_result, char *tmpstr) +{ + struct cam_device *dev; + struct nvme_controller_data cdata; + char vendor[64], product[64]; + + dev = cam_open_btl(dev_result->path_id, dev_result->target_id, + dev_result->target_lun, O_RDWR, NULL); + if (dev == NULL) { + warnx("%s", cam_errbuf); + return (1); + } + + if (nvme_get_cdata(dev, &cdata)) + return (1); + cam_strvis(vendor, cdata.mn, sizeof(cdata.mn), sizeof(vendor)); cam_strvis(product, cdata.fr, sizeof(cdata.fr), sizeof(product)); sprintf(tmpstr, "<%s %s>", vendor, product); - cam_freeccb(ccb); cam_close_device(dev); return (0); } @@ -2390,6 +2401,34 @@ ataidentify(struct cam_device *device, int retry_count return (0); } + +static int +nvmeidentify(struct cam_device *device, int retry_count __unused, int timeout __unused) +{ + struct nvme_controller_data cdata; + + if (nvme_get_cdata(device, &cdata)) + return (1); + nvme_print_controller(&cdata); + + return (0); +} + +static int +identify(struct cam_device *device, int retry_count, int timeout) +{ + struct ccb_pathinq cpi; + + if (get_cpi(device, &cpi) != 0) { + warnx("couldn't get CPI"); + return (-1); + } + + if (cpi.protocol == PROTO_NVME) { + return (nvmeidentify(device, retry_count, timeout)); + } + return (ataidentify(device, retry_count, timeout)); +} #endif /* MINIMALISTIC */ @@ -10058,7 +10097,7 @@ main(int argc, char **argv) task_attr, retry_count, timeout); break; case CAM_CMD_IDENTIFY: - error = ataidentify(cam_dev, retry_count, timeout); + error = identify(cam_dev, retry_count, timeout); break; case CAM_CMD_STARTSTOP: error = scsistart(cam_dev, arglist & CAM_ARG_START_UNIT, From owner-svn-src-head@freebsd.org Wed Jun 13 23:19:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08EA01022BCD; Wed, 13 Jun 2018 23:19:56 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AD8DC819BD; Wed, 13 Jun 2018 23:19:55 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 82947201AA; Wed, 13 Jun 2018 23:19:55 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DNJtdM038087; Wed, 13 Jun 2018 23:19:55 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DNJsrg038084; Wed, 13 Jun 2018 23:19:54 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806132319.w5DNJsrg038084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Wed, 13 Jun 2018 23:19:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335093 - in head/sys: netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys: netinet netinet6 X-SVN-Commit-Revision: 335093 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 23:19:56 -0000 Author: mmacy Date: Wed Jun 13 23:19:54 2018 New Revision: 335093 URL: https://svnweb.freebsd.org/changeset/base/335093 Log: Fix PCBGROUPS build post CK conversion of pcbinfo Modified: head/sys/netinet/in_pcb.c head/sys/netinet/in_pcb.h head/sys/netinet/in_pcbgroup.c head/sys/netinet6/in6_pcb.c Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Wed Jun 13 22:00:08 2018 (r335092) +++ head/sys/netinet/in_pcb.c Wed Jun 13 23:19:54 2018 (r335093) @@ -2025,7 +2025,7 @@ in_pcblookup_group(struct inpcbinfo *pcbinfo, struct i INP_GROUP_LOCK(pcbgroup); head = &pcbgroup->ipg_hashbase[INP_PCBHASH(faddr.s_addr, lport, fport, pcbgroup->ipg_hashmask)]; - LIST_FOREACH(inp, head, inp_pcbgrouphash) { + CK_LIST_FOREACH(inp, head, inp_pcbgrouphash) { #ifdef INET6 /* XXX inp locking */ if ((inp->inp_vflag & INP_IPV4) == 0) @@ -2075,7 +2075,7 @@ in_pcblookup_group(struct inpcbinfo *pcbinfo, struct i head = &pcbgroup->ipg_hashbase[INP_PCBHASH(INADDR_ANY, lport, 0, pcbgroup->ipg_hashmask)]; - LIST_FOREACH(inp, head, inp_pcbgrouphash) { + CK_LIST_FOREACH(inp, head, inp_pcbgrouphash) { #ifdef INET6 /* XXX inp locking */ if ((inp->inp_vflag & INP_IPV4) == 0) @@ -2149,7 +2149,7 @@ in_pcblookup_group(struct inpcbinfo *pcbinfo, struct i */ head = &pcbinfo->ipi_wildbase[INP_PCBHASH(INADDR_ANY, lport, 0, pcbinfo->ipi_wildmask)]; - LIST_FOREACH(inp, head, inp_pcbgroup_wild) { + CK_LIST_FOREACH(inp, head, inp_pcbgroup_wild) { #ifdef INET6 /* XXX inp locking */ if ((inp->inp_vflag & INP_IPV4) == 0) Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Wed Jun 13 22:00:08 2018 (r335092) +++ head/sys/netinet/in_pcb.h Wed Jun 13 23:19:54 2018 (r335093) @@ -276,7 +276,7 @@ struct inpcb { TAILQ_ENTRY(inpcb) inp_input; /* pacing in queue next lock(b) */ struct inpcbinfo *inp_pcbinfo; /* (c) PCB list info */ struct inpcbgroup *inp_pcbgroup; /* (g/i) PCB group list */ - LIST_ENTRY(inpcb) inp_pcbgroup_wild; /* (g/i/h) group wildcard entry */ + CK_LIST_ENTRY(inpcb) inp_pcbgroup_wild; /* (g/i/h) group wildcard entry */ struct ucred *inp_cred; /* (c) cache of socket cred */ u_int32_t inp_flow; /* (i) IPv6 flow information */ u_char inp_vflag; /* (i) IP version flag (v4/v6) */ Modified: head/sys/netinet/in_pcbgroup.c ============================================================================== --- head/sys/netinet/in_pcbgroup.c Wed Jun 13 22:00:08 2018 (r335092) +++ head/sys/netinet/in_pcbgroup.c Wed Jun 13 23:19:54 2018 (r335093) @@ -207,7 +207,7 @@ in_pcbgroup_destroy(struct inpcbinfo *pcbinfo) for (pgn = 0; pgn < pcbinfo->ipi_npcbgroups; pgn++) { pcbgroup = &pcbinfo->ipi_pcbgroups[pgn]; - KASSERT(LIST_EMPTY(pcbinfo->ipi_listhead), + KASSERT(CK_LIST_EMPTY(pcbinfo->ipi_listhead), ("in_pcbinfo_destroy: listhead not empty")); INP_GROUP_LOCK_DESTROY(pcbgroup); hashdestroy(pcbgroup->ipg_hashbase, M_PCB, @@ -338,7 +338,7 @@ in_pcbwild_add(struct inpcb *inp) INP_GROUP_LOCK(&pcbinfo->ipi_pcbgroups[pgn]); head = &pcbinfo->ipi_wildbase[INP_PCBHASH(INADDR_ANY, inp->inp_lport, 0, pcbinfo->ipi_wildmask)]; - LIST_INSERT_HEAD(head, inp, inp_pcbgroup_wild); + CK_LIST_INSERT_HEAD(head, inp, inp_pcbgroup_wild); inp->inp_flags2 |= INP_PCBGROUPWILD; for (pgn = 0; pgn < pcbinfo->ipi_npcbgroups; pgn++) INP_GROUP_UNLOCK(&pcbinfo->ipi_pcbgroups[pgn]); @@ -357,7 +357,7 @@ in_pcbwild_remove(struct inpcb *inp) pcbinfo = inp->inp_pcbinfo; for (pgn = 0; pgn < pcbinfo->ipi_npcbgroups; pgn++) INP_GROUP_LOCK(&pcbinfo->ipi_pcbgroups[pgn]); - LIST_REMOVE(inp, inp_pcbgroup_wild); + CK_LIST_REMOVE(inp, inp_pcbgroup_wild); for (pgn = 0; pgn < pcbinfo->ipi_npcbgroups; pgn++) INP_GROUP_UNLOCK(&pcbinfo->ipi_pcbgroups[pgn]); inp->inp_flags2 &= ~INP_PCBGROUPWILD; @@ -415,7 +415,7 @@ in_pcbgroup_update_internal(struct inpcbinfo *pcbinfo, oldpcbgroup = inp->inp_pcbgroup; if (oldpcbgroup != NULL && oldpcbgroup != newpcbgroup) { INP_GROUP_LOCK(oldpcbgroup); - LIST_REMOVE(inp, inp_pcbgrouphash); + CK_LIST_REMOVE(inp, inp_pcbgrouphash); inp->inp_pcbgroup = NULL; INP_GROUP_UNLOCK(oldpcbgroup); } @@ -445,7 +445,7 @@ in_pcbgroup_update_internal(struct inpcbinfo *pcbinfo, inp->inp_fport, newpcbgroup->ipg_hashmask)]; } - LIST_INSERT_HEAD(pcbhash, inp, inp_pcbgrouphash); + CK_LIST_INSERT_HEAD(pcbhash, inp, inp_pcbgrouphash); inp->inp_pcbgroup = newpcbgroup; INP_GROUP_UNLOCK(newpcbgroup); } @@ -548,7 +548,7 @@ in_pcbgroup_remove(struct inpcb *inp) pcbgroup = inp->inp_pcbgroup; if (pcbgroup != NULL) { INP_GROUP_LOCK(pcbgroup); - LIST_REMOVE(inp, inp_pcbgrouphash); + CK_LIST_REMOVE(inp, inp_pcbgrouphash); inp->inp_pcbgroup = NULL; INP_GROUP_UNLOCK(pcbgroup); } Modified: head/sys/netinet6/in6_pcb.c ============================================================================== --- head/sys/netinet6/in6_pcb.c Wed Jun 13 22:00:08 2018 (r335092) +++ head/sys/netinet6/in6_pcb.c Wed Jun 13 23:19:54 2018 (r335093) @@ -946,7 +946,7 @@ in6_pcblookup_group(struct inpcbinfo *pcbinfo, struct INP_GROUP_LOCK(pcbgroup); head = &pcbgroup->ipg_hashbase[INP_PCBHASH( INP6_PCBHASHKEY(faddr), lport, fport, pcbgroup->ipg_hashmask)]; - LIST_FOREACH(inp, head, inp_pcbgrouphash) { + CK_LIST_FOREACH(inp, head, inp_pcbgrouphash) { /* XXX inp locking */ if ((inp->inp_vflag & INP_IPV6) == 0) continue; @@ -987,7 +987,7 @@ in6_pcblookup_group(struct inpcbinfo *pcbinfo, struct */ head = &pcbgroup->ipg_hashbase[ INP_PCBHASH(INADDR_ANY, lport, 0, pcbgroup->ipg_hashmask)]; - LIST_FOREACH(inp, head, inp_pcbgrouphash) { + CK_LIST_FOREACH(inp, head, inp_pcbgrouphash) { /* XXX inp locking */ if ((inp->inp_vflag & INP_IPV6) == 0) continue; @@ -1049,7 +1049,7 @@ in6_pcblookup_group(struct inpcbinfo *pcbinfo, struct head = &pcbinfo->ipi_wildbase[INP_PCBHASH( INP6_PCBHASHKEY(&in6addr_any), lport, 0, pcbinfo->ipi_wildmask)]; - LIST_FOREACH(inp, head, inp_pcbgroup_wild) { + CK_LIST_FOREACH(inp, head, inp_pcbgroup_wild) { /* XXX inp locking */ if ((inp->inp_vflag & INP_IPV6) == 0) continue; From owner-svn-src-head@freebsd.org Wed Jun 13 23:30:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 253731000B9E; Wed, 13 Jun 2018 23:30:55 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CB0AE8223D; Wed, 13 Jun 2018 23:30:54 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ACC6020350; Wed, 13 Jun 2018 23:30:54 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5DNUsjC043574; Wed, 13 Jun 2018 23:30:54 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5DNUsrE043573; Wed, 13 Jun 2018 23:30:54 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806132330.w5DNUsrE043573@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Wed, 13 Jun 2018 23:30:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335094 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/ofed/drivers/infiniband/core X-SVN-Commit-Revision: 335094 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 23:30:55 -0000 Author: mmacy Date: Wed Jun 13 23:30:54 2018 New Revision: 335094 URL: https://svnweb.freebsd.org/changeset/base/335094 Log: fix OFED build after r335053 Modified: head/sys/ofed/drivers/infiniband/core/ib_user_mad.c Modified: head/sys/ofed/drivers/infiniband/core/ib_user_mad.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_user_mad.c Wed Jun 13 23:19:54 2018 (r335093) +++ head/sys/ofed/drivers/infiniband/core/ib_user_mad.c Wed Jun 13 23:30:54 2018 (r335094) @@ -130,7 +130,8 @@ struct ib_umad_packet { static struct class *umad_class; -static const dev_t base_dev = MKDEV(IB_UMAD_MAJOR, IB_UMAD_MINOR_BASE); +#define IBMKDEV(x, y) (((dev_t)(x) << 32) | (unsigned)(y)) +static const dev_t base_dev = IBMKDEV(IB_UMAD_MAJOR, IB_UMAD_MINOR_BASE); static DEFINE_SPINLOCK(port_lock); static DECLARE_BITMAP(dev_map, IB_UMAD_MAX_PORTS); From owner-svn-src-head@freebsd.org Wed Jun 13 23:47:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6241B10027A9; Wed, 13 Jun 2018 23:47:38 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: from mail-pf0-f180.google.com (mail-pf0-f180.google.com [209.85.192.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E041182F71; Wed, 13 Jun 2018 23:47:37 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: by mail-pf0-f180.google.com with SMTP id b17-v6so2242178pfi.0; Wed, 13 Jun 2018 16:47:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=l0VC7Yr+YiaraIxvBviIHf/TrOT8qaTLhZ48eneLQBA=; b=VWxqlTJoUbbZHWaBAyEUvT00Q5tWi8BypuLHE49xWxcjJCmDng198+hQaX0PWdv8It G/R0Yi6JMdR1E6U5BNbGMxdyG4WzvF0rtF36HC6oAYzaPNu3PMMNtoSx4SACGxSXh/9P UYRVN5Yi2TcsrHC9QO5k1ceKMt1HV42iCYZsq+glvEM7hh/+xU9DAUDhBQSO4c4FRsf4 ZrMswapJv+IzwEitfK0tLWxGWxvSL9TX7rgd8+k4BHpMqkAyJ0cZy7jTVao3N3eVg0Lp 3ztWuLsBm6tCAHjbbG0/T5KPdk09Xk/huLwm3JSPM7EjqVN0AYChbmdZbb0L40FRCds1 bVrQ== X-Gm-Message-State: APt69E27kKmrfSQ4D8PsN+6ZjkteQ/VRmpEir5OXUn9oPLqB9YivocQF nSSwFofontLqhwtbZsTxNbVBs0D4W+Y= X-Google-Smtp-Source: ADUXVKLT9zx1yqhkj5OdiQkXU4OPfmIVK2BSOfJNLiPPUmuW6A6yM/8JqlOmK9uK1mfjE/pgoEpybA== X-Received: by 2002:a63:2dc2:: with SMTP id t185-v6mr234503pgt.204.1528933651032; Wed, 13 Jun 2018 16:47:31 -0700 (PDT) Received: from mail-pf0-f171.google.com (mail-pf0-f171.google.com. [209.85.192.171]) by smtp.gmail.com with ESMTPSA id n22-v6sm4376145pgv.60.2018.06.13.16.47.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Jun 2018 16:47:30 -0700 (PDT) Received: by mail-pf0-f171.google.com with SMTP id r11-v6so2233125pfl.6; Wed, 13 Jun 2018 16:47:30 -0700 (PDT) X-Received: by 2002:a63:6ecb:: with SMTP id j194-v6mr237827pgc.158.1528933650582; Wed, 13 Jun 2018 16:47:30 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a17:90a:1581:0:0:0:0 with HTTP; Wed, 13 Jun 2018 16:47:30 -0700 (PDT) In-Reply-To: <201806132330.w5DNUsrE043573@repo.freebsd.org> References: <201806132330.w5DNUsrE043573@repo.freebsd.org> From: Ryan Libby Date: Wed, 13 Jun 2018 16:47:30 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335094 - head/sys/ofed/drivers/infiniband/core To: Matt Macy Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, bde@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 23:47:38 -0000 On Wed, Jun 13, 2018 at 4:30 PM, Matt Macy wrote: > Author: mmacy > Date: Wed Jun 13 23:30:54 2018 > New Revision: 335094 > URL: https://svnweb.freebsd.org/changeset/base/335094 > > Log: > fix OFED build after r335053 > > Modified: > head/sys/ofed/drivers/infiniband/core/ib_user_mad.c > > Modified: head/sys/ofed/drivers/infiniband/core/ib_user_mad.c > ============================================================================== > --- head/sys/ofed/drivers/infiniband/core/ib_user_mad.c Wed Jun 13 23:19:54 2018 (r335093) > +++ head/sys/ofed/drivers/infiniband/core/ib_user_mad.c Wed Jun 13 23:30:54 2018 (r335094) > @@ -130,7 +130,8 @@ struct ib_umad_packet { > > static struct class *umad_class; > > -static const dev_t base_dev = MKDEV(IB_UMAD_MAJOR, IB_UMAD_MINOR_BASE); > +#define IBMKDEV(x, y) (((dev_t)(x) << 32) | (unsigned)(y)) > +static const dev_t base_dev = IBMKDEV(IB_UMAD_MAJOR, IB_UMAD_MINOR_BASE); > > static DEFINE_SPINLOCK(port_lock); > static DECLARE_BITMAP(dev_map, IB_UMAD_MAX_PORTS); > The scheme for major/minor encoding is different as of r335053. Won't that matter? In sys/ofed/drivers/infiniband/core/{ib_ucm.c,ib_uverbs_main.c} the pattern is to #define the MKDEV(). Following that would in ib_user_mad.c would also resolve this. Or makedev could be re-macroized with the new scheme. From owner-svn-src-head@freebsd.org Thu Jun 14 00:01:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90DEE1003E61; Thu, 14 Jun 2018 00:01:53 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D27B83BDF; Thu, 14 Jun 2018 00:01:53 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id EFD301D1E8; Thu, 14 Jun 2018 00:01:52 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id ECEC87CD9; Thu, 14 Jun 2018 00:01:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id Lf8YqJdobzY0; Thu, 14 Jun 2018 00:01:49 +0000 (UTC) To: Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org DKIM-Filter: OpenDKIM Filter v2.10.3 mail.xzibition.com A0D837CD1 References: <201806130852.w5D8qKd4094584@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Autocrypt: addr=bdrewery@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFJphmsBCADiFgmS4bIzwZijrS31SjEMzg+n5zNellgM+HkShwehpqCiyhXdWrvH6dTZ a6u50pbUIX7doTR7W7PQHCjCTqtpwvcj0eulZva+iHFp+XrbgSFHn+VVXgkYP2MFySyZRFab D2qqzJBEJofhpv4HvY6uQI5K99pMqKr1Z/lHqsijYYu4RH2OfwB5PinId7xeldzWEonVoCr+ rfxzO/UrgA6v/3layGZcKNHFjmc3NqoN1DXtdaEHqtjIozzbndVkH6lkFvIpIrI6i5ox8pwp VxsxLCr/4Musd5CWgHiet5kSw2SzNeA8FbxdLYCpXNVu+uBACEbCUP+CSNy3NVfEUxsBABEB AAHNJEJyeWFuIERyZXdlcnkgPGJkcmV3ZXJ5QEZyZWVCU0Qub3JnPsLAgAQTAQoAKgIbAwUL CQgHAwUVCgkICwUWAwIBAAIeAQIXgAIZAQUCWujOIgUJCmB7NwAKCRA113G7bkaXz/xpB/9b /UWIPbieY1IeIuHF2pyYPE7Hytkh3HVsxMA0F5Ma2AYQsXZZeKNKWrF7RPyDyDwUklLHJkhm k3EfClBbHxf08kMIm1vWCJRtgxic9knY/bzYGiWMpHjg3cSd1XfrYH1autYqTZAjDwIkgOjU dR//Tbn4V36sY7y2jz+kdMVWvK53U32aZqiwBbCn4DPe1wSZcUs17mV/0uZdIoGdj74B1orN A/0py5vHYo6HcbBNoaR8pKRLf5VZNRsxqGIMhTucx4SJWcHpuRBWYyvJSFzwvxdK4ZD4Yqoc kFGPVtOXktVMai9exrLvP3G77fKMu8DI6j4QRU4wCesnHuIfRPFuzsBNBFJphmsBCACiVFPf kNfaFtUSuY0395ueo/rMyHPGPQ2iwvERFCpeFGSQSgagpenNHLpFQKTg/dl6FOoST5tqyxMq fyHGHDzzU51bvA/IfaGoNi/BIhTe/toZNMRvpcI3PLjiGcnJnuwCCbAVOAGdb+t5cZtpNdOI cKYmrYG3u9RiBpe6dTF+qLrD/8Bs1wjhduQ8fcNNgnkXu8xDH4ZxY0lIc3QgvYWp9vimlQe6 iKjUd2/DX28ETZcD5h6pYV331KMPTrEI0p0yvFijUZce8c1XHFyL1j9sBAha5qpszJl6Uq5i LolhKRcGfcdmtD72vHQjUYglUyudSJUVyo2gMYjdbiFKzJulABEBAAHCwGUEGAEKAA8CGwwF AlrozigFCQpgez0ACgkQNddxu25Gl8+m5Af/R3VEdxNMAcDIes9ADhQyofj20SPV3eCJ3HYR OebTSuNdOudGt4AAyA8Ks94u9hiIp5IGsc6RDsT9W7O2vgXhd6eV3eiY5Oif5xLIYrIDVu1Y 1GyRxRrPEn/QOqDN6uFZCPwK1aOapGcYCrO9lB0gMuTVfgHanU61rgC9tMX0OoAOyRd+V3/M 8lDNhjJdF/IpO3SdYzKfkwduy4qamw4Gphcx/RfYQvYLq/eDkP8d50PphWdboqWBwNRHayro W/07OGzfxM5fJ5mBsXPQcO2QcRjkyHf6xCM6Hi1qQL4OnXMNE/ZTX0lnOj1/pH93TlzSHZMP TaiiA/MBD3vGsXBmBg== Organization: FreeBSD Subject: Re: svn commit: r335042 - head/usr.bin/top Message-ID: <9b6b26cf-dac2-f5ab-e694-5d132ff1bdb9@FreeBSD.org> Date: Wed, 13 Jun 2018 17:01:35 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <201806130852.w5D8qKd4094584@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9Wgrtzixcze6qfAfp5yWRGyOKAXaxSvc2" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 00:01:54 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --9Wgrtzixcze6qfAfp5yWRGyOKAXaxSvc2 Content-Type: multipart/mixed; boundary="ATlQM6y8g3RNle56kKvDtVw76tSh0GFat"; protected-headers="v1" From: Bryan Drewery To: Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <9b6b26cf-dac2-f5ab-e694-5d132ff1bdb9@FreeBSD.org> Subject: Re: svn commit: r335042 - head/usr.bin/top References: <201806130852.w5D8qKd4094584@repo.freebsd.org> In-Reply-To: <201806130852.w5D8qKd4094584@repo.freebsd.org> --ATlQM6y8g3RNle56kKvDtVw76tSh0GFat Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 6/13/2018 1:52 AM, Eitan Adler wrote: > Author: eadler > Date: Wed Jun 13 08:52:19 2018 > New Revision: 335042 > URL: https://svnweb.freebsd.org/changeset/base/335042 >=20 > Log: > top(1): add myself to authors > =20 > At this point I've mucked enough with top(1) that all bugs should be > blamed on me rather than William LeFebvre. >=20 Thank you for all of your work here... There's not exactly a guideline for this but I don't feel that non-functional changes qualify as "authors". Especially the sorting chosen. Perhaps I missed some rewrite you've done? Though none have 'Relnotes: yes' so I am assuming they were all non-functional. There's been 62 unique committers to usr.bin/top, which does not account for Submitted By. All of which are also missing from AUTHORS and Copyrigh= ts. I do see some people adding their Copyright on some commits but overall we haven't done that as a project and I am curious if we should change in that regard. Also I really abhor rewriting anything that's not broken as it causes merge conflict pain downstream and just adds regression risk. > Modified: > head/usr.bin/top/top.1 > head/usr.bin/top/utils.c >=20 > Modified: head/usr.bin/top/top.1 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.bin/top/top.1 Wed Jun 13 08:52:17 2018 (r335041) > +++ head/usr.bin/top/top.1 Wed Jun 13 08:52:19 2018 (r335042) > @@ -360,6 +360,7 @@ process is waiting. > Lock names are prefixed with an asterisk \*(lq*\*(rq while sleep event= s > are not. > .Sh AUTHORS > +.An Eitan Adler Aq Mt eadler@FreeBSD.org > .An William LeFebvre, EECS Department, Northwestern University > .Sh BUGS > The command name for swapped processes should be tracked down, but thi= s >=20 > Modified: head/usr.bin/top/utils.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.bin/top/utils.c Wed Jun 13 08:52:17 2018 (r335041) > +++ head/usr.bin/top/utils.c Wed Jun 13 08:52:19 2018 (r335042) > @@ -2,6 +2,7 @@ > * This program may be freely redistributed, > * but this entire comment MUST remain intact. > * > + * Copyright (c) 2018, Eitan Adler > * Copyright (c) 1984, 1989, William LeFebvre, Rice University > * Copyright (c) 1989, 1990, 1992, William LeFebvre, Northwestern Uni= versity > * >=20 --=20 Regards, Bryan Drewery --ATlQM6y8g3RNle56kKvDtVw76tSh0GFat-- --9Wgrtzixcze6qfAfp5yWRGyOKAXaxSvc2 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJbIbBrAAoJEDXXcbtuRpfPnw4H/3sf5fNiUbb7aeLwQIXNs9k/ oBPKHDX+iNW0MP7HIDPJKFAg7lkC2Tnxkld0HpV2W/Tijp/JLgWc0lBTiEfdVDk0 /Z5Bl/zaQm9fml8p9CIeK3eJTorptcO883aKFVK8veMdMb0QwMpfsGBWu+MYAxKq ykvRgsDlH/IU1Ja/ird7+/VqF1iyGCSYQffZ/RXr2IIsv6lFtrQ9G5ytCQSG0RYJ MY13gI8n0Lpnp0J5YGeZ11qOmr6u8Em25XLdHO4Xaj1aTRPT5RgcN9rVRogCSv41 6aB8I+e3WHmuNcqJXvuSOyUdGO/elEDDQrC36m/XdJkJeMmHRc9Se3xYgPBoT7E= =3k1a -----END PGP SIGNATURE----- --9Wgrtzixcze6qfAfp5yWRGyOKAXaxSvc2-- From owner-svn-src-head@freebsd.org Thu Jun 14 00:03:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D7721004470; Thu, 14 Jun 2018 00:03:34 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2538183EF4; Thu, 14 Jun 2018 00:03:34 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-it0-f50.google.com (mail-it0-f50.google.com [209.85.214.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id E08939DF7; Thu, 14 Jun 2018 00:03:33 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-it0-f50.google.com with SMTP id j135-v6so6364738itj.1; Wed, 13 Jun 2018 17:03:33 -0700 (PDT) X-Gm-Message-State: APt69E3aLzxwSjhx0n1IUW1tova0qDzKr7cTqmjNz6SLOyQ5mTDeDRe7 MqGVzfcgrIH9Nf+k7lcsVtqIN3Go4RWn41uJ3NA= X-Google-Smtp-Source: ADUXVKKp11+qZCqiBS0ZphTcy3xucW+zGcMgTtbOY0q/CDa/ytDEIyJO3wqZ4h7S1vTPXPSb5TZfc4jgm/LhT7kvBvs= X-Received: by 2002:a24:6c8a:: with SMTP id w132-v6mr248860itb.4.1528934613342; Wed, 13 Jun 2018 17:03:33 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:8cd:0:0:0:0:0 with HTTP; Wed, 13 Jun 2018 17:03:32 -0700 (PDT) In-Reply-To: References: <201806132330.w5DNUsrE043573@repo.freebsd.org> From: Matthew Macy Date: Wed, 13 Jun 2018 17:03:32 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335094 - head/sys/ofed/drivers/infiniband/core To: Ryan Libby Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, bde@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 00:03:36 -0000 On Wed, Jun 13, 2018 at 4:47 PM, Ryan Libby wrote: > On Wed, Jun 13, 2018 at 4:30 PM, Matt Macy wrote: >> Author: mmacy >> Date: Wed Jun 13 23:30:54 2018 >> New Revision: 335094 >> URL: https://svnweb.freebsd.org/changeset/base/335094 >> >> Log: >> fix OFED build after r335053 >> >> Modified: >> head/sys/ofed/drivers/infiniband/core/ib_user_mad.c >> >> Modified: head/sys/ofed/drivers/infiniband/core/ib_user_mad.c >> ============================================================================== >> --- head/sys/ofed/drivers/infiniband/core/ib_user_mad.c Wed Jun 13 23:19:54 2018 (r335093) >> +++ head/sys/ofed/drivers/infiniband/core/ib_user_mad.c Wed Jun 13 23:30:54 2018 (r335094) >> @@ -130,7 +130,8 @@ struct ib_umad_packet { >> >> static struct class *umad_class; >> >> -static const dev_t base_dev = MKDEV(IB_UMAD_MAJOR, IB_UMAD_MINOR_BASE); >> +#define IBMKDEV(x, y) (((dev_t)(x) << 32) | (unsigned)(y)) >> +static const dev_t base_dev = IBMKDEV(IB_UMAD_MAJOR, IB_UMAD_MINOR_BASE); >> >> static DEFINE_SPINLOCK(port_lock); >> static DECLARE_BITMAP(dev_map, IB_UMAD_MAX_PORTS); >> > > The scheme for major/minor encoding is different as of r335053. Won't > that matter? Yes. > In sys/ofed/drivers/infiniband/core/{ib_ucm.c,ib_uverbs_main.c} the > pattern is to #define the MKDEV(). Following that would in > ib_user_mad.c would also resolve this. Or makedev could be > re-macroized with the new scheme. That's probably the best course of action. Will follow up. From owner-svn-src-head@freebsd.org Thu Jun 14 00:10:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32417100505E; Thu, 14 Jun 2018 00:10:17 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D8DDD844CF; Thu, 14 Jun 2018 00:10:16 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B5F1F209A2; Thu, 14 Jun 2018 00:10:16 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5E0AGRc063996; Thu, 14 Jun 2018 00:10:16 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5E0AGoq063995; Thu, 14 Jun 2018 00:10:16 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201806140010.w5E0AGoq063995@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Thu, 14 Jun 2018 00:10:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335099 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 335099 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 00:10:17 -0000 Author: allanjude Date: Thu Jun 14 00:10:16 2018 New Revision: 335099 URL: https://svnweb.freebsd.org/changeset/base/335099 Log: Fix top(1) support for displaying ZFS Compressed ARC statistics Broken in r334514 sysctlbyname("vfs.zfs.compressed_arc_enabled", ...) would return ENOMEM while trying to read the sysctl (a boolean_t) into a bool, which is too small. Reviewed by: jhb (on irc) Sponsored by: Klara Systems Modified: head/usr.bin/top/machine.c Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Thu Jun 14 00:03:44 2018 (r335098) +++ head/usr.bin/top/machine.c Thu Jun 14 00:10:16 2018 (r335099) @@ -304,7 +304,7 @@ machine_init(struct statics *statics) { int i, j, empty, pagesize; uint64_t arc_size; - bool carc_en; + int carc_en; size_t size; size = sizeof(smpmode); From owner-svn-src-head@freebsd.org Thu Jun 14 00:10:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33C4310050B4; Thu, 14 Jun 2018 00:10:30 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF986845D1; Thu, 14 Jun 2018 00:10:29 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (Seawolf.HML3.ScaleEngine.net [209.51.186.28]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id C03EE1C618; Thu, 14 Jun 2018 00:10:28 +0000 (UTC) To: Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201806020325.w523PFKn048824@repo.freebsd.org> From: Allan Jude Openpgp: preference=signencrypt Autocrypt: addr=allanjude@freebsd.org; prefer-encrypt=mutual; keydata= xsFNBFVwZcYBEADwrZDH0xe0ZVjc9ORCc6PcBLwS/RTXA6NkvpD6ea02pZ8lPOVgteuuugFc D34LdDbiWr+479vfrKBh+Y38GL0oZ0/13j10tIlDMHSa5BU0y6ACtnhupFvVlQ57+XaJAb/q 7qkfSiuxVwQ3FY3PL3cl1RrIP5eGHLA9hu4eVbu+FOX/q/XVKz49HaeIaxzo2Q54572VzIo6 C28McX9m65UL5fXMUGJDDLCItLmehZlHsQQ+uBxvODLFpVV2lUgDR/0rDa0B9zHZX8jY8qQ7 ZdCSy7CwClXI054CkXZCaBzgxYh/CotdI8ezmaw7NLs5vWNTxaDEFXaFMQtMVhvqQBpHkfOD 7rjjOmFw00nJL4FuPE5Yut0CPyx8vLjVmNJSt/Y8WxxmhutsqJYFgYfWl/vaWkrFLur/Zcmz IklwLw35HLsCZytCN5A3rGKdRbQjD6QPXOTJu0JPrJF6t2xFkWAT7oxnSV0ELhl2g+JfMMz2 Z1PDmS3NRnyEdqEm7NoRGXJJ7bgxDbN+9SXTyOletqGNXj/bSrBvhvZ0RQrzdHAPwQUfVSU2 qBhQEi2apSZstgVNMan0GUPqCdbE2zpysg+zT7Yhvf9EUQbzPL4LpdK1llT9fZbrdMzEXvEF oSvwJFdV3sqKmZc7b+E3PuxK6GTsKqaukd/3Cj8aLHG1T1im1QARAQABzSJBbGxhbiBKdWRl IDxhbGxhbmp1ZGVAZnJlZWJzZC5vcmc+wsF/BBMBAgApBQJVcGXGAhsjBQkSzAMABwsJCAcD AgEGFQgCCQoLBBYCAwECHgECF4AACgkQGZU1PhKYC34Muw/+JOKpSfhhysWFYiRXynGRDe07 Z6pVsn7DzrPUMRNZfHu8Uujmmy3p2nx9FelIY9yjd2UKHhug+whM54MiIFs90eCRVa4XEsPR 4FFAm0DAWrrb7qhZFcE/GhHdRWpZ341WAElWf6Puj2devtRjfYbikvj5+1V1QmDbju7cEw5D mEET44pTuD2VMRJpu2yZZzkM0i+wKFuPxlhqreufA1VNkZXI/rIfkYWK+nkXd9Efw3YdCyCQ zUgTUCb88ttSqcyhik/li1CDbXBpkzDCKI6I/8fAb7jjOC9LAtrZJrdgONywcVFoyK9ZN7EN AVA+xvYCmuYhR/3zHWH1g4hAm1v1+gIsufhajhfo8/wY1SetlzPaYkSkVQLqD8T6zZyhf+AN bC7ci44UsiKGAplB3phAXrtSPUEqM86kbnHg3fSx37kWKUiYNOnx4AC2VXvEiKsOBlpyt3dw WQbOtOYM+vkfbBwDtoGOOPYAKxc4LOIt9r+J8aD+gTooi9Eo5tvphATf9WkCpl9+aaGbSixB tUpvQMRnSMqTqq4Z7DeiG6VMRQIjsXDSLJEUqcfhnLFo0Ko/RiaHd5xyAQ4DhQ9QpkyQjjNf /3f/dYG7JAtoD30txaQ5V8uHrz210/77DRRX+HJjEj6xCxWUGvQgvEZf5XXyxeePvqZ+zQyT DX61bYw6w6bOwU0EVXBlxgEQAMy7YVnCCLN4oAOBVLZ5nUbVPvpUhsdA94/0/P+uqCIh28Cz ar56OCX0X19N/nAWecxL4H32zFbIRyDB2V/MEh4p9Qvyu/j4i1r3Ex5GhOT2hnit43Ng46z5 29Es4TijrHJP4/l/rB2VOqMKBS7Cq8zk1cWqaI9XZ59imxDNjtLLPPM+zQ1yE3OAMb475QwN UgWxTMw8rkA7CEaqeIn4sqpTSD5C7kT1Bh26+rbgJDZ77D6Uv1LaCZZOaW52okW3bFbdozV8 yM2u+xz2Qs8bHz67p+s+BlygryiOyYytpkiK6Iy4N7FTolyj5EIwCuqzfk0SaRHeOKX2ZRjC qatkgoD/t13PNT38V9tw3qZVOJDS0W6WM8VSg+F+bkM9LgJ8CmKV+Hj0k3pfGfYPOZJ/v18i +SmZmL/Uw2RghnwDWGAsPCKu4uZR777iw7n9Io6Vfxndw2dcS0e9klvFYoaGS6H2F13Asygr WBzFNGFQscN4mUW+ZYBzpTOcHkdT7w8WS55BmXYLna+dYer9/HaAuUrONjujukN4SPS1fMJ2 /CS/idAUKyyVVX5vozoNK2JVC1h1zUAVsdnmhEzNPsvBoqcVNfyqBFROEVLIPwq+lQMGNVjH ekLTKRWf59MEhUC2ztjSKkGmwdg73d6xSXMuq45EgIJV2wPvOgWQonoHH/kxABEBAAHCwWUE GAECAA8FAlVwZcYCGwwFCRLMAwAACgkQGZU1PhKYC34w5A//YViBtZyDV5O+SJT9FFO3lb9x Zdxf0trA3ooCt7gdBkdnBM6T5EmjgVZ3KYYyFfwXZVkteuCCycMF/zVw5eE9FL1+zz9gg663 nY9q2F77TZTKXVWOLlOV2bY+xaK94U4ytogOGhh9b4UnQ/Ct3+6aviCF78Go608BXbmF/GVT 7uhddemk7ItxM1gE5Hscx3saxGKlayaOsdPKeGTVJCDEtHDuOc7/+jGh5Zxpk/Hpi+DUt1ot 8e6hPYLIQa4uVx4f1xxxV858PQ7QysSLr9pTV7FAQ18JclCaMc7JWIa3homZQL/MNKOfST0S 2e+msuRwQo7AnnfFKBUtb02KwpA4GhWryhkjUh/kbVc1wmGxaU3DgXYQ5GV5+Zf4kk/wqr/7 KG0dkTz6NLCVLyDlmAzuFhf66DJ3zzz4yIo3pbDYi3HB/BwJXVSKB3Ko0oUo+6/qMrOIS02L s++QE/z7K12CCcs7WwOjfCYHK7VtE0Sr/PfybBdTbuDncOuAyAIeIKxdI2nmQHzl035hhvQX s4CSghsP319jAOQiIolCeSbTMD4QWMK8RL/Pe1FI1jC3Nw9s+jq8Dudtbcj2UwAP/STUEbJ9 5rznzuuhPjE0e++EU/RpWmcaIMK/z1zZDMN+ce2v1qzgV936ZhJ3iaVzyqbEE81gDxg3P+IM kiYh4ZtPB4Q= Subject: Re: svn commit: r334514 - head/usr.bin/top Message-ID: Date: Wed, 13 Jun 2018 20:10:22 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <201806020325.w523PFKn048824@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7DDuQYUGSbTUQv3pZxcbJnPTCYamvHSzk" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 00:10:30 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --7DDuQYUGSbTUQv3pZxcbJnPTCYamvHSzk Content-Type: multipart/mixed; boundary="w44D7cW2St8qhBuBFNNPMF4JBwypg9H0Q"; protected-headers="v1" From: Allan Jude To: Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r334514 - head/usr.bin/top References: <201806020325.w523PFKn048824@repo.freebsd.org> In-Reply-To: <201806020325.w523PFKn048824@repo.freebsd.org> --w44D7cW2St8qhBuBFNNPMF4JBwypg9H0Q Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 2018-06-01 23:25, Eitan Adler wrote: > Author: eadler > Date: Sat Jun 2 03:25:15 2018 > New Revision: 334514 > URL: https://svnweb.freebsd.org/changeset/base/334514 >=20 > Log: > top(1): Use standard boolean rather than homegrown alternative >=20 > Deleted: > head/usr.bin/top/boolean.h > Modified: > head/usr.bin/top/commands.c > head/usr.bin/top/display.c > head/usr.bin/top/machine.c > head/usr.bin/top/screen.c > head/usr.bin/top/top.1 > head/usr.bin/top/top.c >=20 > Modified: head/usr.bin/top/machine.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.bin/top/machine.c Sat Jun 2 02:06:48 2018 (r334513) > +++ head/usr.bin/top/machine.c Sat Jun 2 03:25:15 2018 (r334514) > @@ -35,6 +35,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -308,7 +309,7 @@ machine_init(struct statics *statics) > { > int i, j, empty, pagesize; > uint64_t arc_size; > - boolean_t carc_en; > + bool carc_en; > size_t size; > =20 > size =3D sizeof(smpmode); >=20 This broke compressed ARC display in top. The sysctl vfs.zfs.compressed_arc_enabled is backed by a boolean_t (which is the same size as an int), so trying to read it into a bool (1 byte) fails and returns ENOMEM. Fixed in r335099 --=20 Allan Jude --w44D7cW2St8qhBuBFNNPMF4JBwypg9H0Q-- --7DDuQYUGSbTUQv3pZxcbJnPTCYamvHSzk Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (MingW32) iQIcBAEBAgAGBQJbIbJzAAoJEBmVNT4SmAt+kRgQAOFafGeBHKj2ouHnUSJBlGIc yKHIrBWKL2UhyoK0vt7Xyt4xFjnkPN2dPHwNQx+Y/UMKqG6hz9+W4apRNvGKsZAw +Vmu/AFO4uOL3z3HJw7CjbGdcHAcbz6CUrqavsMUP14YliMG0BlsbjEFwtHkU+s9 pif3o1mSTxURdXU3ur/6T5cuCNcZz6yoVmhmOjRS3Cta0UkYTtv56ewpiMy0HuMW kJDAWnHaLDrzW1lrifHG6Gp76wAB8GDKhFO7sK6An+b6lnjMY5j+Oty3NxRjuUcA 6BE5N6Uz5/BocWspVlcvAcGlQyd/4JqyCWRcgD0pORNVJJjENpTPHs3LcFEWUcsC nx/wX/V43YkL44aRi2XywrFzhVWw8agDnxwlFfb/3IlUdk7Rm65syp8cCTTWBzOZ 5A2UWdAYM82HErJZkcYRxjK1xk2jMmNIf/5Rh56H4TK/MOjT6g7fr7Y8boWsLj2+ EuS5PiDnv6x6b4WKXiwVH28CGuIaKIDxLCD+2+GnZS7weVwVIQqtYJzJw7MvjRMu uQ4hJzjbGbSK7CffdSHSdr0qkeUCSo9o0aDH7a1n0UBihn9K8ptr0vJjvBcberUL RKZIA8Xx9pQskXn8aMXqBMw9SfUmyAG4uGzsywhIE4TFtxywKF3nWWlENShZFzn7 5k+kVFQpNB6HZ34TAY3a =NpQJ -----END PGP SIGNATURE----- --7DDuQYUGSbTUQv3pZxcbJnPTCYamvHSzk-- From owner-svn-src-head@freebsd.org Thu Jun 14 00:30:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DCEC10072D7; Thu, 14 Jun 2018 00:30:33 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89D2D8544D; Thu, 14 Jun 2018 00:30:32 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w5E0UTmx042097; Wed, 13 Jun 2018 17:30:29 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w5E0UTIi042096; Wed, 13 Jun 2018 17:30:29 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806140030.w5E0UTIi042096@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r335072 - head/sys/amd64/amd64 In-Reply-To: <201806131755.w5DHtAwo073314@repo.freebsd.org> To: Konstantin Belousov Date: Wed, 13 Jun 2018 17:30:29 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 00:30:33 -0000 > Author: kib > Date: Wed Jun 13 17:55:09 2018 > New Revision: 335072 > URL: https://svnweb.freebsd.org/changeset/base/335072 > > Log: > Enable eager FPU context switch by default on amd64. > > With compilers making increasing use of vector instructions the > performance benefit of lazily switching FPU state is no longer a > desirable tradeoff. Linux switched to eager FPU context switch some > time ago, and the idea was floated on the FreeBSD-current mailing list > some years ago[1]. > > Enable eager FPU context switch by default on amd64, with a tunable/sysctl > available to turn it back off. > > [1] https://lists.freebsd.org/pipermail/freebsd-current/2015-March/055198.html > > Reviewed by: jhb > Tested by: pho > Sponsored by: The FreeBSD Foundation MFC: ? ... -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Jun 14 01:01:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC9EE100A028 for ; Thu, 14 Jun 2018 01:01:19 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic315-9.consmr.mail.gq1.yahoo.com (sonic315-9.consmr.mail.gq1.yahoo.com [98.137.65.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5557586D5A for ; Thu, 14 Jun 2018 01:01:19 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: vRTj9x4VM1nAK2hu2rybjZZcZzrFGmTekEs0HqQGX.H3oT2wpjFhX_39rOhhd2C PcsRzC4Fks.UQfZ.6rwFUHfDQjbZOqXSLBi5z2NVO0oUZWA7fDTJFKuvVHp.oRgaQIB7VH0nxScE tJQ5jh2kPw1iKwZlpJ_G44lKwT6dtZRjLlbS7i6wYefXPow.oPLUT6ZxpYbTlfj2r.n9krAv07Bs 8xcmHcaA3pc2SLOXj4gio.ZJEW9yewbGBtoibThnLAqukBreO0O4B71OxtgS4xWlYg92zLTXjnJb adNqvelsXlQaukzvTfEJp_SjTosSem9YGQjfV7YZxXRa5bYQ1CbYRbcR4SQxKjavO0X9EG36Cdhw YmeFL3LxAmrNgFfv7Ehl3lApn0KpBHIUWT8d6U.LoLJmSOW019mCRVdh9UaDqHteTWbbaI7szFc7 W4Y7geXDR05.t7M3gOYHJA8qhsleUIZv3T_zVZiv12GzVZ6Y2cz8JzDQ9V.iKdQfkn3dNS75VZqj rVGpjs_tvMQnEofDeiWLxQNGmTOXJQ46QiApLMBKVMsPTn47vi2gbsvfTIFoHyMhvIXAcWmVeF9m c64L.8vRrPdqHdtpCQTaBZcNtMjWpV5RK.qcdZV9j9y3TwMAf9NpE9.Riw9ZYP9gSaekc2j5B2w9 VOK2uxrhOytDzf2vrPUXg5f356.TxC7KOVBxhBBXa1DAF4m81gH_tn12Cg8ey1z2.g0pET_nwual dUEyq8WGgA5DUudeSQcBix8RvCoVhPepPiILguhb9JvPR63zJarIiXy0Vkznd.UqV_McEEQdOYvf LVdNhByDvObGiYcrzS4ozIMPXNfP6cCH8Pj0DMAKabuGDyhUqOlmGmBdU6STOhWR5BJLIwX7PsC9 EbhCANpxDI20sinxgQ8uBpkoEeFV87VsSk7qAYphnIeCY1Hbk9GtnNRViJTMZJfWeqIJy.pwsCc2 ttKi3KA-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic315.consmr.mail.gq1.yahoo.com with HTTP; Thu, 14 Jun 2018 01:01:12 +0000 Received: from ip70-189-131-151.lv.lv.cox.net (EHLO [192.168.0.109]) ([70.189.131.151]) by smtp418.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 2d61148bf9bcb664212b0fee8380770a; Thu, 14 Jun 2018 01:01:08 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Subject: Re: svn commit: r335091 - head/sbin/nvmecontrol [broke builds of FreeBSD-head-armv7-build and other 32-bit ci.freeb sd.org builds] Message-Id: <0A0EF5DB-CC1C-4A1E-8FAD-0D81CBAFC5B5@yahoo.com> Date: Wed, 13 Jun 2018 18:01:07 -0700 To: imp@FreeBSD.org, svn-src-head@freebsd.org X-Mailer: Apple Mail (2.3445.8.2) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 01:01:20 -0000 Warner Losh imp at FreeBSD.org wrote on Wed Jun 13 22:00:04 UTC 2018 : > Author: imp > Date: Wed Jun 13 22:00:02 2018 > New Revision: 335091 > URL:=20 > https://svnweb.freebsd.org/changeset/base/335091 >=20 >=20 > Log: > Make it possible to use print_controller from another program > =20 > Rename print_controller to nvme_print_controller. Put it in its > own file for easy inclusion. Move util.c to be nc_util.c to not > conflict with camcontrol. add nvecontrol_ext.h to define shared > interfaces. > =20 > Sponsored by: Netflix > Differential Revision:=20 > https://reviews.freebsd.org/D15371 >=20 >=20 > Added: > head/sbin/nvmecontrol/identify_ext.c > - copied, changed from r335089, head/sbin/nvmecontrol/identify.c > head/sbin/nvmecontrol/nc_util.c > - copied, changed from r335089, head/sbin/nvmecontrol/util.c > head/sbin/nvmecontrol/nvmecontrol_ext.h (contents, props changed) > - copied, changed from r335089, head/sbin/nvmecontrol/util.c > Deleted: > head/sbin/nvmecontrol/util.c > Modified: > head/sbin/nvmecontrol/Makefile > head/sbin/nvmecontrol/identify.c . . . For 32-bit clang-based targets first . . . FreeBSD-head-armv7-build FreeBSD-head-armv6-build get build failures like: --- all_subdir_sbin --- In file included from /usr/src/sbin/nvmecontrol/identify_ext.c:43: /usr/src/sbin/nvmecontrol/nvmecontrol.h:112:9: error: unknown type name = '__uint128_t' typedef __uint128_t uint128_t; ^ 1 error generated. *** [identify_ext.o] Error code 1 For 32-bit gcc 4.2.1 targets second . . . FreeBSD-head-mips-build FreeBSD-head-powerpc-build FreeBSD-head-powerpcspe-build get build failures like: --- all_subdir_sbin --- In file included from /usr/src/sbin/nvmecontrol/identify_ext.c:43: /usr/src/sbin/nvmecontrol/nvmecontrol.h:112: error: expected '=3D', ',', = ';', 'asm' or '__attribute__' before 'uint128_t' /usr/src/sbin/nvmecontrol/nvmecontrol.h:116: error: expected '=3D', ',', = ';', 'asm' or '__attribute__' before 'to128' /usr/src/sbin/nvmecontrol/nvmecontrol.h:122: error: expected ')' before = 'u' cc1: warnings being treated as errors /usr/src/sbin/nvmecontrol/identify_ext.c: In function = 'nvme_print_controller': /usr/src/sbin/nvmecontrol/identify_ext.c:219: warning: implicit = declaration of function 'uint128_to_str' /usr/src/sbin/nvmecontrol/identify_ext.c:219: warning: nested extern = declaration of 'uint128_to_str' /usr/src/sbin/nvmecontrol/identify_ext.c:219: warning: implicit = declaration of function 'to128' /usr/src/sbin/nvmecontrol/identify_ext.c:219: warning: nested extern = declaration of 'to128' /usr/src/sbin/nvmecontrol/identify_ext.c:219: warning: format '%s' = expects type 'char *', but argument 2 has type 'int' /usr/src/sbin/nvmecontrol/identify_ext.c:221: warning: format '%s' = expects type 'char *', but argument 2 has type 'int' *** [identify_ext.o] Error code 1 =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Thu Jun 14 01:15:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6BA7100B792; Thu, 14 Jun 2018 01:15:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6646E8786F; Thu, 14 Jun 2018 01:15:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 465F521560; Thu, 14 Jun 2018 01:15:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5E1FLle099591; Thu, 14 Jun 2018 01:15:21 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5E1FJH6099583; Thu, 14 Jun 2018 01:15:19 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806140115.w5E1FJH6099583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 14 Jun 2018 01:15:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335101 - in head: sbin sbin/camcontrol share/mk X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: sbin sbin/camcontrol share/mk X-SVN-Commit-Revision: 335101 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 01:15:22 -0000 Author: imp Date: Thu Jun 14 01:15:19 2018 New Revision: 335101 URL: https://svnweb.freebsd.org/changeset/base/335101 Log: NVME support is only for x86 and powerpc64. Implement MK_NVME now that the expression for where NVMe is complicated. Default it to "yes" for x86 and powerpc64 and no everywhere else. Use it in camcontrol to define WITH_NVME for those platforms where we support nvme. This should fix the newly introduced nvme files to camcontrol which were building everywhere. Pointy Hat To: imp Sponsored by: Netflix Modified: head/sbin/Makefile head/sbin/Makefile.amd64 head/sbin/Makefile.i386 head/sbin/Makefile.powerpc64 head/sbin/camcontrol/Makefile head/sbin/camcontrol/camcontrol.c head/share/mk/src.opts.mk Modified: head/sbin/Makefile ============================================================================== --- head/sbin/Makefile Thu Jun 14 00:20:55 2018 (r335100) +++ head/sbin/Makefile Thu Jun 14 01:15:19 2018 (r335101) @@ -82,6 +82,7 @@ SUBDIR.${MK_IPFW}+= natd SUBDIR.${MK_ISCSI}+= iscontrol SUBDIR.${MK_NAND}+= nandfs SUBDIR.${MK_NAND}+= newfs_nandfs +SUBDIR.${MK_NVME}+= nvmecontrol SUBDIR.${MK_OPENSSL}+= decryptcore SUBDIR.${MK_PF}+= pfctl SUBDIR.${MK_PF}+= pflogd Modified: head/sbin/Makefile.amd64 ============================================================================== --- head/sbin/Makefile.amd64 Thu Jun 14 00:20:55 2018 (r335100) +++ head/sbin/Makefile.amd64 Thu Jun 14 01:15:19 2018 (r335101) @@ -2,4 +2,3 @@ SUBDIR += bsdlabel SUBDIR += fdisk -SUBDIR += nvmecontrol Modified: head/sbin/Makefile.i386 ============================================================================== --- head/sbin/Makefile.i386 Thu Jun 14 00:20:55 2018 (r335100) +++ head/sbin/Makefile.i386 Thu Jun 14 01:15:19 2018 (r335101) @@ -2,5 +2,4 @@ SUBDIR += bsdlabel SUBDIR += fdisk -SUBDIR += nvmecontrol SUBDIR += sconfig Modified: head/sbin/Makefile.powerpc64 ============================================================================== --- head/sbin/Makefile.powerpc64 Thu Jun 14 00:20:55 2018 (r335100) +++ head/sbin/Makefile.powerpc64 Thu Jun 14 01:15:19 2018 (r335101) @@ -2,4 +2,3 @@ SUBDIR += bsdlabel SUBDIR += fdisk -SUBDIR += nvmecontrol Modified: head/sbin/camcontrol/Makefile ============================================================================== --- head/sbin/camcontrol/Makefile Thu Jun 14 00:20:55 2018 (r335100) +++ head/sbin/camcontrol/Makefile Thu Jun 14 01:15:19 2018 (r335101) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PACKAGE=runtime PROG= camcontrol SRCS= camcontrol.c util.c @@ -8,11 +10,13 @@ SRCS+= attrib.c epc.c fwdownload.c modeedit.c persist. .else CFLAGS+= -DMINIMALISTIC .endif +.if ${MK_NVME} != "no" .PATH: ${SRCTOP}/sbin/nvmecontrol -CFLAGS+= -I${SRCTOP}/sbin/nvmecontrol +CFLAGS+= -I${SRCTOP}/sbin/nvmecontrol -DWITH_NVME SRCS+= identify_ext.c nc_util.c .PATH: ${SRCTOP}/sys/dev/nvme SRCS+= nvme_util.c +.endif # This is verboten .if ${MACHINE_CPUARCH} == "arm" WARNS?= 3 Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Thu Jun 14 00:20:55 2018 (r335100) +++ head/sbin/camcontrol/camcontrol.c Thu Jun 14 01:15:19 2018 (r335101) @@ -63,7 +63,9 @@ __FBSDID("$FreeBSD$"); #include #include #include "camcontrol.h" +#ifdef WITH_NVME #include "nvmecontrol_ext.h" +#endif typedef enum { CAM_CMD_NONE = 0x00000000, @@ -281,7 +283,9 @@ static int print_dev_ata(struct device_match_result *d static int print_dev_semb(struct device_match_result *dev_result, char *tmpstr); static int print_dev_mmcsd(struct device_match_result *dev_result, char *tmpstr); +#ifdef WITH_NVME static int print_dev_nvme(struct device_match_result *dev_result, char *tmpstr); +#endif #ifndef MINIMALISTIC static int testunitready(struct cam_device *device, int task_attr, int retry_count, int timeout, int quiet); @@ -602,12 +606,14 @@ getdevtree(int argc, char **argv, char *combinedopt) skip_device = 1; break; } +#ifdef WITH_NVME } else if (dev_result->protocol == PROTO_NVME) { if (print_dev_nvme(dev_result, &tmpstr[0]) != 0) { skip_device = 1; break; } +#endif } else { sprintf(tmpstr, "<>"); } @@ -763,6 +769,7 @@ print_dev_mmcsd(struct device_match_result *dev_result return (0); } +#ifdef WITH_NVME static int nvme_get_cdata(struct cam_device *dev, struct nvme_controller_data *cdata) { @@ -824,6 +831,7 @@ print_dev_nvme(struct device_match_result *dev_result, cam_close_device(dev); return (0); } +#endif #ifndef MINIMALISTIC static int @@ -2402,6 +2410,7 @@ ataidentify(struct cam_device *device, int retry_count return (0); } +#ifdef WITH_NVME static int nvmeidentify(struct cam_device *device, int retry_count __unused, int timeout __unused) { @@ -2413,10 +2422,12 @@ nvmeidentify(struct cam_device *device, int retry_coun return (0); } +#endif static int identify(struct cam_device *device, int retry_count, int timeout) { +#ifdef WITH_NVME struct ccb_pathinq cpi; if (get_cpi(device, &cpi) != 0) { @@ -2427,6 +2438,7 @@ identify(struct cam_device *device, int retry_count, i if (cpi.protocol == PROTO_NVME) { return (nvmeidentify(device, retry_count, timeout)); } +#endif return (ataidentify(device, retry_count, timeout)); } #endif /* MINIMALISTIC */ @@ -5206,6 +5218,7 @@ cts_print(struct cam_device *device, struct ccb_trans_ "enabled" : "disabled"); } } +#ifdef WITH_NVME if (cts->protocol == PROTO_NVME) { struct ccb_trans_settings_nvme *nvmex = &cts->xport_specific.nvme; @@ -5222,6 +5235,7 @@ cts_print(struct cam_device *device, struct ccb_trans_ nvmex->speed, nvmex->max_speed); } } +#endif } /* Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Thu Jun 14 00:20:55 2018 (r335100) +++ head/share/mk/src.opts.mk Thu Jun 14 01:15:19 2018 (r335101) @@ -322,6 +322,13 @@ __DEFAULT_NO_OPTIONS+=CXGBETOOL __DEFAULT_NO_OPTIONS+=MLX5TOOL .endif +# NVME is only x86 and powerpc64 +.if ${__T} == "amd64" || ${__T} == "i386" || ${__T} == "powerpc64" +__DEFAULT_YES_OPTIONS+=NVME +.else +__DEFAULT_NO_OPTIONS+=NVME +.endif + .include # From owner-svn-src-head@freebsd.org Thu Jun 14 01:27:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D69FC100CE03; Thu, 14 Jun 2018 01:27:36 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 82E076856F; Thu, 14 Jun 2018 01:27:36 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 49FEB21745; Thu, 14 Jun 2018 01:27:36 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5E1Ra1T004638; Thu, 14 Jun 2018 01:27:36 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5E1Radw004637; Thu, 14 Jun 2018 01:27:36 GMT (envelope-from np@FreeBSD.org) Message-Id: <201806140127.w5E1Radw004637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 14 Jun 2018 01:27:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335102 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 335102 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 01:27:37 -0000 Author: np Date: Thu Jun 14 01:27:35 2018 New Revision: 335102 URL: https://svnweb.freebsd.org/changeset/base/335102 Log: cxgbe(4): Catch up with recent changes in the kernel -- it no longer holds non-sleepable locks around any of the driver ioctls. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Jun 14 01:15:19 2018 (r335101) +++ head/sys/dev/cxgbe/t4_main.c Thu Jun 14 01:27:35 2018 (r335102) @@ -1663,7 +1663,7 @@ cxgbe_init(void *arg) static int cxgbe_ioctl(struct ifnet *ifp, unsigned long cmd, caddr_t data) { - int rc = 0, mtu, flags, can_sleep; + int rc = 0, mtu, flags; struct vi_info *vi = ifp->if_softc; struct port_info *pi = vi->pi; struct adapter *sc = pi->adapter; @@ -1689,59 +1689,36 @@ cxgbe_ioctl(struct ifnet *ifp, unsigned long cmd, cadd break; case SIOCSIFFLAGS: - can_sleep = 0; -redo_sifflags: - rc = begin_synchronized_op(sc, vi, - can_sleep ? (SLEEP_OK | INTR_OK) : HOLD_LOCK, "t4flg"); - if (rc) { - if_printf(ifp, "%ssleepable synch operation failed: %d." - " if_flags 0x%08x, if_drv_flags 0x%08x\n", - can_sleep ? "" : "non-", rc, ifp->if_flags, - ifp->if_drv_flags); + rc = begin_synchronized_op(sc, vi, SLEEP_OK | INTR_OK, "t4flg"); + if (rc) return (rc); - } if (ifp->if_flags & IFF_UP) { if (ifp->if_drv_flags & IFF_DRV_RUNNING) { flags = vi->if_flags; if ((ifp->if_flags ^ flags) & (IFF_PROMISC | IFF_ALLMULTI)) { - if (can_sleep == 1) { - end_synchronized_op(sc, 0); - can_sleep = 0; - goto redo_sifflags; - } rc = update_mac_settings(ifp, XGMAC_PROMISC | XGMAC_ALLMULTI); } } else { - if (can_sleep == 0) { - end_synchronized_op(sc, LOCK_HELD); - can_sleep = 1; - goto redo_sifflags; - } rc = cxgbe_init_synchronized(vi); } vi->if_flags = ifp->if_flags; } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - if (can_sleep == 0) { - end_synchronized_op(sc, LOCK_HELD); - can_sleep = 1; - goto redo_sifflags; - } rc = cxgbe_uninit_synchronized(vi); } - end_synchronized_op(sc, can_sleep ? 0 : LOCK_HELD); + end_synchronized_op(sc, 0); break; case SIOCADDMULTI: - case SIOCDELMULTI: /* these two are called with a mutex held :-( */ - rc = begin_synchronized_op(sc, vi, HOLD_LOCK, "t4multi"); + case SIOCDELMULTI: + rc = begin_synchronized_op(sc, vi, SLEEP_OK | INTR_OK, "t4multi"); if (rc) return (rc); if (ifp->if_drv_flags & IFF_DRV_RUNNING) rc = update_mac_settings(ifp, XGMAC_MCADDRS); - end_synchronized_op(sc, LOCK_HELD); + end_synchronized_op(sc, 0); break; case SIOCSIFCAP: From owner-svn-src-head@freebsd.org Thu Jun 14 01:28:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 566C5100D2CA; Thu, 14 Jun 2018 01:28:56 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0870C687BB; Thu, 14 Jun 2018 01:28:56 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD26621748; Thu, 14 Jun 2018 01:28:55 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5E1St2f004736; Thu, 14 Jun 2018 01:28:55 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5E1StCT004735; Thu, 14 Jun 2018 01:28:55 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201806140128.w5E1StCT004735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Thu, 14 Jun 2018 01:28:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335103 - head/lib/libvmmapi X-SVN-Group: head X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: head/lib/libvmmapi X-SVN-Commit-Revision: 335103 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 01:28:56 -0000 Author: araujo Date: Thu Jun 14 01:28:55 2018 New Revision: 335103 URL: https://svnweb.freebsd.org/changeset/base/335103 Log: Fix style(9) space vs tab. Reviewed by: jhb MFC after: 3 weeks. Sponsored by: iXsystems Inc. Differential Revision: https://reviews.freebsd.org/D15774 Modified: head/lib/libvmmapi/vmmapi.c Modified: head/lib/libvmmapi/vmmapi.c ============================================================================== --- head/lib/libvmmapi/vmmapi.c Thu Jun 14 01:27:35 2018 (r335102) +++ head/lib/libvmmapi/vmmapi.c Thu Jun 14 01:28:55 2018 (r335103) @@ -85,19 +85,19 @@ struct vmctx { static int vm_device_open(const char *name) { - int fd, len; - char *vmfile; + int fd, len; + char *vmfile; len = strlen("/dev/vmm/") + strlen(name) + 1; vmfile = malloc(len); assert(vmfile != NULL); snprintf(vmfile, len, "/dev/vmm/%s", name); - /* Open the device file */ - fd = open(vmfile, O_RDWR, 0); + /* Open the device file */ + fd = open(vmfile, O_RDWR, 0); free(vmfile); - return (fd); + return (fd); } int @@ -876,7 +876,7 @@ vm_set_capability(struct vmctx *ctx, int vcpu, enum vm vmcap.cpuid = vcpu; vmcap.captype = cap; vmcap.capval = val; - + return (ioctl(ctx->fd, VM_SET_CAPABILITY, &vmcap)); } @@ -1580,4 +1580,3 @@ vm_get_ioctls(size_t *len) *len = nitems(vm_ioctl_cmds); return (NULL); } - From owner-svn-src-head@freebsd.org Thu Jun 14 01:34:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8FA5100E39F; Thu, 14 Jun 2018 01:34:57 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8982869111; Thu, 14 Jun 2018 01:34:57 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6960821910; Thu, 14 Jun 2018 01:34:57 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5E1YvG4009461; Thu, 14 Jun 2018 01:34:57 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5E1YsCH009444; Thu, 14 Jun 2018 01:34:54 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201806140134.w5E1YsCH009444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Thu, 14 Jun 2018 01:34:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335104 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 335104 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 01:34:58 -0000 Author: araujo Date: Thu Jun 14 01:34:53 2018 New Revision: 335104 URL: https://svnweb.freebsd.org/changeset/base/335104 Log: Fix style(9) space vs tab. Reviewed by: jhb MFC after: 3 weeks. Sponsored by: iXsystems Inc. Differential Revision: https://reviews.freebsd.org/D15768 Modified: head/usr.sbin/bhyve/acpi.c head/usr.sbin/bhyve/ahci.h head/usr.sbin/bhyve/bhyverun.c head/usr.sbin/bhyve/block_if.c head/usr.sbin/bhyve/bootrom.h head/usr.sbin/bhyve/console.h head/usr.sbin/bhyve/consport.c head/usr.sbin/bhyve/inout.c head/usr.sbin/bhyve/mem.h head/usr.sbin/bhyve/mevent.c head/usr.sbin/bhyve/mevent_test.c head/usr.sbin/bhyve/pci_e82545.c head/usr.sbin/bhyve/pci_emul.c head/usr.sbin/bhyve/pci_virtio_net.c head/usr.sbin/bhyve/pci_xhci.c head/usr.sbin/bhyve/rfb.c head/usr.sbin/bhyve/rtc.c head/usr.sbin/bhyve/sockstream.c head/usr.sbin/bhyve/uart_emul.c head/usr.sbin/bhyve/usb_mouse.c head/usr.sbin/bhyve/vga.h head/usr.sbin/bhyve/virtio.c head/usr.sbin/bhyve/virtio.h Modified: head/usr.sbin/bhyve/acpi.c ============================================================================== --- head/usr.sbin/bhyve/acpi.c Thu Jun 14 01:28:55 2018 (r335103) +++ head/usr.sbin/bhyve/acpi.c Thu Jun 14 01:34:53 2018 (r335104) @@ -885,7 +885,7 @@ basl_make_templates(void) int len; err = 0; - + /* * */ Modified: head/usr.sbin/bhyve/ahci.h ============================================================================== --- head/usr.sbin/bhyve/ahci.h Thu Jun 14 01:28:55 2018 (r335103) +++ head/usr.sbin/bhyve/ahci.h Thu Jun 14 01:34:53 2018 (r335104) @@ -33,292 +33,292 @@ #define _AHCI_H_ /* ATA register defines */ -#define ATA_DATA 0 /* (RW) data */ +#define ATA_DATA 0 /* (RW) data */ -#define ATA_FEATURE 1 /* (W) feature */ -#define ATA_F_DMA 0x01 /* enable DMA */ -#define ATA_F_OVL 0x02 /* enable overlap */ +#define ATA_FEATURE 1 /* (W) feature */ +#define ATA_F_DMA 0x01 /* enable DMA */ +#define ATA_F_OVL 0x02 /* enable overlap */ -#define ATA_COUNT 2 /* (W) sector count */ +#define ATA_COUNT 2 /* (W) sector count */ -#define ATA_SECTOR 3 /* (RW) sector # */ -#define ATA_CYL_LSB 4 /* (RW) cylinder# LSB */ -#define ATA_CYL_MSB 5 /* (RW) cylinder# MSB */ -#define ATA_DRIVE 6 /* (W) Sector/Drive/Head */ -#define ATA_D_LBA 0x40 /* use LBA addressing */ -#define ATA_D_IBM 0xa0 /* 512 byte sectors, ECC */ +#define ATA_SECTOR 3 /* (RW) sector # */ +#define ATA_CYL_LSB 4 /* (RW) cylinder# LSB */ +#define ATA_CYL_MSB 5 /* (RW) cylinder# MSB */ +#define ATA_DRIVE 6 /* (W) Sector/Drive/Head */ +#define ATA_D_LBA 0x40 /* use LBA addressing */ +#define ATA_D_IBM 0xa0 /* 512 byte sectors, ECC */ -#define ATA_COMMAND 7 /* (W) command */ +#define ATA_COMMAND 7 /* (W) command */ -#define ATA_ERROR 8 /* (R) error */ -#define ATA_E_ILI 0x01 /* illegal length */ -#define ATA_E_NM 0x02 /* no media */ -#define ATA_E_ABORT 0x04 /* command aborted */ -#define ATA_E_MCR 0x08 /* media change request */ -#define ATA_E_IDNF 0x10 /* ID not found */ -#define ATA_E_MC 0x20 /* media changed */ -#define ATA_E_UNC 0x40 /* uncorrectable data */ -#define ATA_E_ICRC 0x80 /* UDMA crc error */ -#define ATA_E_ATAPI_SENSE_MASK 0xf0 /* ATAPI sense key mask */ +#define ATA_ERROR 8 /* (R) error */ +#define ATA_E_ILI 0x01 /* illegal length */ +#define ATA_E_NM 0x02 /* no media */ +#define ATA_E_ABORT 0x04 /* command aborted */ +#define ATA_E_MCR 0x08 /* media change request */ +#define ATA_E_IDNF 0x10 /* ID not found */ +#define ATA_E_MC 0x20 /* media changed */ +#define ATA_E_UNC 0x40 /* uncorrectable data */ +#define ATA_E_ICRC 0x80 /* UDMA crc error */ +#define ATA_E_ATAPI_SENSE_MASK 0xf0 /* ATAPI sense key mask */ -#define ATA_IREASON 9 /* (R) interrupt reason */ -#define ATA_I_CMD 0x01 /* cmd (1) | data (0) */ -#define ATA_I_IN 0x02 /* read (1) | write (0) */ -#define ATA_I_RELEASE 0x04 /* released bus (1) */ -#define ATA_I_TAGMASK 0xf8 /* tag mask */ +#define ATA_IREASON 9 /* (R) interrupt reason */ +#define ATA_I_CMD 0x01 /* cmd (1) | data (0) */ +#define ATA_I_IN 0x02 /* read (1) | write (0) */ +#define ATA_I_RELEASE 0x04 /* released bus (1) */ +#define ATA_I_TAGMASK 0xf8 /* tag mask */ -#define ATA_STATUS 10 /* (R) status */ -#define ATA_ALTSTAT 11 /* (R) alternate status */ -#define ATA_S_ERROR 0x01 /* error */ -#define ATA_S_INDEX 0x02 /* index */ -#define ATA_S_CORR 0x04 /* data corrected */ -#define ATA_S_DRQ 0x08 /* data request */ -#define ATA_S_DSC 0x10 /* drive seek completed */ -#define ATA_S_SERVICE 0x10 /* drive needs service */ -#define ATA_S_DWF 0x20 /* drive write fault */ -#define ATA_S_DMA 0x20 /* DMA ready */ -#define ATA_S_READY 0x40 /* drive ready */ -#define ATA_S_BUSY 0x80 /* busy */ +#define ATA_STATUS 10 /* (R) status */ +#define ATA_ALTSTAT 11 /* (R) alternate status */ +#define ATA_S_ERROR 0x01 /* error */ +#define ATA_S_INDEX 0x02 /* index */ +#define ATA_S_CORR 0x04 /* data corrected */ +#define ATA_S_DRQ 0x08 /* data request */ +#define ATA_S_DSC 0x10 /* drive seek completed */ +#define ATA_S_SERVICE 0x10 /* drive needs service */ +#define ATA_S_DWF 0x20 /* drive write fault */ +#define ATA_S_DMA 0x20 /* DMA ready */ +#define ATA_S_READY 0x40 /* drive ready */ +#define ATA_S_BUSY 0x80 /* busy */ -#define ATA_CONTROL 12 /* (W) control */ -#define ATA_A_IDS 0x02 /* disable interrupts */ -#define ATA_A_RESET 0x04 /* RESET controller */ -#define ATA_A_4BIT 0x08 /* 4 head bits */ -#define ATA_A_HOB 0x80 /* High Order Byte enable */ +#define ATA_CONTROL 12 /* (W) control */ +#define ATA_A_IDS 0x02 /* disable interrupts */ +#define ATA_A_RESET 0x04 /* RESET controller */ +#define ATA_A_4BIT 0x08 /* 4 head bits */ +#define ATA_A_HOB 0x80 /* High Order Byte enable */ /* SATA register defines */ -#define ATA_SSTATUS 13 -#define ATA_SS_DET_MASK 0x0000000f -#define ATA_SS_DET_NO_DEVICE 0x00000000 -#define ATA_SS_DET_DEV_PRESENT 0x00000001 -#define ATA_SS_DET_PHY_ONLINE 0x00000003 -#define ATA_SS_DET_PHY_OFFLINE 0x00000004 +#define ATA_SSTATUS 13 +#define ATA_SS_DET_MASK 0x0000000f +#define ATA_SS_DET_NO_DEVICE 0x00000000 +#define ATA_SS_DET_DEV_PRESENT 0x00000001 +#define ATA_SS_DET_PHY_ONLINE 0x00000003 +#define ATA_SS_DET_PHY_OFFLINE 0x00000004 -#define ATA_SS_SPD_MASK 0x000000f0 -#define ATA_SS_SPD_NO_SPEED 0x00000000 -#define ATA_SS_SPD_GEN1 0x00000010 -#define ATA_SS_SPD_GEN2 0x00000020 -#define ATA_SS_SPD_GEN3 0x00000030 +#define ATA_SS_SPD_MASK 0x000000f0 +#define ATA_SS_SPD_NO_SPEED 0x00000000 +#define ATA_SS_SPD_GEN1 0x00000010 +#define ATA_SS_SPD_GEN2 0x00000020 +#define ATA_SS_SPD_GEN3 0x00000030 -#define ATA_SS_IPM_MASK 0x00000f00 -#define ATA_SS_IPM_NO_DEVICE 0x00000000 -#define ATA_SS_IPM_ACTIVE 0x00000100 -#define ATA_SS_IPM_PARTIAL 0x00000200 -#define ATA_SS_IPM_SLUMBER 0x00000600 -#define ATA_SS_IPM_DEVSLEEP 0x00000800 +#define ATA_SS_IPM_MASK 0x00000f00 +#define ATA_SS_IPM_NO_DEVICE 0x00000000 +#define ATA_SS_IPM_ACTIVE 0x00000100 +#define ATA_SS_IPM_PARTIAL 0x00000200 +#define ATA_SS_IPM_SLUMBER 0x00000600 +#define ATA_SS_IPM_DEVSLEEP 0x00000800 -#define ATA_SERROR 14 -#define ATA_SE_DATA_CORRECTED 0x00000001 -#define ATA_SE_COMM_CORRECTED 0x00000002 -#define ATA_SE_DATA_ERR 0x00000100 -#define ATA_SE_COMM_ERR 0x00000200 -#define ATA_SE_PROT_ERR 0x00000400 -#define ATA_SE_HOST_ERR 0x00000800 -#define ATA_SE_PHY_CHANGED 0x00010000 -#define ATA_SE_PHY_IERROR 0x00020000 -#define ATA_SE_COMM_WAKE 0x00040000 -#define ATA_SE_DECODE_ERR 0x00080000 -#define ATA_SE_PARITY_ERR 0x00100000 -#define ATA_SE_CRC_ERR 0x00200000 -#define ATA_SE_HANDSHAKE_ERR 0x00400000 -#define ATA_SE_LINKSEQ_ERR 0x00800000 -#define ATA_SE_TRANSPORT_ERR 0x01000000 -#define ATA_SE_UNKNOWN_FIS 0x02000000 -#define ATA_SE_EXCHANGED 0x04000000 +#define ATA_SERROR 14 +#define ATA_SE_DATA_CORRECTED 0x00000001 +#define ATA_SE_COMM_CORRECTED 0x00000002 +#define ATA_SE_DATA_ERR 0x00000100 +#define ATA_SE_COMM_ERR 0x00000200 +#define ATA_SE_PROT_ERR 0x00000400 +#define ATA_SE_HOST_ERR 0x00000800 +#define ATA_SE_PHY_CHANGED 0x00010000 +#define ATA_SE_PHY_IERROR 0x00020000 +#define ATA_SE_COMM_WAKE 0x00040000 +#define ATA_SE_DECODE_ERR 0x00080000 +#define ATA_SE_PARITY_ERR 0x00100000 +#define ATA_SE_CRC_ERR 0x00200000 +#define ATA_SE_HANDSHAKE_ERR 0x00400000 +#define ATA_SE_LINKSEQ_ERR 0x00800000 +#define ATA_SE_TRANSPORT_ERR 0x01000000 +#define ATA_SE_UNKNOWN_FIS 0x02000000 +#define ATA_SE_EXCHANGED 0x04000000 -#define ATA_SCONTROL 15 -#define ATA_SC_DET_MASK 0x0000000f -#define ATA_SC_DET_IDLE 0x00000000 -#define ATA_SC_DET_RESET 0x00000001 -#define ATA_SC_DET_DISABLE 0x00000004 +#define ATA_SCONTROL 15 +#define ATA_SC_DET_MASK 0x0000000f +#define ATA_SC_DET_IDLE 0x00000000 +#define ATA_SC_DET_RESET 0x00000001 +#define ATA_SC_DET_DISABLE 0x00000004 -#define ATA_SC_SPD_MASK 0x000000f0 -#define ATA_SC_SPD_NO_SPEED 0x00000000 -#define ATA_SC_SPD_SPEED_GEN1 0x00000010 -#define ATA_SC_SPD_SPEED_GEN2 0x00000020 -#define ATA_SC_SPD_SPEED_GEN3 0x00000030 +#define ATA_SC_SPD_MASK 0x000000f0 +#define ATA_SC_SPD_NO_SPEED 0x00000000 +#define ATA_SC_SPD_SPEED_GEN1 0x00000010 +#define ATA_SC_SPD_SPEED_GEN2 0x00000020 +#define ATA_SC_SPD_SPEED_GEN3 0x00000030 -#define ATA_SC_IPM_MASK 0x00000f00 -#define ATA_SC_IPM_NONE 0x00000000 -#define ATA_SC_IPM_DIS_PARTIAL 0x00000100 -#define ATA_SC_IPM_DIS_SLUMBER 0x00000200 -#define ATA_SC_IPM_DIS_DEVSLEEP 0x00000400 +#define ATA_SC_IPM_MASK 0x00000f00 +#define ATA_SC_IPM_NONE 0x00000000 +#define ATA_SC_IPM_DIS_PARTIAL 0x00000100 +#define ATA_SC_IPM_DIS_SLUMBER 0x00000200 +#define ATA_SC_IPM_DIS_DEVSLEEP 0x00000400 -#define ATA_SACTIVE 16 +#define ATA_SACTIVE 16 -#define AHCI_MAX_PORTS 32 -#define AHCI_MAX_SLOTS 32 -#define AHCI_MAX_IRQS 16 +#define AHCI_MAX_PORTS 32 +#define AHCI_MAX_SLOTS 32 +#define AHCI_MAX_IRQS 16 /* SATA AHCI v1.0 register defines */ -#define AHCI_CAP 0x00 -#define AHCI_CAP_NPMASK 0x0000001f -#define AHCI_CAP_SXS 0x00000020 -#define AHCI_CAP_EMS 0x00000040 -#define AHCI_CAP_CCCS 0x00000080 -#define AHCI_CAP_NCS 0x00001F00 -#define AHCI_CAP_NCS_SHIFT 8 -#define AHCI_CAP_PSC 0x00002000 -#define AHCI_CAP_SSC 0x00004000 -#define AHCI_CAP_PMD 0x00008000 -#define AHCI_CAP_FBSS 0x00010000 -#define AHCI_CAP_SPM 0x00020000 -#define AHCI_CAP_SAM 0x00080000 -#define AHCI_CAP_ISS 0x00F00000 -#define AHCI_CAP_ISS_SHIFT 20 -#define AHCI_CAP_SCLO 0x01000000 -#define AHCI_CAP_SAL 0x02000000 -#define AHCI_CAP_SALP 0x04000000 -#define AHCI_CAP_SSS 0x08000000 -#define AHCI_CAP_SMPS 0x10000000 -#define AHCI_CAP_SSNTF 0x20000000 -#define AHCI_CAP_SNCQ 0x40000000 -#define AHCI_CAP_64BIT 0x80000000 +#define AHCI_CAP 0x00 +#define AHCI_CAP_NPMASK 0x0000001f +#define AHCI_CAP_SXS 0x00000020 +#define AHCI_CAP_EMS 0x00000040 +#define AHCI_CAP_CCCS 0x00000080 +#define AHCI_CAP_NCS 0x00001F00 +#define AHCI_CAP_NCS_SHIFT 8 +#define AHCI_CAP_PSC 0x00002000 +#define AHCI_CAP_SSC 0x00004000 +#define AHCI_CAP_PMD 0x00008000 +#define AHCI_CAP_FBSS 0x00010000 +#define AHCI_CAP_SPM 0x00020000 +#define AHCI_CAP_SAM 0x00080000 +#define AHCI_CAP_ISS 0x00F00000 +#define AHCI_CAP_ISS_SHIFT 20 +#define AHCI_CAP_SCLO 0x01000000 +#define AHCI_CAP_SAL 0x02000000 +#define AHCI_CAP_SALP 0x04000000 +#define AHCI_CAP_SSS 0x08000000 +#define AHCI_CAP_SMPS 0x10000000 +#define AHCI_CAP_SSNTF 0x20000000 +#define AHCI_CAP_SNCQ 0x40000000 +#define AHCI_CAP_64BIT 0x80000000 -#define AHCI_GHC 0x04 -#define AHCI_GHC_AE 0x80000000 -#define AHCI_GHC_MRSM 0x00000004 -#define AHCI_GHC_IE 0x00000002 -#define AHCI_GHC_HR 0x00000001 +#define AHCI_GHC 0x04 +#define AHCI_GHC_AE 0x80000000 +#define AHCI_GHC_MRSM 0x00000004 +#define AHCI_GHC_IE 0x00000002 +#define AHCI_GHC_HR 0x00000001 -#define AHCI_IS 0x08 -#define AHCI_PI 0x0c -#define AHCI_VS 0x10 +#define AHCI_IS 0x08 +#define AHCI_PI 0x0c +#define AHCI_VS 0x10 -#define AHCI_CCCC 0x14 -#define AHCI_CCCC_TV_MASK 0xffff0000 -#define AHCI_CCCC_TV_SHIFT 16 -#define AHCI_CCCC_CC_MASK 0x0000ff00 -#define AHCI_CCCC_CC_SHIFT 8 -#define AHCI_CCCC_INT_MASK 0x000000f8 -#define AHCI_CCCC_INT_SHIFT 3 -#define AHCI_CCCC_EN 0x00000001 -#define AHCI_CCCP 0x18 +#define AHCI_CCCC 0x14 +#define AHCI_CCCC_TV_MASK 0xffff0000 +#define AHCI_CCCC_TV_SHIFT 16 +#define AHCI_CCCC_CC_MASK 0x0000ff00 +#define AHCI_CCCC_CC_SHIFT 8 +#define AHCI_CCCC_INT_MASK 0x000000f8 +#define AHCI_CCCC_INT_SHIFT 3 +#define AHCI_CCCC_EN 0x00000001 +#define AHCI_CCCP 0x18 -#define AHCI_EM_LOC 0x1C -#define AHCI_EM_CTL 0x20 -#define AHCI_EM_MR 0x00000001 -#define AHCI_EM_TM 0x00000100 -#define AHCI_EM_RST 0x00000200 -#define AHCI_EM_LED 0x00010000 -#define AHCI_EM_SAFTE 0x00020000 -#define AHCI_EM_SES2 0x00040000 -#define AHCI_EM_SGPIO 0x00080000 -#define AHCI_EM_SMB 0x01000000 -#define AHCI_EM_XMT 0x02000000 -#define AHCI_EM_ALHD 0x04000000 -#define AHCI_EM_PM 0x08000000 +#define AHCI_EM_LOC 0x1C +#define AHCI_EM_CTL 0x20 +#define AHCI_EM_MR 0x00000001 +#define AHCI_EM_TM 0x00000100 +#define AHCI_EM_RST 0x00000200 +#define AHCI_EM_LED 0x00010000 +#define AHCI_EM_SAFTE 0x00020000 +#define AHCI_EM_SES2 0x00040000 +#define AHCI_EM_SGPIO 0x00080000 +#define AHCI_EM_SMB 0x01000000 +#define AHCI_EM_XMT 0x02000000 +#define AHCI_EM_ALHD 0x04000000 +#define AHCI_EM_PM 0x08000000 -#define AHCI_CAP2 0x24 -#define AHCI_CAP2_BOH 0x00000001 -#define AHCI_CAP2_NVMP 0x00000002 -#define AHCI_CAP2_APST 0x00000004 -#define AHCI_CAP2_SDS 0x00000008 -#define AHCI_CAP2_SADM 0x00000010 -#define AHCI_CAP2_DESO 0x00000020 +#define AHCI_CAP2 0x24 +#define AHCI_CAP2_BOH 0x00000001 +#define AHCI_CAP2_NVMP 0x00000002 +#define AHCI_CAP2_APST 0x00000004 +#define AHCI_CAP2_SDS 0x00000008 +#define AHCI_CAP2_SADM 0x00000010 +#define AHCI_CAP2_DESO 0x00000020 -#define AHCI_OFFSET 0x100 -#define AHCI_STEP 0x80 +#define AHCI_OFFSET 0x100 +#define AHCI_STEP 0x80 -#define AHCI_P_CLB 0x00 -#define AHCI_P_CLBU 0x04 -#define AHCI_P_FB 0x08 -#define AHCI_P_FBU 0x0c -#define AHCI_P_IS 0x10 -#define AHCI_P_IE 0x14 -#define AHCI_P_IX_DHR 0x00000001 -#define AHCI_P_IX_PS 0x00000002 -#define AHCI_P_IX_DS 0x00000004 -#define AHCI_P_IX_SDB 0x00000008 -#define AHCI_P_IX_UF 0x00000010 -#define AHCI_P_IX_DP 0x00000020 -#define AHCI_P_IX_PC 0x00000040 -#define AHCI_P_IX_MP 0x00000080 +#define AHCI_P_CLB 0x00 +#define AHCI_P_CLBU 0x04 +#define AHCI_P_FB 0x08 +#define AHCI_P_FBU 0x0c +#define AHCI_P_IS 0x10 +#define AHCI_P_IE 0x14 +#define AHCI_P_IX_DHR 0x00000001 +#define AHCI_P_IX_PS 0x00000002 +#define AHCI_P_IX_DS 0x00000004 +#define AHCI_P_IX_SDB 0x00000008 +#define AHCI_P_IX_UF 0x00000010 +#define AHCI_P_IX_DP 0x00000020 +#define AHCI_P_IX_PC 0x00000040 +#define AHCI_P_IX_MP 0x00000080 -#define AHCI_P_IX_PRC 0x00400000 -#define AHCI_P_IX_IPM 0x00800000 -#define AHCI_P_IX_OF 0x01000000 -#define AHCI_P_IX_INF 0x04000000 -#define AHCI_P_IX_IF 0x08000000 -#define AHCI_P_IX_HBD 0x10000000 -#define AHCI_P_IX_HBF 0x20000000 -#define AHCI_P_IX_TFE 0x40000000 -#define AHCI_P_IX_CPD 0x80000000 +#define AHCI_P_IX_PRC 0x00400000 +#define AHCI_P_IX_IPM 0x00800000 +#define AHCI_P_IX_OF 0x01000000 +#define AHCI_P_IX_INF 0x04000000 +#define AHCI_P_IX_IF 0x08000000 +#define AHCI_P_IX_HBD 0x10000000 +#define AHCI_P_IX_HBF 0x20000000 +#define AHCI_P_IX_TFE 0x40000000 +#define AHCI_P_IX_CPD 0x80000000 -#define AHCI_P_CMD 0x18 -#define AHCI_P_CMD_ST 0x00000001 -#define AHCI_P_CMD_SUD 0x00000002 -#define AHCI_P_CMD_POD 0x00000004 -#define AHCI_P_CMD_CLO 0x00000008 -#define AHCI_P_CMD_FRE 0x00000010 -#define AHCI_P_CMD_CCS_MASK 0x00001f00 -#define AHCI_P_CMD_CCS_SHIFT 8 -#define AHCI_P_CMD_ISS 0x00002000 -#define AHCI_P_CMD_FR 0x00004000 -#define AHCI_P_CMD_CR 0x00008000 -#define AHCI_P_CMD_CPS 0x00010000 -#define AHCI_P_CMD_PMA 0x00020000 -#define AHCI_P_CMD_HPCP 0x00040000 -#define AHCI_P_CMD_MPSP 0x00080000 -#define AHCI_P_CMD_CPD 0x00100000 -#define AHCI_P_CMD_ESP 0x00200000 -#define AHCI_P_CMD_FBSCP 0x00400000 -#define AHCI_P_CMD_APSTE 0x00800000 -#define AHCI_P_CMD_ATAPI 0x01000000 -#define AHCI_P_CMD_DLAE 0x02000000 -#define AHCI_P_CMD_ALPE 0x04000000 -#define AHCI_P_CMD_ASP 0x08000000 -#define AHCI_P_CMD_ICC_MASK 0xf0000000 -#define AHCI_P_CMD_NOOP 0x00000000 -#define AHCI_P_CMD_ACTIVE 0x10000000 -#define AHCI_P_CMD_PARTIAL 0x20000000 -#define AHCI_P_CMD_SLUMBER 0x60000000 -#define AHCI_P_CMD_DEVSLEEP 0x80000000 +#define AHCI_P_CMD 0x18 +#define AHCI_P_CMD_ST 0x00000001 +#define AHCI_P_CMD_SUD 0x00000002 +#define AHCI_P_CMD_POD 0x00000004 +#define AHCI_P_CMD_CLO 0x00000008 +#define AHCI_P_CMD_FRE 0x00000010 +#define AHCI_P_CMD_CCS_MASK 0x00001f00 +#define AHCI_P_CMD_CCS_SHIFT 8 +#define AHCI_P_CMD_ISS 0x00002000 +#define AHCI_P_CMD_FR 0x00004000 +#define AHCI_P_CMD_CR 0x00008000 +#define AHCI_P_CMD_CPS 0x00010000 +#define AHCI_P_CMD_PMA 0x00020000 +#define AHCI_P_CMD_HPCP 0x00040000 +#define AHCI_P_CMD_MPSP 0x00080000 +#define AHCI_P_CMD_CPD 0x00100000 +#define AHCI_P_CMD_ESP 0x00200000 +#define AHCI_P_CMD_FBSCP 0x00400000 +#define AHCI_P_CMD_APSTE 0x00800000 +#define AHCI_P_CMD_ATAPI 0x01000000 +#define AHCI_P_CMD_DLAE 0x02000000 +#define AHCI_P_CMD_ALPE 0x04000000 +#define AHCI_P_CMD_ASP 0x08000000 +#define AHCI_P_CMD_ICC_MASK 0xf0000000 +#define AHCI_P_CMD_NOOP 0x00000000 +#define AHCI_P_CMD_ACTIVE 0x10000000 +#define AHCI_P_CMD_PARTIAL 0x20000000 +#define AHCI_P_CMD_SLUMBER 0x60000000 +#define AHCI_P_CMD_DEVSLEEP 0x80000000 -#define AHCI_P_TFD 0x20 -#define AHCI_P_SIG 0x24 -#define AHCI_P_SSTS 0x28 -#define AHCI_P_SCTL 0x2c -#define AHCI_P_SERR 0x30 -#define AHCI_P_SACT 0x34 -#define AHCI_P_CI 0x38 -#define AHCI_P_SNTF 0x3C -#define AHCI_P_FBS 0x40 -#define AHCI_P_FBS_EN 0x00000001 -#define AHCI_P_FBS_DEC 0x00000002 -#define AHCI_P_FBS_SDE 0x00000004 -#define AHCI_P_FBS_DEV 0x00000f00 -#define AHCI_P_FBS_DEV_SHIFT 8 -#define AHCI_P_FBS_ADO 0x0000f000 -#define AHCI_P_FBS_ADO_SHIFT 12 -#define AHCI_P_FBS_DWE 0x000f0000 -#define AHCI_P_FBS_DWE_SHIFT 16 -#define AHCI_P_DEVSLP 0x44 -#define AHCI_P_DEVSLP_ADSE 0x00000001 -#define AHCI_P_DEVSLP_DSP 0x00000002 -#define AHCI_P_DEVSLP_DETO 0x000003fc -#define AHCI_P_DEVSLP_DETO_SHIFT 2 -#define AHCI_P_DEVSLP_MDAT 0x00007c00 -#define AHCI_P_DEVSLP_MDAT_SHIFT 10 -#define AHCI_P_DEVSLP_DITO 0x01ff8000 -#define AHCI_P_DEVSLP_DITO_SHIFT 15 -#define AHCI_P_DEVSLP_DM 0x0e000000 -#define AHCI_P_DEVSLP_DM_SHIFT 25 +#define AHCI_P_TFD 0x20 +#define AHCI_P_SIG 0x24 +#define AHCI_P_SSTS 0x28 +#define AHCI_P_SCTL 0x2c +#define AHCI_P_SERR 0x30 +#define AHCI_P_SACT 0x34 +#define AHCI_P_CI 0x38 +#define AHCI_P_SNTF 0x3C +#define AHCI_P_FBS 0x40 +#define AHCI_P_FBS_EN 0x00000001 +#define AHCI_P_FBS_DEC 0x00000002 +#define AHCI_P_FBS_SDE 0x00000004 +#define AHCI_P_FBS_DEV 0x00000f00 +#define AHCI_P_FBS_DEV_SHIFT 8 +#define AHCI_P_FBS_ADO 0x0000f000 +#define AHCI_P_FBS_ADO_SHIFT 12 +#define AHCI_P_FBS_DWE 0x000f0000 +#define AHCI_P_FBS_DWE_SHIFT 16 +#define AHCI_P_DEVSLP 0x44 +#define AHCI_P_DEVSLP_ADSE 0x00000001 +#define AHCI_P_DEVSLP_DSP 0x00000002 +#define AHCI_P_DEVSLP_DETO 0x000003fc +#define AHCI_P_DEVSLP_DETO_SHIFT 2 +#define AHCI_P_DEVSLP_MDAT 0x00007c00 +#define AHCI_P_DEVSLP_MDAT_SHIFT 10 +#define AHCI_P_DEVSLP_DITO 0x01ff8000 +#define AHCI_P_DEVSLP_DITO_SHIFT 15 +#define AHCI_P_DEVSLP_DM 0x0e000000 +#define AHCI_P_DEVSLP_DM_SHIFT 25 /* Just to be sure, if building as module. */ #if MAXPHYS < 512 * 1024 #undef MAXPHYS -#define MAXPHYS 512 * 1024 +#define MAXPHYS 512 * 1024 #endif /* Pessimistic prognosis on number of required S/G entries */ -#define AHCI_SG_ENTRIES (roundup(btoc(MAXPHYS) + 1, 8)) +#define AHCI_SG_ENTRIES (roundup(btoc(MAXPHYS) + 1, 8)) /* Command list. 32 commands. First, 1Kbyte aligned. */ -#define AHCI_CL_OFFSET 0 -#define AHCI_CL_SIZE 32 +#define AHCI_CL_OFFSET 0 +#define AHCI_CL_SIZE 32 /* Command tables. Up to 32 commands, Each, 128byte aligned. */ -#define AHCI_CT_OFFSET (AHCI_CL_OFFSET + AHCI_CL_SIZE * AHCI_MAX_SLOTS) -#define AHCI_CT_SIZE (128 + AHCI_SG_ENTRIES * 16) +#define AHCI_CT_OFFSET (AHCI_CL_OFFSET + AHCI_CL_SIZE * AHCI_MAX_SLOTS) +#define AHCI_CT_SIZE (128 + AHCI_SG_ENTRIES * 16) /* Total main work area. */ -#define AHCI_WORK_SIZE (AHCI_CT_OFFSET + AHCI_CT_SIZE * ch->numslots) +#define AHCI_WORK_SIZE (AHCI_CT_OFFSET + AHCI_CT_SIZE * ch->numslots) #endif /* _AHCI_H_ */ Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Thu Jun 14 01:28:55 2018 (r335103) +++ head/usr.sbin/bhyve/bhyverun.c Thu Jun 14 01:34:53 2018 (r335104) @@ -118,14 +118,14 @@ static void vm_loop(struct vmctx *ctx, int vcpu, uint6 static struct vm_exit vmexit[VM_MAXCPU]; struct bhyvestats { - uint64_t vmexit_bogus; + uint64_t vmexit_bogus; uint64_t vmexit_reqidle; - uint64_t vmexit_hlt; - uint64_t vmexit_pause; - uint64_t vmexit_mtrap; - uint64_t vmexit_inst_emul; - uint64_t cpu_switch_rotate; - uint64_t cpu_switch_direct; + uint64_t vmexit_hlt; + uint64_t vmexit_pause; + uint64_t vmexit_mtrap; + uint64_t vmexit_inst_emul; + uint64_t cpu_switch_rotate; + uint64_t cpu_switch_direct; } stats; struct mt_vmm_info { @@ -413,7 +413,7 @@ vmexit_handle_notify(struct vmctx *ctx, struct vm_exit * put guest-driven debug here */ #endif - return (VMEXIT_CONTINUE); + return (VMEXIT_CONTINUE); } static int Modified: head/usr.sbin/bhyve/block_if.c ============================================================================== --- head/usr.sbin/bhyve/block_if.c Thu Jun 14 01:28:55 2018 (r335103) +++ head/usr.sbin/bhyve/block_if.c Thu Jun 14 01:34:53 2018 (r335104) @@ -101,8 +101,8 @@ struct blockif_ctxt { int bc_psectoff; int bc_closing; pthread_t bc_btid[BLOCKIF_NUMTHR]; - pthread_mutex_t bc_mtx; - pthread_cond_t bc_cond; + pthread_mutex_t bc_mtx; + pthread_cond_t bc_cond; /* Request elements and free/pending/busy queues */ TAILQ_HEAD(, blockif_elem) bc_freeq; Modified: head/usr.sbin/bhyve/bootrom.h ============================================================================== --- head/usr.sbin/bhyve/bootrom.h Thu Jun 14 01:28:55 2018 (r335103) +++ head/usr.sbin/bhyve/bootrom.h Thu Jun 14 01:34:53 2018 (r335104) @@ -35,6 +35,6 @@ struct vmctx; -int bootrom_init(struct vmctx *ctx, const char *romfile); +int bootrom_init(struct vmctx *ctx, const char *romfile); #endif Modified: head/usr.sbin/bhyve/console.h ============================================================================== --- head/usr.sbin/bhyve/console.h Thu Jun 14 01:28:55 2018 (r335103) +++ head/usr.sbin/bhyve/console.h Thu Jun 14 01:34:53 2018 (r335104) @@ -37,19 +37,19 @@ typedef void (*fb_render_func_t)(struct bhyvegc *gc, v typedef void (*kbd_event_func_t)(int down, uint32_t keysym, void *arg); typedef void (*ptr_event_func_t)(uint8_t mask, int x, int y, void *arg); -void console_init(int w, int h, void *fbaddr); +void console_init(int w, int h, void *fbaddr); -void console_set_fbaddr(void *fbaddr); +void console_set_fbaddr(void *fbaddr); struct bhyvegc_image *console_get_image(void); -void console_fb_register(fb_render_func_t render_cb, void *arg); -void console_refresh(void); +void console_fb_register(fb_render_func_t render_cb, void *arg); +void console_refresh(void); -void console_kbd_register(kbd_event_func_t event_cb, void *arg, int pri); -void console_key_event(int down, uint32_t keysym); +void console_kbd_register(kbd_event_func_t event_cb, void *arg, int pri); +void console_key_event(int down, uint32_t keysym); -void console_ptr_register(ptr_event_func_t event_cb, void *arg, int pri); -void console_ptr_event(uint8_t button, int x, int y); +void console_ptr_register(ptr_event_func_t event_cb, void *arg, int pri); +void console_ptr_event(uint8_t button, int x, int y); #endif /* _CONSOLE_H_ */ Modified: head/usr.sbin/bhyve/consport.c ============================================================================== --- head/usr.sbin/bhyve/consport.c Thu Jun 14 01:28:55 2018 (r335103) +++ head/usr.sbin/bhyve/consport.c Thu Jun 14 01:34:53 2018 (r335104) @@ -74,14 +74,14 @@ ttyopen(void) static bool tty_char_available(void) { - fd_set rfds; - struct timeval tv; + fd_set rfds; + struct timeval tv; - FD_ZERO(&rfds); - FD_SET(STDIN_FILENO, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - if (select(STDIN_FILENO + 1, &rfds, NULL, NULL, &tv) > 0) { + FD_ZERO(&rfds); + FD_SET(STDIN_FILENO, &rfds); + tv.tv_sec = 0; + tv.tv_usec = 0; + if (select(STDIN_FILENO + 1, &rfds, NULL, NULL, &tv) > 0) { return (true); } else { return (false); Modified: head/usr.sbin/bhyve/inout.c ============================================================================== --- head/usr.sbin/bhyve/inout.c Thu Jun 14 01:28:55 2018 (r335103) +++ head/usr.sbin/bhyve/inout.c Thu Jun 14 01:34:53 2018 (r335104) @@ -68,21 +68,21 @@ static int default_inout(struct vmctx *ctx, int vcpu, int in, int port, int bytes, uint32_t *eax, void *arg) { - if (in) { - switch (bytes) { - case 4: - *eax = 0xffffffff; - break; - case 2: - *eax = 0xffff; - break; - case 1: - *eax = 0xff; - break; - } - } - - return (0); + if (in) { + switch (bytes) { + case 4: + *eax = 0xffffffff; + break; + case 2: + *eax = 0xffff; + break; + case 1: + *eax = 0xff; + break; + } + } + + return (0); } static void Modified: head/usr.sbin/bhyve/mem.h ============================================================================== --- head/usr.sbin/bhyve/mem.h Thu Jun 14 01:28:55 2018 (r335103) +++ head/usr.sbin/bhyve/mem.h Thu Jun 14 01:34:53 2018 (r335104) @@ -55,7 +55,7 @@ struct mem_range { void init_mem(void); int emulate_mem(struct vmctx *, int vcpu, uint64_t paddr, struct vie *vie, struct vm_guest_paging *paging); - + int read_mem(struct vmctx *ctx, int vcpu, uint64_t gpa, uint64_t *rval, int size); int register_mem(struct mem_range *memp); Modified: head/usr.sbin/bhyve/mevent.c ============================================================================== --- head/usr.sbin/bhyve/mevent.c Thu Jun 14 01:28:55 2018 (r335103) +++ head/usr.sbin/bhyve/mevent.c Thu Jun 14 01:34:53 2018 (r335104) @@ -71,7 +71,7 @@ static int mevent_timid = 43; static int mevent_pipefd[2]; static pthread_mutex_t mevent_lmutex = PTHREAD_MUTEX_INITIALIZER; -struct mevent { +struct mevent { void (*me_func)(int, enum ev_type, void *); #define me_msecs me_fd int me_fd; @@ -81,7 +81,7 @@ struct mevent { int me_cq; int me_state; int me_closefd; - LIST_ENTRY(mevent) me_list; + LIST_ENTRY(mevent) me_list; }; static LIST_HEAD(listhead, mevent) global_head, change_head; Modified: head/usr.sbin/bhyve/mevent_test.c ============================================================================== --- head/usr.sbin/bhyve/mevent_test.c Thu Jun 14 01:28:55 2018 (r335103) +++ head/usr.sbin/bhyve/mevent_test.c Thu Jun 14 01:34:53 2018 (r335104) @@ -199,25 +199,25 @@ acceptor(void *param) int s; static int first; - if ((s = socket(AF_INET, SOCK_STREAM, 0)) < 0) { - perror("socket"); - exit(1); - } + if ((s = socket(AF_INET, SOCK_STREAM, 0)) < 0) { + perror("socket"); + exit(1); + } - sin.sin_len = sizeof(sin); - sin.sin_family = AF_INET; - sin.sin_addr.s_addr = htonl(INADDR_ANY); - sin.sin_port = htons(TEST_PORT); + sin.sin_len = sizeof(sin); + sin.sin_family = AF_INET; + sin.sin_addr.s_addr = htonl(INADDR_ANY); + sin.sin_port = htons(TEST_PORT); - if (bind(s, (struct sockaddr *)&sin, sizeof(sin)) < 0) { - perror("bind"); - exit(1); - } + if (bind(s, (struct sockaddr *)&sin, sizeof(sin)) < 0) { + perror("bind"); + exit(1); + } - if (listen(s, 1) < 0) { - perror("listen"); - exit(1); - } + if (listen(s, 1) < 0) { + perror("listen"); + exit(1); + } (void) mevent_add(s, EVF_READ, acceptor_callback, NULL); Modified: head/usr.sbin/bhyve/pci_e82545.c ============================================================================== --- head/usr.sbin/bhyve/pci_e82545.c Thu Jun 14 01:28:55 2018 (r335103) +++ head/usr.sbin/bhyve/pci_e82545.c Thu Jun 14 01:34:53 2018 (r335104) @@ -344,8 +344,8 @@ struct e82545_softc { #define E82545_NVM_MODE_OPADDR 0x0 #define E82545_NVM_MODE_DATAIN 0x1 #define E82545_NVM_MODE_DATAOUT 0x2 - /* EEPROM data */ - uint16_t eeprom_data[E82545_NVM_EEPROM_SIZE]; + /* EEPROM data */ + uint16_t eeprom_data[E82545_NVM_EEPROM_SIZE]; }; static void e82545_reset(struct e82545_softc *sc, int dev); @@ -1472,7 +1472,7 @@ e82545_rx_disable(struct e82545_softc *sc) static void e82545_write_ra(struct e82545_softc *sc, int reg, uint32_t wval) { - struct eth_uni *eu; + struct eth_uni *eu; int idx; idx = reg >> 1; @@ -1498,7 +1498,7 @@ e82545_write_ra(struct e82545_softc *sc, int reg, uint static uint32_t e82545_read_ra(struct e82545_softc *sc, int reg) { - struct eth_uni *eu; + struct eth_uni *eu; uint32_t retval; int idx; @@ -1742,12 +1742,12 @@ e82545_read_register(struct e82545_softc *sc, uint32_t { uint32_t retval; int ridx; - + if (offset & 0x3) { DPRINTF("Unaligned register read offset:0x%x\r\n", offset); return 0; } - + DPRINTF("Register read: 0x%x\r\n", offset); switch (offset) { Modified: head/usr.sbin/bhyve/pci_emul.c ============================================================================== --- head/usr.sbin/bhyve/pci_emul.c Thu Jun 14 01:28:55 2018 (r335103) +++ head/usr.sbin/bhyve/pci_emul.c Thu Jun 14 01:34:53 2018 (r335104) @@ -863,7 +863,7 @@ msixcap_cfgwrite(struct pci_devinst *pi, int capoff, i { uint16_t msgctrl, rwmask; int off; - + off = offset - capoff; /* Message Control Register */ if (off == 2 && bytes == 2) { @@ -876,8 +876,8 @@ msixcap_cfgwrite(struct pci_devinst *pi, int capoff, i pi->pi_msix.enabled = val & PCIM_MSIXCTRL_MSIX_ENABLE; pi->pi_msix.function_mask = val & PCIM_MSIXCTRL_FUNCTION_MASK; pci_lintr_update(pi); - } - + } + CFGWRITE(pi, offset, val, bytes); } @@ -1336,11 +1336,11 @@ pci_bus_write_dsdt(int bus) dsdt_line("Name (PPRT, Package ()"); dsdt_line("{"); pci_walk_lintr(bus, pci_pirq_prt_entry, NULL); - dsdt_line("})"); + dsdt_line("})"); dsdt_line("Name (APRT, Package ()"); dsdt_line("{"); pci_walk_lintr(bus, pci_apic_prt_entry, NULL); - dsdt_line("})"); + dsdt_line("})"); dsdt_line("Method (_PRT, 0, NotSerialized)"); dsdt_line("{"); dsdt_line(" If (PICM)"); @@ -1726,7 +1726,7 @@ pci_emul_cmdsts_write(struct pci_devinst *pi, int coff * interrupt. */ pci_lintr_update(pi); -} +} static void pci_cfgrw(struct vmctx *ctx, int vcpu, int in, int bus, int slot, int func, Modified: head/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_net.c Thu Jun 14 01:28:55 2018 (r335103) +++ head/usr.sbin/bhyve/pci_virtio_net.c Thu Jun 14 01:34:53 2018 (r335104) @@ -726,24 +726,24 @@ pci_vtnet_ping_ctlq(void *vsc, struct vqueue_info *vq) static int pci_vtnet_parsemac(char *mac_str, uint8_t *mac_addr) { - struct ether_addr *ea; - char *tmpstr; - char zero_addr[ETHER_ADDR_LEN] = { 0, 0, 0, 0, 0, 0 }; + struct ether_addr *ea; + char *tmpstr; + char zero_addr[ETHER_ADDR_LEN] = { 0, 0, 0, 0, 0, 0 }; - tmpstr = strsep(&mac_str,"="); - - if ((mac_str != NULL) && (!strcmp(tmpstr,"mac"))) { - ea = ether_aton(mac_str); + tmpstr = strsep(&mac_str,"="); - if (ea == NULL || ETHER_IS_MULTICAST(ea->octet) || - memcmp(ea->octet, zero_addr, ETHER_ADDR_LEN) == 0) { + if ((mac_str != NULL) && (!strcmp(tmpstr,"mac"))) { + ea = ether_aton(mac_str); + + if (ea == NULL || ETHER_IS_MULTICAST(ea->octet) || + memcmp(ea->octet, zero_addr, ETHER_ADDR_LEN) == 0) { fprintf(stderr, "Invalid MAC %s\n", mac_str); - return (EINVAL); - } else - memcpy(mac_addr, ea->octet, ETHER_ADDR_LEN); - } + return (EINVAL); + } else + memcpy(mac_addr, ea->octet, ETHER_ADDR_LEN); + } - return (0); + return (0); } static void @@ -932,7 +932,7 @@ pci_vtnet_init(struct vmctx *ctx, struct pci_devinst * pthread_create(&sc->tx_tid, NULL, pci_vtnet_tx_thread, (void *)sc); snprintf(tname, sizeof(tname), "vtnet-%d:%d tx", pi->pi_slot, pi->pi_func); - pthread_set_name_np(sc->tx_tid, tname); + pthread_set_name_np(sc->tx_tid, tname); return (0); } Modified: head/usr.sbin/bhyve/pci_xhci.c ============================================================================== --- head/usr.sbin/bhyve/pci_xhci.c Thu Jun 14 01:28:55 2018 (r335103) +++ head/usr.sbin/bhyve/pci_xhci.c Thu Jun 14 01:34:53 2018 (r335104) @@ -2212,12 +2212,12 @@ pci_xhci_write(struct vmctx *ctx, int vcpu, struct pci sc = pi->pi_arg; - assert(baridx == 0); + assert(baridx == 0); - pthread_mutex_lock(&sc->mtx); + pthread_mutex_lock(&sc->mtx); if (offset < XHCI_CAPLEN) /* read only registers */ - WPRINTF(("pci_xhci: write RO-CAPs offset %ld\r\n", offset)); + WPRINTF(("pci_xhci: write RO-CAPs offset %ld\r\n", offset)); else if (offset < sc->dboff) pci_xhci_hostop_write(sc, offset, value); else if (offset < sc->rtsoff) @@ -2225,9 +2225,9 @@ pci_xhci_write(struct vmctx *ctx, int vcpu, struct pci else if (offset < sc->regsend) pci_xhci_rtsregs_write(sc, offset, value); else - WPRINTF(("pci_xhci: write invalid offset %ld\r\n", offset)); + WPRINTF(("pci_xhci: write invalid offset %ld\r\n", offset)); - pthread_mutex_unlock(&sc->mtx); + pthread_mutex_unlock(&sc->mtx); } static uint64_t @@ -2435,9 +2435,9 @@ pci_xhci_read(struct vmctx *ctx, int vcpu, struct pci_ sc = pi->pi_arg; - assert(baridx == 0); + assert(baridx == 0); - pthread_mutex_lock(&sc->mtx); + pthread_mutex_lock(&sc->mtx); if (offset < XHCI_CAPLEN) value = pci_xhci_hostcap_read(sc, offset); else if (offset < sc->dboff) @@ -2450,10 +2450,10 @@ pci_xhci_read(struct vmctx *ctx, int vcpu, struct pci_ value = pci_xhci_xecp_read(sc, offset); else { value = 0; - WPRINTF(("pci_xhci: read invalid offset %ld\r\n", offset)); + WPRINTF(("pci_xhci: read invalid offset %ld\r\n", offset)); } - pthread_mutex_unlock(&sc->mtx); + pthread_mutex_unlock(&sc->mtx); switch (size) { case 1: Modified: head/usr.sbin/bhyve/rfb.c ============================================================================== --- head/usr.sbin/bhyve/rfb.c Thu Jun 14 01:28:55 2018 (r335103) +++ head/usr.sbin/bhyve/rfb.c Thu Jun 14 01:34:53 2018 (r335104) @@ -74,11 +74,11 @@ static int rfb_debug = 0; #define AUTH_LENGTH 16 #define PASSWD_LENGTH 8 -#define SECURITY_TYPE_NONE 1 -#define SECURITY_TYPE_VNC_AUTH 2 +#define SECURITY_TYPE_NONE 1 +#define SECURITY_TYPE_VNC_AUTH 2 -#define AUTH_FAILED_UNAUTH 1 -#define AUTH_FAILED_ERROR 2 +#define AUTH_FAILED_UNAUTH 1 +#define AUTH_FAILED_ERROR 2 struct rfb_softc { int sfd; @@ -140,12 +140,12 @@ struct rfb_pixfmt_msg { #define RFB_ENCODING_ZLIB 6 #define RFB_ENCODING_RESIZE -223 -#define RFB_MAX_WIDTH 2000 -#define RFB_MAX_HEIGHT 1200 +#define RFB_MAX_WIDTH 2000 +#define RFB_MAX_HEIGHT 1200 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Jun 14 02:14:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F333E10122BA for ; Thu, 14 Jun 2018 02:14:15 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A36EF6B0DD for ; Thu, 14 Jun 2018 02:14:15 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from mail-yb0-f181.google.com (mail-yb0-f181.google.com [209.85.213.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: eadler) by smtp.freebsd.org (Postfix) with ESMTPSA id 6B006AB2F for ; Thu, 14 Jun 2018 02:14:15 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: by mail-yb0-f181.google.com with SMTP id m137-v6so1671960ybm.6 for ; Wed, 13 Jun 2018 19:14:15 -0700 (PDT) X-Gm-Message-State: APt69E1CEAaeAIAwTg9pBTOEnEMkzYTABAqve03gfIgLTKKMy5ofkPVe rqQx846TFOOLbE4E5YlGdQ7pHqG3h7tzNpx75Dul5g== X-Google-Smtp-Source: ADUXVKI/WOtH3MpRNejxBE4GMtJOa3g7pFqPMLK+L5gUigov/DwCx1rsnA2wWMcVr2r5kkB8p1SQt90gluB6YoGQ1AQ= X-Received: by 2002:a25:8751:: with SMTP id e17-v6mr357206ybn.194.1528942454839; Wed, 13 Jun 2018 19:14:14 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ef50:0:0:0:0:0 with HTTP; Wed, 13 Jun 2018 19:13:44 -0700 (PDT) In-Reply-To: References: <201806020325.w523PFKn048824@repo.freebsd.org> From: Eitan Adler Date: Wed, 13 Jun 2018 19:13:44 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334514 - head/usr.bin/top To: Allan Jude Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 02:14:16 -0000 On 13 June 2018 at 17:10, Allan Jude wrote: > > This broke compressed ARC display in top. The sysctl > vfs.zfs.compressed_arc_enabled is backed by a boolean_t (which is the > same size as an int), so trying to read it into a bool (1 byte) fails > and returns ENOMEM. > > Fixed in r335099 Sorry for the breakage and thanks for the fix. As discussed on IRC, the type of the sysctl might change to int (from boolean_t) and we don't have a great way of asserting that the size is right. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@freebsd.org Thu Jun 14 02:30:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E3031013889; Thu, 14 Jun 2018 02:30:44 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E82B16B9CD; Thu, 14 Jun 2018 02:30:43 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C9512221EE; Thu, 14 Jun 2018 02:30:43 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5E2Uhtm035338; Thu, 14 Jun 2018 02:30:43 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5E2UhPG035337; Thu, 14 Jun 2018 02:30:43 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201806140230.w5E2UhPG035337@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 14 Jun 2018 02:30:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335105 - head/tests/sys/audit X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/audit X-SVN-Commit-Revision: 335105 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 02:30:44 -0000 Author: asomers Date: Thu Jun 14 02:30:43 2018 New Revision: 335105 URL: https://svnweb.freebsd.org/changeset/base/335105 Log: audit(4): add tests for statfs(2), fstatfs(2), and getfsstat(2) Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15750 Modified: head/tests/sys/audit/file-attribute-access.c Modified: head/tests/sys/audit/file-attribute-access.c ============================================================================== --- head/tests/sys/audit/file-attribute-access.c Thu Jun 14 01:34:53 2018 (r335104) +++ head/tests/sys/audit/file-attribute-access.c Thu Jun 14 02:30:43 2018 (r335105) @@ -25,6 +25,9 @@ * $FreeBSD$ */ +#include +#include +#include #include #include @@ -36,9 +39,11 @@ static struct pollfd fds[1]; static mode_t mode = 0777; +static pid_t pid; static int filedesc; static char extregex[80]; static struct stat statbuff; +static struct statfs statfsbuff; static const char *auclass = "fa"; static const char *path = "fileforaudit"; static const char *errpath = "dirdoesnotexist/fileforaudit"; @@ -226,6 +231,145 @@ ATF_TC_CLEANUP(fstatat_failure, tc) } +ATF_TC_WITH_CLEANUP(statfs_success); +ATF_TC_HEAD(statfs_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "statfs(2) call"); +} + +ATF_TC_BODY(statfs_success, tc) +{ + /* File needs to exist to call statfs(2) */ + ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, statfs(path, &statfsbuff)); + check_audit(fds, successreg, pipefd); + close(filedesc); +} + +ATF_TC_CLEANUP(statfs_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(statfs_failure); +ATF_TC_HEAD(statfs_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "statfs(2) call"); +} + +ATF_TC_BODY(statfs_failure, tc) +{ + FILE *pipefd = setup(fds, auclass); + /* Failure reason: file does not exist */ + ATF_REQUIRE_EQ(-1, statfs(errpath, &statfsbuff)); + check_audit(fds, failurereg, pipefd); +} + +ATF_TC_CLEANUP(statfs_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(fstatfs_success); +ATF_TC_HEAD(fstatfs_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "fstatfs(2) call"); +} + +ATF_TC_BODY(fstatfs_success, tc) +{ + /* File needs to exist to call fstat(2) */ + ATF_REQUIRE((filedesc = open(path, O_CREAT | O_RDWR, mode)) != -1); + /* Call stat(2) to store the Inode number of 'path' */ + ATF_REQUIRE_EQ(0, stat(path, &statbuff)); + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, fstatfs(filedesc, &statfsbuff)); + + snprintf(extregex, sizeof(extregex), "fstatfs.*%jd.*return,success", + (intmax_t)statbuff.st_ino); + check_audit(fds, extregex, pipefd); + close(filedesc); +} + +ATF_TC_CLEANUP(fstatfs_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(fstatfs_failure); +ATF_TC_HEAD(fstatfs_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "fstatfs(2) call"); +} + +ATF_TC_BODY(fstatfs_failure, tc) +{ + FILE *pipefd = setup(fds, auclass); + const char *regex = "fstatfs.*return,failure : Bad file descriptor"; + /* Failure reason: bad file descriptor */ + ATF_REQUIRE_EQ(-1, fstatfs(-1, &statfsbuff)); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(fstatfs_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(getfsstat_success); +ATF_TC_HEAD(getfsstat_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "getfsstat(2) call"); +} + +ATF_TC_BODY(getfsstat_success, tc) +{ + pid = getpid(); + snprintf(extregex, sizeof(extregex), "getfsstat.*%d.*success", pid); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE(getfsstat(NULL, 0, MNT_NOWAIT) != -1); + check_audit(fds, extregex, pipefd); +} + +ATF_TC_CLEANUP(getfsstat_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(getfsstat_failure); +ATF_TC_HEAD(getfsstat_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "getfsstat(2) call"); +} + +ATF_TC_BODY(getfsstat_failure, tc) +{ + const char *regex = "getfsstat.*return,failure : Invalid argument"; + FILE *pipefd = setup(fds, auclass); + /* Failure reason: Invalid value for mode */ + ATF_REQUIRE_EQ(-1, getfsstat(NULL, 0, -1)); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(getfsstat_failure, tc) +{ + cleanup(); +} + + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, stat_success); @@ -236,6 +380,14 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, fstat_failure); ATF_TP_ADD_TC(tp, fstatat_success); ATF_TP_ADD_TC(tp, fstatat_failure); + + ATF_TP_ADD_TC(tp, statfs_success); + ATF_TP_ADD_TC(tp, statfs_failure); + ATF_TP_ADD_TC(tp, fstatfs_success); + ATF_TP_ADD_TC(tp, fstatfs_failure); + + ATF_TP_ADD_TC(tp, getfsstat_success); + ATF_TP_ADD_TC(tp, getfsstat_failure); return (atf_no_error()); } From owner-svn-src-head@freebsd.org Thu Jun 14 03:03:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D7A41016D23; Thu, 14 Jun 2018 03:03:14 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA5856D4B2; Thu, 14 Jun 2018 03:03:13 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w5E33BGN042497; Wed, 13 Jun 2018 20:03:11 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w5E33BYj042496; Wed, 13 Jun 2018 20:03:11 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806140303.w5E33BYj042496@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r335091 - head/sbin/nvmecontrol In-Reply-To: <201806132200.w5DM03bF097193@repo.freebsd.org> To: Warner Losh Date: Wed, 13 Jun 2018 20:03:11 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 03:03:14 -0000 > Author: imp > Date: Wed Jun 13 22:00:02 2018 > New Revision: 335091 > URL: https://svnweb.freebsd.org/changeset/base/335091 > > Log: > Make it possible to use print_controller from another program > > Rename print_controller to nvme_print_controller. Put it in its > own file for easy inclusion. Move util.c to be nc_util.c to not > conflict with camcontrol. add nvecontrol_ext.h to define shared > interfaces. > > Sponsored by: Netflix > Differential Revision: https://reviews.freebsd.org/D15371 > > Added: > head/sbin/nvmecontrol/identify_ext.c > - copied, changed from r335089, head/sbin/nvmecontrol/identify.c > head/sbin/nvmecontrol/nc_util.c > - copied, changed from r335089, head/sbin/nvmecontrol/util.c > head/sbin/nvmecontrol/nvmecontrol_ext.h (contents, props changed) > - copied, changed from r335089, head/sbin/nvmecontrol/util.c ... > > Copied and modified: head/sbin/nvmecontrol/nvmecontrol_ext.h (from r335089, head/sbin/nvmecontrol/util.c) > ============================================================================== > --- head/sbin/nvmecontrol/util.c Wed Jun 13 21:10:23 2018 (r335089, copy source) > +++ head/sbin/nvmecontrol/nvmecontrol_ext.h Wed Jun 13 22:00:02 2018 (r335091) > @@ -1,7 +1,8 @@ > /*- > - * Copyright (c) 2017 Netflix, Inc > - * All rights reserved. > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > * > + * Copyright (C) 2018 Netflix You moved a copyright forward, that is not proper to do. Not sure about dropping the , Inc either. > + * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > @@ -22,38 +23,8 @@ > * 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$ > */ > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Jun 14 03:05:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 583851016FDE for ; Thu, 14 Jun 2018 03:05:24 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x234.google.com (mail-it0-x234.google.com [IPv6:2607:f8b0:4001:c0b::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BE7326D6CA for ; Thu, 14 Jun 2018 03:05:23 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x234.google.com with SMTP id 76-v6so6450514itx.4 for ; Wed, 13 Jun 2018 20:05:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=YlWPPIDek7HG+pb0hYSFFuczJFPhIVfpY85boSQ+w3k=; b=lotmwiPFrL8AV/Zr3v9wdWdNXapT8En0+9bQV+lrGgUNaEN8wFSLzj/HylEzqZ7a/U lNkHZsfQK22MjzEL8hjmtwjhaMB/+DVvHyKgRfYyZZL2MMDPfT6V34wGPREKzXdOu2hS tk03wNgs5UfL8HqNfPGieoskVzeS6WePgVDGtk5b4g9tMC6rKDp1fNXh8/At6qi/ebej jXXYg1lJMh+iG1s71TCLB6Xh+/9EOxExTZq/e33LeSgUI9yxYYkuouqOtkAr8ylbb/eY 82ggvtV5Dn12UKRU7nqLy22aw9YGOHWgsNCg23AlOMaO3bTSU+uK9J3mkkyyb/glFFns 7Nyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=YlWPPIDek7HG+pb0hYSFFuczJFPhIVfpY85boSQ+w3k=; b=ULXB0mGJ2khePXBPQorcakOLznJpjJs5E7o2HhhN+zd/gHPpIOTRYOqYVMxGGKjUYm ON7plkieIzFOOebz6JwEDtTvUEAfIPaa/NDjMr8SFVCpxH+t5I+gutsUxRuuxjlCA3S+ zytJ8qjnMATWAGR0OBLpkrXzpaK4YSCGUO/DKzG8GKkcscIbCJIfFKw1pTBZtRsMk6Pp b9kbz9gB9GpY36YoF4oa3a5ePJ5w2ARp3RN5gaTUYjzbzHS6/Vzq1dXH1/deHhOAPHYO JRrN1hDkp8rG8jISwVpbhrl62v+SNMHzKeDpNKfSq/VfliPxgcEh4uMvV2YrC35K+cKR bpxA== X-Gm-Message-State: APt69E3zTKAJ2r1Pafhe0wBqot2O7bkYUbwkPQInGCctC5f72apXSVcs rKiqmiHsrSW9BhwFCYj/BDiIaUSLl55cBYdkXhadnw== X-Google-Smtp-Source: ADUXVKI5bFVWLX8KOykt/pv8/K8GwLFRvIFrzkO4PneLyB8bLqlG8o1JGc3vQC8ftohnoHS5ko9hSk27ipGNj1Z1gag= X-Received: by 2002:a24:64ce:: with SMTP id t197-v6mr624906itc.36.1528945523108; Wed, 13 Jun 2018 20:05:23 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:d028:0:0:0:0:0 with HTTP; Wed, 13 Jun 2018 20:05:22 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <201806140303.w5E33BYj042496@pdx.rh.CN85.dnsmgr.net> References: <201806132200.w5DM03bF097193@repo.freebsd.org> <201806140303.w5E33BYj042496@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Wed, 13 Jun 2018 21:05:22 -0600 X-Google-Sender-Auth: WyHULtL9Bc-3hYw2NazU_5uhgqA Message-ID: Subject: Re: svn commit: r335091 - head/sbin/nvmecontrol To: "Rodney W. Grimes" Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 03:05:24 -0000 On Wed, Jun 13, 2018 at 9:03 PM, Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > Author: imp > > Date: Wed Jun 13 22:00:02 2018 > > New Revision: 335091 > > URL: https://svnweb.freebsd.org/changeset/base/335091 > > > > Log: > > Make it possible to use print_controller from another program > > > > Rename print_controller to nvme_print_controller. Put it in its > > own file for easy inclusion. Move util.c to be nc_util.c to not > > conflict with camcontrol. add nvecontrol_ext.h to define shared > > interfaces. > > > > Sponsored by: Netflix > > Differential Revision: https://reviews.freebsd.org/D15371 > > > > Added: > > head/sbin/nvmecontrol/identify_ext.c > > - copied, changed from r335089, head/sbin/nvmecontrol/identify.c > > head/sbin/nvmecontrol/nc_util.c > > - copied, changed from r335089, head/sbin/nvmecontrol/util.c > > head/sbin/nvmecontrol/nvmecontrol_ext.h (contents, props changed) > > - copied, changed from r335089, head/sbin/nvmecontrol/util.c > ... > > > > > Copied and modified: head/sbin/nvmecontrol/nvmecontrol_ext.h (from > r335089, head/sbin/nvmecontrol/util.c) > > ============================================================ > ================== > > --- head/sbin/nvmecontrol/util.c Wed Jun 13 21:10:23 2018 > (r335089, copy source) > > +++ head/sbin/nvmecontrol/nvmecontrol_ext.h Wed Jun 13 22:00:02 2018 > (r335091) > > @@ -1,7 +1,8 @@ > > /*- > > - * Copyright (c) 2017 Netflix, Inc > > - * All rights reserved. > > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > > * > > + * Copyright (C) 2018 Netflix > > You moved a copyright forward, that is not proper to do. > Thought it was. I honestly don't care where (nor does my employer), so if you want to tweak it to be more conforming, be my guest. > Not sure about dropping the , Inc either. Doesn't matter. Different Netflix committers do different things and I was trying to move towards uniformity. Warner From owner-svn-src-head@freebsd.org Thu Jun 14 03:27:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7533B10190F0; Thu, 14 Jun 2018 03:27:43 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 233E66E84D; Thu, 14 Jun 2018 03:27:43 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 048C822CB7; Thu, 14 Jun 2018 03:27:43 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5E3Rgc7066135; Thu, 14 Jun 2018 03:27:42 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5E3RgsJ066134; Thu, 14 Jun 2018 03:27:42 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201806140327.w5E3RgsJ066134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Thu, 14 Jun 2018 03:27:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335106 - head/sys/netinet/tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: rrs X-SVN-Commit-Paths: head/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 335106 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 03:27:43 -0000 Author: rrs Date: Thu Jun 14 03:27:42 2018 New Revision: 335106 URL: https://svnweb.freebsd.org/changeset/base/335106 Log: This fixes several bugs that Larry Rosenman helped me find in Rack with respect to its handling of TCP Fast Open. Several fixes all related to TFO are included in this commit: 1) Handling of non-TFO retransmissions 2) Building the proper send-map when we are doing TFO 3) Dealing with the ack that comes back that includes the SYN and data. It appears that with this commit TFO now works :-) Thanks Larry for all your help!! Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D15758 Modified: head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Thu Jun 14 02:30:43 2018 (r335105) +++ head/sys/netinet/tcp_stacks/rack.c Thu Jun 14 03:27:42 2018 (r335106) @@ -2083,6 +2083,8 @@ rack_timer_start(struct tcpcb *tp, struct tcp_rack *ra /* We can't start any timer in persists */ return (rack_get_persists_timer_val(tp, rack)); } + if (tp->t_state < TCPS_ESTABLISHED) + goto activate_rxt; rsm = TAILQ_FIRST(&rack->r_ctl.rc_tmap); if (rsm == NULL) { /* Nothing on the send map */ @@ -3385,8 +3387,15 @@ again: rsm->r_tim_lastsent[0] = ts; rsm->r_rtr_cnt = 1; rsm->r_rtr_bytes = 0; - rsm->r_start = seq_out; - rsm->r_end = rsm->r_start + len; + if (th_flags & TH_SYN) { + /* The data space is one beyond snd_una */ + rsm->r_start = seq_out + 1; + rsm->r_end = rsm->r_start + (len - 1); + } else { + /* Normal case */ + rsm->r_start = seq_out; + rsm->r_end = rsm->r_start + len; + } rsm->r_sndcnt = 0; TAILQ_INSERT_TAIL(&rack->r_ctl.rc_map, rsm, r_next); TAILQ_INSERT_TAIL(&rack->r_ctl.rc_tmap, rsm, r_tnext); @@ -4657,11 +4666,7 @@ rack_process_data(struct mbuf *m, struct tcphdr *th, s * send garbage on first SYN. */ int32_t nsegs; -#ifdef TCP_RFC7413 int32_t tfo_syn; -#else -#define tfo_syn (FALSE) -#endif struct tcp_rack *rack; rack = (struct tcp_rack *)tp->t_fb_ptr; @@ -4767,10 +4772,8 @@ dodata: /* XXX */ * PRU_RCVD). If a FIN has already been received on this connection * then we just ignore the text. */ -#ifdef TCP_RFC7413 tfo_syn = ((tp->t_state == TCPS_SYN_RECEIVED) && - (tp->t_flags & TF_FASTOPEN)); -#endif + IS_FASTOPEN(tp->t_flags)); if ((tlen || (thflags & TH_FIN) || tfo_syn) && TCPS_HAVERCVDFIN(tp->t_state) == 0) { tcp_seq save_start = th->th_seq; @@ -5237,6 +5240,8 @@ rack_do_syn_sent(struct mbuf *m, struct tcphdr *th, st tp->irs = th->th_seq; tcp_rcvseqinit(tp); if (thflags & TH_ACK) { + int tfo_partial = 0; + TCPSTAT_INC(tcps_connects); soisconnected(so); #ifdef MAC @@ -5250,10 +5255,19 @@ rack_do_syn_sent(struct mbuf *m, struct tcphdr *th, st tp->rcv_adv += min(tp->rcv_wnd, TCP_MAXWIN << tp->rcv_scale); /* + * If not all the data that was sent in the TFO SYN + * has been acked, resend the remainder right away. + */ + if (IS_FASTOPEN(tp->t_flags) && + (tp->snd_una != tp->snd_max)) { + tp->snd_nxt = th->th_ack; + tfo_partial = 1; + } + /* * If there's data, delay ACK; if there's also a FIN ACKNOW * will be turned on later. */ - if (DELAY_ACK(tp, tlen) && tlen != 0) { + if (DELAY_ACK(tp, tlen) && tlen != 0 && (tfo_partial == 0)) { rack_timer_cancel(tp, (struct tcp_rack *)tp->t_fb_ptr, ((struct tcp_rack *)tp->t_fb_ptr)->r_ctl.rc_rcvtime, __LINE__); tp->t_flags |= TF_DELACK; @@ -5266,6 +5280,21 @@ rack_do_syn_sent(struct mbuf *m, struct tcphdr *th, st tp->t_flags |= TF_ECN_PERMIT; TCPSTAT_INC(tcps_ecn_shs); } + if (SEQ_GT(th->th_ack, tp->snd_una)) { + /* + * We advance snd_una for the + * fast open case. If th_ack is + * acknowledging data beyond + * snd_una we can't just call + * ack-processing since the + * data stream in our send-map + * will start at snd_una + 1 (one + * beyond the SYN). If its just + * equal we don't need to do that + * and there is no send_map. + */ + tp->snd_una++; + } /* * Received in SYN_SENT[*] state. Transitions: * SYN_SENT --> ESTABLISHED SYN_SENT* --> FIN_WAIT_1 @@ -5375,13 +5404,13 @@ rack_do_syn_recv(struct mbuf *m, struct tcphdr *th, st rack_do_dropwithreset(m, tp, th, ti_locked, BANDLIM_RST_OPENPORT, tlen); return (1); } -#ifdef TCP_RFC7413 - if (tp->t_flags & TF_FASTOPEN) { + if (IS_FASTOPEN(tp->t_flags)) { /* - * When a TFO connection is in SYN_RECEIVED, the only valid - * packets are the initial SYN, a retransmit/copy of the - * initial SYN (possibly with a subset of the original - * data), a valid ACK, a FIN, or a RST. + * When a TFO connection is in SYN_RECEIVED, the + * only valid packets are the initial SYN, a + * retransmit/copy of the initial SYN (possibly with + * a subset of the original data), a valid ACK, a + * FIN, or a RST. */ if ((thflags & (TH_SYN | TH_ACK)) == (TH_SYN | TH_ACK)) { rack_do_dropwithreset(m, tp, th, ti_locked, BANDLIM_RST_OPENPORT, tlen); @@ -5402,7 +5431,6 @@ rack_do_syn_recv(struct mbuf *m, struct tcphdr *th, st return (0); } } -#endif if (thflags & TH_RST) return (rack_process_rst(m, th, so, tp, ti_locked)); /* @@ -5463,12 +5491,10 @@ rack_do_syn_recv(struct mbuf *m, struct tcphdr *th, st * processing; else drop segment and return. */ if ((thflags & TH_ACK) == 0) { -#ifdef TCP_RFC7413 - if (tp->t_flags & TF_FASTOPEN) { + if (IS_FASTOPEN(tp->t_flags)) { tp->snd_wnd = tiwin; cc_conn_init(tp); } -#endif return (rack_process_data(m, th, so, tp, drop_hdrlen, tlen, ti_locked, tiwin, thflags, nxt_pkt)); } @@ -5492,8 +5518,7 @@ rack_do_syn_recv(struct mbuf *m, struct tcphdr *th, st tcp_state_change(tp, TCPS_ESTABLISHED); TCP_PROBE5(accept__established, NULL, tp, mtod(m, const char *), tp, th); -#ifdef TCP_RFC7413 - if (tp->t_tfo_pending) { + if (IS_FASTOPEN(tp->t_flags) && tp->t_tfo_pending) { tcp_fastopen_decrement_counter(tp->t_tfo_pending); tp->t_tfo_pending = NULL; @@ -5509,8 +5534,7 @@ rack_do_syn_recv(struct mbuf *m, struct tcphdr *th, st * is not harmless as it would undo the snd_cwnd reduction * that occurs when a TFO SYN|ACK is retransmitted. */ - if (!(tp->t_flags & TF_FASTOPEN)) -#endif + if (!IS_FASTOPEN(tp->t_flags)) cc_conn_init(tp); } /* @@ -6926,6 +6950,7 @@ rack_output(struct tcpcb *tp) struct tcp_rack *rack; struct tcphdr *th; uint8_t pass = 0; + uint8_t wanted_cookie = 0; u_char opt[TCP_MAXOLEN]; unsigned ipoptlen, optlen, hdrlen, ulen=0; uint32_t rack_seq; @@ -6967,17 +6992,15 @@ rack_output(struct tcpcb *tp) return (tcp_offload_output(tp)); #endif -#ifdef TCP_RFC7413 /* * For TFO connections in SYN_RECEIVED, only allow the initial * SYN|ACK and those sent by the retransmit timer. */ - if ((tp->t_flags & TF_FASTOPEN) && + if (IS_FASTOPEN(tp->t_flags) && (tp->t_state == TCPS_SYN_RECEIVED) && - SEQ_GT(tp->snd_max, tp->snd_una) && /* inital SYN|ACK sent */ - (tp->snd_nxt != tp->snd_una)) /* not a retransmit */ + SEQ_GT(tp->snd_max, tp->snd_una) && /* initial SYN|ACK sent */ + (rack->r_ctl.rc_resend == NULL)) /* not a retransmit */ return (0); -#endif #ifdef INET6 if (rack->r_state) { /* Use the cache line loaded if possible */ @@ -7267,7 +7290,7 @@ again: uint32_t avail; avail = sbavail(sb); - if (SEQ_GT(tp->snd_nxt, tp->snd_una)) + if (SEQ_GT(tp->snd_nxt, tp->snd_una) && avail) sb_offset = tp->snd_nxt - tp->snd_una; else sb_offset = 0; @@ -7359,22 +7382,18 @@ again: * SYN-SENT state and if segment contains data and if we don't know * that foreign host supports TAO, suppress sending segment. */ - if ((flags & TH_SYN) && SEQ_GT(tp->snd_nxt, tp->snd_una)) { - if ((tp->t_state != TCPS_SYN_RECEIVED) && - (tp->t_state != TCPS_SYN_SENT)) + if ((flags & TH_SYN) && SEQ_GT(tp->snd_nxt, tp->snd_una) && + ((sack_rxmit == 0) && (tp->t_rxtshift == 0))) { + if (tp->t_state != TCPS_SYN_RECEIVED) flags &= ~TH_SYN; -#ifdef TCP_RFC7413 /* * When sending additional segments following a TFO SYN|ACK, * do not include the SYN bit. */ - if ((tp->t_flags & TF_FASTOPEN) && + if (IS_FASTOPEN(tp->t_flags) && (tp->t_state == TCPS_SYN_RECEIVED)) flags &= ~TH_SYN; -#endif sb_offset--, len++; - if (sbavail(sb) == 0) - len = 0; } /* * Be careful not to send data and/or FIN on SYN segments. This @@ -7385,16 +7404,27 @@ again: len = 0; flags &= ~TH_FIN; } -#ifdef TCP_RFC7413 /* - * When retransmitting SYN|ACK on a passively-created TFO socket, - * don't include data, as the presence of data may have caused the - * original SYN|ACK to have been dropped by a middlebox. + * On TFO sockets, ensure no data is sent in the following cases: + * + * - When retransmitting SYN|ACK on a passively-created socket + * + * - When retransmitting SYN on an actively created socket + * + * - When sending a zero-length cookie (cookie request) on an + * actively created socket + * + * - When the socket is in the CLOSED state (RST is being sent) */ - if ((tp->t_flags & TF_FASTOPEN) && - ((tp->t_state == TCPS_SYN_RECEIVED) && (tp->t_rxtshift > 0))) + if (IS_FASTOPEN(tp->t_flags) && + (((flags & TH_SYN) && (tp->t_rxtshift > 0)) || + ((tp->t_state == TCPS_SYN_SENT) && + (tp->t_tfo_client_cookie_len == 0)) || + (flags & TH_RST))) len = 0; -#endif + /* Without fast-open there should never be data sent on a SYN */ + if ((flags & TH_SYN) && (!IS_FASTOPEN(tp->t_flags))) + len = 0; if (len <= 0) { /* * If FIN has been sent but not acked, but we haven't been @@ -7710,22 +7740,39 @@ send: to.to_mss -= V_tcp_udp_tunneling_overhead; #endif to.to_flags |= TOF_MSS; -#ifdef TCP_RFC7413 + /* - * Only include the TFO option on the first - * transmission of the SYN|ACK on a - * passively-created TFO socket, as the presence of - * the TFO option may have caused the original - * SYN|ACK to have been dropped by a middlebox. + * On SYN or SYN|ACK transmits on TFO connections, + * only include the TFO option if it is not a + * retransmit, as the presence of the TFO option may + * have caused the original SYN or SYN|ACK to have + * been dropped by a middlebox. */ - if ((tp->t_flags & TF_FASTOPEN) && - (tp->t_state == TCPS_SYN_RECEIVED) && + if (IS_FASTOPEN(tp->t_flags) && (tp->t_rxtshift == 0)) { - to.to_tfo_len = TCP_FASTOPEN_MAX_COOKIE_LEN; - to.to_tfo_cookie = (u_char *)&tp->t_tfo_cookie; - to.to_flags |= TOF_FASTOPEN; + if (tp->t_state == TCPS_SYN_RECEIVED) { + to.to_tfo_len = TCP_FASTOPEN_COOKIE_LEN; + to.to_tfo_cookie = + (u_int8_t *)&tp->t_tfo_cookie.server; + to.to_flags |= TOF_FASTOPEN; + wanted_cookie = 1; + } else if (tp->t_state == TCPS_SYN_SENT) { + to.to_tfo_len = + tp->t_tfo_client_cookie_len; + to.to_tfo_cookie = + tp->t_tfo_cookie.client; + to.to_flags |= TOF_FASTOPEN; + wanted_cookie = 1; + /* + * If we wind up having more data to + * send with the SYN than can fit in + * one segment, don't send any more + * until the SYN|ACK comes back from + * the other end. + */ + sendalot = 0; + } } -#endif } /* Window scaling. */ if ((flags & TH_SYN) && (tp->t_flags & TF_REQ_SCALE)) { @@ -7760,6 +7807,13 @@ send: /* Processing the options. */ hdrlen += optlen = tcp_addoptions(&to, opt); + /* + * If we wanted a TFO option to be added, but it was unable + * to fit, ensure no data is sent. + */ + if (IS_FASTOPEN(tp->t_flags) && wanted_cookie && + !(to.to_flags & TOF_FASTOPEN)) + len = 0; } #ifdef NETFLIX_TCPOUDP if (tp->t_port) { From owner-svn-src-head@freebsd.org Thu Jun 14 03:28:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4702101919F; Thu, 14 Jun 2018 03:28:16 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 357616E9D4; Thu, 14 Jun 2018 03:28:16 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w5E3SCW4042621; Wed, 13 Jun 2018 20:28:12 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w5E3SCZp042620; Wed, 13 Jun 2018 20:28:12 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806140328.w5E3SCZp042620@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r335091 - head/sbin/nvmecontrol In-Reply-To: To: Warner Losh Date: Wed, 13 Jun 2018 20:28:12 -0700 (PDT) CC: "Rodney W. Grimes" , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 03:28:17 -0000 > On Wed, Jun 13, 2018 at 9:03 PM, Rodney W. Grimes < > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > Author: imp > > > Date: Wed Jun 13 22:00:02 2018 > > > New Revision: 335091 > > > URL: https://svnweb.freebsd.org/changeset/base/335091 > > > > > > Log: > > > Make it possible to use print_controller from another program > > > > > > Rename print_controller to nvme_print_controller. Put it in its > > > own file for easy inclusion. Move util.c to be nc_util.c to not > > > conflict with camcontrol. add nvecontrol_ext.h to define shared > > > interfaces. > > > > > > Sponsored by: Netflix > > > Differential Revision: https://reviews.freebsd.org/D15371 > > > > > > Added: > > > head/sbin/nvmecontrol/identify_ext.c > > > - copied, changed from r335089, head/sbin/nvmecontrol/identify.c > > > head/sbin/nvmecontrol/nc_util.c > > > - copied, changed from r335089, head/sbin/nvmecontrol/util.c > > > head/sbin/nvmecontrol/nvmecontrol_ext.h (contents, props changed) > > > - copied, changed from r335089, head/sbin/nvmecontrol/util.c > > ... > > > > > > > > Copied and modified: head/sbin/nvmecontrol/nvmecontrol_ext.h (from > > r335089, head/sbin/nvmecontrol/util.c) > > > ============================================================ > > ================== > > > --- head/sbin/nvmecontrol/util.c Wed Jun 13 21:10:23 2018 > > (r335089, copy source) > > > +++ head/sbin/nvmecontrol/nvmecontrol_ext.h Wed Jun 13 22:00:02 2018 > > (r335091) > > > @@ -1,7 +1,8 @@ > > > /*- > > > - * Copyright (c) 2017 Netflix, Inc > > > - * All rights reserved. > > > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > > > * > > > + * Copyright (C) 2018 Netflix > > > > You moved a copyright forward, that is not proper to do. > > > > Thought it was. I honestly don't care where (nor does my employer), so if > you want to tweak it to be more conforming, be my guest. You can add a new date to the end of a list, but you should always retain the oldest date, and many opinions are that all dates should be retained unless they are continuous. It would be much simpler for you to commit: - * Copyright (C) 2018 Netflix + * Copyright (C) 2017-2018 Netflix Than for me to get approval: bde, phk. Thanks. Rod > > > Not sure about dropping the , Inc either. > > > Doesn't matter. Different Netflix committers do different things and I was > trying to move towards uniformity. Ok > Warner -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Jun 14 03:31:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FB41101956C for ; Thu, 14 Jun 2018 03:31:17 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22f.google.com (mail-io0-x22f.google.com [IPv6:2607:f8b0:4001:c06::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0CB246EE0B for ; Thu, 14 Jun 2018 03:31:17 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22f.google.com with SMTP id t5-v6so5702997ioa.8 for ; Wed, 13 Jun 2018 20:31:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=ysTQO6zgCkJBaeakKDfHmhYHx2y+pzGGdRUZ2zfEdKw=; b=CNC4totR/Mf7KFwILXZfs7j04S7VCyxPYWcKRu2kG2fuj3VFYAMTdkVbMrdsNRchC+ YDH3SJMl3PaiyBKqdwYUgq9vxTE6laHbNnyqCcA6xZsjoNcgq6pHYkeLzB3585NzE2l8 ixppn8mKdVZU3vASA8qGQmFFHzF6/2IcwXYEk0pFJhLpCvs2Y9wZ2DGSeDOdTXfi5Hpx dT/dGgwY49NHnkiNGxMEzCHDq5cLKmRYaXiLFKQzmI7Wrglm3mXOah5NNG4MvJi6x6Nn 9EObFqnbW9pDlhD24iz5ag+F0QUls1wTV9iJWdRd0qL1Mg2FFqCsxzPRLzOS4qgUFWp5 Mdxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=ysTQO6zgCkJBaeakKDfHmhYHx2y+pzGGdRUZ2zfEdKw=; b=XmgV5RTL3LVx7ApM/tqWBfB23YyOTwl780vuiIBKnhZG18vQFBeWUJXLZZm+pjiX2Q yR0lxpA7kH5eAUWaKHjifSFMbdZ6TJ2pL854XgVc8Af6lO68cUVvkV5iYMwtDtG6hTth IDbg11xo5WkXVEDKJG4eJik1CNTroAmJbwuzL2ufDvfsXBjxwWWeoLpxGvgLP+a+bYh9 cLqZZijgnOX6K9rt5SPyLuSY3YY6P4mdKi4teys8glKgzYBgOOlktTBegC7tsdPJBENX 8VVnGVitSjn4TC8TXtU/B0cYXopNn03jdMfL+nNVCno82RfKkjPk2omvNPvz8T03X9iY 2nfg== X-Gm-Message-State: APt69E2ElaOrkoVhwSSRezj6+qcNWXfm29OmZa16vDY5Kt2AYoVd4a40 w2ZugBF/IPjcnck/S2Xo4CcclER/Dss4wfGlEUoe3w== X-Google-Smtp-Source: ADUXVKIUhLVnFu5LaZwIX1ktKXJAyO7aIaEpl7E9XZHCu91+0UrLFO0dyHA5LTpasgHGGcDLGnyyr2r+OuW4kbwufQ4= X-Received: by 2002:a6b:29c4:: with SMTP id p187-v6mr685944iop.299.1528947076260; Wed, 13 Jun 2018 20:31:16 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:d028:0:0:0:0:0 with HTTP; Wed, 13 Jun 2018 20:31:15 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <201806140328.w5E3SCZp042620@pdx.rh.CN85.dnsmgr.net> References: <201806140328.w5E3SCZp042620@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Wed, 13 Jun 2018 21:31:15 -0600 X-Google-Sender-Auth: ppY4Ormpjdlm2QG_b-lSgX5kfHw Message-ID: Subject: Re: svn commit: r335091 - head/sbin/nvmecontrol To: "Rodney W. Grimes" Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 03:31:17 -0000 Ah, that's what you were talking about. OK. Will do. Warner On Wed, Jun 13, 2018 at 9:28 PM, Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > On Wed, Jun 13, 2018 at 9:03 PM, Rodney W. Grimes < > > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > > > Author: imp > > > > Date: Wed Jun 13 22:00:02 2018 > > > > New Revision: 335091 > > > > URL: https://svnweb.freebsd.org/changeset/base/335091 > > > > > > > > Log: > > > > Make it possible to use print_controller from another program > > > > > > > > Rename print_controller to nvme_print_controller. Put it in its > > > > own file for easy inclusion. Move util.c to be nc_util.c to not > > > > conflict with camcontrol. add nvecontrol_ext.h to define shared > > > > interfaces. > > > > > > > > Sponsored by: Netflix > > > > Differential Revision: https://reviews.freebsd.org/D15371 > > > > > > > > Added: > > > > head/sbin/nvmecontrol/identify_ext.c > > > > - copied, changed from r335089, head/sbin/nvmecontrol/ > identify.c > > > > head/sbin/nvmecontrol/nc_util.c > > > > - copied, changed from r335089, head/sbin/nvmecontrol/util.c > > > > head/sbin/nvmecontrol/nvmecontrol_ext.h (contents, props > changed) > > > > - copied, changed from r335089, head/sbin/nvmecontrol/util.c > > > ... > > > > > > > > > > > Copied and modified: head/sbin/nvmecontrol/nvmecontrol_ext.h (from > > > r335089, head/sbin/nvmecontrol/util.c) > > > > ============================================================ > > > ================== > > > > --- head/sbin/nvmecontrol/util.c Wed Jun 13 21:10:23 2018 > > > (r335089, copy source) > > > > +++ head/sbin/nvmecontrol/nvmecontrol_ext.h Wed Jun 13 22:00:02 > 2018 > > > (r335091) > > > > @@ -1,7 +1,8 @@ > > > > /*- > > > > - * Copyright (c) 2017 Netflix, Inc > > > > - * All rights reserved. > > > > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > > > > * > > > > + * Copyright (C) 2018 Netflix > > > > > > You moved a copyright forward, that is not proper to do. > > > > > > > Thought it was. I honestly don't care where (nor does my employer), so if > > you want to tweak it to be more conforming, be my guest. > > You can add a new date to the end of a list, but you should always > retain the oldest date, and many opinions are that all dates should > be retained unless they are continuous. > > It would be much simpler for you to commit: > - * Copyright (C) 2018 Netflix > + * Copyright (C) 2017-2018 Netflix > > Than for me to get approval: bde, phk. > > Thanks. > Rod > > > > > > Not sure about dropping the , Inc either. > > > > > > Doesn't matter. Different Netflix committers do different things and I > was > > trying to move towards uniformity. > > Ok > > > Warner > > -- > Rod Grimes > rgrimes@freebsd.org > From owner-svn-src-head@freebsd.org Thu Jun 14 03:32:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3E02101982A for ; Thu, 14 Jun 2018 03:32:15 +0000 (UTC) (envelope-from juli@northcloak.com) Received: from mail-qt0-x236.google.com (mail-qt0-x236.google.com [IPv6:2607:f8b0:400d:c0d::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 428E76F06F for ; Thu, 14 Jun 2018 03:32:15 +0000 (UTC) (envelope-from juli@northcloak.com) Received: by mail-qt0-x236.google.com with SMTP id i18-v6so4523736qtp.12 for ; Wed, 13 Jun 2018 20:32:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=northcloak-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=zDFFhV57mCzzdG7W8GYUX4sDL4NC77kEwIAVuVeuRns=; b=s03KencNFiOOM7Zm6cIUMHD1sfYuQJAwKQVVrsR5ssRWu8r3PQ9E6PBofaMYUCghVQ Ww2f1qRp9txdN2jFTxYTz67wJj05i/JlAp63FjEPYWTdBAgUNsy6+uTXKia05ZSsnLNw ublNdwpaGtNv+AJ497asoPjTrdFUx5/cO4DMwK6k0CzhI3vKmUKea37Nhg+APH7OF5VS Yx2WH1HLJPeyBRe3BbH/d2TVIFJufVgQYrteI3+2osKfUNkNcjGB/tZyglQQaredkXEr +CcVa6KtNIxtXYiePetPSVv8znWfGTf8DEKB/ZXnG2diFV6YMyxaWMsFNmq3kMiW64WK g7ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=zDFFhV57mCzzdG7W8GYUX4sDL4NC77kEwIAVuVeuRns=; b=ruTk7mZYlusxqEfqKtlPZwEZmmF6npMZkpHR4pQFW2HbDrcs/G7ShxudMuMHmAjbAz Kisz54Vek6YyoQ86+TifkpKLIgKGH9YXEtcrBEHLmtmHbLFnCLrXXqyesZ0yN2Zg+ArH /oHVCRXHFjs4RQL9KXLDR5W6jtuP6NBT5BgDv2xdOK6VI0Uetf5QNRIhj7QnRIQMyPf8 vdPLKhEhqCdYBDhaAo1fbB3S6qK7kOR7iGYBvyz9qniotGA10Ze3Z2b7OrkcmlT7OHfZ eIjoBlfmEXBg+E/r+nhyytFnE0dEDIN0f9Ys+adzbhV54/ofdPYCcxXo0lFLdzfoPx1J G5Kw== X-Gm-Message-State: APt69E1rlJ9/jC05y06iJl7ZKaf/gsVBHG+voFZXWiKWNCIaHJ9w4p3N T9P+dRtKzIf8o3Fa1Qj5jq6BWxWqOptwLuPWfqM+YQ== X-Google-Smtp-Source: ADUXVKJROlyDNpPGBtOUdGa3Cwe2D5hBkrAvOvIalFQUpfRvm31mu6d3F14tucHKTq3mRQ0wSvVXUcF3w0zfrXbKXaE= X-Received: by 2002:a0c:e401:: with SMTP id o1-v6mr743647qvl.66.1528947134744; Wed, 13 Jun 2018 20:32:14 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:aed:3579:0:0:0:0:0 with HTTP; Wed, 13 Jun 2018 20:31:34 -0700 (PDT) In-Reply-To: <201806140328.w5E3SCZp042620@pdx.rh.CN85.dnsmgr.net> References: <201806140328.w5E3SCZp042620@pdx.rh.CN85.dnsmgr.net> From: Juli Mallett Date: Wed, 13 Jun 2018 20:31:34 -0700 Message-ID: Subject: Re: svn commit: r335091 - head/sbin/nvmecontrol To: rgrimes@freebsd.org Cc: Warner Losh , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 03:32:15 -0000 On 13 June 2018 at 20:28, Rodney W. Grimes wrote: > > On Wed, Jun 13, 2018 at 9:03 PM, Rodney W. Grimes < > > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > > > Author: imp > > > > Date: Wed Jun 13 22:00:02 2018 > > > > New Revision: 335091 > > > > URL: https://svnweb.freebsd.org/changeset/base/335091 > > > > > > > > Log: > > > > Make it possible to use print_controller from another program > > > > > > > > Rename print_controller to nvme_print_controller. Put it in its > > > > own file for easy inclusion. Move util.c to be nc_util.c to not > > > > conflict with camcontrol. add nvecontrol_ext.h to define shared > > > > interfaces. > > > > > > > > Sponsored by: Netflix > > > > Differential Revision: https://reviews.freebsd.org/D15371 > > > > > > > > Added: > > > > head/sbin/nvmecontrol/identify_ext.c > > > > - copied, changed from r335089, head/sbin/nvmecontrol/ > identify.c > > > > head/sbin/nvmecontrol/nc_util.c > > > > - copied, changed from r335089, head/sbin/nvmecontrol/util.c > > > > head/sbin/nvmecontrol/nvmecontrol_ext.h (contents, props > changed) > > > > - copied, changed from r335089, head/sbin/nvmecontrol/util.c > > > ... > > > > > > > > > > > Copied and modified: head/sbin/nvmecontrol/nvmecontrol_ext.h (from > > > r335089, head/sbin/nvmecontrol/util.c) > > > > ============================================================ > > > ================== > > > > --- head/sbin/nvmecontrol/util.c Wed Jun 13 21:10:23 2018 > > > (r335089, copy source) > > > > +++ head/sbin/nvmecontrol/nvmecontrol_ext.h Wed Jun 13 22:00:02 > 2018 > > > (r335091) > > > > @@ -1,7 +1,8 @@ > > > > /*- > > > > - * Copyright (c) 2017 Netflix, Inc > > > > - * All rights reserved. > > > > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > > > > * > > > > + * Copyright (C) 2018 Netflix > > > > > > You moved a copyright forward, that is not proper to do. > > > > > > > Thought it was. I honestly don't care where (nor does my employer), so if > > you want to tweak it to be more conforming, be my guest. > > You can add a new date to the end of a list, but you should always > retain the oldest date, and many opinions are that all dates should > be retained unless they are continuous. > Do you have a citation for this, Rod? I ask because my impression was that although it has often been done, and at one point may legitimately have been required, it is not any longer so. I'd love to have a concrete source on this, though. > It would be much simpler for you to commit: > - * Copyright (C) 2018 Netflix > + * Copyright (C) 2017-2018 Netflix > > Than for me to get approval: bde, phk. > > Thanks. > Rod > > > > > > Not sure about dropping the , Inc either. > > > > > > Doesn't matter. Different Netflix committers do different things and I > was > > trying to move towards uniformity. > > Ok > > > Warner > > -- > Rod Grimes > rgrimes@freebsd.org > > From owner-svn-src-head@freebsd.org Thu Jun 14 03:32:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27DB61019985 for ; Thu, 14 Jun 2018 03:32:56 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22b.google.com (mail-it0-x22b.google.com [IPv6:2607:f8b0:4001:c0b::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A80336F241 for ; Thu, 14 Jun 2018 03:32:55 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22b.google.com with SMTP id p185-v6so6809196itp.4 for ; Wed, 13 Jun 2018 20:32:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=HofdsxjKybOQCVIRoN6BWchnCIdfNTXrHon3gBxaaBw=; b=eSJuvXW44y+JX6SBXB/xcfnFv0U03LLEBuzoDHixTHMn9UEg3o7gr9AfHBLsSY2KAL ri/SEC02LplPsD4Mdu2KzwT3j6vRY4K2i9d/CmcGzxVyGboKeJtuEjxqPXSBxN2/ssm8 QA84+9Y2no0CNM6nJB5ySn8dKnBDcbTC6WYau+SYgG7Q19ggEQZrMUW7Vo7b2Jx5HDh9 +3XoxGtt5rJG6fmTNXzp0bmebC3s4BlP2cXSVq3qs9gsR/K4xufbcc3Sen36RsYJWofS d7ZQ5Z/v19cMv4+dpyZxyp7zFDtfaLrfnu4Y6keDG51aVVHixBL/iMxEYyi9sx7rxwMa v/QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=HofdsxjKybOQCVIRoN6BWchnCIdfNTXrHon3gBxaaBw=; b=fa+8CH/GEhsWM8n85+vxpP8Uk2bAtpN8PkBvpO8dFMRCRJHH7ioXAekQ5Q39nY+FNO mVInZzE5LXfGpJSD8W+x0qh5MFa3J6jnOdm8GzbI0yL4evVmSH6Y60KZXQ/KWULOWddS kToN8187AobVlEWZgzxJ+fHwy2wGEaOcPTKW3Sk9t2QKf49mErU65IlLhy/8nTF92Vn5 2ewzeMxEpjvUgs/A8ZOM5s491GdloE/xOe7ekEuGuHddWtACP5f2dvT9yzFHbEt/Ujay CoTkFmlnrEofr+SDp2dsahsGuHMC7p2rT0FutSUQ2jFwelq0m24Qoc670O7XWWW4QOQR FV3w== X-Gm-Message-State: APt69E2x6OV+fEWq2C4e4x4MzZaiqWEEIZ8fT1Dl1ctNoosfsCXDacaD 5eqEyLrjC3plCC/t/jgO7le1UQjM1ipEOGWljreX8w== X-Google-Smtp-Source: ADUXVKLu3BNxKg4QopV6g/vRxGHd5RGJ67hKxP4khqHC59ZjnktwtkgZcBwcJjf/apE0/s+6kNuzGfR2M3s1bhRUN0s= X-Received: by 2002:a02:9aba:: with SMTP id m55-v6mr305796jak.140.1528947175048; Wed, 13 Jun 2018 20:32:55 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:d028:0:0:0:0:0 with HTTP; Wed, 13 Jun 2018 20:32:54 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: References: <201806140328.w5E3SCZp042620@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Wed, 13 Jun 2018 21:32:54 -0600 X-Google-Sender-Auth: x8jxzwf8KEPxT62DfPnKN4QC54k Message-ID: Subject: Re: svn commit: r335091 - head/sbin/nvmecontrol To: "Rodney W. Grimes" Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 03:32:56 -0000 Actually, that file (nvmecontrol_ext.h) is completely new. I'm not sure why it thought I copied it from util.c. Maybe it's a git svn integration thing. Warner On Wed, Jun 13, 2018 at 9:31 PM, Warner Losh wrote: > Ah, that's what you were talking about. OK. Will do. > > Warner > > On Wed, Jun 13, 2018 at 9:28 PM, Rodney W. Grimes < > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > >> > On Wed, Jun 13, 2018 at 9:03 PM, Rodney W. Grimes < >> > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: >> > >> > > > Author: imp >> > > > Date: Wed Jun 13 22:00:02 2018 >> > > > New Revision: 335091 >> > > > URL: https://svnweb.freebsd.org/changeset/base/335091 >> > > > >> > > > Log: >> > > > Make it possible to use print_controller from another program >> > > > >> > > > Rename print_controller to nvme_print_controller. Put it in its >> > > > own file for easy inclusion. Move util.c to be nc_util.c to not >> > > > conflict with camcontrol. add nvecontrol_ext.h to define shared >> > > > interfaces. >> > > > >> > > > Sponsored by: Netflix >> > > > Differential Revision: https://reviews.freebsd.org/D15371 >> > > > >> > > > Added: >> > > > head/sbin/nvmecontrol/identify_ext.c >> > > > - copied, changed from r335089, head/sbin/nvmecontrol/identify >> .c >> > > > head/sbin/nvmecontrol/nc_util.c >> > > > - copied, changed from r335089, head/sbin/nvmecontrol/util.c >> > > > head/sbin/nvmecontrol/nvmecontrol_ext.h (contents, props >> changed) >> > > > - copied, changed from r335089, head/sbin/nvmecontrol/util.c >> > > ... >> > > >> > > > >> > > > Copied and modified: head/sbin/nvmecontrol/nvmecontrol_ext.h (from >> > > r335089, head/sbin/nvmecontrol/util.c) >> > > > ============================================================ >> > > ================== >> > > > --- head/sbin/nvmecontrol/util.c Wed Jun 13 21:10:23 2018 >> > > (r335089, copy source) >> > > > +++ head/sbin/nvmecontrol/nvmecontrol_ext.h Wed Jun 13 22:00:02 >> 2018 >> > > (r335091) >> > > > @@ -1,7 +1,8 @@ >> > > > /*- >> > > > - * Copyright (c) 2017 Netflix, Inc >> > > > - * All rights reserved. >> > > > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD >> > > > * >> > > > + * Copyright (C) 2018 Netflix >> > > >> > > You moved a copyright forward, that is not proper to do. >> > > >> > >> > Thought it was. I honestly don't care where (nor does my employer), so >> if >> > you want to tweak it to be more conforming, be my guest. >> >> You can add a new date to the end of a list, but you should always >> retain the oldest date, and many opinions are that all dates should >> be retained unless they are continuous. >> >> It would be much simpler for you to commit: >> - * Copyright (C) 2018 Netflix >> + * Copyright (C) 2017-2018 Netflix >> >> Than for me to get approval: bde, phk. >> >> Thanks. >> Rod >> >> > >> > > Not sure about dropping the , Inc either. >> > >> > >> > Doesn't matter. Different Netflix committers do different things and I >> was >> > trying to move towards uniformity. >> >> Ok >> >> > Warner >> >> -- >> Rod Grimes >> rgrimes@freebsd.org >> > > From owner-svn-src-head@freebsd.org Thu Jun 14 03:34:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 763C41019C7B for ; Thu, 14 Jun 2018 03:34:34 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22e.google.com (mail-io0-x22e.google.com [IPv6:2607:f8b0:4001:c06::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 028086F44B for ; Thu, 14 Jun 2018 03:34:34 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22e.google.com with SMTP id t6-v6so5705170iob.10 for ; Wed, 13 Jun 2018 20:34:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=5Qpz+tOntiGpl+liUCcdnVnxpdIxEZkHzuVX3G+It44=; b=TdcIWRxW78iMhyR+9UGsIXPhMREALKK+zsi5uKgf4bi0fAyqxU+BJyHjFMROIXyrBa qJOJ8cs6fbEneyxJ1e9aDBXWOGeuTU+cAfuPT9dyGGtmUGTND4WWeJbhXubeeAgouNNA QT8yJavlQAsUgrSJv53jO1uIQItHUfYiwfmy4dAgga67PAxfm/yC14beSO8FsTJvG0Pp rR6VnaxsyKHt7hFSszCiZKDn1bG4AUj4Io7fDtOre2jOnmBtSvK4ElJ6rHnDZ560H2su i6VnW12DRfMOz34KhOwkc5TDxVdMmv59wL65ayiyb3FOEr0eux85GA4gN3RBttFFkoyY Bfmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=5Qpz+tOntiGpl+liUCcdnVnxpdIxEZkHzuVX3G+It44=; b=tjrsdFkQ2rXDz0dkwDXqNjweAwq0mmX00vDXUUxUBq0l7JJcGaUOKNaPuHV+P5mx7i ZGMw4jlBQfPny1l7zg3tk1WqABL/Ci+jbNgPlFVIwTUe27nJdhuILtrQzfsVjE2K+5aT ympJOfosNAY/P/klW29xKdmSTWUmaP6DRlWHKGHMK96zMBWYDAKIsFUyIwffWmtO3kU7 ZBt+C9effIMkaqMSRjcoSaWDp/MjMCYa8a3mi6JQmHBov9QmqrZ39mMxkqH4SPyqfhQ8 Q1juVpx1GvnjhJmx9HqMNcAFXiZi1+YKMeoTwcPOjb2iyIFohkrPEkEDt2ZcfsOuVeEk AxRA== X-Gm-Message-State: APt69E3FKM2qRjhOC7o6Q/GEDFl0DvIA9krVlSpqPJORAW31e/duanyg KAi2xM43G+wemTQdJnBzs8vjPdYt3CzNWLFX/uGGQQ== X-Google-Smtp-Source: ADUXVKKkvjWpuBYWtP1V6c3SewhGhOBpxMc4hSj5S+2jNsjZmxRhudRVj41vrfWbsvnwr51drKgCV2nglsLrOBBUrCA= X-Received: by 2002:a6b:d40c:: with SMTP id l12-v6mr759818iog.37.1528947273356; Wed, 13 Jun 2018 20:34:33 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:d028:0:0:0:0:0 with HTTP; Wed, 13 Jun 2018 20:34:32 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: References: <201806140328.w5E3SCZp042620@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Wed, 13 Jun 2018 21:34:32 -0600 X-Google-Sender-Auth: QO5BZk1KHtjv9BWadMBh7iuLhy4 Message-ID: Subject: Re: svn commit: r335091 - head/sbin/nvmecontrol To: Juli Mallett Cc: "Rodney W. Grimes" , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 03:34:34 -0000 On Wed, Jun 13, 2018 at 9:31 PM, Juli Mallett wrote: > On 13 June 2018 at 20:28, Rodney W. Grimes > wrote: > >> > On Wed, Jun 13, 2018 at 9:03 PM, Rodney W. Grimes < >> > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: >> > >> > > > Author: imp >> > > > Date: Wed Jun 13 22:00:02 2018 >> > > > New Revision: 335091 >> > > > URL: https://svnweb.freebsd.org/changeset/base/335091 >> > > > >> > > > Log: >> > > > Make it possible to use print_controller from another program >> > > > >> > > > Rename print_controller to nvme_print_controller. Put it in its >> > > > own file for easy inclusion. Move util.c to be nc_util.c to not >> > > > conflict with camcontrol. add nvecontrol_ext.h to define shared >> > > > interfaces. >> > > > >> > > > Sponsored by: Netflix >> > > > Differential Revision: https://reviews.freebsd.org/D15371 >> > > > >> > > > Added: >> > > > head/sbin/nvmecontrol/identify_ext.c >> > > > - copied, changed from r335089, head/sbin/nvmecontrol/identify >> .c >> > > > head/sbin/nvmecontrol/nc_util.c >> > > > - copied, changed from r335089, head/sbin/nvmecontrol/util.c >> > > > head/sbin/nvmecontrol/nvmecontrol_ext.h (contents, props >> changed) >> > > > - copied, changed from r335089, head/sbin/nvmecontrol/util.c >> > > ... >> > > >> > > > >> > > > Copied and modified: head/sbin/nvmecontrol/nvmecontrol_ext.h (from >> > > r335089, head/sbin/nvmecontrol/util.c) >> > > > ============================================================ >> > > ================== >> > > > --- head/sbin/nvmecontrol/util.c Wed Jun 13 21:10:23 2018 >> > > (r335089, copy source) >> > > > +++ head/sbin/nvmecontrol/nvmecontrol_ext.h Wed Jun 13 22:00:02 >> 2018 >> > > (r335091) >> > > > @@ -1,7 +1,8 @@ >> > > > /*- >> > > > - * Copyright (c) 2017 Netflix, Inc >> > > > - * All rights reserved. >> > > > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD >> > > > * >> > > > + * Copyright (C) 2018 Netflix >> > > >> > > You moved a copyright forward, that is not proper to do. >> > > >> > >> > Thought it was. I honestly don't care where (nor does my employer), so >> if >> > you want to tweak it to be more conforming, be my guest. >> >> You can add a new date to the end of a list, but you should always >> retain the oldest date, and many opinions are that all dates should >> be retained unless they are continuous. >> > > Do you have a citation for this, Rod? I ask because my impression was > that although it has often been done, and at one point may legitimately > have been required, it is not any longer so. I'd love to have a concrete > source on this, though. > The project just does oldest and newest with a -. The US copyright office says you just need the newest. There's some concern elsewhere is different, but I have nothing concrete on that. I've never heard Rod's advice in the 20 years I've been minding the store here and at small shops I've worked at. Warner > > It would be much simpler for you to commit: >> - * Copyright (C) 2018 Netflix >> + * Copyright (C) 2017-2018 Netflix >> >> Than for me to get approval: bde, phk. >> >> Thanks. >> Rod >> >> > >> > > Not sure about dropping the , Inc either. >> > >> > >> > Doesn't matter. Different Netflix committers do different things and I >> was >> > trying to move towards uniformity. >> >> Ok >> >> > Warner >> >> -- >> Rod Grimes >> rgrimes@freebsd.org >> >> > From owner-svn-src-head@freebsd.org Thu Jun 14 04:44:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A4D4101F844; Thu, 14 Jun 2018 04:44:35 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2ED7871BFE; Thu, 14 Jun 2018 04:44:35 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 1EF8C2565; Thu, 14 Jun 2018 04:44:35 +0000 (UTC) Date: Thu, 14 Jun 2018 04:44:35 +0000 From: Alexey Dokuchaev To: Bryan Drewery Cc: Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335042 - head/usr.bin/top Message-ID: <20180614044435.GA94219@FreeBSD.org> References: <201806130852.w5D8qKd4094584@repo.freebsd.org> <9b6b26cf-dac2-f5ab-e694-5d132ff1bdb9@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9b6b26cf-dac2-f5ab-e694-5d132ff1bdb9@FreeBSD.org> User-Agent: Mutt/1.9.5 (2018-04-13) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 04:44:35 -0000 On Wed, Jun 13, 2018 at 05:01:35PM -0700, Bryan Drewery wrote: > ... > Also I really abhor rewriting anything that's not broken as it causes > merge conflict pain downstream and just adds regression risk. +1. I'm still having mixed feelings about top(1) de-contrib and rewrite. At the very least, it should not be MFC'ed until it matures long enough in -CURRENT and all regressions are found and fixed (they pop up here and there now). Currently top(1) is still a pessimization compared to what it was before, so there's a lot to catch up with. ./danfe From owner-svn-src-head@freebsd.org Thu Jun 14 04:57:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D29F10209AE; Thu, 14 Jun 2018 04:57:57 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC4C872309; Thu, 14 Jun 2018 04:57:56 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w5E4vpEq042986; Wed, 13 Jun 2018 21:57:51 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w5E4vpEA042985; Wed, 13 Jun 2018 21:57:51 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806140457.w5E4vpEA042985@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r335091 - head/sbin/nvmecontrol In-Reply-To: To: Warner Losh Date: Wed, 13 Jun 2018 21:57:50 -0700 (PDT) CC: "Rodney W. Grimes" , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 04:57:57 -0000 [ Charset UTF-8 unsupported, converting... ] > Actually, that file (nvmecontrol_ext.h) is completely new. I'm not sure why > it thought I copied it from util.c. Maybe it's a git svn integration thing. If it is a totally new file why is it showing contect diff with + and -'s? > Warner > > On Wed, Jun 13, 2018 at 9:31 PM, Warner Losh wrote: > > > Ah, that's what you were talking about. OK. Will do. > > > > Warner > > > > On Wed, Jun 13, 2018 at 9:28 PM, Rodney W. Grimes < > > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > >> > On Wed, Jun 13, 2018 at 9:03 PM, Rodney W. Grimes < > >> > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > >> > > >> > > > Author: imp > >> > > > Date: Wed Jun 13 22:00:02 2018 > >> > > > New Revision: 335091 > >> > > > URL: https://svnweb.freebsd.org/changeset/base/335091 > >> > > > > >> > > > Log: > >> > > > Make it possible to use print_controller from another program > >> > > > > >> > > > Rename print_controller to nvme_print_controller. Put it in its > >> > > > own file for easy inclusion. Move util.c to be nc_util.c to not > >> > > > conflict with camcontrol. add nvecontrol_ext.h to define shared > >> > > > interfaces. > >> > > > > >> > > > Sponsored by: Netflix > >> > > > Differential Revision: https://reviews.freebsd.org/D15371 > >> > > > > >> > > > Added: > >> > > > head/sbin/nvmecontrol/identify_ext.c > >> > > > - copied, changed from r335089, head/sbin/nvmecontrol/identify > >> .c > >> > > > head/sbin/nvmecontrol/nc_util.c > >> > > > - copied, changed from r335089, head/sbin/nvmecontrol/util.c > >> > > > head/sbin/nvmecontrol/nvmecontrol_ext.h (contents, props > >> changed) > >> > > > - copied, changed from r335089, head/sbin/nvmecontrol/util.c > >> > > ... > >> > > > >> > > > > >> > > > Copied and modified: head/sbin/nvmecontrol/nvmecontrol_ext.h (from > >> > > r335089, head/sbin/nvmecontrol/util.c) > >> > > > ============================================================ > >> > > ================== > >> > > > --- head/sbin/nvmecontrol/util.c Wed Jun 13 21:10:23 2018 > >> > > (r335089, copy source) > >> > > > +++ head/sbin/nvmecontrol/nvmecontrol_ext.h Wed Jun 13 22:00:02 > >> 2018 > >> > > (r335091) > >> > > > @@ -1,7 +1,8 @@ > >> > > > /*- > >> > > > - * Copyright (c) 2017 Netflix, Inc > >> > > > - * All rights reserved. > >> > > > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > >> > > > * > >> > > > + * Copyright (C) 2018 Netflix > >> > > > >> > > You moved a copyright forward, that is not proper to do. > >> > > > >> > > >> > Thought it was. I honestly don't care where (nor does my employer), so > >> if > >> > you want to tweak it to be more conforming, be my guest. > >> > >> You can add a new date to the end of a list, but you should always > >> retain the oldest date, and many opinions are that all dates should > >> be retained unless they are continuous. > >> > >> It would be much simpler for you to commit: > >> - * Copyright (C) 2018 Netflix > >> + * Copyright (C) 2017-2018 Netflix > >> > >> Than for me to get approval: bde, phk. > >> > >> Thanks. > >> Rod > >> > >> > > >> > > Not sure about dropping the , Inc either. > >> > > >> > > >> > Doesn't matter. Different Netflix committers do different things and I > >> was > >> > trying to move towards uniformity. > >> > >> Ok > >> > >> > Warner > >> > >> -- > >> Rod Grimes > >> rgrimes@freebsd.org > >> > > > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Jun 14 04:59:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C2B81020C2B; Thu, 14 Jun 2018 04:59:52 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1EE4724A8; Thu, 14 Jun 2018 04:59:51 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w5E4xnPh043002; Wed, 13 Jun 2018 21:59:49 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w5E4xn93043001; Wed, 13 Jun 2018 21:59:49 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806140459.w5E4xn93043001@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r335091 - head/sbin/nvmecontrol In-Reply-To: To: Warner Losh Date: Wed, 13 Jun 2018 21:59:49 -0700 (PDT) CC: Juli Mallett , "Rodney W. Grimes" , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 04:59:52 -0000 > On Wed, Jun 13, 2018 at 9:31 PM, Juli Mallett wrote: > > > On 13 June 2018 at 20:28, Rodney W. Grimes > > wrote: > > > >> > On Wed, Jun 13, 2018 at 9:03 PM, Rodney W. Grimes < > >> > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > >> > > >> > > > Author: imp > >> > > > Date: Wed Jun 13 22:00:02 2018 > >> > > > New Revision: 335091 > >> > > > URL: https://svnweb.freebsd.org/changeset/base/335091 > >> > > > > >> > > > Log: > >> > > > Make it possible to use print_controller from another program > >> > > > > >> > > > Rename print_controller to nvme_print_controller. Put it in its > >> > > > own file for easy inclusion. Move util.c to be nc_util.c to not > >> > > > conflict with camcontrol. add nvecontrol_ext.h to define shared > >> > > > interfaces. > >> > > > > >> > > > Sponsored by: Netflix > >> > > > Differential Revision: https://reviews.freebsd.org/D15371 > >> > > > > >> > > > Added: > >> > > > head/sbin/nvmecontrol/identify_ext.c > >> > > > - copied, changed from r335089, head/sbin/nvmecontrol/identify > >> .c > >> > > > head/sbin/nvmecontrol/nc_util.c > >> > > > - copied, changed from r335089, head/sbin/nvmecontrol/util.c > >> > > > head/sbin/nvmecontrol/nvmecontrol_ext.h (contents, props > >> changed) > >> > > > - copied, changed from r335089, head/sbin/nvmecontrol/util.c > >> > > ... > >> > > > >> > > > > >> > > > Copied and modified: head/sbin/nvmecontrol/nvmecontrol_ext.h (from > >> > > r335089, head/sbin/nvmecontrol/util.c) > >> > > > ============================================================ > >> > > ================== > >> > > > --- head/sbin/nvmecontrol/util.c Wed Jun 13 21:10:23 2018 > >> > > (r335089, copy source) > >> > > > +++ head/sbin/nvmecontrol/nvmecontrol_ext.h Wed Jun 13 22:00:02 > >> 2018 > >> > > (r335091) > >> > > > @@ -1,7 +1,8 @@ > >> > > > /*- > >> > > > - * Copyright (c) 2017 Netflix, Inc > >> > > > - * All rights reserved. > >> > > > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > >> > > > * > >> > > > + * Copyright (C) 2018 Netflix > >> > > > >> > > You moved a copyright forward, that is not proper to do. > >> > > > >> > > >> > Thought it was. I honestly don't care where (nor does my employer), so > >> if > >> > you want to tweak it to be more conforming, be my guest. > >> > >> You can add a new date to the end of a list, but you should always > >> retain the oldest date, and many opinions are that all dates should > >> be retained unless they are continuous. > >> > > > > Do you have a citation for this, Rod? I ask because my impression was > > that although it has often been done, and at one point may legitimately > > have been required, it is not any longer so. I'd love to have a concrete > > source on this, though. > > > > The project just does oldest and newest with a -. > > The US copyright office says you just need the newest. There's some concern Can you be more specific on where on the US copyright offices site? > elsewhere is different, but I have nothing concrete on that. > > I've never heard Rod's advice in the 20 years I've been minding the store > here and at small shops I've worked at. And have any of these places actually read the text of USC 17? > Warner > > > > > > > It would be much simpler for you to commit: > >> - * Copyright (C) 2018 Netflix > >> + * Copyright (C) 2017-2018 Netflix > >> > >> Than for me to get approval: bde, phk. > >> > >> Thanks. > >> Rod > >> > >> > > >> > > Not sure about dropping the , Inc either. > >> > > >> > > >> > Doesn't matter. Different Netflix committers do different things and I > >> was > >> > trying to move towards uniformity. > >> > >> Ok > >> > >> > Warner > >> > >> -- > >> Rod Grimes > >> rgrimes@freebsd.org > >> > >> > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Jun 14 05:21:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71EEC10225C2 for ; Thu, 14 Jun 2018 05:21:55 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22a.google.com (mail-it0-x22a.google.com [IPv6:2607:f8b0:4001:c0b::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 99F717320F for ; Thu, 14 Jun 2018 05:21:54 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22a.google.com with SMTP id j135-v6so7055608itj.1 for ; Wed, 13 Jun 2018 22:21:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=OlO3uj4tPx3I4kdzzfAajofVjoXDY60vMZNLkFfuD1c=; b=oJ/FnMiPLxW9ovQGeZn8oj3zdxA5UMafyHu/hdan9h7cl9wes2eNCIf0J8wX8KbITr MEjPpf95/8lnl034koS/fix5xdEdejC1mULIDyc2olC/cWTSwxIfP8ppopnmMenFNnia B4DXziYu++EQ4aUoPcnbGDbKB6O9OjAJLXlwmZCgKQP3vToc/GZMiq4UChgzBa9FX8F5 apTai+FxGBOZ2E8/VaThnm+SY/tqUl14TFnCYEOe4AwsK28NYJnah1FBcWKIVt+b73Uy 3a4IcLB81G2oNMEwPRWkynrLyUOW1y9kVxkOqQdbCPLlogKHPgfbOBUTzF2DKhattCVK 3CBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=OlO3uj4tPx3I4kdzzfAajofVjoXDY60vMZNLkFfuD1c=; b=sPabeZ2fy4jMZuU8y0ogGBVtJ6vn8VfO9fNmUUndMYF0oGrZIGytyF7bDF8XHm8lq0 cpQPalYVXLydrawgOBjSmhog8TSSPwxnS13vYwfN3RQj2JfBSo8IQyKyhLL2Jwy8sa8n i3enUFjxsLkKESI4SfLUgXaHoG3zzJdDhyGHi+Yu2vpy1LcQGpuuIHfmtLt2shpT7wfG KN2/c1pWVaOCIdaQ2POv2jZvCxLKLLYvWu8WptEAHJGue6eb6RavraOOPW9q9489ELsF ABQZHL3jqYUtc/AVk/YGbgpqFnzt/TiA3uSS21ZEZqaqUbTYRQ/zMtwujYs0t1408hOP mwhQ== X-Gm-Message-State: APt69E0FceOXiI89L9559oI8cz8+JfzbVF9oEI3g17U6SK+pCyikZGJI cMXaIJdYQ21nZg0r4WIvABMBqI2KyHSNfxCDnwsV1Q== X-Google-Smtp-Source: ADUXVKIqlHLjPJ7sEvCvUvaBmh9r90lA8ca64qOa03I4hHRAYCnJ/Qb+gi7mxL96JkNkEq8WYDDXVOMvXLDolqfnuxo= X-Received: by 2002:a24:7c8d:: with SMTP id a135-v6mr867032itd.73.1528953713740; Wed, 13 Jun 2018 22:21:53 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:d028:0:0:0:0:0 with HTTP; Wed, 13 Jun 2018 22:21:53 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <201806140457.w5E4vpEA042985@pdx.rh.CN85.dnsmgr.net> References: <201806140457.w5E4vpEA042985@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Wed, 13 Jun 2018 23:21:53 -0600 X-Google-Sender-Auth: VaAEPgy_90TjJeVvX7ZBTc6FFNM Message-ID: Subject: Re: svn commit: r335091 - head/sbin/nvmecontrol To: "Rodney W. Grimes" Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 05:21:55 -0000 On Wed, Jun 13, 2018 at 10:57 PM, Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > [ Charset UTF-8 unsupported, converting... ] > > Actually, that file (nvmecontrol_ext.h) is completely new. I'm not sure > why > > it thought I copied it from util.c. Maybe it's a git svn integration > thing. > > If it is a totally new file why is it showing contect diff with > + and -'s? Don't know, but the whole contents of this file is 1 line of extern function statements. Since util.c is short, and I try to use identical copyright notices, I'm thinking git thought it was a move through 'magic' and that's where svn got confused into thinking it was a copy + modification which is where the diff came from. Warner > > Warner > > > > On Wed, Jun 13, 2018 at 9:31 PM, Warner Losh wrote: > > > > > Ah, that's what you were talking about. OK. Will do. > > > > > > Warner > > > > > > On Wed, Jun 13, 2018 at 9:28 PM, Rodney W. Grimes < > > > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > > >> > On Wed, Jun 13, 2018 at 9:03 PM, Rodney W. Grimes < > > >> > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > >> > > > >> > > > Author: imp > > >> > > > Date: Wed Jun 13 22:00:02 2018 > > >> > > > New Revision: 335091 > > >> > > > URL: https://svnweb.freebsd.org/changeset/base/335091 > > >> > > > > > >> > > > Log: > > >> > > > Make it possible to use print_controller from another program > > >> > > > > > >> > > > Rename print_controller to nvme_print_controller. Put it in > its > > >> > > > own file for easy inclusion. Move util.c to be nc_util.c to > not > > >> > > > conflict with camcontrol. add nvecontrol_ext.h to define > shared > > >> > > > interfaces. > > >> > > > > > >> > > > Sponsored by: Netflix > > >> > > > Differential Revision: https://reviews.freebsd.org/D15371 > > >> > > > > > >> > > > Added: > > >> > > > head/sbin/nvmecontrol/identify_ext.c > > >> > > > - copied, changed from r335089, > head/sbin/nvmecontrol/identify > > >> .c > > >> > > > head/sbin/nvmecontrol/nc_util.c > > >> > > > - copied, changed from r335089, > head/sbin/nvmecontrol/util.c > > >> > > > head/sbin/nvmecontrol/nvmecontrol_ext.h (contents, props > > >> changed) > > >> > > > - copied, changed from r335089, > head/sbin/nvmecontrol/util.c > > >> > > ... > > >> > > > > >> > > > > > >> > > > Copied and modified: head/sbin/nvmecontrol/nvmecontrol_ext.h > (from > > >> > > r335089, head/sbin/nvmecontrol/util.c) > > >> > > > ============================================================ > > >> > > ================== > > >> > > > --- head/sbin/nvmecontrol/util.c Wed Jun 13 21:10:23 2018 > > >> > > (r335089, copy source) > > >> > > > +++ head/sbin/nvmecontrol/nvmecontrol_ext.h Wed Jun 13 > 22:00:02 > > >> 2018 > > >> > > (r335091) > > >> > > > @@ -1,7 +1,8 @@ > > >> > > > /*- > > >> > > > - * Copyright (c) 2017 Netflix, Inc > > >> > > > - * All rights reserved. > > >> > > > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > > >> > > > * > > >> > > > + * Copyright (C) 2018 Netflix > > >> > > > > >> > > You moved a copyright forward, that is not proper to do. > > >> > > > > >> > > > >> > Thought it was. I honestly don't care where (nor does my employer), > so > > >> if > > >> > you want to tweak it to be more conforming, be my guest. > > >> > > >> You can add a new date to the end of a list, but you should always > > >> retain the oldest date, and many opinions are that all dates should > > >> be retained unless they are continuous. > > >> > > >> It would be much simpler for you to commit: > > >> - * Copyright (C) 2018 Netflix > > >> + * Copyright (C) 2017-2018 Netflix > > >> > > >> Than for me to get approval: bde, phk. > > >> > > >> Thanks. > > >> Rod > > >> > > >> > > > >> > > Not sure about dropping the , Inc either. > > >> > > > >> > > > >> > Doesn't matter. Different Netflix committers do different things > and I > > >> was > > >> > trying to move towards uniformity. > > >> > > >> Ok > > >> > > >> > Warner > > >> > > >> -- > > >> Rod Grimes > > >> rgrimes@freebsd.org > > >> > > > > > > > > -- > Rod Grimes > rgrimes@freebsd.org > From owner-svn-src-head@freebsd.org Thu Jun 14 05:35:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 272B01000A2B; Thu, 14 Jun 2018 05:35:14 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 74E2673B14; Thu, 14 Jun 2018 05:35:13 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w5E5ZB8p043115; Wed, 13 Jun 2018 22:35:11 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w5E5ZBmf043114; Wed, 13 Jun 2018 22:35:11 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806140535.w5E5ZBmf043114@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r335091 - head/sbin/nvmecontrol In-Reply-To: To: Juli Mallett Date: Wed, 13 Jun 2018 22:35:11 -0700 (PDT) CC: rgrimes@freebsd.org, Warner Losh , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 05:35:14 -0000 > On 13 June 2018 at 20:28, Rodney W. Grimes > wrote: > > > > On Wed, Jun 13, 2018 at 9:03 PM, Rodney W. Grimes < ... > > > > > @@ -1,7 +1,8 @@ > > > > > /*- > > > > > - * Copyright (c) 2017 Netflix, Inc > > > > > - * All rights reserved. > > > > > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > > > > > * > > > > > + * Copyright (C) 2018 Netflix > > > > > > > > You moved a copyright forward, that is not proper to do. > > > > > > > > > > Thought it was. I honestly don't care where (nor does my employer), so if > > > you want to tweak it to be more conforming, be my guest. > > > > You can add a new date to the end of a list, but you should always > > retain the oldest date, and many opinions are that all dates should > > be retained unless they are continuous. > > > > Do you have a citation for this, Rod? I ask because my impression was that > although it has often been done, and at one point may legitimately have > been required, it is not any longer so. I'd love to have a concrete source > on this, though. One place to start is circ15: https://www.copyright.gov/circs/circ15a.pdf Fundemental principle of copyright protections duration are from -first- date of publication, that is covered in USC 17. If you miss represent that date in your copyright your copyright can be held invalid. The real smoking gun is: 17 USC 401 b (2): the year of first publication of the work; in the case of compilations or derivative works incorporating previously published material, the year date of first publication of the compilation or derivative work is sufficient. The year date may be omitted where a pictorial, graphic, or sculptural work, with accompanying text matter, if any, is reproduced in or on greeting cards, postcards, stationery, jewelry, dolls, toys, or any useful articles; and The interpretation of compilation or derivative does open a grey area here in software, and I can see how one might consider a patch to create a derived work. There is case law that putting a date later than first publication appears as an attempt to move the duration of your protection to be longer than it really should be. https://www.copyright.gov/comp3/chap2200/ch2200-notice.pdf At 2202.2(A) Advantages to Using Notice on Post-Berne Works "It identifies the year of first publication, which may be used to determine the term of copyright protection in the case of an anonymous work, a pseudonymous work, or a work made for hire." Much of our work, and in this case of Netflix and these files, they are defanitly works made for hire, so this applies and identifying first date of publication is important. There is also: At 2203.1 Works First Published Between January 1, 1978 and February 28, 1989 This Applies to some of our code, as it has First publications in these date ranges, boils down to even though Berne says you dont have to have a notice, if you first published the work in this time frame you had to have a notice then, and you still have to have a notice now. Yes, Disney and others have done fun stuff with copyrights on *movies*, but that has other complications doing with re-mixes and all sorts of other things that make it possible for them to claim it is a new creative work, not just a revision of an old work. I could re research the case law if you really want more. > > It would be much simpler for you to commit: > > - * Copyright (C) 2018 Netflix > > + * Copyright (C) 2017-2018 Netflix > > > > Than for me to get approval: bde, phk. > > > > Thanks. > > Rod > > > > > > > > > Not sure about dropping the , Inc either. > > > > > > > > > Doesn't matter. Different Netflix committers do different things and I > > was > > > trying to move towards uniformity. > > > > Ok > > > > > Warner > > > > -- > > Rod Grimes > > rgrimes@freebsd.org > > > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Jun 14 05:38:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 581901000F5E for ; Thu, 14 Jun 2018 05:38:15 +0000 (UTC) (envelope-from juli@northcloak.com) Received: from mail-qk0-x242.google.com (mail-qk0-x242.google.com [IPv6:2607:f8b0:400d:c09::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E62D173DB0 for ; Thu, 14 Jun 2018 05:38:14 +0000 (UTC) (envelope-from juli@northcloak.com) Received: by mail-qk0-x242.google.com with SMTP id c198-v6so2964047qkg.12 for ; Wed, 13 Jun 2018 22:38:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=northcloak-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=wmDpie84PZuiihRj+912Jp9JSJTP785eEJZgm1tJ4pE=; b=T6TU65WvXOFcTpZdXN2OQCzNabDf2HYARG9VYkJqoc4ptNvMjVB94wxMKBtFteqQbJ WgOJYMh1BYu39kQ762eweTx102hSW5lXoZgkRmw43Cqy4ba59cohY0H2FKf78OfZQiOt asbD0s2KAZWJ/C1ZcfQN8tHOLP+OtLIsIhuuWX3ujKzAZrrvDtG1934fb6ZzpVwJj0Zt j7lXz48Sxsy+XZhRx8BplPe2drti0+AaPKYG+hN3eiY/Zd1Zj6fikibl2prA4W6r0H5E vzwVMryDIZ5dRlCpo6zmvKUea3YMW0jc6Qq4fy3Npt712UVlHpnR4H+uSQCqzdnHc+e3 yrSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=wmDpie84PZuiihRj+912Jp9JSJTP785eEJZgm1tJ4pE=; b=YPc3fsQ70RtVzMXqmSm1aaMYCSJAz/1IOnLkDAvBxKJvno9TUfsnvZNZsfmboZadTC FGno3urvrzp4kdkbh0UMkSZi2GYf2bYWmhVbxT2yN/glfuWr7ix2LwyRH/YWgWHSdHYe UBgGp2m+BY7awgoZySjKlyVn7dSugnPnx9Jf3en37n8nAipJbZnGpCO8dakDCmpXrVug 5bhJ+ZmQaB+NExsisruEbuLI8x57vRH3c9jMaSGD1LOZPdunsTayYzhvpx/BmxIgwc8I B382qkf11ddB0hK8spPEOM2YhkB3s9NI56OdrUcizkc2AcL9/YSWeJ/0BeF0HXAkwBdk HS4g== X-Gm-Message-State: APt69E35YnoC3g/rRHhzVWsigencFM/00SGFR47t0Yp1ACbrl6LzR/PF OAoYGaOLLyMjoLE6bq87YwvadkNlDM8rB+PJYhyxhg== X-Google-Smtp-Source: ADUXVKIhbvZ88ANGnbuvLvneirDw0n819p/OM6nBRaneZxRYnSrJa99ACT2cHVgPoUav7oOHC6zKyaD6IsK7iYbzbK8= X-Received: by 2002:a37:c598:: with SMTP id k24-v6mr914394qkl.153.1528954694592; Wed, 13 Jun 2018 22:38:14 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:aed:3579:0:0:0:0:0 with HTTP; Wed, 13 Jun 2018 22:37:34 -0700 (PDT) In-Reply-To: <201806140535.w5E5ZBmf043114@pdx.rh.CN85.dnsmgr.net> References: <201806140535.w5E5ZBmf043114@pdx.rh.CN85.dnsmgr.net> From: Juli Mallett Date: Wed, 13 Jun 2018 22:37:34 -0700 Message-ID: Subject: Re: svn commit: r335091 - head/sbin/nvmecontrol To: rgrimes@freebsd.org Cc: Warner Losh , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 05:38:15 -0000 On 13 June 2018 at 22:35, Rodney W. Grimes wrote: > > On 13 June 2018 at 20:28, Rodney W. Grimes net> > > wrote: > > > > > > On Wed, Jun 13, 2018 at 9:03 PM, Rodney W. Grimes < > ... > > > > > > @@ -1,7 +1,8 @@ > > > > > > /*- > > > > > > - * Copyright (c) 2017 Netflix, Inc > > > > > > - * All rights reserved. > > > > > > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > > > > > > * > > > > > > + * Copyright (C) 2018 Netflix > > > > > > > > > > You moved a copyright forward, that is not proper to do. > > > > > > > > > > > > > Thought it was. I honestly don't care where (nor does my employer), > so if > > > > you want to tweak it to be more conforming, be my guest. > > > > > > You can add a new date to the end of a list, but you should always > > > retain the oldest date, and many opinions are that all dates should > > > be retained unless they are continuous. > > > > > > > Do you have a citation for this, Rod? I ask because my impression was > that > > although it has often been done, and at one point may legitimately have > > been required, it is not any longer so. I'd love to have a concrete > source > > on this, though. > > One place to start is circ15: > https://www.copyright.gov/circs/circ15a.pdf > > Fundemental principle of copyright protections duration are from -first- > date of publication, that is covered in USC 17. If you miss represent > that date in your copyright your copyright can be held invalid. > The real smoking gun is: > 17 USC 401 b (2): > the year of first publication of the work; in the > case of compilations or derivative works incorporating > previously published material, the year date of first > publication of the compilation or derivative work is > sufficient. The year date may be omitted where a pictorial, > graphic, or sculptural work, with accompanying text matter, > if any, is reproduced in or on greeting cards, postcards, > stationery, jewelry, dolls, toys, or any useful articles; and > > The interpretation of compilation or derivative does open a grey > area here in software, and I can see how one might consider a > patch to create a derived work. > Per your quote: "the year of first publication of the work; in the case of compilations or derivative works incorporating previously published material, the year date of first publication of the compilation or derivative work is sufficient." It seems to plainly suggest listing one year, not several years, and certainly not by some convoluted scheme. We're not lawyers. I'm not sure this is a useful discussion. I'd love a citation for the multiple-years scheme you describe, which does not seem to be in USC 17. There is case law that putting a date later than first publication > appears as an attempt to move the duration of your protection > to be longer than it really should be. > > https://www.copyright.gov/comp3/chap2200/ch2200-notice.pdf > At 2202.2(A) Advantages to Using Notice on Post-Berne Works > "It identifies the year of first publication, > which may be used to determine the term of copyright > protection in the case of an anonymous work, > a pseudonymous work, or a work made for hire." > > Much of our work, and in this case of Netflix and these > files, they are defanitly works made for hire, so this > applies and identifying first date of publication is > important. > > There is also: > At 2203.1 Works First Published Between January 1, 1978 and February 28, > 1989 > This Applies to some of our code, as it has First publications > in these date ranges, boils down to even though Berne says you dont > have to have a notice, if you first published the work in this time > frame you had to have a notice then, and you still have to have a > notice now. > > Yes, Disney and others have done fun stuff with copyrights on *movies*, > but that has other complications doing with re-mixes and all sorts of other > things that make it possible for them to claim it is a new creative > work, not just a revision of an old work. > > I could re research the case law if you really want more. > > > > > It would be much simpler for you to commit: > > > - * Copyright (C) 2018 Netflix > > > + * Copyright (C) 2017-2018 Netflix > > > > > > Than for me to get approval: bde, phk. > > > > > > Thanks. > > > Rod > > > > > > > > > > > > Not sure about dropping the , Inc either. > > > > > > > > > > > > Doesn't matter. Different Netflix committers do different things and > I > > > was > > > > trying to move towards uniformity. > > > > > > Ok > > > > > > > Warner > > > > > > -- > > > Rod Grimes > > > rgrimes@freebsd.org > > > > > > > > -- > Rod Grimes > rgrimes@freebsd.org > From owner-svn-src-head@freebsd.org Thu Jun 14 05:41:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C7FF1001452; Thu, 14 Jun 2018 05:41:17 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E5747404E; Thu, 14 Jun 2018 05:41:17 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F14B2429B; Thu, 14 Jun 2018 05:41:17 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5E5fHWY032165; Thu, 14 Jun 2018 05:41:17 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5E5fGRT032164; Thu, 14 Jun 2018 05:41:16 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201806140541.w5E5fGRT032164@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 14 Jun 2018 05:41:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335107 - head/sys/arm64/rockchip X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip X-SVN-Commit-Revision: 335107 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 05:41:17 -0000 Author: manu Date: Thu Jun 14 05:41:16 2018 New Revision: 335107 URL: https://svnweb.freebsd.org/changeset/base/335107 Log: rk_pinctrl: Only add gpio subnode This is the only node we are interested in so do not waste time to test creating device that will be either unused or fail as most of the nodes don't have a compatible string. Modified: head/sys/arm64/rockchip/rk_pinctrl.c Modified: head/sys/arm64/rockchip/rk_pinctrl.c ============================================================================== --- head/sys/arm64/rockchip/rk_pinctrl.c Thu Jun 14 03:27:42 2018 (r335106) +++ head/sys/arm64/rockchip/rk_pinctrl.c Thu Jun 14 05:41:16 2018 (r335107) @@ -438,6 +438,8 @@ rk_pinctrl_attach(device_t dev) /* Attach child devices */ for (node = OF_child(node); node > 0; node = OF_peer(node)) { + if (!ofw_bus_node_is_compatible(node, "rockchip,gpio-bank")) + continue; cdev = simplebus_add_device(dev, node, 0, NULL, -1, NULL); if (cdev != NULL) device_probe_and_attach(cdev); From owner-svn-src-head@freebsd.org Thu Jun 14 05:43:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E524410018AD; Thu, 14 Jun 2018 05:43:46 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9301E744D0; Thu, 14 Jun 2018 05:43:46 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5AFAF243F7; Thu, 14 Jun 2018 05:43:46 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5E5hkhc036520; Thu, 14 Jun 2018 05:43:46 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5E5hjS8036518; Thu, 14 Jun 2018 05:43:45 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201806140543.w5E5hjS8036518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 14 Jun 2018 05:43:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335108 - head/sys/arm64/rockchip/clk X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip/clk X-SVN-Commit-Revision: 335108 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 05:43:47 -0000 Author: manu Date: Thu Jun 14 05:43:45 2018 New Revision: 335108 URL: https://svnweb.freebsd.org/changeset/base/335108 Log: rk_pll: Add support for mode RockChip PLL have two modes controlled by a register, a "slow mode" (the default one) where the frequency is derived from the 24Mhz oscillator on the board, and a "normal" one when the pll take it's input from the real PLL output. Default the mode to normal for all the PLLs. Modified: head/sys/arm64/rockchip/clk/rk3328_cru.c head/sys/arm64/rockchip/clk/rk_clk_pll.c head/sys/arm64/rockchip/clk/rk_clk_pll.h Modified: head/sys/arm64/rockchip/clk/rk3328_cru.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk3328_cru.c Thu Jun 14 05:41:16 2018 (r335107) +++ head/sys/arm64/rockchip/clk/rk3328_cru.c Thu Jun 14 05:43:45 2018 (r335108) @@ -512,6 +512,8 @@ static struct rk_clk_pll_def apll = { .base_offset = 0x00, .gate_offset = 0x200, .gate_shift = 0, + .mode_reg = 0x80, + .mode_val = 0x1, .flags = RK_CLK_PLL_HAVE_GATE, .frac_rates = rk3328_pll_frac_rates, }; @@ -526,6 +528,8 @@ static struct rk_clk_pll_def dpll = { .base_offset = 0x20, .gate_offset = 0x200, .gate_shift = 1, + .mode_reg = 0x80, + .mode_val = 0x8, .flags = RK_CLK_PLL_HAVE_GATE, }; @@ -537,6 +541,8 @@ static struct rk_clk_pll_def cpll = { .parent_cnt = nitems(pll_parents), }, .base_offset = 0x40, + .mode_reg = 0x80, + .mode_val = 0x80, .rates = rk3328_pll_rates, }; @@ -550,6 +556,8 @@ static struct rk_clk_pll_def gpll = { .base_offset = 0x60, .gate_offset = 0x200, .gate_shift = 2, + .mode_reg = 0x80, + .mode_val = 0x800, .flags = RK_CLK_PLL_HAVE_GATE, .frac_rates = rk3328_pll_frac_rates, }; @@ -564,6 +572,8 @@ static struct rk_clk_pll_def npll = { .base_offset = 0xa0, .gate_offset = 0x200, .gate_shift = 12, + .mode_reg = 0x80, + .mode_val = 0x2, .flags = RK_CLK_PLL_HAVE_GATE, .rates = rk3328_pll_rates, }; Modified: head/sys/arm64/rockchip/clk/rk_clk_pll.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk_clk_pll.c Thu Jun 14 05:41:16 2018 (r335107) +++ head/sys/arm64/rockchip/clk/rk_clk_pll.c Thu Jun 14 05:43:45 2018 (r335108) @@ -47,6 +47,9 @@ struct rk_clk_pll_sc { uint32_t gate_offset; uint32_t gate_shift; + uint32_t mode_reg; + uint32_t mode_val; + uint32_t flags; struct rk_clk_pll_rate *rates; @@ -221,6 +224,11 @@ rk_clk_pll_set_freq(struct clknode *clk, uint64_t fpar reg |= rates->frac << RK_CLK_PLL_FRAC_SHIFT; WRITE4(clk, sc->base_offset + 0x8, reg); + /* Setting to normal mode */ + READ4(clk, sc->mode_reg, ®); + reg |= sc->mode_val << 16 | sc->mode_val; + WRITE4(clk, sc->mode_reg, reg); + /* Reading lock */ for (timeout = 1000; timeout; timeout--) { READ4(clk, sc->base_offset + 0x4, ®); @@ -263,6 +271,8 @@ rk_clk_pll_register(struct clkdom *clkdom, struct rk_c sc->base_offset = clkdef->base_offset; sc->gate_offset = clkdef->gate_offset; sc->gate_shift = clkdef->gate_shift; + sc->mode_reg = clkdef->mode_reg; + sc->mode_val = clkdef->mode_val; sc->flags = clkdef->flags; sc->rates = clkdef->rates; sc->frac_rates = clkdef->frac_rates; Modified: head/sys/arm64/rockchip/clk/rk_clk_pll.h ============================================================================== --- head/sys/arm64/rockchip/clk/rk_clk_pll.h Thu Jun 14 05:41:16 2018 (r335107) +++ head/sys/arm64/rockchip/clk/rk_clk_pll.h Thu Jun 14 05:43:45 2018 (r335108) @@ -50,6 +50,9 @@ struct rk_clk_pll_def { uint32_t gate_offset; uint32_t gate_shift; + uint32_t mode_reg; + uint32_t mode_val; + uint32_t flags; struct rk_clk_pll_rate *rates; From owner-svn-src-head@freebsd.org Thu Jun 14 05:46:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88F041001D3E; Thu, 14 Jun 2018 05:46:58 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 39A2674790; Thu, 14 Jun 2018 05:46:58 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B95E24405; Thu, 14 Jun 2018 05:46:58 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5E5kvfY036711; Thu, 14 Jun 2018 05:46:57 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5E5kvDY036710; Thu, 14 Jun 2018 05:46:57 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201806140546.w5E5kvDY036710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 14 Jun 2018 05:46:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335109 - head/sys/arm64/rockchip/clk X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip/clk X-SVN-Commit-Revision: 335109 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 05:46:58 -0000 Author: manu Date: Thu Jun 14 05:46:57 2018 New Revision: 335109 URL: https://svnweb.freebsd.org/changeset/base/335109 Log: rk_armclk: Add the write mask to the register mux value This was omitted in r334112 and r334996 which cause the PLL to not correctly reparent, leaving the armclk to be derived from the APLL instead of the NPLL. The arm core clock is now correctly set to 600Mhz via the assigned-clock present in the DTB. Modified: head/sys/arm64/rockchip/clk/rk_clk_armclk.c Modified: head/sys/arm64/rockchip/clk/rk_clk_armclk.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk_clk_armclk.c Thu Jun 14 05:43:45 2018 (r335108) +++ head/sys/arm64/rockchip/clk/rk_clk_armclk.c Thu Jun 14 05:46:57 2018 (r335109) @@ -105,7 +105,7 @@ rk_clk_armclk_set_mux(struct clknode *clk, int index) DEVICE_LOCK(clk); READ4(clk, sc->muxdiv_offset, &val); val &= ~(sc->mux_mask >> sc->mux_shift); - val |= index << sc->mux_shift; + val |= index << sc->mux_shift | RK_ARMCLK_WRITE_MASK; WRITE4(clk, sc->muxdiv_offset, val); DEVICE_UNLOCK(clk); From owner-svn-src-head@freebsd.org Thu Jun 14 05:47:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD8EC1001EAE for ; Thu, 14 Jun 2018 05:47:45 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x242.google.com (mail-it0-x242.google.com [IPv6:2607:f8b0:4001:c0b::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49C82748FF for ; Thu, 14 Jun 2018 05:47:45 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x242.google.com with SMTP id k17-v6so1449402ita.0 for ; Wed, 13 Jun 2018 22:47:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=6gs+hphMLBQqKan7uhiwZwb0WFrZCAYrD6jdEFWpkYw=; b=bWXe+M/wCCTxOHXmG/Y57PfhfTlCur4wj/exTcC/6geCJzhdz77E4dFGKozgOAB4k6 lSVQvxIzMKwjDVlcKg8nryanr7xtXsWEeknZdb8Rbhcxv5MGPXz0cELDkYTC8w74UhPU +O4ArtM55pK+RnMM0UomOXNE1R9bjKcQhN+wWCR00qyKayjahkgVnst9YqNDxKhh2+v/ 3jGvzO8ytTlsjcX34Psr4e4jBmwjEmqeZO5BGN/ivyxxP7MBZKUiOTyJd1QJ81Hsol3Y 8drHThLoyQyA7lZxRXEB+PavdUj4wdqQ0cc5WYy9lUpASK9hXYHAZAvwulksTcAlsAnY CMtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=6gs+hphMLBQqKan7uhiwZwb0WFrZCAYrD6jdEFWpkYw=; b=HeJETphhdm8pLQQ2lnH7rGhRYKLxL7+1cGnnOrZ2wbgpIypfeSziMy5r+pAUoP5gwx 12XncsWMr6Wo1h2XdDjeCzRMAKycvR9Op5z0qTZ2ZPtiRe8xN+ha5VmTmN6K3FhHOp6a wE3c+2LN6qio61XA4sOacgLyKS12Qc/x9fMiaxCb14DXD4PiQ71nJPWqOvLfZ/8pSiFo siodr0dO+B1BenF/CNInlNSEu3XytRYFGs8r/Mo3BU3m5Z7i06VbNVyu6I1m97ncaqkW YSowQkQAP3C6EgptzUTVBPTWAh+AwHlaRCOy81hMNJZ8yF+qq5x8iWjExiNndrHK6Ti4 /kNQ== X-Gm-Message-State: APt69E0MYww9FQXH2zf77a/GcarNHYtBukoqwLvJFMlbuyVhvXwI7uwq Nq9rMuCrO33RiWnmoS/aTdDVW+eHy2TSvQ6XcmeqCg== X-Google-Smtp-Source: ADUXVKJ9YwbzACgYYD/YedepiY0C8BPPG24AQnbRkkPPhMpJbt92Cai5LkS9yOIRWwcG6RsJYfhK/2jhbQ+qUlNHU8k= X-Received: by 2002:a02:6348:: with SMTP id j69-v6mr419815jac.45.1528955264630; Wed, 13 Jun 2018 22:47:44 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:d028:0:0:0:0:0 with HTTP; Wed, 13 Jun 2018 22:47:44 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: References: <201806140535.w5E5ZBmf043114@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Wed, 13 Jun 2018 23:47:44 -0600 X-Google-Sender-Auth: fr0AnXxUP-BYIE9PzlO1j14DAl0 Message-ID: Subject: Re: svn commit: r335091 - head/sbin/nvmecontrol To: Juli Mallett Cc: "Rodney W. Grimes" , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 05:47:46 -0000 So I found this https://www.copyright.gov/circs/circ03.pdf and it states two things: "A notice consists of three elements that generally appear as a single continuous statement: =E2=80=A2 The copyright symbol =C2=A9 (or for phonore= cords, the symbol =E2=84=97 ); the word =E2=80=9Ccopyright=E2=80=9D; or the abbreviati= on =E2=80=9Ccopr.=E2=80=9D; =E2=80=A2 The year of first publication of the work; and =E2=80=A2 The name of the copyright o= wner." But this only required for works published before March 1, 1989. It later states: "Copyright notice is optional for unpublished works, foreign works, or works published on or after March 1, 1989. When notice is optional, copyright owners can use any form of notice they wish." The project wishes date ranges. :) But since we're not lawyers... Warner On Wed, Jun 13, 2018 at 11:37 PM, Juli Mallett wrote: > > > On 13 June 2018 at 22:35, Rodney W. Grimes > wrote: > >> > On 13 June 2018 at 20:28, Rodney W. Grimes < >> freebsd@pdx.rh.cn85.dnsmgr.net> >> > wrote: >> > >> > > > On Wed, Jun 13, 2018 at 9:03 PM, Rodney W. Grimes < >> ... >> > > > > > @@ -1,7 +1,8 @@ >> > > > > > /*- >> > > > > > - * Copyright (c) 2017 Netflix, Inc >> > > > > > - * All rights reserved. >> > > > > > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD >> > > > > > * >> > > > > > + * Copyright (C) 2018 Netflix >> > > > > >> > > > > You moved a copyright forward, that is not proper to do. >> > > > > >> > > > >> > > > Thought it was. I honestly don't care where (nor does my employer)= , >> so if >> > > > you want to tweak it to be more conforming, be my guest. >> > > >> > > You can add a new date to the end of a list, but you should always >> > > retain the oldest date, and many opinions are that all dates should >> > > be retained unless they are continuous. >> > > >> > >> > Do you have a citation for this, Rod? I ask because my impression was >> that >> > although it has often been done, and at one point may legitimately hav= e >> > been required, it is not any longer so. I'd love to have a concrete >> source >> > on this, though. >> >> One place to start is circ15: >> https://www.copyright.gov/circs/circ15a.pdf >> >> Fundemental principle of copyright protections duration are from -first- >> date of publication, that is covered in USC 17. If you miss represent >> that date in your copyright your copyright can be held invalid. >> The real smoking gun is: >> 17 USC 401 b (2): >> the year of first publication of the work; in the >> case of compilations or derivative works incorporating >> previously published material, the year date of first >> publication of the compilation or derivative work is >> sufficient. The year date may be omitted where a pictorial, >> graphic, or sculptural work, with accompanying text matter, >> if any, is reproduced in or on greeting cards, postcards, >> stationery, jewelry, dolls, toys, or any useful articles; and >> >> The interpretation of compilation or derivative does open a grey >> area here in software, and I can see how one might consider a >> patch to create a derived work. >> > > Per your quote: > "the year of first publication of the work; in the > case of compilations or derivative works incorporating > previously published material, the year date of first > publication of the compilation or derivative work is > sufficient." > > It seems to plainly suggest listing one year, not several years, and > certainly not by some convoluted scheme. > > We're not lawyers. I'm not sure this is a useful discussion. I'd love a > citation for the multiple-years scheme you describe, which does not seem = to > be in USC 17. > > > There is case law that putting a date later than first publication >> appears as an attempt to move the duration of your protection >> to be longer than it really should be. >> >> https://www.copyright.gov/comp3/chap2200/ch2200-notice.pdf >> At 2202.2(A) Advantages to Using Notice on Post-Berne Works >> "It identifies the year of first publication, >> which may be used to determine the term of copyright >> protection in the case of an anonymous work, >> a pseudonymous work, or a work made for hire." >> >> Much of our work, and in this case of Netflix and these >> files, they are defanitly works made for hire, so this >> applies and identifying first date of publication is >> important. >> >> There is also: >> At 2203.1 Works First Published Between January 1, 1978 and February 28, >> 1989 >> This Applies to some of our code, as it has First publications >> in these date ranges, boils down to even though Berne says you dont >> have to have a notice, if you first published the work in this time >> frame you had to have a notice then, and you still have to have a >> notice now. >> >> Yes, Disney and others have done fun stuff with copyrights on *movies*, >> but that has other complications doing with re-mixes and all sorts of >> other >> things that make it possible for them to claim it is a new creative >> work, not just a revision of an old work. >> >> I could re research the case law if you really want more. >> >> >> > > It would be much simpler for you to commit: >> > > - * Copyright (C) 2018 Netflix >> > > + * Copyright (C) 2017-2018 Netflix >> > > >> > > Than for me to get approval: bde, phk. >> > > >> > > Thanks. >> > > Rod >> > > >> > > > >> > > > > Not sure about dropping the , Inc either. >> > > > >> > > > >> > > > Doesn't matter. Different Netflix committers do different things >> and I >> > > was >> > > > trying to move towards uniformity. >> > > >> > > Ok >> > > >> > > > Warner >> > > >> > > -- >> > > Rod Grimes >> > > rgrimes@freebsd.org >> > > >> > > >> >> -- >> Rod Grimes >> rgrimes@freebsd.org >> > > From owner-svn-src-head@freebsd.org Thu Jun 14 05:54:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78B92100296A; Thu, 14 Jun 2018 05:54:05 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id A3AC775147; Thu, 14 Jun 2018 05:54:04 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id f1a6438b; Thu, 14 Jun 2018 07:53:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=mail; bh=Y7OphintpxvT IzTfo24M31i7UQI=; b=eiegBCsWnLbqmxjlHkUrxGOdKZVSVpHN2h26DbOq0/OA 0O/uZlXZK7wPUkOUYMaio5OUcbp4oujM7WYOkEVW8c5jBs5xjv24In3reXlejR0W bktRXEWPtZdtpU38wwpnAVTlTQSEJhEG/0X0ZpTS5vUfo4fT5wcQhINNIhuJ8OA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=mail; b=cMlpdU XKOAauZGJ7SuGsVwKBgAqlCw9CsXZDyR4uYq3QqGKxIWsHREFO0EeOjLkZK9IoEP 8Y0KCrXNbWT7h2KpeLaNA3W5hdzECNRI6SujTPBPeG6KgPsw9/yXeI+r/kBbeuZL ZK/SnCRQ3GOKgVLwricc1tEtAhDyLUc3ATPBk= Received: from skull.home.blih.net (ip-9.net-89-3-105.rev.numericable.fr [89.3.105.9]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 9d82e74c TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Thu, 14 Jun 2018 07:53:55 +0200 (CEST) Date: Thu, 14 Jun 2018 07:53:55 +0200 From: Emmanuel Vadot To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335108 - head/sys/arm64/rockchip/clk Message-Id: <20180614075355.39845fb56979c7226692c3f9@bidouilliste.com> In-Reply-To: <201806140543.w5E5hjS8036518@repo.freebsd.org> References: <201806140543.w5E5hjS8036518@repo.freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 05:54:05 -0000 On Thu, 14 Jun 2018 05:43:45 +0000 (UTC) Emmanuel Vadot wrote: > Author: manu > Date: Thu Jun 14 05:43:45 2018 > New Revision: 335108 > URL: https://svnweb.freebsd.org/changeset/base/335108 > > Log: > rk_pll: Add support for mode > > RockChip PLL have two modes controlled by a register, a "slow mode" (the > default one) where the frequency is derived from the 24Mhz oscillator on the > board, and a "normal" one when the pll take it's input from the real PLL output. > > Default the mode to normal for all the PLLs. > Thanks to jmcneill@ for the tip by the way. -- Emmanuel Vadot From owner-svn-src-head@freebsd.org Thu Jun 14 05:59:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 106D81002FFC for ; Thu, 14 Jun 2018 05:59:49 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-yb0-x230.google.com (mail-yb0-x230.google.com [IPv6:2607:f8b0:4002:c09::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9CA2C754A8 for ; Thu, 14 Jun 2018 05:59:48 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-yb0-x230.google.com with SMTP id w74-v6so1807992ybe.11 for ; Wed, 13 Jun 2018 22:59:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=f7ocAOw+SgkmpJUFBEj+IGpdIxqCSRUqP2xlJYIEo8Y=; b=DEvQEf8/suKWic0jp//r+fv6VZnSbledBSszxSxzzwDlXdG+JGb3paRWWrhzaZbbL6 +FQcYbARXAy3g+JfJuypGQ+HWclqUMl7rcEAyyP4c1zVQ6UuXIXE2S5wwW7hjrV3Ni9M 3RVX5iWgCdYHPE8Kn+6pN/j68DsS7KB+tpv07XgivTXPyFmTOccmKQEFlM0uAssizmOA 8rKu3F4gcB1XuAsAWcRpwCyahgEFD66rwfVr6OVs38ld7gsejh97ESLXDTTL5WW6S2Tc 0Oyl4kttm7WnP/UEUUvL7+X3TEWfAiLY8JQIrI9qKecpNxBUgPy3a1obw9MB3bnDmBfE fG6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=f7ocAOw+SgkmpJUFBEj+IGpdIxqCSRUqP2xlJYIEo8Y=; b=iquzufpmZmqh7sRxJi1tasWxgS/wDizBln+JYgGmPR+BUbk1So/WCUVmP4tl3b5vqS w7b8Ijb+CAqSVEa/QgBT/36FPesJl9i0LHEue9SeqmovpTGVkBROhUqqbszv/kcb5WyY KywezO13We57/UaCyivdqHoPKEavojDlRRKKHYvT0TWEwfwwSgDB987QsSVKddZ/p5ax geaREP4zXb34nEVfQum7F5DwcYNjE3Jh4RdiGhN/PgHJzzKKm9+fr96BYbARHE12nWCm sAOr5t0+mjme1pgFusruBMCx2uMVzYP9wgtkvhDQ06A6e+iJ649x9a1UcKg+QZTpZUt3 Gr+g== X-Gm-Message-State: APt69E22Mz2n8exaXm0dirc0NesJxRQuNaXQT7yVDxdGRZxA0nbfNAFd +aTYirTma9oy8Z2Xsa0jx9fXgOhCN4ZC+wO4kDp3/w== X-Google-Smtp-Source: ADUXVKJEynR1QJGkxBEph/0V7VMEXtS8IO45TrT/Zdfxfcdp3zrT/T+2Cmh/8FwyW+UiCzydSMnetVY4rRrRsP0wn/M= X-Received: by 2002:a25:bc06:: with SMTP id i6-v6mr603798ybh.348.1528955987926; Wed, 13 Jun 2018 22:59:47 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:db86:0:0:0:0:0 with HTTP; Wed, 13 Jun 2018 22:59:47 -0700 (PDT) In-Reply-To: <201806140030.w5E0UTIi042096@pdx.rh.CN85.dnsmgr.net> References: <201806131755.w5DHtAwo073314@repo.freebsd.org> <201806140030.w5E0UTIi042096@pdx.rh.CN85.dnsmgr.net> From: Oliver Pinter Date: Thu, 14 Jun 2018 07:59:47 +0200 Message-ID: Subject: Re: svn commit: r335072 - head/sys/amd64/amd64 To: "rgrimes@freebsd.org" Cc: Konstantin Belousov , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 05:59:49 -0000 On Thursday, June 14, 2018, Rodney W. Grimes wrote: > > Author: kib > > Date: Wed Jun 13 17:55:09 2018 > > New Revision: 335072 > > URL: https://svnweb.freebsd.org/changeset/base/335072 > > > > Log: > > Enable eager FPU context switch by default on amd64. > > > > With compilers making increasing use of vector instructions the > > performance benefit of lazily switching FPU state is no longer a > > desirable tradeoff. Linux switched to eager FPU context switch some > > time ago, and the idea was floated on the FreeBSD-current mailing list > > some years ago[1]. > > > > Enable eager FPU context switch by default on amd64, with a > tunable/sysctl > > available to turn it back off. > > > > [1] https://lists.freebsd.org/pipermail/freebsd-current/ > 2015-March/055198.html > > > > Reviewed by: jhb > > Tested by: pho > > Sponsored by: The FreeBSD Foundation > > MFC: ? Already done. > > ... > > -- > Rod Grimes > rgrimes@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-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Thu Jun 14 06:03:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E4CF10035B6; Thu, 14 Jun 2018 06:03:09 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63026759B3; Thu, 14 Jun 2018 06:03:08 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w5E634jD043237; Wed, 13 Jun 2018 23:03:04 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w5E634gG043236; Wed, 13 Jun 2018 23:03:04 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806140603.w5E634gG043236@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r335091 - head/sbin/nvmecontrol In-Reply-To: To: Warner Losh Date: Wed, 13 Jun 2018 23:03:04 -0700 (PDT) CC: Juli Mallett , "Rodney W. Grimes" , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 06:03:09 -0000 > So I found this > > https://www.copyright.gov/circs/circ03.pdf > > and it states two things: > > "A notice consists of three elements that generally appear as a single > continuous statement: ? The copyright symbol ? (or for phonorecords, the > symbol ? ); the word ?copyright?; or the abbreviation ?copr.?; ? The year > of first publication of the work; and ? The name of the copyright owner." > > But this only required for works published before March 1, 1989. It later > states: > > "Copyright notice is optional for unpublished works, foreign works, or > works published on or after March 1, 1989. When notice is optional, > copyright owners can use any form of notice they wish." > > The project wishes date ranges. :) > > But since we're not lawyers... https://www.copyright.gov/comp3/chap2200/ch2200-notice.pdf 2205.1(A) Year of Publication .. .. The year of first publication followed by multiple year dates ( e.g. , 1981, 1982, 1983) .. Though I have seen it commonly used in practive date-date, I have not actally seen that in any of the actual Copyright office publications, nor have I ever seen any case law that makes it bad to do. I am fine with date ranges, I have fine with lists, I am not fine with altering that "first publication date". I am also a bit concerned on the treating each commit as a "derived" work. > > Warner > > On Wed, Jun 13, 2018 at 11:37 PM, Juli Mallett wrote: > > > > > > > On 13 June 2018 at 22:35, Rodney W. Grimes > > wrote: > > > >> > On 13 June 2018 at 20:28, Rodney W. Grimes < > >> freebsd@pdx.rh.cn85.dnsmgr.net> > >> > wrote: > >> > > >> > > > On Wed, Jun 13, 2018 at 9:03 PM, Rodney W. Grimes < > >> ... > >> > > > > > @@ -1,7 +1,8 @@ > >> > > > > > /*- > >> > > > > > - * Copyright (c) 2017 Netflix, Inc > >> > > > > > - * All rights reserved. > >> > > > > > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > >> > > > > > * > >> > > > > > + * Copyright (C) 2018 Netflix > >> > > > > > >> > > > > You moved a copyright forward, that is not proper to do. > >> > > > > > >> > > > > >> > > > Thought it was. I honestly don't care where (nor does my employer), > >> so if > >> > > > you want to tweak it to be more conforming, be my guest. > >> > > > >> > > You can add a new date to the end of a list, but you should always > >> > > retain the oldest date, and many opinions are that all dates should > >> > > be retained unless they are continuous. > >> > > > >> > > >> > Do you have a citation for this, Rod? I ask because my impression was > >> that > >> > although it has often been done, and at one point may legitimately have > >> > been required, it is not any longer so. I'd love to have a concrete > >> source > >> > on this, though. > >> > >> One place to start is circ15: > >> https://www.copyright.gov/circs/circ15a.pdf > >> > >> Fundemental principle of copyright protections duration are from -first- > >> date of publication, that is covered in USC 17. If you miss represent > >> that date in your copyright your copyright can be held invalid. > >> The real smoking gun is: > >> 17 USC 401 b (2): > >> the year of first publication of the work; in the > >> case of compilations or derivative works incorporating > >> previously published material, the year date of first > >> publication of the compilation or derivative work is > >> sufficient. The year date may be omitted where a pictorial, > >> graphic, or sculptural work, with accompanying text matter, > >> if any, is reproduced in or on greeting cards, postcards, > >> stationery, jewelry, dolls, toys, or any useful articles; and > >> > >> The interpretation of compilation or derivative does open a grey > >> area here in software, and I can see how one might consider a > >> patch to create a derived work. > >> > > > > Per your quote: > > "the year of first publication of the work; in the > > case of compilations or derivative works incorporating > > previously published material, the year date of first > > publication of the compilation or derivative work is > > sufficient." > > > > It seems to plainly suggest listing one year, not several years, and > > certainly not by some convoluted scheme. > > > > We're not lawyers. I'm not sure this is a useful discussion. I'd love a > > citation for the multiple-years scheme you describe, which does not seem to > > be in USC 17. > > > > > > There is case law that putting a date later than first publication > >> appears as an attempt to move the duration of your protection > >> to be longer than it really should be. > >> > >> https://www.copyright.gov/comp3/chap2200/ch2200-notice.pdf > >> At 2202.2(A) Advantages to Using Notice on Post-Berne Works > >> "It identifies the year of first publication, > >> which may be used to determine the term of copyright > >> protection in the case of an anonymous work, > >> a pseudonymous work, or a work made for hire." > >> > >> Much of our work, and in this case of Netflix and these > >> files, they are defanitly works made for hire, so this > >> applies and identifying first date of publication is > >> important. > >> > >> There is also: > >> At 2203.1 Works First Published Between January 1, 1978 and February 28, > >> 1989 > >> This Applies to some of our code, as it has First publications > >> in these date ranges, boils down to even though Berne says you dont > >> have to have a notice, if you first published the work in this time > >> frame you had to have a notice then, and you still have to have a > >> notice now. > >> > >> Yes, Disney and others have done fun stuff with copyrights on *movies*, > >> but that has other complications doing with re-mixes and all sorts of > >> other > >> things that make it possible for them to claim it is a new creative > >> work, not just a revision of an old work. > >> > >> I could re research the case law if you really want more. > >> > >> > >> > > It would be much simpler for you to commit: > >> > > - * Copyright (C) 2018 Netflix > >> > > + * Copyright (C) 2017-2018 Netflix > >> > > > >> > > Than for me to get approval: bde, phk. > >> > > > >> > > Thanks. > >> > > Rod > >> > > > >> > > > > >> > > > > Not sure about dropping the , Inc either. > >> > > > > >> > > > > >> > > > Doesn't matter. Different Netflix committers do different things > >> and I > >> > > was > >> > > > trying to move towards uniformity. > >> > > > >> > > Ok > >> > > > >> > > > Warner > >> > > > >> > > -- > >> > > Rod Grimes > >> > > rgrimes@freebsd.org > >> > > > >> > > > >> > >> -- > >> Rod Grimes > >> rgrimes@freebsd.org > >> > > > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Jun 14 06:14:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7344100458C; Thu, 14 Jun 2018 06:14:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 909E1762BC; Thu, 14 Jun 2018 06:14:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 70CFA24943; Thu, 14 Jun 2018 06:14:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5E6En4G052354; Thu, 14 Jun 2018 06:14:49 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5E6EnYQ052352; Thu, 14 Jun 2018 06:14:49 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806140614.w5E6EnYQ052352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 14 Jun 2018 06:14:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335110 - head/stand X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand X-SVN-Commit-Revision: 335110 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 06:14:50 -0000 Author: imp Date: Thu Jun 14 06:14:48 2018 New Revision: 335110 URL: https://svnweb.freebsd.org/changeset/base/335110 Log: Remove redundant defs.mk includes. They aren't needed. Modified: head/stand/ficl.mk head/stand/loader.mk Modified: head/stand/ficl.mk ============================================================================== --- head/stand/ficl.mk Thu Jun 14 05:46:57 2018 (r335109) +++ head/stand/ficl.mk Thu Jun 14 06:14:48 2018 (r335110) @@ -2,8 +2,6 @@ # Common flags to build FICL related files -.include "defs.mk" - .if ${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 1 FICL_CPUARCH= i386 .elif ${MACHINE_ARCH:Mmips64*} != "" Modified: head/stand/loader.mk ============================================================================== --- head/stand/loader.mk Thu Jun 14 05:46:57 2018 (r335109) +++ head/stand/loader.mk Thu Jun 14 06:14:48 2018 (r335110) @@ -1,7 +1,5 @@ # $FreeBSD$ -.include "defs.mk" - .PATH: ${LDRSRC} ${BOOTSRC}/libsa CFLAGS+=-I${LDRSRC} From owner-svn-src-head@freebsd.org Thu Jun 14 06:28:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAFEF1005744; Thu, 14 Jun 2018 06:28:10 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8F89D76CDC; Thu, 14 Jun 2018 06:28:10 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 70F6A24B26; Thu, 14 Jun 2018 06:28:10 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5E6SAEE057850; Thu, 14 Jun 2018 06:28:10 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5E6S9Da057847; Thu, 14 Jun 2018 06:28:09 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201806140628.w5E6S9Da057847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 14 Jun 2018 06:28:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335112 - in head/sys: arm64/conf arm64/rockchip conf X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: arm64/conf arm64/rockchip conf X-SVN-Commit-Revision: 335112 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 06:28:11 -0000 Author: manu Date: Thu Jun 14 06:28:09 2018 New Revision: 335112 URL: https://svnweb.freebsd.org/changeset/base/335112 Log: if_dwc_rk: Add DesignWare driver for RockChip SoCs. Add driver for the designware ethernet controller found in some RockChip SoCs. The driver still rely on a lot of things setup by the bootloader like clocks and phy mode. But since netbooting is the only/easiest way to boot rockchip board at the moment add the driver so other people can test/dev on thoses boards. Added: head/sys/arm64/rockchip/if_dwc_rk.c (contents, props changed) Modified: head/sys/arm64/conf/GENERIC head/sys/conf/files.arm64 Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Thu Jun 14 06:24:29 2018 (r335111) +++ head/sys/arm64/conf/GENERIC Thu Jun 14 06:28:09 2018 (r335112) @@ -146,6 +146,7 @@ device neta # Marvell Armada 370/38x/XP/3700 NIC device smc # SMSC LAN91C111 device vnic # Cavium ThunderX NIC device al_eth # Annapurna Alpine Ethernet NIC +device dwc_rk # Rockchip Designware # Block devices device ahci Added: head/sys/arm64/rockchip/if_dwc_rk.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/rockchip/if_dwc_rk.c Thu Jun 14 06:28:09 2018 (r335112) @@ -0,0 +1,151 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Emmanuel Vadot + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include +#include + +#include + +#include "syscon_if.h" + +#include "if_dwc_if.h" + +#define RK3328_GRF_MAC_CON0 0x0900 +#define RK3328_GRF_MAC_CON0_TX_MASK 0x7F +#define RK3328_GRF_MAC_CON0_TX_SHIFT 0 +#define RK3328_GRF_MAC_CON0_RX_MASK 0x7F +#define RK3328_GRF_MAC_CON0_RX_SHIFT 7 + +#define RK3328_GRF_MAC_CON1 0x0904 +#define RK3328_GRF_MAC_CON2 0x0908 +#define RK3328_GRF_MACPHY_CON0 0x0B00 +#define RK3328_GRF_MACPHY_CON1 0x0B04 +#define RK3328_GRF_MACPHY_CON2 0x0B08 +#define RK3328_GRF_MACPHY_CON3 0x0B0C +#define RK3328_GRF_MACPHY_STATUS 0x0B10 + +static void +rk3328_set_delays(struct syscon *grf, phandle_t node) +{ + uint32_t tx, rx; + + if (OF_getencprop(node, "tx-delay", &tx, sizeof(tx)) >= 0) + tx = 0x30; + if (OF_getencprop(node, "rx-delay", &rx, sizeof(rx)) >= 0) + rx = 0x10; + + tx = ((tx & RK3328_GRF_MAC_CON0_TX_MASK) << + RK3328_GRF_MAC_CON0_TX_SHIFT); + rx = ((rx & RK3328_GRF_MAC_CON0_TX_MASK) << + RK3328_GRF_MAC_CON0_RX_SHIFT); + SYSCON_WRITE_4(grf, RK3328_GRF_MAC_CON0, tx | rx); +} + +static int +if_dwc_rk_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "rockchip,rk3328-gmac")) + return (ENXIO); + device_set_desc(dev, "Rockchip Gigabit Ethernet Controller"); + + return (BUS_PROBE_DEFAULT); +} + +static int +if_dwc_rk_init(device_t dev) +{ + phandle_t node; + struct syscon *grf = NULL; + + node = ofw_bus_get_node(dev); + if (OF_hasprop(node, "rockchip,grf") && + syscon_get_by_ofw_property(dev, node, + "rockchip,grf", &grf) != 0) { + device_printf(dev, "cannot get grf driver handle\n"); + return (ENXIO); + } + + rk3328_set_delays(grf, node); + + /* Mode should be set according to dtb property */ + + return (0); +} + +static int +if_dwc_rk_mac_type(device_t dev) +{ + + return (DWC_GMAC_ALT_DESC); +} + +static int +if_dwc_rk_mii_clk(device_t dev) +{ + + /* Should be calculated from the clock */ + return (GMAC_MII_CLK_150_250M_DIV102); +} + +static device_method_t if_dwc_rk_methods[] = { + DEVMETHOD(device_probe, if_dwc_rk_probe), + + DEVMETHOD(if_dwc_init, if_dwc_rk_init), + DEVMETHOD(if_dwc_mac_type, if_dwc_rk_mac_type), + DEVMETHOD(if_dwc_mii_clk, if_dwc_rk_mii_clk), + + DEVMETHOD_END +}; + +static devclass_t dwc_rk_devclass; + +extern driver_t dwc_driver; + +DEFINE_CLASS_1(dwc, dwc_rk_driver, if_dwc_rk_methods, + sizeof(struct dwc_softc), dwc_driver); +DRIVER_MODULE(dwc_rk, simplebus, dwc_rk_driver, dwc_rk_devclass, 0, 0); +MODULE_DEPEND(dwc_rk, dwc, 1, 1, 1); Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Thu Jun 14 06:24:29 2018 (r335111) +++ head/sys/conf/files.arm64 Thu Jun 14 06:28:09 2018 (r335112) @@ -256,3 +256,6 @@ arm64/rockchip/clk/rk_clk_gate.c optional fdt soc_rock arm64/rockchip/clk/rk_clk_mux.c optional fdt soc_rockchip_rk3328 arm64/rockchip/clk/rk_clk_pll.c optional fdt soc_rockchip_rk3328 arm64/rockchip/clk/rk3328_cru.c optional fdt soc_rockchip_rk3328 +arm64/rockchip/if_dwc_rk.c optional dwc_rk fdt soc_rockchip_rk3328 +dev/dwc/if_dwc.c optional dwc_rk +dev/dwc/if_dwc_if.m optional dwc_rk From owner-svn-src-head@freebsd.org Thu Jun 14 06:34:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9AEE1006342; Thu, 14 Jun 2018 06:34:28 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3C0FF772EE; Thu, 14 Jun 2018 06:34:28 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D1D724CD3; Thu, 14 Jun 2018 06:34:28 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5E6YRFD062760; Thu, 14 Jun 2018 06:34:27 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5E6YRnj062759; Thu, 14 Jun 2018 06:34:27 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201806140634.w5E6YRnj062759@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 14 Jun 2018 06:34:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335113 - head/sys/arm64/rockchip/clk X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip/clk X-SVN-Commit-Revision: 335113 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 06:34:28 -0000 Author: manu Date: Thu Jun 14 06:34:27 2018 New Revision: 335113 URL: https://svnweb.freebsd.org/changeset/base/335113 Log: rk3328: Add support for the i2c clocks Modified: head/sys/arm64/rockchip/clk/rk3328_cru.c Modified: head/sys/arm64/rockchip/clk/rk3328_cru.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk3328_cru.c Thu Jun 14 06:28:09 2018 (r335112) +++ head/sys/arm64/rockchip/clk/rk3328_cru.c Thu Jun 14 06:34:27 2018 (r335113) @@ -57,6 +57,10 @@ __FBSDID("$FreeBSD$"); #define PCLK_GPIO1 201 #define PCLK_GPIO2 202 #define PCLK_GPIO3 203 +#define PCLK_I2C0 205 +#define PCLK_I2C1 206 +#define PCLK_I2C2 207 +#define PCLK_I2C3 208 #define HCLK_SDMMC 317 #define HCLK_SDIO 318 #define HCLK_EMMC 319 @@ -80,7 +84,13 @@ static struct rk_cru_gate rk3328_gates[] = { /* CRU_CLKGATE_CON10 */ CRU_GATE(ACLK_PERI, "aclk_peri", "aclk_peri_pre", 0x228, 0) + /* CRU_CLKGATE_CON15*/ + CRU_GATE(PCLK_I2C0, "pclk_i2c0", "pclk_bus", 0x23C, 10) + /* CRU_CLKGATE_CON16 */ + CRU_GATE(PCLK_I2C1, "pclk_i2c1", "pclk_bus", 0x23C, 0) + CRU_GATE(PCLK_I2C2, "pclk_i2c2", "pclk_bus", 0x23C, 1) + CRU_GATE(PCLK_I2C3, "pclk_i2c3", "pclk_bus", 0x23C, 2) CRU_GATE(PCLK_GPIO0, "pclk_gpio0", "pclk_bus", 0x240, 7) CRU_GATE(PCLK_GPIO1, "pclk_gpio1", "pclk_bus", 0x240, 8) CRU_GATE(PCLK_GPIO2, "pclk_gpio2", "pclk_bus", 0x240, 9) @@ -863,6 +873,104 @@ static struct rk_clk_composite_def emmc = { .flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE, }; +/* CRU_CLKSEL_CON34 */ +#define SCLK_I2C0 55 +#define SCLK_I2C1 56 + +static const char *i2c_parents[] = {"cpll", "gpll"}; + +static struct rk_clk_composite_def i2c0 = { + .clkdef = { + .id = SCLK_I2C0, + .name = "clk_i2c0", + .parent_names = i2c_parents, + .parent_cnt = nitems(i2c_parents), + }, + .muxdiv_offset = 0x188, + + .mux_shift = 7, + .mux_width = 1, + + .div_shift = 0, + .div_width = 6, + + /* CRU_CLKGATE_CON2 */ + .gate_offset = 0x208, + .gate_shift = 9, + + .flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE, +}; + +static struct rk_clk_composite_def i2c1 = { + .clkdef = { + .id = SCLK_I2C1, + .name = "clk_i2c1", + .parent_names = i2c_parents, + .parent_cnt = nitems(i2c_parents), + }, + .muxdiv_offset = 0x188, + + .mux_shift = 15, + .mux_width = 1, + + .div_shift = 8, + .div_width = 6, + + /* CRU_CLKGATE_CON2 */ + .gate_offset = 0x208, + .gate_shift = 10, + + .flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE, +}; + +/* CRU_CLKSEL_CON35 */ +#define SCLK_I2C2 57 +#define SCLK_I2C3 58 + +static struct rk_clk_composite_def i2c2 = { + .clkdef = { + .id = SCLK_I2C2, + .name = "clk_i2c2", + .parent_names = i2c_parents, + .parent_cnt = nitems(i2c_parents), + }, + .muxdiv_offset = 0x18C, + + .mux_shift = 7, + .mux_width = 1, + + .div_shift = 0, + .div_width = 6, + + /* CRU_CLKGATE_CON2 */ + .gate_offset = 0x208, + .gate_shift = 11, + + .flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE, +}; + +static struct rk_clk_composite_def i2c3 = { + .clkdef = { + .id = SCLK_I2C3, + .name = "clk_i2c3", + .parent_names = i2c_parents, + .parent_cnt = nitems(i2c_parents), + }, + .muxdiv_offset = 0x18C, + + .mux_shift = 15, + .mux_width = 1, + + .div_shift = 8, + .div_width = 6, + + /* CRU_CLKGATE_CON2 */ + .gate_offset = 0x208, + .gate_shift = 12, + + .flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE, +}; + static struct rk_clk rk3328_clks[] = { { .type = RK_CLK_PLL, @@ -926,6 +1034,23 @@ static struct rk_clk rk3328_clks[] = { { .type = RK_CLK_COMPOSITE, .clk.composite = &emmc + }, + + { + .type = RK_CLK_COMPOSITE, + .clk.composite = &i2c0 + }, + { + .type = RK_CLK_COMPOSITE, + .clk.composite = &i2c1 + }, + { + .type = RK_CLK_COMPOSITE, + .clk.composite = &i2c2 + }, + { + .type = RK_CLK_COMPOSITE, + .clk.composite = &i2c3 }, }; From owner-svn-src-head@freebsd.org Thu Jun 14 06:39:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95A0F1006A3F; Thu, 14 Jun 2018 06:39:34 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 39995775F9; Thu, 14 Jun 2018 06:39:34 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1889C24CE9; Thu, 14 Jun 2018 06:39:34 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5E6dYTf063002; Thu, 14 Jun 2018 06:39:34 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5E6dX5O063000; Thu, 14 Jun 2018 06:39:33 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201806140639.w5E6dX5O063000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 14 Jun 2018 06:39:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335114 - in head/sys: arm64/rockchip conf X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: arm64/rockchip conf X-SVN-Commit-Revision: 335114 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 06:39:35 -0000 Author: manu Date: Thu Jun 14 06:39:33 2018 New Revision: 335114 URL: https://svnweb.freebsd.org/changeset/base/335114 Log: rk_i2c: Add driver for the I2C controller present in RockChip SoC This controller have a special mode for RX to help with smbus-like transfer when the controller will automatically send the slave address, register address and read the data. Use it when possible. The same mode for TX is describe is the datasheet but is broken and have been since ~10 years of presence of this controller in RockChip SoCs. Attach this driver early at we need it to communicate with the PMIC early in the boot. Do not hook it to the kernel build for now. Added: head/sys/arm64/rockchip/rk_i2c.c (contents, props changed) Modified: head/sys/conf/files.arm64 Added: head/sys/arm64/rockchip/rk_i2c.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/rockchip/rk_i2c.c Thu Jun 14 06:39:33 2018 (r335114) @@ -0,0 +1,607 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Emmanuel Vadot + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include + +#include "iicbus_if.h" + +#include "opt_soc.h" + + +#define RK_I2C_CON 0x00 +#define RK_I2C_CON_EN (1 << 0) +#define RK_I2C_CON_MODE_SHIFT 1 +#define RK_I2C_CON_MODE_TX 0 +#define RK_I2C_CON_MODE_RRX 1 +#define RK_I2C_CON_MODE_RX 2 +#define RK_I2C_CON_MODE_RTX 3 +#define RK_I2C_CON_MODE_MASK 0x6 +#define RK_I2C_CON_START (1 << 3) +#define RK_I2C_CON_STOP (1 << 4) +#define RK_I2C_CON_LASTACK (1 << 5) +#define RK_I2C_CON_NAKSTOP (1 << 6) + +#define RK_I2C_CLKDIV 0x04 +#define RK_I2C_CLKDIVL_MASK 0xFFFF +#define RK_I2C_CLKDIVL_SHIFT 0 +#define RK_I2C_CLKDIVH_MASK 0xFFFF0000 +#define RK_I2C_CLKDIVH_SHIFT 16 +#define RK_I2C_CLKDIV_MUL 8 + +#define RK_I2C_MRXADDR 0x08 +#define RK_I2C_MRXADDR_SADDR_MASK 0xFFFFFF +#define RK_I2C_MRXADDR_VALID(x) (1 << (24 + x)) + +#define RK_I2C_MRXRADDR 0x0C +#define RK_I2C_MRXRADDR_SRADDR_MASK 0xFFFFFF +#define RK_I2C_MRXRADDR_VALID(x) (1 << (24 + x)) + +#define RK_I2C_MTXCNT 0x10 +#define RK_I2C_MTXCNT_MASK 0x3F + +#define RK_I2C_MRXCNT 0x14 +#define RK_I2C_MRXCNT_MASK 0x3F + +#define RK_I2C_IEN 0x18 +#define RK_I2C_IEN_BTFIEN (1 << 0) +#define RK_I2C_IEN_BRFIEN (1 << 1) +#define RK_I2C_IEN_MBTFIEN (1 << 2) +#define RK_I2C_IEN_MBRFIEN (1 << 3) +#define RK_I2C_IEN_STARTIEN (1 << 4) +#define RK_I2C_IEN_STOPIEN (1 << 5) +#define RK_I2C_IEN_NAKRCVIEN (1 << 6) +#define RK_I2C_IEN_ALL (RK_I2C_IEN_BTFIEN | \ + RK_I2C_IEN_BRFIEN | RK_I2C_IEN_MBTFIEN | RK_I2C_IEN_MBRFIEN | \ + RK_I2C_IEN_STARTIEN | RK_I2C_IEN_STOPIEN | RK_I2C_IEN_NAKRCVIEN) + +#define RK_I2C_IPD 0x1C +#define RK_I2C_IPD_BTFIPD (1 << 0) +#define RK_I2C_IPD_BRFIPD (1 << 1) +#define RK_I2C_IPD_MBTFIPD (1 << 2) +#define RK_I2C_IPD_MBRFIPD (1 << 3) +#define RK_I2C_IPD_STARTIPD (1 << 4) +#define RK_I2C_IPD_STOPIPD (1 << 5) +#define RK_I2C_IPD_NAKRCVIPD (1 << 6) +#define RK_I2C_IPD_ALL (RK_I2C_IPD_BTFIPD | \ + RK_I2C_IPD_BRFIPD | RK_I2C_IPD_MBTFIPD | RK_I2C_IPD_MBRFIPD | \ + RK_I2C_IPD_STARTIPD | RK_I2C_IPD_STOPIPD | RK_I2C_IPD_NAKRCVIPD) + +#define RK_I2C_FNCT 0x20 +#define RK_I2C_FNCT_MASK 0x3F + +#define RK_I2C_TXDATA_BASE 0x100 + +#define RK_I2C_RXDATA_BASE 0x200 + +enum rk_i2c_state { + STATE_IDLE = 0, + STATE_START, + STATE_READ, + STATE_WRITE, + STATE_STOP +}; + +struct rk_i2c_softc { + device_t dev; + struct resource *res[2]; + struct mtx mtx; + clk_t sclk; + clk_t pclk; + int busy; + void * intrhand; + uint32_t intr; + uint32_t ipd; + struct iic_msg *msg; + size_t cnt; + int transfer_done; + int nak_recv; + uint8_t mode; + uint8_t state; + + device_t iicbus; +}; + +static struct ofw_compat_data compat_data[] = { +#ifdef SOC_ROCKCHIP_RK3328 + {"rockchip,rk3328-i2c", 1}, +#endif + {NULL, 0} +}; + +static struct resource_spec rk_i2c_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE | RF_SHAREABLE }, + { -1, 0 } +}; + +static int rk_i2c_probe(device_t dev); +static int rk_i2c_attach(device_t dev); +static int rk_i2c_detach(device_t dev); + +#define RK_I2C_LOCK(sc) mtx_lock(&(sc)->mtx) +#define RK_I2C_UNLOCK(sc) mtx_unlock(&(sc)->mtx) +#define RK_I2C_ASSERT_LOCKED(sc) mtx_assert(&(sc)->mtx, MA_OWNED) +#define RK_I2C_READ(sc, reg) bus_read_4((sc)->res[0], (reg)) +#define RK_I2C_WRITE(sc, reg, val) bus_write_4((sc)->res[0], (reg), (val)) + +static uint32_t +rk_i2c_get_clkdiv(struct rk_i2c_softc *sc, uint64_t speed) +{ + uint64_t pclk_freq; + uint32_t clkdiv; + int err; + + err = clk_get_freq(sc->pclk, &pclk_freq); + if (err != 0) + return (err); + + clkdiv = (pclk_freq / speed / RK_I2C_CLKDIV_MUL / 2) - 1; + clkdiv &= RK_I2C_CLKDIVL_MASK; + + clkdiv = clkdiv << RK_I2C_CLKDIVH_SHIFT | clkdiv; + + return (clkdiv); +} + +static int +rk_i2c_reset(device_t dev, u_char speed, u_char addr, u_char *oldaddr) +{ + struct rk_i2c_softc *sc; + uint32_t clkdiv; + u_int busfreq; + + sc = device_get_softc(dev); + + busfreq = IICBUS_GET_FREQUENCY(sc->iicbus, speed); + + clkdiv = rk_i2c_get_clkdiv(sc, busfreq); + + RK_I2C_LOCK(sc); + + /* Set the clock divider */ + RK_I2C_WRITE(sc, RK_I2C_CLKDIV, clkdiv); + + /* Disable the module */ + RK_I2C_WRITE(sc, RK_I2C_CON, 0); + + RK_I2C_UNLOCK(sc); + + return (0); +} + +static void +rk_i2c_fill_tx(struct rk_i2c_softc *sc) +{ + uint32_t buf32; + uint8_t buf; + int i, j, len; + + if (sc->msg == NULL || sc->msg->len == sc->cnt) + return; + + len = sc->msg->len - sc->cnt; + if (len > 8) + len = 8; + + for (i = 0; i < len; i++) { + buf32 = 0; + for (j = 0; j < 4 ; j++) { + if (sc->cnt == sc->msg->len) + break; + + /* Fill the addr if needed */ + if (sc->cnt == 0) { + buf = sc->msg->slave; + } + else + buf = sc->msg->buf[sc->cnt - 1]; + + buf32 |= buf << (j * 8); + + sc->cnt++; + } + + RK_I2C_WRITE(sc, RK_I2C_TXDATA_BASE + 4 * i, buf32); + + if (sc->cnt == sc->msg->len) + break; + } +} + +static void +rk_i2c_drain_rx(struct rk_i2c_softc *sc) +{ + uint32_t buf32 = 0; + uint8_t buf8; + int len; + int i; + + if (sc->msg == NULL) { + device_printf(sc->dev, "No current iic msg\n"); + return; + } + + len = sc->msg->len - sc->cnt; + if (len > 32) + len = 32; + + for (i = 0; i < len; i++) { + if (i % 4 == 0) + buf32 = RK_I2C_READ(sc, RK_I2C_RXDATA_BASE + (i / 4) * 4); + + buf8 = (buf32 >> ((i % 4) * 8)) & 0xFF; + + sc->msg->buf[sc->cnt++] = buf8; + } +} + +static void +rk_i2c_send_start(struct rk_i2c_softc *sc) +{ + uint32_t reg; + + RK_I2C_WRITE(sc, RK_I2C_IEN, RK_I2C_IEN_STARTIEN); + + sc->state = STATE_START; + + reg = RK_I2C_READ(sc, RK_I2C_CON); + reg |= RK_I2C_CON_START; + reg |= RK_I2C_CON_EN; + reg &= ~RK_I2C_CON_MODE_MASK; + reg |= sc->mode << RK_I2C_CON_MODE_SHIFT; + RK_I2C_WRITE(sc, RK_I2C_CON, reg); +} + +static void +rk_i2c_send_stop(struct rk_i2c_softc *sc) +{ + uint32_t reg; + + RK_I2C_WRITE(sc, RK_I2C_IEN, RK_I2C_IEN_STOPIEN); + + sc->state = STATE_STOP; + + reg = RK_I2C_READ(sc, RK_I2C_CON); + reg |= RK_I2C_CON_STOP; + RK_I2C_WRITE(sc, RK_I2C_CON, reg); +} + +static void +rk_i2c_intr(void *arg) +{ + struct rk_i2c_softc *sc; + uint32_t reg; + + sc = (struct rk_i2c_softc *)arg; + + RK_I2C_LOCK(sc); + + sc->ipd = RK_I2C_READ(sc, RK_I2C_IPD); + RK_I2C_WRITE(sc, RK_I2C_IPD, sc->ipd); + + switch (sc->state) { + case STATE_START: + /* Disable start bit */ + reg = RK_I2C_READ(sc, RK_I2C_CON); + reg &= ~RK_I2C_CON_START; + RK_I2C_WRITE(sc, RK_I2C_CON, reg); + + if (sc->mode == RK_I2C_CON_MODE_RRX || + sc->mode == RK_I2C_CON_MODE_RX) { + sc->state = STATE_READ; + RK_I2C_WRITE(sc, RK_I2C_IEN, RK_I2C_IEN_MBRFIEN | + RK_I2C_IEN_NAKRCVIEN); + + reg = RK_I2C_READ(sc, RK_I2C_CON); + reg |= RK_I2C_CON_LASTACK; + RK_I2C_WRITE(sc, RK_I2C_CON, reg); + + RK_I2C_WRITE(sc, RK_I2C_MRXCNT, sc->msg->len); + } else { + sc->state = STATE_WRITE; + RK_I2C_WRITE(sc, RK_I2C_IEN, RK_I2C_IEN_MBTFIEN | + RK_I2C_IEN_NAKRCVIEN); + + sc->msg->len += 1; + rk_i2c_fill_tx(sc); + RK_I2C_WRITE(sc, RK_I2C_MTXCNT, sc->msg->len); + } + break; + case STATE_READ: + rk_i2c_drain_rx(sc); + + if (sc->cnt == sc->msg->len) + rk_i2c_send_stop(sc); + + break; + case STATE_WRITE: + if (sc->cnt == sc->msg->len) + rk_i2c_send_stop(sc); + + break; + case STATE_STOP: + /* Disable stop bit */ + reg = RK_I2C_READ(sc, RK_I2C_CON); + reg &= ~RK_I2C_CON_STOP; + RK_I2C_WRITE(sc, RK_I2C_CON, reg); + + sc->transfer_done = 1; + sc->state = STATE_IDLE; + break; + case STATE_IDLE: + break; + } + + wakeup(sc); + RK_I2C_UNLOCK(sc); +} + +static int +rk_i2c_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs) +{ + struct rk_i2c_softc *sc; + uint32_t reg; + int i, j, msgskip, err = 0; + + sc = device_get_softc(dev); + + while (sc->busy) + mtx_sleep(sc, &sc->mtx, 0, "i2cbuswait", 0); + + sc->busy = 1; + + err = clk_enable(sc->pclk); + if (err != 0) { + device_printf(dev, "cannot enable pclk clock\n"); + goto out; + } + err = clk_enable(sc->sclk); + if (err != 0) { + device_printf(dev, "cannot enable i2c clock\n"); + goto out; + } + + RK_I2C_LOCK(sc); + + /* Clean stale interrupts */ + RK_I2C_WRITE(sc, RK_I2C_IPD, RK_I2C_IPD_ALL); + + for (i = 0; i < nmsgs; i += msgskip) { + if (nmsgs - i >= 2 && !(msgs[i].flags & IIC_M_RD) && + msgs[i + 1].flags & IIC_M_RD && msgs[i].len <= 4) { + sc->mode = RK_I2C_CON_MODE_RRX; + msgskip = 2; + sc->msg = &msgs[i + 1]; + + /* Write slave address */ + reg = msgs[i].slave | RK_I2C_MRXADDR_VALID(0); + RK_I2C_WRITE(sc, RK_I2C_MRXADDR, reg); + + /* Write slave register address */ + for (j = 0, reg = 0; j < msgs[i].len; j++) { + reg |= (msgs[i].buf[j] & 0xff) << (j * 8); + reg |= RK_I2C_MRXADDR_VALID(j); + } + + RK_I2C_WRITE(sc, RK_I2C_MRXRADDR, reg); + } else { + if (msgs[i].flags & IIC_M_RD) { + sc->mode = RK_I2C_CON_MODE_RX; + msgs[i].slave |= LSB; + } + else { + sc->mode = RK_I2C_CON_MODE_TX; + msgs[i].slave &= ~LSB; + } + msgskip = 1; + sc->msg = &msgs[i]; + } + + sc->transfer_done = 0; + sc->cnt = 0; + sc->state = STATE_IDLE; + rk_i2c_send_start(sc); + + while (err == 0 && sc->transfer_done != 1) { + err = msleep(sc, &sc->mtx, 0, "rk_i2c", 10 * hz); + } + } + + /* Disable the module and interrupts */ + RK_I2C_WRITE(sc, RK_I2C_CON, 0); + RK_I2C_WRITE(sc, RK_I2C_IEN, 0); + + sc->busy = 0; + + RK_I2C_UNLOCK(sc); + + err = clk_disable(sc->pclk); + if (err != 0) { + device_printf(dev, "cannot enable pclk clock\n"); + goto out; + } + err = clk_disable(sc->sclk); + if (err != 0) { + device_printf(dev, "cannot enable i2c clock\n"); + goto out; + } + +out: + return (err); +} + +static int +rk_i2c_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "RockChip I2C"); + return (BUS_PROBE_DEFAULT); +} + +static int +rk_i2c_attach(device_t dev) +{ + struct rk_i2c_softc *sc; + int error; + + sc = device_get_softc(dev); + sc->dev = dev; + + mtx_init(&sc->mtx, device_get_nameunit(dev), "rk_i2c", MTX_DEF); + + if (bus_alloc_resources(dev, rk_i2c_spec, sc->res) != 0) { + device_printf(dev, "cannot allocate resources for device\n"); + error = ENXIO; + goto fail; + } + + if (bus_setup_intr(dev, sc->res[1], + INTR_TYPE_MISC | INTR_MPSAFE, NULL, rk_i2c_intr, sc, + &sc->intrhand)) { + bus_release_resources(dev, rk_i2c_spec, sc->res); + device_printf(dev, "cannot setup interrupt handler\n"); + return (ENXIO); + } + + /* Activate the module clocks. */ + error = clk_get_by_ofw_name(dev, 0, "i2c", &sc->sclk); + if (error != 0) { + device_printf(dev, "cannot get i2c clock\n"); + goto fail; + } + error = clk_get_by_ofw_name(dev, 0, "pclk", &sc->pclk); + if (error != 0) { + device_printf(dev, "cannot get pclk clock\n"); + goto fail; + } + + sc->iicbus = device_add_child(dev, "iicbus", -1); + if (sc->iicbus == NULL) { + device_printf(dev, "cannot add iicbus child device\n"); + error = ENXIO; + goto fail; + } + + bus_generic_attach(dev); + + return (0); + +fail: + if (rk_i2c_detach(dev) != 0) + device_printf(dev, "Failed to detach\n"); + return (error); +} + +static int +rk_i2c_detach(device_t dev) +{ + struct rk_i2c_softc *sc; + int error; + + sc = device_get_softc(dev); + + if ((error = bus_generic_detach(dev)) != 0) + return (error); + + if (sc->iicbus != NULL) + if ((error = device_delete_child(dev, sc->iicbus)) != 0) + return (error); + + if (sc->sclk != NULL) + clk_release(sc->sclk); + if (sc->pclk != NULL) + clk_release(sc->pclk); + + if (sc->intrhand != NULL) + bus_teardown_intr(sc->dev, sc->res[1], sc->intrhand); + + bus_release_resources(dev, rk_i2c_spec, sc->res); + + mtx_destroy(&sc->mtx); + + return (0); +} + +static phandle_t +rk_i2c_get_node(device_t bus, device_t dev) +{ + + return ofw_bus_get_node(bus); +} + +static device_method_t rk_i2c_methods[] = { + DEVMETHOD(device_probe, rk_i2c_probe), + DEVMETHOD(device_attach, rk_i2c_attach), + DEVMETHOD(device_detach, rk_i2c_detach), + + /* OFW methods */ + DEVMETHOD(ofw_bus_get_node, rk_i2c_get_node), + + DEVMETHOD(iicbus_callback, iicbus_null_callback), + DEVMETHOD(iicbus_reset, rk_i2c_reset), + DEVMETHOD(iicbus_transfer, rk_i2c_transfer), + + DEVMETHOD_END +}; + +static driver_t rk_i2c_driver = { + "rk_i2c", + rk_i2c_methods, + sizeof(struct rk_i2c_softc), +}; + +static devclass_t rk_i2c_devclass; + +EARLY_DRIVER_MODULE(rk_i2c, simplebus, rk_i2c_driver, rk_i2c_devclass, 0, 0, + BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE); +EARLY_DRIVER_MODULE(ofw_iicbus, rk_i2c, ofw_iicbus_driver, ofw_iicbus_devclass, + 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE); +MODULE_DEPEND(rk_i2c, iicbus, 1, 1, 1); +MODULE_DEPEND(rk_i2c, ofw_iicbus, 1, 1, 1); +MODULE_VERSION(rk_i2c, 1); Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Thu Jun 14 06:34:27 2018 (r335113) +++ head/sys/conf/files.arm64 Thu Jun 14 06:39:33 2018 (r335114) @@ -246,6 +246,7 @@ cddl/dev/dtrace/aarch64/dtrace_asm.S optional dtrace cddl/dev/dtrace/aarch64/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" cddl/dev/fbt/aarch64/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}" +arm64/rockchip/rk_i2c.c optional rk_i2c fdt soc_rockchip_rk3328 arm64/rockchip/rk_grf.c optional fdt soc_rockchip_rk3328 arm64/rockchip/rk_pinctrl.c optional fdt soc_rockchip_rk3328 arm64/rockchip/rk_gpio.c optional fdt soc_rockchip_rk3328 From owner-svn-src-head@freebsd.org Thu Jun 14 06:41:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B15CC1006C34; Thu, 14 Jun 2018 06:41:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F30C778C8; Thu, 14 Jun 2018 06:41:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4077524D12; Thu, 14 Jun 2018 06:41:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5E6f04n064081; Thu, 14 Jun 2018 06:41:00 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5E6ex7e064074; Thu, 14 Jun 2018 06:40:59 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201806140640.w5E6ex7e064074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 14 Jun 2018 06:40:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335115 - in head/sys/modules: . rockchip rockchip/rk_i2c X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys/modules: . rockchip rockchip/rk_i2c X-SVN-Commit-Revision: 335115 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 06:41:00 -0000 Author: manu Date: Thu Jun 14 06:40:59 2018 New Revision: 335115 URL: https://svnweb.freebsd.org/changeset/base/335115 Log: Add modules/rockchip Build rockchip modules as part of buildkernel. Add the i2c controller module. Added: head/sys/modules/rockchip/ head/sys/modules/rockchip/Makefile (contents, props changed) head/sys/modules/rockchip/rk_i2c/ head/sys/modules/rockchip/rk_i2c/Makefile (contents, props changed) Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Thu Jun 14 06:39:33 2018 (r335114) +++ head/sys/modules/Makefile Thu Jun 14 06:40:59 2018 (r335115) @@ -331,6 +331,7 @@ SUBDIR= \ ${_rdrand_rng} \ re \ rl \ + ${_rockchip} \ rtwn \ rtwn_pci \ rtwn_usb \ @@ -563,6 +564,7 @@ _allwinner= allwinner _armv8crypto= armv8crypto _efirt= efirt _em= em +_rockchip= rockchip .endif .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" Added: head/sys/modules/rockchip/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/rockchip/Makefile Thu Jun 14 06:40:59 2018 (r335115) @@ -0,0 +1,7 @@ +# $FreeBSD$ +# Build modules specific to RockChip. + +SUBDIR = \ + rk_i2c \ + +.include Added: head/sys/modules/rockchip/rk_i2c/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/rockchip/rk_i2c/Makefile Thu Jun 14 06:40:59 2018 (r335115) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/arm64/rockchip + +KMOD= rk_i2c +SRCS= rk_i2c.c + +SRCS+= \ + bus_if.h \ + clknode_if.h \ + device_if.h \ + iicbus_if.h \ + ofw_bus_if.h \ + opt_platform.h \ + +.include From owner-svn-src-head@freebsd.org Thu Jun 14 06:41:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8E201006DF6; Thu, 14 Jun 2018 06:41:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 652E477A43; Thu, 14 Jun 2018 06:41:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4729F24E22; Thu, 14 Jun 2018 06:41:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5E6fNf7064138; Thu, 14 Jun 2018 06:41:23 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5E6fN9O064137; Thu, 14 Jun 2018 06:41:23 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806140641.w5E6fN9O064137@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 14 Jun 2018 06:41:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335116 - head/stand/efi/loader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/loader X-SVN-Commit-Revision: 335116 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 06:41:24 -0000 Author: imp Date: Thu Jun 14 06:41:22 2018 New Revision: 335116 URL: https://svnweb.freebsd.org/changeset/base/335116 Log: Use bool for vargood, since it's a boolean. Sponsored by: Netflix Modified: head/stand/efi/loader/main.c Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Thu Jun 14 06:40:59 2018 (r335115) +++ head/stand/efi/loader/main.c Thu Jun 14 06:41:22 2018 (r335116) @@ -415,7 +415,8 @@ main(int argc, CHAR16 *argv[]) { char var[128]; EFI_GUID *guid; - int i, j, vargood, howto; + int i, j, howto; + bool vargood; UINTN k; int has_kbd; char *s; @@ -532,14 +533,14 @@ main(int argc, CHAR16 *argv[]) } } } else { - vargood = 0; + vargood = false; for (j = 0; argv[i][j] != 0; j++) { if (j == sizeof(var)) { - vargood = 0; + vargood = false; break; } if (j > 0 && argv[i][j] == '=') - vargood = 1; + vargood = true; var[j] = (char)argv[i][j]; } if (vargood) { From owner-svn-src-head@freebsd.org Thu Jun 14 06:41:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 326461006E83; Thu, 14 Jun 2018 06:41:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D89277B56; Thu, 14 Jun 2018 06:41:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F2C5724E35; Thu, 14 Jun 2018 06:41:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5E6fZ6D064203; Thu, 14 Jun 2018 06:41:35 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5E6fYLr064193; Thu, 14 Jun 2018 06:41:34 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806140641.w5E6fYLr064193@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 14 Jun 2018 06:41:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335117 - in head/stand: common efi/loader i386/loader mips/beri/loader powerpc/kboot powerpc/ofw sparc64/loader uboot/common userboot/userboot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/stand: common efi/loader i386/loader mips/beri/loader powerpc/kboot powerpc/ofw sparc64/loader uboot/common userboot/userboot X-SVN-Commit-Revision: 335117 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 06:41:38 -0000 Author: imp Date: Thu Jun 14 06:41:33 2018 New Revision: 335117 URL: https://svnweb.freebsd.org/changeset/base/335117 Log: bootprog_info is generated in vers.c. Move it's definition to bootstrap.h and remove all the redundant copies. Sponsored by: Netflix Modified: head/stand/common/bootstrap.h head/stand/efi/loader/main.c head/stand/i386/loader/main.c head/stand/mips/beri/loader/loader.h head/stand/powerpc/kboot/main.c head/stand/powerpc/ofw/main.c head/stand/sparc64/loader/main.c head/stand/uboot/common/main.c head/stand/userboot/userboot/main.c Modified: head/stand/common/bootstrap.h ============================================================================== --- head/stand/common/bootstrap.h Thu Jun 14 06:41:22 2018 (r335116) +++ head/stand/common/bootstrap.h Thu Jun 14 06:41:33 2018 (r335117) @@ -161,6 +161,11 @@ char *pnp_eisaformat(uint8_t *data); extern int isapnp_readport; /* + * Version information + */ +extern char bootprog_info[]; + +/* * Preloaded file metadata header. * * Metadata are allocated on our heap, and copied into kernel space Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Thu Jun 14 06:41:22 2018 (r335116) +++ head/stand/efi/loader/main.c Thu Jun 14 06:41:33 2018 (r335117) @@ -53,8 +53,6 @@ __FBSDID("$FreeBSD$"); #include "loader_efi.h" -extern char bootprog_info[]; - struct arch_switch archsw; /* MI/MD interface boundary */ EFI_GUID acpi = ACPI_TABLE_GUID; Modified: head/stand/i386/loader/main.c ============================================================================== --- head/stand/i386/loader/main.c Thu Jun 14 06:41:22 2018 (r335116) +++ head/stand/i386/loader/main.c Thu Jun 14 06:41:33 2018 (r335117) @@ -79,9 +79,6 @@ struct zfs_boot_args *zargs; static void i386_zfs_probe(void); #endif -/* from vers.c */ -extern char bootprog_info[]; - /* XXX debugging */ extern char end[]; Modified: head/stand/mips/beri/loader/loader.h ============================================================================== --- head/stand/mips/beri/loader/loader.h Thu Jun 14 06:41:22 2018 (r335116) +++ head/stand/mips/beri/loader/loader.h Thu Jun 14 06:41:33 2018 (r335117) @@ -58,7 +58,4 @@ extern struct bootinfo boot2_bootinfo; /* metadata.c */ int md_load64(char *args, vm_offset_t *modulep, vm_offset_t *dtbp); -/* vers.c */ -extern char bootprog_info[]; - #endif /* !_BOOT_LOADER_H_ */ Modified: head/stand/powerpc/kboot/main.c ============================================================================== --- head/stand/powerpc/kboot/main.c Thu Jun 14 06:41:22 2018 (r335116) +++ head/stand/powerpc/kboot/main.c Thu Jun 14 06:41:33 2018 (r335117) @@ -40,8 +40,6 @@ __FBSDID("$FreeBSD$"); struct arch_switch archsw; extern void *_end; -extern char bootprog_info[]; - int kboot_getdev(void **vdev, const char *devspec, const char **path); ssize_t kboot_copyin(const void *src, vm_offset_t dest, const size_t len); ssize_t kboot_copyout(vm_offset_t src, void *dest, const size_t len); Modified: head/stand/powerpc/ofw/main.c ============================================================================== --- head/stand/powerpc/ofw/main.c Thu Jun 14 06:41:22 2018 (r335116) +++ head/stand/powerpc/ofw/main.c Thu Jun 14 06:41:33 2018 (r335117) @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); struct arch_switch archsw; /* MI/MD interface boundary */ extern char end[]; -extern char bootprog_info[]; uint32_t acells, scells; Modified: head/stand/sparc64/loader/main.c ============================================================================== --- head/stand/sparc64/loader/main.c Thu Jun 14 06:41:22 2018 (r335116) +++ head/stand/sparc64/loader/main.c Thu Jun 14 06:41:33 2018 (r335117) @@ -75,8 +75,6 @@ __FBSDID("$FreeBSD$"); #include "libofw.h" #include "dev_net.h" -extern char bootprog_info[]; - enum { HEAPVA = 0x800000, HEAPSZ = 0x1000000, Modified: head/stand/uboot/common/main.c ============================================================================== --- head/stand/uboot/common/main.c Thu Jun 14 06:41:22 2018 (r335116) +++ head/stand/uboot/common/main.c Thu Jun 14 06:41:33 2018 (r335117) @@ -66,7 +66,6 @@ struct device_type { }; extern char end[]; -extern char bootprog_info[]; extern unsigned char _etext[]; extern unsigned char _edata[]; Modified: head/stand/userboot/userboot/main.c ============================================================================== --- head/stand/userboot/userboot/main.c Thu Jun 14 06:41:22 2018 (r335116) +++ head/stand/userboot/userboot/main.c Thu Jun 14 06:41:33 2018 (r335117) @@ -52,7 +52,6 @@ static int userboot_zfs_found; struct loader_callbacks *callbacks; void *callbacks_arg; -extern char bootprog_info[]; static jmp_buf jb; struct arch_switch archsw; /* MI/MD interface boundary */ From owner-svn-src-head@freebsd.org Thu Jun 14 07:12:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2ACD51009798; Thu, 14 Jun 2018 07:12:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CFA9579459; Thu, 14 Jun 2018 07:12:13 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B099725368; Thu, 14 Jun 2018 07:12:13 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5E7CD2k083541; Thu, 14 Jun 2018 07:12:13 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5E7CA0M083525; Thu, 14 Jun 2018 07:12:10 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201806140712.w5E7CA0M083525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 14 Jun 2018 07:12:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335121 - in head/sys/gnu/dts: arm include/dt-bindings/clock include/dt-bindings/gpio include/dt-bindings/input include/dt-bindings/media include/dt-bindings/mfd include/dt-bindings/net... X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys/gnu/dts: arm include/dt-bindings/clock include/dt-bindings/gpio include/dt-bindings/input include/dt-bindings/media include/dt-bindings/mfd include/dt-bindings/net include/dt-bindings/pinc... X-SVN-Commit-Revision: 335121 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 07:12:14 -0000 Author: manu Date: Thu Jun 14 07:12:10 2018 New Revision: 335121 URL: https://svnweb.freebsd.org/changeset/base/335121 Log: dts: Update our copy to Linux 4.17 Added: - copied unchanged from r335118, vendor/device-tree/dist/src/arm/am335x-pdu001.dts - copied unchanged from r335118, vendor/device-tree/dist/src/arm/aspeed-bmc-arm-centriq2400-rep.dts - copied unchanged from r335118, vendor/device-tree/dist/src/arm/dra76x-mmc-iodelay.dtsi - copied unchanged from r335118, vendor/device-tree/dist/src/arm/exynos4412-galaxy-s3.dtsi - copied unchanged from r335118, vendor/device-tree/dist/src/arm/exynos4412-i9300.dts - copied unchanged from r335118, vendor/device-tree/dist/src/arm/exynos4412-i9305.dts - copied unchanged from r335118, vendor/device-tree/dist/src/arm/exynos4412-midas.dtsi - copied unchanged from r335118, vendor/device-tree/dist/src/arm/exynos4412-n710x.dts - copied unchanged from r335118, vendor/device-tree/dist/src/arm/imx6dl-phytec-mira-rdk-nand.dts - copied unchanged from r335118, vendor/device-tree/dist/src/arm/imx6q-dms-ba16.dts - copied unchanged from r335118, vendor/device-tree/dist/src/arm/imx6q-phytec-mira-rdk-emmc.dts - copied unchanged from r335118, vendor/device-tree/dist/src/arm/imx6q-phytec-mira-rdk-nand.dts - copied unchanged from r335118, vendor/device-tree/dist/src/arm/imx6qdl-phytec-mira.dtsi - copied unchanged from r335118, vendor/device-tree/dist/src/arm/imx6qdl-phytec-phycore-som.dtsi - copied unchanged from r335118, vendor/device-tree/dist/src/arm/imx6qp-phytec-mira-rdk-nand.dts - copied unchanged from r335118, vendor/device-tree/dist/src/arm/imx6ul-14x14-evk.dtsi - copied unchanged from r335118, vendor/device-tree/dist/src/arm/imx6ull-colibri-eval-v3.dts - copied unchanged from r335118, vendor/device-tree/dist/src/arm/imx6ull-colibri-eval-v3.dtsi - copied unchanged from r335118, vendor/device-tree/dist/src/arm/imx6ull-colibri-nonwifi.dtsi - copied unchanged from r335118, vendor/device-tree/dist/src/arm/imx6ull-colibri-wifi-eval-v3.dts - copied unchanged from r335118, vendor/device-tree/dist/src/arm/imx6ull-colibri-wifi.dtsi - copied unchanged from r335118, vendor/device-tree/dist/src/arm/imx6ull-colibri.dtsi - copied unchanged from r335118, vendor/device-tree/dist/src/arm/imx6ull-pinfunc-snvs.h - copied unchanged from r335118, vendor/device-tree/dist/src/arm/nuvoton-common-npcm7xx.dtsi - copied unchanged from r335118, vendor/device-tree/dist/src/arm/nuvoton-npcm750-evb.dts - copied unchanged from r335118, vendor/device-tree/dist/src/arm/nuvoton-npcm750.dtsi - copied unchanged from r335118, vendor/device-tree/dist/src/arm/qcom-msm8974-samsung-klte.dts - copied unchanged from r335118, vendor/device-tree/dist/src/arm/r8a7790-stout.dts - copied unchanged from r335118, vendor/device-tree/dist/src/arm/stm32f7-pinctrl.dtsi - copied unchanged from r335118, vendor/device-tree/dist/src/arm/stm32f746-pinctrl.dtsi - copied unchanged from r335118, vendor/device-tree/dist/src/arm/stm32f769-pinctrl.dtsi - copied unchanged from r335118, vendor/device-tree/dist/src/arm/stm32mp157-pinctrl.dtsi - copied unchanged from r335118, vendor/device-tree/dist/src/arm/stm32mp157c-ed1.dts - copied unchanged from r335118, vendor/device-tree/dist/src/arm/stm32mp157c-ev1.dts - copied unchanged from r335118, vendor/device-tree/dist/src/arm/stm32mp157c.dtsi - copied unchanged from r335118, vendor/device-tree/dist/src/arm/sun7i-a20-olimex-som204-evb-emmc.dts - copied unchanged from r335118, vendor/device-tree/dist/src/arm/sun7i-a20-olimex-som204-evb.dts - copied unchanged from r335118, vendor/device-tree/dist/src/arm/sun8i-h2-plus-bananapi-m2-zero.dts - copied unchanged from r335118, vendor/device-tree/dist/src/arm/tegra124-apalis-v1.2-eval.dts - copied unchanged from r335118, vendor/device-tree/dist/src/arm/tegra124-apalis-v1.2.dtsi - copied unchanged from r335118, vendor/device-tree/dist/src/arm/versatile-ab-ib2.dts - copied unchanged from r335118, vendor/device-tree/dist/src/arm/zynq-cc108.dts - copied unchanged from r335118, vendor/device-tree/dist/src/arm/zynq-zc770-xm010.dts - copied unchanged from r335118, vendor/device-tree/dist/src/arm/zynq-zc770-xm011.dts - copied unchanged from r335118, vendor/device-tree/dist/src/arm/zynq-zc770-xm012.dts - copied unchanged from r335118, vendor/device-tree/dist/src/arm/zynq-zc770-xm013.dts - copied unchanged from r335118, vendor/device-tree/dist/src/arm/zynq-zybo-z7.dts - copied unchanged from r335118, vendor/device-tree/dist/include/dt-bindings/clock/imx6sll-clock.h - copied unchanged from r335118, vendor/device-tree/dist/include/dt-bindings/clock/r8a77965-cpg-mssr.h - copied unchanged from r335118, vendor/device-tree/dist/include/dt-bindings/clock/r8a77980-cpg-mssr.h - copied unchanged from r335118, vendor/device-tree/dist/include/dt-bindings/clock/stm32mp1-clks.h - copied unchanged from r335118, vendor/device-tree/dist/include/dt-bindings/clock/stratix10-clock.h - copied unchanged from r335118, vendor/device-tree/dist/include/dt-bindings/clock/sun50i-h6-ccu.h - copied unchanged from r335118, vendor/device-tree/dist/include/dt-bindings/clock/tegra194-clock.h - copied unchanged from r335118, vendor/device-tree/dist/include/dt-bindings/gpio/tegra194-gpio.h - copied unchanged from r335118, vendor/device-tree/dist/include/dt-bindings/input/gpio-keys.h - copied unchanged from r335118, vendor/device-tree/dist/include/dt-bindings/media/tda1997x.h - copied unchanged from r335118, vendor/device-tree/dist/include/dt-bindings/power/mt7623a-power.h - copied unchanged from r335118, vendor/device-tree/dist/include/dt-bindings/power/r8a77965-sysc.h - copied unchanged from r335118, vendor/device-tree/dist/include/dt-bindings/power/r8a77980-sysc.h - copied unchanged from r335118, vendor/device-tree/dist/include/dt-bindings/power/tegra194-powergate.h - copied unchanged from r335118, vendor/device-tree/dist/include/dt-bindings/reset/stm32mp1-resets.h - copied unchanged from r335118, vendor/device-tree/dist/include/dt-bindings/reset/sun50i-h6-ccu.h - copied unchanged from r335118, vendor/device-tree/dist/include/dt-bindings/reset/tegra194-reset.h - copied unchanged from r335118, vendor/device-tree/dist/include/dt-bindings/sound/rt5651.h Directory Properties: head/sys/gnu/dts/arm/am335x-pdu001.dts (props changed) head/sys/gnu/dts/arm/aspeed-bmc-arm-centriq2400-rep.dts (props changed) head/sys/gnu/dts/arm/dra76x-mmc-iodelay.dtsi (props changed) head/sys/gnu/dts/arm/exynos4412-galaxy-s3.dtsi (props changed) head/sys/gnu/dts/arm/exynos4412-i9300.dts (props changed) head/sys/gnu/dts/arm/exynos4412-i9305.dts (props changed) head/sys/gnu/dts/arm/exynos4412-midas.dtsi (props changed) head/sys/gnu/dts/arm/exynos4412-n710x.dts (props changed) head/sys/gnu/dts/arm/imx6dl-phytec-mira-rdk-nand.dts (props changed) head/sys/gnu/dts/arm/imx6q-dms-ba16.dts (props changed) head/sys/gnu/dts/arm/imx6q-phytec-mira-rdk-emmc.dts (props changed) head/sys/gnu/dts/arm/imx6q-phytec-mira-rdk-nand.dts (props changed) head/sys/gnu/dts/arm/imx6qdl-phytec-mira.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-phytec-phycore-som.dtsi (props changed) head/sys/gnu/dts/arm/imx6qp-phytec-mira-rdk-nand.dts (props changed) head/sys/gnu/dts/arm/imx6ul-14x14-evk.dtsi (props changed) head/sys/gnu/dts/arm/imx6ull-colibri-eval-v3.dts (props changed) head/sys/gnu/dts/arm/imx6ull-colibri-eval-v3.dtsi (props changed) head/sys/gnu/dts/arm/imx6ull-colibri-nonwifi.dtsi (props changed) head/sys/gnu/dts/arm/imx6ull-colibri-wifi-eval-v3.dts (props changed) head/sys/gnu/dts/arm/imx6ull-colibri-wifi.dtsi (props changed) head/sys/gnu/dts/arm/imx6ull-colibri.dtsi (props changed) head/sys/gnu/dts/arm/imx6ull-pinfunc-snvs.h (props changed) head/sys/gnu/dts/arm/nuvoton-common-npcm7xx.dtsi (props changed) head/sys/gnu/dts/arm/nuvoton-npcm750-evb.dts (props changed) head/sys/gnu/dts/arm/nuvoton-npcm750.dtsi (props changed) head/sys/gnu/dts/arm/qcom-msm8974-samsung-klte.dts (props changed) head/sys/gnu/dts/arm/r8a7790-stout.dts (props changed) head/sys/gnu/dts/arm/stm32f7-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm/stm32f746-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm/stm32f769-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm/stm32mp157-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm/stm32mp157c-ed1.dts (props changed) head/sys/gnu/dts/arm/stm32mp157c-ev1.dts (props changed) head/sys/gnu/dts/arm/stm32mp157c.dtsi (props changed) head/sys/gnu/dts/arm/sun7i-a20-olimex-som204-evb-emmc.dts (props changed) head/sys/gnu/dts/arm/sun7i-a20-olimex-som204-evb.dts (props changed) head/sys/gnu/dts/arm/sun8i-h2-plus-bananapi-m2-zero.dts (props changed) head/sys/gnu/dts/arm/tegra124-apalis-v1.2-eval.dts (props changed) head/sys/gnu/dts/arm/tegra124-apalis-v1.2.dtsi (props changed) head/sys/gnu/dts/arm/versatile-ab-ib2.dts (props changed) head/sys/gnu/dts/arm/zynq-cc108.dts (props changed) head/sys/gnu/dts/arm/zynq-zc770-xm010.dts (props changed) head/sys/gnu/dts/arm/zynq-zc770-xm011.dts (props changed) head/sys/gnu/dts/arm/zynq-zc770-xm012.dts (props changed) head/sys/gnu/dts/arm/zynq-zc770-xm013.dts (props changed) head/sys/gnu/dts/arm/zynq-zybo-z7.dts (props changed) head/sys/gnu/dts/include/dt-bindings/clock/imx6sll-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/r8a77965-cpg-mssr.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/r8a77980-cpg-mssr.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/stm32mp1-clks.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/stratix10-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/sun50i-h6-ccu.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/tegra194-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/gpio/tegra194-gpio.h (props changed) head/sys/gnu/dts/include/dt-bindings/input/gpio-keys.h (props changed) head/sys/gnu/dts/include/dt-bindings/media/tda1997x.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/mt7623a-power.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/r8a77965-sysc.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/r8a77980-sysc.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/tegra194-powergate.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/stm32mp1-resets.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/sun50i-h6-ccu.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/tegra194-reset.h (props changed) head/sys/gnu/dts/include/dt-bindings/sound/rt5651.h (props changed) Deleted: head/sys/gnu/dts/arm/samsung_k3pe0e000b.dtsi Modified: head/sys/gnu/dts/arm/am335x-boneblue.dts head/sys/gnu/dts/arm/am33xx.dtsi head/sys/gnu/dts/arm/am4372.dtsi head/sys/gnu/dts/arm/am437x-gp-evm.dts head/sys/gnu/dts/arm/am437x-sk-evm.dts head/sys/gnu/dts/arm/am43x-epos-evm.dts head/sys/gnu/dts/arm/am571x-idk.dts head/sys/gnu/dts/arm/am572x-idk.dts head/sys/gnu/dts/arm/am57xx-beagle-x15-common.dtsi head/sys/gnu/dts/arm/am57xx-idk-common.dtsi head/sys/gnu/dts/arm/animeo_ip.dts head/sys/gnu/dts/arm/arm-realview-eb.dtsi head/sys/gnu/dts/arm/arm-realview-pb1176.dts head/sys/gnu/dts/arm/arm-realview-pb11mp.dts head/sys/gnu/dts/arm/arm-realview-pbx.dtsi head/sys/gnu/dts/arm/armada-370-db.dts head/sys/gnu/dts/arm/armada-370-dlink-dns327l.dts head/sys/gnu/dts/arm/armada-370-mirabox.dts head/sys/gnu/dts/arm/armada-370-netgear-rn102.dts head/sys/gnu/dts/arm/armada-370-netgear-rn104.dts head/sys/gnu/dts/arm/armada-370-rd.dts head/sys/gnu/dts/arm/armada-370-seagate-nas-2bay.dts head/sys/gnu/dts/arm/armada-370-seagate-nas-4bay.dts head/sys/gnu/dts/arm/armada-370-seagate-nas-xbay.dtsi head/sys/gnu/dts/arm/armada-370-seagate-personal-cloud-2bay.dts head/sys/gnu/dts/arm/armada-370-seagate-personal-cloud.dts head/sys/gnu/dts/arm/armada-370-seagate-personal-cloud.dtsi head/sys/gnu/dts/arm/armada-370-synology-ds213j.dts head/sys/gnu/dts/arm/armada-370-xp.dtsi head/sys/gnu/dts/arm/armada-370.dtsi head/sys/gnu/dts/arm/armada-375-db.dts head/sys/gnu/dts/arm/armada-375.dtsi head/sys/gnu/dts/arm/armada-380.dtsi head/sys/gnu/dts/arm/armada-385-db-ap.dts head/sys/gnu/dts/arm/armada-385-linksys-caiman.dts head/sys/gnu/dts/arm/armada-385-linksys-cobra.dts head/sys/gnu/dts/arm/armada-385-linksys-rango.dts head/sys/gnu/dts/arm/armada-385-linksys-shelby.dts head/sys/gnu/dts/arm/armada-385-linksys.dtsi head/sys/gnu/dts/arm/armada-385-synology-ds116.dts head/sys/gnu/dts/arm/armada-385-turris-omnia.dts head/sys/gnu/dts/arm/armada-385.dtsi head/sys/gnu/dts/arm/armada-388-clearfog-base.dts head/sys/gnu/dts/arm/armada-388-clearfog-pro.dts head/sys/gnu/dts/arm/armada-388-clearfog.dts head/sys/gnu/dts/arm/armada-388-clearfog.dtsi head/sys/gnu/dts/arm/armada-388-db.dts head/sys/gnu/dts/arm/armada-388-gp.dts head/sys/gnu/dts/arm/armada-388-rd.dts head/sys/gnu/dts/arm/armada-388.dtsi head/sys/gnu/dts/arm/armada-38x-solidrun-microsom.dtsi head/sys/gnu/dts/arm/armada-38x.dtsi head/sys/gnu/dts/arm/armada-390-db.dts head/sys/gnu/dts/arm/armada-390.dtsi head/sys/gnu/dts/arm/armada-395-gp.dts head/sys/gnu/dts/arm/armada-395.dtsi head/sys/gnu/dts/arm/armada-398-db.dts head/sys/gnu/dts/arm/armada-398.dtsi head/sys/gnu/dts/arm/armada-39x.dtsi head/sys/gnu/dts/arm/armada-xp-98dx3236.dtsi head/sys/gnu/dts/arm/armada-xp-98dx3336.dtsi head/sys/gnu/dts/arm/armada-xp-98dx4251.dtsi head/sys/gnu/dts/arm/armada-xp-axpwifiap.dts head/sys/gnu/dts/arm/armada-xp-db-dxbc2.dts head/sys/gnu/dts/arm/armada-xp-db-xc3-24g4xg.dts head/sys/gnu/dts/arm/armada-xp-db.dts head/sys/gnu/dts/arm/armada-xp-gp.dts head/sys/gnu/dts/arm/armada-xp-lenovo-ix4-300d.dts head/sys/gnu/dts/arm/armada-xp-linksys-mamba.dts head/sys/gnu/dts/arm/armada-xp-matrix.dts head/sys/gnu/dts/arm/armada-xp-mv78230.dtsi head/sys/gnu/dts/arm/armada-xp-mv78260.dtsi head/sys/gnu/dts/arm/armada-xp-mv78460.dtsi head/sys/gnu/dts/arm/armada-xp-netgear-rn2120.dts head/sys/gnu/dts/arm/armada-xp-openblocks-ax3-4.dts head/sys/gnu/dts/arm/armada-xp-synology-ds414.dts head/sys/gnu/dts/arm/armada-xp.dtsi head/sys/gnu/dts/arm/artpec6-devboard.dts head/sys/gnu/dts/arm/artpec6.dtsi head/sys/gnu/dts/arm/aspeed-bmc-opp-palmetto.dts head/sys/gnu/dts/arm/aspeed-bmc-opp-romulus.dts head/sys/gnu/dts/arm/aspeed-bmc-opp-witherspoon.dts (contents, props changed) head/sys/gnu/dts/arm/aspeed-bmc-opp-zaius.dts (contents, props changed) head/sys/gnu/dts/arm/aspeed-g4.dtsi head/sys/gnu/dts/arm/aspeed-g5.dtsi head/sys/gnu/dts/arm/at91-nattis-2-natte-2.dts (contents, props changed) head/sys/gnu/dts/arm/at91-sama5d2_ptc_ek.dts (contents, props changed) head/sys/gnu/dts/arm/at91-tse850-3.dts head/sys/gnu/dts/arm/at91rm9200.dtsi head/sys/gnu/dts/arm/at91sam9260.dtsi head/sys/gnu/dts/arm/at91sam9260ek.dts head/sys/gnu/dts/arm/at91sam9261.dtsi head/sys/gnu/dts/arm/at91sam9263.dtsi head/sys/gnu/dts/arm/at91sam9263ek.dts head/sys/gnu/dts/arm/at91sam9g20ek_common.dtsi head/sys/gnu/dts/arm/at91sam9g25.dtsi head/sys/gnu/dts/arm/at91sam9g45.dtsi head/sys/gnu/dts/arm/at91sam9n12.dtsi head/sys/gnu/dts/arm/at91sam9rl.dtsi head/sys/gnu/dts/arm/at91sam9rlek.dts head/sys/gnu/dts/arm/at91sam9x5.dtsi head/sys/gnu/dts/arm/at91sam9x5_usart3.dtsi head/sys/gnu/dts/arm/atlas7-evb.dts head/sys/gnu/dts/arm/axp209.dtsi head/sys/gnu/dts/arm/axp22x.dtsi head/sys/gnu/dts/arm/axp81x.dtsi head/sys/gnu/dts/arm/bcm-cygnus.dtsi head/sys/gnu/dts/arm/bcm2835-rpi-zero-w.dts head/sys/gnu/dts/arm/bcm2835-rpi.dtsi head/sys/gnu/dts/arm/bcm2837-rpi-3-b.dts head/sys/gnu/dts/arm/bcm283x.dtsi head/sys/gnu/dts/arm/bcm47081-buffalo-wzr-900dhp.dts head/sys/gnu/dts/arm/bcm958622hr.dts head/sys/gnu/dts/arm/bcm958623hr.dts head/sys/gnu/dts/arm/bcm958625hr.dts head/sys/gnu/dts/arm/bcm958625k.dts head/sys/gnu/dts/arm/bcm988312hr.dts head/sys/gnu/dts/arm/da850-evm.dts head/sys/gnu/dts/arm/da850-lcdk.dts head/sys/gnu/dts/arm/da850-lego-ev3.dts head/sys/gnu/dts/arm/da850.dtsi head/sys/gnu/dts/arm/dm8148-evm.dts head/sys/gnu/dts/arm/dm8148-t410.dts head/sys/gnu/dts/arm/dm8168-evm.dts head/sys/gnu/dts/arm/dra62x-j5eco-evm.dts head/sys/gnu/dts/arm/dra7-evm.dts head/sys/gnu/dts/arm/dra7.dtsi head/sys/gnu/dts/arm/dra71-evm.dts head/sys/gnu/dts/arm/dra76-evm.dts head/sys/gnu/dts/arm/emev2-kzm9d.dts head/sys/gnu/dts/arm/exynos-mfc-reserved-memory.dtsi head/sys/gnu/dts/arm/exynos-syscon-restart.dtsi head/sys/gnu/dts/arm/exynos3250-artik5.dtsi head/sys/gnu/dts/arm/exynos3250.dtsi head/sys/gnu/dts/arm/exynos4.dtsi head/sys/gnu/dts/arm/exynos4210-pinctrl.dtsi head/sys/gnu/dts/arm/exynos4210-trats.dts head/sys/gnu/dts/arm/exynos4210-universal_c210.dts head/sys/gnu/dts/arm/exynos4210.dtsi head/sys/gnu/dts/arm/exynos4412-itop-elite.dts head/sys/gnu/dts/arm/exynos4412-odroid-common.dtsi head/sys/gnu/dts/arm/exynos4412-pinctrl.dtsi head/sys/gnu/dts/arm/exynos4412-tiny4412.dts head/sys/gnu/dts/arm/exynos4412-tmu-sensor-conf.dtsi head/sys/gnu/dts/arm/exynos4412-trats2.dts head/sys/gnu/dts/arm/exynos4412.dtsi head/sys/gnu/dts/arm/exynos5250-snow-common.dtsi head/sys/gnu/dts/arm/exynos5250-snow.dts head/sys/gnu/dts/arm/exynos5250.dtsi head/sys/gnu/dts/arm/exynos5260-xyref5260.dts head/sys/gnu/dts/arm/exynos5410.dtsi head/sys/gnu/dts/arm/exynos5420-cpus.dtsi head/sys/gnu/dts/arm/exynos5420-peach-pit.dts head/sys/gnu/dts/arm/exynos5422-cpus.dtsi head/sys/gnu/dts/arm/exynos5440.dtsi head/sys/gnu/dts/arm/exynos5800-peach-pi.dts head/sys/gnu/dts/arm/exynos5800.dtsi head/sys/gnu/dts/arm/gemini-dlink-dns-313.dts (contents, props changed) head/sys/gnu/dts/arm/gemini-nas4220b.dts head/sys/gnu/dts/arm/imx1-ads.dts head/sys/gnu/dts/arm/imx1-apf9328.dts head/sys/gnu/dts/arm/imx1.dtsi head/sys/gnu/dts/arm/imx23-evk.dts head/sys/gnu/dts/arm/imx23-olinuxino.dts head/sys/gnu/dts/arm/imx23-sansa.dts head/sys/gnu/dts/arm/imx23-stmp378x_devb.dts head/sys/gnu/dts/arm/imx23-xfi3.dts head/sys/gnu/dts/arm/imx23.dtsi head/sys/gnu/dts/arm/imx25-eukrea-cpuimx25.dtsi head/sys/gnu/dts/arm/imx25-eukrea-mbimxsd25-baseboard.dts head/sys/gnu/dts/arm/imx25-karo-tx25.dts head/sys/gnu/dts/arm/imx25-pdk.dts head/sys/gnu/dts/arm/imx25-pinfunc.h head/sys/gnu/dts/arm/imx25.dtsi head/sys/gnu/dts/arm/imx27-apf27.dts head/sys/gnu/dts/arm/imx27-eukrea-cpuimx27.dtsi head/sys/gnu/dts/arm/imx27-eukrea-mbimxsd27-baseboard.dts head/sys/gnu/dts/arm/imx27-pdk.dts head/sys/gnu/dts/arm/imx27-phytec-phycard-s-som.dtsi head/sys/gnu/dts/arm/imx27-phytec-phycore-som.dtsi head/sys/gnu/dts/arm/imx27.dtsi head/sys/gnu/dts/arm/imx28-apf28.dts head/sys/gnu/dts/arm/imx28-apx4devkit.dts head/sys/gnu/dts/arm/imx28-cfa10036.dts head/sys/gnu/dts/arm/imx28-cfa10049.dts head/sys/gnu/dts/arm/imx28-duckbill-2-485.dts head/sys/gnu/dts/arm/imx28-duckbill-2-enocean.dts head/sys/gnu/dts/arm/imx28-duckbill-2-spi.dts head/sys/gnu/dts/arm/imx28-duckbill-2.dts head/sys/gnu/dts/arm/imx28-duckbill.dts head/sys/gnu/dts/arm/imx28-eukrea-mbmx283lc.dts head/sys/gnu/dts/arm/imx28-eukrea-mbmx287lc.dts head/sys/gnu/dts/arm/imx28-eukrea-mbmx28lc.dtsi head/sys/gnu/dts/arm/imx28-evk.dts head/sys/gnu/dts/arm/imx28-m28.dtsi head/sys/gnu/dts/arm/imx28-m28cu3.dts head/sys/gnu/dts/arm/imx28-m28evk.dts head/sys/gnu/dts/arm/imx28-sps1.dts head/sys/gnu/dts/arm/imx28-ts4600.dts (contents, props changed) head/sys/gnu/dts/arm/imx28-tx28.dts head/sys/gnu/dts/arm/imx28.dtsi head/sys/gnu/dts/arm/imx31-bug.dts head/sys/gnu/dts/arm/imx31.dtsi head/sys/gnu/dts/arm/imx35-eukrea-cpuimx35.dtsi head/sys/gnu/dts/arm/imx35-pdk.dts head/sys/gnu/dts/arm/imx35.dtsi head/sys/gnu/dts/arm/imx50-evk.dts head/sys/gnu/dts/arm/imx50.dtsi head/sys/gnu/dts/arm/imx51-apf51.dts head/sys/gnu/dts/arm/imx51-babbage.dts head/sys/gnu/dts/arm/imx51-digi-connectcore-jsk.dts head/sys/gnu/dts/arm/imx51-digi-connectcore-som.dtsi head/sys/gnu/dts/arm/imx51-eukrea-cpuimx51.dtsi head/sys/gnu/dts/arm/imx51-ts4800.dts head/sys/gnu/dts/arm/imx51-zii-rdu1.dts head/sys/gnu/dts/arm/imx51.dtsi head/sys/gnu/dts/arm/imx53-ard.dts head/sys/gnu/dts/arm/imx53-cx9020.dts head/sys/gnu/dts/arm/imx53-m53.dtsi head/sys/gnu/dts/arm/imx53-m53evk.dts head/sys/gnu/dts/arm/imx53-ppd.dts head/sys/gnu/dts/arm/imx53-qsb-common.dtsi head/sys/gnu/dts/arm/imx53-smd.dts head/sys/gnu/dts/arm/imx53-tqma53.dtsi head/sys/gnu/dts/arm/imx53-tx53-x03x.dts head/sys/gnu/dts/arm/imx53-tx53-x13x.dts head/sys/gnu/dts/arm/imx53-tx53.dtsi head/sys/gnu/dts/arm/imx53-usbarmory.dts head/sys/gnu/dts/arm/imx53-voipac-bsb.dts head/sys/gnu/dts/arm/imx53.dtsi head/sys/gnu/dts/arm/imx6dl-apf6dev.dts head/sys/gnu/dts/arm/imx6dl-aristainetos2_4.dts head/sys/gnu/dts/arm/imx6dl-aristainetos2_7.dts head/sys/gnu/dts/arm/imx6dl-aristainetos_4.dts head/sys/gnu/dts/arm/imx6dl-aristainetos_7.dts head/sys/gnu/dts/arm/imx6dl-colibri-eval-v3.dts head/sys/gnu/dts/arm/imx6dl-dfi-fs700-m60.dts head/sys/gnu/dts/arm/imx6dl-phytec-pfla02.dtsi head/sys/gnu/dts/arm/imx6dl-rex-basic.dts head/sys/gnu/dts/arm/imx6dl-riotboard.dts head/sys/gnu/dts/arm/imx6dl-ts4900.dts head/sys/gnu/dts/arm/imx6dl-ts7970.dts (contents, props changed) head/sys/gnu/dts/arm/imx6dl-wandboard-revb1.dts head/sys/gnu/dts/arm/imx6dl-wandboard-revd1.dts head/sys/gnu/dts/arm/imx6dl-wandboard.dts head/sys/gnu/dts/arm/imx6dl.dtsi head/sys/gnu/dts/arm/imx6q-apf6dev.dts head/sys/gnu/dts/arm/imx6q-arm2.dts head/sys/gnu/dts/arm/imx6q-ba16.dtsi head/sys/gnu/dts/arm/imx6q-bx50v3.dtsi head/sys/gnu/dts/arm/imx6q-cm-fx6.dts head/sys/gnu/dts/arm/imx6q-dfi-fs700-m60.dts head/sys/gnu/dts/arm/imx6q-display5.dtsi head/sys/gnu/dts/arm/imx6q-dmo-edmqmx6.dts head/sys/gnu/dts/arm/imx6q-evi.dts head/sys/gnu/dts/arm/imx6q-gk802.dts head/sys/gnu/dts/arm/imx6q-gw5400-a.dts head/sys/gnu/dts/arm/imx6q-h100.dts head/sys/gnu/dts/arm/imx6q-marsboard.dts head/sys/gnu/dts/arm/imx6q-mccmon6.dts head/sys/gnu/dts/arm/imx6q-novena.dts head/sys/gnu/dts/arm/imx6q-phytec-pfla02.dtsi head/sys/gnu/dts/arm/imx6q-pistachio.dts head/sys/gnu/dts/arm/imx6q-rex-pro.dts head/sys/gnu/dts/arm/imx6q-sbc6x.dts head/sys/gnu/dts/arm/imx6q-tbs2910.dts head/sys/gnu/dts/arm/imx6q-ts4900.dts head/sys/gnu/dts/arm/imx6q-ts7970.dts (contents, props changed) head/sys/gnu/dts/arm/imx6q-wandboard-revb1.dts head/sys/gnu/dts/arm/imx6q-wandboard-revd1.dts head/sys/gnu/dts/arm/imx6q-wandboard.dts head/sys/gnu/dts/arm/imx6q-zii-rdu2.dts head/sys/gnu/dts/arm/imx6q.dtsi head/sys/gnu/dts/arm/imx6qdl-apalis.dtsi head/sys/gnu/dts/arm/imx6qdl-cubox-i.dtsi head/sys/gnu/dts/arm/imx6qdl-gw51xx.dtsi head/sys/gnu/dts/arm/imx6qdl-gw52xx.dtsi head/sys/gnu/dts/arm/imx6qdl-gw53xx.dtsi head/sys/gnu/dts/arm/imx6qdl-gw54xx.dtsi head/sys/gnu/dts/arm/imx6qdl-gw551x.dtsi head/sys/gnu/dts/arm/imx6qdl-gw552x.dtsi head/sys/gnu/dts/arm/imx6qdl-gw553x.dtsi head/sys/gnu/dts/arm/imx6qdl-gw560x.dtsi head/sys/gnu/dts/arm/imx6qdl-gw5903.dtsi head/sys/gnu/dts/arm/imx6qdl-gw5904.dtsi head/sys/gnu/dts/arm/imx6qdl-hummingboard.dtsi head/sys/gnu/dts/arm/imx6qdl-hummingboard2.dtsi (contents, props changed) head/sys/gnu/dts/arm/imx6qdl-icore-rqs.dtsi head/sys/gnu/dts/arm/imx6qdl-icore.dtsi head/sys/gnu/dts/arm/imx6qdl-nit6xlite.dtsi head/sys/gnu/dts/arm/imx6qdl-nitrogen6_max.dtsi head/sys/gnu/dts/arm/imx6qdl-nitrogen6_som2.dtsi head/sys/gnu/dts/arm/imx6qdl-nitrogen6x.dtsi head/sys/gnu/dts/arm/imx6qdl-phytec-pbab01.dtsi head/sys/gnu/dts/arm/imx6qdl-phytec-pfla02.dtsi head/sys/gnu/dts/arm/imx6qdl-rex.dtsi head/sys/gnu/dts/arm/imx6qdl-sabreauto.dtsi head/sys/gnu/dts/arm/imx6qdl-sabrelite.dtsi head/sys/gnu/dts/arm/imx6qdl-sabresd.dtsi head/sys/gnu/dts/arm/imx6qdl-tx6.dtsi head/sys/gnu/dts/arm/imx6qdl-udoo.dtsi head/sys/gnu/dts/arm/imx6qdl-var-dart.dtsi (contents, props changed) head/sys/gnu/dts/arm/imx6qdl-zii-rdu2.dtsi head/sys/gnu/dts/arm/imx6qdl.dtsi head/sys/gnu/dts/arm/imx6qp-wandboard-revd1.dts head/sys/gnu/dts/arm/imx6qp-zii-rdu2.dts head/sys/gnu/dts/arm/imx6sl-evk.dts head/sys/gnu/dts/arm/imx6sl-warp.dts head/sys/gnu/dts/arm/imx6sl.dtsi head/sys/gnu/dts/arm/imx6sx-nitrogen6sx.dts head/sys/gnu/dts/arm/imx6sx-sabreauto.dts head/sys/gnu/dts/arm/imx6sx-sdb.dtsi head/sys/gnu/dts/arm/imx6sx-softing-vining-2000.dts head/sys/gnu/dts/arm/imx6sx-udoo-neo-basic.dts head/sys/gnu/dts/arm/imx6sx-udoo-neo-extended.dts head/sys/gnu/dts/arm/imx6sx-udoo-neo-full.dts head/sys/gnu/dts/arm/imx6sx.dtsi head/sys/gnu/dts/arm/imx6ul-14x14-evk.dts head/sys/gnu/dts/arm/imx6ul-geam.dts head/sys/gnu/dts/arm/imx6ul-isiot.dtsi head/sys/gnu/dts/arm/imx6ul-litesom.dtsi head/sys/gnu/dts/arm/imx6ul-opos6ul.dtsi head/sys/gnu/dts/arm/imx6ul-pico-hobbit.dts head/sys/gnu/dts/arm/imx6ul-pinfunc.h head/sys/gnu/dts/arm/imx6ul-tx6ul.dtsi head/sys/gnu/dts/arm/imx6ul.dtsi head/sys/gnu/dts/arm/imx6ull-14x14-evk.dts head/sys/gnu/dts/arm/imx6ull.dtsi head/sys/gnu/dts/arm/imx7d-cl-som-imx7.dts head/sys/gnu/dts/arm/imx7d-colibri-emmc.dtsi (contents, props changed) head/sys/gnu/dts/arm/imx7d-colibri.dtsi head/sys/gnu/dts/arm/imx7d-nitrogen7.dts head/sys/gnu/dts/arm/imx7d-pico.dtsi (contents, props changed) head/sys/gnu/dts/arm/imx7d-sdb.dts head/sys/gnu/dts/arm/imx7s-colibri.dtsi head/sys/gnu/dts/arm/imx7s-warp.dts head/sys/gnu/dts/arm/imx7s.dtsi head/sys/gnu/dts/arm/keystone-k2e-clocks.dtsi head/sys/gnu/dts/arm/keystone-k2e.dtsi head/sys/gnu/dts/arm/keystone-k2g.dtsi head/sys/gnu/dts/arm/keystone-k2hk.dtsi head/sys/gnu/dts/arm/keystone-k2l.dtsi head/sys/gnu/dts/arm/keystone.dtsi head/sys/gnu/dts/arm/kirkwood-b3.dts head/sys/gnu/dts/arm/kirkwood-blackarmor-nas220.dts head/sys/gnu/dts/arm/kirkwood-d2net.dts head/sys/gnu/dts/arm/kirkwood-db-88f6281.dts head/sys/gnu/dts/arm/kirkwood-db-88f6282.dts head/sys/gnu/dts/arm/kirkwood-db.dtsi head/sys/gnu/dts/arm/kirkwood-dir665.dts head/sys/gnu/dts/arm/kirkwood-ds109.dts head/sys/gnu/dts/arm/kirkwood-ds110jv10.dts head/sys/gnu/dts/arm/kirkwood-ds111.dts head/sys/gnu/dts/arm/kirkwood-ds112.dts head/sys/gnu/dts/arm/kirkwood-ds209.dts head/sys/gnu/dts/arm/kirkwood-ds210.dts head/sys/gnu/dts/arm/kirkwood-ds212.dts head/sys/gnu/dts/arm/kirkwood-ds212j.dts head/sys/gnu/dts/arm/kirkwood-ds409.dts head/sys/gnu/dts/arm/kirkwood-ds409slim.dts head/sys/gnu/dts/arm/kirkwood-ds411.dts head/sys/gnu/dts/arm/kirkwood-ds411j.dts head/sys/gnu/dts/arm/kirkwood-ds411slim.dts head/sys/gnu/dts/arm/kirkwood-laplug.dts head/sys/gnu/dts/arm/kirkwood-linkstation-6282.dtsi head/sys/gnu/dts/arm/kirkwood-linkstation-duo-6281.dtsi head/sys/gnu/dts/arm/kirkwood-linkstation-lsqvl.dts head/sys/gnu/dts/arm/kirkwood-linkstation-lsvl.dts head/sys/gnu/dts/arm/kirkwood-linkstation-lswsxl.dts head/sys/gnu/dts/arm/kirkwood-linkstation-lswvl.dts head/sys/gnu/dts/arm/kirkwood-linkstation-lswxl.dts head/sys/gnu/dts/arm/kirkwood-linkstation.dtsi head/sys/gnu/dts/arm/kirkwood-linksys-viper.dts head/sys/gnu/dts/arm/kirkwood-mv88f6281gtw-ge.dts head/sys/gnu/dts/arm/kirkwood-nas2big.dts head/sys/gnu/dts/arm/kirkwood-net2big.dts head/sys/gnu/dts/arm/kirkwood-net5big.dts head/sys/gnu/dts/arm/kirkwood-netgear_readynas_duo_v2.dts head/sys/gnu/dts/arm/kirkwood-netgear_readynas_nv+_v2.dts head/sys/gnu/dts/arm/kirkwood-netxbig.dtsi head/sys/gnu/dts/arm/kirkwood-nsa320.dts head/sys/gnu/dts/arm/kirkwood-nsa325.dts head/sys/gnu/dts/arm/kirkwood-openblocks_a7.dts head/sys/gnu/dts/arm/kirkwood-openrd-base.dts head/sys/gnu/dts/arm/kirkwood-openrd-client.dts head/sys/gnu/dts/arm/kirkwood-openrd-ultimate.dts head/sys/gnu/dts/arm/kirkwood-openrd.dtsi head/sys/gnu/dts/arm/kirkwood-pogo_e02.dts head/sys/gnu/dts/arm/kirkwood-pogoplug-series-4.dts head/sys/gnu/dts/arm/kirkwood-rd88f6192.dts head/sys/gnu/dts/arm/kirkwood-rd88f6281-a.dts head/sys/gnu/dts/arm/kirkwood-rd88f6281-z0.dts head/sys/gnu/dts/arm/kirkwood-rd88f6281.dtsi head/sys/gnu/dts/arm/kirkwood-rs212.dts head/sys/gnu/dts/arm/kirkwood-rs409.dts head/sys/gnu/dts/arm/kirkwood-rs411.dts head/sys/gnu/dts/arm/kirkwood-sheevaplug-common.dtsi head/sys/gnu/dts/arm/kirkwood-sheevaplug-esata.dts head/sys/gnu/dts/arm/kirkwood-sheevaplug.dts head/sys/gnu/dts/arm/kirkwood-synology.dtsi head/sys/gnu/dts/arm/kirkwood-t5325.dts head/sys/gnu/dts/arm/kirkwood-ts419-6281.dts head/sys/gnu/dts/arm/kirkwood-ts419-6282.dts head/sys/gnu/dts/arm/kirkwood-ts419.dtsi head/sys/gnu/dts/arm/kirkwood.dtsi head/sys/gnu/dts/arm/logicpd-som-lv.dtsi head/sys/gnu/dts/arm/logicpd-torpedo-som.dtsi head/sys/gnu/dts/arm/lpc18xx.dtsi head/sys/gnu/dts/arm/ls1021a.dtsi head/sys/gnu/dts/arm/meson8.dtsi head/sys/gnu/dts/arm/meson8b-odroidc1.dts head/sys/gnu/dts/arm/meson8b.dtsi head/sys/gnu/dts/arm/motorola-cpcap-mapphone.dtsi head/sys/gnu/dts/arm/mt7623.dtsi head/sys/gnu/dts/arm/mt7623n-bananapi-bpi-r2.dts head/sys/gnu/dts/arm/mt7623n-rfb-nand.dts head/sys/gnu/dts/arm/omap3-n9.dts head/sys/gnu/dts/arm/omap3-n900.dts head/sys/gnu/dts/arm/omap3.dtsi head/sys/gnu/dts/arm/omap4-droid4-xt894.dts head/sys/gnu/dts/arm/omap4.dtsi head/sys/gnu/dts/arm/omap443x.dtsi head/sys/gnu/dts/arm/omap4460.dtsi head/sys/gnu/dts/arm/omap5-board-common.dtsi head/sys/gnu/dts/arm/omap5.dtsi head/sys/gnu/dts/arm/omap54xx-clocks.dtsi head/sys/gnu/dts/arm/orion5x-lacie-d2-network.dts head/sys/gnu/dts/arm/orion5x-lacie-ethernet-disk-mini-v2.dts head/sys/gnu/dts/arm/orion5x-linkstation.dtsi head/sys/gnu/dts/arm/orion5x-lswsgl.dts head/sys/gnu/dts/arm/orion5x-maxtor-shared-storage-2.dts head/sys/gnu/dts/arm/orion5x-rd88f5182-nas.dts head/sys/gnu/dts/arm/picoxcell-pc7302-pc3x2.dts head/sys/gnu/dts/arm/picoxcell-pc7302-pc3x3.dts head/sys/gnu/dts/arm/pxa3xx.dtsi head/sys/gnu/dts/arm/qcom-apq8064-cm-qs600.dts head/sys/gnu/dts/arm/qcom-apq8064.dtsi head/sys/gnu/dts/arm/qcom-msm8974-sony-xperia-castor.dts head/sys/gnu/dts/arm/r8a7743-iwg20m.dtsi head/sys/gnu/dts/arm/r8a7743.dtsi head/sys/gnu/dts/arm/r8a7745-iwg22m.dtsi head/sys/gnu/dts/arm/r8a7745.dtsi head/sys/gnu/dts/arm/r8a7779-marzen.dts head/sys/gnu/dts/arm/r8a7790-lager.dts head/sys/gnu/dts/arm/r8a7790.dtsi head/sys/gnu/dts/arm/r8a7791-koelsch.dts head/sys/gnu/dts/arm/r8a7791-porter.dts head/sys/gnu/dts/arm/r8a7791.dtsi head/sys/gnu/dts/arm/r8a7792.dtsi head/sys/gnu/dts/arm/r8a7793-gose.dts head/sys/gnu/dts/arm/r8a7793.dtsi head/sys/gnu/dts/arm/r8a7794-alt.dts head/sys/gnu/dts/arm/r8a7794-silk.dts head/sys/gnu/dts/arm/r8a7794.dtsi head/sys/gnu/dts/arm/rk322x.dtsi head/sys/gnu/dts/arm/rk3288-phycore-rdk.dts head/sys/gnu/dts/arm/rk3288-phycore-som.dtsi head/sys/gnu/dts/arm/rk3288-rock2-som.dtsi head/sys/gnu/dts/arm/rk3288-rock2-square.dts head/sys/gnu/dts/arm/rk3288-veyron-chromebook.dtsi head/sys/gnu/dts/arm/rk3288-vyasa.dts head/sys/gnu/dts/arm/sama5d3.dtsi head/sys/gnu/dts/arm/sama5d34ek.dts head/sys/gnu/dts/arm/sama5d3_uart.dtsi head/sys/gnu/dts/arm/sama5d4.dtsi head/sys/gnu/dts/arm/socfpga.dtsi head/sys/gnu/dts/arm/socfpga_arria10_socdk_sdmmc.dts head/sys/gnu/dts/arm/socfpga_arria5.dtsi head/sys/gnu/dts/arm/socfpga_cyclone5.dtsi head/sys/gnu/dts/arm/socfpga_vt.dts head/sys/gnu/dts/arm/stih407-b2120.dts head/sys/gnu/dts/arm/stih407-clock.dtsi head/sys/gnu/dts/arm/stih407-family.dtsi head/sys/gnu/dts/arm/stih407-pinctrl.dtsi head/sys/gnu/dts/arm/stih407.dtsi head/sys/gnu/dts/arm/stih410-b2120.dts head/sys/gnu/dts/arm/stih410-b2260.dts head/sys/gnu/dts/arm/stih410-clock.dtsi head/sys/gnu/dts/arm/stih410-pinctrl.dtsi head/sys/gnu/dts/arm/stih410.dtsi head/sys/gnu/dts/arm/stih418-b2199.dts head/sys/gnu/dts/arm/stih418-clock.dtsi head/sys/gnu/dts/arm/stih418.dtsi head/sys/gnu/dts/arm/stihxxx-b2120.dtsi head/sys/gnu/dts/arm/stm32429i-eval.dts head/sys/gnu/dts/arm/stm32746g-eval.dts head/sys/gnu/dts/arm/stm32f4-pinctrl.dtsi head/sys/gnu/dts/arm/stm32f429.dtsi head/sys/gnu/dts/arm/stm32f469-disco.dts head/sys/gnu/dts/arm/stm32f746-disco.dts head/sys/gnu/dts/arm/stm32f746.dtsi head/sys/gnu/dts/arm/stm32f769-disco.dts head/sys/gnu/dts/arm/stm32h743-pinctrl.dtsi head/sys/gnu/dts/arm/stm32h743.dtsi head/sys/gnu/dts/arm/stm32h743i-disco.dts head/sys/gnu/dts/arm/stm32h743i-eval.dts head/sys/gnu/dts/arm/sun4i-a10-a1000.dts head/sys/gnu/dts/arm/sun4i-a10-ba10-tvbox.dts head/sys/gnu/dts/arm/sun4i-a10-chuwi-v7-cw0825.dts head/sys/gnu/dts/arm/sun4i-a10-cubieboard.dts head/sys/gnu/dts/arm/sun4i-a10-dserve-dsrv9703c.dts head/sys/gnu/dts/arm/sun4i-a10-gemei-g9.dts head/sys/gnu/dts/arm/sun4i-a10-hackberry.dts head/sys/gnu/dts/arm/sun4i-a10-hyundai-a7hd.dts head/sys/gnu/dts/arm/sun4i-a10-inet1.dts head/sys/gnu/dts/arm/sun4i-a10-inet97fv2.dts head/sys/gnu/dts/arm/sun4i-a10-inet9f-rev03.dts head/sys/gnu/dts/arm/sun4i-a10-itead-iteaduino-plus.dts head/sys/gnu/dts/arm/sun4i-a10-jesurun-q5.dts head/sys/gnu/dts/arm/sun4i-a10-marsboard.dts head/sys/gnu/dts/arm/sun4i-a10-mini-xplus.dts head/sys/gnu/dts/arm/sun4i-a10-mk802.dts head/sys/gnu/dts/arm/sun4i-a10-mk802ii.dts head/sys/gnu/dts/arm/sun4i-a10-olinuxino-lime.dts head/sys/gnu/dts/arm/sun4i-a10-pcduino.dts head/sys/gnu/dts/arm/sun4i-a10-pov-protab2-ips9.dts head/sys/gnu/dts/arm/sun4i-a10.dtsi head/sys/gnu/dts/arm/sun5i-a10s-auxtek-t003.dts head/sys/gnu/dts/arm/sun5i-a10s-auxtek-t004.dts head/sys/gnu/dts/arm/sun5i-a10s-mk802.dts head/sys/gnu/dts/arm/sun5i-a10s-olinuxino-micro.dts head/sys/gnu/dts/arm/sun5i-a10s-r7-tv-dongle.dts head/sys/gnu/dts/arm/sun5i-a10s-wobo-i5.dts head/sys/gnu/dts/arm/sun5i-a13-empire-electronix-d709.dts head/sys/gnu/dts/arm/sun5i-a13-hsg-h702.dts head/sys/gnu/dts/arm/sun5i-a13-olinuxino-micro.dts head/sys/gnu/dts/arm/sun5i-a13-olinuxino.dts head/sys/gnu/dts/arm/sun5i-a13.dtsi head/sys/gnu/dts/arm/sun5i-gr8-evb.dts head/sys/gnu/dts/arm/sun5i-reference-design-tablet.dtsi head/sys/gnu/dts/arm/sun6i-a31-colombus.dts head/sys/gnu/dts/arm/sun6i-a31-hummingbird.dts head/sys/gnu/dts/arm/sun6i-a31-i7.dts head/sys/gnu/dts/arm/sun6i-a31-m9.dts head/sys/gnu/dts/arm/sun6i-a31-mele-a1000g-quad.dts head/sys/gnu/dts/arm/sun6i-a31.dtsi head/sys/gnu/dts/arm/sun6i-a31s-primo81.dts head/sys/gnu/dts/arm/sun6i-a31s-sina31s.dts head/sys/gnu/dts/arm/sun6i-a31s-sinovoip-bpi-m2.dts head/sys/gnu/dts/arm/sun6i-a31s-yones-toptech-bs1078-v2.dts head/sys/gnu/dts/arm/sun6i-reference-design-tablet.dtsi head/sys/gnu/dts/arm/sun7i-a20-bananapi-m1-plus.dts head/sys/gnu/dts/arm/sun7i-a20-bananapi.dts head/sys/gnu/dts/arm/sun7i-a20-bananapro.dts head/sys/gnu/dts/arm/sun7i-a20-cubieboard2.dts head/sys/gnu/dts/arm/sun7i-a20-cubietruck.dts head/sys/gnu/dts/arm/sun7i-a20-hummingbird.dts head/sys/gnu/dts/arm/sun7i-a20-i12-tvbox.dts head/sys/gnu/dts/arm/sun7i-a20-icnova-swac.dts head/sys/gnu/dts/arm/sun7i-a20-itead-ibox.dts head/sys/gnu/dts/arm/sun7i-a20-lamobo-r1.dts head/sys/gnu/dts/arm/sun7i-a20-m3.dts head/sys/gnu/dts/arm/sun7i-a20-mk808c.dts head/sys/gnu/dts/arm/sun7i-a20-olimex-som-evb.dts head/sys/gnu/dts/arm/sun7i-a20-olinuxino-lime.dts head/sys/gnu/dts/arm/sun7i-a20-olinuxino-lime2.dts head/sys/gnu/dts/arm/sun7i-a20-olinuxino-micro.dts head/sys/gnu/dts/arm/sun7i-a20-orangepi-mini.dts head/sys/gnu/dts/arm/sun7i-a20-orangepi.dts head/sys/gnu/dts/arm/sun7i-a20-pcduino3-nano.dts head/sys/gnu/dts/arm/sun7i-a20-pcduino3.dts head/sys/gnu/dts/arm/sun7i-a20-wexler-tab7200.dts head/sys/gnu/dts/arm/sun7i-a20-wits-pro-a20-dkt.dts head/sys/gnu/dts/arm/sun7i-a20.dtsi head/sys/gnu/dts/arm/sun8i-a23-evb.dts head/sys/gnu/dts/arm/sun8i-a33-olinuxino.dts head/sys/gnu/dts/arm/sun8i-a33-sinlinx-sina33.dts head/sys/gnu/dts/arm/sun8i-a33.dtsi head/sys/gnu/dts/arm/sun8i-a83t-allwinner-h8homlet-v2.dts head/sys/gnu/dts/arm/sun8i-a83t-bananapi-m3.dts head/sys/gnu/dts/arm/sun8i-a83t-cubietruck-plus.dts head/sys/gnu/dts/arm/sun8i-a83t-tbs-a711.dts head/sys/gnu/dts/arm/sun8i-a83t.dtsi head/sys/gnu/dts/arm/sun8i-h2-plus-orangepi-r1.dts (contents, props changed) head/sys/gnu/dts/arm/sun8i-h2-plus-orangepi-zero.dts head/sys/gnu/dts/arm/sun8i-h3-bananapi-m2-plus.dts head/sys/gnu/dts/arm/sun8i-h3-beelink-x2.dts head/sys/gnu/dts/arm/sun8i-h3-libretech-all-h3-cc.dts (contents, props changed) head/sys/gnu/dts/arm/sun8i-h3-nanopi-m1-plus.dts head/sys/gnu/dts/arm/sun8i-h3-nanopi-m1.dts head/sys/gnu/dts/arm/sun8i-h3-nanopi-neo-air.dts head/sys/gnu/dts/arm/sun8i-h3-nanopi.dtsi head/sys/gnu/dts/arm/sun8i-h3-orangepi-2.dts head/sys/gnu/dts/arm/sun8i-h3-orangepi-lite.dts head/sys/gnu/dts/arm/sun8i-h3-orangepi-one.dts head/sys/gnu/dts/arm/sun8i-h3-orangepi-pc-plus.dts head/sys/gnu/dts/arm/sun8i-h3-orangepi-pc.dts head/sys/gnu/dts/arm/sun8i-h3.dtsi head/sys/gnu/dts/arm/sun8i-r16-bananapi-m2m.dts head/sys/gnu/dts/arm/sun8i-r40-bananapi-m2-ultra.dts head/sys/gnu/dts/arm/sun8i-reference-design-tablet.dtsi head/sys/gnu/dts/arm/sun8i-v3s-licheepi-zero-dock.dts head/sys/gnu/dts/arm/sun8i-v40-bananapi-m2-berry.dts head/sys/gnu/dts/arm/sun9i-a80-cubieboard4.dts head/sys/gnu/dts/arm/sun9i-a80-optimus.dts head/sys/gnu/dts/arm/sun9i-a80.dtsi head/sys/gnu/dts/arm/sunxi-h3-h5.dtsi head/sys/gnu/dts/arm/tegra114-dalmore.dts head/sys/gnu/dts/arm/tegra124-apalis-eval.dts head/sys/gnu/dts/arm/tegra124-apalis.dtsi head/sys/gnu/dts/arm/tegra124-jetson-tk1.dts head/sys/gnu/dts/arm/tegra124-venice2.dts head/sys/gnu/dts/arm/tegra20-colibri-512.dtsi head/sys/gnu/dts/arm/tegra20.dtsi head/sys/gnu/dts/arm/tegra30-apalis-eval.dts head/sys/gnu/dts/arm/tegra30-apalis.dtsi head/sys/gnu/dts/arm/tegra30-beaver.dts head/sys/gnu/dts/arm/tegra30-colibri-eval-v3.dts head/sys/gnu/dts/arm/tegra30-colibri.dtsi head/sys/gnu/dts/arm/tegra30.dtsi head/sys/gnu/dts/arm/uniphier-ld4-ref.dts head/sys/gnu/dts/arm/uniphier-ld4.dtsi head/sys/gnu/dts/arm/uniphier-ld6b-ref.dts head/sys/gnu/dts/arm/uniphier-ld6b.dtsi head/sys/gnu/dts/arm/uniphier-pinctrl.dtsi head/sys/gnu/dts/arm/uniphier-pro4-ace.dts head/sys/gnu/dts/arm/uniphier-pro4-ref.dts head/sys/gnu/dts/arm/uniphier-pro4-sanji.dts head/sys/gnu/dts/arm/uniphier-pro4.dtsi head/sys/gnu/dts/arm/uniphier-pro5.dtsi head/sys/gnu/dts/arm/uniphier-pxs2-gentil.dts head/sys/gnu/dts/arm/uniphier-pxs2-vodka.dts head/sys/gnu/dts/arm/uniphier-pxs2.dtsi head/sys/gnu/dts/arm/uniphier-ref-daughter.dtsi head/sys/gnu/dts/arm/uniphier-sld8-ref.dts head/sys/gnu/dts/arm/uniphier-sld8.dtsi head/sys/gnu/dts/arm/uniphier-support-card.dtsi head/sys/gnu/dts/arm/versatile-ab.dts head/sys/gnu/dts/arm/vf500-colibri.dtsi head/sys/gnu/dts/arm/vf500.dtsi head/sys/gnu/dts/arm/vf610-colibri.dtsi head/sys/gnu/dts/arm/vf610-cosmic.dts head/sys/gnu/dts/arm/vf610-twr.dts head/sys/gnu/dts/arm/vf610-zii-dev.dtsi head/sys/gnu/dts/arm/vf610m4-colibri.dts head/sys/gnu/dts/arm/vf610m4.dtsi head/sys/gnu/dts/arm/zynq-7000.dtsi head/sys/gnu/dts/arm/zynq-microzed.dts head/sys/gnu/dts/arm/zynq-parallella.dts head/sys/gnu/dts/arm/zynq-zc702.dts head/sys/gnu/dts/arm/zynq-zc706.dts head/sys/gnu/dts/arm/zynq-zed.dts head/sys/gnu/dts/arm/zynq-zybo.dts head/sys/gnu/dts/include/dt-bindings/clock/axg-clkc.h head/sys/gnu/dts/include/dt-bindings/clock/histb-clock.h head/sys/gnu/dts/include/dt-bindings/clock/imx7d-clock.h head/sys/gnu/dts/include/dt-bindings/clock/mt2701-clk.h head/sys/gnu/dts/include/dt-bindings/clock/mt2712-clk.h head/sys/gnu/dts/include/dt-bindings/clock/mt7622-clk.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,rpmcc.h head/sys/gnu/dts/include/dt-bindings/clock/rk3328-cru.h head/sys/gnu/dts/include/dt-bindings/clock/sprd,sc9860-clk.h head/sys/gnu/dts/include/dt-bindings/clock/stm32fx-clock.h head/sys/gnu/dts/include/dt-bindings/clock/sun8i-h3-ccu.h head/sys/gnu/dts/include/dt-bindings/clock/tegra210-car.h head/sys/gnu/dts/include/dt-bindings/gpio/meson8b-gpio.h head/sys/gnu/dts/include/dt-bindings/mfd/stm32f7-rcc.h head/sys/gnu/dts/include/dt-bindings/net/ti-dp83867.h head/sys/gnu/dts/include/dt-bindings/pinctrl/mt7623-pinfunc.h head/sys/gnu/dts/include/dt-bindings/power/mt2712-power.h Directory Properties: head/sys/gnu/dts/arm/ (props changed) head/sys/gnu/dts/arm/am572x-idk-common.dtsi (props changed) head/sys/gnu/dts/arm/am574x-idk.dts (props changed) head/sys/gnu/dts/arm/aspeed-bmc-quanta-q71l.dts (props changed) head/sys/gnu/dts/arm/at91-natte.dtsi (props changed) head/sys/gnu/dts/arm/imx6dl-cubox-i-emmc-som-v15.dts (props changed) head/sys/gnu/dts/arm/imx6dl-cubox-i-som-v15.dts (props changed) head/sys/gnu/dts/arm/imx6dl-hummingboard-emmc-som-v15.dts (props changed) head/sys/gnu/dts/arm/imx6dl-hummingboard-som-v15.dts (props changed) head/sys/gnu/dts/arm/imx6dl-hummingboard2-emmc-som-v15.dts (props changed) head/sys/gnu/dts/arm/imx6dl-hummingboard2-som-v15.dts (props changed) head/sys/gnu/dts/arm/imx6dl-hummingboard2.dts (props changed) head/sys/gnu/dts/arm/imx6q-cubox-i-emmc-som-v15.dts (props changed) head/sys/gnu/dts/arm/imx6q-cubox-i-som-v15.dts (props changed) head/sys/gnu/dts/arm/imx6q-hummingboard-emmc-som-v15.dts (props changed) head/sys/gnu/dts/arm/imx6q-hummingboard-som-v15.dts (props changed) head/sys/gnu/dts/arm/imx6q-hummingboard2-emmc-som-v15.dts (props changed) head/sys/gnu/dts/arm/imx6q-hummingboard2-som-v15.dts (props changed) head/sys/gnu/dts/arm/imx6q-hummingboard2.dts (props changed) head/sys/gnu/dts/arm/imx6q-var-dt6customboard.dts (props changed) head/sys/gnu/dts/arm/imx6qdl-hummingboard2-emmc.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-sr-som-brcm.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-sr-som-emmc.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-sr-som-ti.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-sr-som.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-ts7970.dtsi (props changed) head/sys/gnu/dts/arm/imx7d-colibri-emmc-eval-v3.dts (props changed) head/sys/gnu/dts/arm/imx7d-pico-pi.dts (props changed) head/sys/gnu/dts/arm/logicpd-som-lv-35xx-devkit.dts (props changed) head/sys/gnu/dts/arm/logicpd-som-lv-baseboard.dtsi (props changed) head/sys/gnu/dts/arm/logicpd-torpedo-35xx-devkit.dts (props changed) head/sys/gnu/dts/arm/logicpd-torpedo-baseboard.dtsi (props changed) head/sys/gnu/dts/arm/ls1021a-moxa-uc-8410a.dts (props changed) head/sys/gnu/dts/arm/openbmc-flash-layout.dtsi (props changed) head/sys/gnu/dts/arm/owl-s500-sparky.dts (props changed) head/sys/gnu/dts/arm/ox810se-wd-mbwe.dts (props changed) head/sys/gnu/dts/arm/ox820-cloudengines-pogoplug-series-3.dts (props changed) head/sys/gnu/dts/arm/r8a7745-iwg22d-sodimm-dbhd-ca.dts (props changed) head/sys/gnu/dts/include/ (props changed) Modified: head/sys/gnu/dts/arm/am335x-boneblue.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-boneblue.dts Thu Jun 14 07:09:50 2018 (r335120) +++ head/sys/gnu/dts/arm/am335x-boneblue.dts Thu Jun 14 07:12:10 2018 (r335121) @@ -342,7 +342,7 @@ }; baseboard_eeprom: baseboard_eeprom@50 { - compatible = "at,24c256"; + compatible = "atmel,24c256"; reg = <0x50>; #address-cells = <1>; Copied: head/sys/gnu/dts/arm/am335x-pdu001.dts (from r335118, vendor/device-tree/dist/src/arm/am335x-pdu001.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/dts/arm/am335x-pdu001.dts Thu Jun 14 07:12:10 2018 (r335121, copy of r335118, vendor/device-tree/dist/src/arm/am335x-pdu001.dts) @@ -0,0 +1,595 @@ +/* + * pdu001.dts + * + * EETS GmbH PDU001 board device tree file + * + * Copyright (C) 2018 EETS GmbH - http://www.eets.ch/ + * + * Copyright (C) 2011, Texas Instruments, Incorporated - http://www.ti.com/ + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/dts-v1/; + +#include "am33xx.dtsi" +#include +#include + +/ { + model = "EETS,PDU001"; + compatible = "ti,am33xx"; + + chosen { + stdout-path = &uart3; + }; + + cpus { + cpu@0 { + cpu0-supply = <&vdd1_reg>; + }; + }; + + memory { + device_type = "memory"; + reg = <0x80000000 0x10000000>; /* 256 MB */ + }; + + vbat: fixedregulator@0 { + compatible = "regulator-fixed"; + regulator-name = "vbat"; + regulator-min-microvolt = <3600000>; + regulator-max-microvolt = <3600000>; + regulator-boot-on; + }; + + lis3_reg: fixedregulator@1 { + compatible = "regulator-fixed"; + regulator-name = "lis3_reg"; + regulator-boot-on; + }; + + panel { + compatible = "ti,tilcdc,panel"; + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&lcd_pins_s0>; + panel-info { + ac-bias = <255>; + ac-bias-intrpt = <0>; + dma-burst-sz = <16>; + bpp = <16>; + fdd = <0x80>; + sync-edge = <0>; + sync-ctrl = <1>; + raster-order = <0>; + fifo-th = <0>; + }; + + display-timings { + 240x320p16 { + clock-frequency = <6500000>; + hactive = <240>; + vactive = <320>; + hfront-porch = <6>; + hback-porch = <6>; + hsync-len = <1>; + vback-porch = <6>; + vfront-porch = <6>; + vsync-len = <1>; + hsync-active = <0>; + vsync-active = <0>; + pixelclk-active = <1>; + de-active = <0>; + }; + }; + }; +}; + +&am33xx_pinmux { + pinctrl-names = "default"; + pinctrl-0 = <&clkout2_pin>; + + i2c0_pins: pinmux_i2c0_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x988, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c0_sda.i2c0_sda */ + AM33XX_IOPAD(0x98c, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c0_scl.i2c0_scl */ + >; + }; + + i2c1_pins: pinmux_i2c1_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x958, PIN_INPUT_PULLUP | MUX_MODE2) /* spi0_d1.i2c1_sda */ + AM33XX_IOPAD(0x95c, PIN_INPUT_PULLUP | MUX_MODE2) /* spi0_cs0.i2c1_scl */ + >; + }; + + i2c2_pins: pinmux_i2c2_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x950, PIN_INPUT_PULLUP | MUX_MODE2) /* spi0_clk.i2c2_sda */ + AM33XX_IOPAD(0x954, PIN_INPUT_PULLUP | MUX_MODE2) /* spi0_d0.i2c2_scl */ + >; + }; + + spi1_pins: pinmux_spi1_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x990, PIN_OUTPUT | MUX_MODE3) /* mcasp0_aclkx.spi1_sclk */ + AM33XX_IOPAD(0x994, PIN_OUTPUT | MUX_MODE3) /* mcasp0_fsx.spi1_d0 */ + AM33XX_IOPAD(0x998, PIN_INPUT_PULLDOWN | MUX_MODE3) /* mcasp0_axr0.spi1_d1 */ + AM33XX_IOPAD(0x99C, PIN_OUTPUT | MUX_MODE3) /* mcasp0_ahclkr.spi1_cs0 */ + >; + }; + + uart0_pins: pinmux_uart0_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x96C, PIN_OUTPUT | MUX_MODE7) /* uart0_rtsn.gpio1_9 */ + AM33XX_IOPAD(0x970, PIN_INPUT_PULLUP | MUX_MODE0) /* uart0_rxd.uart0_rxd */ + AM33XX_IOPAD(0x974, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart0_txd.uart0_txd */ + >; + }; + + uart1_pins: pinmux_uart1_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x980, PIN_INPUT_PULLUP | MUX_MODE0) /* uart1_rxd.uart1_rxd */ + AM33XX_IOPAD(0x984, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart1_txd.uart1_txd */ + >; + }; + + uart3_pins: pinmux_uart3_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x960, PIN_INPUT_PULLUP | MUX_MODE1) /* spi0_cs1.uart3_rxd */ + AM33XX_IOPAD(0x964, PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* ecap0_in_pwm0_out.uart3_txd */ + >; + }; + + clkout2_pin: pinmux_clkout2_pin { + pinctrl-single,pins = < + AM33XX_IOPAD(0x9b4, PIN_OUTPUT_PULLDOWN | MUX_MODE3) /* xdma_event_intr1.clkout2 */ + >; + }; + + cpsw_default: cpsw_default { + pinctrl-single,pins = < + /* Port 1 (emac0) */ + AM33XX_IOPAD(0x908, PIN_INPUT | MUX_MODE0) /* mii1_col.mii1_col */ + AM33XX_IOPAD(0x90C, PIN_INPUT | MUX_MODE0) /* mii1_crs.mii1_crs */ + AM33XX_IOPAD(0x910, PIN_INPUT | MUX_MODE0) /* mii1_rxer.mii1_rxer */ + AM33XX_IOPAD(0x914, PIN_OUTPUT | MUX_MODE0) /* mii1_txen.mii1_txen */ + AM33XX_IOPAD(0x918, PIN_INPUT | MUX_MODE0) /* mii1_rxdv.mii1_rxdv */ + AM33XX_IOPAD(0x91c, PIN_OUTPUT | MUX_MODE0) /* mii1_txd3.mii1_txd3 */ + AM33XX_IOPAD(0x920, PIN_OUTPUT | MUX_MODE0) /* mii1_txd2.mii1_txd2 */ + AM33XX_IOPAD(0x924, PIN_OUTPUT | MUX_MODE0) /* mii1_txd1.mii1_txd1 */ + AM33XX_IOPAD(0x928, PIN_OUTPUT | MUX_MODE0) /* mii1_txd0.mii1_txd0 */ + AM33XX_IOPAD(0x92c, PIN_INPUT | MUX_MODE0) /* mii1_txclk.mii1_txclk */ + AM33XX_IOPAD(0x930, PIN_INPUT | MUX_MODE0) /* mii1_rxclk.mii1_rxclk */ + AM33XX_IOPAD(0x934, PIN_INPUT | MUX_MODE0) /* mii1_rxd3.mii1_rxd3 */ + AM33XX_IOPAD(0x938, PIN_INPUT | MUX_MODE0) /* mii1_rxd2.mii1_rxd2 */ + AM33XX_IOPAD(0x93c, PIN_INPUT | MUX_MODE0) /* mii1_rxd1.mii1_rxd1 */ + AM33XX_IOPAD(0x940, PIN_INPUT | MUX_MODE0) /* mii1_rxd0.mii1_rxd0 */ + + /* Port 2 (emac1) */ + AM33XX_IOPAD(0x840, PIN_OUTPUT | MUX_MODE1) /* mii2_txen.gpmc_a0 */ + AM33XX_IOPAD(0x844, PIN_INPUT | MUX_MODE1) /* mii2_rxdv.gpmc_a1 */ + AM33XX_IOPAD(0x848, PIN_OUTPUT | MUX_MODE1) /* mii2_txd3.gpmc_a2 */ + AM33XX_IOPAD(0x84c, PIN_OUTPUT | MUX_MODE1) /* mii2_txd2.gpmc_a3 */ + AM33XX_IOPAD(0x850, PIN_OUTPUT | MUX_MODE1) /* mii2_txd1.gpmc_a4 */ + AM33XX_IOPAD(0x854, PIN_OUTPUT | MUX_MODE1) /* mii2_txd0.gpmc_a5 */ + AM33XX_IOPAD(0x858, PIN_INPUT | MUX_MODE1) /* mii2_txclk.gpmc_a6 */ + AM33XX_IOPAD(0x85c, PIN_INPUT | MUX_MODE1) /* mii2_rxclk.gpmc_a7 */ + AM33XX_IOPAD(0x860, PIN_INPUT | MUX_MODE1) /* mii2_rxd3.gpmc_a8 */ + AM33XX_IOPAD(0x864, PIN_INPUT | MUX_MODE1) /* mii2_rxd2.gpmc_a9 */ + AM33XX_IOPAD(0x868, PIN_INPUT | MUX_MODE1) /* mii2_rxd1.gpmc_a10 */ + AM33XX_IOPAD(0x86C, PIN_INPUT | MUX_MODE1) /* mii2_rxd0.gpmc_a11 */ + AM33XX_IOPAD(0x870, PIN_INPUT | MUX_MODE1) /* mii2_crs.gpmc_wait0 */ + AM33XX_IOPAD(0x874, PIN_INPUT | MUX_MODE1) /* mii2_rxer.gpmc_wpn */ + AM33XX_IOPAD(0x878, PIN_INPUT | MUX_MODE1) /* mii2_col.gpmc_ben1 */ + >; + }; + + davinci_mdio_default: davinci_mdio_default { + pinctrl-single,pins = < + AM33XX_IOPAD(0x948, PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0) /* mdio_data.mdio_data */ + AM33XX_IOPAD(0x94c, PIN_OUTPUT_PULLUP | MUX_MODE0) /* mdio_clk.mdio_clk */ + >; + }; + + mmc1_pins: pinmux_mmc1_pins { + /* eMMC */ + pinctrl-single,pins = < + AM33XX_IOPAD(0x8f0, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat3 */ + AM33XX_IOPAD(0x8f4, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat2 */ + AM33XX_IOPAD(0x8f8, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat1 */ + AM33XX_IOPAD(0x8fc, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat0 */ + AM33XX_IOPAD(0x900, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_clk */ + AM33XX_IOPAD(0x904, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_cmd */ + >; + }; + + mmc2_pins: pinmux_mmc2_pins { + /* SD cardcage */ + pinctrl-single,pins = < + AM33XX_IOPAD(0x80c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad3.mmc1_dat3 */ + AM33XX_IOPAD(0x808, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad2.mmc1_dat2 */ + AM33XX_IOPAD(0x804, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad1.mmc1_dat1 */ + AM33XX_IOPAD(0x800, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad0.mmc1_dat0 */ + AM33XX_IOPAD(0x880, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn1.mmc1_clk */ + AM33XX_IOPAD(0x884, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn2.mmc1_cmd */ + /* card change signal for frontpanel SD cardcage */ + AM33XX_IOPAD(0x890, PIN_INPUT | MUX_MODE7) /* gpmc_advn_ale.gpio2_2 */ + >; + }; + + lcd_pins_s0: lcd_pins_s0 { + pinctrl-single,pins = < + AM33XX_IOPAD(0x8a0, PIN_OUTPUT | MUX_MODE0) /* lcd_data0.lcd_data0 */ + AM33XX_IOPAD(0x8a4, PIN_OUTPUT | MUX_MODE0) /* lcd_data1.lcd_data1 */ + AM33XX_IOPAD(0x8a8, PIN_OUTPUT | MUX_MODE0) /* lcd_data2.lcd_data2 */ + AM33XX_IOPAD(0x8ac, PIN_OUTPUT | MUX_MODE0) /* lcd_data3.lcd_data3 */ + AM33XX_IOPAD(0x8b0, PIN_OUTPUT | MUX_MODE0) /* lcd_data4.lcd_data4 */ + AM33XX_IOPAD(0x8b4, PIN_OUTPUT | MUX_MODE0) /* lcd_data5.lcd_data5 */ + AM33XX_IOPAD(0x8b8, PIN_OUTPUT | MUX_MODE0) /* lcd_data6.lcd_data6 */ + AM33XX_IOPAD(0x8bc, PIN_OUTPUT | MUX_MODE0) /* lcd_data7.lcd_data7 */ + AM33XX_IOPAD(0x8c0, PIN_OUTPUT | MUX_MODE0) /* lcd_data8.lcd_data8 */ + AM33XX_IOPAD(0x8c4, PIN_OUTPUT | MUX_MODE0) /* lcd_data9.lcd_data9 */ + AM33XX_IOPAD(0x8c8, PIN_OUTPUT | MUX_MODE0) /* lcd_data10.lcd_data10 */ + AM33XX_IOPAD(0x8cc, PIN_OUTPUT | MUX_MODE0) /* lcd_data11.lcd_data11 */ + AM33XX_IOPAD(0x8d0, PIN_OUTPUT | MUX_MODE0) /* lcd_data12.lcd_data12 */ + AM33XX_IOPAD(0x8d4, PIN_OUTPUT | MUX_MODE0) /* lcd_data13.lcd_data13 */ + AM33XX_IOPAD(0x8d8, PIN_OUTPUT | MUX_MODE0) /* lcd_data14.lcd_data14 */ + AM33XX_IOPAD(0x8dc, PIN_OUTPUT | MUX_MODE0) /* lcd_data15.lcd_data15 */ + AM33XX_IOPAD(0x8e0, PIN_OUTPUT | MUX_MODE0) /* lcd_vsync.lcd_vsync */ + AM33XX_IOPAD(0x8e4, PIN_OUTPUT | MUX_MODE0) /* lcd_hsync.lcd_hsync */ + AM33XX_IOPAD(0x8e8, PIN_OUTPUT | MUX_MODE0) /* lcd_pclk.lcd_pclk */ + AM33XX_IOPAD(0x8ec, PIN_OUTPUT | MUX_MODE0) /* lcd_ac_bias_en.lcd_ac_bias_en */ + >; + }; + + dcan0_pins: pinmux_dcan0_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x978, PIN_OUTPUT | MUX_MODE2) /* uart1_ctsn.d_can0_tx */ + AM33XX_IOPAD(0x97c, PIN_INPUT_PULLDOWN | MUX_MODE2) /* uart1_rtsn.d_can0_rx */ + >; + }; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins>; + + rts-gpio = <&gpio1 9 GPIO_ACTIVE_HIGH>; + rs485-rts-active-high; + rs485-rts-delay = <0 0>; + linux,rs485-enabled-at-boot-time; + + status = "okay"; +}; + +&uart1 { + pinctrl-names = "default"; + pinctrl-0 = <&uart1_pins>; + + status = "okay"; +}; + +&uart3 { + pinctrl-names = "default"; + pinctrl-0 = <&uart3_pins>; + + status = "okay"; +}; + +&i2c0 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c0_pins>; + + status = "okay"; + clock-frequency = <400000>; + + tps: tps@2d { + reg = <0x2d>; + }; + + m2_eeprom: m2_eeprom@50 { + compatible = "atmel,24c256"; + reg = <0x50>; + status = "okay"; + }; +}; + +&i2c1 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c1_pins>; + + status = "okay"; + clock-frequency = <100000>; + + board_24aa025e48: board_24aa025e48@50 { + compatible = "atmel,24c02"; + reg = <0x50>; + }; + + backplane_24aa025e48: backplane_24aa025e48@53 { + compatible = "atmel,24c02"; + reg = <0x53>; + }; + + pca9532: pca9532@60 { + compatible = "nxp,pca9532"; + reg = <0x60>; + psc0 = <0x97>; + pwm0 = <0x80>; + psc1 = <0x97>; + pwm1 = <0x10>; + + run.red@0 { + type = ; + }; + run.green@1 { + type = ; + default-state = "on"; + }; + s2.red@2 { + type = ; + }; + s2.green@3 { + type = ; + }; + s1.yellow@4 { + type = ; + }; + s1.green@5 { + type = ; + }; + }; + + pca9530: pca9530@61 { + compatible = "nxp,pca9530"; + reg = <0x61>; + + tft-panel@0 { + type = ; + linux,default-trigger = "backlight"; + default-state = "on"; + }; + }; + + mcp79400: mcp79400@6f { + compatible = "microchip,mcp7940x"; + reg = <0x6f>; + }; +}; + +&i2c2 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c2_pins>; + + status = "okay"; + clock-frequency = <100000>; +}; + +&spi1 { + pinctrl-names = "default"; + pinctrl-0 = <&spi1_pins>; + ti,pindir-d0-out-d1-in; + status = "okay"; + + cfaf240320a032t { + compatible = "orisetech,otm3225a"; + reg = <0>; + spi-max-frequency = <1000000>; + // SPI mode 3 + spi-cpol; + spi-cpha; + status = "okay"; + }; +}; + +&usb { + status = "okay"; +}; + +&usb_ctrl_mod { + status = "okay"; +}; + +&usb0_phy { + status = "okay"; +}; + +&usb1_phy { + status = "okay"; +}; + +&usb0 { + status = "okay"; +}; + +&usb1 { + status = "okay"; +}; + +&cppi41dma { + status = "okay"; +}; + +/* + * Disable soc's rtc as we have no VBAT for it. This makes the board + * rtc (Microchip MCP79400) the default rtc device 'rtc0'. + */ +&rtc { + status = "disabled"; +}; + +&lcdc { + status = "okay"; +}; + +&elm { + status = "okay"; +}; + +#include "tps65910.dtsi" + +&tps { + vcc1-supply = <&vbat>; + vcc2-supply = <&vbat>; + vcc3-supply = <&vbat>; + vcc4-supply = <&vbat>; + vcc5-supply = <&vbat>; + vcc6-supply = <&vbat>; + vcc7-supply = <&vbat>; + vccio-supply = <&vbat>; + + regulators { + vrtc_reg: regulator@0 { + regulator-name = "ldo_vrtc"; + regulator-always-on; + }; + + vio_reg: regulator@1 { + regulator-name = "buck_vdd_ddr"; + regulator-always-on; + }; + + vdd1_reg: regulator@2 { + /* VDD_MPU voltage limits */ + regulator-name = "buck_vdd_mpu"; + regulator-min-microvolt = <912500>; + regulator-max-microvolt = <1312500>; + regulator-boot-on; + regulator-always-on; + }; + + vdd2_reg: regulator@3 { + /* VDD_CORE voltage limits */ + regulator-name = "buck_vdd_core"; + regulator-min-microvolt = <912500>; + regulator-max-microvolt = <1150000>; + regulator-boot-on; + regulator-always-on; + }; + + vdd3_reg: regulator@4 { + regulator-name = "boost_res"; + regulator-always-on; + }; + + vdig1_reg: regulator@5 { + regulator-name = "ldo_vdig1"; + regulator-always-on; + }; + + vdig2_reg: regulator@6 { + regulator-name = "ldo_vdig2"; + regulator-always-on; + }; + + vpll_reg: regulator@7 { + regulator-name = "ldo_vpll"; + regulator-always-on; + }; + + vdac_reg: regulator@8 { + regulator-name = "ldo_vdac"; + regulator-always-on; + }; + + vaux1_reg: regulator@9 { + regulator-name = "ldo_vaux1"; + regulator-always-on; + }; + + vaux2_reg: regulator@10 { + regulator-name = "ldo_vaux2"; + regulator-always-on; + }; + + vaux33_reg: regulator@11 { + regulator-name = "ldo_vaux33"; + regulator-always-on; + }; + + vmmc_reg: regulator@12 { + regulator-name = "ldo_vmmc"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; + + vbb_reg: regulator@13 { + regulator-name = "bat_vbb"; + }; + }; +}; + +&mac { + pinctrl-names = "default"; + pinctrl-0 = <&cpsw_default>; + dual_emac; /* no switch, two distinct MACs */ + status = "okay"; +}; + +&davinci_mdio { + pinctrl-names = "default"; + pinctrl-0 = <&davinci_mdio_default>; + status = "okay"; +}; + +&cpsw_emac0 { + phy_id = <&davinci_mdio>, <0>; + phy-mode = "mii"; + dual_emac_res_vlan = <1>; +}; + +&cpsw_emac1 { + phy_id = <&davinci_mdio>, <1>; + phy-mode = "mii"; + dual_emac_res_vlan = <2>; +}; + +&tscadc { + status = "okay"; + tsc { + ti,wires = <4>; + ti,x-plate-resistance = <200>; + ti,coordinate-readouts = <5>; + ti,wire-config = <0x01 0x10 0x22 0x33>; + ti,charge-delay = <0x400>; + }; + + adc { + ti,adc-channels = <4 5 6 7>; + }; +}; + +&mmc1 { + status = "okay"; + vmmc-supply = <&vmmc_reg>; + bus-width = <4>; + pinctrl-names = "default"; + pinctrl-0 = <&mmc1_pins>; + non-removable; +}; + +&mmc2 { + status = "okay"; + vmmc-supply = <&vmmc_reg>; + bus-width = <4>; + pinctrl-names = "default"; + pinctrl-0 = <&mmc2_pins>; + cd-gpios = <&gpio2 2 GPIO_ACTIVE_LOW>; +}; + +&sham { + status = "okay"; +}; + +&aes { + status = "okay"; +}; + +&dcan0 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&dcan0_pins>; +}; Modified: head/sys/gnu/dts/arm/am33xx.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am33xx.dtsi Thu Jun 14 07:09:50 2018 (r335120) +++ head/sys/gnu/dts/arm/am33xx.dtsi Thu Jun 14 07:12:10 2018 (r335121) @@ -147,6 +147,8 @@ mpu { compatible = "ti,omap3-mpu"; ti,hwmods = "mpu"; + pm-sram = <&pm_sram_code + &pm_sram_data>; }; }; @@ -905,6 +907,21 @@ ocmcram: ocmcram@40300000 { compatible = "mmio-sram"; reg = <0x40300000 0x10000>; /* 64k */ + ranges = <0x0 0x40300000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; + + pm_sram_code: pm-sram-code@0 { + compatible = "ti,sram"; + reg = <0x0 0x1000>; + protect-exec; + }; + + pm_sram_data: pm-sram-data@1000 { + compatible = "ti,sram"; + reg = <0x1000 0x1000>; + pool; + }; }; elm: elm@48080000 { @@ -945,6 +962,10 @@ compatible = "ti,emif-am3352"; reg = <0x4c000000 0x1000000>; ti,hwmods = "emif"; + interrupts = <101>; + sram = <&pm_sram_code + &pm_sram_data>; + ti,no-idle; }; gpmc: gpmc@50000000 { Modified: head/sys/gnu/dts/arm/am4372.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am4372.dtsi Thu Jun 14 07:09:50 2018 (r335120) +++ head/sys/gnu/dts/arm/am4372.dtsi Thu Jun 14 07:12:10 2018 (r335121) @@ -92,6 +92,16 @@ }; }; + soc { + compatible = "ti,omap-infra"; + mpu { + compatible = "ti,omap4-mpu"; + ti,hwmods = "mpu"; + pm-sram = <&pm_sram_code + &pm_sram_data>; + }; + }; + gic: interrupt-controller@48241000 { compatible = "arm,cortex-a9-gic"; interrupt-controller; @@ -143,6 +153,7 @@ #size-cells = <1>; ranges; ti,hwmods = "l3_main"; + ti,no-idle; reg = <0x44000000 0x400000 0x44800000 0x400000>; interrupts = , @@ -237,6 +248,10 @@ compatible = "ti,emif-am4372"; reg = <0x4c000000 0x1000000>; ti,hwmods = "emif"; + interrupts = ; + ti,no-idle; + sram = <&pm_sram_code + &pm_sram_data>; }; edma: edma@49000000 { @@ -1141,6 +1156,21 @@ ocmcram: ocmcram@40300000 { compatible = "mmio-sram"; reg = <0x40300000 0x40000>; /* 256k */ + ranges = <0x0 0x40300000 0x40000>; + #address-cells = <1>; + #size-cells = <1>; + + pm_sram_code: pm-sram-code@0 { + compatible = "ti,sram"; + reg = <0x0 0x1000>; + protect-exec; + }; + + pm_sram_data: pm-sram-data@1000 { + compatible = "ti,sram"; + reg = <0x1000 0x1000>; + pool; + }; }; dcan0: can@481cc000 { Modified: head/sys/gnu/dts/arm/am437x-gp-evm.dts ============================================================================== --- head/sys/gnu/dts/arm/am437x-gp-evm.dts Thu Jun 14 07:09:50 2018 (r335120) +++ head/sys/gnu/dts/arm/am437x-gp-evm.dts Thu Jun 14 07:12:10 2018 (r335121) @@ -805,7 +805,7 @@ }; &usb1 { - dr_mode = "peripheral"; + dr_mode = "otg"; status = "okay"; }; Modified: head/sys/gnu/dts/arm/am437x-sk-evm.dts ============================================================================== --- head/sys/gnu/dts/arm/am437x-sk-evm.dts Thu Jun 14 07:09:50 2018 (r335120) +++ head/sys/gnu/dts/arm/am437x-sk-evm.dts Thu Jun 14 07:12:10 2018 (r335121) @@ -600,7 +600,7 @@ }; &usb1 { - dr_mode = "peripheral"; + dr_mode = "otg"; status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&usb1_pins>; Modified: head/sys/gnu/dts/arm/am43x-epos-evm.dts ============================================================================== --- head/sys/gnu/dts/arm/am43x-epos-evm.dts Thu Jun 14 07:09:50 2018 (r335120) +++ head/sys/gnu/dts/arm/am43x-epos-evm.dts Thu Jun 14 07:12:10 2018 (r335121) @@ -856,7 +856,7 @@ }; &usb1 { - dr_mode = "peripheral"; + dr_mode = "otg"; status = "okay"; }; Modified: head/sys/gnu/dts/arm/am571x-idk.dts ============================================================================== --- head/sys/gnu/dts/arm/am571x-idk.dts Thu Jun 14 07:09:50 2018 (r335120) +++ head/sys/gnu/dts/arm/am571x-idk.dts Thu Jun 14 07:12:10 2018 (r335121) @@ -10,8 +10,8 @@ #include "dra72x.dtsi" #include #include -#include "am57xx-idk-common.dtsi" #include "dra72x-mmc-iodelay.dtsi" +#include "am57xx-idk-common.dtsi" / { model = "TI AM5718 IDK"; Modified: head/sys/gnu/dts/arm/am572x-idk.dts ============================================================================== --- head/sys/gnu/dts/arm/am572x-idk.dts Thu Jun 14 07:09:50 2018 (r335120) +++ head/sys/gnu/dts/arm/am572x-idk.dts Thu Jun 14 07:12:10 2018 (r335121) @@ -9,9 +9,8 @@ /dts-v1/; #include "dra74x.dtsi" -#include "am572x-idk-common.dtsi" -#include "am57xx-idk-common.dtsi" #include "dra74x-mmc-iodelay.dtsi" +#include "am572x-idk-common.dtsi" / { model = "TI AM5728 IDK"; Modified: head/sys/gnu/dts/arm/am57xx-beagle-x15-common.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am57xx-beagle-x15-common.dtsi Thu Jun 14 07:09:50 2018 (r335120) +++ head/sys/gnu/dts/arm/am57xx-beagle-x15-common.dtsi Thu Jun 14 07:12:10 2018 (r335121) @@ -442,6 +442,7 @@ pinctrl-0 = <&mmc2_pins_default>; vmmc-supply = <&vdd_3v3>; + vqmmc-supply = <&vdd_3v3>; bus-width = <8>; ti,non-removable; cap-mmc-dual-data-rate; Modified: head/sys/gnu/dts/arm/am57xx-idk-common.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am57xx-idk-common.dtsi Thu Jun 14 07:09:50 2018 (r335120) +++ head/sys/gnu/dts/arm/am57xx-idk-common.dtsi Thu Jun 14 07:12:10 2018 (r335121) @@ -115,6 +115,17 @@ DRA7XX_CORE_IOPAD(0x37d4, MUX_MODE15 | PULL_UP) /* dcan1_rx.off */ >; }; + + mmc1_pins_default: mmc1_pins_default { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x3754, PIN_INPUT_PULLDOWN | MUX_MODE0) /* mmc1_clk.clk */ + DRA7XX_CORE_IOPAD(0x3758, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_cmd.cmd */ + DRA7XX_CORE_IOPAD(0x375c, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat0.dat0 */ + DRA7XX_CORE_IOPAD(0x3760, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat1.dat1 */ + DRA7XX_CORE_IOPAD(0x3764, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat2.dat2 */ + DRA7XX_CORE_IOPAD(0x3768, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat3.dat3 */ + >; + }; }; &i2c1 { @@ -410,6 +421,7 @@ &mmc2 { status = "okay"; vmmc-supply = <&v3_3d>; + vqmmc-supply = <&v3_3d>; bus-width = <8>; ti,non-removable; max-frequency = <96000000>; Modified: head/sys/gnu/dts/arm/animeo_ip.dts ============================================================================== --- head/sys/gnu/dts/arm/animeo_ip.dts Thu Jun 14 07:09:50 2018 (r335120) +++ head/sys/gnu/dts/arm/animeo_ip.dts Thu Jun 14 07:12:10 2018 (r335121) @@ -24,7 +24,7 @@ }; chosen { - linux,stdout-path = &usart2; + stdout-path = &usart2; }; memory { Modified: head/sys/gnu/dts/arm/arm-realview-eb.dtsi ============================================================================== --- head/sys/gnu/dts/arm/arm-realview-eb.dtsi Thu Jun 14 07:09:50 2018 (r335120) +++ head/sys/gnu/dts/arm/arm-realview-eb.dtsi Thu Jun 14 07:12:10 2018 (r335121) @@ -143,6 +143,43 @@ port1-otg; }; + bridge { + compatible = "ti,ths8134a", "ti,ths8134"; + #address-cells = <1>; + #size-cells = <0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + vga_bridge_in: endpoint { + remote-endpoint = <&clcd_pads>; + }; + }; + + port@1 { + reg = <1>; + + vga_bridge_out: endpoint { + remote-endpoint = <&vga_con_in>; + }; + }; + }; + }; + + vga { + compatible = "vga-connector"; + + port { + vga_con_in: endpoint { + remote-endpoint = <&vga_bridge_out>; + }; + }; + }; + /* These peripherals are inside the FPGA */ fpga { #address-cells = <1>; @@ -409,34 +446,13 @@ interrupt-names = "combined"; clocks = <&oscclk0>, <&pclk>; clock-names = "clcdclk", "apb_pclk"; + /* 1024x768 16bpp @65MHz works fine */ + max-memory-bandwidth = <95000000>; port { clcd_pads: endpoint { - remote-endpoint = <&clcd_panel>; + remote-endpoint = <&vga_bridge_in>; arm,pl11x,tft-r0g0b0-pads = <0 8 16>; - }; - }; - - panel { - compatible = "panel-dpi"; - - port { - clcd_panel: endpoint { - remote-endpoint = <&clcd_pads>; - }; - }; - - /* Standard 640x480 VGA timings */ - panel-timing { - clock-frequency = <25175000>; - hactive = <640>; - hback-porch = <48>; - hfront-porch = <16>; - hsync-len = <96>; - vactive = <480>; - vback-porch = <33>; - vfront-porch = <10>; - vsync-len = <2>; }; }; }; Modified: head/sys/gnu/dts/arm/arm-realview-pb1176.dts ============================================================================== --- head/sys/gnu/dts/arm/arm-realview-pb1176.dts Thu Jun 14 07:09:50 2018 (r335120) +++ head/sys/gnu/dts/arm/arm-realview-pb1176.dts Thu Jun 14 07:12:10 2018 (r335121) @@ -161,6 +161,43 @@ port1-otg; }; + bridge { + compatible = "ti,ths8134a", "ti,ths8134"; + #address-cells = <1>; + #size-cells = <0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + vga_bridge_in: endpoint { + remote-endpoint = <&clcd_pads>; + }; + }; + + port@1 { + reg = <1>; + + vga_bridge_out: endpoint { + remote-endpoint = <&vga_con_in>; + }; + }; + }; + }; + + vga { + compatible = "vga-connector"; + + port { + vga_con_in: endpoint { + remote-endpoint = <&vga_bridge_out>; + }; + }; + }; + soc { #address-cells = <1>; #size-cells = <1>; @@ -403,36 +440,15 @@ interrupts = <0 47 IRQ_TYPE_LEVEL_HIGH>; clocks = <&oscclk0>, <&pclk>; clock-names = "clcdclk", "apb_pclk"; + /* 1024x768 16bpp @65MHz works fine */ + max-memory-bandwidth = <95000000>; port { clcd_pads: endpoint { - remote-endpoint = <&clcd_panel>; + remote-endpoint = <&vga_bridge_in>; arm,pl11x,tft-r0g0b0-pads = <0 8 16>; }; }; - - panel { - compatible = "panel-dpi"; - - port { - clcd_panel: endpoint { - remote-endpoint = <&clcd_pads>; - }; - }; - - /* Standard 640x480 VGA timings */ - panel-timing { - clock-frequency = <25175000>; - hactive = <640>; - hback-porch = <48>; - hfront-porch = <16>; - hsync-len = <96>; - vactive = <480>; - vback-porch = <33>; - vfront-porch = <10>; - vsync-len = <2>; - }; - }; }; }; @@ -564,7 +580,5 @@ clocks = <&pclk>; clock-names = "apb_pclk"; }; - - }; }; Modified: head/sys/gnu/dts/arm/arm-realview-pb11mp.dts ============================================================================== --- head/sys/gnu/dts/arm/arm-realview-pb11mp.dts Thu Jun 14 07:09:50 2018 (r335120) +++ head/sys/gnu/dts/arm/arm-realview-pb11mp.dts Thu Jun 14 07:12:10 2018 (r335121) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Jun 14 07:26:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D045A100A7D8; Thu, 14 Jun 2018 07:26:36 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6FCF979DC6; Thu, 14 Jun 2018 07:26:36 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id A634C260199; Thu, 14 Jun 2018 09:26:34 +0200 (CEST) Subject: Re: svn commit: r335094 - head/sys/ofed/drivers/infiniband/core To: Matthew Macy , Ryan Libby Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, bde@freebsd.org References: <201806132330.w5DNUsrE043573@repo.freebsd.org> From: Hans Petter Selasky Message-ID: Date: Thu, 14 Jun 2018 09:26:18 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 07:26:37 -0000 On 06/14/18 02:03, Matthew Macy wrote: > On Wed, Jun 13, 2018 at 4:47 PM, Ryan Libby wrote: >> On Wed, Jun 13, 2018 at 4:30 PM, Matt Macy wrote: >>> Author: mmacy >>> Date: Wed Jun 13 23:30:54 2018 >>> New Revision: 335094 >>> URL: https://svnweb.freebsd.org/changeset/base/335094 >>> >>> Log: >>> fix OFED build after r335053 >>> >>> Modified: >>> head/sys/ofed/drivers/infiniband/core/ib_user_mad.c >>> >>> Modified: head/sys/ofed/drivers/infiniband/core/ib_user_mad.c >>> ============================================================================== >>> --- head/sys/ofed/drivers/infiniband/core/ib_user_mad.c Wed Jun 13 23:19:54 2018 (r335093) >>> +++ head/sys/ofed/drivers/infiniband/core/ib_user_mad.c Wed Jun 13 23:30:54 2018 (r335094) >>> @@ -130,7 +130,8 @@ struct ib_umad_packet { >>> >>> static struct class *umad_class; >>> >>> -static const dev_t base_dev = MKDEV(IB_UMAD_MAJOR, IB_UMAD_MINOR_BASE); >>> +#define IBMKDEV(x, y) (((dev_t)(x) << 32) | (unsigned)(y)) >>> +static const dev_t base_dev = IBMKDEV(IB_UMAD_MAJOR, IB_UMAD_MINOR_BASE); >>> >>> static DEFINE_SPINLOCK(port_lock); >>> static DECLARE_BITMAP(dev_map, IB_UMAD_MAX_PORTS); >>> >> >> The scheme for major/minor encoding is different as of r335053. Won't >> that matter? > > Yes. > >> In sys/ofed/drivers/infiniband/core/{ib_ucm.c,ib_uverbs_main.c} the >> pattern is to #define the MKDEV(). Following that would in >> ib_user_mad.c would also resolve this. Or makedev could be >> re-macroized with the new scheme. > > That's probably the best course of action. > Will follow up. > > Hi, Please revert this patch and fix MKDEV() in: compat/linuxkpi/common/include/linux/kdev_t.h Instead. The value returned by MKDEV() must be passable through MAJOR() and MINOR() to restore the two arguments. Please make sure this is the case. Else the code gets broken. --HPS From owner-svn-src-head@freebsd.org Thu Jun 14 07:27:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31C1D100A943; Thu, 14 Jun 2018 07:27:34 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id ACA2279F50; Thu, 14 Jun 2018 07:27:33 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.55.3]) by phk.freebsd.dk (Postfix) with ESMTP id 2435214894; Thu, 14 Jun 2018 07:27:32 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.15.2/8.15.2) with ESMTPS id w5E7RUks048402 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 14 Jun 2018 07:27:30 GMT (envelope-from phk@critter.freebsd.dk) Received: (from phk@localhost) by critter.freebsd.dk (8.15.2/8.15.2/Submit) id w5E7RUnP048401; Thu, 14 Jun 2018 07:27:30 GMT (envelope-from phk) To: Warner Losh cc: Juli Mallett , "Rodney W. Grimes" , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335091 - head/sbin/nvmecontrol In-reply-to: From: "Poul-Henning Kamp" References: <201806140535.w5E5ZBmf043114@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <48399.1528961250.1@critter.freebsd.dk> Content-Transfer-Encoding: quoted-printable Date: Thu, 14 Jun 2018 07:27:30 +0000 Message-ID: <48400.1528961250@critter.freebsd.dk> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 07:27:34 -0000 -------- In message , Warner Losh writes: >The year of first publication of the work; Please be aware that "year of first publicaiton of the work" is a surprising tricky legal concept, because neither "first", "publication" or "the work" means what a normal or sane person would expect. >But this only required for works published before March 1, 1989. It later >states: > >"Copyright notice is optional for unpublished works, foreign works, or >works published on or after March 1, 1989. When notice is optional, >copyright owners can use any form of notice they wish." This is just about the worst legal advise one can imagine, because US still runs a system of "Copyright Registration" and there is a lot riding on having done so "promptly" if you ever get into a lawsuit, and if you don't affix a notice it gets even worse. >The project wishes date ranges. :) I support that, for data-archaeological reasons, but the publication year cannot just be updated willy nilly. A notice of "2014-2017" literally means "Some individual parts, each of which clear the 'substantial' threshold, were published in 2014, others in 2015, others again in 2016 and some in 2017" This is why "2014-2017" is significantly different from "2014,2016-2017". It is also important to understand that Copyright cannot be "renewed" this way unless the changes are 'substantial' enough, which probably means they have to clear the 'derivative work' threshold to be safe. But there is no guidance to be found *anywhere* what it takes for source code to clear any of those thresholds, because nobody has gone to court on that question yet. And nobody is likely to do so in the next three decades, because almost no software has fallen out of copyright, and no software will do so in the next three decades (All Hail Mickey!) The legal advice I have received is that one should "probably not" update the publication year unless the changes amount to "a rewrite", but updating *a little* too aggressively will probably only be "harmless error" due to the total absense of statute text and case law. Nobody want to guess what the situation is for "live works", under which countinous software development (probably) falls, and when you start talking about changing maintainers, your friendly copyright lawyer will get that glazed "Thank goodness the lawsuits wont start until I'm dead" look. And of course all this gets much more "interesting" if APIs can truly be copyrighted, because then we need to find out what "an API" is in the first place. -- = Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe = Never attribute to malice what can adequately be explained by incompetence= . From owner-svn-src-head@freebsd.org Thu Jun 14 07:29:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E64A100AC17; Thu, 14 Jun 2018 07:29:17 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C48187A1FF; Thu, 14 Jun 2018 07:29:16 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id ABA28260199; Thu, 14 Jun 2018 09:29:15 +0200 (CEST) Subject: Re: svn commit: r335053 - in head/sys: compat/freebsd32 compat/linux fs/nfsclient kern sys To: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201806131222.w5DCM00c001080@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <90566a73-c793-2cc4-27ac-039bf83fd2d0@selasky.org> Date: Thu, 14 Jun 2018 09:29:00 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <201806131222.w5DCM00c001080@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 07:29:17 -0000 On 06/13/18 14:22, Bruce Evans wrote: > +/* > + * The major and minor numbers are encoded in dev_t as MMMmmmMm (where > + * letters correspond to bytes). The encoding of the lower 4 bytes is > + * constrained by compatibility with 16-bit and 32-bit dev_t's. The > + * encoding of of the upper 4 bytes is the least unnatural one consistent > + * with this and other constraints. Also, the decoding of the m bytes by > + * minor() is unnatural to maximize compatibility subject to not discarding > + * bits. The upper m byte is shifted into the position of the lower M byte > + * instead of shifting 3 upper m bytes to close the gap. Compatibility for > + * minor() is achieved iff the upper m byte is 0. > + */ > +#define major(d) __major(d) > +static __inline int > +__major(dev_t _d) > +{ > + return (((_d >> 32) & 0xffffff00) | ((_d >> 8) & 0xff)); > +} > +#define minor(d) __minor(d) > +static __inline int > +__minor(dev_t _d) > +{ > + return (((_d >> 24) & 0xff00) | (_d & 0xffff00ff)); > +} > +#define makedev(M, m) __makedev((M), (m)) > +static __inline dev_t > +__makedev(int _M, int _m) > +{ > + return (((dev_t)(_M & 0xffffff00) << 32) | ((_M & 0xff) << 8) | > + ((dev_t)(_m & 0xff00) << 24) | (_m & 0xffff00ff)); > +} Can you use all macros here? This breaks OFED, because __makedev() is used to initialize variables. --HPS From owner-svn-src-head@freebsd.org Thu Jun 14 07:55:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 701B2100D194; Thu, 14 Jun 2018 07:55:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 269817B492; Thu, 14 Jun 2018 07:55:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 08C3625A03; Thu, 14 Jun 2018 07:55:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5E7tAb2004568; Thu, 14 Jun 2018 07:55:10 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5E7tAQ3004567; Thu, 14 Jun 2018 07:55:10 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806140755.w5E7tAQ3004567@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 14 Jun 2018 07:55:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335123 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/ofed/drivers/infiniband/core X-SVN-Commit-Revision: 335123 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 07:55:11 -0000 Author: hselasky Date: Thu Jun 14 07:55:10 2018 New Revision: 335123 URL: https://svnweb.freebsd.org/changeset/base/335123 Log: Revert r335094 and properly fix OFED build after r335053. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/ofed/drivers/infiniband/core/ib_user_mad.c Modified: head/sys/ofed/drivers/infiniband/core/ib_user_mad.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_user_mad.c Thu Jun 14 07:12:30 2018 (r335122) +++ head/sys/ofed/drivers/infiniband/core/ib_user_mad.c Thu Jun 14 07:55:10 2018 (r335123) @@ -130,8 +130,7 @@ struct ib_umad_packet { static struct class *umad_class; -#define IBMKDEV(x, y) (((dev_t)(x) << 32) | (unsigned)(y)) -static const dev_t base_dev = IBMKDEV(IB_UMAD_MAJOR, IB_UMAD_MINOR_BASE); +#define base_dev MKDEV(IB_UMAD_MAJOR, IB_UMAD_MINOR_BASE) static DEFINE_SPINLOCK(port_lock); static DECLARE_BITMAP(dev_map, IB_UMAD_MAX_PORTS); From owner-svn-src-head@freebsd.org Thu Jun 14 07:57:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEB93100D63C; Thu, 14 Jun 2018 07:57:43 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6CEC87B72C; Thu, 14 Jun 2018 07:57:43 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id CD84B260199; Thu, 14 Jun 2018 09:57:38 +0200 (CEST) Subject: Re: svn commit: r335094 - head/sys/ofed/drivers/infiniband/core From: Hans Petter Selasky To: Matthew Macy , Ryan Libby Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, bde@freebsd.org References: <201806132330.w5DNUsrE043573@repo.freebsd.org> Message-ID: <838bc229-a54c-8fd6-ef05-d503a9e4cbe9@selasky.org> Date: Thu, 14 Jun 2018 09:57:21 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 07:57:44 -0000 On 06/14/18 09:26, Hans Petter Selasky wrote: > On 06/14/18 02:03, Matthew Macy wrote: >> On Wed, Jun 13, 2018 at 4:47 PM, Ryan Libby wrote: >>> On Wed, Jun 13, 2018 at 4:30 PM, Matt Macy wrote: >>>> Author: mmacy >>>> Date: Wed Jun 13 23:30:54 2018 >>>> New Revision: 335094 >>>> URL: https://svnweb.freebsd.org/changeset/base/335094 >>>> >>>> Log: >>>>    fix OFED build after r335053 >>>> >>>> Modified: >>>>    head/sys/ofed/drivers/infiniband/core/ib_user_mad.c >>>> >>>> Modified: head/sys/ofed/drivers/infiniband/core/ib_user_mad.c >>>> ============================================================================== >>>> >>>> --- head/sys/ofed/drivers/infiniband/core/ib_user_mad.c Wed Jun 13 >>>> 23:19:54 2018        (r335093) >>>> +++ head/sys/ofed/drivers/infiniband/core/ib_user_mad.c Wed Jun 13 >>>> 23:30:54 2018        (r335094) >>>> @@ -130,7 +130,8 @@ struct ib_umad_packet { >>>> >>>>   static struct class *umad_class; >>>> >>>> -static const dev_t base_dev = MKDEV(IB_UMAD_MAJOR, >>>> IB_UMAD_MINOR_BASE); >>>> +#define IBMKDEV(x, y)  (((dev_t)(x) << 32) | (unsigned)(y)) >>>> +static const dev_t base_dev = IBMKDEV(IB_UMAD_MAJOR, >>>> IB_UMAD_MINOR_BASE); >>>> >>>>   static DEFINE_SPINLOCK(port_lock); >>>>   static DECLARE_BITMAP(dev_map, IB_UMAD_MAX_PORTS); >>>> >>> >>> The scheme for major/minor encoding is different as of r335053.  Won't >>> that matter? >> >> Yes. >> >>> In sys/ofed/drivers/infiniband/core/{ib_ucm.c,ib_uverbs_main.c} the >>> pattern is to #define the MKDEV().  Following that would in >>> ib_user_mad.c would also resolve this.  Or makedev could be >>> re-macroized with the new scheme. >> >> That's probably the best course of action. >> Will follow up. >> >> > > Hi, > > Please revert this patch and fix MKDEV() in: > compat/linuxkpi/common/include/linux/kdev_t.h > > Instead. > > The value returned by MKDEV() must be passable through MAJOR() and > MINOR() to restore the two arguments. Please make sure this is the case. > Else the code gets broken. > > --HPS > See r335123. --HPS From owner-svn-src-head@freebsd.org Thu Jun 14 07:59:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A7F3100D7D4; Thu, 14 Jun 2018 07:59:07 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D75FC7B8C8; Thu, 14 Jun 2018 07:59:06 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id D83C0260199; Thu, 14 Jun 2018 09:59:05 +0200 (CEST) Subject: Re: svn commit: r335053 - in head/sys: compat/freebsd32 compat/linux fs/nfsclient kern sys From: Hans Petter Selasky To: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201806131222.w5DCM00c001080@repo.freebsd.org> <90566a73-c793-2cc4-27ac-039bf83fd2d0@selasky.org> Message-ID: <35d80ebb-b505-59ed-2ee1-a0334090755e@selasky.org> Date: Thu, 14 Jun 2018 09:58:50 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <90566a73-c793-2cc4-27ac-039bf83fd2d0@selasky.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 07:59:07 -0000 On 06/14/18 09:29, Hans Petter Selasky wrote: > On 06/13/18 14:22, Bruce Evans wrote: >> +/* >> + * The major and minor numbers are encoded in dev_t as MMMmmmMm (where >> + * letters correspond to bytes).  The encoding of the lower 4 bytes is >> + * constrained by compatibility with 16-bit and 32-bit dev_t's.  The >> + * encoding of of the upper 4 bytes is the least unnatural one >> consistent >> + * with this and other constraints.  Also, the decoding of the m >> bytes by >> + * minor() is unnatural to maximize compatibility subject to not >> discarding >> + * bits.  The upper m byte is shifted into the position of the lower >> M byte >> + * instead of shifting 3 upper m bytes to close the gap. >> Compatibility for >> + * minor() is achieved iff the upper m byte is 0. >> + */ >> +#define    major(d)    __major(d) >> +static __inline int >> +__major(dev_t _d) >> +{ >> +    return (((_d >> 32) & 0xffffff00) | ((_d >> 8) & 0xff)); >> +} >> +#define    minor(d)    __minor(d) >> +static __inline int >> +__minor(dev_t _d) >> +{ >> +    return (((_d >> 24) & 0xff00) | (_d & 0xffff00ff)); >> +} >> +#define    makedev(M, m)    __makedev((M), (m)) >> +static __inline dev_t >> +__makedev(int _M, int _m) >> +{ >> +    return (((dev_t)(_M & 0xffffff00) << 32) | ((_M & 0xff) << 8) | >> +        ((dev_t)(_m & 0xff00) << 24) | (_m & 0xffff00ff)); >> +} > > Can you use all macros here? This breaks OFED, because __makedev() is > used to initialize variables. r335123 fixes this for OFED, but there might be other places where MAKDEV() is used to setup static and const variables. --HPS From owner-svn-src-head@freebsd.org Thu Jun 14 07:59:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39789100D8A8; Thu, 14 Jun 2018 07:59:48 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E36A97B9F7; Thu, 14 Jun 2018 07:59:47 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C495E25A09; Thu, 14 Jun 2018 07:59:47 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5E7xlBM004843; Thu, 14 Jun 2018 07:59:47 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5E7xlOe004841; Thu, 14 Jun 2018 07:59:47 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201806140759.w5E7xlOe004841@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 14 Jun 2018 07:59:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335124 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 335124 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 07:59:48 -0000 Author: manu Date: Thu Jun 14 07:59:47 2018 New Revision: 335124 URL: https://svnweb.freebsd.org/changeset/base/335124 Log: rk_i2c: Add manpage for this driver Added: head/share/man/man4/rk_i2c.4 (contents, props changed) Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Thu Jun 14 07:55:10 2018 (r335123) +++ head/share/man/man4/Makefile Thu Jun 14 07:59:47 2018 (r335124) @@ -446,6 +446,7 @@ MAN= aac.4 \ rights.4 \ ${_rk_gpio.4} \ ${_rk_grf.4} \ + ${_rk_i2c.4} \ ${_rk_pinctrl.4} \ rl.4 \ rndtest.4 \ @@ -765,6 +766,7 @@ MLINKS+=xl.4 if_xl.4 _armv8crypto.4= armv8crypto.4 _rk_gpio.4= rk_gpio.4 _rk_grf.4= rk_grf.4 +_rk_i2c.4= rk_i2c.4 _rk_pinctrl.4= rk_pinctrl.4 .endif Added: head/share/man/man4/rk_i2c.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/rk_i2c.4 Thu Jun 14 07:59:47 2018 (r335124) @@ -0,0 +1,64 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2018 Emmanuel Vadot +.\" +.\" 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 14, 2018 +.Dt RK_I2C 4 +.Os +.Sh NAME +.Nm rk_i2c +.Nd driver for the i2c controller on RockChip SoCs +.Sh SYNOPSIS +.Cd "options SOC_ROCKCHIP_RK3328" +.Sh DESCRIPTION +The +.Nm +device driver provides support for the i2c controller device present +on RockChip SoC. +.Sh HARDWARE +The current version of the +.Nm +driver supports the i2c controller with one of the following +compatible strings : +.Pp +.Bl -bullet -compact +.It +rockchip,rk3328-i2c +.El +.Sh SEE ALSO +.Xr iic 4 , +.Xr iicbus 4 , +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 12.0 . +.Sh AUTHORS +The +.Nm +device driver and manpage was written by +.An Emmanuel Vadot Aq Mt manu@freebsd.org . From owner-svn-src-head@freebsd.org Thu Jun 14 08:10:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0976100E997; Thu, 14 Jun 2018 08:10:04 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id E26EC7C39A; Thu, 14 Jun 2018 08:10:03 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id F3C023CCC66; Thu, 14 Jun 2018 18:09:51 +1000 (AEST) Date: Thu, 14 Jun 2018 18:09:51 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Matthew Macy cc: Ryan Libby , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, bde@freebsd.org Subject: Re: svn commit: r335094 - head/sys/ofed/drivers/infiniband/core In-Reply-To: Message-ID: <20180614165804.L1156@besplex.bde.org> References: <201806132330.w5DNUsrE043573@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=I9sVfJog c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=Qbu6MDAsAjz1s12MRMMA:9 a=NM1pzMuOk_UbrT9-:21 a=hHtOW9pH9XD3AjIz:21 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 08:10:04 -0000 On Wed, 13 Jun 2018, Matthew Macy wrote: > On Wed, Jun 13, 2018 at 4:47 PM, Ryan Libby wrote: >> On Wed, Jun 13, 2018 at 4:30 PM, Matt Macy wrote: >>> Author: mmacy >>> Date: Wed Jun 13 23:30:54 2018 >>> New Revision: 335094 >>> URL: https://svnweb.freebsd.org/changeset/base/335094 >>> >>> Log: >>> fix OFED build after r335053 Ooops. makedev(), etc., will have to go back to being plain macros. But not so plain since they will need to use unportable statement-expressions to be safe macros. >>> Modified: >>> head/sys/ofed/drivers/infiniband/core/ib_user_mad.c >>> >>> Modified: head/sys/ofed/drivers/infiniband/core/ib_user_mad.c >>> ============================================================================== >>> --- head/sys/ofed/drivers/infiniband/core/ib_user_mad.c Wed Jun 13 23:19:54 2018 (r335093) >>> +++ head/sys/ofed/drivers/infiniband/core/ib_user_mad.c Wed Jun 13 23:30:54 2018 (r335094) >>> @@ -130,7 +130,8 @@ struct ib_umad_packet { >>> >>> static struct class *umad_class; >>> >>> -static const dev_t base_dev = MKDEV(IB_UMAD_MAJOR, IB_UMAD_MINOR_BASE); >>> +#define IBMKDEV(x, y) (((dev_t)(x) << 32) | (unsigned)(y)) >>> +static const dev_t base_dev = IBMKDEV(IB_UMAD_MAJOR, IB_UMAD_MINOR_BASE); >>> >>> static DEFINE_SPINLOCK(port_lock); >>> static DECLARE_BITMAP(dev_map, IB_UMAD_MAX_PORTS); >>> >> >> The scheme for major/minor encoding is different as of r335053. Won't >> that matter? Using the host makedev() seems to be correct here. So is wrapping it in MKDEV() (except the definition of MKDEV() is broken -- it is missing parentheses around args). Since the major and minor number here are small (231, 0), there is no problem with the encoding and you can just use the old makedev() macro for a quick fix (shift by 8 instead of 32) until the new one is fixed. I seem to have broken the 64-bit linux l_dev_t in a different way than before. Linux device numbers are only 16 bits for linux32 (even for stat64) and also for everything in linux[64] except newstat. For 64-bit (amd64) newstat, they are 64 bits. They can actually support large major and minor numbers in this case. I don't know there encoding for this case, but it is unlikely to be the same as the FreeBSD one. This gives the following bugs: - st_rdev is still translated by old code that does (major << 8 | minor). This is supposed to give the Linux encoding. For major < 256 and minor < 256, it works to give the old common 16-bit encoding. Otherwises, it first combines the bits in a wrong way and then assignment to 16-bit ldev_t may lose bits while assignment to 64-bit ldev_t gives wrong bits instead of lost bits for the high 48 bits. - st_dev was translated in the same way. Now it truncates to 16 bits in the 64-bit case too, so it loses bits consistently. > Yes. > >> In sys/ofed/drivers/infiniband/core/{ib_ucm.c,ib_uverbs_main.c} the >> pattern is to #define the MKDEV(). Following that would in >> ib_user_mad.c would also resolve this. Or makedev could be >> re-macroized with the new scheme. > > That's probably the best course of action. > Will follow up. It is not best to churn makedev() just for ofed, but some applications probably need it to be a plain macro too. Bruce From owner-svn-src-head@freebsd.org Thu Jun 14 08:26:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25492100FFF8; Thu, 14 Jun 2018 08:26:05 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 938C17D11F; Thu, 14 Jun 2018 08:26:04 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 26CDD104D6AC; Thu, 14 Jun 2018 18:25:53 +1000 (AEST) Date: Thu, 14 Jun 2018 18:25:44 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Hans Petter Selasky cc: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335053 - in head/sys: compat/freebsd32 compat/linux fs/nfsclient kern sys In-Reply-To: <90566a73-c793-2cc4-27ac-039bf83fd2d0@selasky.org> Message-ID: <20180614181525.I1417@besplex.bde.org> References: <201806131222.w5DCM00c001080@repo.freebsd.org> <90566a73-c793-2cc4-27ac-039bf83fd2d0@selasky.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=FNpr/6gs c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=veEjxAY5SaK3AuIXAPsA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 08:26:05 -0000 On Thu, 14 Jun 2018, Hans Petter Selasky wrote: > On 06/13/18 14:22, Bruce Evans wrote: >> [... inlines for makedev(), etc.] > > Can you use all macros here? This breaks OFED, because __makedev() is used to > initialize variables. See another reply. I will change them to macros and fear breaking them with a gccism instead of with with inlines. I should have worried more about the inlines. Plain inline is only in C99 or a gcc extension starting in gcc-2.mumble. Portability of sys/types.h is more important than for any other header in the system except sys/cdevs.h. So it must compile with C90 compilers and should compile with K&R compilers. For makedev(), etc., it spells inline as __inline so the inline feature can be turned off easily (the functions then become static and repeated every time sys/types.h is included, but this probably happens anyway with -O0 and it works for any compiler). Turning off the statement-expression feature needed to write safe macros is not so easy. In , this feature is only used in mostly-kernel headers and in stdatomic.h. Bruce From owner-svn-src-head@freebsd.org Thu Jun 14 08:46:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F06921011A94; Thu, 14 Jun 2018 08:46:24 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 6992D7DE85; Thu, 14 Jun 2018 08:46:24 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 2DCDF1072A1; Thu, 14 Jun 2018 18:46:21 +1000 (AEST) Date: Thu, 14 Jun 2018 18:46:20 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Hans Petter Selasky cc: Matthew Macy , Ryan Libby , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, bde@freebsd.org Subject: Re: svn commit: r335094 - head/sys/ofed/drivers/infiniband/core In-Reply-To: Message-ID: <20180614182603.U1417@besplex.bde.org> References: <201806132330.w5DNUsrE043573@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=I9sVfJog c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=i7P0IqkiC3WXgPp8RoMA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 08:46:25 -0000 On Thu, 14 Jun 2018, Hans Petter Selasky wrote: > On 06/14/18 02:03, Matthew Macy wrote: >> On Wed, Jun 13, 2018 at 4:47 PM, Ryan Libby wrote: >>> On Wed, Jun 13, 2018 at 4:30 PM, Matt Macy wrote: >>>> Author: mmacy >>>> Date: Wed Jun 13 23:30:54 2018 >>>> New Revision: 335094 >>>> URL: https://svnweb.freebsd.org/changeset/base/335094 >>>> >>>> Log: >>>> fix OFED build after r335053 >* ... > Please revert this patch and fix MKDEV() in: > compat/linuxkpi/common/include/linux/kdev_t.h > > Instead. > > The value returned by MKDEV() must be passable through MAJOR() and MINOR() to > restore the two arguments. Please make sure this is the case. Else the code > gets broken. Are these macros for conversion of host (FreeBSD) dev_t's or target (Linux) ones? If for the host, then I don't see any reason not to use the host APIs. If for the target, then they shouldn't be used with the host dev_t. If for a mixture, then the translations are very confusing, especially when they are the identity, and many more macros are needed to reduce the confusion. Bruce From owner-svn-src-head@freebsd.org Thu Jun 14 08:58:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 292B41012AB9; Thu, 14 Jun 2018 08:58:12 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D2FBD7E685; Thu, 14 Jun 2018 08:58:11 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B96A263CF; Thu, 14 Jun 2018 08:58:11 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5E8wBvg036010; Thu, 14 Jun 2018 08:58:11 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5E8wAId036006; Thu, 14 Jun 2018 08:58:10 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201806140858.w5E8wAId036006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 14 Jun 2018 08:58:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335125 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 335125 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 08:58:12 -0000 Author: tsoome Date: Thu Jun 14 08:58:10 2018 New Revision: 335125 URL: https://svnweb.freebsd.org/changeset/base/335125 Log: libsa: cstyle cleanup for open/close/read/write sources Modified: head/stand/libsa/close.c head/stand/libsa/open.c head/stand/libsa/read.c head/stand/libsa/write.c Modified: head/stand/libsa/close.c ============================================================================== --- head/stand/libsa/close.c Thu Jun 14 07:59:47 2018 (r335124) +++ head/stand/libsa/close.c Thu Jun 14 08:58:10 2018 (r335125) @@ -32,30 +32,30 @@ * SUCH DAMAGE. * * @(#)close.c 8.1 (Berkeley) 6/11/93 - * * + * * Copyright (c) 1989, 1990, 1991 Carnegie Mellon University * All Rights Reserved. * * Author: Alessandro Forin - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * + * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. */ @@ -68,31 +68,31 @@ __FBSDID("$FreeBSD$"); int close(int fd) { - struct open_file *f = &files[fd]; - int err1 = 0, err2 = 0; + struct open_file *f = &files[fd]; + int err1 = 0, err2 = 0; - if ((unsigned)fd >= SOPEN_MAX || f->f_flags == 0) { - errno = EBADF; - return (-1); - } - if (f->f_rabuf != NULL) { - free(f->f_rabuf); - f->f_rabuf = NULL; - } - if (!(f->f_flags & F_RAW) && f->f_ops) - err1 = (f->f_ops->fo_close)(f); - if (!(f->f_flags & F_NODEV) && f->f_dev) - err2 = (f->f_dev->dv_close)(f); - if (f->f_devdata != NULL) - devclose(f); - f->f_flags = 0; - if (err1) { - errno = err1; - return (-1); - } - if (err2) { - errno = err2; - return (-1); - } - return (0); + if ((unsigned)fd >= SOPEN_MAX || f->f_flags == 0) { + errno = EBADF; + return (-1); + } + if (f->f_rabuf != NULL) { + free(f->f_rabuf); + f->f_rabuf = NULL; + } + if (!(f->f_flags & F_RAW) && f->f_ops) + err1 = (f->f_ops->fo_close)(f); + if (!(f->f_flags & F_NODEV) && f->f_dev) + err2 = (f->f_dev->dv_close)(f); + if (f->f_devdata != NULL) + devclose(f); + f->f_flags = 0; + if (err1) { + errno = err1; + return (-1); + } + if (err2) { + errno = err2; + return (-1); + } + return (0); } Modified: head/stand/libsa/open.c ============================================================================== --- head/stand/libsa/open.c Thu Jun 14 07:59:47 2018 (r335124) +++ head/stand/libsa/open.c Thu Jun 14 08:58:10 2018 (r335125) @@ -32,30 +32,30 @@ * SUCH DAMAGE. * * @(#)open.c 8.1 (Berkeley) 6/11/93 - * * + * * Copyright (c) 1989, 1990, 1991 Carnegie Mellon University * All Rights Reserved. * * Author: Alessandro Forin - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * + * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. */ @@ -70,89 +70,89 @@ struct fs_ops *exclusive_file_system; struct open_file files[SOPEN_MAX]; static int -o_gethandle(void) +o_gethandle(void) { - int fd; - - for (fd = 0; fd < SOPEN_MAX; fd++) - if (files[fd].f_flags == 0) - return(fd); - return(-1); + int fd; + + for (fd = 0; fd < SOPEN_MAX; fd++) + if (files[fd].f_flags == 0) + return (fd); + return (-1); } static void o_rainit(struct open_file *f) { - f->f_rabuf = malloc(SOPEN_RASIZE); - f->f_ralen = 0; - f->f_raoffset = 0; + f->f_rabuf = malloc(SOPEN_RASIZE); + f->f_ralen = 0; + f->f_raoffset = 0; } int open(const char *fname, int mode) { - struct fs_ops *fs; - struct open_file *f; - int fd, i, error, besterror; - const char *file; + struct fs_ops *fs; + struct open_file *f; + int fd, i, error, besterror; + const char *file; - if ((fd = o_gethandle()) == -1) { - errno = EMFILE; - return(-1); - } + if ((fd = o_gethandle()) == -1) { + errno = EMFILE; + return (-1); + } - f = &files[fd]; - f->f_flags = mode + 1; - f->f_dev = (struct devsw *)0; - f->f_ops = (struct fs_ops *)0; - f->f_offset = 0; - f->f_devdata = NULL; - file = (char *)0; + f = &files[fd]; + f->f_flags = mode + 1; + f->f_dev = (struct devsw *)0; + f->f_ops = (struct fs_ops *)0; + f->f_offset = 0; + f->f_devdata = NULL; + file = (char *)0; - if (exclusive_file_system != NULL) { - fs = exclusive_file_system; - error = (fs->fo_open)(fname, f); - if (error == 0) - goto ok; - goto err; - } + if (exclusive_file_system != NULL) { + fs = exclusive_file_system; + error = (fs->fo_open)(fname, f); + if (error == 0) + goto ok; + goto err; + } - error = devopen(f, fname, &file); - if (error || - (((f->f_flags & F_NODEV) == 0) && f->f_dev == (struct devsw *)0)) - goto err; + error = devopen(f, fname, &file); + if (error || + (((f->f_flags & F_NODEV) == 0) && f->f_dev == (struct devsw *)0)) + goto err; - /* see if we opened a raw device; otherwise, 'file' is the file name. */ - if (file == (char *)0 || *file == '\0') { - f->f_flags |= F_RAW; - f->f_rabuf = NULL; - return (fd); - } + /* see if we opened a raw device; otherwise, 'file' is the file name. */ + if (file == (char *)0 || *file == '\0') { + f->f_flags |= F_RAW; + f->f_rabuf = NULL; + return (fd); + } - /* pass file name to the different filesystem open routines */ - besterror = ENOENT; - for (i = 0; file_system[i] != NULL; i++) { - fs = file_system[i]; - error = (fs->fo_open)(file, f); - if (error == 0) - goto ok; - if (error != EINVAL) - besterror = error; - } - error = besterror; + /* pass file name to the different filesystem open routines */ + besterror = ENOENT; + for (i = 0; file_system[i] != NULL; i++) { + fs = file_system[i]; + error = (fs->fo_open)(file, f); + if (error == 0) + goto ok; + if (error != EINVAL) + besterror = error; + } + error = besterror; - if ((f->f_flags & F_NODEV) == 0 && f->f_dev != NULL) - f->f_dev->dv_close(f); - if (error) - devclose(f); + if ((f->f_flags & F_NODEV) == 0 && f->f_dev != NULL) + f->f_dev->dv_close(f); + if (error) + devclose(f); - err: - f->f_flags = 0; - errno = error; - return (-1); +err: + f->f_flags = 0; + errno = error; + return (-1); - ok: - f->f_ops = fs; - o_rainit(f); - return (fd); +ok: + f->f_ops = fs; + o_rainit(f); + return (fd); } Modified: head/stand/libsa/read.c ============================================================================== --- head/stand/libsa/read.c Thu Jun 14 07:59:47 2018 (r335124) +++ head/stand/libsa/read.c Thu Jun 14 08:58:10 2018 (r335125) @@ -32,30 +32,30 @@ * SUCH DAMAGE. * * @(#)read.c 8.1 (Berkeley) 6/11/93 - * * + * * Copyright (c) 1989, 1990, 1991 Carnegie Mellon University * All Rights Reserved. * * Author: Alessandro Forin - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * + * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. */ @@ -69,59 +69,65 @@ __FBSDID("$FreeBSD$"); ssize_t read(int fd, void *dest, size_t bcount) { - struct open_file *f = &files[fd]; - size_t resid; + struct open_file *f = &files[fd]; + size_t resid; - if ((unsigned)fd >= SOPEN_MAX || !(f->f_flags & F_READ)) { - errno = EBADF; - return (-1); - } - if (f->f_flags & F_RAW) { - twiddle(4); - errno = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, - btodb(f->f_offset), bcount, dest, &resid); - if (errno) - return (-1); - f->f_offset += resid; - return (resid); - } - - /* - * Optimise reads from regular files using a readahead buffer. - * If the request can't be satisfied from the current buffer contents, - * check to see if it should be bypassed, or refill the buffer and complete - * the request. - */ - resid = bcount; - for (;;) { - size_t ccount, cresid; - /* how much can we supply? */ - ccount = imin(f->f_ralen, resid); - if (ccount > 0) { - bcopy(f->f_rabuf + f->f_raoffset, dest, ccount); - f->f_raoffset += ccount; - f->f_ralen -= ccount; - resid -= ccount; - if (resid == 0) - return(bcount); - dest = (char *)dest + ccount; + if ((unsigned)fd >= SOPEN_MAX || !(f->f_flags & F_READ)) { + errno = EBADF; + return (-1); } - - /* will filling the readahead buffer again not help? */ - if (resid >= SOPEN_RASIZE) { - /* bypass the rest of the request and leave the buffer empty */ - if ((errno = (f->f_ops->fo_read)(f, dest, resid, &cresid))) - return (-1); - return(bcount - cresid); + if (f->f_flags & F_RAW) { + twiddle(4); + errno = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, + btodb(f->f_offset), bcount, dest, &resid); + if (errno) + return (-1); + f->f_offset += resid; + return (resid); } - /* fetch more data */ - if ((errno = (f->f_ops->fo_read)(f, f->f_rabuf, SOPEN_RASIZE, &cresid))) - return (-1); - f->f_raoffset = 0; - f->f_ralen = SOPEN_RASIZE - cresid; - /* no more data, return what we had */ - if (f->f_ralen == 0) - return(bcount - resid); - } + /* + * Optimise reads from regular files using a readahead buffer. + * If the request can't be satisfied from the current buffer contents, + * check to see if it should be bypassed, or refill the buffer and + * complete the request. + */ + resid = bcount; + for (;;) { + size_t ccount, cresid; + /* how much can we supply? */ + ccount = imin(f->f_ralen, resid); + if (ccount > 0) { + bcopy(f->f_rabuf + f->f_raoffset, dest, ccount); + f->f_raoffset += ccount; + f->f_ralen -= ccount; + resid -= ccount; + if (resid == 0) + return (bcount); + dest = (char *)dest + ccount; + } + + /* will filling the readahead buffer again not help? */ + if (resid >= SOPEN_RASIZE) { + /* + * bypass the rest of the request and leave the + * buffer empty + */ + errno = (f->f_ops->fo_read)(f, dest, resid, &cresid); + if (errno != 0) + return (-1); + return (bcount - cresid); + } + + /* fetch more data */ + errno = (f->f_ops->fo_read)(f, f->f_rabuf, SOPEN_RASIZE, + &cresid); + if (errno != 0) + return (-1); + f->f_raoffset = 0; + f->f_ralen = SOPEN_RASIZE - cresid; + /* no more data, return what we had */ + if (f->f_ralen == 0) + return (bcount - resid); + } } Modified: head/stand/libsa/write.c ============================================================================== --- head/stand/libsa/write.c Thu Jun 14 07:59:47 2018 (r335124) +++ head/stand/libsa/write.c Thu Jun 14 08:58:10 2018 (r335125) @@ -32,30 +32,30 @@ * SUCH DAMAGE. * * @(#)write.c 8.1 (Berkeley) 6/11/93 - * * + * * Copyright (c) 1989, 1990, 1991 Carnegie Mellon University * All Rights Reserved. * * Author: Alessandro Forin - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * + * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. */ @@ -67,10 +67,7 @@ __FBSDID("$FreeBSD$"); #include "stand.h" ssize_t -write(fd, dest, bcount) - int fd; - const void *dest; - size_t bcount; +write(int fd, const void *dest, size_t bcount) { struct open_file *f = &files[fd]; size_t resid; @@ -82,8 +79,8 @@ write(fd, dest, bcount) if (f->f_flags & F_RAW) { twiddle(4); errno = (f->f_dev->dv_strategy)(f->f_devdata, F_WRITE, - btodb(f->f_offset), bcount, __DECONST(void *, dest), - &resid); + btodb(f->f_offset), bcount, __DECONST(void *, dest), + &resid); if (errno) return (-1); f->f_offset += resid; From owner-svn-src-head@freebsd.org Thu Jun 14 09:06:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67212101396F; Thu, 14 Jun 2018 09:06:54 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 158847EEB7; Thu, 14 Jun 2018 09:06:54 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E622526563; Thu, 14 Jun 2018 09:06:53 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5E96r2w041126; Thu, 14 Jun 2018 09:06:53 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5E96rA4041125; Thu, 14 Jun 2018 09:06:53 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201806140906.w5E96rA4041125@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 14 Jun 2018 09:06:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335126 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 335126 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 09:06:54 -0000 Author: tsoome Date: Thu Jun 14 09:06:53 2018 New Revision: 335126 URL: https://svnweb.freebsd.org/changeset/base/335126 Log: libsa: f_rabuf could be NULL It is possible that we will not get RA buffer from open(), therefore we must validate RA. Modified: head/stand/libsa/read.c Modified: head/stand/libsa/read.c ============================================================================== --- head/stand/libsa/read.c Thu Jun 14 08:58:10 2018 (r335125) +++ head/stand/libsa/read.c Thu Jun 14 09:06:53 2018 (r335126) @@ -108,7 +108,7 @@ read(int fd, void *dest, size_t bcount) } /* will filling the readahead buffer again not help? */ - if (resid >= SOPEN_RASIZE) { + if (f->f_rabuf == NULL || resid >= SOPEN_RASIZE) { /* * bypass the rest of the request and leave the * buffer empty From owner-svn-src-head@freebsd.org Thu Jun 14 09:10:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 242701013D87; Thu, 14 Jun 2018 09:10:35 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C3EF57F0D2; Thu, 14 Jun 2018 09:10:34 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A151B2656D; Thu, 14 Jun 2018 09:10:34 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5E9AYKL041330; Thu, 14 Jun 2018 09:10:34 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5E9AYei041329; Thu, 14 Jun 2018 09:10:34 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201806140910.w5E9AYei041329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 14 Jun 2018 09:10:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335127 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 335127 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 09:10:35 -0000 Author: tsoome Date: Thu Jun 14 09:10:34 2018 New Revision: 335127 URL: https://svnweb.freebsd.org/changeset/base/335127 Log: libsa: remobe unneeded check before free() free() is checking for NULL, remove duplicate check. Modified: head/stand/libsa/close.c Modified: head/stand/libsa/close.c ============================================================================== --- head/stand/libsa/close.c Thu Jun 14 09:06:53 2018 (r335126) +++ head/stand/libsa/close.c Thu Jun 14 09:10:34 2018 (r335127) @@ -75,10 +75,9 @@ close(int fd) errno = EBADF; return (-1); } - if (f->f_rabuf != NULL) { - free(f->f_rabuf); - f->f_rabuf = NULL; - } + free(f->f_rabuf); + f->f_rabuf = NULL; + if (!(f->f_flags & F_RAW) && f->f_ops) err1 = (f->f_ops->fo_close)(f); if (!(f->f_flags & F_NODEV) && f->f_dev) From owner-svn-src-head@freebsd.org Thu Jun 14 09:28:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53A07101559F; Thu, 14 Jun 2018 09:28:38 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay110.isp.belgacom.be (mailrelay110.isp.belgacom.be [195.238.20.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "relay.skynet.be", Issuer "GlobalSign Organization Validation CA - SHA256 - G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7EBD37FD53; Thu, 14 Jun 2018 09:28:37 +0000 (UTC) (envelope-from tijl@freebsd.org) X-Belgacom-Dynamic: yes IronPort-PHdr: =?us-ascii?q?9a23=3AO9Jkhh+eSnUMfP9uRHKM819IXTAuvvDOBiVQ1KB2?= =?us-ascii?q?2ugcTK2v8tzYMVDF4r011RmVBdids6oMotGVmpioYXYH75eFvSJKW713fDhBt/?= =?us-ascii?q?8rmRc9CtWOE0zxIa2iRSU7GMNfSA0tpCnjYgBaF8nkelLdvGC54yIMFRXjLwp1?= =?us-ascii?q?Ifn+FpLPg8it2O2+553ebx9UiDahfLh/MAi4oQLNu8cMnIBsMLwxyhzHontJf+?= =?us-ascii?q?RZ22ZlLk+Nkhj/+8m94odt/zxftPw9+cFAV776f7kjQrxDEDsmKWE169b1uhTF?= =?us-ascii?q?UACC+2ETUmQSkhpPHgjF8BT3VYr/vyfmquZw3jSRMNboRr4oRzut86ZrSAfpiC?= =?us-ascii?q?gZMT457HrXgdF0gK5CvR6tuwBzz4vSbYqINvRxY7ndcMsUS2RBQMhfSi9PDYGy?= =?us-ascii?q?b4QAE+UPMv1Vr5X/qlcSsReyGRWgCP3pxzRVhnH2x6o60+E5HA/Y2Q4gG88FvW?= =?us-ascii?q?rTrNXyL6cdT+W1w7POzTXYcvhb3iv96InKchAluvyCXahwftTPxkQyCg3LgE+c?= =?us-ascii?q?qYv/PzOaz+kAtXWQ4eRnVeKqkWEnqgdxryChxsc2lIbGmJkaykvZ+iljx4Y1P9?= =?us-ascii?q?K4RUhmatCnCJtdryKXOolsTs4jQmxkojs2x74btZKhYSQHyZcqyhjCYPKdaYeI?= =?us-ascii?q?+AjsVOOJLDd9g3JqZaywig6p8Uil1u38Ts600EtWriZdktnDqHQN1xvL58iEUP?= =?us-ascii?q?R9+kah2TOR2ADJ7eFIO1w0lavZK54l2LI/ip0TsUPYHiDonUX5lqmWdl4+9uiv?= =?us-ascii?q?8eTnba3qpp6aN4BqlgHzKqcjl86lDek5MwUCRXWX9Oeh2LH54EH0QbZHguUzkq?= =?us-ascii?q?bDsZDaIcobprS+Aw9Qyosj9xe/DzWi0NkDk3kHNkxKdwycgIjyJl7COvf4De2w?= =?us-ascii?q?g1i0ijdk2+jGPqH9ApXKNnXDi6nhfbBk505H0go80clT55JKBb4bPf3+QUHxtM?= =?us-ascii?q?bGARAnKAO02PvoBM961oMEVmKFGrWZP7/KsV+U+uIvJPGBZJQLuDb7MvQl/OTu?= =?us-ascii?q?gmMglVAHeamp2YAaaH6iHvt4PUqWemHsjcobHWcNpAo+Q/TgiEeeXj5Le3ayQ6?= =?us-ascii?q?U86ykgCIK8EYjPX5yigLuE3Ce+H51WenxGBU6WEXfzbIiEVe0MZzyMLcB6iTwL?= =?us-ascii?q?SKKtS4g71RGhrAX60aZoLvLI+i0EspLuzMZ66PfOmhE26zN0Fd+Q02+XT25qgG?= =?us-ascii?q?wHXCQ2071lrUx60FeD3vswv/sNON1P7vUBews+OISUm+FzB9T/QCrvZNqEYm2K?= =?us-ascii?q?BNK8DmdiYMg2xooyhEI1MNKllR3G1iyxS+sJlr6PLLIu/6/25FS3INxynSWVnJ?= =?us-ascii?q?I9hkUrF5McfVatgbRyok2KX9bE?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2D5EQBsNCJb/6i1QlddHAEBAQQBAQoBA?= =?us-ascii?q?YNIVA5tEhUTjFyLcAEBgX4xAZQ7gXguhEkCgkIiNhYBAgEBAQEBAQIBbBwMQgE?= =?us-ascii?q?ECQGBZCQBgk8BBTocIxALDgYECSUPKh4GE4MkggMLrRSIISaBYwWKXoQbhHWFV?= =?us-ascii?q?gKZDgmFeYh9jUOKDYh8CSiBUk0wCIJ+giEXiFmFQD0wh0SCGocuAQE?= X-IPAS-Result: =?us-ascii?q?A2D5EQBsNCJb/6i1QlddHAEBAQQBAQoBAYNIVA5tEhUTjFy?= =?us-ascii?q?LcAEBgX4xAZQ7gXguhEkCgkIiNhYBAgEBAQEBAQIBbBwMQgEECQGBZCQBgk8BB?= =?us-ascii?q?TocIxALDgYECSUPKh4GE4MkggMLrRSIISaBYwWKXoQbhHWFVgKZDgmFeYh9jUO?= =?us-ascii?q?KDYh8CSiBUk0wCIJ+giEXiFmFQD0wh0SCGocuAQE?= Received: from 168.181-66-87.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([87.66.181.168]) by relay.skynet.be with ESMTP; 14 Jun 2018 11:27:22 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.15.2/8.15.2) with ESMTP id w5E9RK14031973; Thu, 14 Jun 2018 11:27:21 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Date: Thu, 14 Jun 2018 11:27:20 +0200 From: =?UTF-8?B?VMSzbA==?= Coosemans To: Eitan Adler Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334869 - head/usr.bin/top Message-ID: <20180614112720.7bd13a9e@kalimero.tijl.coosemans.org> In-Reply-To: <201806090247.w592l2b2071661@repo.freebsd.org> References: <201806090247.w592l2b2071661@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 09:28:38 -0000 On Sat, 9 Jun 2018 02:47:02 +0000 (UTC) Eitan Adler wrote: > Author: eadler > Date: Sat Jun 9 02:47:02 2018 > New Revision: 334869 > URL: https://svnweb.freebsd.org/changeset/base/334869 > > Log: > top(1): correct header, align it. > > THR is always 6 digits or longer. Now that the PID/THR change is > separated, use correct headers. > > PR: 228823 > Reported by: Trond.Endrestol@ximalas.info > > Modified: > head/usr.bin/top/machine.c > > Modified: head/usr.bin/top/machine.c > ============================================================================== > --- head/usr.bin/top/machine.c Sat Jun 9 02:41:51 2018 (r334868) > +++ head/usr.bin/top/machine.c Sat Jun 9 02:47:02 2018 (r334869) > @@ -94,17 +94,20 @@ static const char io_header[] = > static const char io_Proc_format[] = > "%5d%*s %-*.*s %6ld %6ld %6ld %6ld %6ld %6ld %6.2f%% %.*s"; > > +/* XXX: build up header instead of statically defining them. > + * This will also allow for a "format string" to be supplied > + * as an argument to top(1) instead of having predefined options */ > static const char smp_header_thr_and_pid[] = > - " PID%*s %-*.*s THR PRI NICE SIZE RES%*s STATE C TIME %7s COMMAND"; > -static const char smp_header_tid_only[] = > - " THR%*s %-*.*s " "PRI NICE SIZE RES%*s STATE C TIME %7s COMMAND"; > + " %s%*s %-*.*s THR PRI NICE SIZE RES%*s STATE C TIME %7s COMMAND"; > +static const char smp_header_id_only[] = > + " %s%*s %-*.*s PRI NICE SIZE RES%*s STATE C TIME %7s COMMAND"; > static const char smp_Proc_format[] = > "%5d%*s %-*.*s %s%3d %4s%7s %6s%*.*s %-6.6s %2d%7s %6.2f%% %.*s"; > > static char up_header_thr_and_pid[] = > " PID%*s %-*.*s THR PRI NICE SIZE RES%*s STATE TIME %7s COMMAND"; You need to replace PID with %s here as well. > -static char up_header_tid_only[] = > - " THR%*s %-*.*s " "PRI NICE SIZE RES%*s STATE TIME %7s COMMAND"; > +static char up_header_id_only[] = > + " %s%*s %-*.*s PRI NICE SIZE RES%*s STATE TIME %7s COMMAND"; > static char up_Proc_format[] = > "%5d%*s %-*.*s %s%3d %4s%7s %6s%*.*s %-6.6s%.0d%7s %6.2f%% %.*s"; From owner-svn-src-head@freebsd.org Thu Jun 14 09:29:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8242101571A; Thu, 14 Jun 2018 09:29:40 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6E1F57FEB9; Thu, 14 Jun 2018 09:29:40 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4F689268AF; Thu, 14 Jun 2018 09:29:40 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5E9Tetu051455; Thu, 14 Jun 2018 09:29:40 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5E9Te0t051454; Thu, 14 Jun 2018 09:29:40 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201806140929.w5E9Te0t051454@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 14 Jun 2018 09:29:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335128 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 335128 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 09:29:40 -0000 Author: ae Date: Thu Jun 14 09:29:39 2018 New Revision: 335128 URL: https://svnweb.freebsd.org/changeset/base/335128 Log: Remove stale comment. in6_ifdetach() can be called from places where addresses are not removed yet. Modified: head/sys/netinet6/in6_ifattach.c Modified: head/sys/netinet6/in6_ifattach.c ============================================================================== --- head/sys/netinet6/in6_ifattach.c Thu Jun 14 09:10:34 2018 (r335127) +++ head/sys/netinet6/in6_ifattach.c Thu Jun 14 09:29:39 2018 (r335128) @@ -749,7 +749,6 @@ _in6_ifdetach(struct ifnet *ifp, int purgeulp) /* * nuke any of IPv6 addresses we have - * XXX: all addresses should be already removed */ CK_STAILQ_FOREACH_SAFE(ifa, &ifp->if_addrhead, ifa_link, next) { if (ifa->ifa_addr->sa_family != AF_INET6) From owner-svn-src-head@freebsd.org Thu Jun 14 09:36:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE1FF101621E; Thu, 14 Jun 2018 09:36:25 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A0CE38079D; Thu, 14 Jun 2018 09:36:25 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8188D26A78; Thu, 14 Jun 2018 09:36:25 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5E9aPB5056651; Thu, 14 Jun 2018 09:36:25 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5E9aP5e056650; Thu, 14 Jun 2018 09:36:25 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201806140936.w5E9aP5e056650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 14 Jun 2018 09:36:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335129 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 335129 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 09:36:26 -0000 Author: ae Date: Thu Jun 14 09:36:25 2018 New Revision: 335129 URL: https://svnweb.freebsd.org/changeset/base/335129 Log: Add NULL check like the rest of code has. It is possible that ifma_protospec becomes NULL in this function for some entry, but it is still referenced and thus it will not unlinked from the list. Then "restart" condition triggers and this entry with NULL ifma_protospec will lead to page fault. PR: 228982 Modified: head/sys/netinet6/mld6.c Modified: head/sys/netinet6/mld6.c ============================================================================== --- head/sys/netinet6/mld6.c Thu Jun 14 09:29:39 2018 (r335128) +++ head/sys/netinet6/mld6.c Thu Jun 14 09:36:25 2018 (r335129) @@ -1679,7 +1679,8 @@ mld_v2_cancel_link_timers(struct mld_ifsoftc *mli) IF_ADDR_WLOCK(ifp); restart: CK_STAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, next) { - if (ifma->ifma_addr->sa_family != AF_INET6) + if (ifma->ifma_addr->sa_family != AF_INET6 || + ifma->ifma_protospec == NULL) continue; inm = (struct in6_multi *)ifma->ifma_protospec; switch (inm->in6m_state) { From owner-svn-src-head@freebsd.org Thu Jun 14 10:00:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 528481018212; Thu, 14 Jun 2018 10:00:21 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E9BB081739; Thu, 14 Jun 2018 10:00:20 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD2EE26DC8; Thu, 14 Jun 2018 10:00:20 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5EA0Kse067178; Thu, 14 Jun 2018 10:00:20 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5EA0Jg7067172; Thu, 14 Jun 2018 10:00:19 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201806141000.w5EA0Jg7067172@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 14 Jun 2018 10:00:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335130 - in head/sys/fs: nfs nfsclient X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in head/sys/fs: nfs nfsclient X-SVN-Commit-Revision: 335130 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 10:00:21 -0000 Author: rmacklem Date: Thu Jun 14 10:00:19 2018 New Revision: 335130 URL: https://svnweb.freebsd.org/changeset/base/335130 Log: Move four functions in nfscl.ko to nfscommon.ko. Four functions nfscl_reqstart(), nfscl_fillsattr(), nfsm_stateidtom() and nfsmnt_mdssession() are now called from within the nfsd. As such, they needed to be moved from nfscl.ko to nfscommon.ko so that nfsd.ko would load when nfscl.ko wasn't loaded. Reported by: herbert@gojira.at Modified: head/sys/fs/nfs/nfs_commonsubs.c head/sys/fs/nfs/nfs_var.h head/sys/fs/nfs/nfsport.h head/sys/fs/nfsclient/nfs_clcomsubs.c head/sys/fs/nfsclient/nfs_clport.c head/sys/fs/nfsclient/nfsmount.h Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Thu Jun 14 09:36:25 2018 (r335129) +++ head/sys/fs/nfs/nfs_commonsubs.c Thu Jun 14 10:00:19 2018 (r335130) @@ -79,6 +79,7 @@ extern struct mtx nfsrv_dslock_mtx; extern volatile int nfsrv_devidcnt; extern int nfscl_debuglevel; extern struct nfsdevicehead nfsrv_devidhead; +extern struct nfsstatsv1 nfsstatsv1; SYSCTL_DECL(_vfs_nfs); SYSCTL_INT(_vfs_nfs, OID_AUTO, enable_uidtostring, CTLFLAG_RW, @@ -189,7 +190,7 @@ static struct nfsrv_lughash *nfsgroupnamehash; * marked 0 in this array, the code will still work, just not quite as * efficiently.) */ -int nfs_bigreply[NFSV41_NPROCS] = { 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, +static int nfs_bigreply[NFSV41_NPROCS] = { 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }; @@ -204,6 +205,362 @@ static int nfsrv_getrefstr(struct nfsrv_descript *, u_ int *, int *); static void nfsrv_refstrbigenough(int, u_char **, u_char **, int *); +static struct { + int op; + int opcnt; + const u_char *tag; + int taglen; +} nfsv4_opmap[NFSV41_NPROCS] = { + { 0, 1, "Null", 4 }, + { NFSV4OP_GETATTR, 1, "Getattr", 7, }, + { NFSV4OP_SETATTR, 2, "Setattr", 7, }, + { NFSV4OP_LOOKUP, 3, "Lookup", 6, }, + { NFSV4OP_ACCESS, 2, "Access", 6, }, + { NFSV4OP_READLINK, 2, "Readlink", 8, }, + { NFSV4OP_READ, 1, "Read", 4, }, + { NFSV4OP_WRITE, 2, "Write", 5, }, + { NFSV4OP_OPEN, 5, "Open", 4, }, + { NFSV4OP_CREATE, 5, "Create", 6, }, + { NFSV4OP_CREATE, 1, "Create", 6, }, + { NFSV4OP_CREATE, 3, "Create", 6, }, + { NFSV4OP_REMOVE, 1, "Remove", 6, }, + { NFSV4OP_REMOVE, 1, "Remove", 6, }, + { NFSV4OP_SAVEFH, 5, "Rename", 6, }, + { NFSV4OP_SAVEFH, 4, "Link", 4, }, + { NFSV4OP_READDIR, 2, "Readdir", 7, }, + { NFSV4OP_READDIR, 2, "Readdir", 7, }, + { NFSV4OP_GETATTR, 1, "Getattr", 7, }, + { NFSV4OP_GETATTR, 1, "Getattr", 7, }, + { NFSV4OP_GETATTR, 1, "Getattr", 7, }, + { NFSV4OP_COMMIT, 2, "Commit", 6, }, + { NFSV4OP_LOOKUPP, 3, "Lookupp", 7, }, + { NFSV4OP_SETCLIENTID, 1, "SetClientID", 11, }, + { NFSV4OP_SETCLIENTIDCFRM, 1, "SetClientIDConfirm", 18, }, + { NFSV4OP_LOCK, 1, "Lock", 4, }, + { NFSV4OP_LOCKU, 1, "LockU", 5, }, + { NFSV4OP_OPEN, 2, "Open", 4, }, + { NFSV4OP_CLOSE, 1, "Close", 5, }, + { NFSV4OP_OPENCONFIRM, 1, "Openconfirm", 11, }, + { NFSV4OP_LOCKT, 1, "LockT", 5, }, + { NFSV4OP_OPENDOWNGRADE, 1, "Opendowngrade", 13, }, + { NFSV4OP_RENEW, 1, "Renew", 5, }, + { NFSV4OP_PUTROOTFH, 1, "Dirpath", 7, }, + { NFSV4OP_RELEASELCKOWN, 1, "Rellckown", 9, }, + { NFSV4OP_DELEGRETURN, 1, "Delegret", 8, }, + { NFSV4OP_DELEGRETURN, 3, "DelegRemove", 11, }, + { NFSV4OP_DELEGRETURN, 7, "DelegRename1", 12, }, + { NFSV4OP_DELEGRETURN, 9, "DelegRename2", 12, }, + { NFSV4OP_GETATTR, 1, "Getacl", 6, }, + { NFSV4OP_SETATTR, 1, "Setacl", 6, }, + { NFSV4OP_EXCHANGEID, 1, "ExchangeID", 10, }, + { NFSV4OP_CREATESESSION, 1, "CreateSession", 13, }, + { NFSV4OP_DESTROYSESSION, 1, "DestroySession", 14, }, + { NFSV4OP_DESTROYCLIENTID, 1, "DestroyClient", 13, }, + { NFSV4OP_FREESTATEID, 1, "FreeStateID", 11, }, + { NFSV4OP_LAYOUTGET, 1, "LayoutGet", 9, }, + { NFSV4OP_GETDEVINFO, 1, "GetDeviceInfo", 13, }, + { NFSV4OP_LAYOUTCOMMIT, 1, "LayoutCommit", 12, }, + { NFSV4OP_LAYOUTRETURN, 1, "LayoutReturn", 12, }, + { NFSV4OP_RECLAIMCOMPL, 1, "ReclaimComplete", 15, }, + { NFSV4OP_WRITE, 1, "WriteDS", 7, }, + { NFSV4OP_READ, 1, "ReadDS", 6, }, + { NFSV4OP_COMMIT, 1, "CommitDS", 8, }, + { NFSV4OP_OPEN, 3, "OpenLayoutGet", 13, }, + { NFSV4OP_OPEN, 8, "CreateLayGet", 12, }, +}; + +/* + * NFS RPCS that have large request message size. + */ +static int nfs_bigrequest[NFSV41_NPROCS] = { + 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 +}; + +/* + * Start building a request. Mostly just put the first file handle in + * place. + */ +APPLESTATIC void +nfscl_reqstart(struct nfsrv_descript *nd, int procnum, struct nfsmount *nmp, + u_int8_t *nfhp, int fhlen, u_int32_t **opcntpp, struct nfsclsession *sep, + int vers, int minorvers) +{ + struct mbuf *mb; + u_int32_t *tl; + int opcnt; + nfsattrbit_t attrbits; + + /* + * First, fill in some of the fields of nd. + */ + nd->nd_slotseq = NULL; + if (vers == NFS_VER4) { + nd->nd_flag = ND_NFSV4 | ND_NFSCL; + if (minorvers == NFSV41_MINORVERSION) + nd->nd_flag |= ND_NFSV41; + } else if (vers == NFS_VER3) + nd->nd_flag = ND_NFSV3 | ND_NFSCL; + else { + if (NFSHASNFSV4(nmp)) { + nd->nd_flag = ND_NFSV4 | ND_NFSCL; + if (NFSHASNFSV4N(nmp)) + nd->nd_flag |= ND_NFSV41; + } else if (NFSHASNFSV3(nmp)) + nd->nd_flag = ND_NFSV3 | ND_NFSCL; + else + nd->nd_flag = ND_NFSV2 | ND_NFSCL; + } + nd->nd_procnum = procnum; + nd->nd_repstat = 0; + + /* + * Get the first mbuf for the request. + */ + if (nfs_bigrequest[procnum]) + NFSMCLGET(mb, M_WAITOK); + else + NFSMGET(mb); + mbuf_setlen(mb, 0); + nd->nd_mreq = nd->nd_mb = mb; + nd->nd_bpos = NFSMTOD(mb, caddr_t); + + /* + * And fill the first file handle into the request. + */ + if (nd->nd_flag & ND_NFSV4) { + opcnt = nfsv4_opmap[procnum].opcnt + + nfsv4_opflag[nfsv4_opmap[procnum].op].needscfh; + if ((nd->nd_flag & ND_NFSV41) != 0) { + opcnt += nfsv4_opflag[nfsv4_opmap[procnum].op].needsseq; + if (procnum == NFSPROC_RENEW) + /* + * For the special case of Renew, just do a + * Sequence Op. + */ + opcnt = 1; + else if (procnum == NFSPROC_WRITEDS || + procnum == NFSPROC_COMMITDS) + /* + * For the special case of a Writeor Commit to + * a DS, the opcnt == 3, for Sequence, PutFH, + * Write/Commit. + */ + opcnt = 3; + } + /* + * What should the tag really be? + */ + (void) nfsm_strtom(nd, nfsv4_opmap[procnum].tag, + nfsv4_opmap[procnum].taglen); + NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); + if ((nd->nd_flag & ND_NFSV41) != 0) + *tl++ = txdr_unsigned(NFSV41_MINORVERSION); + else + *tl++ = txdr_unsigned(NFSV4_MINORVERSION); + if (opcntpp != NULL) + *opcntpp = tl; + *tl = txdr_unsigned(opcnt); + if ((nd->nd_flag & ND_NFSV41) != 0 && + nfsv4_opflag[nfsv4_opmap[procnum].op].needsseq > 0) { + if (nfsv4_opflag[nfsv4_opmap[procnum].op].loopbadsess > + 0) + nd->nd_flag |= ND_LOOPBADSESS; + NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); + *tl = txdr_unsigned(NFSV4OP_SEQUENCE); + if (sep == NULL) { + sep = nfsmnt_mdssession(nmp); + nfsv4_setsequence(nmp, nd, sep, + nfs_bigreply[procnum]); + } else + nfsv4_setsequence(nmp, nd, sep, + nfs_bigreply[procnum]); + } + if (nfsv4_opflag[nfsv4_opmap[procnum].op].needscfh > 0) { + NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); + *tl = txdr_unsigned(NFSV4OP_PUTFH); + (void) nfsm_fhtom(nd, nfhp, fhlen, 0); + if (nfsv4_opflag[nfsv4_opmap[procnum].op].needscfh + == 2 && procnum != NFSPROC_WRITEDS && + procnum != NFSPROC_COMMITDS) { + NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); + *tl = txdr_unsigned(NFSV4OP_GETATTR); + /* + * For Lookup Ops, we want all the directory + * attributes, so we can load the name cache. + */ + if (procnum == NFSPROC_LOOKUP || + procnum == NFSPROC_LOOKUPP) + NFSGETATTR_ATTRBIT(&attrbits); + else { + NFSWCCATTR_ATTRBIT(&attrbits); + nd->nd_flag |= ND_V4WCCATTR; + } + (void) nfsrv_putattrbit(nd, &attrbits); + } + } + if (procnum != NFSPROC_RENEW || + (nd->nd_flag & ND_NFSV41) == 0) { + NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); + *tl = txdr_unsigned(nfsv4_opmap[procnum].op); + } + } else { + (void) nfsm_fhtom(nd, nfhp, fhlen, 0); + } + if (procnum < NFSV41_NPROCS) + NFSINCRGLOBAL(nfsstatsv1.rpccnt[procnum]); +} + +/* + * Put a state Id in the mbuf list. + */ +APPLESTATIC void +nfsm_stateidtom(struct nfsrv_descript *nd, nfsv4stateid_t *stateidp, int flag) +{ + nfsv4stateid_t *st; + + NFSM_BUILD(st, nfsv4stateid_t *, NFSX_STATEID); + if (flag == NFSSTATEID_PUTALLZERO) { + st->seqid = 0; + st->other[0] = 0; + st->other[1] = 0; + st->other[2] = 0; + } else if (flag == NFSSTATEID_PUTALLONE) { + st->seqid = 0xffffffff; + st->other[0] = 0xffffffff; + st->other[1] = 0xffffffff; + st->other[2] = 0xffffffff; + } else if (flag == NFSSTATEID_PUTSEQIDZERO) { + st->seqid = 0; + st->other[0] = stateidp->other[0]; + st->other[1] = stateidp->other[1]; + st->other[2] = stateidp->other[2]; + } else { + st->seqid = stateidp->seqid; + st->other[0] = stateidp->other[0]; + st->other[1] = stateidp->other[1]; + st->other[2] = stateidp->other[2]; + } +} + +/* + * Fill in the setable attributes. The full argument indicates whether + * to fill in them all or just mode and time. + */ +void +nfscl_fillsattr(struct nfsrv_descript *nd, struct vattr *vap, + struct vnode *vp, int flags, u_int32_t rdev) +{ + u_int32_t *tl; + struct nfsv2_sattr *sp; + nfsattrbit_t attrbits; + + switch (nd->nd_flag & (ND_NFSV2 | ND_NFSV3 | ND_NFSV4)) { + case ND_NFSV2: + NFSM_BUILD(sp, struct nfsv2_sattr *, NFSX_V2SATTR); + if (vap->va_mode == (mode_t)VNOVAL) + sp->sa_mode = newnfs_xdrneg1; + else + sp->sa_mode = vtonfsv2_mode(vap->va_type, vap->va_mode); + if (vap->va_uid == (uid_t)VNOVAL) + sp->sa_uid = newnfs_xdrneg1; + else + sp->sa_uid = txdr_unsigned(vap->va_uid); + if (vap->va_gid == (gid_t)VNOVAL) + sp->sa_gid = newnfs_xdrneg1; + else + sp->sa_gid = txdr_unsigned(vap->va_gid); + if (flags & NFSSATTR_SIZE0) + sp->sa_size = 0; + else if (flags & NFSSATTR_SIZENEG1) + sp->sa_size = newnfs_xdrneg1; + else if (flags & NFSSATTR_SIZERDEV) + sp->sa_size = txdr_unsigned(rdev); + else + sp->sa_size = txdr_unsigned(vap->va_size); + txdr_nfsv2time(&vap->va_atime, &sp->sa_atime); + txdr_nfsv2time(&vap->va_mtime, &sp->sa_mtime); + break; + case ND_NFSV3: + if (vap->va_mode != (mode_t)VNOVAL) { + NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); + *tl++ = newnfs_true; + *tl = txdr_unsigned(vap->va_mode); + } else { + NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); + *tl = newnfs_false; + } + if ((flags & NFSSATTR_FULL) && vap->va_uid != (uid_t)VNOVAL) { + NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); + *tl++ = newnfs_true; + *tl = txdr_unsigned(vap->va_uid); + } else { + NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); + *tl = newnfs_false; + } + if ((flags & NFSSATTR_FULL) && vap->va_gid != (gid_t)VNOVAL) { + NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); + *tl++ = newnfs_true; + *tl = txdr_unsigned(vap->va_gid); + } else { + NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); + *tl = newnfs_false; + } + if ((flags & NFSSATTR_FULL) && vap->va_size != VNOVAL) { + NFSM_BUILD(tl, u_int32_t *, 3 * NFSX_UNSIGNED); + *tl++ = newnfs_true; + txdr_hyper(vap->va_size, tl); + } else { + NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); + *tl = newnfs_false; + } + if (vap->va_atime.tv_sec != VNOVAL) { + if ((vap->va_vaflags & VA_UTIMES_NULL) == 0) { + NFSM_BUILD(tl, u_int32_t *, 3 * NFSX_UNSIGNED); + *tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT); + txdr_nfsv3time(&vap->va_atime, tl); + } else { + NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); + *tl = txdr_unsigned(NFSV3SATTRTIME_TOSERVER); + } + } else { + NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); + *tl = txdr_unsigned(NFSV3SATTRTIME_DONTCHANGE); + } + if (vap->va_mtime.tv_sec != VNOVAL) { + if ((vap->va_vaflags & VA_UTIMES_NULL) == 0) { + NFSM_BUILD(tl, u_int32_t *, 3 * NFSX_UNSIGNED); + *tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT); + txdr_nfsv3time(&vap->va_mtime, tl); + } else { + NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); + *tl = txdr_unsigned(NFSV3SATTRTIME_TOSERVER); + } + } else { + NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); + *tl = txdr_unsigned(NFSV3SATTRTIME_DONTCHANGE); + } + break; + case ND_NFSV4: + NFSZERO_ATTRBIT(&attrbits); + if (vap->va_mode != (mode_t)VNOVAL) + NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_MODE); + if ((flags & NFSSATTR_FULL) && vap->va_uid != (uid_t)VNOVAL) + NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_OWNER); + if ((flags & NFSSATTR_FULL) && vap->va_gid != (gid_t)VNOVAL) + NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_OWNERGROUP); + if ((flags & NFSSATTR_FULL) && vap->va_size != VNOVAL) + NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_SIZE); + if (vap->va_atime.tv_sec != VNOVAL) + NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_TIMEACCESSSET); + if (vap->va_mtime.tv_sec != VNOVAL) + NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_TIMEMODIFYSET); + (void) nfsv4_fillattr(nd, vp->v_mount, vp, NULL, vap, NULL, 0, + &attrbits, NULL, NULL, 0, 0, 0, 0, (uint64_t)0, NULL); + break; + } +} #ifndef APPLE /* Modified: head/sys/fs/nfs/nfs_var.h ============================================================================== --- head/sys/fs/nfs/nfs_var.h Thu Jun 14 09:36:25 2018 (r335129) +++ head/sys/fs/nfs/nfs_var.h Thu Jun 14 10:00:19 2018 (r335130) @@ -298,6 +298,11 @@ void nfsrvd_delcache(struct nfsrvcache *); void nfsrc_trimcache(uint64_t, uint32_t, int); /* nfs_commonsubs.c */ +void nfscl_reqstart(struct nfsrv_descript *, int, struct nfsmount *, + u_int8_t *, int, u_int32_t **, struct nfsclsession *, int, int); +void nfsm_stateidtom(struct nfsrv_descript *, nfsv4stateid_t *, int); +void nfscl_fillsattr(struct nfsrv_descript *, struct vattr *, + vnode_t, int, u_int32_t); void newnfs_init(void); int nfsaddr_match(int, union nethostaddr *, NFSSOCKADDR_T); int nfsaddr2_match(NFSSOCKADDR_T, NFSSOCKADDR_T); @@ -347,11 +352,7 @@ struct nfsdevice *nfsv4_findmirror(struct nfsmount *); /* nfs_clcomsubs.c */ void nfsm_uiombuf(struct nfsrv_descript *, struct uio *, int); struct mbuf *nfsm_uiombuflist(struct uio *, int, struct mbuf **, char **); -void nfscl_reqstart(struct nfsrv_descript *, int, struct nfsmount *, - u_int8_t *, int, u_int32_t **, struct nfsclsession *, int, int); nfsuint64 *nfscl_getcookie(struct nfsnode *, off_t off, int); -void nfscl_fillsattr(struct nfsrv_descript *, struct vattr *, - vnode_t, int, u_int32_t); u_int8_t *nfscl_getmyip(struct nfsmount *, struct in6_addr *, int *); int nfsm_getfh(struct nfsrv_descript *, struct nfsfh **); int nfscl_mtofh(struct nfsrv_descript *, struct nfsfh **, @@ -363,7 +364,6 @@ int nfscl_wcc_data(struct nfsrv_descript *, vnode_t, int nfsm_loadattr(struct nfsrv_descript *, struct nfsvattr *); int nfscl_request(struct nfsrv_descript *, vnode_t, NFSPROC_T *, struct ucred *, void *); -void nfsm_stateidtom(struct nfsrv_descript *, nfsv4stateid_t *, int); /* nfs_nfsdsubs.c */ void nfsd_fhtovp(struct nfsrv_descript *, struct nfsrvfh *, int, Modified: head/sys/fs/nfs/nfsport.h ============================================================================== --- head/sys/fs/nfs/nfsport.h Thu Jun 14 09:36:25 2018 (r335129) +++ head/sys/fs/nfs/nfsport.h Thu Jun 14 10:00:19 2018 (r335130) @@ -1054,6 +1054,27 @@ extern const char nfs_vnode_tag[]; */ #define nfsds_failerr(e) ((e) == ENXIO || (e) == EIO) +/* + * Get a pointer to the MDS session, which is always the first element + * in the list. + * This macro can only be safely used when the NFSLOCKMNT() lock is held. + * The inline function can be used when the lock isn't held. + */ +#define NFSMNT_MDSSESSION(m) (&(TAILQ_FIRST(&((m)->nm_sess))->nfsclds_sess)) + +static __inline struct nfsclsession * +nfsmnt_mdssession(struct nfsmount *nmp) +{ + struct nfsclsession *tsep; + + tsep = NULL; + mtx_lock(&nmp->nm_mtx); + if (TAILQ_FIRST(&nmp->nm_sess) != NULL) + tsep = NFSMNT_MDSSESSION(nmp); + mtx_unlock(&nmp->nm_mtx); + return (tsep); +} + #endif /* _KERNEL */ #endif /* _NFS_NFSPORT_H */ Modified: head/sys/fs/nfsclient/nfs_clcomsubs.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clcomsubs.c Thu Jun 14 09:36:25 2018 (r335129) +++ head/sys/fs/nfsclient/nfs_clcomsubs.c Thu Jun 14 10:00:19 2018 (r335130) @@ -49,219 +49,12 @@ extern struct nfsv4_opflag nfsv4_opflag[NFSV41_NOPS]; extern int ncl_mbuf_mlen; extern enum vtype newnv2tov_type[8]; extern enum vtype nv34tov_type[8]; -extern int nfs_bigreply[NFSV41_NPROCS]; NFSCLSTATEMUTEX; #endif /* !APPLEKEXT */ static nfsuint64 nfs_nullcookie = {{ 0, 0 }}; -static struct { - int op; - int opcnt; - const u_char *tag; - int taglen; -} nfsv4_opmap[NFSV41_NPROCS] = { - { 0, 1, "Null", 4 }, - { NFSV4OP_GETATTR, 1, "Getattr", 7, }, - { NFSV4OP_SETATTR, 2, "Setattr", 7, }, - { NFSV4OP_LOOKUP, 3, "Lookup", 6, }, - { NFSV4OP_ACCESS, 2, "Access", 6, }, - { NFSV4OP_READLINK, 2, "Readlink", 8, }, - { NFSV4OP_READ, 1, "Read", 4, }, - { NFSV4OP_WRITE, 2, "Write", 5, }, - { NFSV4OP_OPEN, 5, "Open", 4, }, - { NFSV4OP_CREATE, 5, "Create", 6, }, - { NFSV4OP_CREATE, 1, "Create", 6, }, - { NFSV4OP_CREATE, 3, "Create", 6, }, - { NFSV4OP_REMOVE, 1, "Remove", 6, }, - { NFSV4OP_REMOVE, 1, "Remove", 6, }, - { NFSV4OP_SAVEFH, 5, "Rename", 6, }, - { NFSV4OP_SAVEFH, 4, "Link", 4, }, - { NFSV4OP_READDIR, 2, "Readdir", 7, }, - { NFSV4OP_READDIR, 2, "Readdir", 7, }, - { NFSV4OP_GETATTR, 1, "Getattr", 7, }, - { NFSV4OP_GETATTR, 1, "Getattr", 7, }, - { NFSV4OP_GETATTR, 1, "Getattr", 7, }, - { NFSV4OP_COMMIT, 2, "Commit", 6, }, - { NFSV4OP_LOOKUPP, 3, "Lookupp", 7, }, - { NFSV4OP_SETCLIENTID, 1, "SetClientID", 11, }, - { NFSV4OP_SETCLIENTIDCFRM, 1, "SetClientIDConfirm", 18, }, - { NFSV4OP_LOCK, 1, "Lock", 4, }, - { NFSV4OP_LOCKU, 1, "LockU", 5, }, - { NFSV4OP_OPEN, 2, "Open", 4, }, - { NFSV4OP_CLOSE, 1, "Close", 5, }, - { NFSV4OP_OPENCONFIRM, 1, "Openconfirm", 11, }, - { NFSV4OP_LOCKT, 1, "LockT", 5, }, - { NFSV4OP_OPENDOWNGRADE, 1, "Opendowngrade", 13, }, - { NFSV4OP_RENEW, 1, "Renew", 5, }, - { NFSV4OP_PUTROOTFH, 1, "Dirpath", 7, }, - { NFSV4OP_RELEASELCKOWN, 1, "Rellckown", 9, }, - { NFSV4OP_DELEGRETURN, 1, "Delegret", 8, }, - { NFSV4OP_DELEGRETURN, 3, "DelegRemove", 11, }, - { NFSV4OP_DELEGRETURN, 7, "DelegRename1", 12, }, - { NFSV4OP_DELEGRETURN, 9, "DelegRename2", 12, }, - { NFSV4OP_GETATTR, 1, "Getacl", 6, }, - { NFSV4OP_SETATTR, 1, "Setacl", 6, }, - { NFSV4OP_EXCHANGEID, 1, "ExchangeID", 10, }, - { NFSV4OP_CREATESESSION, 1, "CreateSession", 13, }, - { NFSV4OP_DESTROYSESSION, 1, "DestroySession", 14, }, - { NFSV4OP_DESTROYCLIENTID, 1, "DestroyClient", 13, }, - { NFSV4OP_FREESTATEID, 1, "FreeStateID", 11, }, - { NFSV4OP_LAYOUTGET, 1, "LayoutGet", 9, }, - { NFSV4OP_GETDEVINFO, 1, "GetDeviceInfo", 13, }, - { NFSV4OP_LAYOUTCOMMIT, 1, "LayoutCommit", 12, }, - { NFSV4OP_LAYOUTRETURN, 1, "LayoutReturn", 12, }, - { NFSV4OP_RECLAIMCOMPL, 1, "ReclaimComplete", 15, }, - { NFSV4OP_WRITE, 1, "WriteDS", 7, }, - { NFSV4OP_READ, 1, "ReadDS", 6, }, - { NFSV4OP_COMMIT, 1, "CommitDS", 8, }, - { NFSV4OP_OPEN, 3, "OpenLayoutGet", 13, }, - { NFSV4OP_OPEN, 8, "CreateLayGet", 12, }, -}; /* - * NFS RPCS that have large request message size. - */ -static int nfs_bigrequest[NFSV41_NPROCS] = { - 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 -}; - -/* - * Start building a request. Mostly just put the first file handle in - * place. - */ -APPLESTATIC void -nfscl_reqstart(struct nfsrv_descript *nd, int procnum, struct nfsmount *nmp, - u_int8_t *nfhp, int fhlen, u_int32_t **opcntpp, struct nfsclsession *sep, - int vers, int minorvers) -{ - struct mbuf *mb; - u_int32_t *tl; - int opcnt; - nfsattrbit_t attrbits; - - /* - * First, fill in some of the fields of nd. - */ - nd->nd_slotseq = NULL; - if (vers == NFS_VER4) { - nd->nd_flag = ND_NFSV4 | ND_NFSCL; - if (minorvers == NFSV41_MINORVERSION) - nd->nd_flag |= ND_NFSV41; - } else if (vers == NFS_VER3) - nd->nd_flag = ND_NFSV3 | ND_NFSCL; - else { - if (NFSHASNFSV4(nmp)) { - nd->nd_flag = ND_NFSV4 | ND_NFSCL; - if (NFSHASNFSV4N(nmp)) - nd->nd_flag |= ND_NFSV41; - } else if (NFSHASNFSV3(nmp)) - nd->nd_flag = ND_NFSV3 | ND_NFSCL; - else - nd->nd_flag = ND_NFSV2 | ND_NFSCL; - } - nd->nd_procnum = procnum; - nd->nd_repstat = 0; - - /* - * Get the first mbuf for the request. - */ - if (nfs_bigrequest[procnum]) - NFSMCLGET(mb, M_WAITOK); - else - NFSMGET(mb); - mbuf_setlen(mb, 0); - nd->nd_mreq = nd->nd_mb = mb; - nd->nd_bpos = NFSMTOD(mb, caddr_t); - - /* - * And fill the first file handle into the request. - */ - if (nd->nd_flag & ND_NFSV4) { - opcnt = nfsv4_opmap[procnum].opcnt + - nfsv4_opflag[nfsv4_opmap[procnum].op].needscfh; - if ((nd->nd_flag & ND_NFSV41) != 0) { - opcnt += nfsv4_opflag[nfsv4_opmap[procnum].op].needsseq; - if (procnum == NFSPROC_RENEW) - /* - * For the special case of Renew, just do a - * Sequence Op. - */ - opcnt = 1; - else if (procnum == NFSPROC_WRITEDS || - procnum == NFSPROC_COMMITDS) - /* - * For the special case of a Writeor Commit to - * a DS, the opcnt == 3, for Sequence, PutFH, - * Write/Commit. - */ - opcnt = 3; - } - /* - * What should the tag really be? - */ - (void) nfsm_strtom(nd, nfsv4_opmap[procnum].tag, - nfsv4_opmap[procnum].taglen); - NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); - if ((nd->nd_flag & ND_NFSV41) != 0) - *tl++ = txdr_unsigned(NFSV41_MINORVERSION); - else - *tl++ = txdr_unsigned(NFSV4_MINORVERSION); - if (opcntpp != NULL) - *opcntpp = tl; - *tl = txdr_unsigned(opcnt); - if ((nd->nd_flag & ND_NFSV41) != 0 && - nfsv4_opflag[nfsv4_opmap[procnum].op].needsseq > 0) { - if (nfsv4_opflag[nfsv4_opmap[procnum].op].loopbadsess > - 0) - nd->nd_flag |= ND_LOOPBADSESS; - NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); - *tl = txdr_unsigned(NFSV4OP_SEQUENCE); - if (sep == NULL) { - sep = nfsmnt_mdssession(nmp); - nfsv4_setsequence(nmp, nd, sep, - nfs_bigreply[procnum]); - } else - nfsv4_setsequence(nmp, nd, sep, - nfs_bigreply[procnum]); - } - if (nfsv4_opflag[nfsv4_opmap[procnum].op].needscfh > 0) { - NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); - *tl = txdr_unsigned(NFSV4OP_PUTFH); - (void) nfsm_fhtom(nd, nfhp, fhlen, 0); - if (nfsv4_opflag[nfsv4_opmap[procnum].op].needscfh - == 2 && procnum != NFSPROC_WRITEDS && - procnum != NFSPROC_COMMITDS) { - NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); - *tl = txdr_unsigned(NFSV4OP_GETATTR); - /* - * For Lookup Ops, we want all the directory - * attributes, so we can load the name cache. - */ - if (procnum == NFSPROC_LOOKUP || - procnum == NFSPROC_LOOKUPP) - NFSGETATTR_ATTRBIT(&attrbits); - else { - NFSWCCATTR_ATTRBIT(&attrbits); - nd->nd_flag |= ND_V4WCCATTR; - } - (void) nfsrv_putattrbit(nd, &attrbits); - } - } - if (procnum != NFSPROC_RENEW || - (nd->nd_flag & ND_NFSV41) == 0) { - NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); - *tl = txdr_unsigned(nfsv4_opmap[procnum].op); - } - } else { - (void) nfsm_fhtom(nd, nfhp, fhlen, 0); - } - if (procnum < NFSV41_NPROCS) - NFSINCRGLOBAL(nfsstatsv1.rpccnt[procnum]); -} - -/* * copies a uio scatter/gather list to an mbuf chain. * NOTE: can ony handle iovcnt == 1 */ @@ -592,38 +385,6 @@ nfscl_mtofh(struct nfsrv_descript *nd, struct nfsfh ** } nfsmout: return (error); -} - -/* - * Put a state Id in the mbuf list. - */ -APPLESTATIC void -nfsm_stateidtom(struct nfsrv_descript *nd, nfsv4stateid_t *stateidp, int flag) -{ - nfsv4stateid_t *st; - - NFSM_BUILD(st, nfsv4stateid_t *, NFSX_STATEID); - if (flag == NFSSTATEID_PUTALLZERO) { - st->seqid = 0; - st->other[0] = 0; - st->other[1] = 0; - st->other[2] = 0; - } else if (flag == NFSSTATEID_PUTALLONE) { - st->seqid = 0xffffffff; - st->other[0] = 0xffffffff; - st->other[1] = 0xffffffff; - st->other[2] = 0xffffffff; - } else if (flag == NFSSTATEID_PUTSEQIDZERO) { - st->seqid = 0; - st->other[0] = stateidp->other[0]; - st->other[1] = stateidp->other[1]; - st->other[2] = stateidp->other[2]; - } else { - st->seqid = stateidp->seqid; - st->other[0] = stateidp->other[0]; - st->other[1] = stateidp->other[1]; - st->other[2] = stateidp->other[2]; - } } /* Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Thu Jun 14 09:36:25 2018 (r335129) +++ head/sys/fs/nfsclient/nfs_clport.c Thu Jun 14 10:00:19 2018 (r335130) @@ -819,124 +819,6 @@ nfsmout: } /* - * Fill in the setable attributes. The full argument indicates whether - * to fill in them all or just mode and time. - */ -void -nfscl_fillsattr(struct nfsrv_descript *nd, struct vattr *vap, - struct vnode *vp, int flags, u_int32_t rdev) -{ - u_int32_t *tl; - struct nfsv2_sattr *sp; - nfsattrbit_t attrbits; - - switch (nd->nd_flag & (ND_NFSV2 | ND_NFSV3 | ND_NFSV4)) { - case ND_NFSV2: - NFSM_BUILD(sp, struct nfsv2_sattr *, NFSX_V2SATTR); - if (vap->va_mode == (mode_t)VNOVAL) - sp->sa_mode = newnfs_xdrneg1; - else - sp->sa_mode = vtonfsv2_mode(vap->va_type, vap->va_mode); - if (vap->va_uid == (uid_t)VNOVAL) - sp->sa_uid = newnfs_xdrneg1; - else - sp->sa_uid = txdr_unsigned(vap->va_uid); - if (vap->va_gid == (gid_t)VNOVAL) - sp->sa_gid = newnfs_xdrneg1; - else - sp->sa_gid = txdr_unsigned(vap->va_gid); - if (flags & NFSSATTR_SIZE0) - sp->sa_size = 0; - else if (flags & NFSSATTR_SIZENEG1) - sp->sa_size = newnfs_xdrneg1; - else if (flags & NFSSATTR_SIZERDEV) - sp->sa_size = txdr_unsigned(rdev); - else - sp->sa_size = txdr_unsigned(vap->va_size); - txdr_nfsv2time(&vap->va_atime, &sp->sa_atime); - txdr_nfsv2time(&vap->va_mtime, &sp->sa_mtime); - break; - case ND_NFSV3: - if (vap->va_mode != (mode_t)VNOVAL) { - NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); - *tl++ = newnfs_true; - *tl = txdr_unsigned(vap->va_mode); - } else { - NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); - *tl = newnfs_false; - } - if ((flags & NFSSATTR_FULL) && vap->va_uid != (uid_t)VNOVAL) { - NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); - *tl++ = newnfs_true; - *tl = txdr_unsigned(vap->va_uid); - } else { - NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); - *tl = newnfs_false; - } - if ((flags & NFSSATTR_FULL) && vap->va_gid != (gid_t)VNOVAL) { - NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); - *tl++ = newnfs_true; - *tl = txdr_unsigned(vap->va_gid); - } else { - NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); - *tl = newnfs_false; - } - if ((flags & NFSSATTR_FULL) && vap->va_size != VNOVAL) { - NFSM_BUILD(tl, u_int32_t *, 3 * NFSX_UNSIGNED); - *tl++ = newnfs_true; - txdr_hyper(vap->va_size, tl); - } else { - NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); - *tl = newnfs_false; - } - if (vap->va_atime.tv_sec != VNOVAL) { - if ((vap->va_vaflags & VA_UTIMES_NULL) == 0) { - NFSM_BUILD(tl, u_int32_t *, 3 * NFSX_UNSIGNED); - *tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT); - txdr_nfsv3time(&vap->va_atime, tl); - } else { - NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); - *tl = txdr_unsigned(NFSV3SATTRTIME_TOSERVER); - } - } else { - NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); - *tl = txdr_unsigned(NFSV3SATTRTIME_DONTCHANGE); - } - if (vap->va_mtime.tv_sec != VNOVAL) { - if ((vap->va_vaflags & VA_UTIMES_NULL) == 0) { - NFSM_BUILD(tl, u_int32_t *, 3 * NFSX_UNSIGNED); - *tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT); - txdr_nfsv3time(&vap->va_mtime, tl); - } else { - NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); - *tl = txdr_unsigned(NFSV3SATTRTIME_TOSERVER); - } - } else { - NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); - *tl = txdr_unsigned(NFSV3SATTRTIME_DONTCHANGE); - } - break; - case ND_NFSV4: - NFSZERO_ATTRBIT(&attrbits); - if (vap->va_mode != (mode_t)VNOVAL) - NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_MODE); - if ((flags & NFSSATTR_FULL) && vap->va_uid != (uid_t)VNOVAL) - NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_OWNER); - if ((flags & NFSSATTR_FULL) && vap->va_gid != (gid_t)VNOVAL) - NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_OWNERGROUP); - if ((flags & NFSSATTR_FULL) && vap->va_size != VNOVAL) - NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_SIZE); - if (vap->va_atime.tv_sec != VNOVAL) - NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_TIMEACCESSSET); - if (vap->va_mtime.tv_sec != VNOVAL) - NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_TIMEMODIFYSET); - (void) nfsv4_fillattr(nd, vp->v_mount, vp, NULL, vap, NULL, 0, - &attrbits, NULL, NULL, 0, 0, 0, 0, (uint64_t)0, NULL); - break; - } -} - -/* * nfscl_request() - mostly a wrapper for newnfs_request(). */ int Modified: head/sys/fs/nfsclient/nfsmount.h ============================================================================== --- head/sys/fs/nfsclient/nfsmount.h Thu Jun 14 09:36:25 2018 (r335129) +++ head/sys/fs/nfsclient/nfsmount.h Thu Jun 14 10:00:19 2018 (r335130) @@ -116,27 +116,6 @@ struct nfsmount { */ #define VFSTONFS(mp) ((struct nfsmount *)((mp)->mnt_data)) -/* - * Get a pointer to the MDS session, which is always the first element - * in the list. - * This macro can only be safely used when the NFSLOCKMNT() lock is held. - * The inline function can be used when the lock isn't held. - */ -#define NFSMNT_MDSSESSION(m) (&(TAILQ_FIRST(&((m)->nm_sess))->nfsclds_sess)) - -static __inline struct nfsclsession * -nfsmnt_mdssession(struct nfsmount *nmp) -{ - struct nfsclsession *tsep; - - tsep = NULL; - mtx_lock(&nmp->nm_mtx); - if (TAILQ_FIRST(&nmp->nm_sess) != NULL) - tsep = NFSMNT_MDSSESSION(nmp); - mtx_unlock(&nmp->nm_mtx); - return (tsep); -} - #ifndef NFS_DEFAULT_NAMETIMEO #define NFS_DEFAULT_NAMETIMEO 60 #endif From owner-svn-src-head@freebsd.org Thu Jun 14 10:33:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BACCE101A866; Thu, 14 Jun 2018 10:33:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6FC6982DB6; Thu, 14 Jun 2018 10:33:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 50F8727426; Thu, 14 Jun 2018 10:33:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5EAXRJi086943; Thu, 14 Jun 2018 10:33:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5EAXQkL086941; Thu, 14 Jun 2018 10:33:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201806141033.w5EAXQkL086941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 14 Jun 2018 10:33:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335131 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 335131 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 10:33:27 -0000 Author: kib Date: Thu Jun 14 10:33:26 2018 New Revision: 335131 URL: https://svnweb.freebsd.org/changeset/base/335131 Log: Remove printf() in #NM handler. Give up and remove the almost useless informational message reporting that device not available exception occured while our state tracking indicates the current CPU has FPU context loaded for the current thread. It seems that this is recurring bug with some VM monitors. Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/amd64/fpu.c head/sys/i386/i386/npx.c Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Thu Jun 14 10:00:19 2018 (r335130) +++ head/sys/amd64/amd64/fpu.c Thu Jun 14 10:33:26 2018 (r335131) @@ -723,7 +723,12 @@ fpudna(void) KASSERT((curpcb->pcb_flags & PCB_FPUNOSAVE) == 0, ("fpudna while in fpu_kern_enter(FPU_KERN_NOCTX)")); if (PCPU_GET(fpcurthread) == td) { - printf("fpudna: fpcurthread == curthread\n"); + /* + * Some virtual machines seems to set %cr0.TS at + * arbitrary moments. Silently clear the TS bit + * regardless of the eager/lazy FPU context switch + * mode. + */ stop_emulating(); critical_exit(); return; Modified: head/sys/i386/i386/npx.c ============================================================================== --- head/sys/i386/i386/npx.c Thu Jun 14 10:00:19 2018 (r335130) +++ head/sys/i386/i386/npx.c Thu Jun 14 10:33:26 2018 (r335131) @@ -826,9 +826,6 @@ restore_npx_curthread(struct thread *td, struct pcb *p * and not necessarily for every context switch, but it is too hard to * access foreign pcb's. */ - -static int err_count = 0; - int npxdna(void) { @@ -839,8 +836,12 @@ npxdna(void) td = curthread; critical_enter(); if (PCPU_GET(fpcurthread) == td) { - printf("npxdna: fpcurthread == curthread %d times\n", - ++err_count); + /* + * Some virtual machines seems to set %cr0.TS at + * arbitrary moments. Silently clear the TS bit + * regardless of the eager/lazy FPU context switch + * mode. + */ stop_emulating(); critical_exit(); return (1); From owner-svn-src-head@freebsd.org Thu Jun 14 10:50:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3659101BB58; Thu, 14 Jun 2018 10:50:54 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 57C94836C5; Thu, 14 Jun 2018 10:50:54 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 6C9B2260199; Thu, 14 Jun 2018 12:50:52 +0200 (CEST) Subject: Re: svn commit: r335094 - head/sys/ofed/drivers/infiniband/core To: Bruce Evans Cc: Matthew Macy , Ryan Libby , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, bde@freebsd.org References: <201806132330.w5DNUsrE043573@repo.freebsd.org> <20180614182603.U1417@besplex.bde.org> From: Hans Petter Selasky Message-ID: <4aa93c89-686e-e344-8e04-c34069e8516d@selasky.org> Date: Thu, 14 Jun 2018 12:50:36 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180614182603.U1417@besplex.bde.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 10:50:54 -0000 On 06/14/18 10:46, Bruce Evans wrote: > Are these macros for conversion of host (FreeBSD) dev_t's or target (Linux) > ones?  If for the host, then I don't see any reason not to use the host > APIs. > If for the target, then they shouldn't be used with the host dev_t.  If for > a mixture, then the translations are very confusing, especially when they > are the identity, and many more macros are needed to reduce the confusion. Hi, These values are only used inside the LinuxKPI for creating character devices. They have no exposure to user-space. Basically: Z = MKDEV(X,Y) MAJOR(Z) must be equal to X MINOR(Z) must be equal to Y --HPS From owner-svn-src-head@freebsd.org Thu Jun 14 11:09:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 257AC101D1F8; Thu, 14 Jun 2018 11:09:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C730184338; Thu, 14 Jun 2018 11:09:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8EB9727905; Thu, 14 Jun 2018 11:09:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5EB9qud002682; Thu, 14 Jun 2018 11:09:52 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5EB9qGk002680; Thu, 14 Jun 2018 11:09:52 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201806141109.w5EB9qGk002680@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 14 Jun 2018 11:09:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335132 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 335132 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 11:09:53 -0000 Author: kib Date: Thu Jun 14 11:09:51 2018 New Revision: 335132 URL: https://svnweb.freebsd.org/changeset/base/335132 Log: Reorganize code flow in fpudna()/npxdna() to highlight the critical section scope. Sprinkle __predict_false() for conditions known to never occur or occur only on rare platforms. Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/amd64/fpu.c head/sys/i386/i386/npx.c Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Thu Jun 14 10:33:26 2018 (r335131) +++ head/sys/amd64/amd64/fpu.c Thu Jun 14 11:09:51 2018 (r335132) @@ -722,7 +722,7 @@ fpudna(void) KASSERT((curpcb->pcb_flags & PCB_FPUNOSAVE) == 0, ("fpudna while in fpu_kern_enter(FPU_KERN_NOCTX)")); - if (PCPU_GET(fpcurthread) == td) { + if (__predict_false(PCPU_GET(fpcurthread) == td)) { /* * Some virtual machines seems to set %cr0.TS at * arbitrary moments. Silently clear the TS bit @@ -730,15 +730,15 @@ fpudna(void) * mode. */ stop_emulating(); - critical_exit(); - return; + } else { + if (__predict_false(PCPU_GET(fpcurthread) != NULL)) { + panic( + "fpudna: fpcurthread = %p (%d), curthread = %p (%d)\n", + PCPU_GET(fpcurthread), + PCPU_GET(fpcurthread)->td_tid, td, td->td_tid); + } + restore_fpu_curthread(td); } - if (PCPU_GET(fpcurthread) != NULL) { - panic("fpudna: fpcurthread = %p (%d), curthread = %p (%d)\n", - PCPU_GET(fpcurthread), PCPU_GET(fpcurthread)->td_tid, - td, td->td_tid); - } - restore_fpu_curthread(td); critical_exit(); } Modified: head/sys/i386/i386/npx.c ============================================================================== --- head/sys/i386/i386/npx.c Thu Jun 14 10:33:26 2018 (r335131) +++ head/sys/i386/i386/npx.c Thu Jun 14 11:09:51 2018 (r335132) @@ -835,7 +835,7 @@ npxdna(void) return (0); td = curthread; critical_enter(); - if (PCPU_GET(fpcurthread) == td) { + if (__predict_false(PCPU_GET(fpcurthread) == td)) { /* * Some virtual machines seems to set %cr0.TS at * arbitrary moments. Silently clear the TS bit @@ -843,19 +843,18 @@ npxdna(void) * mode. */ stop_emulating(); - critical_exit(); - return (1); + } else { + if (__predict_false(PCPU_GET(fpcurthread) != NULL)) { + printf( + "npxdna: fpcurthread = %p (%d), curthread = %p (%d)\n", + PCPU_GET(fpcurthread), + PCPU_GET(fpcurthread)->td_proc->p_pid, + td, td->td_proc->p_pid); + panic("npxdna"); + } + restore_npx_curthread(td, td->td_pcb); } - if (PCPU_GET(fpcurthread) != NULL) { - printf("npxdna: fpcurthread = %p (%d), curthread = %p (%d)\n", - PCPU_GET(fpcurthread), - PCPU_GET(fpcurthread)->td_proc->p_pid, - td, td->td_proc->p_pid); - panic("npxdna"); - } - restore_npx_curthread(td, td->td_pcb); critical_exit(); - return (1); } From owner-svn-src-head@freebsd.org Thu Jun 14 11:15:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFAEA101DE66; Thu, 14 Jun 2018 11:15:40 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 90DA8849E4; Thu, 14 Jun 2018 11:15:40 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6EB8727A94; Thu, 14 Jun 2018 11:15:40 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5EBFe1Q007471; Thu, 14 Jun 2018 11:15:40 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5EBFeTu007470; Thu, 14 Jun 2018 11:15:40 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201806141115.w5EBFeTu007470@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 14 Jun 2018 11:15:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335133 - head/sys/netinet/libalias X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netinet/libalias X-SVN-Commit-Revision: 335133 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 11:15:41 -0000 Author: ae Date: Thu Jun 14 11:15:39 2018 New Revision: 335133 URL: https://svnweb.freebsd.org/changeset/base/335133 Log: In m_megapullup() use m_getjcl() to allocate 9k or 16k mbuf when requested. It is better to try allocate a big mbuf, than just silently drop a big packet. A better solution could be reworking of libalias modules to be able use m_copydata()/m_copyback() instead of requiring the single contiguous buffer. PR: 229006 MFC after: 1 week Modified: head/sys/netinet/libalias/alias.c Modified: head/sys/netinet/libalias/alias.c ============================================================================== --- head/sys/netinet/libalias/alias.c Thu Jun 14 11:09:51 2018 (r335132) +++ head/sys/netinet/libalias/alias.c Thu Jun 14 11:15:39 2018 (r335133) @@ -1751,7 +1751,8 @@ LibAliasUnLoadAllModule(void) * the input packet, on failure NULL. The input packet is always consumed. */ struct mbuf * -m_megapullup(struct mbuf *m, int len) { +m_megapullup(struct mbuf *m, int len) +{ struct mbuf *mcl; if (len > m->m_pkthdr.len) @@ -1760,7 +1761,14 @@ m_megapullup(struct mbuf *m, int len) { if (m->m_next == NULL && M_WRITABLE(m)) return (m); - mcl = m_get2(len, M_NOWAIT, MT_DATA, M_PKTHDR); + if (len <= MJUMPAGESIZE) + mcl = m_get2(len, M_NOWAIT, MT_DATA, M_PKTHDR); + else if (len <= MJUM9BYTES) + mcl = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, MJUM9BYTES); + else if (len <= MJUM16BYTES) + mcl = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, MJUM16BYTES); + else + goto bad; if (mcl == NULL) goto bad; m_align(mcl, len); From owner-svn-src-head@freebsd.org Thu Jun 14 12:07:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54938102251D for ; Thu, 14 Jun 2018 12:07:20 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 06C4586C95 for ; Thu, 14 Jun 2018 12:07:20 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from mail-yw0-f172.google.com (mail-yw0-f172.google.com [209.85.161.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: eadler) by smtp.freebsd.org (Postfix) with ESMTPSA id C4D56E6FC for ; Thu, 14 Jun 2018 12:07:19 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: by mail-yw0-f172.google.com with SMTP id v131-v6so2041528ywg.2 for ; Thu, 14 Jun 2018 05:07:19 -0700 (PDT) X-Gm-Message-State: APt69E2whb7iSn88gdbtvc/xmbe6POLqslduJH2uY6LiaTx3pNZVyYrs ZUjgxJs7QRSkSFdfAmqEBW5BWQnatxbbkqOprlsoFQ== X-Google-Smtp-Source: ADUXVKIvohuCFXWk+fmKImU+zX+NbJk8qyrX5MVgpDEZflCgUHpAFB4++V7Jau6ot8dUQA4+QweSqvddyE+uYrIjFRs= X-Received: by 2002:a81:3e16:: with SMTP id l22-v6mr1140991ywa.37.1528978039168; Thu, 14 Jun 2018 05:07:19 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ef50:0:0:0:0:0 with HTTP; Thu, 14 Jun 2018 05:06:48 -0700 (PDT) In-Reply-To: <20180614112720.7bd13a9e@kalimero.tijl.coosemans.org> References: <201806090247.w592l2b2071661@repo.freebsd.org> <20180614112720.7bd13a9e@kalimero.tijl.coosemans.org> From: Eitan Adler Date: Thu, 14 Jun 2018 05:06:48 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334869 - head/usr.bin/top To: =?UTF-8?Q?T=C4=B3l_Coosemans?= Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 12:07:20 -0000 On 14 June 2018 at 02:27, T=C4=B3l Coosemans wrote: ... > > You need to replace PID with %s here as well. Thanks. I also need to change it in io_header and roll this into my header rewrite. --=20 Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@freebsd.org Thu Jun 14 12:10:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84ADB1022A00 for ; Thu, 14 Jun 2018 12:10:52 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3505F86F7F for ; Thu, 14 Jun 2018 12:10:52 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from mail-yw0-f176.google.com (mail-yw0-f176.google.com [209.85.161.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: eadler) by smtp.freebsd.org (Postfix) with ESMTPSA id 00F7DE6FE for ; Thu, 14 Jun 2018 12:10:51 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: by mail-yw0-f176.google.com with SMTP id v131-v6so2045099ywg.2 for ; Thu, 14 Jun 2018 05:10:51 -0700 (PDT) X-Gm-Message-State: APt69E14XHfB/1zoVSEEVdoFBSnhM/2kEXOMX+XDFV0g/e3X++MS3mqB tnyexSI2pWSNCDD8UtkxjGx2w1d5/2TYfsYE4Dj1PA== X-Google-Smtp-Source: ADUXVKJE+0xlqy+4UCpy7oObtBoH/Nz1BOZfOGJoOoIscKXamZgy40/nsmhyCkiNj7ePNM1EfEEnkNXeLGJVL37jnCU= X-Received: by 2002:a0d:cf01:: with SMTP id r1-v6mr1137215ywd.162.1528978251638; Thu, 14 Jun 2018 05:10:51 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ef50:0:0:0:0:0 with HTTP; Thu, 14 Jun 2018 05:10:21 -0700 (PDT) In-Reply-To: <9b6b26cf-dac2-f5ab-e694-5d132ff1bdb9@FreeBSD.org> References: <201806130852.w5D8qKd4094584@repo.freebsd.org> <9b6b26cf-dac2-f5ab-e694-5d132ff1bdb9@FreeBSD.org> From: Eitan Adler Date: Thu, 14 Jun 2018 05:10:21 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335042 - head/usr.bin/top To: Bryan Drewery Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 12:10:52 -0000 On 13 June 2018 at 17:01, Bryan Drewery wrote: > On 6/13/2018 1:52 AM, Eitan Adler wrote: >> Author: eadler >> Date: Wed Jun 13 08:52:19 2018 >> New Revision: 335042 >> URL: https://svnweb.freebsd.org/changeset/base/335042 >> >> Log: >> top(1): add myself to authors >> >> At this point I've mucked enough with top(1) that all bugs should be >> blamed on me rather than William LeFebvre. >> > > Thank you for all of your work here... > > There's not exactly a guideline for this but I don't feel that > non-functional changes qualify as "authors". I actually meant what I wrote in the commit message: at this point it doesn't make sense to blame William. I'll revert the change to top.1 change as I don't care all that much. Personally, I like being liberal with credit though I understand that isn't the project's stance necessarily. > Especially the sorting chosen. I went with alphabetical. Perhaps I missed some rewrite you've done? Though none have > 'Relnotes: yes' so I am assuming they were all non-functional. Some were functional, I've not done a good job of marking them. > I do see some people adding their Copyright on some commits but overall > we haven't done that as a project and I am curious if we should change > in that regard. The rule of them is about 25% of the file, right? -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@freebsd.org Thu Jun 14 12:12:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E67691022C77 for ; Thu, 14 Jun 2018 12:12:40 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 94318873F8 for ; Thu, 14 Jun 2018 12:12:40 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from mail-yb0-f178.google.com (mail-yb0-f178.google.com [209.85.213.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: eadler) by smtp.freebsd.org (Postfix) with ESMTPSA id 5CA2CE802 for ; Thu, 14 Jun 2018 12:12:40 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: by mail-yb0-f178.google.com with SMTP id q62-v6so2136738ybg.5 for ; Thu, 14 Jun 2018 05:12:40 -0700 (PDT) X-Gm-Message-State: APt69E0OM5GsIs7NRO6cIG4tlQyR79W8omYreFS3wPePjOKECptAsHZL MF5m2ax/WelrH5/dBbhYtYoWyROZ3YYz8W+Jj1sz6Q== X-Google-Smtp-Source: ADUXVKJUv8dLZ7uDRXcY8gY0VdsBUrn23o12ZvUCNzJvNtX1apKDhA2iW0EwmQTWFLuvfRB02VByUDR6olPAmUSkXok= X-Received: by 2002:a25:500a:: with SMTP id e10-v6mr1233852ybb.87.1528978359750; Thu, 14 Jun 2018 05:12:39 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ef50:0:0:0:0:0 with HTTP; Thu, 14 Jun 2018 05:12:09 -0700 (PDT) In-Reply-To: <20180610162653.GA2999@FreeBSD.org> References: <201805202319.w4KNJ9hj038452@repo.freebsd.org> <20180521094344.Q1053@besplex.bde.org> <20180521063953.GA70671@FreeBSD.org> <20180610122819.GA75055@FreeBSD.org> <20180610162653.GA2999@FreeBSD.org> From: Eitan Adler Date: Thu, 14 Jun 2018 05:12:09 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r333945 - head/usr.bin/top To: Alexey Dokuchaev Cc: Bruce Evans , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 12:12:41 -0000 On 10 June 2018 at 09:26, Alexey Dokuchaev wrote: > On Sun, Jun 10, 2018 at 08:56:24AM -0700, Eitan Adler wrote: >> On 10 June 2018 at 05:28, Alexey Dokuchaev wrote: >> > I've just tried the latest top(1). Now it's even worse: >> > ... >> > Also, it is COMMA now. Can we please do something about this? I am not >> > calling for "USER PRI" as Bruce had suggested, but "USERNAME PRI" is just >> > about right. >> >> FWIW I have not forgotten about this. I am planning on completely >> rewriting how the header, and data, get displayed so its low my >> priority (pun intended) list to fix this specific case until then. > > Great! Looking forward to improvements. top(1) should be neat(TM). > Take your time Eitan, it's not that urgent. What do y'all think of https://reviews.freebsd.org/D15801 ? It changes the username length to 8 unconditionally. Its rolled into a rewrite of how the header gets created in order to actually make it understandable. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@freebsd.org Thu Jun 14 12:14:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4EC161022EBE; Thu, 14 Jun 2018 12:14:52 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F056887605; Thu, 14 Jun 2018 12:14:51 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD8B8495; Thu, 14 Jun 2018 12:14:51 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5ECEp0O037619; Thu, 14 Jun 2018 12:14:51 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5ECEpad037618; Thu, 14 Jun 2018 12:14:51 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806141214.w5ECEpad037618@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 14 Jun 2018 12:14:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335134 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 335134 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 12:14:52 -0000 Author: eadler Date: Thu Jun 14 12:14:51 2018 New Revision: 335134 URL: https://svnweb.freebsd.org/changeset/base/335134 Log: top(1): remove myself from top.1 I wrote some, but not enough for the man page. Modified: head/usr.bin/top/top.1 Modified: head/usr.bin/top/top.1 ============================================================================== --- head/usr.bin/top/top.1 Thu Jun 14 11:15:39 2018 (r335133) +++ head/usr.bin/top/top.1 Thu Jun 14 12:14:51 2018 (r335134) @@ -360,7 +360,6 @@ process is waiting. Lock names are prefixed with an asterisk \*(lq*\*(rq while sleep events are not. .Sh AUTHORS -.An Eitan Adler Aq Mt eadler@FreeBSD.org .An William LeFebvre, EECS Department, Northwestern University .Sh BUGS The command name for swapped processes should be tracked down, but this From owner-svn-src-head@freebsd.org Thu Jun 14 12:21:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6833110006E9; Thu, 14 Jun 2018 12:21:31 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 93A5887A50; Thu, 14 Jun 2018 12:21:30 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id A48D71A25EC; Thu, 14 Jun 2018 22:21:21 +1000 (AEST) Date: Thu, 14 Jun 2018 22:21:20 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Hans Petter Selasky cc: Bruce Evans , Matthew Macy , Ryan Libby , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, bde@freebsd.org Subject: Re: svn commit: r335094 - head/sys/ofed/drivers/infiniband/core In-Reply-To: <4aa93c89-686e-e344-8e04-c34069e8516d@selasky.org> Message-ID: <20180614213127.E2164@besplex.bde.org> References: <201806132330.w5DNUsrE043573@repo.freebsd.org> <20180614182603.U1417@besplex.bde.org> <4aa93c89-686e-e344-8e04-c34069e8516d@selasky.org> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=FNpr/6gs c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=nlC_4_pT8q9DhB4Ho9EA:9 a=U_0igYKcpFDwVscRnRYA:9 a=GuU8CwD0NdOPvrho:21 a=1QG-dSD2mB3_j1r4:21 a=45ClL6m2LaAA:10 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 12:21:31 -0000 On Thu, 14 Jun 2018, Hans Petter Selasky wrote: > On 06/14/18 10:46, Bruce Evans wrote: >> Are these macros for conversion of host (FreeBSD) dev_t's or target (Lin= ux) >> ones?=C2=A0 If for the host, then I don't see any reason not to use the = host=20 >> APIs. >> If for the target, then they shouldn't be used with the host dev_t.=C2= =A0 If=20 >> for >> a mixture, then the translations are very confusing, especially when the= y >> are the identity, and many more macros are needed to reduce the confusio= n. > > These values are only used inside the LinuxKPI for creating character=20 > devices. They have no exposure to user-space. > > Basically: > > Z =3D MKDEV(X,Y) > MAJOR(Z) must be equal to X > MINOR(Z) must be equal to Y So they are only for the host. You should try harder to allocate the device number properly (not using hard-coded numbers which are not even #defined in a central place). compat/linux already has similar hard-coding for pts and more, but that is more central and historically established. Unique device numbers now seems to be allocated by devfs_alloc_cdp_inode(). Or call make_dev*() to create a full device with a device number allocated by this. I now see bugs in this too. Major numbers for devices are supposed to be 0. But devfs_alloc_cdp_inode() constructs a minor number which is assigned to cdp->cdp_inode. cdp_inode is treated as a device number, not as a minor number. It is assigned directly to a device number in dev2udev() and for assignment to va_rdev. So after 256 allocations, the minor bits leak into the major bits. Eventually the leak breaks uniqueness of hard-coded Linux major numbers. I saw this earlier to today but thought the problem was a kernel without the encoding fixes combined with an old userland using old major(), etc., to decode new dev_t encoding. Actually, the encodings were consistently old except in devfs_alloc_cdp_inode(). I created 514 ptys in /dev/pts/ and noticed that the numbers change from (major =3D N, minor =3D 255) to (major =3D N, minor =3D 0). With the previous kernel encoding, the minor numbers would have increased sequentially, but old userland would not have noticed the difference since it users old major(), etc., to decode.s If you create a device by name, then its name needs to be unique instead of its numbers, but this is easier to arrange. Bruce From owner-svn-src-head@freebsd.org Thu Jun 14 12:35:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0349910016D3; Thu, 14 Jun 2018 12:35:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9FD81683EF; Thu, 14 Jun 2018 12:35:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7CBA57D5; Thu, 14 Jun 2018 12:35:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5ECZvE1047960; Thu, 14 Jun 2018 12:35:57 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5ECZvTk047959; Thu, 14 Jun 2018 12:35:57 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201806141235.w5ECZvTk047959@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 14 Jun 2018 12:35:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335135 - head/sys/amd64/linux X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/linux X-SVN-Commit-Revision: 335135 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 12:35:58 -0000 Author: kib Date: Thu Jun 14 12:35:57 2018 New Revision: 335135 URL: https://svnweb.freebsd.org/changeset/base/335135 Log: linuxolator/amd64: Don't mangle %r10 on return from syscall for EJUSTRETURN. This fixes the %r10 content for rt_sigreturn. Submitted by: Yanko Yankulov MFC after: 1 week Modified: head/sys/amd64/linux/linux_sysvec.c Modified: head/sys/amd64/linux/linux_sysvec.c ============================================================================== --- head/sys/amd64/linux/linux_sysvec.c Thu Jun 14 12:14:51 2018 (r335134) +++ head/sys/amd64/linux/linux_sysvec.c Thu Jun 14 12:35:57 2018 (r335135) @@ -228,7 +228,8 @@ linux_set_syscall_retval(struct thread *td, int error) * the syscall. So, do not clobber %rdx and %r10. */ td->td_retval[1] = frame->tf_rdx; - frame->tf_r10 = frame->tf_rcx; + if (error != EJUSTRETURN) + frame->tf_r10 = frame->tf_rcx; cpu_set_syscall_retval(td, error); From owner-svn-src-head@freebsd.org Thu Jun 14 12:43:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66EB81001EF8; Thu, 14 Jun 2018 12:43:29 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1DD146892E; Thu, 14 Jun 2018 12:43:29 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id F0652B404; Thu, 14 Jun 2018 12:43:28 +0000 (UTC) Date: Thu, 14 Jun 2018 12:43:28 +0000 From: Alexey Dokuchaev To: Eitan Adler Cc: Bruce Evans , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Subject: Re: svn commit: r333945 - head/usr.bin/top Message-ID: <20180614124328.GA72115@FreeBSD.org> References: <201805202319.w4KNJ9hj038452@repo.freebsd.org> <20180521094344.Q1053@besplex.bde.org> <20180521063953.GA70671@FreeBSD.org> <20180610122819.GA75055@FreeBSD.org> <20180610162653.GA2999@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.5 (2018-04-13) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 12:43:29 -0000 On Thu, Jun 14, 2018 at 05:12:09AM -0700, Eitan Adler wrote: > On 10 June 2018 at 09:26, Alexey Dokuchaev wrote: > > On Sun, Jun 10, 2018 at 08:56:24AM -0700, Eitan Adler wrote: > >> On 10 June 2018 at 05:28, Alexey Dokuchaev wrote: > >> > I've just tried the latest top(1). Now it's even worse: > >> > ... > >> > Also, it is COMMA now. Can we please do something about this? I am not > >> > calling for "USER PRI" as Bruce had suggested, but "USERNAME PRI" is just > >> > about right. > >> > >> FWIW I have not forgotten about this. I am planning on completely > >> rewriting how the header, and data, get displayed so its low my > >> priority (pun intended) list to fix this specific case until then. > > > > Great! Looking forward to improvements. top(1) should be neat(TM). > > Take your time Eitan, it's not that urgent. > > What do y'all think of https://reviews.freebsd.org/D15801 ? Thanks for putting up a review! Please give all interested parties to participate and leave feedback. I personally won't be able to test or produce any top(1) patches tonight :( but would get to it tomorrow. ./danfe From owner-svn-src-head@freebsd.org Thu Jun 14 12:49:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4D25100249D; Thu, 14 Jun 2018 12:49:47 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 5630268D51; Thu, 14 Jun 2018 12:49:46 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 54C601A2410; Thu, 14 Jun 2018 22:49:44 +1000 (AEST) Date: Thu, 14 Jun 2018 22:49:41 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Eitan Adler cc: Alexey Dokuchaev , Bruce Evans , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Subject: Re: svn commit: r333945 - head/usr.bin/top In-Reply-To: Message-ID: <20180614223558.S2349@besplex.bde.org> References: <201805202319.w4KNJ9hj038452@repo.freebsd.org> <20180521094344.Q1053@besplex.bde.org> <20180521063953.GA70671@FreeBSD.org> <20180610122819.GA75055@FreeBSD.org> <20180610162653.GA2999@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=cIaQihWN c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=1n0M5KOwwqV-EO1I0TAA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 12:49:48 -0000 On Thu, 14 Jun 2018, Eitan Adler wrote: > On 10 June 2018 at 09:26, Alexey Dokuchaev wrote: >> On Sun, Jun 10, 2018 at 08:56:24AM -0700, Eitan Adler wrote: >>> On 10 June 2018 at 05:28, Alexey Dokuchaev wrote: >>>> I've just tried the latest top(1). Now it's even worse: >>>> ... >>>> Also, it is COMMA now. Can we please do something about this? I am not >>>> calling for "USER PRI" as Bruce had suggested, but "USERNAME PRI" is just >>>> about right. >>> >>> FWIW I have not forgotten about this. I am planning on completely >>> rewriting how the header, and data, get displayed so its low my >>> priority (pun intended) list to fix this specific case until then. >> >> Great! Looking forward to improvements. top(1) should be neat(TM). >> Take your time Eitan, it's not that urgent. > > What do y'all think of https://reviews.freebsd.org/D15801 ? It changes > the username length to 8 unconditionally. Its rolled into a rewrite of > how the header gets created in order to actually make it > understandable. Hard-coded 8 is too simple. Old versions were easy enough to understand, but that depends on them mostly being hard-coded. I don't like to review anything that is not in mail. Bruce From owner-svn-src-head@freebsd.org Thu Jun 14 12:54:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D11CB1002ADF; Thu, 14 Jun 2018 12:54:42 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 57C4469231; Thu, 14 Jun 2018 12:54:42 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 65C4726057A; Thu, 14 Jun 2018 14:54:36 +0200 (CEST) Subject: Re: svn commit: r335094 - head/sys/ofed/drivers/infiniband/core To: Bruce Evans Cc: Matthew Macy , Ryan Libby , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, bde@freebsd.org References: <201806132330.w5DNUsrE043573@repo.freebsd.org> <20180614182603.U1417@besplex.bde.org> <4aa93c89-686e-e344-8e04-c34069e8516d@selasky.org> <20180614213127.E2164@besplex.bde.org> From: Hans Petter Selasky Message-ID: <772a3f11-af10-1ac6-b0d4-c0b47546850e@selasky.org> Date: Thu, 14 Jun 2018 14:54:20 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180614213127.E2164@besplex.bde.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 12:54:43 -0000 On 06/14/18 14:21, Bruce Evans wrote: > Eventually the leak breaks > uniqueness of hard-coded Linux major numbers. Like already said, the major and minor numbers are internal to the LinuxKPI and devfs is not aware about them, and nor anything in user-space. --HPS From owner-svn-src-head@freebsd.org Thu Jun 14 13:43:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C86511005C62; Thu, 14 Jun 2018 13:42:59 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7DBC76B1B0; Thu, 14 Jun 2018 13:42:59 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 605F61319; Thu, 14 Jun 2018 13:42:59 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5EDgxmQ084206; Thu, 14 Jun 2018 13:42:59 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5EDgxpG084204; Thu, 14 Jun 2018 13:42:59 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201806141342.w5EDgxpG084204@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 14 Jun 2018 13:42:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335136 - head/tests/sys/audit X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/audit X-SVN-Commit-Revision: 335136 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 13:43:00 -0000 Author: asomers Date: Thu Jun 14 13:42:58 2018 New Revision: 335136 URL: https://svnweb.freebsd.org/changeset/base/335136 Log: audit(4): add tests for flock, fcntl, and fsync Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15795 Added: head/tests/sys/audit/file-attribute-modify.c (contents, props changed) Modified: head/tests/sys/audit/Makefile Modified: head/tests/sys/audit/Makefile ============================================================================== --- head/tests/sys/audit/Makefile Thu Jun 14 12:35:57 2018 (r335135) +++ head/tests/sys/audit/Makefile Thu Jun 14 13:42:58 2018 (r335136) @@ -3,6 +3,7 @@ TESTSDIR= ${TESTSBASE}/sys/audit ATF_TESTS_C= file-attribute-access +ATF_TESTS_C= file-attribute-modify ATF_TESTS_C+= file-create ATF_TESTS_C+= file-delete ATF_TESTS_C+= file-close @@ -12,6 +13,8 @@ ATF_TESTS_C+= open SRCS.file-attribute-access+= file-attribute-access.c SRCS.file-attribute-access+= utils.c +SRCS.file-attribute-modify+= file-attribute-modify.c +SRCS.file-attribute-modify+= utils.c SRCS.file-create+= file-create.c SRCS.file-create+= utils.c SRCS.file-delete+= file-delete.c Added: head/tests/sys/audit/file-attribute-modify.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/audit/file-attribute-modify.c Thu Jun 14 13:42:58 2018 (r335136) @@ -0,0 +1,199 @@ +/*- + * Copyright (c) 2018 Aniket Pandey + * + * 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 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * 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 + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include + +#include +#include +#include + +#include "utils.h" + +static pid_t pid; +static int filedesc; +static struct pollfd fds[1]; +static mode_t mode = 0777; +static char extregex[80]; +static const char *auclass = "fm"; +static const char *path = "fileforaudit"; + + +ATF_TC_WITH_CLEANUP(flock_success); +ATF_TC_HEAD(flock_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "flock(2) call"); +} + +ATF_TC_BODY(flock_success, tc) +{ + pid = getpid(); + snprintf(extregex, sizeof(extregex), "flock.*%d.*return,success", pid); + + /* File needs to exist to call flock(2) */ + ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, flock(filedesc, LOCK_SH)); + check_audit(fds, extregex, pipefd); + close(filedesc); +} + +ATF_TC_CLEANUP(flock_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(flock_failure); +ATF_TC_HEAD(flock_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "flock(2) call"); +} + +ATF_TC_BODY(flock_failure, tc) +{ + const char *regex = "flock.*return,failure : Bad file descriptor"; + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(-1, flock(-1, LOCK_SH)); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(flock_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(fcntl_success); +ATF_TC_HEAD(fcntl_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "fcntl(2) call"); +} + +ATF_TC_BODY(fcntl_success, tc) +{ + int flagstatus; + /* File needs to exist to call fcntl(2) */ + ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + FILE *pipefd = setup(fds, auclass); + + /* Retrieve the status flags of 'filedesc' and store it in flagstatus */ + ATF_REQUIRE((flagstatus = fcntl(filedesc, F_GETFL, 0)) != -1); + snprintf(extregex, sizeof(extregex), + "fcntl.*return,success,%d", flagstatus); + check_audit(fds, extregex, pipefd); + close(filedesc); +} + +ATF_TC_CLEANUP(fcntl_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(fcntl_failure); +ATF_TC_HEAD(fcntl_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "fcntl(2) call"); +} + +ATF_TC_BODY(fcntl_failure, tc) +{ + const char *regex = "fcntl.*return,failure : Bad file descriptor"; + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(-1, fcntl(-1, F_GETFL, 0)); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(fcntl_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(fsync_success); +ATF_TC_HEAD(fsync_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "fsync(2) call"); +} + +ATF_TC_BODY(fsync_success, tc) +{ + pid = getpid(); + snprintf(extregex, sizeof(extregex), "fsync.*%d.*return,success", pid); + + /* File needs to exist to call fsync(2) */ + ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, fsync(filedesc)); + check_audit(fds, extregex, pipefd); + close(filedesc); +} + +ATF_TC_CLEANUP(fsync_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(fsync_failure); +ATF_TC_HEAD(fsync_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "fsync(2) call"); +} + +ATF_TC_BODY(fsync_failure, tc) +{ + const char *regex = "fsync.*return,failure : Bad file descriptor"; + FILE *pipefd = setup(fds, auclass); + /* Failure reason: Invalid file descriptor */ + ATF_REQUIRE_EQ(-1, fsync(-1)); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(fsync_failure, tc) +{ + cleanup(); +} + + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, flock_success); + ATF_TP_ADD_TC(tp, flock_failure); + ATF_TP_ADD_TC(tp, fcntl_success); + ATF_TP_ADD_TC(tp, fcntl_failure); + ATF_TP_ADD_TC(tp, fsync_success); + ATF_TP_ADD_TC(tp, fsync_failure); + + return (atf_no_error()); +} From owner-svn-src-head@freebsd.org Thu Jun 14 14:10:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 235FC1007C22 for ; Thu, 14 Jun 2018 14:10:47 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x235.google.com (mail-io0-x235.google.com [IPv6:2607:f8b0:4001:c06::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ABD2E6C29B for ; Thu, 14 Jun 2018 14:10:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x235.google.com with SMTP id k3-v6so7274913iog.3 for ; Thu, 14 Jun 2018 07:10:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=HcJZWqnw4UCGSFjfs6VmYdfdt5ZXY6Y3X06DlCcCydM=; b=1ZNwSosWshpfBtE+FSOPyfzk/4OQcB23kEiQ8c5d4JXzYndVccZ2kc8QCkrLb+P2wo bM8UP9Dk0cR/G2V1jlsSpS0CSFQiq4HJwl0eUh0fwNUqH2a/OCeyELbsQudT2qUOvbEe XG73DqWZDh8Zo14Ituf+KtYsam1/K7LCt0wuH5vuvndZNxbzGrqqrRh8YUm9znBEwYh2 hSKmzg6vrI/bFXAobjMgCjCpM9YKMgjSb4ZcjSuLz6o8yO7MuP0VirIBRnbSjEkrxFUj vJVNs8JtN8FgspVOuHN9TaBaWmsyEpctI6pKGBAAqpQbaYraZp+BTui03beZxQgTM0To EVpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=HcJZWqnw4UCGSFjfs6VmYdfdt5ZXY6Y3X06DlCcCydM=; b=qoQeGOtzqcNPi1/kxqt+UFl3h8HTqVl4k7XVYD+wdbvXNIY6D/Onp/xSSqPAgE+kqs 2sfDeuFoOPnm67VXVrmNnjKNOadlBL2heYcnAHqZCPmh7eDVQdhqZ2I5RYZZHxa8sMQd QWcEkM3gtKOZaXqYl11D3mSJTNeKQYHvpM22Lz1rqj0mrpzWcjJP/9PcA0pmRGtvpx5R 5ahHErgPdkEWxNpdPUsYtWD4iUEYTOplkjo5XHPzAp1np/vDvISYRqeqtLtlo0eQA5jx QEnmK+w/W66gGQkTvS6JL2QU7Ga6lUkHfoekuOUA8nNZ14AAMGDv87Rzz2F0S+/GdfRW n3sg== X-Gm-Message-State: APt69E2ilChQtARwsyOngaiQ/bEP/SrfzJ8LAFOED1eVE+5qD7NTWnYx /n1drgIjJ3uHohAQiE9AQhpPEwFslNxMIEGZrld7vQ== X-Google-Smtp-Source: ADUXVKJib6QJFAVazVaZOIhtzEMqe5g92bE0oaDxrbDyYCPLIj1q2pMiaFY8CHoCDAdwBWkhyyJ6uUmM/2/g6w0XZxw= X-Received: by 2002:a6b:29c4:: with SMTP id p187-v6mr2375322iop.299.1528985445804; Thu, 14 Jun 2018 07:10:45 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:d028:0:0:0:0:0 with HTTP; Thu, 14 Jun 2018 07:10:45 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: References: <201806130852.w5D8qKd4094584@repo.freebsd.org> <9b6b26cf-dac2-f5ab-e694-5d132ff1bdb9@FreeBSD.org> From: Warner Losh Date: Thu, 14 Jun 2018 08:10:45 -0600 X-Google-Sender-Auth: 9ytLh-vLyTwNFDyPvAz5-aLR45U Message-ID: Subject: Re: svn commit: r335042 - head/usr.bin/top To: Eitan Adler Cc: Bryan Drewery , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 14:10:47 -0000 On Thu, Jun 14, 2018 at 6:10 AM, Eitan Adler wrote: > > I do see some people adding their Copyright on some commits but overall > > we haven't done that as a project and I am curious if we should change > > in that regard. > > The rule of them is about 25% of the file, right? > The law that motivates this (but maybe not requires it) states only substantial change. One cannot mislead people about the copyright term which also feeds into it (which is one of the motivators for not doing it for trivial changes: it would lead people to believe that a copyright is being claimed that might not be substantial). Trouble is, there's no concrete rules for substantial in the laws, and the caselaw is substantially muddied. People know and use the terms, but there's no sharp line that can be drawn or articulated. Generally, the project has adopted a bit of a Potter Stewart like standard. A substantial change is situational. Generally, a 25% or more change is substantial. Sometimes, substantial changes can be less when important new functions are added. Other times, like with mechanical changes that may lack artistic expression, you can change 90% of the file (via indent) and not have it be substantial. The current case is on the boarder. There's a lot of code motion that doesn't change the functionality and just moves code around, inflating any scoring efforts. On the other hand, there's been some level of cleanup of the code as well on a very systemic basic through the whole code base. I've not paid extreme attention to every change, to be honest, but on the whole I think it's a close call. Generally, however, the project has been deferential to cases that are close calls where the author has legitimately asserted a claim. That deference, however, has not been extended in several instances where it's not a borderline case. So there's your answer, clear as mud. Warner From owner-svn-src-head@freebsd.org Thu Jun 14 14:53:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 726BA100AE4B; Thu, 14 Jun 2018 14:53:02 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2478E6E54B; Thu, 14 Jun 2018 14:53:02 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 05B281E7A; Thu, 14 Jun 2018 14:53:02 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5EEr17A020639; Thu, 14 Jun 2018 14:53:01 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5EEr1Q0020638; Thu, 14 Jun 2018 14:53:01 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201806141453.w5EEr1Q0020638@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 14 Jun 2018 14:53:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335140 - head/tests/sys/audit X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/audit X-SVN-Commit-Revision: 335140 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 14:53:02 -0000 Author: asomers Date: Thu Jun 14 14:53:01 2018 New Revision: 335140 URL: https://svnweb.freebsd.org/changeset/base/335140 Log: audit(4): fix typo from r335136 Typo in Makefile accidentally disabled some older tests MFC after: 2 weeks X-MFC-With: 335136 Modified: head/tests/sys/audit/Makefile Modified: head/tests/sys/audit/Makefile ============================================================================== --- head/tests/sys/audit/Makefile Thu Jun 14 14:50:30 2018 (r335139) +++ head/tests/sys/audit/Makefile Thu Jun 14 14:53:01 2018 (r335140) @@ -3,7 +3,7 @@ TESTSDIR= ${TESTSBASE}/sys/audit ATF_TESTS_C= file-attribute-access -ATF_TESTS_C= file-attribute-modify +ATF_TESTS_C+= file-attribute-modify ATF_TESTS_C+= file-create ATF_TESTS_C+= file-delete ATF_TESTS_C+= file-close From owner-svn-src-head@freebsd.org Thu Jun 14 14:53:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11A18100AED2; Thu, 14 Jun 2018 14:53:25 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B8DC26E659; Thu, 14 Jun 2018 14:53:24 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 80D3A1E7C; Thu, 14 Jun 2018 14:53:24 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5EErObh020698; Thu, 14 Jun 2018 14:53:24 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5EErO7V020697; Thu, 14 Jun 2018 14:53:24 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201806141453.w5EErO7V020697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 14 Jun 2018 14:53:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335141 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 335141 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 14:53:25 -0000 Author: ae Date: Thu Jun 14 14:53:24 2018 New Revision: 335141 URL: https://svnweb.freebsd.org/changeset/base/335141 Log: Convert if_me(4) driver to use encap_lookup_t method and be lockless on data path. Modified: head/sys/net/if_me.c Modified: head/sys/net/if_me.c ============================================================================== --- head/sys/net/if_me.c Thu Jun 14 14:53:01 2018 (r335140) +++ head/sys/net/if_me.c Thu Jun 14 14:53:24 2018 (r335141) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014 Andrey V. Elsukov + * Copyright (c) 2014, 2018 Andrey V. Elsukov * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -28,22 +28,20 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include -#include #include #include #include #include #include -#include #include #include #include #include #include -#include #include #include @@ -68,8 +66,6 @@ __FBSDID("$FreeBSD$"); #define MEMTU (1500 - sizeof(struct mobhdr)) static const char mename[] = "me"; static MALLOC_DEFINE(M_IFME, mename, "Minimal Encapsulation for IP"); -static VNET_DEFINE(struct mtx, me_mtx); -#define V_me_mtx VNET(me_mtx) /* Minimal forwarding header RFC 2004 */ struct mobhdr { uint8_t mob_proto; /* protocol */ @@ -82,32 +78,27 @@ struct mobhdr { struct me_softc { struct ifnet *me_ifp; - LIST_ENTRY(me_softc) me_list; - struct rmlock me_lock; u_int me_fibnum; - const struct encaptab *me_ecookie; struct in_addr me_src; struct in_addr me_dst; + + CK_LIST_ENTRY(me_softc) chain; }; +CK_LIST_HEAD(me_list, me_softc); #define ME2IFP(sc) ((sc)->me_ifp) #define ME_READY(sc) ((sc)->me_src.s_addr != 0) -#define ME_LOCK_INIT(sc) rm_init(&(sc)->me_lock, "me softc") -#define ME_LOCK_DESTROY(sc) rm_destroy(&(sc)->me_lock) -#define ME_RLOCK_TRACKER struct rm_priotracker me_tracker -#define ME_RLOCK(sc) rm_rlock(&(sc)->me_lock, &me_tracker) -#define ME_RUNLOCK(sc) rm_runlock(&(sc)->me_lock, &me_tracker) -#define ME_RLOCK_ASSERT(sc) rm_assert(&(sc)->me_lock, RA_RLOCKED) -#define ME_WLOCK(sc) rm_wlock(&(sc)->me_lock) -#define ME_WUNLOCK(sc) rm_wunlock(&(sc)->me_lock) -#define ME_WLOCK_ASSERT(sc) rm_assert(&(sc)->me_lock, RA_WLOCKED) +#define ME_RLOCK() epoch_enter_preempt(net_epoch_preempt) +#define ME_RUNLOCK() epoch_exit_preempt(net_epoch_preempt) +#define ME_WAIT() epoch_wait_preempt(net_epoch_preempt) -#define ME_LIST_LOCK_INIT(x) mtx_init(&V_me_mtx, "me_mtx", NULL, MTX_DEF) -#define ME_LIST_LOCK_DESTROY(x) mtx_destroy(&V_me_mtx) -#define ME_LIST_LOCK(x) mtx_lock(&V_me_mtx) -#define ME_LIST_UNLOCK(x) mtx_unlock(&V_me_mtx) +#ifndef ME_HASH_SIZE +#define ME_HASH_SIZE (1 << 4) +#endif +static VNET_DEFINE(struct me_list *, me_hashtbl) = NULL; +#define V_me_hashtbl VNET(me_hashtbl) +#define ME_HASH(src, dst) (V_me_hashtbl[\ + me_hashval((src), (dst)) & (ME_HASH_SIZE - 1)]) -static VNET_DEFINE(LIST_HEAD(, me_softc), me_softc_list); -#define V_me_softc_list VNET(me_softc_list) static struct sx me_ioctl_sx; SX_SYSINIT(me_ioctl_sx, &me_ioctl_sx, "me_ioctl"); @@ -123,21 +114,9 @@ static int me_output(struct ifnet *, struct mbuf *, const struct sockaddr *, struct route *); static int me_input(struct mbuf *, int, int, void *); -static int me_set_tunnel(struct ifnet *, struct sockaddr_in *, - struct sockaddr_in *); -static void me_delete_tunnel(struct ifnet *); -static int me_encapcheck(const struct mbuf *, int, int, void *); +static int me_set_tunnel(struct me_softc *, in_addr_t, in_addr_t); +static void me_delete_tunnel(struct me_softc *); -#define ME_MINLEN (sizeof(struct ip) + sizeof(struct mobhdr) -\ - sizeof(in_addr_t)) -static const struct encap_config ipv4_encap_cfg = { - .proto = IPPROTO_MOBILE, - .min_length = ME_MINLEN, - .exact_match = (sizeof(in_addr_t) << 4) + 8, - .check = me_encapcheck, - .input = me_input -}; - SYSCTL_DECL(_net_link); static SYSCTL_NODE(_net_link, IFT_TUNNEL, me, CTLFLAG_RW, 0, "Minimal Encapsulation for IP (RFC 2004)"); @@ -150,11 +129,32 @@ static VNET_DEFINE(int, max_me_nesting) = MAX_ME_NEST; SYSCTL_INT(_net_link_me, OID_AUTO, max_nesting, CTLFLAG_RW | CTLFLAG_VNET, &VNET_NAME(max_me_nesting), 0, "Max nested tunnels"); +static uint32_t +me_hashval(in_addr_t src, in_addr_t dst) +{ + uint32_t ret; + + ret = fnv_32_buf(&src, sizeof(src), FNV1_32_INIT); + return (fnv_32_buf(&dst, sizeof(dst), ret)); +} + +static struct me_list * +me_hashinit(void) +{ + struct me_list *hash; + int i; + + hash = malloc(sizeof(struct me_list) * ME_HASH_SIZE, + M_IFME, M_WAITOK); + for (i = 0; i < ME_HASH_SIZE; i++) + CK_LIST_INIT(&hash[i]); + + return (hash); +} + static void vnet_me_init(const void *unused __unused) { - LIST_INIT(&V_me_softc_list); - ME_LIST_LOCK_INIT(); V_me_cloner = if_clone_simple(mename, me_clone_create, me_clone_destroy, 0); } @@ -165,8 +165,9 @@ static void vnet_me_uninit(const void *unused __unused) { + if (V_me_hashtbl != NULL) + free(V_me_hashtbl, M_IFME); if_clone_detach(V_me_cloner); - ME_LIST_LOCK_DESTROY(); } VNET_SYSUNINIT(vnet_me_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, vnet_me_uninit, NULL); @@ -179,7 +180,6 @@ me_clone_create(struct if_clone *ifc, int unit, caddr_ sc = malloc(sizeof(struct me_softc), M_IFME, M_WAITOK | M_ZERO); sc->me_fibnum = curthread->td_proc->p_fibnum; ME2IFP(sc) = if_alloc(IFT_TUNNEL); - ME_LOCK_INIT(sc); ME2IFP(sc)->if_softc = sc; if_initname(ME2IFP(sc), mename, unit); @@ -193,9 +193,6 @@ me_clone_create(struct if_clone *ifc, int unit, caddr_ ME2IFP(sc)->if_capenable |= IFCAP_LINKSTATE; if_attach(ME2IFP(sc)); bpfattach(ME2IFP(sc), DLT_NULL, sizeof(u_int32_t)); - ME_LIST_LOCK(); - LIST_INSERT_HEAD(&V_me_softc_list, sc, me_list); - ME_LIST_UNLOCK(); return (0); } @@ -206,24 +203,20 @@ me_clone_destroy(struct ifnet *ifp) sx_xlock(&me_ioctl_sx); sc = ifp->if_softc; - me_delete_tunnel(ifp); - ME_LIST_LOCK(); - LIST_REMOVE(sc, me_list); - ME_LIST_UNLOCK(); + me_delete_tunnel(sc); bpfdetach(ifp); if_detach(ifp); ifp->if_softc = NULL; sx_xunlock(&me_ioctl_sx); + ME_WAIT(); if_free(ifp); - ME_LOCK_DESTROY(sc); free(sc, M_IFME); } static int me_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { - ME_RLOCK_TRACKER; struct ifreq *ifr = (struct ifreq *)data; struct sockaddr_in *src, *dst; struct me_softc *sc; @@ -251,10 +244,8 @@ me_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) error = 0; switch (cmd) { case SIOCSIFPHYADDR: - src = (struct sockaddr_in *) - &(((struct in_aliasreq *)data)->ifra_addr); - dst = (struct sockaddr_in *) - &(((struct in_aliasreq *)data)->ifra_dstaddr); + src = &((struct in_aliasreq *)data)->ifra_addr; + dst = &((struct in_aliasreq *)data)->ifra_dstaddr; if (src->sin_family != dst->sin_family || src->sin_family != AF_INET || src->sin_len != dst->sin_len || @@ -267,17 +258,16 @@ me_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) error = EADDRNOTAVAIL; break; } - error = me_set_tunnel(ifp, src, dst); + error = me_set_tunnel(sc, src->sin_addr.s_addr, + dst->sin_addr.s_addr); break; case SIOCDIFPHYADDR: - me_delete_tunnel(ifp); + me_delete_tunnel(sc); break; case SIOCGIFPSRCADDR: case SIOCGIFPDSTADDR: - ME_RLOCK(sc); if (!ME_READY(sc)) { error = EADDRNOTAVAIL; - ME_RUNLOCK(sc); break; } src = (struct sockaddr_in *)&ifr->ifr_addr; @@ -292,7 +282,6 @@ me_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) src->sin_addr = sc->me_dst; break; } - ME_RUNLOCK(sc); error = prison_if(curthread->td_ucred, sintosa(src)); if (error != 0) memset(src, 0, sizeof(*src)); @@ -318,81 +307,71 @@ end: } static int -me_encapcheck(const struct mbuf *m, int off, int proto, void *arg) +me_lookup(const struct mbuf *m, int off, int proto, void **arg) { - ME_RLOCK_TRACKER; + const struct ip *ip; struct me_softc *sc; - struct ip *ip; - int ret; - sc = (struct me_softc *)arg; - if ((ME2IFP(sc)->if_flags & IFF_UP) == 0) - return (0); - - M_ASSERTPKTHDR(m); - - ret = 0; - ME_RLOCK(sc); - if (ME_READY(sc)) { - ip = mtod(m, struct ip *); + MPASS(in_epoch()); + ip = mtod(m, const struct ip *); + CK_LIST_FOREACH(sc, &ME_HASH(ip->ip_dst.s_addr, + ip->ip_src.s_addr), chain) { if (sc->me_src.s_addr == ip->ip_dst.s_addr && - sc->me_dst.s_addr == ip->ip_src.s_addr) - ret = 32 * 2 + 8; + sc->me_dst.s_addr == ip->ip_src.s_addr) { + if ((ME2IFP(sc)->if_flags & IFF_UP) == 0) + return (0); + *arg = sc; + return (ENCAP_DRV_LOOKUP); + } } - ME_RUNLOCK(sc); - return (ret); + return (0); } static int -me_set_tunnel(struct ifnet *ifp, struct sockaddr_in *src, - struct sockaddr_in *dst) +me_set_tunnel(struct me_softc *sc, in_addr_t src, in_addr_t dst) { - struct me_softc *sc, *tsc; + struct me_softc *tmp; sx_assert(&me_ioctl_sx, SA_XLOCKED); - ME_LIST_LOCK(); - sc = ifp->if_softc; - LIST_FOREACH(tsc, &V_me_softc_list, me_list) { - if (tsc == sc || !ME_READY(tsc)) + + if (V_me_hashtbl == NULL) + V_me_hashtbl = me_hashinit(); + + if (sc->me_src.s_addr == src && sc->me_dst.s_addr == dst) + return (0); + + CK_LIST_FOREACH(tmp, &ME_HASH(src, dst), chain) { + if (tmp == sc) continue; - if (tsc->me_src.s_addr == src->sin_addr.s_addr && - tsc->me_dst.s_addr == dst->sin_addr.s_addr) { - ME_LIST_UNLOCK(); + if (tmp->me_src.s_addr == src && + tmp->me_dst.s_addr == dst) return (EADDRNOTAVAIL); - } } - ME_LIST_UNLOCK(); - ME_WLOCK(sc); - sc->me_dst = dst->sin_addr; - sc->me_src = src->sin_addr; - ME_WUNLOCK(sc); + me_delete_tunnel(sc); + sc->me_dst.s_addr = dst; + sc->me_src.s_addr = src; + CK_LIST_INSERT_HEAD(&ME_HASH(src, dst), sc, chain); - if (sc->me_ecookie == NULL) - sc->me_ecookie = ip_encap_attach(&ipv4_encap_cfg, - sc, M_WAITOK); - if (sc->me_ecookie != NULL) { - ifp->if_drv_flags |= IFF_DRV_RUNNING; - if_link_state_change(ifp, LINK_STATE_UP); - } + ME2IFP(sc)->if_drv_flags |= IFF_DRV_RUNNING; + if_link_state_change(ME2IFP(sc), LINK_STATE_UP); return (0); } static void -me_delete_tunnel(struct ifnet *ifp) +me_delete_tunnel(struct me_softc *sc) { - struct me_softc *sc = ifp->if_softc; sx_assert(&me_ioctl_sx, SA_XLOCKED); - if (sc->me_ecookie != NULL) - ip_encap_detach(sc->me_ecookie); - sc->me_ecookie = NULL; - ME_WLOCK(sc); - sc->me_src.s_addr = 0; - sc->me_dst.s_addr = 0; - ME_WUNLOCK(sc); - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - if_link_state_change(ifp, LINK_STATE_DOWN); + if (ME_READY(sc)) { + CK_LIST_REMOVE(sc, chain); + ME_WAIT(); + + sc->me_src.s_addr = 0; + sc->me_dst.s_addr = 0; + ME2IFP(sc)->if_drv_flags &= ~IFF_DRV_RUNNING; + if_link_state_change(ME2IFP(sc), LINK_STATE_DOWN); + } } static uint16_t @@ -505,58 +484,48 @@ me_check_nesting(struct ifnet *ifp, struct mbuf *m) static int me_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, - struct route *ro) + struct route *ro __unused) { uint32_t af; - int error; -#ifdef MAC - error = mac_ifnet_check_transmit(ifp, m); - if (error != 0) - goto drop; -#endif - if ((ifp->if_flags & IFF_MONITOR) != 0 || - (ifp->if_flags & IFF_UP) == 0) { - error = ENETDOWN; - goto drop; - } - - error = me_check_nesting(ifp, m); - if (error != 0) - goto drop; - - m->m_flags &= ~(M_BCAST|M_MCAST); if (dst->sa_family == AF_UNSPEC) bcopy(dst->sa_data, &af, sizeof(af)); else af = dst->sa_family; - if (af != AF_INET) { - error = EAFNOSUPPORT; - goto drop; - } - BPF_MTAP2(ifp, &af, sizeof(af), m); + m->m_pkthdr.csum_data = af; return (ifp->if_transmit(ifp, m)); -drop: - m_freem(m); - if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); - return (error); } static int me_transmit(struct ifnet *ifp, struct mbuf *m) { - ME_RLOCK_TRACKER; struct mobhdr mh; struct me_softc *sc; struct ip *ip; + uint32_t af; int error, hlen, plen; +#ifdef MAC + error = mac_ifnet_check_transmit(ifp, m); + if (error != 0) + goto drop; +#endif + error = ENETDOWN; + ME_RLOCK(); sc = ifp->if_softc; - if (sc == NULL) { - error = ENETDOWN; + if (sc == NULL || !ME_READY(sc) || + (ifp->if_flags & IFF_MONITOR) != 0 || + (ifp->if_flags & IFF_UP) == 0 || + (error = me_check_nesting(ifp, m) != 0)) { m_freem(m); goto drop; } + af = m->m_pkthdr.csum_data; + if (af != AF_INET) { + error = EAFNOSUPPORT; + m_freem(m); + goto drop; + } if (m->m_len < sizeof(struct ip)) m = m_pullup(m, sizeof(struct ip)); if (m == NULL) { @@ -573,13 +542,6 @@ me_transmit(struct ifnet *ifp, struct mbuf *m) mh.mob_proto = ip->ip_p; mh.mob_src = ip->ip_src; mh.mob_dst = ip->ip_dst; - ME_RLOCK(sc); - if (!ME_READY(sc)) { - ME_RUNLOCK(sc); - error = ENETDOWN; - m_freem(m); - goto drop; - } if (in_hosteq(sc->me_src, ip->ip_src)) { hlen = sizeof(struct mobhdr) - sizeof(struct in_addr); mh.mob_flags = 0; @@ -590,8 +552,8 @@ me_transmit(struct ifnet *ifp, struct mbuf *m) plen = m->m_pkthdr.len; ip->ip_src = sc->me_src; ip->ip_dst = sc->me_dst; + m->m_flags &= ~(M_BCAST|M_MCAST); M_SETFIB(m, sc->me_fibnum); - ME_RUNLOCK(sc); M_PREPEND(m, hlen, M_NOWAIT); if (m == NULL) { error = ENOBUFS; @@ -619,6 +581,7 @@ drop: if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); if_inc_counter(ifp, IFCOUNTER_OBYTES, plen); } + ME_RUNLOCK(); return (error); } @@ -628,13 +591,26 @@ me_qflush(struct ifnet *ifp __unused) } +static const struct encaptab *ecookie = NULL; +static const struct encap_config me_encap_cfg = { + .proto = IPPROTO_MOBILE, + .min_length = sizeof(struct ip) + sizeof(struct mobhdr) - + sizeof(in_addr_t), + .exact_match = ENCAP_DRV_LOOKUP, + .lookup = me_lookup, + .input = me_input +}; + static int memodevent(module_t mod, int type, void *data) { switch (type) { case MOD_LOAD: + ecookie = ip_encap_attach(&me_encap_cfg, NULL, M_WAITOK); + break; case MOD_UNLOAD: + ip_encap_detach(ecookie); break; default: return (EOPNOTSUPP); From owner-svn-src-head@freebsd.org Thu Jun 14 15:04:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6CC9100BDF1; Thu, 14 Jun 2018 15:04:31 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 78F876F125; Thu, 14 Jun 2018 15:04:31 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A7D22023; Thu, 14 Jun 2018 15:04:31 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5EF4VnC025761; Thu, 14 Jun 2018 15:04:31 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5EF4VHo025760; Thu, 14 Jun 2018 15:04:31 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201806141504.w5EF4VHo025760@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 14 Jun 2018 15:04:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335144 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 335144 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 15:04:32 -0000 Author: ae Date: Thu Jun 14 15:04:30 2018 New Revision: 335144 URL: https://svnweb.freebsd.org/changeset/base/335144 Log: Add missing BPF_MTAP2() for outbound packets. Modified: head/sys/net/if_me.c Modified: head/sys/net/if_me.c ============================================================================== --- head/sys/net/if_me.c Thu Jun 14 15:02:27 2018 (r335143) +++ head/sys/net/if_me.c Thu Jun 14 15:04:30 2018 (r335144) @@ -549,6 +549,7 @@ me_transmit(struct ifnet *ifp, struct mbuf *m) hlen = sizeof(struct mobhdr); mh.mob_flags = MOB_FLAGS_SP; } + BPF_MTAP2(ifp, &af, sizeof(af), m); plen = m->m_pkthdr.len; ip->ip_src = sc->me_src; ip->ip_dst = sc->me_dst; From owner-svn-src-head@freebsd.org Thu Jun 14 15:04:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D27E9100BE88; Thu, 14 Jun 2018 15:04:50 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 59B136F268; Thu, 14 Jun 2018 15:04:50 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C4252025; Thu, 14 Jun 2018 15:04:50 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5EF4oaU025818; Thu, 14 Jun 2018 15:04:50 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5EF4oZd025817; Thu, 14 Jun 2018 15:04:50 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201806141504.w5EF4oZd025817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 14 Jun 2018 15:04:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335145 - head/tests/sys/audit X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/audit X-SVN-Commit-Revision: 335145 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 15:04:51 -0000 Author: asomers Date: Thu Jun 14 15:04:49 2018 New Revision: 335145 URL: https://svnweb.freebsd.org/changeset/base/335145 Log: audit(4): add tests for fhopen, fhstat, and fhstatfs Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15798 Modified: head/tests/sys/audit/file-attribute-access.c Modified: head/tests/sys/audit/file-attribute-access.c ============================================================================== --- head/tests/sys/audit/file-attribute-access.c Thu Jun 14 15:04:30 2018 (r335144) +++ head/tests/sys/audit/file-attribute-access.c Thu Jun 14 15:04:49 2018 (r335145) @@ -40,7 +40,8 @@ static struct pollfd fds[1]; static mode_t mode = 0777; static pid_t pid; -static int filedesc; +static fhandle_t fht; +static int filedesc, fhdesc; static char extregex[80]; static struct stat statbuff; static struct statfs statfsbuff; @@ -370,6 +371,164 @@ ATF_TC_CLEANUP(getfsstat_failure, tc) } +ATF_TC_WITH_CLEANUP(fhopen_success); +ATF_TC_HEAD(fhopen_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "fhopen(2) call"); +} + +ATF_TC_BODY(fhopen_success, tc) +{ + pid = getpid(); + snprintf(extregex, sizeof(extregex), "fhopen.*%d.*return,success", pid); + + /* File needs to exist to get a file-handle */ + ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + /* Get the file handle to be passed to fhopen(2) */ + ATF_REQUIRE_EQ(0, getfh(path, &fht)); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE((fhdesc = fhopen(&fht, O_RDWR)) != -1); + check_audit(fds, extregex, pipefd); + + close(fhdesc); + close(filedesc); +} + +ATF_TC_CLEANUP(fhopen_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(fhopen_failure); +ATF_TC_HEAD(fhopen_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "fhopen(2) call"); +} + +ATF_TC_BODY(fhopen_failure, tc) +{ + const char *regex = "fhopen.*return,failure : Invalid argument"; + FILE *pipefd = setup(fds, auclass); + /* + * Failure reason: NULL does not represent any file handle + * and O_CREAT is not allowed as the flag for fhopen(2) + */ + ATF_REQUIRE_EQ(-1, fhopen(NULL, O_CREAT)); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(fhopen_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(fhstat_success); +ATF_TC_HEAD(fhstat_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "fstat(2) call"); +} + +ATF_TC_BODY(fhstat_success, tc) +{ + pid = getpid(); + snprintf(extregex, sizeof(extregex), "fhstat.*%d.*return,success", pid); + + /* File needs to exist to get a file-handle */ + ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + /* Get the file handle to be passed to fhstat(2) */ + ATF_REQUIRE_EQ(0, getfh(path, &fht)); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, fhstat(&fht, &statbuff)); + check_audit(fds, extregex, pipefd); + close(filedesc); +} + +ATF_TC_CLEANUP(fhstat_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(fhstat_failure); +ATF_TC_HEAD(fhstat_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "fhstat(2) call"); +} + +ATF_TC_BODY(fhstat_failure, tc) +{ + const char *regex = "fhstat.*return,failure : Bad address"; + FILE *pipefd = setup(fds, auclass); + /* Failure reason: NULL does not represent any file handle */ + ATF_REQUIRE_EQ(-1, fhstat(NULL, NULL)); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(fhstat_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(fhstatfs_success); +ATF_TC_HEAD(fhstatfs_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "fstatfs(2) call"); +} + +ATF_TC_BODY(fhstatfs_success, tc) +{ + pid = getpid(); + snprintf(extregex, sizeof(extregex), "fhstatfs.*%d.*success", pid); + + /* File needs to exist to get a file-handle */ + ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + /* Get the file handle to be passed to fhstatfs(2) */ + ATF_REQUIRE_EQ(0, getfh(path, &fht)); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, fhstatfs(&fht, &statfsbuff)); + check_audit(fds, extregex, pipefd); + close(filedesc); +} + +ATF_TC_CLEANUP(fhstatfs_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(fhstatfs_failure); +ATF_TC_HEAD(fhstatfs_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "fhstatfs(2) call"); +} + +ATF_TC_BODY(fhstatfs_failure, tc) +{ + const char *regex = "fhstatfs.*return,failure : Bad address"; + FILE *pipefd = setup(fds, auclass); + /* Failure reason: NULL does not represent any file handle */ + ATF_REQUIRE_EQ(-1, fhstatfs(NULL, NULL)); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(fhstatfs_failure, tc) +{ + cleanup(); +} + + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, stat_success); @@ -388,6 +547,13 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, getfsstat_success); ATF_TP_ADD_TC(tp, getfsstat_failure); + + ATF_TP_ADD_TC(tp, fhopen_success); + ATF_TP_ADD_TC(tp, fhopen_failure); + ATF_TP_ADD_TC(tp, fhstat_success); + ATF_TP_ADD_TC(tp, fhstat_failure); + ATF_TP_ADD_TC(tp, fhstatfs_success); + ATF_TP_ADD_TC(tp, fhstatfs_failure); return (atf_no_error()); } From owner-svn-src-head@freebsd.org Thu Jun 14 16:01:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DD90100FD8F; Thu, 14 Jun 2018 16:01:12 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D5025717E4; Thu, 14 Jun 2018 16:01:11 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6C4D2889; Thu, 14 Jun 2018 16:01:11 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5EG1BNn053649; Thu, 14 Jun 2018 16:01:11 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5EG1Bqj053648; Thu, 14 Jun 2018 16:01:11 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201806141601.w5EG1Bqj053648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 14 Jun 2018 16:01:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335146 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 335146 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 16:01:12 -0000 Author: jhibbits Date: Thu Jun 14 16:01:11 2018 New Revision: 335146 URL: https://svnweb.freebsd.org/changeset/base/335146 Log: Fix CTR formatting for moea64_native bootstrap On very large memory systems 'size' can become 2GB or larger, resulting in a negative value being formatted. Also, moea64_pteg_count is already a long, so format it as such. Modified: head/sys/powerpc/aim/moea64_native.c Modified: head/sys/powerpc/aim/moea64_native.c ============================================================================== --- head/sys/powerpc/aim/moea64_native.c Thu Jun 14 15:04:49 2018 (r335145) +++ head/sys/powerpc/aim/moea64_native.c Thu Jun 14 16:01:11 2018 (r335146) @@ -453,7 +453,7 @@ moea64_bootstrap_native(mmu_t mmup, vm_offset_t kernel */ size = moea64_pteg_count * sizeof(struct lpteg); - CTR2(KTR_PMAP, "moea64_bootstrap: %d PTEGs, %d bytes", + CTR2(KTR_PMAP, "moea64_bootstrap: %lu PTEGs, %lu bytes", moea64_pteg_count, size); rw_init(&moea64_eviction_lock, "pte eviction"); From owner-svn-src-head@freebsd.org Thu Jun 14 16:09:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84EFD1010689; Thu, 14 Jun 2018 16:09:30 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 394BE71D70; Thu, 14 Jun 2018 16:09:30 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A54129EE; Thu, 14 Jun 2018 16:09:30 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5EG9TA4057316; Thu, 14 Jun 2018 16:09:29 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5EG9Tpj057315; Thu, 14 Jun 2018 16:09:29 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201806141609.w5EG9Tpj057315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 14 Jun 2018 16:09:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335147 - in head/etc: devd rc.d X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/etc: devd rc.d X-SVN-Commit-Revision: 335147 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 16:09:30 -0000 Author: kevans Date: Thu Jun 14 16:09:29 2018 New Revision: 335147 URL: https://svnweb.freebsd.org/changeset/base/335147 Log: devmatch: Address some rc nits - devmatch_enable in rc.conf(5) was not gating the start of devmatch - Use quietstart in devd/devmatch to suppress dozens of 'Cannot start' messages and other spurious messages from rc.subr(8) that aren't necessarily helpful. Discussed with: imp Modified: head/etc/devd/devmatch.conf head/etc/rc.d/devmatch Modified: head/etc/devd/devmatch.conf ============================================================================== --- head/etc/devd/devmatch.conf Thu Jun 14 16:01:11 2018 (r335146) +++ head/etc/devd/devmatch.conf Thu Jun 14 16:09:29 2018 (r335147) @@ -9,7 +9,7 @@ # # Generic NOMATCH event nomatch 100 { - action "service devmatch start '?$_'"; + action "service devmatch quietstart '?$_'"; }; # Add the following to devd.conf to prevent this from running: Modified: head/etc/rc.d/devmatch ============================================================================== --- head/etc/rc.d/devmatch Thu Jun 14 16:01:11 2018 (r335146) +++ head/etc/rc.d/devmatch Thu Jun 14 16:09:29 2018 (r335147) @@ -33,6 +33,7 @@ name="devmatch" desc="Use devmatch(8) to load kernel modules" +rcvar="${name}_enable" start_cmd="${name}_start" stop_cmd=':' From owner-svn-src-head@freebsd.org Thu Jun 14 16:11:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 732DE1010A02; Thu, 14 Jun 2018 16:11:51 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 29AC57202A; Thu, 14 Jun 2018 16:11:51 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0BEB92B4C; Thu, 14 Jun 2018 16:11:51 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5EGBoer059133; Thu, 14 Jun 2018 16:11:50 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5EGBoNv059132; Thu, 14 Jun 2018 16:11:50 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201806141611.w5EGBoNv059132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 14 Jun 2018 16:11:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335148 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 335148 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 16:11:51 -0000 Author: tsoome Date: Thu Jun 14 16:11:50 2018 New Revision: 335148 URL: https://svnweb.freebsd.org/changeset/base/335148 Log: libsa: open() should use NULL instead of typecasted 0 Modified: head/stand/libsa/open.c Modified: head/stand/libsa/open.c ============================================================================== --- head/stand/libsa/open.c Thu Jun 14 16:09:29 2018 (r335147) +++ head/stand/libsa/open.c Thu Jun 14 16:11:50 2018 (r335148) @@ -103,11 +103,11 @@ open(const char *fname, int mode) f = &files[fd]; f->f_flags = mode + 1; - f->f_dev = (struct devsw *)0; - f->f_ops = (struct fs_ops *)0; + f->f_dev = NULL; + f->f_ops = NULL; f->f_offset = 0; f->f_devdata = NULL; - file = (char *)0; + file = NULL; if (exclusive_file_system != NULL) { fs = exclusive_file_system; @@ -119,11 +119,11 @@ open(const char *fname, int mode) error = devopen(f, fname, &file); if (error || - (((f->f_flags & F_NODEV) == 0) && f->f_dev == (struct devsw *)0)) + (((f->f_flags & F_NODEV) == 0) && f->f_dev == NULL)) goto err; /* see if we opened a raw device; otherwise, 'file' is the file name. */ - if (file == (char *)0 || *file == '\0') { + if (file == NULL || *file == '\0') { f->f_flags |= F_RAW; f->f_rabuf = NULL; return (fd); From owner-svn-src-head@freebsd.org Thu Jun 14 17:08:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B4171014B45; Thu, 14 Jun 2018 17:08:45 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B1CEC75096; Thu, 14 Jun 2018 17:08:44 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8EA5A33F7; Thu, 14 Jun 2018 17:08:44 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5EH8iRs087637; Thu, 14 Jun 2018 17:08:44 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5EH8iWM087636; Thu, 14 Jun 2018 17:08:44 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201806141708.w5EH8iWM087636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Thu, 14 Jun 2018 17:08:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335154 - head/sys/cam/scsi X-SVN-Group: head X-SVN-Commit-Author: ken X-SVN-Commit-Paths: head/sys/cam/scsi X-SVN-Commit-Revision: 335154 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 17:08:45 -0000 Author: ken Date: Thu Jun 14 17:08:44 2018 New Revision: 335154 URL: https://svnweb.freebsd.org/changeset/base/335154 Log: Fix da(4) locking when probing SMR drives. Probing host aware and host managed SMR drives got broken in revision 330796. The added cam_periph_lock() calls were in areas in dadone() where the peripheral lock was already held. Since then, dadone() has been split into separate functions that are dedicated to each probe state. The result is that when probing a host aware drive, I ran into a recursive lock acquisition in dadone_probeatalogdir(). I would have run into the same problem in dadone_probeataiddir(), and in dadone_probeatasup() and dadone_probeatazone() in the error paths had the probe continued. The solution is to take out all of the extra cam_periph_lock() calls. I also added cam_periph_assert(periph, MA_OWNED) near the top of each of the dadone_* calls. These make it clear to anyone coming along in the the future that the lock is held in the probe done functions. Also add a locking assert in daprobedone(), to make it clear that it must be called with the periph lock held. Sponsored by: Spectra Logic Differential Revision: https://reviews.freebsd.org/D15764 Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Thu Jun 14 17:06:19 2018 (r335153) +++ head/sys/cam/scsi/scsi_da.c Thu Jun 14 17:08:44 2018 (r335154) @@ -2428,6 +2428,8 @@ daprobedone(struct cam_periph *periph, union ccb *ccb) softc = (struct da_softc *)periph->softc; + cam_periph_assert(periph, MA_OWNED); + dadeletemethodchoose(softc, DA_DELETE_NONE); if (bootverbose && (softc->flags & DA_FLAG_ANNOUNCED) == 0) { @@ -4505,6 +4507,8 @@ dadone_probewp(struct cam_periph *periph, union ccb *d priority = done_ccb->ccb_h.pinfo.priority; csio = &done_ccb->csio; + cam_periph_assert(periph, MA_OWNED); + if (softc->minimum_cmd_size > 6) { mode_hdr10 = (struct scsi_mode_header_10 *)csio->data_ptr; dev_spec = mode_hdr10->dev_spec; @@ -4578,6 +4582,8 @@ dadone_proberc(struct cam_periph *periph, union ccb *d rcaplong = (struct scsi_read_capacity_data_long *) csio->data_ptr; + cam_periph_assert(periph, MA_OWNED); + if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { struct disk_params *dp; uint32_t block_size; @@ -4835,6 +4841,8 @@ dadone_probelbp(struct cam_periph *periph, union ccb * csio = &done_ccb->csio; lbp = (struct scsi_vpd_logical_block_prov *)csio->data_ptr; + cam_periph_assert(periph, MA_OWNED); + if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { /* * T10/1799-D Revision 31 states at least one of these @@ -4891,6 +4899,8 @@ dadone_probeblklimits(struct cam_periph *periph, union csio = &done_ccb->csio; block_limits = (struct scsi_vpd_block_limits *)csio->data_ptr; + cam_periph_assert(periph, MA_OWNED); + if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { uint32_t max_txfer_len = scsi_4btoul( block_limits->max_txfer_len); @@ -4983,6 +4993,8 @@ dadone_probebdc(struct cam_periph *periph, union ccb * csio = &done_ccb->csio; bdc = (struct scsi_vpd_block_device_characteristics *)csio->data_ptr; + cam_periph_assert(periph, MA_OWNED); + if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { uint32_t valid_len; @@ -5088,6 +5100,8 @@ dadone_probeata(struct cam_periph *periph, union ccb * continue_probe = 0; error = 0; + cam_periph_assert(periph, MA_OWNED); + if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { uint16_t old_rate; @@ -5223,7 +5237,7 @@ dadone_probeatalogdir(struct cam_periph *periph, union priority = done_ccb->ccb_h.pinfo.priority; csio = &done_ccb->csio; - cam_periph_lock(periph); + cam_periph_assert(periph, MA_OWNED); if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { error = 0; softc->valid_logdir_len = 0; @@ -5276,7 +5290,6 @@ dadone_probeatalogdir(struct cam_periph *periph, union } } } - cam_periph_unlock(periph); free(csio->data_ptr, M_SCSIDA); @@ -5305,7 +5318,8 @@ dadone_probeataiddir(struct cam_periph *periph, union priority = done_ccb->ccb_h.pinfo.priority; csio = &done_ccb->csio; - cam_periph_lock(periph); + cam_periph_assert(periph, MA_OWNED); + if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { off_t entries_offset, max_entries; error = 0; @@ -5368,7 +5382,6 @@ dadone_probeataiddir(struct cam_periph *periph, union } } } - cam_periph_unlock(periph); free(csio->data_ptr, M_SCSIDA); @@ -5396,6 +5409,8 @@ dadone_probeatasup(struct cam_periph *periph, union cc priority = done_ccb->ccb_h.pinfo.priority; csio = &done_ccb->csio; + cam_periph_assert(periph, MA_OWNED); + if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { uint32_t valid_len; size_t needed_size; @@ -5466,9 +5481,7 @@ dadone_probeatasup(struct cam_periph *periph, union cc * Supported Capabilities page, clear the * flag... */ - cam_periph_lock(periph); softc->flags &= ~DA_FLAG_CAN_ATA_SUPCAP; - cam_periph_unlock(periph); /* * And clear zone capabilities. */ @@ -5508,6 +5521,8 @@ dadone_probeatazone(struct cam_periph *periph, union c softc = (struct da_softc *)periph->softc; csio = &done_ccb->csio; + cam_periph_assert(periph, MA_OWNED); + if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { struct ata_zoned_info_log *zi_log; uint32_t valid_len; @@ -5568,10 +5583,8 @@ dadone_probeatazone(struct cam_periph *periph, union c if (error == ERESTART) return; else if (error != 0) { - cam_periph_lock(periph); softc->flags &= ~DA_FLAG_CAN_ATA_ZONE; softc->flags &= ~DA_ZONE_FLAG_SET_MASK; - cam_periph_unlock(periph); if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { /* Don't wedge this device's queue */ @@ -5584,6 +5597,7 @@ dadone_probeatazone(struct cam_periph *periph, union c } } + free(csio->data_ptr, M_SCSIDA); daprobedone(periph, done_ccb); @@ -5602,6 +5616,8 @@ dadone_probezone(struct cam_periph *periph, union ccb softc = (struct da_softc *)periph->softc; csio = &done_ccb->csio; + cam_periph_assert(periph, MA_OWNED); + if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { uint32_t valid_len; size_t needed_len; @@ -5672,6 +5688,9 @@ dadone_tur(struct cam_periph *periph, union ccb *done_ softc = (struct da_softc *)periph->softc; csio = &done_ccb->csio; + + cam_periph_assert(periph, MA_OWNED); + if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { if (daerror(done_ccb, CAM_RETRY_SELTO, From owner-svn-src-head@freebsd.org Thu Jun 14 17:12:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6F34101520F; Thu, 14 Jun 2018 17:12:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C41E7573E; Thu, 14 Jun 2018 17:12:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id A357C10AFAD; Thu, 14 Jun 2018 13:12:29 -0400 (EDT) Subject: Re: svn commit: r335091 - head/sbin/nvmecontrol To: Warner Losh , "Rodney W. Grimes" References: <201806140457.w5E4vpEA042985@pdx.rh.CN85.dnsmgr.net> Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: John Baldwin Message-ID: <16d77299-ac4f-7885-674a-511d5f0f7b45@FreeBSD.org> Date: Thu, 14 Jun 2018 10:12:28 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Thu, 14 Jun 2018 13:12:30 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 17:12:36 -0000 On 6/13/18 10:21 PM, Warner Losh wrote: > > > On Wed, Jun 13, 2018 at 10:57 PM, Rodney W. Grimes > wrote: > > [ Charset UTF-8 unsupported, converting... ] > > Actually, that file (nvmecontrol_ext.h) is completely new. I'm not sure why > > it thought I copied it from util.c. Maybe it's a git svn integration thing. > > If it is a totally new file why is it showing contect diff with > + and -'s? > > > Don't know, but the whole contents of this file is 1 line of extern function statements. > > Since util.c is short, and I try to use identical copyright notices, I'm thinking git thought it was a move through 'magic' and that's where svn got confused into thinking it was a copy + modification which is where the diff came from. Yes. git fails at this often since it's notion of a copy is "implicit guess" that you can't override vs "explicit action". I sometimes have to do fixups after an 'arc patch' of a diff that git mangles where I save off a copy of the .c file, svn revert -f the file, then svn add the new file so it shows up as a new file from scratch. -- John Baldwin From owner-svn-src-head@freebsd.org Thu Jun 14 17:18:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B71A101593A; Thu, 14 Jun 2018 17:18:16 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 00C5E75BC6; Thu, 14 Jun 2018 17:18:16 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BBD653938; Thu, 14 Jun 2018 17:18:15 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5EHIFa5093608; Thu, 14 Jun 2018 17:18:15 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5EHIFnE093607; Thu, 14 Jun 2018 17:18:15 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201806141718.w5EHIFnE093607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 14 Jun 2018 17:18:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335156 - head/sys/arm/arm X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/arm X-SVN-Commit-Revision: 335156 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 17:18:16 -0000 Author: manu Date: Thu Jun 14 17:18:15 2018 New Revision: 335156 URL: https://svnweb.freebsd.org/changeset/base/335156 Log: arm timer: Add workaround for Allwinner A64 timer The timer present in allwinner A64 SoC is unstable, value can jump backward or forward. It was found that when bit 11 and upper roll over the low bits can sometimes being read as all as 1 or all as 0. Simply ignore the values for those cases. Modified: head/sys/arm/arm/generic_timer.c Modified: head/sys/arm/arm/generic_timer.c ============================================================================== --- head/sys/arm/arm/generic_timer.c Thu Jun 14 17:09:33 2018 (r335155) +++ head/sys/arm/arm/generic_timer.c Thu Jun 14 17:18:15 2018 (r335156) @@ -92,6 +92,7 @@ __FBSDID("$FreeBSD$"); struct arm_tmr_softc { struct resource *res[4]; void *ihl[4]; + uint64_t (*get_cntxct)(bool); uint32_t clkfreq; struct eventtimer et; bool physical; @@ -142,6 +143,28 @@ get_freq(void) } static uint64_t +get_cntxct_a64_unstable(bool physical) +{ + uint64_t val +; + isb(); + if (physical) { + do { + val = get_el0(cntpct); + } + while (((val + 1) & 0x7FF) <= 1); + } + else { + do { + val = get_el0(cntvct); + } + while (((val + 1) & 0x7FF) <= 1); + } + + return (val); +} + +static uint64_t get_cntxct(bool physical) { uint64_t val; @@ -226,7 +249,7 @@ static unsigned arm_tmr_get_timecount(struct timecounter *tc) { - return (get_cntxct(arm_tmr_sc->physical)); + return (arm_tmr_sc->get_cntxct(arm_tmr_sc->physical)); } static int @@ -379,6 +402,7 @@ arm_tmr_attach(device_t dev) if (arm_tmr_sc) return (ENXIO); + sc->get_cntxct = &get_cntxct_a64_unstable; #ifdef FDT /* Get the base clock frequency */ node = ofw_bus_get_node(dev); @@ -387,6 +411,13 @@ arm_tmr_attach(device_t dev) sizeof(clock)); if (error > 0) sc->clkfreq = clock; + + if (OF_hasprop(node, "allwinner,sun50i-a64-unstable-timer")) { + sc->get_cntxct = &get_cntxct_a64_unstable; + if (bootverbose) + device_printf(dev, + "Enabling allwinner unstable timer workaround\n"); + } } #endif @@ -518,10 +549,10 @@ arm_tmr_do_delay(int usec, void *arg) else counts = usec * counts_per_usec; - first = get_cntxct(sc->physical); + first = sc->get_cntxct(sc->physical); while (counts > 0) { - last = get_cntxct(sc->physical); + last = sc->get_cntxct(sc->physical); counts -= (int32_t)(last - first); first = last; } From owner-svn-src-head@freebsd.org Thu Jun 14 17:19:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BF221015A9C; Thu, 14 Jun 2018 17:19:45 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3200D75D58; Thu, 14 Jun 2018 17:19:45 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 12C413939; Thu, 14 Jun 2018 17:19:45 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5EHJiSe093709; Thu, 14 Jun 2018 17:19:44 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5EHJiic093708; Thu, 14 Jun 2018 17:19:44 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201806141719.w5EHJiic093708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 14 Jun 2018 17:19:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335157 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 335157 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 17:19:45 -0000 Author: manu Date: Thu Jun 14 17:19:44 2018 New Revision: 335157 URL: https://svnweb.freebsd.org/changeset/base/335157 Log: aw_spi: Add pnp info Modified: head/sys/arm/allwinner/aw_spi.c Modified: head/sys/arm/allwinner/aw_spi.c ============================================================================== --- head/sys/arm/allwinner/aw_spi.c Thu Jun 14 17:18:15 2018 (r335156) +++ head/sys/arm/allwinner/aw_spi.c Thu Jun 14 17:19:44 2018 (r335157) @@ -602,3 +602,4 @@ static devclass_t aw_spi_devclass; DRIVER_MODULE(aw_spi, simplebus, aw_spi_driver, aw_spi_devclass, 0, 0); DRIVER_MODULE(ofw_spibus, aw_spi, ofw_spibus_driver, ofw_spibus_devclass, 0, 0); MODULE_DEPEND(aw_spi, ofw_spibus, 1, 1, 1); +SIMPLEBUS_PNP_INFO(compat_data); From owner-svn-src-head@freebsd.org Thu Jun 14 17:20:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D75891015BC9; Thu, 14 Jun 2018 17:20:47 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8DED575F0C; Thu, 14 Jun 2018 17:20:47 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F0B73954; Thu, 14 Jun 2018 17:20:47 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5EHKl2R094531; Thu, 14 Jun 2018 17:20:47 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5EHKlRJ094530; Thu, 14 Jun 2018 17:20:47 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201806141720.w5EHKlRJ094530@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 14 Jun 2018 17:20:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335158 - head/sys/dev/spibus X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/spibus X-SVN-Commit-Revision: 335158 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 17:20:48 -0000 Author: manu Date: Thu Jun 14 17:20:47 2018 New Revision: 335158 URL: https://svnweb.freebsd.org/changeset/base/335158 Log: spi: Add SPIBUS_PNP_INFO macro The PNP info string is the same as the SIMPLEBUS one but driver should depend on spibus and not simplebus Modified: head/sys/dev/spibus/spi.h Modified: head/sys/dev/spibus/spi.h ============================================================================== --- head/sys/dev/spibus/spi.h Thu Jun 14 17:19:44 2018 (r335157) +++ head/sys/dev/spibus/spi.h Thu Jun 14 17:20:47 2018 (r335158) @@ -40,3 +40,7 @@ struct spi_command { #define SPI_COMMAND_INITIALIZER { 0 } #define SPI_CHIP_SELECT_HIGH 0x1 /* Chip select high (else low) */ + +#define SPIBUS_PNP_DESCR "Z:compat;P:#;" +#define SPIBUS_PNP_INFO(t) \ + MODULE_PNP_INFO(SPIBUS_PNP_DESCR, spibus, t, t, sizeof(t[0]), sizeof(t) / sizeof(t[0])); From owner-svn-src-head@freebsd.org Thu Jun 14 17:21:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E3DF1015C7D; Thu, 14 Jun 2018 17:21:10 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 34C6E76056; Thu, 14 Jun 2018 17:21:10 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 161053AEB; Thu, 14 Jun 2018 17:21:10 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5EHL9L4094596; Thu, 14 Jun 2018 17:21:09 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5EHL91t094595; Thu, 14 Jun 2018 17:21:09 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201806141721.w5EHL91t094595@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 14 Jun 2018 17:21:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335159 - head/sys/dev/flash X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/flash X-SVN-Commit-Revision: 335159 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 17:21:10 -0000 Author: manu Date: Thu Jun 14 17:21:09 2018 New Revision: 335159 URL: https://svnweb.freebsd.org/changeset/base/335159 Log: mx25l: Add pnp info Modified: head/sys/dev/flash/mx25l.c Modified: head/sys/dev/flash/mx25l.c ============================================================================== --- head/sys/dev/flash/mx25l.c Thu Jun 14 17:20:47 2018 (r335158) +++ head/sys/dev/flash/mx25l.c Thu Jun 14 17:21:09 2018 (r335159) @@ -684,3 +684,4 @@ static driver_t mx25l_driver = { DRIVER_MODULE(mx25l, spibus, mx25l_driver, mx25l_devclass, 0, 0); MODULE_DEPEND(mx25l, spibus, 1, 1, 1); +SPIBUS_PNP_INFO(compat_data); From owner-svn-src-head@freebsd.org Thu Jun 14 17:23:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61E4B1016136; Thu, 14 Jun 2018 17:23:53 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0952576495; Thu, 14 Jun 2018 17:23:53 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D98B13B5C; Thu, 14 Jun 2018 17:23:52 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5EHNq4h098426; Thu, 14 Jun 2018 17:23:52 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5EHNqG5098421; Thu, 14 Jun 2018 17:23:52 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201806141723.w5EHNqG5098421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 14 Jun 2018 17:23:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335160 - in head/sys: conf powerpc/aim powerpc/include X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys: conf powerpc/aim powerpc/include X-SVN-Commit-Revision: 335160 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 17:23:53 -0000 Author: jhibbits Date: Thu Jun 14 17:23:51 2018 New Revision: 335160 URL: https://svnweb.freebsd.org/changeset/base/335160 Log: Split the PowerISA 3.0 HPT implementation from historic PowerISA 3.0 makes several changes to not only the format of the HPT but also the behavior surrounding it. For instance, TLBIE no longer requires serialization. Removing this lock cuts buildworld time in half on a 18-core/72-thread POWER9 system, demonstrating that this lock is highly contended on such a system. There was odd behavior observed trying to make this change in a backwards-compatible manner in moea64_native.c, so the best option was to fully split it, and largely revert the original changes adding POWER9 support to the original file. Suggested by: nwhitehorn Added: head/sys/powerpc/aim/isa3_hashtb.c - copied, changed from r335146, head/sys/powerpc/aim/moea64_native.c Modified: head/sys/conf/files.powerpc head/sys/powerpc/aim/aim_machdep.c head/sys/powerpc/aim/moea64_native.c head/sys/powerpc/include/mmuvar.h Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Thu Jun 14 17:21:09 2018 (r335159) +++ head/sys/conf/files.powerpc Thu Jun 14 17:23:51 2018 (r335160) @@ -102,6 +102,7 @@ libkern/qdivrem.c optional powerpc | powerpcspe libkern/ucmpdi2.c optional powerpc | powerpcspe libkern/udivdi3.c optional powerpc | powerpcspe libkern/umoddi3.c optional powerpc | powerpcspe +powerpc/aim/isa3_hashtb.c optional aim powerpc64 powerpc/aim/locore.S optional aim no-obj powerpc/aim/aim_machdep.c optional aim powerpc/aim/mmu_oea.c optional aim powerpc Modified: head/sys/powerpc/aim/aim_machdep.c ============================================================================== --- head/sys/powerpc/aim/aim_machdep.c Thu Jun 14 17:21:09 2018 (r335159) +++ head/sys/powerpc/aim/aim_machdep.c Thu Jun 14 17:23:51 2018 (r335160) @@ -420,7 +420,9 @@ aim_cpu_init(vm_offset_t toc) * in case the platform module had a better idea of what we * should do. */ - if (cpu_features & PPC_FEATURE_64) + if (cpu_features2 & PPC_FEATURE2_ARCH_3_00) + pmap_mmu_install(MMU_TYPE_P9H, BUS_PROBE_GENERIC); + else if (cpu_features & PPC_FEATURE_64) pmap_mmu_install(MMU_TYPE_G5, BUS_PROBE_GENERIC); else pmap_mmu_install(MMU_TYPE_OEA, BUS_PROBE_GENERIC); Copied and modified: head/sys/powerpc/aim/isa3_hashtb.c (from r335146, head/sys/powerpc/aim/moea64_native.c) ============================================================================== --- head/sys/powerpc/aim/moea64_native.c Thu Jun 14 16:01:11 2018 (r335146, copy source) +++ head/sys/powerpc/aim/isa3_hashtb.c Thu Jun 14 17:23:51 2018 (r335160) @@ -134,56 +134,13 @@ __FBSDID("$FreeBSD$"); /* POWER9 only permits a 64k partition table size. */ #define PART_SIZE 0x10000 -static int moea64_crop_tlbie; - static __inline void -TLBIE(uint64_t vpn) { -#ifndef __powerpc64__ - register_t vpn_hi, vpn_lo; - register_t msr; - register_t scratch, intr; -#endif - - static volatile u_int tlbie_lock = 0; - +TLBIE(uint64_t vpn) +{ vpn <<= ADDR_PIDX_SHFT; - /* Hobo spinlock: we need stronger guarantees than mutexes provide */ - while (!atomic_cmpset_int(&tlbie_lock, 0, 1)); - isync(); /* Flush instruction queue once lock acquired */ - - if (moea64_crop_tlbie) - vpn &= ~(0xffffULL << 48); - -#ifdef __powerpc64__ __asm __volatile("tlbie %0" :: "r"(vpn) : "memory"); __asm __volatile("eieio; tlbsync; ptesync" ::: "memory"); -#else - vpn_hi = (uint32_t)(vpn >> 32); - vpn_lo = (uint32_t)vpn; - - intr = intr_disable(); - __asm __volatile("\ - mfmsr %0; \ - mr %1, %0; \ - insrdi %1,%5,1,0; \ - mtmsrd %1; isync; \ - \ - sld %1,%2,%4; \ - or %1,%1,%3; \ - tlbie %1; \ - \ - mtmsrd %0; isync; \ - eieio; \ - tlbsync; \ - ptesync;" - : "=r"(msr), "=r"(scratch) : "r"(vpn_hi), "r"(vpn_lo), "r"(32), "r"(1) - : "memory"); - intr_restore(intr); -#endif - - /* No barriers or special ops -- taken care of by ptesync above */ - tlbie_lock = 0; } #define DISABLE_TRANS(msr) msr = mfmsr(); mtmsr(msr & ~PSL_DR) @@ -192,48 +149,48 @@ TLBIE(uint64_t vpn) { /* * PTEG data. */ -static volatile struct pate *moea64_part_table; -static volatile struct lpte *moea64_pteg_table; -static struct rwlock moea64_eviction_lock; +static volatile struct pate *isa3_part_table; +static volatile struct lpte *isa3_hashtb_pteg_table; +static struct rwlock isa3_hashtb_eviction_lock; /* * PTE calls. */ -static int moea64_pte_insert_native(mmu_t, struct pvo_entry *); -static int64_t moea64_pte_synch_native(mmu_t, struct pvo_entry *); -static int64_t moea64_pte_clear_native(mmu_t, struct pvo_entry *, uint64_t); -static int64_t moea64_pte_replace_native(mmu_t, struct pvo_entry *, int); -static int64_t moea64_pte_unset_native(mmu_t mmu, struct pvo_entry *); +static int isa3_hashtb_pte_insert(mmu_t, struct pvo_entry *); +static int64_t isa3_hashtb_pte_synch(mmu_t, struct pvo_entry *); +static int64_t isa3_hashtb_pte_clear(mmu_t, struct pvo_entry *, uint64_t); +static int64_t isa3_hashtb_pte_replace(mmu_t, struct pvo_entry *, int); +static int64_t isa3_hashtb_pte_unset(mmu_t mmu, struct pvo_entry *); /* * Utility routines. */ -static void moea64_bootstrap_native(mmu_t mmup, +static void isa3_hashtb_bootstrap(mmu_t mmup, vm_offset_t kernelstart, vm_offset_t kernelend); -static void moea64_cpu_bootstrap_native(mmu_t, int ap); +static void isa3_hashtb_cpu_bootstrap(mmu_t, int ap); static void tlbia(void); -static mmu_method_t moea64_native_methods[] = { +static mmu_method_t isa3_hashtb_methods[] = { /* Internal interfaces */ - MMUMETHOD(mmu_bootstrap, moea64_bootstrap_native), - MMUMETHOD(mmu_cpu_bootstrap, moea64_cpu_bootstrap_native), + MMUMETHOD(mmu_bootstrap, isa3_hashtb_bootstrap), + MMUMETHOD(mmu_cpu_bootstrap, isa3_hashtb_cpu_bootstrap), - MMUMETHOD(moea64_pte_synch, moea64_pte_synch_native), - MMUMETHOD(moea64_pte_clear, moea64_pte_clear_native), - MMUMETHOD(moea64_pte_unset, moea64_pte_unset_native), - MMUMETHOD(moea64_pte_replace, moea64_pte_replace_native), - MMUMETHOD(moea64_pte_insert, moea64_pte_insert_native), + MMUMETHOD(moea64_pte_synch, isa3_hashtb_pte_synch), + MMUMETHOD(moea64_pte_clear, isa3_hashtb_pte_clear), + MMUMETHOD(moea64_pte_unset, isa3_hashtb_pte_unset), + MMUMETHOD(moea64_pte_replace, isa3_hashtb_pte_replace), + MMUMETHOD(moea64_pte_insert, isa3_hashtb_pte_insert), { 0, 0 } }; -MMU_DEF_INHERIT(oea64_mmu_native, MMU_TYPE_G5, moea64_native_methods, +MMU_DEF_INHERIT(isa3_mmu_native, MMU_TYPE_P9H, isa3_hashtb_methods, 0, oea64_mmu); static int64_t -moea64_pte_synch_native(mmu_t mmu, struct pvo_entry *pvo) +isa3_hashtb_pte_synch(mmu_t mmu, struct pvo_entry *pvo) { - volatile struct lpte *pt = moea64_pteg_table + pvo->pvo_pte.slot; + volatile struct lpte *pt = isa3_hashtb_pteg_table + pvo->pvo_pte.slot; struct lpte properpt; uint64_t ptelo; @@ -241,26 +198,26 @@ moea64_pte_synch_native(mmu_t mmu, struct pvo_entry *p moea64_pte_from_pvo(pvo, &properpt); - rw_rlock(&moea64_eviction_lock); + rw_rlock(&isa3_hashtb_eviction_lock); if ((be64toh(pt->pte_hi) & LPTE_AVPN_MASK) != (properpt.pte_hi & LPTE_AVPN_MASK)) { /* Evicted */ - rw_runlock(&moea64_eviction_lock); + rw_runlock(&isa3_hashtb_eviction_lock); return (-1); } PTESYNC(); ptelo = be64toh(pt->pte_lo); - rw_runlock(&moea64_eviction_lock); + rw_runlock(&isa3_hashtb_eviction_lock); return (ptelo & (LPTE_REF | LPTE_CHG)); } static int64_t -moea64_pte_clear_native(mmu_t mmu, struct pvo_entry *pvo, uint64_t ptebit) +isa3_hashtb_pte_clear(mmu_t mmu, struct pvo_entry *pvo, uint64_t ptebit) { - volatile struct lpte *pt = moea64_pteg_table + pvo->pvo_pte.slot; + volatile struct lpte *pt = isa3_hashtb_pteg_table + pvo->pvo_pte.slot; struct lpte properpt; uint64_t ptelo; @@ -268,11 +225,11 @@ moea64_pte_clear_native(mmu_t mmu, struct pvo_entry *p moea64_pte_from_pvo(pvo, &properpt); - rw_rlock(&moea64_eviction_lock); + rw_rlock(&isa3_hashtb_eviction_lock); if ((be64toh(pt->pte_hi) & LPTE_AVPN_MASK) != (properpt.pte_hi & LPTE_AVPN_MASK)) { /* Evicted */ - rw_runlock(&moea64_eviction_lock); + rw_runlock(&isa3_hashtb_eviction_lock); return (-1); } @@ -289,35 +246,35 @@ moea64_pte_clear_native(mmu_t mmu, struct pvo_entry *p #else ((uint8_t *)(&properpt.pte_lo))[1]; #endif - rw_runlock(&moea64_eviction_lock); + rw_runlock(&isa3_hashtb_eviction_lock); critical_enter(); TLBIE(pvo->pvo_vpn); critical_exit(); } else { - rw_runlock(&moea64_eviction_lock); - ptelo = moea64_pte_unset_native(mmu, pvo); - moea64_pte_insert_native(mmu, pvo); + rw_runlock(&isa3_hashtb_eviction_lock); + ptelo = isa3_hashtb_pte_unset(mmu, pvo); + isa3_hashtb_pte_insert(mmu, pvo); } return (ptelo & (LPTE_REF | LPTE_CHG)); } static int64_t -moea64_pte_unset_native(mmu_t mmu, struct pvo_entry *pvo) +isa3_hashtb_pte_unset(mmu_t mmu, struct pvo_entry *pvo) { - volatile struct lpte *pt = moea64_pteg_table + pvo->pvo_pte.slot; + volatile struct lpte *pt = isa3_hashtb_pteg_table + pvo->pvo_pte.slot; struct lpte properpt; uint64_t ptelo; moea64_pte_from_pvo(pvo, &properpt); - rw_rlock(&moea64_eviction_lock); + rw_rlock(&isa3_hashtb_eviction_lock); if ((be64toh(pt->pte_hi & LPTE_AVPN_MASK)) != (properpt.pte_hi & LPTE_AVPN_MASK)) { /* Evicted */ moea64_pte_overflow--; - rw_runlock(&moea64_eviction_lock); + rw_runlock(&isa3_hashtb_eviction_lock); return (-1); } @@ -333,7 +290,7 @@ moea64_pte_unset_native(mmu_t mmu, struct pvo_entry *p ptelo = be64toh(pt->pte_lo); *((volatile int32_t *)(&pt->pte_hi) + 1) = 0; /* Release lock */ critical_exit(); - rw_runlock(&moea64_eviction_lock); + rw_runlock(&isa3_hashtb_eviction_lock); /* Keep statistics */ moea64_pte_valid--; @@ -342,9 +299,9 @@ moea64_pte_unset_native(mmu_t mmu, struct pvo_entry *p } static int64_t -moea64_pte_replace_native(mmu_t mmu, struct pvo_entry *pvo, int flags) +isa3_hashtb_pte_replace(mmu_t mmu, struct pvo_entry *pvo, int flags) { - volatile struct lpte *pt = moea64_pteg_table + pvo->pvo_pte.slot; + volatile struct lpte *pt = isa3_hashtb_pteg_table + pvo->pvo_pte.slot; struct lpte properpt; int64_t ptelo; @@ -352,32 +309,30 @@ moea64_pte_replace_native(mmu_t mmu, struct pvo_entry /* Just some software bits changing. */ moea64_pte_from_pvo(pvo, &properpt); - rw_rlock(&moea64_eviction_lock); + rw_rlock(&isa3_hashtb_eviction_lock); if ((be64toh(pt->pte_hi) & LPTE_AVPN_MASK) != (properpt.pte_hi & LPTE_AVPN_MASK)) { - rw_runlock(&moea64_eviction_lock); + rw_runlock(&isa3_hashtb_eviction_lock); return (-1); } pt->pte_hi = htobe64(properpt.pte_hi); ptelo = be64toh(pt->pte_lo); - rw_runlock(&moea64_eviction_lock); + rw_runlock(&isa3_hashtb_eviction_lock); } else { /* Otherwise, need reinsertion and deletion */ - ptelo = moea64_pte_unset_native(mmu, pvo); - moea64_pte_insert_native(mmu, pvo); + ptelo = isa3_hashtb_pte_unset(mmu, pvo); + isa3_hashtb_pte_insert(mmu, pvo); } return (ptelo); } static void -moea64_cpu_bootstrap_native(mmu_t mmup, int ap) +isa3_hashtb_cpu_bootstrap(mmu_t mmup, int ap) { int i = 0; - #ifdef __powerpc64__ struct slb *slb = PCPU_GET(aim.slb); register_t seg0; - #endif /* * Initialize segment registers and MMU @@ -395,41 +350,30 @@ moea64_cpu_bootstrap_native(mmu_t mmup, int ap) * Install kernel SLB entries */ - #ifdef __powerpc64__ - __asm __volatile ("slbia"); - __asm __volatile ("slbmfee %0,%1; slbie %0;" : "=r"(seg0) : - "r"(0)); + __asm __volatile ("slbia"); + __asm __volatile ("slbmfee %0,%1; slbie %0;" : "=r"(seg0) : + "r"(0)); - for (i = 0; i < n_slbs; i++) { - if (!(slb[i].slbe & SLBE_VALID)) - continue; + for (i = 0; i < n_slbs; i++) { + if (!(slb[i].slbe & SLBE_VALID)) + continue; - __asm __volatile ("slbmte %0, %1" :: - "r"(slb[i].slbv), "r"(slb[i].slbe)); - } - #else - for (i = 0; i < 16; i++) - mtsrin(i << ADDR_SR_SHFT, kernel_pmap->pm_sr[i]); - #endif + __asm __volatile ("slbmte %0, %1" :: + "r"(slb[i].slbv), "r"(slb[i].slbe)); + } /* * Install page table */ - if (cpu_features2 & PPC_FEATURE2_ARCH_3_00) { - mtspr(SPR_PTCR, - ((uintptr_t)moea64_part_table & ~DMAP_BASE_ADDRESS) | - flsl((PART_SIZE >> 12) - 1)); - } else { - __asm __volatile ("ptesync; mtsdr1 %0; isync" - :: "r"(((uintptr_t)moea64_pteg_table & ~DMAP_BASE_ADDRESS) - | (uintptr_t)(flsl(moea64_pteg_mask >> 11)))); - } + mtspr(SPR_PTCR, + ((uintptr_t)isa3_part_table & ~DMAP_BASE_ADDRESS) | + flsl((PART_SIZE >> 12) - 1)); tlbia(); } static void -moea64_bootstrap_native(mmu_t mmup, vm_offset_t kernelstart, +isa3_hashtb_bootstrap(mmu_t mmup, vm_offset_t kernelstart, vm_offset_t kernelend) { vm_size_t size; @@ -439,23 +383,14 @@ moea64_bootstrap_native(mmu_t mmup, vm_offset_t kernel moea64_early_bootstrap(mmup, kernelstart, kernelend); - switch (mfpvr() >> 16) { - case IBMPOWER4: - case IBMPOWER4PLUS: - case IBM970: - case IBM970FX: - case IBM970GX: - case IBM970MP: - moea64_crop_tlbie = true; - } /* * Allocate PTEG table. */ size = moea64_pteg_count * sizeof(struct lpteg); - CTR2(KTR_PMAP, "moea64_bootstrap: %lu PTEGs, %lu bytes", + CTR2(KTR_PMAP, "moea64_bootstrap: %d PTEGs, %lu bytes", moea64_pteg_count, size); - rw_init(&moea64_eviction_lock, "pte eviction"); + rw_init(&isa3_hashtb_eviction_lock, "pte eviction"); /* * We now need to allocate memory. This memory, to be allocated, @@ -464,38 +399,30 @@ moea64_bootstrap_native(mmu_t mmup, vm_offset_t kernel * as a measure of last resort. We do this a couple times. */ - if (cpu_features2 & PPC_FEATURE2_ARCH_3_00) { - moea64_part_table = - (struct pate *)moea64_bootstrap_alloc(PART_SIZE, PART_SIZE); - if (hw_direct_map) - moea64_part_table = (struct pate *)PHYS_TO_DMAP( - (vm_offset_t)moea64_part_table); - } + isa3_part_table = + (struct pate *)moea64_bootstrap_alloc(PART_SIZE, PART_SIZE); + if (hw_direct_map) + isa3_part_table = (struct pate *)PHYS_TO_DMAP( + (vm_offset_t)isa3_part_table); /* * PTEG table must be aligned on a 256k boundary, but can be placed - * anywhere with that alignment on POWER ISA 3+ systems. On earlier - * systems, offset addition is done by the CPU with bitwise OR rather - * than addition, so the table must also be aligned on a boundary of - * its own size. Pick the larger of the two, which works on all - * systems. + * anywhere with that alignment on POWER ISA 3+ systems. */ - moea64_pteg_table = (struct lpte *)moea64_bootstrap_alloc(size, + isa3_hashtb_pteg_table = (struct lpte *)moea64_bootstrap_alloc(size, MAX(256*1024, size)); if (hw_direct_map) - moea64_pteg_table = - (struct lpte *)PHYS_TO_DMAP((vm_offset_t)moea64_pteg_table); + isa3_hashtb_pteg_table = + (struct lpte *)PHYS_TO_DMAP((vm_offset_t)isa3_hashtb_pteg_table); DISABLE_TRANS(msr); - if (cpu_features2 & PPC_FEATURE2_ARCH_3_00) { - bzero(__DEVOLATILE(void *, moea64_part_table), PART_SIZE); - moea64_part_table[0].pagetab = - ((uintptr_t)moea64_pteg_table & ~DMAP_BASE_ADDRESS) | - (uintptr_t)(flsl((moea64_pteg_count - 1) >> 11)); - } - bzero(__DEVOLATILE(void *, moea64_pteg_table), moea64_pteg_count * + bzero(__DEVOLATILE(void *, isa3_part_table), PART_SIZE); + isa3_part_table[0].pagetab = + ((uintptr_t)isa3_hashtb_pteg_table & ~DMAP_BASE_ADDRESS) | + (uintptr_t)(flsl((moea64_pteg_count - 1) >> 11)); + bzero(__DEVOLATILE(void *, isa3_hashtb_pteg_table), moea64_pteg_count * sizeof(struct lpteg)); ENABLE_TRANS(msr); - CTR1(KTR_PMAP, "moea64_bootstrap: PTEG table at %p", moea64_pteg_table); + CTR1(KTR_PMAP, "moea64_bootstrap: PTEG table at %p", isa3_hashtb_pteg_table); moea64_mid_bootstrap(mmup, kernelstart, kernelend); @@ -504,7 +431,7 @@ moea64_bootstrap_native(mmu_t mmup, vm_offset_t kernel */ if (!hw_direct_map) { size = moea64_pteg_count * sizeof(struct lpteg); - off = (vm_offset_t)(moea64_pteg_table); + off = (vm_offset_t)(isa3_hashtb_pteg_table); DISABLE_TRANS(msr); for (pa = off; pa < off + size; pa += PAGE_SIZE) pmap_kenter(pa, pa); @@ -519,43 +446,13 @@ static void tlbia(void) { vm_offset_t i; - #ifndef __powerpc64__ - register_t msr, scratch; - #endif i = 0xc00; /* IS = 11 */ - switch (mfpvr() >> 16) { - case IBM970: - case IBM970FX: - case IBM970MP: - case IBM970GX: - case IBMPOWER4: - case IBMPOWER4PLUS: - case IBMPOWER5: - case IBMPOWER5PLUS: - i = 0; /* IS not supported */ - break; - } TLBSYNC(); for (; i < 0x200000; i += 0x00001000) { - #ifdef __powerpc64__ __asm __volatile("tlbiel %0" :: "r"(i)); - #else - __asm __volatile("\ - mfmsr %0; \ - mr %1, %0; \ - insrdi %1,%3,1,0; \ - mtmsrd %1; \ - isync; \ - \ - tlbiel %2; \ - \ - mtmsrd %0; \ - isync;" - : "=r"(msr), "=r"(scratch) : "r"(i), "r"(1)); - #endif } EIEIO(); @@ -598,7 +495,7 @@ atomic_pte_lock(volatile struct lpte *pte, uint64_t bi } static uintptr_t -moea64_insert_to_pteg_native(struct lpte *pvo_pt, uintptr_t slotbase, +isa3_hashtb_insert_to_pteg(struct lpte *pvo_pt, uintptr_t slotbase, uint64_t mask) { volatile struct lpte *pt; @@ -610,7 +507,7 @@ moea64_insert_to_pteg_native(struct lpte *pvo_pt, uint i = mftb() % 8; for (j = 0; j < 8; j++) { k = slotbase + (i + j) % 8; - pt = &moea64_pteg_table[k]; + pt = &isa3_hashtb_pteg_table[k]; /* Invalidate and seize lock only if no bits in mask set */ if (atomic_pte_lock(pt, mask, &oldptehi)) /* Lock obtained */ break; @@ -659,7 +556,7 @@ moea64_insert_to_pteg_native(struct lpte *pvo_pt, uint } static int -moea64_pte_insert_native(mmu_t mmu, struct pvo_entry *pvo) +isa3_hashtb_pte_insert(mmu_t mmu, struct pvo_entry *pvo) { struct lpte insertpt; uintptr_t slot; @@ -668,16 +565,16 @@ moea64_pte_insert_native(mmu_t mmu, struct pvo_entry * moea64_pte_from_pvo(pvo, &insertpt); /* Make sure further insertion is locked out during evictions */ - rw_rlock(&moea64_eviction_lock); + rw_rlock(&isa3_hashtb_eviction_lock); /* * First try primary hash. */ pvo->pvo_pte.slot &= ~7ULL; /* Base slot address */ - slot = moea64_insert_to_pteg_native(&insertpt, pvo->pvo_pte.slot, + slot = isa3_hashtb_insert_to_pteg(&insertpt, pvo->pvo_pte.slot, LPTE_VALID | LPTE_WIRED | LPTE_LOCKED); if (slot != -1) { - rw_runlock(&moea64_eviction_lock); + rw_runlock(&isa3_hashtb_eviction_lock); pvo->pvo_pte.slot = slot; return (0); } @@ -688,10 +585,10 @@ moea64_pte_insert_native(mmu_t mmu, struct pvo_entry * pvo->pvo_vaddr ^= PVO_HID; insertpt.pte_hi ^= LPTE_HID; pvo->pvo_pte.slot ^= (moea64_pteg_mask << 3); - slot = moea64_insert_to_pteg_native(&insertpt, pvo->pvo_pte.slot, + slot = isa3_hashtb_insert_to_pteg(&insertpt, pvo->pvo_pte.slot, LPTE_VALID | LPTE_WIRED | LPTE_LOCKED); if (slot != -1) { - rw_runlock(&moea64_eviction_lock); + rw_runlock(&isa3_hashtb_eviction_lock); pvo->pvo_pte.slot = slot; return (0); } @@ -701,15 +598,15 @@ moea64_pte_insert_native(mmu_t mmu, struct pvo_entry * */ /* Lock out all insertions for a bit */ - if (!rw_try_upgrade(&moea64_eviction_lock)) { - rw_runlock(&moea64_eviction_lock); - rw_wlock(&moea64_eviction_lock); + if (!rw_try_upgrade(&isa3_hashtb_eviction_lock)) { + rw_runlock(&isa3_hashtb_eviction_lock); + rw_wlock(&isa3_hashtb_eviction_lock); } - slot = moea64_insert_to_pteg_native(&insertpt, pvo->pvo_pte.slot, + slot = isa3_hashtb_insert_to_pteg(&insertpt, pvo->pvo_pte.slot, LPTE_WIRED | LPTE_LOCKED); if (slot != -1) { - rw_wunlock(&moea64_eviction_lock); + rw_wunlock(&isa3_hashtb_eviction_lock); pvo->pvo_pte.slot = slot; return (0); } @@ -718,16 +615,16 @@ moea64_pte_insert_native(mmu_t mmu, struct pvo_entry * pvo->pvo_vaddr ^= PVO_HID; insertpt.pte_hi ^= LPTE_HID; pvo->pvo_pte.slot ^= (moea64_pteg_mask << 3); - slot = moea64_insert_to_pteg_native(&insertpt, pvo->pvo_pte.slot, + slot = isa3_hashtb_insert_to_pteg(&insertpt, pvo->pvo_pte.slot, LPTE_WIRED | LPTE_LOCKED); if (slot != -1) { - rw_wunlock(&moea64_eviction_lock); + rw_wunlock(&isa3_hashtb_eviction_lock); pvo->pvo_pte.slot = slot; return (0); } /* No freeable slots in either PTEG? We're hosed. */ - rw_wunlock(&moea64_eviction_lock); + rw_wunlock(&isa3_hashtb_eviction_lock); panic("moea64_pte_insert: overflow"); return (-1); } Modified: head/sys/powerpc/aim/moea64_native.c ============================================================================== --- head/sys/powerpc/aim/moea64_native.c Thu Jun 14 17:21:09 2018 (r335159) +++ head/sys/powerpc/aim/moea64_native.c Thu Jun 14 17:23:51 2018 (r335160) @@ -192,7 +192,6 @@ TLBIE(uint64_t vpn) { /* * PTEG data. */ -static volatile struct pate *moea64_part_table; static volatile struct lpte *moea64_pteg_table; static struct rwlock moea64_eviction_lock; @@ -385,12 +384,6 @@ moea64_cpu_bootstrap_native(mmu_t mmup, int ap) mtmsr(mfmsr() & ~PSL_DR & ~PSL_IR); - switch (mfpvr() >> 16) { - case IBMPOWER9: - mtspr(SPR_HID0, mfspr(SPR_HID0) & ~HID0_RADIX); - break; - } - /* * Install kernel SLB entries */ @@ -416,15 +409,9 @@ moea64_cpu_bootstrap_native(mmu_t mmup, int ap) * Install page table */ - if (cpu_features2 & PPC_FEATURE2_ARCH_3_00) { - mtspr(SPR_PTCR, - ((uintptr_t)moea64_part_table & ~DMAP_BASE_ADDRESS) | - flsl((PART_SIZE >> 12) - 1)); - } else { - __asm __volatile ("ptesync; mtsdr1 %0; isync" - :: "r"(((uintptr_t)moea64_pteg_table & ~DMAP_BASE_ADDRESS) - | (uintptr_t)(flsl(moea64_pteg_mask >> 11)))); - } + __asm __volatile ("ptesync; mtsdr1 %0; isync" + :: "r"(((uintptr_t)moea64_pteg_table & ~DMAP_BASE_ADDRESS) + | (uintptr_t)(flsl(moea64_pteg_mask >> 11)))); tlbia(); } @@ -463,14 +450,6 @@ moea64_bootstrap_native(mmu_t mmup, vm_offset_t kernel * allocate. We don't have BAT. So drop to data real mode for a minute * as a measure of last resort. We do this a couple times. */ - - if (cpu_features2 & PPC_FEATURE2_ARCH_3_00) { - moea64_part_table = - (struct pate *)moea64_bootstrap_alloc(PART_SIZE, PART_SIZE); - if (hw_direct_map) - moea64_part_table = (struct pate *)PHYS_TO_DMAP( - (vm_offset_t)moea64_part_table); - } /* * PTEG table must be aligned on a 256k boundary, but can be placed * anywhere with that alignment on POWER ISA 3+ systems. On earlier @@ -485,12 +464,6 @@ moea64_bootstrap_native(mmu_t mmup, vm_offset_t kernel moea64_pteg_table = (struct lpte *)PHYS_TO_DMAP((vm_offset_t)moea64_pteg_table); DISABLE_TRANS(msr); - if (cpu_features2 & PPC_FEATURE2_ARCH_3_00) { - bzero(__DEVOLATILE(void *, moea64_part_table), PART_SIZE); - moea64_part_table[0].pagetab = - ((uintptr_t)moea64_pteg_table & ~DMAP_BASE_ADDRESS) | - (uintptr_t)(flsl((moea64_pteg_count - 1) >> 11)); - } bzero(__DEVOLATILE(void *, moea64_pteg_table), moea64_pteg_count * sizeof(struct lpteg)); ENABLE_TRANS(msr); Modified: head/sys/powerpc/include/mmuvar.h ============================================================================== --- head/sys/powerpc/include/mmuvar.h Thu Jun 14 17:21:09 2018 (r335159) +++ head/sys/powerpc/include/mmuvar.h Thu Jun 14 17:23:51 2018 (r335160) @@ -116,6 +116,7 @@ DATA_SET(mmu_set, name) #define MMU_TYPE_BOOKE "mmu_booke" /* Book-E MMU specification */ #define MMU_TYPE_OEA "mmu_oea" /* 32-bit OEA */ #define MMU_TYPE_G5 "mmu_g5" /* 64-bit bridge (ibm 970) */ +#define MMU_TYPE_P9H "mmu_p9h" /* 64-bit native ISA 3.0 (POWER9) hash */ #define MMU_TYPE_8xx "mmu_8xx" /* 8xx quicc TLB */ #endif /* _MACHINE_MMUVAR_H_ */ From owner-svn-src-head@freebsd.org Thu Jun 14 17:27:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B51D10164B5; Thu, 14 Jun 2018 17:27:01 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F895766BD; Thu, 14 Jun 2018 17:27:01 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf0-f53.google.com (mail-lf0-f53.google.com [209.85.215.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id D05A010749; Thu, 14 Jun 2018 17:27:00 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf0-f53.google.com with SMTP id y20-v6so10666018lfy.0; Thu, 14 Jun 2018 10:27:00 -0700 (PDT) X-Gm-Message-State: APt69E1j64jITs3P/68YsMD1YNY8ZhVZLFeG/SnEZkQwAblJmsPAMDR/ zPIrlGLLJfg5SnefqfLwMvehyghMXX7KMX5L9Y4= X-Google-Smtp-Source: ADUXVKI88EoWdV1NQHJuCEZXQpu34k7gRJNXoKJI7BTTMHqH818YwET5lglUARm4a0rKrdY17xe64KGOA4H6yiUqk2s= X-Received: by 2002:a2e:1188:: with SMTP id 8-v6mr2520458ljr.38.1528997219231; Thu, 14 Jun 2018 10:26:59 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:8582:0:0:0:0:0 with HTTP; Thu, 14 Jun 2018 10:26:38 -0700 (PDT) In-Reply-To: <201806141718.w5EHIFnE093607@repo.freebsd.org> References: <201806141718.w5EHIFnE093607@repo.freebsd.org> From: Kyle Evans Date: Thu, 14 Jun 2018 12:26:38 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335156 - head/sys/arm/arm To: Emmanuel Vadot Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 17:27:01 -0000 On Thu, Jun 14, 2018 at 12:18 PM, Emmanuel Vadot wrote: > Author: manu > Date: Thu Jun 14 17:18:15 2018 > New Revision: 335156 > URL: https://svnweb.freebsd.org/changeset/base/335156 > > Log: > arm timer: Add workaround for Allwinner A64 timer > > The timer present in allwinner A64 SoC is unstable, value can jump backward > or forward. > It was found that when bit 11 and upper roll over the low bits can sometimes > being read as all as 1 or all as 0. > Simply ignore the values for those cases. > > Modified: > head/sys/arm/arm/generic_timer.c > > Modified: head/sys/arm/arm/generic_timer.c > ============================================================================== > --- head/sys/arm/arm/generic_timer.c Thu Jun 14 17:09:33 2018 (r335155) > +++ head/sys/arm/arm/generic_timer.c Thu Jun 14 17:18:15 2018 (r335156) > @@ -92,6 +92,7 @@ __FBSDID("$FreeBSD$"); > struct arm_tmr_softc { > struct resource *res[4]; > void *ihl[4]; > + uint64_t (*get_cntxct)(bool); > uint32_t clkfreq; > struct eventtimer et; > bool physical; > @@ -142,6 +143,28 @@ get_freq(void) > } > > static uint64_t > +get_cntxct_a64_unstable(bool physical) > +{ > + uint64_t val > +; > + isb(); > + if (physical) { > + do { > + val = get_el0(cntpct); > + } > + while (((val + 1) & 0x7FF) <= 1); > + } > + else { > + do { > + val = get_el0(cntvct); > + } > + while (((val + 1) & 0x7FF) <= 1); > + } > + > + return (val); > +} > + > +static uint64_t > get_cntxct(bool physical) > { > uint64_t val; > @@ -226,7 +249,7 @@ static unsigned > arm_tmr_get_timecount(struct timecounter *tc) > { > > - return (get_cntxct(arm_tmr_sc->physical)); > + return (arm_tmr_sc->get_cntxct(arm_tmr_sc->physical)); > } > > static int > @@ -379,6 +402,7 @@ arm_tmr_attach(device_t dev) > if (arm_tmr_sc) > return (ENXIO); > > + sc->get_cntxct = &get_cntxct_a64_unstable; > #ifdef FDT > /* Get the base clock frequency */ > node = ofw_bus_get_node(dev); Was it intentional to set sc->get_cntxct to get_cntxct_a64_unstable in the general case? Seems like this should've been get_cntxct. > @@ -387,6 +411,13 @@ arm_tmr_attach(device_t dev) > sizeof(clock)); > if (error > 0) > sc->clkfreq = clock; > + > + if (OF_hasprop(node, "allwinner,sun50i-a64-unstable-timer")) { > + sc->get_cntxct = &get_cntxct_a64_unstable; > + if (bootverbose) > + device_printf(dev, > + "Enabling allwinner unstable timer workaround\n"); > + } > } > #endif > Since the a64-specific get_cntxct is set here. > @@ -518,10 +549,10 @@ arm_tmr_do_delay(int usec, void *arg) > else > counts = usec * counts_per_usec; > > - first = get_cntxct(sc->physical); > + first = sc->get_cntxct(sc->physical); > > while (counts > 0) { > - last = get_cntxct(sc->physical); > + last = sc->get_cntxct(sc->physical); > counts -= (int32_t)(last - first); > first = last; > } > _______________________________________________ > 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-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Thu Jun 14 17:32:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FB4A1016B31; Thu, 14 Jun 2018 17:32:24 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 160AC76D57; Thu, 14 Jun 2018 17:32:24 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB43B3D01; Thu, 14 Jun 2018 17:32:23 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5EHWN10003839; Thu, 14 Jun 2018 17:32:23 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5EHWNq3003838; Thu, 14 Jun 2018 17:32:23 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201806141732.w5EHWNq3003838@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 14 Jun 2018 17:32:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335161 - head/sys/arm/arm X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/arm X-SVN-Commit-Revision: 335161 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 17:32:24 -0000 Author: manu Date: Thu Jun 14 17:32:23 2018 New Revision: 335161 URL: https://svnweb.freebsd.org/changeset/base/335161 Log: arm timer: Use the default get_cntxct by default Reported by: kevans Modified: head/sys/arm/arm/generic_timer.c Modified: head/sys/arm/arm/generic_timer.c ============================================================================== --- head/sys/arm/arm/generic_timer.c Thu Jun 14 17:23:51 2018 (r335160) +++ head/sys/arm/arm/generic_timer.c Thu Jun 14 17:32:23 2018 (r335161) @@ -402,7 +402,7 @@ arm_tmr_attach(device_t dev) if (arm_tmr_sc) return (ENXIO); - sc->get_cntxct = &get_cntxct_a64_unstable; + sc->get_cntxct = &get_cntxct; #ifdef FDT /* Get the base clock frequency */ node = ofw_bus_get_node(dev); From owner-svn-src-head@freebsd.org Thu Jun 14 17:33:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3A9A1016CA8; Thu, 14 Jun 2018 17:33:11 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E769376ED8; Thu, 14 Jun 2018 17:33:10 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id f2f66d57; Thu, 14 Jun 2018 19:33:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=etH+I20pdx+StGum9GxjWomeDW8=; b=L5sU0R3McEMc6FtAh2n6IUOeNhtS Usq0DYtks4yzgcpT41sQtWcjtaECuTppvaaeuDAuSo5JocnHMx2+lZyYZa5g0ZHz CGA+G2SsWR7I8mGja9G83HoIFgFX9atyuRChwW+fRkIbPRoRPRlmeO/MMmUXLNay bp1PEeWKwTDWG0o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=YWlDl97zp7rexgCG2lUYITCj9CaUrKKfKekNtunLgAfkSaS40xZuSe7h UcAQgm6tACtDOObzYIEBhocrI2SYosEfqCyg1JErRG1sUdudrCOVQOFIs4/02oRA Bucir0e87IrJ2UZex+U51ijkqLpxsLeq5ItMgvLqHCvuSwr50vM= Received: from skull.home.blih.net (ip-9.net-89-3-105.rev.numericable.fr [89.3.105.9]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 023f2d0e TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Thu, 14 Jun 2018 19:33:08 +0200 (CEST) Date: Thu, 14 Jun 2018 19:33:08 +0200 From: Emmanuel Vadot To: Kyle Evans Cc: Emmanuel Vadot , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335156 - head/sys/arm/arm Message-Id: <20180614193308.dc3c20f6d98f12f6c628fa0e@bidouilliste.com> In-Reply-To: References: <201806141718.w5EHIFnE093607@repo.freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 17:33:12 -0000 On Thu, 14 Jun 2018 12:26:38 -0500 Kyle Evans wrote: > On Thu, Jun 14, 2018 at 12:18 PM, Emmanuel Vadot wrote: > > Author: manu > > Date: Thu Jun 14 17:18:15 2018 > > New Revision: 335156 > > URL: https://svnweb.freebsd.org/changeset/base/335156 > > > > Log: > > arm timer: Add workaround for Allwinner A64 timer > > > > The timer present in allwinner A64 SoC is unstable, value can jump backward > > or forward. > > It was found that when bit 11 and upper roll over the low bits can sometimes > > being read as all as 1 or all as 0. > > Simply ignore the values for those cases. > > > > Modified: > > head/sys/arm/arm/generic_timer.c > > > > Modified: head/sys/arm/arm/generic_timer.c > > ============================================================================== > > --- head/sys/arm/arm/generic_timer.c Thu Jun 14 17:09:33 2018 (r335155) > > +++ head/sys/arm/arm/generic_timer.c Thu Jun 14 17:18:15 2018 (r335156) > > @@ -92,6 +92,7 @@ __FBSDID("$FreeBSD$"); > > struct arm_tmr_softc { > > struct resource *res[4]; > > void *ihl[4]; > > + uint64_t (*get_cntxct)(bool); > > uint32_t clkfreq; > > struct eventtimer et; > > bool physical; > > @@ -142,6 +143,28 @@ get_freq(void) > > } > > > > static uint64_t > > +get_cntxct_a64_unstable(bool physical) > > +{ > > + uint64_t val > > +; > > + isb(); > > + if (physical) { > > + do { > > + val = get_el0(cntpct); > > + } > > + while (((val + 1) & 0x7FF) <= 1); > > + } > > + else { > > + do { > > + val = get_el0(cntvct); > > + } > > + while (((val + 1) & 0x7FF) <= 1); > > + } > > + > > + return (val); > > +} > > + > > +static uint64_t > > get_cntxct(bool physical) > > { > > uint64_t val; > > @@ -226,7 +249,7 @@ static unsigned > > arm_tmr_get_timecount(struct timecounter *tc) > > { > > > > - return (get_cntxct(arm_tmr_sc->physical)); > > + return (arm_tmr_sc->get_cntxct(arm_tmr_sc->physical)); > > } > > > > static int > > @@ -379,6 +402,7 @@ arm_tmr_attach(device_t dev) > > if (arm_tmr_sc) > > return (ENXIO); > > > > + sc->get_cntxct = &get_cntxct_a64_unstable; > > #ifdef FDT > > /* Get the base clock frequency */ > > node = ofw_bus_get_node(dev); > > Was it intentional to set sc->get_cntxct to get_cntxct_a64_unstable in > the general case? Seems like this should've been get_cntxct. Fixed in 335161. Thanks, > > @@ -387,6 +411,13 @@ arm_tmr_attach(device_t dev) > > sizeof(clock)); > > if (error > 0) > > sc->clkfreq = clock; > > + > > + if (OF_hasprop(node, "allwinner,sun50i-a64-unstable-timer")) { > > + sc->get_cntxct = &get_cntxct_a64_unstable; > > + if (bootverbose) > > + device_printf(dev, > > + "Enabling allwinner unstable timer workaround\n"); > > + } > > } > > #endif > > > > Since the a64-specific get_cntxct is set here. > > > @@ -518,10 +549,10 @@ arm_tmr_do_delay(int usec, void *arg) > > else > > counts = usec * counts_per_usec; > > > > - first = get_cntxct(sc->physical); > > + first = sc->get_cntxct(sc->physical); > > > > while (counts > 0) { > > - last = get_cntxct(sc->physical); > > + last = sc->get_cntxct(sc->physical); > > counts -= (int32_t)(last - first); > > first = last; > > } > > _______________________________________________ > > 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-unsubscribe@freebsd.org" -- Emmanuel Vadot From owner-svn-src-head@freebsd.org Thu Jun 14 17:36:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FFCF1016F42; Thu, 14 Jun 2018 17:36:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA39D770F7; Thu, 14 Jun 2018 17:36:02 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB62F3D0E; Thu, 14 Jun 2018 17:36:02 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5EHa20c004086; Thu, 14 Jun 2018 17:36:02 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5EHa2kB004085; Thu, 14 Jun 2018 17:36:02 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201806141736.w5EHa2kB004085@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 14 Jun 2018 17:36:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335162 - head/sys/arm/allwinner/clkng X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/arm/allwinner/clkng X-SVN-Commit-Revision: 335162 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 17:36:03 -0000 Author: kevans Date: Thu Jun 14 17:36:02 2018 New Revision: 335162 URL: https://svnweb.freebsd.org/changeset/base/335162 Log: aw_ccung: Support clock factors where factor=0, factor is effectively 1 This happens in two cases for a20 clocks: pll_core for 'n' factor: factor=0, val=1 factor=n, val=n ahb divisor: factor=0,val=/2 factor=n,val=/2^n Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D15806 Modified: head/sys/arm/allwinner/clkng/aw_clk.h Modified: head/sys/arm/allwinner/clkng/aw_clk.h ============================================================================== --- head/sys/arm/allwinner/clkng/aw_clk.h Thu Jun 14 17:32:23 2018 (r335161) +++ head/sys/arm/allwinner/clkng/aw_clk.h Thu Jun 14 17:36:02 2018 (r335162) @@ -72,6 +72,7 @@ struct aw_clk_init { #define AW_CLK_FACTOR_ZERO_BASED 0x0002 #define AW_CLK_FACTOR_HAS_COND 0x0004 #define AW_CLK_FACTOR_FIXED 0x0008 +#define AW_CLK_FACTOR_ZERO_IS_ONE 0x0010 struct aw_clk_factor { uint32_t shift; /* Shift bits for the factor */ @@ -110,6 +111,8 @@ aw_clk_get_factor(uint32_t val, struct aw_clk_factor * return (factor->value); factor_val = (val & factor->mask) >> factor->shift; + if (factor_val == 0 && (factor->flags & AW_CLK_FACTOR_ZERO_IS_ONE)) + factor_val = 1; if (factor->flags & AW_CLK_FACTOR_POWER_OF_TWO) factor_val = 1 << factor_val; From owner-svn-src-head@freebsd.org Thu Jun 14 17:50:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65C361017F73; Thu, 14 Jun 2018 17:50:31 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1AE9F77AE8; Thu, 14 Jun 2018 17:50:31 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F0EF33EDE; Thu, 14 Jun 2018 17:50:30 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5EHoUjl009363; Thu, 14 Jun 2018 17:50:30 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5EHoTg6009356; Thu, 14 Jun 2018 17:50:29 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201806141750.w5EHoTg6009356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 14 Jun 2018 17:50:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335165 - in head/sys/arm/allwinner: a10 a20 clkng X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys/arm/allwinner: a10 a20 clkng X-SVN-Commit-Revision: 335165 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 17:50:31 -0000 Author: kevans Date: Thu Jun 14 17:50:29 2018 New Revision: 335165 URL: https://svnweb.freebsd.org/changeset/base/335165 Log: aw_ccung: Add a10/a20 support Note: At this time, this has only been tested on a single board from one of the supported SoCs. This is enough to boot the board from MMC and have functional USB- which is still an improvement over where we were at just before with no functional clocks. Differential Revision: https://reviews.freebsd.org/D15810 Added: head/sys/arm/allwinner/clkng/ccu_a10.c (contents, props changed) head/sys/arm/allwinner/clkng/ccu_a10.h (contents, props changed) Modified: head/sys/arm/allwinner/a10/files.a10 head/sys/arm/allwinner/a20/files.a20 head/sys/arm/allwinner/clkng/aw_ccung.c head/sys/arm/allwinner/clkng/aw_ccung.h Modified: head/sys/arm/allwinner/a10/files.a10 ============================================================================== --- head/sys/arm/allwinner/a10/files.a10 Thu Jun 14 17:42:36 2018 (r335164) +++ head/sys/arm/allwinner/a10/files.a10 Thu Jun 14 17:50:29 2018 (r335165) @@ -2,3 +2,4 @@ arm/allwinner/a10/a10_intc.c standard arm/allwinner/a10/a10_padconf.c standard +arm/allwinner/clkng/ccu_a10.c standard Modified: head/sys/arm/allwinner/a20/files.a20 ============================================================================== --- head/sys/arm/allwinner/a20/files.a20 Thu Jun 14 17:42:36 2018 (r335164) +++ head/sys/arm/allwinner/a20/files.a20 Thu Jun 14 17:50:29 2018 (r335165) @@ -1,3 +1,4 @@ # $FreeBSD$ arm/allwinner/a20/a20_padconf.c standard +arm/allwinner/clkng/ccu_a10.c standard Modified: head/sys/arm/allwinner/clkng/aw_ccung.c ============================================================================== --- head/sys/arm/allwinner/clkng/aw_ccung.c Thu Jun 14 17:42:36 2018 (r335164) +++ head/sys/arm/allwinner/clkng/aw_ccung.c Thu Jun 14 17:50:29 2018 (r335165) @@ -58,6 +58,10 @@ __FBSDID("$FreeBSD$"); #include "opt_soc.h" #endif +#if defined(SOC_ALLWINNER_A10) || defined(SOC_ALLWINNER_A20) +#include +#endif + #if defined(SOC_ALLWINNER_A13) #include #endif @@ -90,9 +94,15 @@ static struct resource_spec aw_ccung_spec[] = { }; static struct ofw_compat_data compat_data[] = { +#if defined(SOC_ALLWINNER_A10) + { "allwinner,sun4i-a10-ccu", A10_CCU }, +#endif #if defined(SOC_ALLWINNER_A31) { "allwinner,sun5i-a13-ccu", A13_CCU}, #endif +#if defined(SOC_ALLWINNER_A20) + { "allwinner,sun7i-a20-ccu", A20_CCU }, +#endif #if defined(SOC_ALLWINNER_H3) || defined(SOC_ALLWINNER_H5) { "allwinner,sun8i-h3-ccu", H3_CCU }, { "allwinner,sun50i-h5-ccu", H3_CCU }, @@ -325,9 +335,19 @@ aw_ccung_attach(device_t dev) panic("Cannot create clkdom\n"); switch (sc->type) { +#if defined(SOC_ALLWINNER_A10) + case A10_CCU: + ccu_a10_register_clocks(sc); + break; +#endif #if defined(SOC_ALLWINNER_A13) case A13_CCU: ccu_a13_register_clocks(sc); + break; +#endif +#if defined(SOC_ALLWINNER_A20) + case A20_CCU: + ccu_a20_register_clocks(sc); break; #endif #if defined(SOC_ALLWINNER_H3) || defined(SOC_ALLWINNER_H5) Modified: head/sys/arm/allwinner/clkng/aw_ccung.h ============================================================================== --- head/sys/arm/allwinner/clkng/aw_ccung.h Thu Jun 14 17:42:36 2018 (r335164) +++ head/sys/arm/allwinner/clkng/aw_ccung.h Thu Jun 14 17:50:29 2018 (r335165) @@ -38,6 +38,8 @@ enum aw_ccung_type { A13_CCU, A83T_CCU, A83T_R_CCU, + A10_CCU, + A20_CCU, }; struct aw_ccung_softc { Added: head/sys/arm/allwinner/clkng/ccu_a10.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/clkng/ccu_a10.c Thu Jun 14 17:50:29 2018 (r335165) @@ -0,0 +1,612 @@ +/*- + * 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 ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "ccu_a10.h" + +/* Non-exported resets */ +/* Non-exported clocks */ +#define CLK_PLL_CORE 2 +#define CLK_AXI 3 +#define CLK_AHB 4 +#define CLK_APB0 5 +#define CLK_APB1 6 +#define CLK_PLL_VIDEO0 8 +#define CLK_PLL_DDR 12 +#define CLK_PLL_DDR_OTHER 13 +#define CLK_PLL6 14 +#define CLK_PLL_PERIPH 15 +#define CLK_PLL_SATA 16 +#define CLK_PLL_VIDEO1 17 + +/* Non-exported fixed clocks */ + +static struct aw_ccung_reset a10_ccu_resets[] = { + CCU_RESET(RST_USB_PHY0, 0xcc, 0) + CCU_RESET(RST_USB_PHY1, 0xcc, 1) + CCU_RESET(RST_USB_PHY2, 0xcc, 2) + + CCU_RESET(RST_GPS, 0xd0, 0) + + CCU_RESET(RST_DE_BE0, 0x104, 30) + CCU_RESET(RST_DE_BE1, 0x108, 30) + CCU_RESET(RST_DE_FE0, 0x10c, 30) + CCU_RESET(RST_DE_FE1, 0x110, 30) + CCU_RESET(RST_DE_MP, 0x114, 30) + + CCU_RESET(RST_TVE0, 0x118, 29) + CCU_RESET(RST_TCON0, 0x118, 30) + + CCU_RESET(RST_TVE1, 0x11c, 29) + CCU_RESET(RST_TCON1, 0x11c, 30) + + CCU_RESET(RST_CSI0, 0x134, 30) + CCU_RESET(RST_CSI1, 0x138, 30) + + CCU_RESET(RST_VE, 0x13c, 0) + + CCU_RESET(RST_ACE, 0x148, 16) + + CCU_RESET(RST_LVDS, 0x14c, 0) + + CCU_RESET(RST_GPU, 0x154, 30) + + CCU_RESET(RST_HDMI_H, 0x170, 0) + CCU_RESET(RST_HDMI_SYS, 0x170, 1) + CCU_RESET(RST_HDMI_AUDIO_DMA, 0x170, 2) +}; + +static struct aw_ccung_gate a10_ccu_gates[] = { + CCU_GATE(CLK_HOSC, "hosc", "osc24M", 0x50, 0) + + CCU_GATE(CLK_AHB_OTG, "ahb-otg", "ahb", 0x60, 0) + CCU_GATE(CLK_AHB_EHCI0, "ahb-ehci0", "ahb", 0x60, 1) + CCU_GATE(CLK_AHB_OHCI0, "ahb-ohci0", "ahb", 0x60, 2) + CCU_GATE(CLK_AHB_EHCI1, "ahb-ehci1", "ahb", 0x60, 3) + CCU_GATE(CLK_AHB_OHCI1, "ahb-ohci1", "ahb", 0x60, 4) + CCU_GATE(CLK_AHB_SS, "ahb-ss", "ahb", 0x60, 5) + CCU_GATE(CLK_AHB_DMA, "ahb-dma", "ahb", 0x60, 6) + CCU_GATE(CLK_AHB_BIST, "ahb-bist", "ahb", 0x60, 7) + CCU_GATE(CLK_AHB_MMC0, "ahb-mmc0", "ahb", 0x60, 8) + CCU_GATE(CLK_AHB_MMC1, "ahb-mmc1", "ahb", 0x60, 9) + CCU_GATE(CLK_AHB_MMC2, "ahb-mmc2", "ahb", 0x60, 10) + CCU_GATE(CLK_AHB_MMC3, "ahb-mmc3", "ahb", 0x60, 11) + CCU_GATE(CLK_AHB_MS, "ahb-ms", "ahb", 0x60, 12) + CCU_GATE(CLK_AHB_NAND, "ahb-nand", "ahb", 0x60, 13) + CCU_GATE(CLK_AHB_SDRAM, "ahb-sdram", "ahb", 0x60, 14) + CCU_GATE(CLK_AHB_ACE, "ahb-ace", "ahb", 0x60, 16) + CCU_GATE(CLK_AHB_EMAC, "ahb-emac", "ahb", 0x60, 17) + CCU_GATE(CLK_AHB_TS, "ahb-ts", "ahb", 0x60, 18) + CCU_GATE(CLK_AHB_SPI0, "ahb-spi0", "ahb", 0x60, 20) + CCU_GATE(CLK_AHB_SPI1, "ahb-spi1", "ahb", 0x60, 21) + CCU_GATE(CLK_AHB_SPI2, "ahb-spi2", "ahb", 0x60, 22) + CCU_GATE(CLK_AHB_SPI3, "ahb-spi3", "ahb", 0x60, 23) + CCU_GATE(CLK_AHB_SATA, "ahb-sata", "ahb", 0x60, 25) + + CCU_GATE(CLK_AHB_VE, "ahb-ve", "ahb", 0x64, 0) + CCU_GATE(CLK_AHB_TVD, "ahb-tvd", "ahb", 0x64, 1) + CCU_GATE(CLK_AHB_TVE0, "ahb-tve0", "ahb", 0x64, 2) + CCU_GATE(CLK_AHB_TVE1, "ahb-tve1", "ahb", 0x64, 3) + CCU_GATE(CLK_AHB_LCD0, "ahb-lcd0", "ahb", 0x64, 4) + CCU_GATE(CLK_AHB_LCD1, "ahb-lcd1", "ahb", 0x64, 5) + CCU_GATE(CLK_AHB_CSI0, "ahb-csi0", "ahb", 0x64, 8) + CCU_GATE(CLK_AHB_CSI1, "ahb-csi1", "ahb", 0x64, 9) + CCU_GATE(CLK_AHB_HDMI1, "ahb-hdmi1", "ahb", 0x64, 10) + CCU_GATE(CLK_AHB_HDMI0, "ahb-hdmi0", "ahb", 0x64, 11) + CCU_GATE(CLK_AHB_DE_BE0, "ahb-de_be0", "ahb", 0x64, 12) + CCU_GATE(CLK_AHB_DE_BE1, "ahb-de_be1", "ahb", 0x64, 13) + CCU_GATE(CLK_AHB_DE_FE0, "ahb-de_fe0", "ahb", 0x64, 14) + CCU_GATE(CLK_AHB_DE_FE1, "ahb-de_fe1", "ahb", 0x64, 15) + CCU_GATE(CLK_AHB_GMAC, "ahb-gmac", "ahb", 0x64, 17) + CCU_GATE(CLK_AHB_MP, "ahb-mp", "ahb", 0x64, 18) + CCU_GATE(CLK_AHB_GPU, "ahb-gpu", "ahb", 0x64, 20) + + CCU_GATE(CLK_APB0_CODEC, "apb0-codec", "apb0", 0x68, 0) + CCU_GATE(CLK_APB0_SPDIF, "apb0-spdif", "apb0", 0x68, 1) + CCU_GATE(CLK_APB0_AC97, "apb0-ac97", "apb0", 0x68, 2) + CCU_GATE(CLK_APB0_I2S0, "apb0-i2s0", "apb0", 0x68, 3) + CCU_GATE(CLK_APB0_I2S1, "apb0-i2s1", "apb0", 0x68, 4) + CCU_GATE(CLK_APB0_PIO, "apb0-pi0", "apb0", 0x68, 5) + CCU_GATE(CLK_APB0_IR0, "apb0-ir0", "apb0", 0x68, 6) + CCU_GATE(CLK_APB0_IR1, "apb0-ir1", "apb0", 0x68, 7) + CCU_GATE(CLK_APB0_I2S2, "apb0-i2s2", "apb0",0x68, 8) + CCU_GATE(CLK_APB0_KEYPAD, "apb0-keypad", "apb0", 0x68, 10) + + CCU_GATE(CLK_APB1_I2C0, "apb1-i2c0", "apb1", 0x6c, 0) + CCU_GATE(CLK_APB1_I2C1, "apb1-i2c1", "apb1",0x6c, 1) + CCU_GATE(CLK_APB1_I2C2, "apb1-i2c2", "apb1",0x6c, 2) + CCU_GATE(CLK_APB1_I2C3, "apb1-i2c3", "apb1",0x6c, 3) + CCU_GATE(CLK_APB1_CAN, "apb1-can", "apb1",0x6c, 4) + CCU_GATE(CLK_APB1_SCR, "apb1-scr", "apb1",0x6c, 5) + CCU_GATE(CLK_APB1_PS20, "apb1-ps20", "apb1",0x6c, 6) + CCU_GATE(CLK_APB1_PS21, "apb1-ps21", "apb1",0x6c, 7) + CCU_GATE(CLK_APB1_I2C4, "apb1-i2c4", "apb1", 0x6c, 15) + CCU_GATE(CLK_APB1_UART0, "apb1-uart0", "apb1",0x6c, 16) + CCU_GATE(CLK_APB1_UART1, "apb1-uart1", "apb1",0x6c, 17) + CCU_GATE(CLK_APB1_UART2, "apb1-uart2", "apb1",0x6c, 18) + CCU_GATE(CLK_APB1_UART3, "apb1-uart3", "apb1",0x6c, 19) + CCU_GATE(CLK_APB1_UART4, "apb1-uart4", "apb1",0x6c, 20) + CCU_GATE(CLK_APB1_UART5, "apb1-uart5", "apb1",0x6c, 21) + CCU_GATE(CLK_APB1_UART6, "apb1-uart6", "apb1",0x6c, 22) + CCU_GATE(CLK_APB1_UART7, "apb1-uart7", "apb1",0x6c, 23) + + CCU_GATE(CLK_USB_OHCI0, "usb-ohci0", "ahb", 0xcc, 6) + CCU_GATE(CLK_USB_OHCI1, "usb-ohci1", "ahb", 0xcc, 7) + CCU_GATE(CLK_USB_PHY, "usb-phy", "ahb", 0xcc, 8) + + CCU_GATE(CLK_DRAM_VE, "dram-ve", "pll_ddr", 0x100, 0) + CCU_GATE(CLK_DRAM_CSI0, "dram-csi0", "pll_ddr", 0x100, 1) + CCU_GATE(CLK_DRAM_CSI1, "dram-csi1", "pll_ddr", 0x100, 2) + CCU_GATE(CLK_DRAM_TS, "dram-ts", "pll_ddr", 0x100, 3) + CCU_GATE(CLK_DRAM_TVD, "dram-tvd", "pll_ddr", 0x100, 4) + CCU_GATE(CLK_DRAM_TVE0, "dram-tve0", "pll_ddr", 0x100, 5) + CCU_GATE(CLK_DRAM_TVE1, "dram-tve1", "pll_ddr", 0x100, 6) + CCU_GATE(CLK_DRAM_OUT, "dram-out", "pll_ddr", 0x100, 15) + CCU_GATE(CLK_DRAM_DE_FE1, "dram-de_fe1", "pll_ddr", 0x100, 24) + CCU_GATE(CLK_DRAM_DE_FE0, "dram-de_fe0", "pll_ddr", 0x100, 25) + CCU_GATE(CLK_DRAM_DE_BE0, "dram-de_be0", "pll_ddr", 0x100, 26) + CCU_GATE(CLK_DRAM_DE_BE1, "dram-de_be1", "pll_ddr", 0x100, 27) + CCU_GATE(CLK_DRAM_MP, "dram-de_mp", "pll_ddr", 0x100, 28) + CCU_GATE(CLK_DRAM_ACE, "dram-ace", "pll_ddr", 0x100, 29) +}; + +static const char *pll_parents[] = {"osc24M"}; +NKMP_CLK(pll_core_clk, + CLK_PLL_CORE, /* id */ + "pll_core", pll_parents, /* name, parents */ + 0x00, /* offset */ + 8, 5, 0, AW_CLK_FACTOR_ZERO_IS_ONE, /* n factor */ + 4, 2, 0, 0, /* k factor */ + 0, 2, 0, 0, /* m factor */ + 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* p factor */ + 31, /* gate */ + 0, 0, /* lock */ + AW_CLK_HAS_GATE); /* flags */ + +NM_CLK_WITH_FRAC(pll_video0_clk, + CLK_PLL_VIDEO0, /* id */ + "pll_video0", pll_parents, /* name, parents */ + 0x10, /* offset */ + 0, 7, 0, 0, /* n factor */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* m factor (fake) */ + 31, 0, 0, /* gate, lock, lock retries */ + AW_CLK_HAS_GATE, /* flags */ + 270000000, 297000000, /* freq0, freq1 */ + 15, 14); /* mode sel, freq sel */ +static const char *pll_video0_2x_parents[] = {"pll_video0"}; +FIXED_CLK(pll_video0_2x_clk, + CLK_PLL_VIDEO0_2X, /* id */ + "pll_video0-2x", pll_video0_2x_parents, /* name, parents */ + 0, /* freq */ + 2, /* mult */ + 1, /* div */ + 0); /* flags */ + +NM_CLK_WITH_FRAC(pll_video1_clk, + CLK_PLL_VIDEO1, /* id */ + "pll_video1", pll_parents, /* name, parents */ + 0x30, /* offset */ + 0, 7, 0, 0, /* n factor */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* m factor (fake) */ + 31, 0, 0, /* gate, lock, lock retries */ + AW_CLK_HAS_GATE, /* flags */ + 270000000, 297000000, /* freq0, freq1 */ + 15, 14); /* mode sel, freq sel */ +static const char *pll_video1_2x_parents[] = {"pll_video1"}; +FIXED_CLK(pll_video1_2x_clk, + CLK_PLL_VIDEO1_2X, /* id */ + "pll_video1-2x", pll_video1_2x_parents, /* name, parents */ + 0, /* freq */ + 2, /* mult */ + 1, /* div */ + 0); /* flags */ + +static const char *cpu_parents[] = {"osc32k", "osc24M", "pll_core", "pll_periph"}; +static const char *axi_parents[] = {"cpu"}; +static const char *ahb_parents[] = {"axi", "pll_periph", "pll6"}; +static const char *apb0_parents[] = {"ahb"}; +static const char *apb1_parents[] = {"osc24M", "pll_periph", "osc32k"}; +MUX_CLK(cpu_clk, + CLK_CPU, /* id */ + "cpu", cpu_parents, /* name, parents */ + 0x54, 16, 2); /* offset, shift, width */ +NM_CLK(axi_clk, + CLK_AXI, /* id */ + "axi", axi_parents, /* name, parents */ + 0x54, /* offset */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ + 0, 2, 0, 0, /* m factor */ + 0, 0, /* mux */ + 0, /* gate */ + 0); /* flags */ +NM_CLK(ahb_clk, + CLK_AHB, /* id */ + "ahb", ahb_parents, /* name, parents */ + 0x54, /* offset */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ + 4, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* m factor */ + 6, 2, /* mux */ + 0, /* gate */ + AW_CLK_HAS_MUX); /* flags */ +NM_CLK(apb0_clk, + CLK_APB0, /* id */ + "apb0", apb0_parents, /* name, parents */ + 0x54, /* offset */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ + 8, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO | + AW_CLK_FACTOR_ZERO_IS_ONE, /* m factor */ + 0, 0, /* mux */ + 0, /* gate */ + 0); /* flags */ + +NM_CLK(apb1_clk, + CLK_APB1, /* id */ + "apb1", apb1_parents, /* name, parents */ + 0x58, /* offset */ + 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ + 0, 5, 0, 0, /* m factor */ + 24, 2, /* mux */ + 0, /* gate */ + AW_CLK_HAS_MUX); /* flags */ + + +NKMP_CLK(pll_ddr_other_clk, + CLK_PLL_DDR_OTHER, /* id */ + "pll_ddr_other", pll_parents, /* name, parents */ + 0x20, /* offset */ + 8, 5, 0, AW_CLK_FACTOR_ZERO_BASED, /* n factor */ + 4, 2, 0, 0, /* k factor */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* m factor (fake) */ + 2, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* p factor */ + 31, /* gate */ + 0, 0, /* lock */ + AW_CLK_HAS_GATE); /* flags */ +NKMP_CLK(pll_ddr_clk, + CLK_PLL_DDR, /* id */ + "pll_ddr", pll_parents, /* name, parents */ + 0x20, /* offset */ + 8, 5, 0, AW_CLK_FACTOR_ZERO_BASED, /* n factor */ + 4, 2, 0, 0, /* k factor */ + 0, 2, 0, 0, /* m factor */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* p factor (fake) */ + 31, /* gate */ + 0, 0, /* lock */ + AW_CLK_HAS_GATE); /* flags */ + +NKMP_CLK(pll6_clk, + CLK_PLL6, /* id */ + "pll6", pll_parents, /* name, parents */ + 0x28, /* offset */ + 8, 5, 0, AW_CLK_FACTOR_ZERO_BASED, /* n factor */ + 4, 2, 0, 0, /* k factor */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* m factor (fake) */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* p factor (fake) */ + 31, /* gate */ + 0, 0, /* lock */ + AW_CLK_HAS_GATE); /* flags */ + +static const char *pll6_parents[] = {"pll6"}; +FIXED_CLK(pll_periph_clk, + CLK_PLL_PERIPH, /* id */ + "pll_periph", pll6_parents, /* name, parents */ + 0, /* freq */ + 1, /* mult */ + 2, /* div */ + 0); /* flags */ +NKMP_CLK(pll_periph_sata_clk, + CLK_PLL_SATA, /* id */ + "pll_periph_sata", pll6_parents, /* name, parents */ + 0x28, /* offset */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* k factor (fake) */ + 0, 2, 0, 0, /* m factor */ + 0, 0, 6, AW_CLK_FACTOR_FIXED, /* p factor (fake, 6) */ + 14, /* gate */ + 0, 0, /* lock */ + AW_CLK_HAS_GATE); /* flags */ + +static const char *mod_parents[] = {"osc24M", "pll_periph", "pll_ddr_other"}; +NM_CLK(nand_clk, + CLK_NAND, /* id */ + "nand", mod_parents, /* name, parents */ + 0x80, /* offset */ + 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ + 0, 4, 0, 0, /* m factor */ + 24, 2, /* mux */ + 31, /* gate */ + AW_CLK_HAS_MUX | AW_CLK_HAS_GATE); /* flags */ + +NM_CLK(ms_clk, + CLK_MS, /* id */ + "ms", mod_parents, /* name, parents */ + 0x84, /* offset */ + 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ + 0, 4, 0, 0, /* m factor */ + 24, 2, /* mux */ + 31, /* gate */ + AW_CLK_HAS_MUX | AW_CLK_HAS_GATE); /* flags */ + +NM_CLK(mmc0_clk, + CLK_MMC0, /* id */ + "mmc0", mod_parents, /* name, parents */ + 0x88, /* offset */ + 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ + 0, 4, 0, 0, /* m factor */ + 24, 2, /* mux */ + 31, /* gate */ + AW_CLK_HAS_MUX | AW_CLK_HAS_GATE | + AW_CLK_REPARENT); /* flags */ + +NM_CLK(mmc1_clk, + CLK_MMC1, /* id */ + "mmc1", mod_parents, /* name, parents */ + 0x8c, /* offset */ + 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ + 0, 4, 0, 0, /* m factor */ + 24, 2, /* mux */ + 31, /* gate */ + AW_CLK_HAS_MUX | AW_CLK_HAS_GATE | + AW_CLK_REPARENT); /* flags */ + +NM_CLK(mmc2_clk, + CLK_MMC2, /* id */ + "mmc2", mod_parents, /* name, parents */ + 0x90, /* offset */ + 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ + 0, 4, 0, 0, /* m factor */ + 24, 2, /* mux */ + 31, /* gate */ + AW_CLK_HAS_MUX | AW_CLK_HAS_GATE | + AW_CLK_REPARENT); /* flags */ + +NM_CLK(mmc3_clk, + CLK_MMC3, /* id */ + "mmc3", mod_parents, /* name, parents */ + 0x94, /* offset */ + 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ + 0, 4, 0, 0, /* m factor */ + 24, 2, /* mux */ + 31, /* gate */ + AW_CLK_HAS_MUX | AW_CLK_HAS_GATE | + AW_CLK_REPARENT); /* flags */ + +NM_CLK(ts_clk, + CLK_TS, /* id */ + "ts", mod_parents, /* name, parents */ + 0x94, /* offset */ + 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ + 0, 4, 0, 0, /* m factor */ + 24, 2, /* mux */ + 31, /* gate */ + AW_CLK_HAS_MUX | AW_CLK_HAS_GATE); /* flags */ + +NM_CLK(ss_clk, + CLK_SS, /* id */ + "ss", mod_parents, /* name, parents */ + 0x9c, /* offset */ + 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ + 0, 4, 0, 0, /* m factor */ + 24, 2, /* mux */ + 31, /* gate */ + AW_CLK_HAS_MUX | AW_CLK_HAS_GATE); /* flags */ + +NM_CLK(spi0_clk, + CLK_SPI0, /* id */ + "spi0", mod_parents, /* name, parents */ + 0xa0, /* offset */ + 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ + 0, 4, 0, 0, /* m factor */ + 24, 2, /* mux */ + 31, /* gate */ + AW_CLK_HAS_MUX | AW_CLK_HAS_GATE); /* flags */ + +NM_CLK(spi1_clk, + CLK_SPI1, /* id */ + "spi1", mod_parents, /* name, parents */ + 0xa4, /* offset */ + 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ + 0, 4, 0, 0, /* m factor */ + 24, 2, /* mux */ + 31, /* gate */ + AW_CLK_HAS_MUX | AW_CLK_HAS_GATE); /* flags */ + +NM_CLK(spi2_clk, + CLK_SPI2, /* id */ + "spi2", mod_parents, /* name, parents */ + 0xa8, /* offset */ + 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ + 0, 4, 0, 0, /* m factor */ + 24, 2, /* mux */ + 31, /* gate */ + AW_CLK_HAS_MUX | AW_CLK_HAS_GATE); /* flags */ + +/* MISSING CLK_PATA */ + +NM_CLK(ir0_clk, + CLK_IR0, /* id */ + "ir0", mod_parents, /* name, parents */ + 0xb0, /* offset */ + 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ + 0, 4, 0, 0, /* m factor */ + 24, 2, /* mux */ + 31, /* gate */ + AW_CLK_HAS_MUX | AW_CLK_HAS_GATE); /* flags */ + +NM_CLK(ir1_clk, + CLK_IR1, /* id */ + "ir1", mod_parents, /* name, parents */ + 0xb4, /* offset */ + 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ + 0, 4, 0, 0, /* m factor */ + 24, 2, /* mux */ + 31, /* gate */ + AW_CLK_HAS_MUX | AW_CLK_HAS_GATE); /* flags */ + +/* MISSING CLK_I2S0, CLK_AC97, CLK_SPDIF */ + +static const char *keypad_parents[] = {"osc24M", "osc24M", "osc32k"}; +NM_CLK(keypad_clk, + CLK_KEYPAD, /* id */ + "keypad", keypad_parents, /* name, parents */ + 0xc4, /* offset */ + 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ + 0, 5, 0, 0, /* m factor */ + 24, 2, /* mux */ + 31, /* gate */ + AW_CLK_HAS_MUX | AW_CLK_HAS_GATE); /* flags */ + +static const char *sata_parents[] = {"pll_periph_sata", "osc32k"}; +NM_CLK(sata_clk, + CLK_SATA, /* id */ + "sata", sata_parents, /* name, parents */ + 0xc8, /* offset */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* m factor (fake) */ + 24, 1, /* mux */ + 31, /* gate */ + AW_CLK_HAS_MUX | AW_CLK_HAS_GATE); /* flags */ + +NM_CLK(spi3_clk, + CLK_SPI3, /* id */ + "spi3", mod_parents, /* name, parents */ + 0xd4, /* offset */ + 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ + 0, 4, 0, 0, /* m factor */ + 24, 2, /* mux */ + 31, /* gate */ + AW_CLK_HAS_MUX | AW_CLK_HAS_GATE); /* flags */ + +/* MISSING CLK_I2S1, CLK_I2S2, DE Clocks */ + +static struct aw_clk_nkmp_def *nkmp_clks[] = { + &pll_core_clk, + &pll_ddr_other_clk, + &pll_ddr_clk, + &pll6_clk, + &pll_periph_sata_clk, +}; + +static struct aw_clk_nm_def *nm_clks[] = { + &axi_clk, + &ahb_clk, + &apb0_clk, + &apb1_clk, + &pll_video0_clk, + &pll_video1_clk, + &nand_clk, + &ms_clk, + &mmc0_clk, + &mmc1_clk, + &mmc2_clk, + &mmc3_clk, + &ts_clk, + &ss_clk, + &spi0_clk, + &spi1_clk, + &spi2_clk, + &ir0_clk, + &ir1_clk, + &keypad_clk, + &sata_clk, + &spi3_clk, +}; + +static struct aw_clk_prediv_mux_def *prediv_mux_clks[] = { +}; + +static struct clk_mux_def *mux_clks[] = { + &cpu_clk, +}; + +static struct clk_div_def *div_clks[] = { +}; + +static struct clk_fixed_def *fixed_factor_clks[] = { + &pll_periph_clk, + &pll_video0_2x_clk, + &pll_video1_2x_clk, +}; + +static struct aw_clk_init init_clks[] = { +}; + +void +ccu_a10_register_clocks(struct aw_ccung_softc *sc) +{ + int i; + + sc->resets = a10_ccu_resets; + sc->nresets = nitems(a10_ccu_resets); + sc->gates = a10_ccu_gates; + sc->ngates = nitems(a10_ccu_gates); + sc->clk_init = init_clks; + sc->n_clk_init = nitems(init_clks); + + for (i = 0; i < nitems(nkmp_clks); i++) + aw_clk_nkmp_register(sc->clkdom, nkmp_clks[i]); + for (i = 0; i < nitems(nm_clks); i++) + aw_clk_nm_register(sc->clkdom, nm_clks[i]); + for (i = 0; i < nitems(prediv_mux_clks); i++) + aw_clk_prediv_mux_register(sc->clkdom, prediv_mux_clks[i]); + + for (i = 0; i < nitems(mux_clks); i++) + clknode_mux_register(sc->clkdom, mux_clks[i]); + for (i = 0; i < nitems(div_clks); i++) + clknode_div_register(sc->clkdom, div_clks[i]); + for (i = 0; i < nitems(fixed_factor_clks); i++) + clknode_fixed_register(sc->clkdom, fixed_factor_clks[i]); +} + +void +ccu_a20_register_clocks(struct aw_ccung_softc *sc) +{ + + /* XXX TODO: Implement the A20-specific clocks */ + ccu_a10_register_clocks(sc); +} Added: head/sys/arm/allwinner/clkng/ccu_a10.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/clkng/ccu_a10.h Thu Jun 14 17:50:29 2018 (r335165) @@ -0,0 +1,36 @@ +/*- + * 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 ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __CCU_A10_H__ +#define __CCU_A10_H__ + +void ccu_a10_register_clocks(struct aw_ccung_softc *sc); +void ccu_a20_register_clocks(struct aw_ccung_softc *sc); + +#endif /* __CCU_A10_H__ */ From owner-svn-src-head@freebsd.org Thu Jun 14 18:34:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E243101B963; Thu, 14 Jun 2018 18:34:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B842D79F78; Thu, 14 Jun 2018 18:34:02 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 997564755; Thu, 14 Jun 2018 18:34:02 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5EIY21w035023; Thu, 14 Jun 2018 18:34:02 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5EIY2dU035022; Thu, 14 Jun 2018 18:34:02 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201806141834.w5EIY2dU035022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 14 Jun 2018 18:34:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335168 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 335168 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 18:34:03 -0000 Author: kevans Date: Thu Jun 14 18:34:02 2018 New Revision: 335168 URL: https://svnweb.freebsd.org/changeset/base/335168 Log: a10_ahci: Correct clock indices for new bindings r329104 imported 4.15 DTS which brought CCU to a10/a20. In the process, they swapped the ordering of 'clocks' for allwinner,sun4i-a10-ahci on both sun4i-a10 and sun7i-a20 from PLL, Gate to Gate, PLL. Swap it in the driver. Modified: head/sys/arm/allwinner/a10_ahci.c Modified: head/sys/arm/allwinner/a10_ahci.c ============================================================================== --- head/sys/arm/allwinner/a10_ahci.c Thu Jun 14 18:33:09 2018 (r335167) +++ head/sys/arm/allwinner/a10_ahci.c Thu Jun 14 18:34:02 2018 (r335168) @@ -313,14 +313,14 @@ ahci_a10_attach(device_t dev) return (ENXIO); /* Enable clocks */ - error = clk_get_by_ofw_index(dev, 0, 0, &clk_pll); + error = clk_get_by_ofw_index(dev, 0, 0, &clk_gate); if (error != 0) { - device_printf(dev, "Cannot get PLL clock\n"); + device_printf(dev, "Cannot get gate clock\n"); goto fail; } - error = clk_get_by_ofw_index(dev, 0, 1, &clk_gate); + error = clk_get_by_ofw_index(dev, 0, 1, &clk_pll); if (error != 0) { - device_printf(dev, "Cannot get gate clock\n"); + device_printf(dev, "Cannot get PLL clock\n"); goto fail; } error = clk_set_freq(clk_pll, PLL_FREQ, CLK_SET_ROUND_DOWN); From owner-svn-src-head@freebsd.org Thu Jun 14 18:40:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A610101C0BC; Thu, 14 Jun 2018 18:40:58 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 88FD77A791; Thu, 14 Jun 2018 18:40:57 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([78.55.219.13]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0Mcyxq-1fkeLy2RvO-00ICiN; Thu, 14 Jun 2018 20:40:48 +0200 Date: Thu, 14 Jun 2018 20:40:14 +0200 From: "O. Hartmann" To: Emmanuel Vadot Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335159 - head/sys/dev/flash Message-ID: <20180614204041.4a13f192@thor.intern.walstatt.dynvpn.de> In-Reply-To: <201806141721.w5EHL91t094595@repo.freebsd.org> References: <201806141721.w5EHL91t094595@repo.freebsd.org> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-Provags-ID: V03:K1:AL6Pie6rU1oaFXOYgfiJHQYpMMeio1lfB+U5nq1z6+xFqiF9v6/ WL53SrlTcvfVQRPzbiv8ZRda0BnqpXFYbDZJDODpGfTy0NudpG3Q5dv1DI7goO42+ek0Dua whGdNoKHGXpF+B+Duybbf1JHSVhObFtateYtIB7Nqy/ysWlRA9cEGpt5cmGTkkTyM4qh8a7 wKTdbGzJwyT6noiUllUAQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:q0lvMfGTRRQ=:9z9uBooBeh6cfotVqjBYyA 5xjq12YP/Qqqn6W94T5zOfZbGb5igOn+52NXQN5cMykWH6e5VK08ViJ+Iwo2UePINyU66TX8B it70TE1E/GVLMu6FPieDw5bNgt1T9LXa/aeFQG0BYZkYp2+WcBrIVmFzIL/pj+77s1qBYeWSD Pbk+B/UZTbZMq+lct6eEDw2kPePRAsbLoBVxWenPBjRW8EZ8HMvM29dqAABqDRONdMsNdpgWI gToXgFN8UDzw1IBtEJpQW8JIISCSkpSkqzpbNzYSA11RZUcIBexjBFDRydUcHmAfl/Pg6wWUT vFIJQiw/o+bp2NlnJDcRyrkHxynS8ebGiw+idajCF8PRpUd/r1MSQvMBBu3/0traI3vFXmntW 40J1DL+7ewIF5GGfGLD09DdrTekM7+iiNLafLJBI9AMwEYDuy9T62yBp16Nbohpnm50Q4OWcR 45tBvJHPSlclSmwF/UEVgQ3T/vhr+XeSgktLweu+1G/4sSOoFoyCaimUQxV2hs2DWHRPLrS4j t9WeU3GqUAWNmlsmnuhO3Q+Wn5IliykzF02GA1NrOhEtG445lOah22YlWBddapxy6ltBe+pMX QoC7dCW0aOSHgfiT4DxXsFsrHcgEeE5VqomW9oKMGuGPSzjojPFOYYoJBAI3V2xXU+8pNh7SZ x3c2nQK4IY6uViJrEKOtSTyG961ARfE3eqabfDY6hlTm5bxRks1Ub0DV7hQpotqyxKSGCeJUi a6DmYEVN3RiBLZOZyEeb2uNBTlzLkr1wlNKlsR2MtxYBC54e+mLcBYiRsfU+OZhtKMdskl0kG XQF7bLm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 18:40:58 -0000 LS0tLS1CRUdJTiBQR1AgU0lHTkVEIE1FU1NBR0UtLS0tLQ0KSGFzaDogU0hBNTEyDQoNCkFtIFRo dSwgMTQgSnVuIDIwMTggMTc6MjE6MDkgKzAwMDAgKFVUQykNCkVtbWFudWVsIFZhZG90IDxtYW51 QEZyZWVCU0Qub3JnPiBzY2hyaWViOg0KDQo+IEF1dGhvcjogbWFudQ0KPiBEYXRlOiBUaHUgSnVu IDE0IDE3OjIxOjA5IDIwMTgNCj4gTmV3IFJldmlzaW9uOiAzMzUxNTkNCj4gVVJMOiBodHRwczov L3N2bndlYi5mcmVlYnNkLm9yZy9jaGFuZ2VzZXQvYmFzZS8zMzUxNTkNCj4gDQo+IExvZzoNCj4g ICBteDI1bDogQWRkIHBucCBpbmZvDQo+IA0KPiBNb2RpZmllZDoNCj4gICBoZWFkL3N5cy9kZXYv Zmxhc2gvbXgyNWwuYw0KPiANCj4gTW9kaWZpZWQ6IGhlYWQvc3lzL2Rldi9mbGFzaC9teDI1bC5j DQo+ID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PQ0KPiAtLS0gaGVhZC9zeXMvZGV2L2ZsYXNoL214MjVs LmMJVGh1IEp1biAxNCAxNzoyMDo0NyAyMDE4CShyMzM1MTU4KQ0KPiArKysgaGVhZC9zeXMvZGV2 L2ZsYXNoL214MjVsLmMJVGh1IEp1biAxNCAxNzoyMTowOSAyMDE4CShyMzM1MTU5KQ0KPiBAQCAt Njg0LDMgKzY4NCw0IEBAIHN0YXRpYyBkcml2ZXJfdCBteDI1bF9kcml2ZXIgPSB7DQo+ICANCj4g IERSSVZFUl9NT0RVTEUobXgyNWwsIHNwaWJ1cywgbXgyNWxfZHJpdmVyLCBteDI1bF9kZXZjbGFz cywgMCwgMCk7DQo+ICBNT0RVTEVfREVQRU5EKG14MjVsLCBzcGlidXMsIDEsIDEsIDEpOw0KPiAr U1BJQlVTX1BOUF9JTkZPKGNvbXBhdF9kYXRhKTsNCj4gX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX18NCj4gc3ZuLXNyYy1oZWFkQGZyZWVic2Qub3JnIG1haWxp bmcgbGlzdA0KPiBodHRwczovL2xpc3RzLmZyZWVic2Qub3JnL21haWxtYW4vbGlzdGluZm8vc3Zu LXNyYy1oZWFkDQo+IFRvIHVuc3Vic2NyaWJlLCBzZW5kIGFueSBtYWlsIHRvICJzdm4tc3JjLWhl YWQtdW5zdWJzY3JpYmVAZnJlZWJzZC5vcmciDQoNCg0KVGhpcyBjb21taXQgc2VlbXMgdG8gYnJl YWsgdGhlIGJ1aWxka2VybmVsICh3aXRoIE1FVEFfTU9ERSBzZXQpIGF0IGxlYXN0IGZvciBtZToN Cg0KDQotIC0tLSBteDI1bC5vIC0tLQ0KL3Vzci9zcmMvc3lzL2Rldi9mbGFzaC9teDI1bC5jOjY4 NzoxNzogZXJyb3I6IHVzZSBvZiB1bmRlY2xhcmVkIGlkZW50aWZpZXIgJ2NvbXBhdF9kYXRhJw0K U1BJQlVTX1BOUF9JTkZPKGNvbXBhdF9kYXRhKTsNCiAgICAgICAgICAgICAgICBeDQovdXNyL3Ny Yy9zeXMvZGV2L2ZsYXNoL214MjVsLmM6Njg3OjE3OiBlcnJvcjogdXNlIG9mIHVuZGVjbGFyZWQg aWRlbnRpZmllciAnY29tcGF0X2RhdGEnDQovdXNyL3NyYy9zeXMvZGV2L2ZsYXNoL214MjVsLmM6 Njg3OjE3OiBlcnJvcjogdXNlIG9mIHVuZGVjbGFyZWQgaWRlbnRpZmllciAnY29tcGF0X2RhdGEn DQovdXNyL3NyYy9zeXMvZGV2L2ZsYXNoL214MjVsLmM6Njg3OjE3OiBlcnJvcjogdXNlIG9mIHVu ZGVjbGFyZWQgaWRlbnRpZmllciAnY29tcGF0X2RhdGEnDQo0IGVycm9ycyBnZW5lcmF0ZWQuDQot IC0tLSBhbGxfc3ViZGlyX3NvdW5kIC0tLQ0KLSAtLS0gYWxsX3N1YmRpcl9zb3VuZC9kcml2ZXIv bWFlc3RybyAtLS0NCj09PT4gc291bmQvZHJpdmVyL21hZXN0cm8gKGFsbCkNCi0gLS0tIGFsbF9z dWJkaXJfc3BpIC0tLQ0KKioqIFtteDI1bC5vXSBFcnJvciBjb2RlIDENCg0KbWFrZVs1XTogc3Rv cHBlZCBpbiAvdXNyL3NyYy9zeXMvbW9kdWxlcy9zcGkvbXgyNWwNCg0KS2luZCByZWdhcmRzLA0K DQpvaA0KDQotIC0tIA0KTy4gSGFydG1hbm4NCg0KSWNoIHdpZGVyc3ByZWNoZSBkZXIgTnV0enVu ZyBvZGVyIMOcYmVybWl0dGx1bmcgbWVpbmVyIERhdGVuIGbDvHINCldlcmJlendlY2tlIG9kZXIg ZsO8ciBkaWUgTWFya3QtIG9kZXIgTWVpbnVuZ3Nmb3JzY2h1bmcgKMKnIDI4IEFicy4gNCBCRFNH KS4NCi0tLS0tQkVHSU4gUEdQIFNJR05BVFVSRS0tLS0tDQoNCmlMVUVBUk1LQUIwV0lRUVpWWk16 QXR3QzJULzg2VHJTNTI4ZnlGaFlsQVVDV3lLMnFRQUtDUkRTNTI4ZnlGaFkNCmxBQ2FBZjlobjZV di9xSWtDUGlnNkxIeXlONkxRU2xCY2trWXlobkFyR2pSLzFpZHlYRFV6NXIxdVdoRzVWMXcNCk8w MGQ4MlRVZTJaSWJEeVpvSVg3VE9RTWFBNWRBZ0NnMXl2MkZEcWh5SVBWRzQyWDZIa1p3SVJhaVpY NnQreGENClByYndqQVMrL28zWkh0L3NYeGs0UzFDeFZUNlhKRThxVGplaUdQK0l1VjRFem5xdktO bDMNCj13Z1pLDQotLS0tLUVORCBQR1AgU0lHTkFUVVJFLS0tLS0NCg== From owner-svn-src-head@freebsd.org Thu Jun 14 19:01:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39A00101D576; Thu, 14 Jun 2018 19:01:41 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E4DFA7B723; Thu, 14 Jun 2018 19:01:40 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C77AE4C07; Thu, 14 Jun 2018 19:01:40 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5EJ1e7u050543; Thu, 14 Jun 2018 19:01:40 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5EJ1eMt050542; Thu, 14 Jun 2018 19:01:40 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201806141901.w5EJ1eMt050542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 14 Jun 2018 19:01:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335170 - head/sys/dev/flash X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/flash X-SVN-Commit-Revision: 335170 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 19:01:41 -0000 Author: manu Date: Thu Jun 14 19:01:40 2018 New Revision: 335170 URL: https://svnweb.freebsd.org/changeset/base/335170 Log: mx25l: compat_data is only defined when FDT is Reported by: O. Hartmann Modified: head/sys/dev/flash/mx25l.c Modified: head/sys/dev/flash/mx25l.c ============================================================================== --- head/sys/dev/flash/mx25l.c Thu Jun 14 18:50:49 2018 (r335169) +++ head/sys/dev/flash/mx25l.c Thu Jun 14 19:01:40 2018 (r335170) @@ -684,4 +684,6 @@ static driver_t mx25l_driver = { DRIVER_MODULE(mx25l, spibus, mx25l_driver, mx25l_devclass, 0, 0); MODULE_DEPEND(mx25l, spibus, 1, 1, 1); +#ifdef FDT SPIBUS_PNP_INFO(compat_data); +#endif From owner-svn-src-head@freebsd.org Thu Jun 14 19:02:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F5B4101D613; Thu, 14 Jun 2018 19:02:00 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7AB467B88D; Thu, 14 Jun 2018 19:01:59 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id e1486a0d; Thu, 14 Jun 2018 21:01:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=bAhrLWTw4U34I4zfyQOV5knNxYU=; b=rJQS2wKPzIwTkWMvTTZilEPD8x8L 1gUfU0vnPVBqpvw9NmpnlptLa/h5IoZJGBQaBy6jK+9wRNM3inrUKDwLkB1NbaOu 6d4x1dUeSIHu5uUxkYxUCcS7vP7zjRy4z5Y2L6rxn/1iKJ4b3t9GZTvEamAOXUo0 syiPrUjxGV+z4yY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=APhakiQHaKGa0BraX7PEoI8SFqZAGM+kh7i6YuXRdL4re6w3x3Gas76o 3AYuu8uO9WnQfIw/KCq3z1s4n7FH9TeTzzQ2ifeVdSXAdrC6Ish3cvGfD4x98EoL WCnv/ZN8KEESdgcN5LSYyz6mxRWdcJYknLUG5D7VPvv7TXE49BQ= Received: from skull.home.blih.net (ip-9.net-89-3-105.rev.numericable.fr [89.3.105.9]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 7ef1c4d9 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Thu, 14 Jun 2018 21:01:56 +0200 (CEST) Date: Thu, 14 Jun 2018 21:01:56 +0200 From: Emmanuel Vadot To: "O. Hartmann" Cc: Emmanuel Vadot , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335159 - head/sys/dev/flash Message-Id: <20180614210156.2f1b5a496b2bdb0e7a1a25f5@bidouilliste.com> In-Reply-To: <20180614204041.4a13f192@thor.intern.walstatt.dynvpn.de> References: <201806141721.w5EHL91t094595@repo.freebsd.org> <20180614204041.4a13f192@thor.intern.walstatt.dynvpn.de> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 19:02:00 -0000 On Thu, 14 Jun 2018 20:40:14 +0200 "O. Hartmann" wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 >=20 > Am Thu, 14 Jun 2018 17:21:09 +0000 (UTC) > Emmanuel Vadot schrieb: >=20 > > Author: manu > > Date: Thu Jun 14 17:21:09 2018 > > New Revision: 335159 > > URL: https://svnweb.freebsd.org/changeset/base/335159 > >=20 > > Log: > > mx25l: Add pnp info > >=20 > > Modified: > > head/sys/dev/flash/mx25l.c > >=20 > > Modified: head/sys/dev/flash/mx25l.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/sys/dev/flash/mx25l.c Thu Jun 14 17:20:47 2018 (r335158) > > +++ head/sys/dev/flash/mx25l.c Thu Jun 14 17:21:09 2018 (r335159) > > @@ -684,3 +684,4 @@ static driver_t mx25l_driver =3D { > > =20 > > DRIVER_MODULE(mx25l, spibus, mx25l_driver, mx25l_devclass, 0, 0); > > MODULE_DEPEND(mx25l, spibus, 1, 1, 1); > > +SPIBUS_PNP_INFO(compat_data); > > _______________________________________________ > > 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-unsubscribe@freebsd.org" >=20 >=20 > This commit seems to break the buildkernel (with META_MODE set) at least = for me: Try with 335170. >=20 > - --- mx25l.o --- > /usr/src/sys/dev/flash/mx25l.c:687:17: error: use of undeclared identifie= r 'compat_data' > SPIBUS_PNP_INFO(compat_data); > ^ > /usr/src/sys/dev/flash/mx25l.c:687:17: error: use of undeclared identifie= r 'compat_data' > /usr/src/sys/dev/flash/mx25l.c:687:17: error: use of undeclared identifie= r 'compat_data' > /usr/src/sys/dev/flash/mx25l.c:687:17: error: use of undeclared identifie= r 'compat_data' > 4 errors generated. > - --- all_subdir_sound --- > - --- all_subdir_sound/driver/maestro --- > =3D=3D=3D> sound/driver/maestro (all) > - --- all_subdir_spi --- > *** [mx25l.o] Error code 1 >=20 > make[5]: stopped in /usr/src/sys/modules/spi/mx25l >=20 > Kind regards, >=20 > oh >=20 > - --=20 > O. Hartmann >=20 > Ich widerspreche der Nutzung oder =DCbermittlung meiner Daten f=FCr > Werbezwecke oder f=FCr die Markt- oder Meinungsforschung (=A7 28 Abs. 4 B= DSG). > -----BEGIN PGP SIGNATURE----- >=20 > iLUEARMKAB0WIQQZVZMzAtwC2T/86TrS528fyFhYlAUCWyK2qQAKCRDS528fyFhY > lACaAf9hn6Uv/qIkCPig6LHyyN6LQSlBckkYyhnArGjR/1idyXDUz5r1uWhG5V1w > O00d82TUe2ZIbDyZoIX7TOQMaA5dAgCg1yv2FDqhyIPVG42X6HkZwIRaiZX6t+xa > PrbwjAS+/o3ZHt/sXxk4S1CxVT6XJE8qTjeiGP+IuV4EznqvKNl3 > =3DwgZK > -----END PGP SIGNATURE----- --=20 Emmanuel Vadot From owner-svn-src-head@freebsd.org Thu Jun 14 19:41:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7391310208BD; Thu, 14 Jun 2018 19:41:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 29CAB7D6CB; Thu, 14 Jun 2018 19:41:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0CB5152B7; Thu, 14 Jun 2018 19:41:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5EJf2Lt069374; Thu, 14 Jun 2018 19:41:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5EJf2qa069373; Thu, 14 Jun 2018 19:41:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201806141941.w5EJf2qa069373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 14 Jun 2018 19:41:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335171 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 335171 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 19:41:03 -0000 Author: kib Date: Thu Jun 14 19:41:02 2018 New Revision: 335171 URL: https://svnweb.freebsd.org/changeset/base/335171 Log: Handle the race between fork/vm_object_split() and faults. If fault started before vmspace_fork() locked the map, and then during fork, vm_map_copy_entry()->vm_object_split() is executed, it is possible that the fault instantiate the page into the original object when the page was already copied into the new object (see vm_map_split() for the orig/new objects terminology). This can happen if split found a busy page (e.g. from the fault) and slept dropping the objects lock, which allows the swap pager to instantiate read-behind pages for the fault. Then the restart of the scan can see a page in the scanned range, where it was already copied to the upper object. Fix it by instantiating the read-ahead pages before swap_pager_getpages() method drops the lock to allocate pbuf. The object scan would see the whole range prefilled with the busy pages and not proceed the range. Note that vm_fault rechecks the map generation count after the object unlock, so that it restarts the handling if raced with split, and re-lookups the right page from the upper object. In collaboration with: alc Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Thu Jun 14 19:01:40 2018 (r335170) +++ head/sys/vm/swap_pager.c Thu Jun 14 19:41:02 2018 (r335171) @@ -1096,21 +1096,24 @@ swap_pager_getpages(vm_object_t object, vm_page_t *ma, int *rahead) { struct buf *bp; - vm_page_t mpred, msucc, p; + vm_page_t bm, mpred, msucc, p; vm_pindex_t pindex; daddr_t blk; - int i, j, maxahead, maxbehind, reqcount, shift; + int i, maxahead, maxbehind, reqcount; reqcount = count; - VM_OBJECT_WUNLOCK(object); - bp = getpbuf(&nsw_rcount); - VM_OBJECT_WLOCK(object); - - if (!swap_pager_haspage(object, ma[0]->pindex, &maxbehind, &maxahead)) { - relpbuf(bp, &nsw_rcount); + /* + * Determine the final number of read-behind pages and + * allocate them BEFORE releasing the object lock. Otherwise, + * there can be a problematic race with vm_object_split(). + * Specifically, vm_object_split() might first transfer pages + * that precede ma[0] in the current object to a new object, + * and then this function incorrectly recreates those pages as + * read-behind pages in the current object. + */ + if (!swap_pager_haspage(object, ma[0]->pindex, &maxbehind, &maxahead)) return (VM_PAGER_FAIL); - } /* * Clip the readahead and readbehind ranges to exclude resident pages. @@ -1132,35 +1135,31 @@ swap_pager_getpages(vm_object_t object, vm_page_t *ma, *rbehind = pindex - mpred->pindex - 1; } + bm = ma[0]; + for (i = 0; i < count; i++) + ma[i]->oflags |= VPO_SWAPINPROG; + /* * Allocate readahead and readbehind pages. */ - shift = rbehind != NULL ? *rbehind : 0; - if (shift != 0) { - for (i = 1; i <= shift; i++) { + if (rbehind != NULL) { + for (i = 1; i <= *rbehind; i++) { p = vm_page_alloc(object, ma[0]->pindex - i, VM_ALLOC_NORMAL); - if (p == NULL) { - /* Shift allocated pages to the left. */ - for (j = 0; j < i - 1; j++) - bp->b_pages[j] = - bp->b_pages[j + shift - i + 1]; + if (p == NULL) break; - } - bp->b_pages[shift - i] = p; + p->oflags |= VPO_SWAPINPROG; + bm = p; } - shift = i - 1; - *rbehind = shift; + *rbehind = i - 1; } - for (i = 0; i < reqcount; i++) - bp->b_pages[i + shift] = ma[i]; if (rahead != NULL) { for (i = 0; i < *rahead; i++) { p = vm_page_alloc(object, ma[reqcount - 1]->pindex + i + 1, VM_ALLOC_NORMAL); if (p == NULL) break; - bp->b_pages[shift + reqcount + i] = p; + p->oflags |= VPO_SWAPINPROG; } *rahead = i; } @@ -1171,15 +1170,18 @@ swap_pager_getpages(vm_object_t object, vm_page_t *ma, vm_object_pip_add(object, count); - for (i = 0; i < count; i++) - bp->b_pages[i]->oflags |= VPO_SWAPINPROG; - - pindex = bp->b_pages[0]->pindex; + pindex = bm->pindex; blk = swp_pager_meta_ctl(object, pindex, 0); KASSERT(blk != SWAPBLK_NONE, ("no swap blocking containing %p(%jx)", object, (uintmax_t)pindex)); VM_OBJECT_WUNLOCK(object); + bp = getpbuf(&nsw_rcount); + /* Pages cannot leave the object while busy. */ + for (i = 0, p = bm; i < count; i++, p = TAILQ_NEXT(p, listq)) { + MPASS(p->pindex == bm->pindex + i); + bp->b_pages[i] = p; + } bp->b_flags |= B_PAGING; bp->b_iocmd = BIO_READ; From owner-svn-src-head@freebsd.org Thu Jun 14 19:44:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 782931020D0B; Thu, 14 Jun 2018 19:44:13 +0000 (UTC) (envelope-from kib@freebsd.org) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 022137DAEA; Thu, 14 Jun 2018 19:44:12 +0000 (UTC) (envelope-from kib@freebsd.org) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTP id w5EJi2FU078420; Thu, 14 Jun 2018 22:44:05 +0300 (EEST) (envelope-from kib@freebsd.org) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w5EJi2FU078420 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w5EJi2VB078419; Thu, 14 Jun 2018 22:44:02 +0300 (EEST) (envelope-from kib@freebsd.org) X-Authentication-Warning: tom.home: kostik set sender to kib@freebsd.org using -f Date: Thu, 14 Jun 2018 22:44:02 +0300 From: Konstantin Belousov To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335171 - head/sys/vm Message-ID: <20180614194402.GJ2493@kib.kiev.ua> References: <201806141941.w5EJf2qa069373@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201806141941.w5EJf2qa069373@repo.freebsd.org> User-Agent: Mutt/1.10.0 (2018-05-17) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 19:44:13 -0000 On Thu, Jun 14, 2018 at 07:41:02PM +0000, Konstantin Belousov wrote: > Author: kib > Date: Thu Jun 14 19:41:02 2018 > New Revision: 335171 > URL: https://svnweb.freebsd.org/changeset/base/335171 > > Log: > Handle the race between fork/vm_object_split() and faults. > > If fault started before vmspace_fork() locked the map, and then during > fork, vm_map_copy_entry()->vm_object_split() is executed, it is > possible that the fault instantiate the page into the original object > when the page was already copied into the new object (see > vm_map_split() for the orig/new objects terminology). This can happen > if split found a busy page (e.g. from the fault) and slept dropping > the objects lock, which allows the swap pager to instantiate > read-behind pages for the fault. Then the restart of the scan can see > a page in the scanned range, where it was already copied to the upper > object. > > Fix it by instantiating the read-ahead pages before > swap_pager_getpages() method drops the lock to allocate pbuf. The > object scan would see the whole range prefilled with the busy pages > and not proceed the range. > > Note that vm_fault rechecks the map generation count after the object > unlock, so that it restarts the handling if raced with split, and > re-lookups the right page from the upper object. > > In collaboration with: alc Reviewed by: markj Sorry. > Tested by: pho > Sponsored by: The FreeBSD Foundation > MFC after: 1 week Differential revision: https://reviews.freebsd.org/D15293 > > Modified: > head/sys/vm/swap_pager.c > > Modified: head/sys/vm/swap_pager.c > ============================================================================== > --- head/sys/vm/swap_pager.c Thu Jun 14 19:01:40 2018 (r335170) > +++ head/sys/vm/swap_pager.c Thu Jun 14 19:41:02 2018 (r335171) > @@ -1096,21 +1096,24 @@ swap_pager_getpages(vm_object_t object, vm_page_t *ma, > int *rahead) > { > struct buf *bp; > - vm_page_t mpred, msucc, p; > + vm_page_t bm, mpred, msucc, p; > vm_pindex_t pindex; > daddr_t blk; > - int i, j, maxahead, maxbehind, reqcount, shift; > + int i, maxahead, maxbehind, reqcount; > > reqcount = count; > > - VM_OBJECT_WUNLOCK(object); > - bp = getpbuf(&nsw_rcount); > - VM_OBJECT_WLOCK(object); > - > - if (!swap_pager_haspage(object, ma[0]->pindex, &maxbehind, &maxahead)) { > - relpbuf(bp, &nsw_rcount); > + /* > + * Determine the final number of read-behind pages and > + * allocate them BEFORE releasing the object lock. Otherwise, > + * there can be a problematic race with vm_object_split(). > + * Specifically, vm_object_split() might first transfer pages > + * that precede ma[0] in the current object to a new object, > + * and then this function incorrectly recreates those pages as > + * read-behind pages in the current object. > + */ > + if (!swap_pager_haspage(object, ma[0]->pindex, &maxbehind, &maxahead)) > return (VM_PAGER_FAIL); > - } > > /* > * Clip the readahead and readbehind ranges to exclude resident pages. > @@ -1132,35 +1135,31 @@ swap_pager_getpages(vm_object_t object, vm_page_t *ma, > *rbehind = pindex - mpred->pindex - 1; > } > > + bm = ma[0]; > + for (i = 0; i < count; i++) > + ma[i]->oflags |= VPO_SWAPINPROG; > + > /* > * Allocate readahead and readbehind pages. > */ > - shift = rbehind != NULL ? *rbehind : 0; > - if (shift != 0) { > - for (i = 1; i <= shift; i++) { > + if (rbehind != NULL) { > + for (i = 1; i <= *rbehind; i++) { > p = vm_page_alloc(object, ma[0]->pindex - i, > VM_ALLOC_NORMAL); > - if (p == NULL) { > - /* Shift allocated pages to the left. */ > - for (j = 0; j < i - 1; j++) > - bp->b_pages[j] = > - bp->b_pages[j + shift - i + 1]; > + if (p == NULL) > break; > - } > - bp->b_pages[shift - i] = p; > + p->oflags |= VPO_SWAPINPROG; > + bm = p; > } > - shift = i - 1; > - *rbehind = shift; > + *rbehind = i - 1; > } > - for (i = 0; i < reqcount; i++) > - bp->b_pages[i + shift] = ma[i]; > if (rahead != NULL) { > for (i = 0; i < *rahead; i++) { > p = vm_page_alloc(object, > ma[reqcount - 1]->pindex + i + 1, VM_ALLOC_NORMAL); > if (p == NULL) > break; > - bp->b_pages[shift + reqcount + i] = p; > + p->oflags |= VPO_SWAPINPROG; > } > *rahead = i; > } > @@ -1171,15 +1170,18 @@ swap_pager_getpages(vm_object_t object, vm_page_t *ma, > > vm_object_pip_add(object, count); > > - for (i = 0; i < count; i++) > - bp->b_pages[i]->oflags |= VPO_SWAPINPROG; > - > - pindex = bp->b_pages[0]->pindex; > + pindex = bm->pindex; > blk = swp_pager_meta_ctl(object, pindex, 0); > KASSERT(blk != SWAPBLK_NONE, > ("no swap blocking containing %p(%jx)", object, (uintmax_t)pindex)); > > VM_OBJECT_WUNLOCK(object); > + bp = getpbuf(&nsw_rcount); > + /* Pages cannot leave the object while busy. */ > + for (i = 0, p = bm; i < count; i++, p = TAILQ_NEXT(p, listq)) { > + MPASS(p->pindex == bm->pindex + i); > + bp->b_pages[i] = p; > + } > > bp->b_flags |= B_PAGING; > bp->b_iocmd = BIO_READ; From owner-svn-src-head@freebsd.org Thu Jun 14 20:36:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E36131002FE0; Thu, 14 Jun 2018 20:36:55 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9991E80C17; Thu, 14 Jun 2018 20:36:55 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 77A1C5B2A; Thu, 14 Jun 2018 20:36:55 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5EKatGn096704; Thu, 14 Jun 2018 20:36:55 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5EKatC8096703; Thu, 14 Jun 2018 20:36:55 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201806142036.w5EKatC8096703@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 14 Jun 2018 20:36:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335172 - head/usr.sbin/nfsd X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/nfsd X-SVN-Commit-Revision: 335172 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 20:36:56 -0000 Author: rmacklem Date: Thu Jun 14 20:36:55 2018 New Revision: 335172 URL: https://svnweb.freebsd.org/changeset/base/335172 Log: Add the "-p" and "-m" options to nfsd.c for the pNFS service. The "-p" option specifies that the nfsd should run a pNFS service instead of a regular NFS service. The "-m" option is only meaningful when used with "-p" to specify that mirroring on the DSs should be done and on how many of them. This change requires the kernel changes committed as r334930. The man page update will be committed as a separate commit soon. Modified: head/usr.sbin/nfsd/nfsd.c Modified: head/usr.sbin/nfsd/nfsd.c ============================================================================== --- head/usr.sbin/nfsd/nfsd.c Thu Jun 14 19:41:02 2018 (r335171) +++ head/usr.sbin/nfsd/nfsd.c Thu Jun 14 20:36:55 2018 (r335172) @@ -64,9 +64,12 @@ static const char rcsid[] = #include #include -#include #include +#include +#include +#include + #include #include #include @@ -88,6 +91,7 @@ static int debug = 0; #define NFS_VER3 3 #define NFS_VER4 4 static pid_t children[MAXNFSDCNT]; /* PIDs of children */ +static pid_t masterpid; /* PID of master/parent */ static int nfsdcnt; /* number of children */ static int nfsdcnt_set; static int minthreads; @@ -105,6 +109,8 @@ static struct option longopts[] = { { "debug", no_argument, &debug, 1 }, { "minthreads", required_argument, &minthreads_set, 1 }, { "maxthreads", required_argument, &maxthreads_set, 1 }, + { "pnfs", required_argument, NULL, 'p' }, + { "mirror", required_argument, NULL, 'm' }, { NULL, 0, NULL, 0} }; @@ -116,13 +122,14 @@ static void nonfs(int); static void reapchild(int); static int setbindhost(struct addrinfo **ia, const char *bindhost, struct addrinfo hints); -static void start_server(int); +static void start_server(int, struct nfsd_nfsd_args *); static void unregistration(void); static void usage(void); static void open_stable(int *, int *); static void copy_stable(int, int); static void backup_stable(int); static void set_nfsdcnt(int); +static void parse_dsserver(const char *, struct nfsd_nfsd_args *); /* * Nfs server daemon mostly just a user context for nfssvc() @@ -142,6 +149,8 @@ static void set_nfsdcnt(int); * -t - support tcp nfs clients * -u - support udp nfs clients * -e - forces it to run a server that supports nfsv4 + * -p - enable a pNFS service + * -m - set the mirroring level for a pNFS service * followed by "n" which is the number of nfsds' to fork off */ int @@ -168,15 +177,19 @@ main(int argc, char **argv) const char *lopt; char **bindhost = NULL; pid_t pid; + struct nfsd_nfsd_args nfsdargs; + nfsdargs.mirrorcnt = 1; nfsdcnt = DEFNFSDCNT; unregister = reregister = tcpflag = maxsock = 0; bindanyflag = udpflag = connect_type_cnt = bindhostc = 0; - getopt_shortopts = "ah:n:rdtue"; + getopt_shortopts = "ah:n:rdtuep:m:"; getopt_usage = "usage:\n" " nfsd [-ardtue] [-h bindip]\n" - " [-n numservers] [--minthreads #] [--maxthreads #]\n"; + " [-n numservers] [--minthreads #] [--maxthreads #]\n" + " [-p/--pnfs dsserver0:/dsserver0-mounted-on-dir,...," + "dsserverN:/dsserverN-mounted-on-dir] [-m mirrorlevel]\n"; while ((ch = getopt_long(argc, argv, getopt_shortopts, longopts, &longindex)) != -1) switch (ch) { @@ -210,6 +223,18 @@ main(int argc, char **argv) case 'e': /* now a no-op, since this is the default */ break; + case 'p': + /* Parse out the DS server host names and mount pts. */ + parse_dsserver(optarg, &nfsdargs); + break; + case 'm': + /* Set the mirror level for a pNFS service. */ + i = atoi(optarg); + if (i < 2 || i > NFSDEV_MAXMIRRORS) + errx(1, "Mirror level out of range 2<-->%d", + NFSDEV_MAXMIRRORS); + nfsdargs.mirrorcnt = i; + break; case 0: lopt = longopts[longindex].name; if (!strcmp(lopt, "minthreads")) { @@ -429,7 +454,7 @@ main(int argc, char **argv) exit(1); } nfssvc_addsock = NFSSVC_NFSDADDSOCK; - nfssvc_nfsd = NFSSVC_NFSDNFSD; + nfssvc_nfsd = NFSSVC_NFSDNFSD | NFSSVC_NEWSTRUCT; if (tcpflag) { /* @@ -437,6 +462,7 @@ main(int argc, char **argv) * kernel nfsd thread. The kernel will add more * threads as needed. */ + masterpid = getpid(); pid = fork(); if (pid == -1) { syslog(LOG_ERR, "fork: %m"); @@ -447,7 +473,7 @@ main(int argc, char **argv) } else { (void)signal(SIGUSR1, child_cleanup); setproctitle("server"); - start_server(0); + start_server(0, &nfsdargs); } } @@ -768,7 +794,7 @@ main(int argc, char **argv) * a "server" too. start_server will not return. */ if (!tcpflag) - start_server(1); + start_server(1, &nfsdargs); /* * Loop forever accepting connections and passing the sockets @@ -992,10 +1018,9 @@ get_tuned_nfsdcount(void) } static void -start_server(int master) +start_server(int master, struct nfsd_nfsd_args *nfsdargp) { char principal[MAXHOSTNAMELEN + 5]; - struct nfsd_nfsd_args nfsdargs; int status, error; char hostname[MAXHOSTNAMELEN + 1], *cp; struct addrinfo *aip, hints; @@ -1018,17 +1043,17 @@ start_server(int master) freeaddrinfo(aip); } } - nfsdargs.principal = principal; + nfsdargp->principal = principal; if (nfsdcnt_set) - nfsdargs.minthreads = nfsdargs.maxthreads = nfsdcnt; + nfsdargp->minthreads = nfsdargp->maxthreads = nfsdcnt; else { - nfsdargs.minthreads = minthreads_set ? minthreads : get_tuned_nfsdcount(); - nfsdargs.maxthreads = maxthreads_set ? maxthreads : nfsdargs.minthreads; - if (nfsdargs.maxthreads < nfsdargs.minthreads) - nfsdargs.maxthreads = nfsdargs.minthreads; + nfsdargp->minthreads = minthreads_set ? minthreads : get_tuned_nfsdcount(); + nfsdargp->maxthreads = maxthreads_set ? maxthreads : nfsdargp->minthreads; + if (nfsdargp->maxthreads < nfsdargp->minthreads) + nfsdargp->maxthreads = nfsdargp->minthreads; } - error = nfssvc(nfssvc_nfsd, &nfsdargs); + error = nfssvc(nfssvc_nfsd, nfsdargp); if (error < 0 && errno == EAUTH) { /* * This indicates that it could not register the @@ -1038,10 +1063,15 @@ start_server(int master) */ syslog(LOG_ERR, "No gssd, using AUTH_SYS only"); principal[0] = '\0'; - error = nfssvc(nfssvc_nfsd, &nfsdargs); + error = nfssvc(nfssvc_nfsd, nfsdargp); } if (error < 0) { - syslog(LOG_ERR, "nfssvc: %m"); + if (errno == ENXIO) { + syslog(LOG_ERR, "Bad -p option, cannot run"); + if (masterpid != 0 && master == 0) + kill(masterpid, SIGUSR1); + } else + syslog(LOG_ERR, "nfssvc: %m"); status = 1; } if (master) @@ -1139,5 +1169,125 @@ backup_stable(__unused int signo) if (stablefd >= 0) copy_stable(stablefd, backupfd); +} + +/* + * Parse the pNFS string and extract the DS servers and ports numbers. + */ +static void +parse_dsserver(const char *optionarg, struct nfsd_nfsd_args *nfsdargp) +{ + char *ad, *cp, *cp2, *dsaddr, *dshost, *dspath, *dsvol, nfsprt[9]; + int ecode; + u_int adsiz, dsaddrcnt, dshostcnt, dspathcnt, hostsiz, pathsiz; + size_t dsaddrsiz, dshostsiz, dspathsiz, nfsprtsiz; + struct addrinfo hints, *ai_tcp; + struct sockaddr_in sin; + + cp = strdup(optionarg); + if (cp == NULL) + errx(1, "Out of memory"); + + /* Now, do the host names. */ + dspathsiz = 1024; + dspathcnt = 0; + dspath = malloc(dspathsiz); + if (dspath == NULL) + errx(1, "Out of memory"); + dshostsiz = 1024; + dshostcnt = 0; + dshost = malloc(dshostsiz); + if (dshost == NULL) + errx(1, "Out of memory"); + dsaddrsiz = 1024; + dsaddrcnt = 0; + dsaddr = malloc(dsaddrsiz); + if (dsaddr == NULL) + errx(1, "Out of memory"); + + /* Put the NFS port# in "." form. */ + snprintf(nfsprt, 9, ".%d.%d", 2049 >> 8, 2049 & 0xff); + nfsprtsiz = strlen(nfsprt); + + ai_tcp = NULL; + /* Loop around for each DS server name. */ + do { + cp2 = strchr(cp, ','); + if (cp2 != NULL) { + /* Not the last DS in the list. */ + *cp2++ = '\0'; + if (*cp2 == '\0') + usage(); + } + + dsvol = strchr(cp, ':'); + if (dsvol == NULL || *(dsvol + 1) == '\0') + usage(); + *dsvol++ = '\0'; + + /* Append this pathname to dspath. */ + pathsiz = strlen(dsvol); + if (dspathcnt + pathsiz + 1 > dspathsiz) { + dspathsiz *= 2; + dspath = realloc(dspath, dspathsiz); + if (dspath == NULL) + errx(1, "Out of memory"); + } + strcpy(&dspath[dspathcnt], dsvol); + dspathcnt += pathsiz + 1; + + if (ai_tcp != NULL) + freeaddrinfo(ai_tcp); + + /* Get the fully qualified domain name and IP address. */ + memset(&hints, 0, sizeof(hints)); + hints.ai_flags = AI_CANONNAME; + hints.ai_family = AF_INET; + hints.ai_socktype = SOCK_STREAM; + hints.ai_protocol = IPPROTO_TCP; + ecode = getaddrinfo(cp, NULL, &hints, &ai_tcp); + if (ecode != 0) + err(1, "getaddrinfo pnfs: %s %s", cp, + gai_strerror(ecode)); + if (ai_tcp->ai_addr->sa_family != AF_INET || + ai_tcp->ai_addrlen < sizeof(sin)) + err(1, "getaddrinfo() returned non-INET address"); + /* Mips cares about sockaddr_in alignment, so copy the addr. */ + memcpy(&sin, ai_tcp->ai_addr, sizeof(sin)); + + /* Append this address to dsaddr. */ + ad = inet_ntoa(sin.sin_addr); + adsiz = strlen(ad); + if (dsaddrcnt + adsiz + nfsprtsiz + 1 > dsaddrsiz) { + dsaddrsiz *= 2; + dsaddr = realloc(dsaddr, dsaddrsiz); + if (dsaddr == NULL) + errx(1, "Out of memory"); + } + strcpy(&dsaddr[dsaddrcnt], ad); + strcat(&dsaddr[dsaddrcnt], nfsprt); + dsaddrcnt += adsiz + nfsprtsiz + 1; + + /* Append this hostname to dshost. */ + hostsiz = strlen(ai_tcp->ai_canonname); + if (dshostcnt + hostsiz + 1 > dshostsiz) { + dshostsiz *= 2; + dshost = realloc(dshost, dshostsiz); + if (dshost == NULL) + errx(1, "Out of memory"); + } + strcpy(&dshost[dshostcnt], ai_tcp->ai_canonname); + dshostcnt += hostsiz + 1; + + cp = cp2; + } while (cp != NULL); + + nfsdargp->addr = dsaddr; + nfsdargp->addrlen = dsaddrcnt; + nfsdargp->dnshost = dshost; + nfsdargp->dnshostlen = dshostcnt; + nfsdargp->dspath = dspath; + nfsdargp->dspathlen = dspathcnt; + freeaddrinfo(ai_tcp); } From owner-svn-src-head@freebsd.org Thu Jun 14 20:37:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82B5F10030C6; Thu, 14 Jun 2018 20:37:26 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 38C7380D69; Thu, 14 Jun 2018 20:37:26 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19F2D5B2B; Thu, 14 Jun 2018 20:37:26 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5EKbPB8096777; Thu, 14 Jun 2018 20:37:25 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5EKbP6S096772; Thu, 14 Jun 2018 20:37:25 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201806142037.w5EKbP6S096772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 14 Jun 2018 20:37:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335173 - head/sys/dev/extres/regulator X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/extres/regulator X-SVN-Commit-Revision: 335173 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 20:37:26 -0000 Author: kevans Date: Thu Jun 14 20:37:25 2018 New Revision: 335173 URL: https://svnweb.freebsd.org/changeset/base/335173 Log: extres/regulator: Properly refcount gpio regulators regnode::enable_cnt is generally used to refcount regulator nodes. For GPIOs, the refcount was done on the gpio_entry since more than one regulator can share a GPIO. GPIO regulators were not taking part in the node refcount, since they had their own mechanism. This caused some fallout after manu started disabling everybody's unused regulators in r331989. Refcount it. Glanced over by: manu Modified: head/sys/dev/extres/regulator/regulator.c head/sys/dev/extres/regulator/regulator.h head/sys/dev/extres/regulator/regulator_fixed.c Modified: head/sys/dev/extres/regulator/regulator.c ============================================================================== --- head/sys/dev/extres/regulator/regulator.c Thu Jun 14 20:36:55 2018 (r335172) +++ head/sys/dev/extres/regulator/regulator.c Thu Jun 14 20:37:25 2018 (r335173) @@ -507,6 +507,20 @@ struct regnode_std_param *regnode_get_stdparam(struct return (®node->std_param); } +void +regnode_enable_cnt_inc(struct regnode *regnode) +{ + + regnode->enable_cnt++; +} + +void +regnode_enable_cnt_dec(struct regnode *regnode) +{ + + regnode->enable_cnt--; +} + void regnode_topo_unlock(void) { Modified: head/sys/dev/extres/regulator/regulator.h ============================================================================== --- head/sys/dev/extres/regulator/regulator.h Thu Jun 14 20:36:55 2018 (r335172) +++ head/sys/dev/extres/regulator/regulator.h Thu Jun 14 20:37:25 2018 (r335173) @@ -106,6 +106,8 @@ int regnode_get_flags(struct regnode *regnode); void *regnode_get_softc(struct regnode *regnode); device_t regnode_get_device(struct regnode *regnode); struct regnode_std_param *regnode_get_stdparam(struct regnode *regnode); +void regnode_enable_cnt_inc(struct regnode *regnode); +void regnode_enable_cnt_dec(struct regnode *regnode); void regnode_topo_unlock(void); void regnode_topo_xlock(void); void regnode_topo_slock(void); Modified: head/sys/dev/extres/regulator/regulator_fixed.c ============================================================================== --- head/sys/dev/extres/regulator/regulator_fixed.c Thu Jun 14 20:36:55 2018 (r335172) +++ head/sys/dev/extres/regulator/regulator_fixed.c Thu Jun 14 20:37:25 2018 (r335173) @@ -156,6 +156,8 @@ regnode_fixed_init(struct regnode *regnode) if (sc->gpio_open_drain) flags |= GPIO_PIN_OPENDRAIN; enable = sc->param->boot_on || sc->param->always_on; + if (enable) + regnode_enable_cnt_inc(regnode); if (!sc->param->enable_active_high) enable = !enable; rv = GPIO_PIN_SET(pin->dev, pin->pin, enable); @@ -194,12 +196,14 @@ regnode_fixed_enable(struct regnode *regnode, bool ena return (0); pin = &sc->gpio_entry->gpio_pin; if (enable) { + regnode_enable_cnt_inc(regnode); sc->gpio_entry->enable_cnt++; if (sc->gpio_entry->enable_cnt > 1) return (0); } else { KASSERT(sc->gpio_entry->enable_cnt > 0, ("Invalid enable count")); + regnode_enable_cnt_dec(regnode); sc->gpio_entry->enable_cnt--; if (sc->gpio_entry->enable_cnt >= 1) return (0); From owner-svn-src-head@freebsd.org Thu Jun 14 20:55:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE45B10053BD; Thu, 14 Jun 2018 20:55:34 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 93D1381B7C; Thu, 14 Jun 2018 20:55:34 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 74E675E97; Thu, 14 Jun 2018 20:55:34 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5EKtYPu007147; Thu, 14 Jun 2018 20:55:34 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5EKtYTa007146; Thu, 14 Jun 2018 20:55:34 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201806142055.w5EKtYTa007146@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 14 Jun 2018 20:55:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335174 - head/usr.sbin/nfsd X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/nfsd X-SVN-Commit-Revision: 335174 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 20:55:35 -0000 Author: rmacklem Date: Thu Jun 14 20:55:33 2018 New Revision: 335174 URL: https://svnweb.freebsd.org/changeset/base/335174 Log: Document the "-p" and "-m" options added to nfsd.c by r335172. This is a content change. Modified: head/usr.sbin/nfsd/nfsd.8 Modified: head/usr.sbin/nfsd/nfsd.8 ============================================================================== --- head/usr.sbin/nfsd/nfsd.8 Thu Jun 14 20:37:25 2018 (r335173) +++ head/usr.sbin/nfsd/nfsd.8 Thu Jun 14 20:55:33 2018 (r335174) @@ -28,7 +28,7 @@ .\" @(#)nfsd.8 8.4 (Berkeley) 3/29/95 .\" $FreeBSD$ .\" -.Dd April 25, 2015 +.Dd May 31, 2018 .Dt NFSD 8 .Os .Sh NAME @@ -41,6 +41,8 @@ server .Op Fl ardute .Op Fl n Ar num_servers .Op Fl h Ar bindip +.Op Fl p Ar pnfs_setup +.Op Fl m Ar mirror_level .Op Fl Fl maxthreads Ar max_threads .Op Fl Fl minthreads Ar min_threads .Sh DESCRIPTION @@ -103,6 +105,64 @@ It may also be specified in addition to any options given. Note that NFS/UDP does not operate properly when bound to the wildcard IP address whether you use -a or do not use -h. +.It Fl p Ar pnfs_setup +Enables pNFS support in the server and specifies the information that the +daemon needs to start it. +This option can only be used on one server and specifies that this server +will be the MetaData Server (MDS) for the pNFS service. +This can only be done if there is at least one FreeBSD system configured +as a Data Server (DS) for it to use. +.Pp +The +.Ar pnfs_setup +string is a set of fields separated by ',' characters: +.Bl -tag -width Ds +Each of these fields specifies one Data Server. +It consists of a server hostname, followed by a ':' +and the directory path where the DS's data storage file system is mounted on +this MDS server. +At this time, only IPv4 addresses are supported by the interface to the kernel, +so the +.Dq server hostname +must resolve to an IPv4 address and support mounts on that address. +This needs to be extended to support IPv6 addresses in the near future. +The DS storage file systems must be mounted on this system before the +.Nm +is started with this option specified. +For example: +.sp +nfsv4-data0:/data0,nfsv4-data1:/data1 +.sp +Would specify two DS servers called nfsv4-data0 and nfsv4-data1 that comprise +the data storage component of the pNFS service. +The directories +.Dq /data0 +and +.Dq /data1 +are where the data storage servers exported +storage directories are mounted on this system (which will act as the MDS). +.El +.It Fl m Ar mirror_level +This option is only meaningful when used with the +.Fl p +option. +It specifies the +.Dq mirror_level , +which defines how many of the DSs will +have a copy of a file's data storage file. +The default of one implies no mirroring of data storage files on the DSs. +The +.Dq mirror_level +would normally be set to 2 to enable mirroring, but +can be as high as NFSDEV_MAXMIRRORS. +.Pp +If mirroring is enabled, the server must use the Flexible File +layout. +If mirroring is not enabled, the server will use the File layout +by default, but this default can be changed to the Flexible File layout if the +.Xr sysctl 1 +vfs.nfsd.default_flexfile +is set non-zero. .It Fl t Serve .Tn TCP NFS @@ -135,9 +195,11 @@ server specification; see .%T "Network File System Protocol Specification" , RFC1094, .%T "NFS: Network File System Version 3 Protocol Specification" , -RFC1813 and +RFC1813, .%T "Network File System (NFS) Version 4 Protocol" , -RFC3530. +RFC3530 and +.%T "Network File System (NFS) Version 4 Minor Version 1 Protocol" , +RFC5661. .Pp If .Nm @@ -213,6 +275,7 @@ just do a .Xr kldload 2 , .Xr nfssvc 2 , .Xr nfsv4 4 , +.Xr pnfs 4 , .Xr exports 5 , .Xr stablerestart 5 , .Xr gssd 8 , @@ -238,3 +301,14 @@ you must kill and then restart it, after the .Xr gssd 8 is running. +.Pp +If mirroring is enabled via the +.Fl m +option and there are Linux clients doing NFSv4.1 mounts, those clients +need to be patched to support the +.Dq tightly coupled +variant of +the Flexible File layout or the +.Xr sysctl 1 +vfs.nfsd.flexlinuxhack +must be set to one on the MDS as a workaround. From owner-svn-src-head@freebsd.org Thu Jun 14 21:12:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99D85100753A; Thu, 14 Jun 2018 21:12:09 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FA2982B9A; Thu, 14 Jun 2018 21:12:09 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 30C3C61A0; Thu, 14 Jun 2018 21:12:09 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5ELC9Ya016532; Thu, 14 Jun 2018 21:12:09 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5ELC8Bu016531; Thu, 14 Jun 2018 21:12:08 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201806142112.w5ELC8Bu016531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 14 Jun 2018 21:12:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335175 - head/usr.sbin/nfsd X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/nfsd X-SVN-Commit-Revision: 335175 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 21:12:09 -0000 Author: rmacklem Date: Thu Jun 14 21:12:08 2018 New Revision: 335175 URL: https://svnweb.freebsd.org/changeset/base/335175 Log: Add a new man page that briefly describes the pNFS variant of the NFSv4.1 protocol. This is a content change. Added: head/usr.sbin/nfsd/pnfs.4 (contents, props changed) Modified: head/usr.sbin/nfsd/Makefile Modified: head/usr.sbin/nfsd/Makefile ============================================================================== --- head/usr.sbin/nfsd/Makefile Thu Jun 14 20:55:33 2018 (r335174) +++ head/usr.sbin/nfsd/Makefile Thu Jun 14 21:12:08 2018 (r335175) @@ -2,6 +2,6 @@ # $FreeBSD$ PROG= nfsd -MAN= nfsd.8 nfsv4.4 stablerestart.5 +MAN= nfsd.8 nfsv4.4 stablerestart.5 pnfs.4 .include Added: head/usr.sbin/nfsd/pnfs.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/nfsd/pnfs.4 Thu Jun 14 21:12:08 2018 (r335175) @@ -0,0 +1,187 @@ +.\" Copyright (c) 2017 Rick Macklem +.\" +.\" 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 March 26, 2018 +.Dt PNFS 4 +.Os +.Sh NAME +.Nm pNFS +.Nd NFS Version 4.1 Parallel NFS Protocol +.Sh DESCRIPTION +The NFSv4.1 client and server provides support for the +.Tn pNFS +specification; see +.%T "Network File System (NFS) Version 4 Minor Version 1 Protocol RFC 5661" . +A pNFS service separates Read/Write operations from all other NFSv4.1 +operations, which are referred to as Metadata operations. +The Read/Write operations are performed directly on the Data Server (DS) +where the file's data resides, bypassing the NFS server. +All other file operations are performed on the NFS server, which is referred to +as a Metadata Server (MDS). +NFS clients that do not support +.Tn pNFS +perform Read/Write operations on the MDS, which acts as a proxy for the +appropriate DS(s). +.Pp +The NFSv4.1 protocol provides two pieces of information to pNFS aware +clients that allow them to perform Read/Write operations directly on +the DS. +.Pp +The first is DeviceInfo, which is static information defining the DS +server. +The critical piece of information in DeviceInfo for the layout types +supported by FreeBSD is the IP address that is used to perform RPCs on the DS. +It also indicates which version of NFS the DS supports, I/O size and other +layout specific information. +In the DeviceInfo, there is a DeviceID which, for the FreeBSD server +is unique to the DS configuration +and changes whenever the +.Xr nfsd +daemon is restarted or the server is rebooted. +.Pp +The second is the layout, which is per file and references the DeviceInfo +to use via the DeviceID. +It is for a byte range of a file and is either Read or Read/Write. +For the FreeBSD server, a layout covers all bytes of a file. +A layout may be recalled by the MDS using a LayoutRecall callback. +When a client returns a layout via the LayoutReturn operation it can +indicate that error(s) were encountered while doing I/O on the DS. +.Pp +The FreeBSD client and server supports two layout types. +.Pp +The File Layout is described in RFC5661 and uses the NFSv4.1 protocol +to perform I/O on the DS. +It does not support client aware DS mirroring and, as such, +the FreeBSD server only provides File Layout support for non-mirrored +configurations. +.Pp +The Flexible File Layout allows the use of the NFSv3, NFSv4.0 or NFSv4.1 +protocol to perform I/O on the DS and does support client aware mirroring. +As such, the FreeBSD server uses Flexible File Layout layouts for the +mirrored DS configurations. +The FreeBSD server supports the +.Dq tightly coupled +variant and all DSs use the +NFSv4.1 protocol for I/O operations. +Clients that support the Flexible File Layout will do writes and commits +to all DS mirrors in the mirror set. +.Pp +A FreeBSD pNFS service consists of a single MDS server plus one or more +DS servers, all of which are FreeBSD systems. +For a non-mirrored configuration, the FreeBSD server will issue File Layout +layouts by default. +However that default can be set to the Flexible File Layout by setting the +.Xr sysctl 1 +sysctl ``vfs.nfsd.default_flexfile'' to one. +Mirrored server configurations will only issue Flexible File Layouts. +.Tn pNFS +clients mount the MDS as they would a single NFS server. +.Pp +A FreeBSD +.Tn pNFS +client must be running the +.Xr nfscbd 8 +daemon and use the mount options +.Dq nfsv4,minorversion=1,pnfs . +.Pp +When files are created, the MDS creates a file tree identical to what a +single NFS server creates, except that all the regular (VREG) files will +be empty. +As such, if you look at the exported tree on the MDS directly +on the MDS server (not via an NFS mount), the files will all be of size zero. +Each of these files will also have two extended attributes in the system +attribute name space: +.Bd -literal -offset indent +pnfsd.dsfile - This extended attrbute stores the information that the + MDS needs to find the data file on a DS for this file. +pnfsd.dsattr - This extended attribute stores the Size, AccessTime, + ModifyTime and Change attributes for the file. +.Ed +.Pp +For each regular (VREG) file, the MDS creates a data file on one +(or on N of them for the mirrored case, where N is the mirror_level) +of the DSs where the file's data will be stored. +The name of this file is +the file handle of the file on the MDS in hexadecimal at time of file creation. +The data file will have the same file ownership, mode and NFSv4 ACL +(if ACLs are enabled for the file system) as the file on the MDS, so that +permission checking can be done on the DS. +This is referred to as +.Dq tightly coupled +for the Flexible File Layout. +.Pp +For +.Tn pNFS +aware clients, the service generates File Layout +or Flexible File Layout +layouts and associated DeviceInfo. +For non-pNFS aware NFS clients, the pNFS service appears just like a normal +NFS service. +For the non-pNFS aware client, the MDS will perform I/O operations on the appropriate DS(s), acting as +a proxy for the non-pNFS aware client. +This is also true for NFSv3 and NFSv4.0 mounts, since these are always non-pNFS +aware. +.Pp +See +.Bd -literal -offset indent +http://people.freebsd.org/~rmacklem/pnfs-planb-setup.txt +.Ed +.sp +for information on how to set up a FreeBSD pNFS service. +.Sh SEE ALSO +.Xr nfsv4 4 , +.Xr exports 5 , +.Xr fstab 5 , +.Xr rc.conf 5 , +.Xr nfscbd 8 , +.Xr nfsd 8 , +.Xr nfsuserd 8 , +.Xr pnfsdscopymr 8 , +.Xr pnfsdsfile 8 , +.Xr pnfsdskill 8 +.Sh BUGS +Linux kernel versions prior to 4.12 only supports NFSv3 DSs in its client +and will do all I/O through the MDS. +For Linux 4.12 kernels, support for NFSv4.1 DSs was added, but I have seen +Linux client crashes when testing this client. +For Linux 4.17-rc2 kernels, I have not seen client crashes during testing, +but it only supports the +.Dq loosely coupled +variant. +To make it work correctly when mounting the FreeBSD server, you must either +patch the Flexible File Layout client driver with a patch like: +.Bd -literal -offset indent +http://people.freebsd.org/~rmacklem/flexfile.patch +.Ed +.sp +or set the sysctl +.Dq vfs.nfsd.flexlinuxhack +to one so that it works around +the Linux client driver's limitations. +.Pp +Since the MDS cannot be mirrored, it is a single point of failure just +as a non +.Tn pNFS +server is. From owner-svn-src-head@freebsd.org Thu Jun 14 21:22:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 162131008BF7; Thu, 14 Jun 2018 21:22:15 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C00078370D; Thu, 14 Jun 2018 21:22:14 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A119A634A; Thu, 14 Jun 2018 21:22:14 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5ELMEP9020255; Thu, 14 Jun 2018 21:22:14 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5ELME7q020254; Thu, 14 Jun 2018 21:22:14 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201806142122.w5ELME7q020254@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 14 Jun 2018 21:22:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335176 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 335176 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 21:22:15 -0000 Author: tuexen Date: Thu Jun 14 21:22:14 2018 New Revision: 335176 URL: https://svnweb.freebsd.org/changeset/base/335176 Log: Whitespace changes. Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Thu Jun 14 21:12:08 2018 (r335175) +++ head/sys/netinet/sctp_output.c Thu Jun 14 21:22:14 2018 (r335176) @@ -2545,6 +2545,7 @@ once_again: inp->next_addr_touse = NULL; goto once_again; } + inp->next_addr_touse = starting_point; resettotop = 0; once_again_too: @@ -2552,6 +2553,7 @@ once_again_too: inp->next_addr_touse = LIST_FIRST(&inp->sctp_addr_list); resettotop = 1; } + /* ok, what about an acceptable address in the inp */ for (laddr = inp->next_addr_touse; laddr; laddr = LIST_NEXT(laddr, sctp_nxt_addr)) { @@ -2574,6 +2576,7 @@ once_again_too: inp->next_addr_touse = NULL; goto once_again_too; } + /* * no address bound can be a source for the destination we are in * trouble @@ -3988,8 +3991,8 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, int so_locked #endif ) -/* nofragment_flag to tell if IP_DF should be set (IPv4 only) */ { +/* nofragment_flag to tell if IP_DF should be set (IPv4 only) */ /** * Given a mbuf chain (via SCTP_BUF_NEXT()) that holds a packet header * WITH an SCTPHDR but no IP header, endpoint inp and sa structure: @@ -4036,6 +4039,7 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, if ((auth != NULL) && (stcb != NULL)) { sctp_fill_hmac_digest_m(m, auth_offset, auth, stcb, auth_keyid); } + if (net) { tos_value = net->dscp; } else if (stcb) { @@ -4550,6 +4554,7 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, prev_scope = sin6->sin6_scope_id; prev_port = sin6->sin6_port; } + if (SCTP_GET_HEADER_FOR_OUTPUT(o_pak)) { /* failed to prepend data, give up */ sctp_m_freem(m); @@ -4738,6 +4743,7 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp ali->indication = htonl(inp->sctp_ep.adaptation_layer_indicator); chunk_len += parameter_len; } + /* ECN parameter */ if (stcb->asoc.ecn_supported == 1) { parameter_len = (uint16_t)sizeof(struct sctp_paramhdr); @@ -4746,6 +4752,7 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp ph->param_length = htons(parameter_len); chunk_len += parameter_len; } + /* PR-SCTP supported parameter */ if (stcb->asoc.prsctp_supported == 1) { parameter_len = (uint16_t)sizeof(struct sctp_paramhdr); @@ -4754,6 +4761,7 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp ph->param_length = htons(parameter_len); chunk_len += parameter_len; } + /* Add NAT friendly parameter. */ if (SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly)) { parameter_len = (uint16_t)sizeof(struct sctp_paramhdr); @@ -4762,6 +4770,7 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp ph->param_length = htons(parameter_len); chunk_len += parameter_len; } + /* And now tell the peer which extensions we support */ num_ext = 0; pr_supported = (struct sctp_supported_chunk_types_param *)(mtod(m, caddr_t)+chunk_len); @@ -4852,6 +4861,7 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp chunk_len += parameter_len; } } + /* now any cookie time extensions */ if (stcb->asoc.cookie_preserve_req) { struct sctp_cookie_perserve_param *cookie_preserve; @@ -4869,6 +4879,7 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp stcb->asoc.cookie_preserve_req = 0; chunk_len += parameter_len; } + if (stcb->asoc.scope.ipv4_addr_legal || stcb->asoc.scope.ipv6_addr_legal) { uint8_t i; @@ -4897,6 +4908,7 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp padding_len = 4 - 2 * i; chunk_len += parameter_len; } + SCTP_BUF_LEN(m) = chunk_len; /* now the addresses */ /* @@ -5902,6 +5914,7 @@ do_a_abort: ali->indication = htonl(inp->sctp_ep.adaptation_layer_indicator); chunk_len += parameter_len; } + /* ECN parameter */ if (((asoc != NULL) && (asoc->ecn_supported == 1)) || ((asoc == NULL) && (inp->ecn_supported == 1))) { @@ -5911,6 +5924,7 @@ do_a_abort: ph->param_length = htons(parameter_len); chunk_len += parameter_len; } + /* PR-SCTP supported parameter */ if (((asoc != NULL) && (asoc->prsctp_supported == 1)) || ((asoc == NULL) && (inp->prsctp_supported == 1))) { @@ -5920,6 +5934,7 @@ do_a_abort: ph->param_length = htons(parameter_len); chunk_len += parameter_len; } + /* Add NAT friendly parameter */ if (nat_friendly) { parameter_len = (uint16_t)sizeof(struct sctp_paramhdr); @@ -5928,6 +5943,7 @@ do_a_abort: ph->param_length = htons(parameter_len); chunk_len += parameter_len; } + /* And now tell the peer which extensions we support */ num_ext = 0; pr_supported = (struct sctp_supported_chunk_types_param *)(mtod(m, caddr_t)+chunk_len); @@ -5971,6 +5987,7 @@ do_a_abort: padding_len = SCTP_SIZE32(parameter_len) - parameter_len; chunk_len += parameter_len; } + /* add authentication parameters */ if (((asoc != NULL) && (asoc->auth_supported == 1)) || ((asoc == NULL) && (inp->auth_supported == 1))) { @@ -6048,6 +6065,7 @@ do_a_abort: SCTP_BUF_LEN(m) += padding_len; padding_len = 0; } + /* tack on the operational error if present */ if (op_err) { parameter_len = 0; @@ -7431,6 +7449,7 @@ dont_do_it: chk->last_mbuf = SCTP_BUF_NEXT(chk->last_mbuf); } } + if (to_move > length) { /*- This should not happen either * since we always lower to_move to the size @@ -7968,6 +7987,7 @@ nothing_to_send: *reason_code = 8; return (0); } + if (asoc->sctp_cmt_on_off > 0) { /* get the last start point */ start_at = asoc->last_net_cmt_send_started; @@ -8614,6 +8634,7 @@ again_one_more_time: /* Don't send the chunk on this net */ continue; } + if (asoc->sctp_cmt_on_off == 0) { if ((asoc->alternate) && (asoc->alternate != net) && @@ -8877,6 +8898,7 @@ no_data_fill: if (old_start_at) goto again_one_more_time; } + /* * At the end there should be no NON timed chunks hanging on this * queue. @@ -9270,17 +9292,20 @@ sctp_send_asconf(struct sctp_tcb *stcb, struct sctp_ne /* can't send a new one if there is one in flight already */ return; } + /* compose an ASCONF chunk, maximum length is PMTU */ m_asconf = sctp_compose_asconf(stcb, &len, addr_locked); if (m_asconf == NULL) { return; } + sctp_alloc_a_chunk(stcb, chk); if (chk == NULL) { /* no memory */ sctp_m_freem(m_asconf); return; } + chk->copy_by_ref = 0; chk->rec.chunk_id.id = SCTP_ASCONF; chk->rec.chunk_id.can_take_data = 0; @@ -9351,6 +9376,7 @@ sctp_send_asconf_ack(struct sctp_tcb *stcb) if (ack->data == NULL) { continue; } + /* copy the asconf_ack */ m_ack = SCTP_M_COPYM(ack->data, 0, M_COPYALL, M_NOWAIT); if (m_ack == NULL) { @@ -10239,6 +10265,7 @@ sctp_output( SCTP_LTRACE_ERR_RET_PKT(m, inp, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, EINVAL); return (EINVAL); } + if (inp->sctp_socket == NULL) { SCTP_LTRACE_ERR_RET_PKT(m, inp, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, EINVAL); return (EINVAL); @@ -11312,6 +11339,7 @@ sctp_send_hb(struct sctp_tcb *stcb, struct sctp_nets * SCTPDBG(SCTP_DEBUG_OUTPUT4, "Gak, can't get a chunk for hb\n"); return; } + chk->copy_by_ref = 0; chk->rec.chunk_id.id = SCTP_HEARTBEAT_REQUEST; chk->rec.chunk_id.can_take_data = 1; @@ -12330,6 +12358,7 @@ sctp_copy_one(struct sctp_stream_queue_pending *sp, SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, ENOBUFS); return (ENOBUFS); } + sp->tail_mbuf = m_last(sp->data); return (0); } @@ -12346,6 +12375,7 @@ sctp_copy_it_in(struct sctp_tcb *stcb, int user_marks_eor, int *error) { + /*- * This routine must be very careful in its work. Protocol * processing is up and running so care must be taken to spl...() @@ -13010,6 +13040,7 @@ sctp_lower_sosend(struct socket *so, error = EFAULT; goto out_unlocked; } + /* Unless E_EOR mode is on, we must make a send FIT in one call. */ if ((user_marks_eor == 0) && (sndlen > SCTP_SB_LIMIT_SND(stcb->sctp_socket))) { @@ -13027,6 +13058,7 @@ sctp_lower_sosend(struct socket *so, error = EINVAL; goto out_unlocked; } + if (user_marks_eor) { local_add_more = min(SCTP_SB_LIMIT_SND(so), SCTP_BASE_SYSCTL(sctp_add_more_threshold)); } else { @@ -13091,6 +13123,7 @@ sctp_lower_sosend(struct socket *so, } SOCKBUF_UNLOCK(&so->so_snd); } + skip_preblock: if (stcb->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) { goto out_unlocked; @@ -13227,6 +13260,7 @@ skip_preblock: if (srcv->sinfo_flags & SCTP_SACK_IMMEDIATELY) { sp->sinfo_flags |= SCTP_SACK_IMMEDIATELY; } + /* Did we reach EOR? */ if ((uio->uio_resid == 0) && ((user_marks_eor == 0) || @@ -13392,6 +13426,7 @@ skip_preblock: SOCKBUF_UNLOCK(&so->so_snd); goto out_unlocked; } + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_BLK_LOGGING_ENABLE) { sctp_log_block(SCTP_BLOCK_LOG_OUTOF_BLK, asoc, stcb->asoc.total_output_queue_size); @@ -13757,6 +13792,7 @@ sctp_v6src_match_nexthop(struct sockaddr_in6 *src6, sc SCTPDBG_ADDR(SCTP_DEBUG_OUTPUT2, (struct sockaddr *)src6); return (0); } + SCTPDBG(SCTP_DEBUG_OUTPUT2, "v6src_match_nexthop(), Prefix entry is "); SCTPDBG_ADDR(SCTP_DEBUG_OUTPUT2, (struct sockaddr *)src6); From owner-svn-src-head@freebsd.org Thu Jun 14 21:27:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A2731009485; Thu, 14 Jun 2018 21:27:27 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E387583BF9; Thu, 14 Jun 2018 21:27:26 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B8E0A6365; Thu, 14 Jun 2018 21:27:26 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5ELRQZP022905; Thu, 14 Jun 2018 21:27:26 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5ELRPoK022899; Thu, 14 Jun 2018 21:27:25 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201806142127.w5ELRPoK022899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 14 Jun 2018 21:27:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335177 - in head/sys: compat/freebsd32 compat/linux i386/ibcs2 kern vm X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head/sys: compat/freebsd32 compat/linux i386/ibcs2 kern vm X-SVN-Commit-Revision: 335177 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 21:27:27 -0000 Author: brooks Date: Thu Jun 14 21:27:25 2018 New Revision: 335177 URL: https://svnweb.freebsd.org/changeset/base/335177 Log: Name the implementation of brk and sbrk sys_break(). The break() system call was renamed (several times) starting in v3 AT&T UNIX when C was invented and break was a language keyword. The last vestage of a need for it to be called something else (eg obreak) was removed in r225617 which consistantly prefixed all syscall implementations. Reviewed by: emaste, kib (older version) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D15638 Modified: head/sys/compat/freebsd32/syscalls.master head/sys/compat/linux/linux_misc.c head/sys/i386/ibcs2/syscalls.master head/sys/kern/capabilities.conf head/sys/kern/syscalls.master head/sys/vm/vm_unix.c Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Thu Jun 14 21:22:14 2018 (r335176) +++ head/sys/compat/freebsd32/syscalls.master Thu Jun 14 21:27:25 2018 (r335177) @@ -87,8 +87,7 @@ int mode, int dev); } 15 AUE_CHMOD NOPROTO { int chmod(char *path, int mode); } 16 AUE_CHOWN NOPROTO { int chown(char *path, int uid, int gid); } -17 AUE_NULL NOPROTO { caddr_t obreak(char *nsize); } break \ - obreak_args int +17 AUE_NULL NOPROTO { caddr_t break(char *nsize); } 18 AUE_GETFSSTAT COMPAT4 { int freebsd32_getfsstat( \ struct statfs32 *buf, long bufsize, \ int mode); } Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Thu Jun 14 21:22:14 2018 (r335176) +++ head/sys/compat/linux/linux_misc.c Thu Jun 14 21:27:25 2018 (r335177) @@ -231,7 +231,7 @@ linux_brk(struct thread *td, struct linux_brk_args *ar { struct vmspace *vm = td->td_proc->p_vmspace; vm_offset_t new, old; - struct obreak_args /* { + struct break_args /* { char * nsize; } */ tmp; @@ -242,7 +242,7 @@ linux_brk(struct thread *td, struct linux_brk_args *ar old = (vm_offset_t)vm->vm_daddr + ctob(vm->vm_dsize); new = (vm_offset_t)args->dsend; tmp.nsize = (char *)new; - if (((caddr_t)new > vm->vm_daddr) && !sys_obreak(td, &tmp)) + if (((caddr_t)new > vm->vm_daddr) && !sys_break(td, &tmp)) td->td_retval[0] = (long)new; else td->td_retval[0] = (long)old; Modified: head/sys/i386/ibcs2/syscalls.master ============================================================================== --- head/sys/i386/ibcs2/syscalls.master Thu Jun 14 21:22:14 2018 (r335176) +++ head/sys/i386/ibcs2/syscalls.master Thu Jun 14 21:27:25 2018 (r335177) @@ -57,7 +57,7 @@ 15 AUE_CHMOD STD { int ibcs2_chmod(char *path, int mode); } 16 AUE_CHOWN STD { int ibcs2_chown(char *path, int uid, \ int gid); } -17 AUE_NULL NOPROTO { int obreak(caddr_t nsize); } +17 AUE_NULL NOPROTO { caddr_t break(caddr_t nsize); } 18 AUE_STAT STD { int ibcs2_stat(char* path, \ struct ibcs2_stat *st); } 19 AUE_LSEEK STD { long ibcs2_lseek(int fd, long offset, \ Modified: head/sys/kern/capabilities.conf ============================================================================== --- head/sys/kern/capabilities.conf Thu Jun 14 21:22:14 2018 (r335176) +++ head/sys/kern/capabilities.conf Thu Jun 14 21:27:25 2018 (r335177) @@ -438,7 +438,7 @@ oaio_write ## ## Allow simple VM operations on the current process. ## -obreak +break ## ## Allow AIO operations by file descriptor, subject to capability rights. Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Thu Jun 14 21:22:14 2018 (r335176) +++ head/sys/kern/syscalls.master Thu Jun 14 21:27:25 2018 (r335177) @@ -118,8 +118,7 @@ 15 AUE_CHMOD STD { int chmod(_In_z_ char *path, int mode); } 16 AUE_CHOWN STD { int chown(_In_z_ char *path, \ int uid, int gid); } -17 AUE_NULL STD { caddr_t obreak(_In_ char *nsize); } break \ - obreak_args int +17 AUE_NULL STD { caddr_t break(_In_ char *nsize); } 18 AUE_GETFSSTAT COMPAT4 { int getfsstat( \ _Out_writes_bytes_opt_(bufsize) \ struct ostatfs *buf, \ Modified: head/sys/vm/vm_unix.c ============================================================================== --- head/sys/vm/vm_unix.c Thu Jun 14 21:22:14 2018 (r335176) +++ head/sys/vm/vm_unix.c Thu Jun 14 21:27:25 2018 (r335177) @@ -61,12 +61,12 @@ __FBSDID("$FreeBSD$"); #include #ifndef _SYS_SYSPROTO_H_ -struct obreak_args { +struct break_args { char *nsize; }; #endif int -sys_obreak(struct thread *td, struct obreak_args *uap) +sys_break(struct thread *td, struct break_args *uap) { #if !defined(__aarch64__) && !defined(__riscv__) struct vmspace *vm = td->td_proc->p_vmspace; @@ -196,11 +196,8 @@ sys_obreak(struct thread *td, struct obreak_args *uap) * * XXX If the pages cannot be wired, no error is returned. */ - if ((map->flags & MAP_WIREFUTURE) == MAP_WIREFUTURE) { - if (bootverbose) - printf("obreak: MAP_WIREFUTURE set\n"); + if ((map->flags & MAP_WIREFUTURE) == MAP_WIREFUTURE) do_map_wirefuture = TRUE; - } } else if (new < old) { rv = vm_map_delete(map, new, old); if (rv != KERN_SUCCESS) { From owner-svn-src-head@freebsd.org Thu Jun 14 21:29:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26A8110097CE; Thu, 14 Jun 2018 21:29:34 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D07F783DDE; Thu, 14 Jun 2018 21:29:33 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ADAC0636C; Thu, 14 Jun 2018 21:29:33 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5ELTXFZ023035; Thu, 14 Jun 2018 21:29:33 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5ELTV1v023027; Thu, 14 Jun 2018 21:29:31 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201806142129.w5ELTV1v023027@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 14 Jun 2018 21:29:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335178 - in head/sys: compat/freebsd32 i386/ibcs2 kern sys X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head/sys: compat/freebsd32 i386/ibcs2 kern sys X-SVN-Commit-Revision: 335178 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 21:29:34 -0000 Author: brooks Date: Thu Jun 14 21:29:31 2018 New Revision: 335178 URL: https://svnweb.freebsd.org/changeset/base/335178 Log: Regen after 335177 (rename sys_obreak to sys_break). Modified: head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/freebsd32/freebsd32_systrace_args.c head/sys/i386/ibcs2/ibcs2_proto.h head/sys/i386/ibcs2/ibcs2_syscall.h head/sys/i386/ibcs2/ibcs2_sysent.c head/sys/kern/init_sysent.c head/sys/kern/systrace_args.c head/sys/sys/sysproto.h Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Thu Jun 14 21:27:25 2018 (r335177) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Thu Jun 14 21:29:31 2018 (r335178) @@ -73,7 +73,7 @@ struct sysent freebsd32_sysent[] = { { compat11(AS(freebsd11_freebsd32_mknod_args),freebsd32_mknod), AUE_MKNOD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 14 = freebsd11 freebsd32_mknod */ { AS(chmod_args), (sy_call_t *)sys_chmod, AUE_CHMOD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 15 = chmod */ { AS(chown_args), (sy_call_t *)sys_chown, AUE_CHOWN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 16 = chown */ - { AS(obreak_args), (sy_call_t *)sys_obreak, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 17 = break */ + { AS(break_args), (sy_call_t *)sys_break, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 17 = break */ { compat4(AS(freebsd4_freebsd32_getfsstat_args),freebsd32_getfsstat), AUE_GETFSSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 18 = freebsd4 freebsd32_getfsstat */ { compat(AS(ofreebsd32_lseek_args),freebsd32_lseek), AUE_LSEEK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 19 = old freebsd32_lseek */ { 0, (sy_call_t *)sys_getpid, AUE_GETPID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 20 = getpid */ Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Jun 14 21:27:25 2018 (r335177) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Jun 14 21:29:31 2018 (r335178) @@ -121,9 +121,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 3; break; } - /* obreak */ + /* break */ case 17: { - struct obreak_args *p = params; + struct break_args *p = params; uarg[0] = (intptr_t) p->nsize; /* char * */ *n_args = 1; break; @@ -3454,7 +3454,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; - /* obreak */ + /* break */ case 17: switch(ndx) { case 0: @@ -8886,7 +8886,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char * if (ndx == 0 || ndx == 1) p = "int"; break; - /* obreak */ + /* break */ case 17: if (ndx == 0 || ndx == 1) p = "caddr_t"; Modified: head/sys/i386/ibcs2/ibcs2_proto.h ============================================================================== --- head/sys/i386/ibcs2/ibcs2_proto.h Thu Jun 14 21:27:25 2018 (r335177) +++ head/sys/i386/ibcs2/ibcs2_proto.h Thu Jun 14 21:29:31 2018 (r335178) @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -357,6 +358,12 @@ int ibcs2_isc(struct thread *, struct ibcs2_isc_args * #endif /* COMPAT_FREEBSD10 */ + + +#ifdef COMPAT_FREEBSD11 + + +#endif /* COMPAT_FREEBSD11 */ #define IBCS2_SYS_AUE_ibcs2_read AUE_NULL #define IBCS2_SYS_AUE_ibcs2_open AUE_OPEN_RWTC Modified: head/sys/i386/ibcs2/ibcs2_syscall.h ============================================================================== --- head/sys/i386/ibcs2/ibcs2_syscall.h Thu Jun 14 21:27:25 2018 (r335177) +++ head/sys/i386/ibcs2/ibcs2_syscall.h Thu Jun 14 21:29:31 2018 (r335178) @@ -22,7 +22,7 @@ #define IBCS2_SYS_ibcs2_mknod 14 #define IBCS2_SYS_ibcs2_chmod 15 #define IBCS2_SYS_ibcs2_chown 16 -#define IBCS2_SYS_obreak 17 +#define IBCS2_SYS_break 17 #define IBCS2_SYS_ibcs2_stat 18 #define IBCS2_SYS_ibcs2_lseek 19 #define IBCS2_SYS_getpid 20 Modified: head/sys/i386/ibcs2/ibcs2_sysent.c ============================================================================== --- head/sys/i386/ibcs2/ibcs2_sysent.c Thu Jun 14 21:27:25 2018 (r335177) +++ head/sys/i386/ibcs2/ibcs2_sysent.c Thu Jun 14 21:29:31 2018 (r335178) @@ -33,7 +33,7 @@ struct sysent ibcs2_sysent[] = { { AS(ibcs2_mknod_args), (sy_call_t *)ibcs2_mknod, AUE_MKNOD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 14 = ibcs2_mknod */ { AS(ibcs2_chmod_args), (sy_call_t *)ibcs2_chmod, AUE_CHMOD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 15 = ibcs2_chmod */ { AS(ibcs2_chown_args), (sy_call_t *)ibcs2_chown, AUE_CHOWN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 16 = ibcs2_chown */ - { AS(obreak_args), (sy_call_t *)sys_obreak, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 17 = obreak */ + { AS(break_args), (sy_call_t *)sys_break, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 17 = break */ { AS(ibcs2_stat_args), (sy_call_t *)ibcs2_stat, AUE_STAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 18 = ibcs2_stat */ { AS(ibcs2_lseek_args), (sy_call_t *)ibcs2_lseek, AUE_LSEEK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 19 = ibcs2_lseek */ { 0, (sy_call_t *)sys_getpid, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 20 = getpid */ Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Thu Jun 14 21:27:25 2018 (r335177) +++ head/sys/kern/init_sysent.c Thu Jun 14 21:29:31 2018 (r335178) @@ -66,7 +66,7 @@ struct sysent sysent[] = { { compat11(AS(freebsd11_mknod_args),mknod), AUE_MKNOD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 14 = freebsd11 mknod */ { AS(chmod_args), (sy_call_t *)sys_chmod, AUE_CHMOD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 15 = chmod */ { AS(chown_args), (sy_call_t *)sys_chown, AUE_CHOWN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 16 = chown */ - { AS(obreak_args), (sy_call_t *)sys_obreak, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 17 = break */ + { AS(break_args), (sy_call_t *)sys_break, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 17 = break */ { compat4(AS(freebsd4_getfsstat_args),getfsstat), AUE_GETFSSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 18 = freebsd4 getfsstat */ { compat(AS(olseek_args),lseek), AUE_LSEEK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 19 = old lseek */ { 0, (sy_call_t *)sys_getpid, AUE_GETPID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 20 = getpid */ Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Thu Jun 14 21:27:25 2018 (r335177) +++ head/sys/kern/systrace_args.c Thu Jun 14 21:29:31 2018 (r335178) @@ -118,9 +118,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 3; break; } - /* obreak */ + /* break */ case 17: { - struct obreak_args *p = params; + struct break_args *p = params; uarg[0] = (intptr_t) p->nsize; /* char * */ *n_args = 1; break; @@ -3459,7 +3459,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; - /* obreak */ + /* break */ case 17: switch(ndx) { case 0: @@ -8835,7 +8835,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char * if (ndx == 0 || ndx == 1) p = "int"; break; - /* obreak */ + /* break */ case 17: if (ndx == 0 || ndx == 1) p = "caddr_t"; Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Thu Jun 14 21:27:25 2018 (r335177) +++ head/sys/sys/sysproto.h Thu Jun 14 21:29:31 2018 (r335178) @@ -89,7 +89,7 @@ struct chown_args { char uid_l_[PADL_(int)]; int uid; char uid_r_[PADR_(int)]; char gid_l_[PADL_(int)]; int gid; char gid_r_[PADR_(int)]; }; -struct obreak_args { +struct break_args { char nsize_l_[PADL_(char *)]; char * nsize; char nsize_r_[PADR_(char *)]; }; struct getpid_args { @@ -1784,7 +1784,7 @@ int sys_chdir(struct thread *, struct chdir_args *); int sys_fchdir(struct thread *, struct fchdir_args *); int sys_chmod(struct thread *, struct chmod_args *); int sys_chown(struct thread *, struct chown_args *); -int sys_obreak(struct thread *, struct obreak_args *); +int sys_break(struct thread *, struct break_args *); int sys_getpid(struct thread *, struct getpid_args *); int sys_mount(struct thread *, struct mount_args *); int sys_unmount(struct thread *, struct unmount_args *); From owner-svn-src-head@freebsd.org Thu Jun 14 21:30:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC17F1009A14; Thu, 14 Jun 2018 21:30:52 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A2A3B83FCD; Thu, 14 Jun 2018 21:30:52 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 83E736382; Thu, 14 Jun 2018 21:30:52 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5ELUq9E023841; Thu, 14 Jun 2018 21:30:52 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5ELUqWM023840; Thu, 14 Jun 2018 21:30:52 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201806142130.w5ELUqWM023840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 14 Jun 2018 21:30:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335179 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 335179 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 21:30:53 -0000 Author: tuexen Date: Thu Jun 14 21:30:52 2018 New Revision: 335179 URL: https://svnweb.freebsd.org/changeset/base/335179 Log: Provide the ip6_plen in network byte order when calling ip6_output(). This is not strictly required by ip6_output(), since it overrides it, but it is needed for upcoming dtrace support. Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Thu Jun 14 21:29:31 2018 (r335178) +++ head/sys/netinet/sctp_output.c Thu Jun 14 21:30:52 2018 (r335179) @@ -4396,7 +4396,7 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, } else { ip6h->ip6_nxt = IPPROTO_SCTP; } - ip6h->ip6_plen = (uint16_t)(packet_length - sizeof(struct ip6_hdr)); + ip6h->ip6_plen = htons(packet_length - sizeof(struct ip6_hdr)); ip6h->ip6_dst = sin6->sin6_addr; /* @@ -11258,7 +11258,7 @@ sctp_send_resp_msg(struct sockaddr *src, struct sockad #endif #ifdef INET6 case AF_INET6: - ip6->ip6_plen = (uint16_t)(len - sizeof(struct ip6_hdr)); + ip6->ip6_plen = htons(len - sizeof(struct ip6_hdr)); if (port) { shout->checksum = sctp_calculate_cksum(mout, sizeof(struct ip6_hdr) + sizeof(struct udphdr)); SCTP_STAT_INCR(sctps_sendswcrc); From owner-svn-src-head@freebsd.org Thu Jun 14 22:23:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F7B71010082; Thu, 14 Jun 2018 22:23:40 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 3FE9686B62; Thu, 14 Jun 2018 22:23:38 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id 6510e4af; Fri, 15 Jun 2018 00:23:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=l2TMH0sxs/ZY8MsaPUYIZTpv3yo=; b=B9INkoxub836FsAqkVopgTsEtxY0 VIcyEmCX3x5CkZhi7NeM9tV9QVsd8ZyzyvPexpdLuk/WIX5jtiebEGctcNRnHjdi lgrkX6NU7GLDBwdtoR35KxFR6ZVQRfo4MLXglxzcZlHILeZAfOETQLHkqix5SodA WiwoNjwkTWGU2tA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=XeYRVSHPRbiYPp95OA/+ZTcYi9yn8p9DS6vg2DgZEQhe0m2UvEcloTkx icoiWi/IzQrVgtM2AIAp7jnGwrAj2I9KQKDo4GdRISRSa84g4DDZdYggr7+QFxuE HWRXMTrQaM2swVJTN0Y2k3hmLBzum3mcXrwTv6mu5a+295poe30= Received: from skull.home.blih.net (ip-9.net-89-3-105.rev.numericable.fr [89.3.105.9]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 7e894d55 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Fri, 15 Jun 2018 00:23:36 +0200 (CEST) Date: Fri, 15 Jun 2018 00:23:36 +0200 From: Emmanuel Vadot To: "Jonathan T. Looney" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335068 - in head: share/man/man9 sys/amd64/amd64 sys/i386/i386 sys/kern sys/net sys/sys sys/vm Message-Id: <20180615002336.fcb966efe812cd60af59f68f@bidouilliste.com> In-Reply-To: <201806131704.w5DH4gLv048134@repo.freebsd.org> References: <201806131704.w5DH4gLv048134@repo.freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 22:23:40 -0000 Hi Jonathan, On Wed, 13 Jun 2018 17:04:42 +0000 (UTC) "Jonathan T. Looney" wrote: > Author: jtl > Date: Wed Jun 13 17:04:41 2018 > New Revision: 335068 > URL: https://svnweb.freebsd.org/changeset/base/335068 > > Log: > Make UMA and malloc(9) return non-executable memory in most cases. > > Most kernel memory that is allocated after boot does not need to be > executable. There are a few exceptions. For example, kernel modules > do need executable memory, but they don't use UMA or malloc(9). The > BPF JIT compiler also needs executable memory and did use malloc(9) > until r317072. > > (Note that a side effect of r316767 was that the "small allocation" > path in UMA on amd64 already returned non-executable memory. This > meant that some calls to malloc(9) or the UMA zone(9) allocator could > return executable memory, while others could return non-executable > memory. This change makes the behavior consistent.) > > This change makes malloc(9) return non-executable memory unless the new > M_EXEC flag is specified. After this change, the UMA zone(9) allocator > will always return non-executable memory, and a KASSERT will catch > attempts to use the M_EXEC flag to allocate executable memory using > uma_zalloc() or its variants. > > Allocations that do need executable memory have various choices. They > may use the M_EXEC flag to malloc(9), or they may use a different VM > interfact to obtain executable pages. > > Now that malloc(9) again allows executable allocations, this change also > reverts most of r317072. > > PR: 228927 > Reviewed by: alc, kib, markj, jhb (previous version) > Sponsored by: Netflix > Differential Revision: https://reviews.freebsd.org/D15691 This brake module loading on armv7 and arm64 kevans log on armv7 : https://gist.github.com/kevans91/d0ffcd6c94a0e4cdfdc5433612fce2e8 mine on arm64 : http://dpaste.com/3VVBZDV Do you have any idea what could cause that ? Is any MD stuff is missing for those arches ? Thanks, -- Emmanuel Vadot From owner-svn-src-head@freebsd.org Thu Jun 14 22:25:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C91FB10103AB; Thu, 14 Jun 2018 22:25:11 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7F60E86D2E; Thu, 14 Jun 2018 22:25:11 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 610AC6E16; Thu, 14 Jun 2018 22:25:11 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5EMPBRv053106; Thu, 14 Jun 2018 22:25:11 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5EMPA9J053100; Thu, 14 Jun 2018 22:25:10 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201806142225.w5EMPA9J053100@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 14 Jun 2018 22:25:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335180 - in head/sys/netinet: . tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 335180 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 22:25:12 -0000 Author: glebius Date: Thu Jun 14 22:25:10 2018 New Revision: 335180 URL: https://svnweb.freebsd.org/changeset/base/335180 Log: TCPOUTFLAGS no longer exists since r334843. Modified: head/sys/netinet/tcp_hpts.c head/sys/netinet/tcp_offload.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_hpts.c ============================================================================== --- head/sys/netinet/tcp_hpts.c Thu Jun 14 21:30:52 2018 (r335179) +++ head/sys/netinet/tcp_hpts.c Thu Jun 14 22:25:10 2018 (r335180) @@ -148,7 +148,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define TCPOUTFLAGS #include #include #include Modified: head/sys/netinet/tcp_offload.c ============================================================================== --- head/sys/netinet/tcp_offload.c Thu Jun 14 21:30:52 2018 (r335179) +++ head/sys/netinet/tcp_offload.c Thu Jun 14 22:25:10 2018 (r335180) @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define TCPOUTFLAGS #include #include #include Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Thu Jun 14 21:30:52 2018 (r335179) +++ head/sys/netinet/tcp_output.c Thu Jun 14 22:25:10 2018 (r335180) @@ -72,7 +72,6 @@ __FBSDID("$FreeBSD$"); #include #endif #include -#define TCPOUTFLAGS #include #include #include Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Thu Jun 14 21:30:52 2018 (r335179) +++ head/sys/netinet/tcp_stacks/rack.c Thu Jun 14 22:25:10 2018 (r335180) @@ -75,7 +75,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define TCPOUTFLAGS #include #include #include From owner-svn-src-head@freebsd.org Thu Jun 14 22:31:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1286F10110FB; Thu, 14 Jun 2018 22:31:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BDAC78743F; Thu, 14 Jun 2018 22:31:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9EF746E65; Thu, 14 Jun 2018 22:31:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5EMVUWI057079; Thu, 14 Jun 2018 22:31:30 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5EMVUwP057078; Thu, 14 Jun 2018 22:31:30 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201806142231.w5EMVUwP057078@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 14 Jun 2018 22:31:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335181 - head/sbin/devmatch X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sbin/devmatch X-SVN-Commit-Revision: 335181 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 22:31:31 -0000 Author: jhb Date: Thu Jun 14 22:31:30 2018 New Revision: 335181 URL: https://svnweb.freebsd.org/changeset/base/335181 Log: Exit with an error if a linker hints file can't be found. Continuing with a NULL hints variable just triggers a segfault later on. The other error cases in this function all exit for an error rather than warning. Reviewed by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D15579 Modified: head/sbin/devmatch/devmatch.c Modified: head/sbin/devmatch/devmatch.c ============================================================================== --- head/sbin/devmatch/devmatch.c Thu Jun 14 22:25:10 2018 (r335180) +++ head/sbin/devmatch/devmatch.c Thu Jun 14 22:31:30 2018 (r335181) @@ -120,12 +120,8 @@ read_linker_hints(void) continue; break; } - if (q == NULL) { - warnx("Can't read linker hints file."); - free(hints); - hints = NULL; - return; - } + if (q == NULL) + errx(1, "Can't read linker hints file."); } else { hints = read_hints(linker_hints, &len); if (hints == NULL) From owner-svn-src-head@freebsd.org Thu Jun 14 22:54:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C11BD1014362 for ; Thu, 14 Jun 2018 22:54:55 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-wm0-x22f.google.com (mail-wm0-x22f.google.com [IPv6:2a00:1450:400c:c09::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3959868A97 for ; Thu, 14 Jun 2018 22:54:55 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by mail-wm0-x22f.google.com with SMTP id r125-v6so637253wmg.2 for ; Thu, 14 Jun 2018 15:54:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=AvYQzJPv54dF/OiYReKiYZWQVSsyTjQohpo5jkPbnjQ=; b=gmyu4ld4HzgOVJfFyZBiJvI8f2Li8d2Oe1j9tWqO63r2dvUh4aclGsaEb+Ren4W0TR Le0M4JD+R7fx5zlYkS+rBEmjp3mqyo9eaQSlzvPdBiBXHSJeyb3dPy+tMBwNZ4XpU7sj 9P9V93TqC9Y882FEE7PrR6g672Z9iGzkEP8klH501xNQBHKn792lJdeLW4F3zcDQ1K1b t1jVPZG66I/DNOc1+7TFjtmho0RB8W0v4OG4HANYnM8QBzLEwZdV110FkSqSnFMamNmq 7XUML4EobYTsIxXfnQ7KOGW5MXAJbzteZqD42QwoSRLoI0lzva2lC2tS90Yp9u3bHDnY 4k9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=AvYQzJPv54dF/OiYReKiYZWQVSsyTjQohpo5jkPbnjQ=; b=AAeBBvbyC2ddqVwDhKK+/W6UOuScA3z2JWSnDVR3H7Ysq6BxgNqPgWqt6Bodq6N3UT uqVQSYQltwB4s2zrg0z9N3V3RsM86kXYl69KjL+kqUYQNohJddZ1avRGo5aRwDfL7bCK o8BXQPCJiYFBIhZbC8+IGAgDXwb7ubVPgIOD/rlxNkuXUMzTeBLUNG6iaAxay0VqEQXB VCJCBxY4GyZWJl9/MLkwxrV3X0vETcfbCAmt38RDjoJDHg3NvOpgS38rX1+LEFo53NMB uiybvoXwl/x9Aesn/XIvhaj+LfUBE3nPoOsgVIncbGYI2jRfEHzKcI7puYYPw5BsGgBQ RMjg== X-Gm-Message-State: APt69E3xHg79OK15lutfVnUnQAQ4cIP/KDWH/Z2daHbQDaPSO5FkiRuZ 0drN/oaFgqeQ58fCnlJlPzu9yK1fYpo= X-Google-Smtp-Source: ADUXVKKHwH1oQIXBo2JvNaRe26syRZCGiesoWlsRaYa9AqwIqcYSKxPDPNKX55LyTVT1FxWwKwArNQ== X-Received: by 2002:a50:b832:: with SMTP id j47-v6mr4078253ede.272.1529016893767; Thu, 14 Jun 2018 15:54:53 -0700 (PDT) Received: from [10.44.128.75] ([161.12.40.153]) by smtp.gmail.com with ESMTPSA id t3-v6sm2827192edh.53.2018.06.14.15.54.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Jun 2018 15:54:52 -0700 (PDT) Subject: Re: svn commit: r335171 - head/sys/vm To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201806141941.w5EJf2qa069373@repo.freebsd.org> From: Steven Hartland Message-ID: Date: Thu, 14 Jun 2018 23:54:52 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <201806141941.w5EJf2qa069373@repo.freebsd.org> Content-Language: en-US Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 22:54:56 -0000 Out of interest, how would this exhibit itself? On 14/06/2018 20:41, Konstantin Belousov wrote: > Author: kib > Date: Thu Jun 14 19:41:02 2018 > New Revision: 335171 > URL: https://svnweb.freebsd.org/changeset/base/335171 > > Log: > Handle the race between fork/vm_object_split() and faults. > > If fault started before vmspace_fork() locked the map, and then during > fork, vm_map_copy_entry()->vm_object_split() is executed, it is > possible that the fault instantiate the page into the original object > when the page was already copied into the new object (see > vm_map_split() for the orig/new objects terminology). This can happen > if split found a busy page (e.g. from the fault) and slept dropping > the objects lock, which allows the swap pager to instantiate > read-behind pages for the fault. Then the restart of the scan can see > a page in the scanned range, where it was already copied to the upper > object. > > Fix it by instantiating the read-ahead pages before > swap_pager_getpages() method drops the lock to allocate pbuf. The > object scan would see the whole range prefilled with the busy pages > and not proceed the range. > > Note that vm_fault rechecks the map generation count after the object > unlock, so that it restarts the handling if raced with split, and > re-lookups the right page from the upper object. > > In collaboration with: alc > Tested by: pho > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > > Modified: > head/sys/vm/swap_pager.c > > Modified: head/sys/vm/swap_pager.c > ============================================================================== > --- head/sys/vm/swap_pager.c Thu Jun 14 19:01:40 2018 (r335170) > +++ head/sys/vm/swap_pager.c Thu Jun 14 19:41:02 2018 (r335171) > @@ -1096,21 +1096,24 @@ swap_pager_getpages(vm_object_t object, vm_page_t *ma, > int *rahead) > { > struct buf *bp; > - vm_page_t mpred, msucc, p; > + vm_page_t bm, mpred, msucc, p; > vm_pindex_t pindex; > daddr_t blk; > - int i, j, maxahead, maxbehind, reqcount, shift; > + int i, maxahead, maxbehind, reqcount; > > reqcount = count; > > - VM_OBJECT_WUNLOCK(object); > - bp = getpbuf(&nsw_rcount); > - VM_OBJECT_WLOCK(object); > - > - if (!swap_pager_haspage(object, ma[0]->pindex, &maxbehind, &maxahead)) { > - relpbuf(bp, &nsw_rcount); > + /* > + * Determine the final number of read-behind pages and > + * allocate them BEFORE releasing the object lock. Otherwise, > + * there can be a problematic race with vm_object_split(). > + * Specifically, vm_object_split() might first transfer pages > + * that precede ma[0] in the current object to a new object, > + * and then this function incorrectly recreates those pages as > + * read-behind pages in the current object. > + */ > + if (!swap_pager_haspage(object, ma[0]->pindex, &maxbehind, &maxahead)) > return (VM_PAGER_FAIL); > - } > > /* > * Clip the readahead and readbehind ranges to exclude resident pages. > @@ -1132,35 +1135,31 @@ swap_pager_getpages(vm_object_t object, vm_page_t *ma, > *rbehind = pindex - mpred->pindex - 1; > } > > + bm = ma[0]; > + for (i = 0; i < count; i++) > + ma[i]->oflags |= VPO_SWAPINPROG; > + > /* > * Allocate readahead and readbehind pages. > */ > - shift = rbehind != NULL ? *rbehind : 0; > - if (shift != 0) { > - for (i = 1; i <= shift; i++) { > + if (rbehind != NULL) { > + for (i = 1; i <= *rbehind; i++) { > p = vm_page_alloc(object, ma[0]->pindex - i, > VM_ALLOC_NORMAL); > - if (p == NULL) { > - /* Shift allocated pages to the left. */ > - for (j = 0; j < i - 1; j++) > - bp->b_pages[j] = > - bp->b_pages[j + shift - i + 1]; > + if (p == NULL) > break; > - } > - bp->b_pages[shift - i] = p; > + p->oflags |= VPO_SWAPINPROG; > + bm = p; > } > - shift = i - 1; > - *rbehind = shift; > + *rbehind = i - 1; > } > - for (i = 0; i < reqcount; i++) > - bp->b_pages[i + shift] = ma[i]; > if (rahead != NULL) { > for (i = 0; i < *rahead; i++) { > p = vm_page_alloc(object, > ma[reqcount - 1]->pindex + i + 1, VM_ALLOC_NORMAL); > if (p == NULL) > break; > - bp->b_pages[shift + reqcount + i] = p; > + p->oflags |= VPO_SWAPINPROG; > } > *rahead = i; > } > @@ -1171,15 +1170,18 @@ swap_pager_getpages(vm_object_t object, vm_page_t *ma, > > vm_object_pip_add(object, count); > > - for (i = 0; i < count; i++) > - bp->b_pages[i]->oflags |= VPO_SWAPINPROG; > - > - pindex = bp->b_pages[0]->pindex; > + pindex = bm->pindex; > blk = swp_pager_meta_ctl(object, pindex, 0); > KASSERT(blk != SWAPBLK_NONE, > ("no swap blocking containing %p(%jx)", object, (uintmax_t)pindex)); > > VM_OBJECT_WUNLOCK(object); > + bp = getpbuf(&nsw_rcount); > + /* Pages cannot leave the object while busy. */ > + for (i = 0, p = bm; i < count; i++, p = TAILQ_NEXT(p, listq)) { > + MPASS(p->pindex == bm->pindex + i); > + bp->b_pages[i] = p; > + } > > bp->b_flags |= B_PAGING; > bp->b_iocmd = BIO_READ; > From owner-svn-src-head@freebsd.org Thu Jun 14 23:07:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB5981015D27; Thu, 14 Jun 2018 23:07:21 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [198.45.61.253]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 48A8F696ED; Thu, 14 Jun 2018 23:07:21 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id w5EN7DbU053120 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 14 Jun 2018 16:07:13 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w5EN7Dsx053119; Thu, 14 Jun 2018 16:07:13 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 14 Jun 2018 16:07:13 -0700 From: Gleb Smirnoff To: Matt Macy Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334960 - head/sys/kern Message-ID: <20180614230713.GV1005@FreeBSD.org> References: <201806111631.w5BGVh2M051386@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201806111631.w5BGVh2M051386@repo.freebsd.org> User-Agent: Mutt/1.9.5 (2018-04-13) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 23:07:21 -0000 Hi, On Mon, Jun 11, 2018 at 04:31:43PM +0000, Matt Macy wrote: M> Author: mmacy M> Date: Mon Jun 11 16:31:42 2018 M> New Revision: 334960 M> URL: https://svnweb.freebsd.org/changeset/base/334960 M> M> Log: M> soreceive_stream: correctly handle edge cases M> M> - non NULL controlp is not an error, returning EINVAL M> would cause X forwarding to fail Can you please provide reference for a code that uses control messages with a stream socket? The removed return was in action since FreeBSD 7.0 and everything with X forwarding was working, AFAIK. -- Gleb Smirnoff From owner-svn-src-head@freebsd.org Thu Jun 14 23:08:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E05981015EAA; Thu, 14 Jun 2018 23:08:02 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mx0a-0010f301.pphosted.com (mx0a-0010f301.pphosted.com [148.163.149.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.pphosted.com", Issuer "thawte SHA256 SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7722169857; Thu, 14 Jun 2018 23:08:02 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pps.filterd (m0102855.ppops.net [127.0.0.1]) by mx0b-0010f301.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w5EN65Kv015724; Thu, 14 Jun 2018 18:07:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rice.edu; h=content-type : mime-version : subject : from : in-reply-to : date : cc : message-id : references : to; s=ricemail; bh=DPkbmqDW5AmlUYyOtbckxmoi7N5NEob17KTlkXNmjFA=; b=VqiTSSmKsajElWxap0N9Tb0b+vVXxvKIjLj71iuGpbobFCMlgP1WrXzgFJIfjQVx9tjk hCnv80ZbhG3ZGqrdoqNICWFTj3eU/zSGB+kgPZNIbjh3Ku5WajPOou/b3kPOL0uMfhHM cXoDoKBSLDnZ2whuBUrI05K98SwfPPKtWEwIWfLyPD4Zq45z24nrGKPk97x6zXNDHwjW vXDPgigoUztUFv9pk23/b7SbDQOHrMLgsQM1ymDn/33uM5/OFNwXyzRcWKpX2qXctIYN WGaJH4anQRljuf++iEDSwlgzpB6ezdwbIWog5IwQg9tNNt24l6q88rruYFAf7yWoI7Qh 4A== Received: from mh11.mail.rice.edu (mh11.mail.rice.edu [128.42.199.30]) by mx0b-0010f301.pphosted.com with ESMTP id 2jm0xtr1fr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Jun 2018 18:07:54 -0500 Received-X: from mh11.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh11.mail.rice.edu (Postfix) with ESMTP id 222CC4C04EB; Thu, 14 Jun 2018 18:07:54 -0500 (CDT) Received-X: from mh11.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh11.mail.rice.edu (Postfix) with ESMTP id 20A084C04EA; Thu, 14 Jun 2018 18:07:54 -0500 (CDT) X-Virus-Scanned: by amavis-2.7.0 at mh11.mail.rice.edu, auth channel Received-X: from mh11.mail.rice.edu ([127.0.0.1]) by mh11.mail.rice.edu (mh11.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id yk1wStTNxjtK; Thu, 14 Jun 2018 18:07:53 -0500 (CDT) Received: from alans-mbp-3.dyndns.rice.edu (alans-mbp-3.dyndns.rice.edu [10.87.78.14]) (using TLSv1.2 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: alc) by mh11.mail.rice.edu (Postfix) with ESMTPSA id E06E64C02B9; Thu, 14 Jun 2018 18:07:53 -0500 (CDT) Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r335171 - head/sys/vm From: Alan Cox In-Reply-To: Date: Thu, 14 Jun 2018 18:07:52 -0500 Cc: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201806141941.w5EJf2qa069373@repo.freebsd.org> To: Steven Hartland X-Mailer: Apple Mail (2.3124) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-06-14_10:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1806140254 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 23:08:03 -0000 > On Jun 14, 2018, at 5:54 PM, Steven Hartland = wrote: >=20 > Out of interest, how would this exhibit itself? >=20 A panic in vm_page_insert_after(). > On 14/06/2018 20:41, Konstantin Belousov wrote: >> Author: kib >> Date: Thu Jun 14 19:41:02 2018 >> New Revision: 335171 >> URL: https://svnweb.freebsd.org/changeset/base/335171 = >>=20 >> Log: >> Handle the race between fork/vm_object_split() and faults. >> =20 >> If fault started before vmspace_fork() locked the map, and then = during >> fork, vm_map_copy_entry()->vm_object_split() is executed, it is >> possible that the fault instantiate the page into the original = object >> when the page was already copied into the new object (see >> vm_map_split() for the orig/new objects terminology). This can = happen >> if split found a busy page (e.g. from the fault) and slept dropping >> the objects lock, which allows the swap pager to instantiate >> read-behind pages for the fault. Then the restart of the scan can = see >> a page in the scanned range, where it was already copied to the = upper >> object. >> =20 >> Fix it by instantiating the read-ahead pages before >> swap_pager_getpages() method drops the lock to allocate pbuf. The >> object scan would see the whole range prefilled with the busy pages >> and not proceed the range. >> =20 >> Note that vm_fault rechecks the map generation count after the = object >> unlock, so that it restarts the handling if raced with split, and >> re-lookups the right page from the upper object. >> =20 >> In collaboration with: alc >> Tested by: pho >> Sponsored by: The FreeBSD Foundation >> MFC after: 1 week >>=20 >> Modified: >> head/sys/vm/swap_pager.c >>=20 >> Modified: head/sys/vm/swap_pager.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/vm/swap_pager.c Thu Jun 14 19:01:40 2018 = (r335170) >> +++ head/sys/vm/swap_pager.c Thu Jun 14 19:41:02 2018 = (r335171) >> @@ -1096,21 +1096,24 @@ swap_pager_getpages(vm_object_t object, = vm_page_t *ma, >> int *rahead) >> { >> struct buf *bp; >> - vm_page_t mpred, msucc, p; >> + vm_page_t bm, mpred, msucc, p; >> vm_pindex_t pindex; >> daddr_t blk; >> - int i, j, maxahead, maxbehind, reqcount, shift; >> + int i, maxahead, maxbehind, reqcount; >> =20 >> reqcount =3D count; >> =20 >> - VM_OBJECT_WUNLOCK(object); >> - bp =3D getpbuf(&nsw_rcount); >> - VM_OBJECT_WLOCK(object); >> - >> - if (!swap_pager_haspage(object, ma[0]->pindex, &maxbehind, = &maxahead)) { >> - relpbuf(bp, &nsw_rcount); >> + /* >> + * Determine the final number of read-behind pages and >> + * allocate them BEFORE releasing the object lock. Otherwise, >> + * there can be a problematic race with vm_object_split(). >> + * Specifically, vm_object_split() might first transfer pages >> + * that precede ma[0] in the current object to a new object, >> + * and then this function incorrectly recreates those pages as >> + * read-behind pages in the current object. >> + */ >> + if (!swap_pager_haspage(object, ma[0]->pindex, &maxbehind, = &maxahead)) >> return (VM_PAGER_FAIL); >> - } >> =20 >> /* >> * Clip the readahead and readbehind ranges to exclude resident = pages. >> @@ -1132,35 +1135,31 @@ swap_pager_getpages(vm_object_t object, = vm_page_t *ma, >> *rbehind =3D pindex - mpred->pindex - 1; >> } >> =20 >> + bm =3D ma[0]; >> + for (i =3D 0; i < count; i++) >> + ma[i]->oflags |=3D VPO_SWAPINPROG; >> + >> /* >> * Allocate readahead and readbehind pages. >> */ >> - shift =3D rbehind !=3D NULL ? *rbehind : 0; >> - if (shift !=3D 0) { >> - for (i =3D 1; i <=3D shift; i++) { >> + if (rbehind !=3D NULL) { >> + for (i =3D 1; i <=3D *rbehind; i++) { >> p =3D vm_page_alloc(object, ma[0]->pindex - i, >> VM_ALLOC_NORMAL); >> - if (p =3D=3D NULL) { >> - /* Shift allocated pages to the left. */ >> - for (j =3D 0; j < i - 1; j++) >> - bp->b_pages[j] =3D >> - bp->b_pages[j + shift - i + = 1]; >> + if (p =3D=3D NULL) >> break; >> - } >> - bp->b_pages[shift - i] =3D p; >> + p->oflags |=3D VPO_SWAPINPROG; >> + bm =3D p; >> } >> - shift =3D i - 1; >> - *rbehind =3D shift; >> + *rbehind =3D i - 1; >> } >> - for (i =3D 0; i < reqcount; i++) >> - bp->b_pages[i + shift] =3D ma[i]; >> if (rahead !=3D NULL) { >> for (i =3D 0; i < *rahead; i++) { >> p =3D vm_page_alloc(object, >> ma[reqcount - 1]->pindex + i + 1, = VM_ALLOC_NORMAL); >> if (p =3D=3D NULL) >> break; >> - bp->b_pages[shift + reqcount + i] =3D p; >> + p->oflags |=3D VPO_SWAPINPROG; >> } >> *rahead =3D i; >> } >> @@ -1171,15 +1170,18 @@ swap_pager_getpages(vm_object_t object, = vm_page_t *ma, >> =20 >> vm_object_pip_add(object, count); >> =20 >> - for (i =3D 0; i < count; i++) >> - bp->b_pages[i]->oflags |=3D VPO_SWAPINPROG; >> - >> - pindex =3D bp->b_pages[0]->pindex; >> + pindex =3D bm->pindex; >> blk =3D swp_pager_meta_ctl(object, pindex, 0); >> KASSERT(blk !=3D SWAPBLK_NONE, >> ("no swap blocking containing %p(%jx)", object, = (uintmax_t)pindex)); >> =20 >> VM_OBJECT_WUNLOCK(object); >> + bp =3D getpbuf(&nsw_rcount); >> + /* Pages cannot leave the object while busy. */ >> + for (i =3D 0, p =3D bm; i < count; i++, p =3D TAILQ_NEXT(p, = listq)) { >> + MPASS(p->pindex =3D=3D bm->pindex + i); >> + bp->b_pages[i] =3D p; >> + } >> =20 >> bp->b_flags |=3D B_PAGING; >> bp->b_iocmd =3D BIO_READ; >>=20 >=20 From owner-svn-src-head@freebsd.org Thu Jun 14 23:10:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9B9A10162C6; Thu, 14 Jun 2018 23:10:11 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F9BE69A68; Thu, 14 Jun 2018 23:10:11 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 78E74748C; Thu, 14 Jun 2018 23:10:11 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5ENABEw074458; Thu, 14 Jun 2018 23:10:11 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5ENABG6074457; Thu, 14 Jun 2018 23:10:11 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201806142310.w5ENABG6074457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Thu, 14 Jun 2018 23:10:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335182 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: cognet X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 335182 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 23:10:12 -0000 Author: cognet Date: Thu Jun 14 23:10:10 2018 New Revision: 335182 URL: https://svnweb.freebsd.org/changeset/base/335182 Log: Use M_EXEC when calling malloc() to allocate the memory to store the module, as it'll contain executable code. Modified: head/sys/kern/link_elf.c Modified: head/sys/kern/link_elf.c ============================================================================== --- head/sys/kern/link_elf.c Thu Jun 14 22:31:30 2018 (r335181) +++ head/sys/kern/link_elf.c Thu Jun 14 23:10:10 2018 (r335182) @@ -945,7 +945,7 @@ link_elf_load_file(linker_class_t cls, const char* fil goto out; } #else - ef->address = malloc(mapsize, M_LINKER, M_WAITOK); + ef->address = malloc(mapsize, M_LINKER, M_EXEC | M_WAITOK); #endif mapbase = ef->address; From owner-svn-src-head@freebsd.org Thu Jun 14 23:12:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B81D1016734; Thu, 14 Jun 2018 23:12:02 +0000 (UTC) (envelope-from cognet@ci0.org) Received: from kanar.ci0.org (kanar.ci0.org [IPv6:2001:bc8:35e6::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "sd-123398", Issuer "sd-123398" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0793669E47; Thu, 14 Jun 2018 23:12:01 +0000 (UTC) (envelope-from cognet@ci0.org) Received: from kanar.ci0.org (localhost [127.0.0.1]) by kanar.ci0.org (8.15.2/8.15.2) with ESMTPS id w5ENBvac071055 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 15 Jun 2018 01:11:58 +0200 (CEST) (envelope-from cognet@ci0.org) Received: (from doginou@localhost) by kanar.ci0.org (8.15.2/8.15.2/Submit) id w5ENBvHK071054; Fri, 15 Jun 2018 01:11:57 +0200 (CEST) (envelope-from cognet@ci0.org) X-Authentication-Warning: kanar.ci0.org: doginou set sender to cognet@ci0.org using -f Date: Fri, 15 Jun 2018 01:11:57 +0200 From: Olivier Houchard To: Emmanuel Vadot Cc: "Jonathan T. Looney" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335068 - in head: share/man/man9 sys/amd64/amd64 sys/i386/i386 sys/kern sys/net sys/sys sys/vm Message-ID: <20180614231157.GA70834@ci0.org> References: <201806131704.w5DH4gLv048134@repo.freebsd.org> <20180615002336.fcb966efe812cd60af59f68f@bidouilliste.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180615002336.fcb966efe812cd60af59f68f@bidouilliste.com> User-Agent: Mutt/1.8.0 (2017-02-23) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 23:12:02 -0000 Hi, On Fri, Jun 15, 2018 at 12:23:36AM +0200, Emmanuel Vadot wrote: > > Hi Jonathan, > [...] > This brake module loading on armv7 and arm64 > kevans log on armv7 : > https://gist.github.com/kevans91/d0ffcd6c94a0e4cdfdc5433612fce2e8 > mine on arm64 : http://dpaste.com/3VVBZDV > > Do you have any idea what could cause that ? Is any MD stuff is > missing for those arches ? > > Thanks, > I think I fixed it with r335182. Jonathan probably missed it because modules are differnt on amd64 (and mips), and the code that handles those are different, and doesn't use malloc(). Regards, Olivier From owner-svn-src-head@freebsd.org Thu Jun 14 23:13:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBDF61016A72; Thu, 14 Jun 2018 23:13:42 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mx0a-0010f301.pphosted.com (mx0a-0010f301.pphosted.com [148.163.149.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.pphosted.com", Issuer "thawte SHA256 SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 82AF76A06A; Thu, 14 Jun 2018 23:13:42 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pps.filterd (m0102855.ppops.net [127.0.0.1]) by mx0b-0010f301.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w5ENAYeG019541; Thu, 14 Jun 2018 18:13:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rice.edu; h=content-type : mime-version : subject : from : in-reply-to : date : cc : message-id : references : to; s=ricemail; bh=JPzN9akPw6lyn1qQuBXdrgHBj0ME1UDbu2Pn46nvoB8=; b=BeZkim+2pdCzrZ+7lyjz14rZzWKUVNAOWbMqrjZCD+wW+ywRVSQYAHCdhAw8i6oDxBnV 9dQzQ53hqNKhpfrQQhlm9BzhmtbmxqeplYlZbX5gQWapxS0+LeY80ljvdjiKkcDptvKH nlFId7F34tlAkEMOu6Sn+fwG5RAywMi6yfYQf+arCi8Hj+r8lZrGrGKY5YFa08bf9pB7 vr8xnHU7Kk5zXnnnTCj+ZC46OOY761ARYyxqPhmIKHgWkYkk97cMU+ipZgqXc6kMjsgR wQyjon49IWEO7jvMrjkRYmLelBkJeLYUmWbi9l4G9jm80qoZb8R9bxcDgAOOyjc58UVT zQ== Received: from mh3.mail.rice.edu (mh3.mail.rice.edu [128.42.199.10]) by mx0b-0010f301.pphosted.com with ESMTP id 2jm0xtr1kk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Jun 2018 18:13:40 -0500 Received-X: from mh3.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh3.mail.rice.edu (Postfix) with ESMTP id 245FD4017F; Thu, 14 Jun 2018 18:13:40 -0500 (CDT) Received-X: from mh3.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh3.mail.rice.edu (Postfix) with ESMTP id 5F888401D6; Thu, 14 Jun 2018 18:13:39 -0500 (CDT) X-Virus-Scanned: by amavis-2.7.0 at mh3.mail.rice.edu, auth channel Received-X: from mh3.mail.rice.edu ([127.0.0.1]) by mh3.mail.rice.edu (mh3.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id TtSGAGrCtmOZ; Thu, 14 Jun 2018 18:13:38 -0500 (CDT) Received: from alans-mbp-3.dyndns.rice.edu (alans-mbp-3.dyndns.rice.edu [10.87.78.14]) (using TLSv1.2 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: alc) by mh3.mail.rice.edu (Postfix) with ESMTPSA id CD4D9401D4; Thu, 14 Jun 2018 18:13:38 -0500 (CDT) Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r335171 - head/sys/vm From: Alan Cox In-Reply-To: Date: Thu, 14 Jun 2018 18:13:37 -0500 Cc: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <2DA5B980-1703-463C-80E1-B8430BFA2A38@rice.edu> References: <201806141941.w5EJf2qa069373@repo.freebsd.org> To: Steven Hartland X-Mailer: Apple Mail (2.3124) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-06-14_10:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1806140255 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 23:13:43 -0000 > On Jun 14, 2018, at 6:07 PM, Alan Cox wrote: >=20 >=20 >> On Jun 14, 2018, at 5:54 PM, Steven Hartland = > wrote: >>=20 >> Out of interest, how would this exhibit itself? >>=20 >=20 > A panic in vm_page_insert_after(). >=20 I should add that a non-debug kernel will panic a little later in = vm_radix_insert(). >> On 14/06/2018 20:41, Konstantin Belousov wrote: >>> Author: kib >>> Date: Thu Jun 14 19:41:02 2018 >>> New Revision: 335171 >>> URL: https://svnweb.freebsd.org/changeset/base/335171 = >>>=20 >>> Log: >>> Handle the race between fork/vm_object_split() and faults. >>> =20 >>> If fault started before vmspace_fork() locked the map, and then = during >>> fork, vm_map_copy_entry()->vm_object_split() is executed, it is >>> possible that the fault instantiate the page into the original = object >>> when the page was already copied into the new object (see >>> vm_map_split() for the orig/new objects terminology). This can = happen >>> if split found a busy page (e.g. from the fault) and slept = dropping >>> the objects lock, which allows the swap pager to instantiate >>> read-behind pages for the fault. Then the restart of the scan can = see >>> a page in the scanned range, where it was already copied to the = upper >>> object. >>> =20 >>> Fix it by instantiating the read-ahead pages before >>> swap_pager_getpages() method drops the lock to allocate pbuf. The >>> object scan would see the whole range prefilled with the busy = pages >>> and not proceed the range. >>> =20 >>> Note that vm_fault rechecks the map generation count after the = object >>> unlock, so that it restarts the handling if raced with split, and >>> re-lookups the right page from the upper object. >>> =20 >>> In collaboration with: alc >>> Tested by: pho >>> Sponsored by: The FreeBSD Foundation >>> MFC after: 1 week >>>=20 >>> Modified: >>> head/sys/vm/swap_pager.c >>>=20 >>> Modified: head/sys/vm/swap_pager.c >>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>> --- head/sys/vm/swap_pager.c Thu Jun 14 19:01:40 2018 = (r335170) >>> +++ head/sys/vm/swap_pager.c Thu Jun 14 19:41:02 2018 = (r335171) >>> @@ -1096,21 +1096,24 @@ swap_pager_getpages(vm_object_t object, = vm_page_t *ma, >>> int *rahead) >>> { >>> struct buf *bp; >>> - vm_page_t mpred, msucc, p; >>> + vm_page_t bm, mpred, msucc, p; >>> vm_pindex_t pindex; >>> daddr_t blk; >>> - int i, j, maxahead, maxbehind, reqcount, shift; >>> + int i, maxahead, maxbehind, reqcount; >>> =20 >>> reqcount =3D count; >>> =20 >>> - VM_OBJECT_WUNLOCK(object); >>> - bp =3D getpbuf(&nsw_rcount); >>> - VM_OBJECT_WLOCK(object); >>> - >>> - if (!swap_pager_haspage(object, ma[0]->pindex, &maxbehind, = &maxahead)) { >>> - relpbuf(bp, &nsw_rcount); >>> + /* >>> + * Determine the final number of read-behind pages and >>> + * allocate them BEFORE releasing the object lock. Otherwise, >>> + * there can be a problematic race with vm_object_split(). >>> + * Specifically, vm_object_split() might first transfer pages >>> + * that precede ma[0] in the current object to a new object, >>> + * and then this function incorrectly recreates those pages as >>> + * read-behind pages in the current object. >>> + */ >>> + if (!swap_pager_haspage(object, ma[0]->pindex, &maxbehind, = &maxahead)) >>> return (VM_PAGER_FAIL); >>> - } >>> =20 >>> /* >>> * Clip the readahead and readbehind ranges to exclude resident = pages. >>> @@ -1132,35 +1135,31 @@ swap_pager_getpages(vm_object_t object, = vm_page_t *ma, >>> *rbehind =3D pindex - mpred->pindex - 1; >>> } >>> =20 >>> + bm =3D ma[0]; >>> + for (i =3D 0; i < count; i++) >>> + ma[i]->oflags |=3D VPO_SWAPINPROG; >>> + >>> /* >>> * Allocate readahead and readbehind pages. >>> */ >>> - shift =3D rbehind !=3D NULL ? *rbehind : 0; >>> - if (shift !=3D 0) { >>> - for (i =3D 1; i <=3D shift; i++) { >>> + if (rbehind !=3D NULL) { >>> + for (i =3D 1; i <=3D *rbehind; i++) { >>> p =3D vm_page_alloc(object, ma[0]->pindex - i, >>> VM_ALLOC_NORMAL); >>> - if (p =3D=3D NULL) { >>> - /* Shift allocated pages to the left. */ >>> - for (j =3D 0; j < i - 1; j++) >>> - bp->b_pages[j] =3D >>> - bp->b_pages[j + shift - i + = 1]; >>> + if (p =3D=3D NULL) >>> break; >>> - } >>> - bp->b_pages[shift - i] =3D p; >>> + p->oflags |=3D VPO_SWAPINPROG; >>> + bm =3D p; >>> } >>> - shift =3D i - 1; >>> - *rbehind =3D shift; >>> + *rbehind =3D i - 1; >>> } >>> - for (i =3D 0; i < reqcount; i++) >>> - bp->b_pages[i + shift] =3D ma[i]; >>> if (rahead !=3D NULL) { >>> for (i =3D 0; i < *rahead; i++) { >>> p =3D vm_page_alloc(object, >>> ma[reqcount - 1]->pindex + i + 1, = VM_ALLOC_NORMAL); >>> if (p =3D=3D NULL) >>> break; >>> - bp->b_pages[shift + reqcount + i] =3D p; >>> + p->oflags |=3D VPO_SWAPINPROG; >>> } >>> *rahead =3D i; >>> } >>> @@ -1171,15 +1170,18 @@ swap_pager_getpages(vm_object_t object, = vm_page_t *ma, >>> =20 >>> vm_object_pip_add(object, count); >>> =20 >>> - for (i =3D 0; i < count; i++) >>> - bp->b_pages[i]->oflags |=3D VPO_SWAPINPROG; >>> - >>> - pindex =3D bp->b_pages[0]->pindex; >>> + pindex =3D bm->pindex; >>> blk =3D swp_pager_meta_ctl(object, pindex, 0); >>> KASSERT(blk !=3D SWAPBLK_NONE, >>> ("no swap blocking containing %p(%jx)", object, = (uintmax_t)pindex)); >>> =20 >>> VM_OBJECT_WUNLOCK(object); >>> + bp =3D getpbuf(&nsw_rcount); >>> + /* Pages cannot leave the object while busy. */ >>> + for (i =3D 0, p =3D bm; i < count; i++, p =3D TAILQ_NEXT(p, = listq)) { >>> + MPASS(p->pindex =3D=3D bm->pindex + i); >>> + bp->b_pages[i] =3D p; >>> + } >>> =20 >>> bp->b_flags |=3D B_PAGING; >>> bp->b_iocmd =3D BIO_READ; >>>=20 >>=20 >=20 From owner-svn-src-head@freebsd.org Thu Jun 14 23:49:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2989D101A90D; Thu, 14 Jun 2018 23:49:18 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D0D936BBEB; Thu, 14 Jun 2018 23:49:17 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-it0-f48.google.com (mail-it0-f48.google.com [209.85.214.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id 9853412E1A; Thu, 14 Jun 2018 23:49:17 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-it0-f48.google.com with SMTP id 188-v6so597491ita.5; Thu, 14 Jun 2018 16:49:17 -0700 (PDT) X-Gm-Message-State: APt69E3hYDp0zCfMM43J8m8ZFZ5QhqD5dAEgpP7KSrHYjl06YKvVNzn0 dVnxhKBYRngNxtjULYfflT3qb6WRbYfJbRZ8oBA= X-Google-Smtp-Source: ADUXVKJpLjMKvTkheGBupJ7QfvVKOaX5RF+1bng6i4Vh+0aUUr1D1see3pEyDOI2Q9oRLPtpH7+4l1Ty9R2gB987BsU= X-Received: by 2002:a24:459f:: with SMTP id c31-v6mr4177943itd.132.1529020157074; Thu, 14 Jun 2018 16:49:17 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:8cd:0:0:0:0:0 with HTTP; Thu, 14 Jun 2018 16:49:16 -0700 (PDT) In-Reply-To: <20180614230713.GV1005@FreeBSD.org> References: <201806111631.w5BGVh2M051386@repo.freebsd.org> <20180614230713.GV1005@FreeBSD.org> From: Matthew Macy Date: Thu, 14 Jun 2018 16:49:16 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334960 - head/sys/kern To: Gleb Smirnoff Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 23:49:18 -0000 diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 2d6dc845938..35bcad41a59 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -2175,6 +2175,7 @@ soreceive_stream(struct socket *so, struct sockaddr **psa, struct uio *uio, struct sockbuf *sb; struct mbuf *m, *n = NULL; + MPASS(controlp == NULL); /* We only do stream sockets. */ if (so->so_type != SOCK_STREAM) return (EINVAL); mmacy@VogonPoetry [~|16:38|56] ssh -Y 192.168.1.40 Edit /etc/motd to change this login announcement. mmacy@entropy [~|16:40|1] xterm & #14 0xffffffff80bcf580 in soreceive_stream (so=0xfffff800441fb790, psa=0xfffffe09b09b7758, uio=0xfffffe09b09b7790, mp0=0x0, controlp=0xfffffe09b09b7778, flagsp=0xfffffe09b09b78f4) at /usr/home/mmacy/devel/freebsd/sys/kern/uipc_socket.c:2178 #15 0xffffffff80bd0ba2 in soreceive (so=0xfffff800441fb790, psa=0xfffffe09b09b7758, uio=0xfffffe09b09b7790, mp0=0x0, controlp=0xfffffe09b09b7778, flagsp=0xfffffe09b09b78f4) at /usr/home/mmacy/devel/freebsd/sys/kern/uipc_socket.c:2567 #16 0xffffffff80bd8e06 in kern_recvit (td=0xfffff8000c8ee000, s=3, mp=0xfffffe09b09b78c8, fromseg=UIO_USERSPACE, controlp=0x0) at /usr/home/mmacy/devel/freebsd/sys/kern/uipc_syscalls.c:945 #17 0xffffffff80bd93c7 in recvit (td=0xfffff8000c8ee000, s=3, mp=0xfffffe09b09b78c8, namelenp=0x0) at /usr/home/mmacy/devel/freebsd/sys/kern/uipc_syscalls.c:1053 #18 0xffffffff80bd9515 in sys_recvmsg (td=0xfffff8000c8ee000, uap=0xfffff8000c8ee3c0) at /usr/home/mmacy/devel/freebsd/sys/kern/uipc_syscalls.c:1169 #19 0xffffffff810cde03 in syscallenter (td=0xfffff8000c8ee000) at /usr/home/mmacy/devel/freebsd/sys/amd64/amd64/../../kern/subr_syscall.c:135 #20 0xffffffff810cd64d in amd64_syscall (td=0xfffff8000c8ee000, traced=0) at /usr/home/mmacy/devel/freebsd/sys/amd64/amd64/trap.c:1007 #16 0xffffffff80bd8e06 in kern_recvit (td=0xfffff8000c8ee000, s=3, mp=0xfffffe09b09b78c8, fromseg=UIO_USERSPACE, controlp=0x0) at /usr/home/mmacy/devel/freebsd/sys/kern/uipc_syscalls.c:945 945 error = soreceive(so, &fromsa, &auio, NULL, (kgdb) list 940 #ifdef KTRACE 941 if (KTRPOINT(td, KTR_GENIO)) 942 ktruio = cloneuio(&auio); 943 #endif 944 len = auio.uio_resid; 945 error = soreceive(so, &fromsa, &auio, NULL, 946 (mp->msg_control || controlp) ? &control : NULL, 947 &mp->msg_flags); 948 if (error != 0) { 949 if (auio.uio_resid != len && (error == ERESTART || (kgdb) p mp->msg_control $1 = (void *) 0x7fffffffe2e0 int sys_recvmsg(struct thread *td, struct recvmsg_args *uap) { struct msghdr msg; struct iovec *uiov, *iov; int error; error = copyin(uap->msg, &msg, sizeof (msg)); if (error != 0) return (error); .... TL;DR X is passing in a msghdr with a control pointer. It isn't used for anything but returning EINVAL for it is a bug. -M On Thu, Jun 14, 2018 at 4:07 PM, Gleb Smirnoff wrote: > Hi, > > On Mon, Jun 11, 2018 at 04:31:43PM +0000, Matt Macy wrote: > M> Author: mmacy > M> Date: Mon Jun 11 16:31:42 2018 > M> New Revision: 334960 > M> URL: https://svnweb.freebsd.org/changeset/base/334960 > M> > M> Log: > M> soreceive_stream: correctly handle edge cases > M> > M> - non NULL controlp is not an error, returning EINVAL > M> would cause X forwarding to fail > > Can you please provide reference for a code that uses > control messages with a stream socket? > > The removed return was in action since FreeBSD 7.0 and > everything with X forwarding was working, AFAIK. > > -- > Gleb Smirnoff From owner-svn-src-head@freebsd.org Fri Jun 15 00:36:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B110A101FFC6; Fri, 15 Jun 2018 00:36:42 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 61C716DA5C; Fri, 15 Jun 2018 00:36:42 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 42F8010316; Fri, 15 Jun 2018 00:36:42 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5F0ageL021174; Fri, 15 Jun 2018 00:36:42 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5F0aga1021173; Fri, 15 Jun 2018 00:36:42 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201806150036.w5F0aga1021173@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 15 Jun 2018 00:36:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335183 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 335183 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 00:36:42 -0000 Author: bdrewery Date: Fri Jun 15 00:36:41 2018 New Revision: 335183 URL: https://svnweb.freebsd.org/changeset/base/335183 Log: proc0_post: Fix some locking issues - Filter out PRS_NEW procs as rufetch() tries taking the thread lock which may not yet be initialized. - Hold PROC_LOCK to ensure stability of iterating the threads. - p_rux fields are protected by the process statlock as well. MFC after: 2 weeks Reviewed by: kib Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D15809 Modified: head/sys/kern/init_main.c Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Thu Jun 14 23:10:10 2018 (r335182) +++ head/sys/kern/init_main.c Fri Jun 15 00:36:41 2018 (r335183) @@ -618,17 +618,23 @@ proc0_post(void *dummy __unused) */ sx_slock(&allproc_lock); FOREACH_PROC_IN_SYSTEM(p) { + PROC_LOCK(p); + if (p->p_state == PRS_NEW) { + PROC_UNLOCK(p); + continue; + } microuptime(&p->p_stats->p_start); PROC_STATLOCK(p); rufetch(p, &ru); /* Clears thread stats */ - PROC_STATUNLOCK(p); p->p_rux.rux_runtime = 0; p->p_rux.rux_uticks = 0; p->p_rux.rux_sticks = 0; p->p_rux.rux_iticks = 0; + PROC_STATUNLOCK(p); FOREACH_THREAD_IN_PROC(p, td) { td->td_runtime = 0; } + PROC_UNLOCK(p); } sx_sunlock(&allproc_lock); PCPU_SET(switchtime, cpu_ticks()); From owner-svn-src-head@freebsd.org Fri Jun 15 02:28:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F51310087E8; Fri, 15 Jun 2018 02:28:37 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4602871B67; Fri, 15 Jun 2018 02:28:37 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 233DC114B3; Fri, 15 Jun 2018 02:28:37 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5F2SaEw076446; Fri, 15 Jun 2018 02:28:36 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5F2SaMG076445; Fri, 15 Jun 2018 02:28:36 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806150228.w5F2SaMG076445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 15 Jun 2018 02:28:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335186 - head/sys/dev/coretemp X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/dev/coretemp X-SVN-Commit-Revision: 335186 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 02:28:37 -0000 Author: mmacy Date: Fri Jun 15 02:28:36 2018 New Revision: 335186 URL: https://svnweb.freebsd.org/changeset/base/335186 Log: Quiet coretemp probe Only the first device will print coretemp0: numa-domain 0 on cpu0 instead of all hyper threads Submitted by: kbowling Reviewed by: imp, sbruno Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D15727 Modified: head/sys/dev/coretemp/coretemp.c Modified: head/sys/dev/coretemp/coretemp.c ============================================================================== --- head/sys/dev/coretemp/coretemp.c Fri Jun 15 00:54:03 2018 (r335185) +++ head/sys/dev/coretemp/coretemp.c Fri Jun 15 02:28:36 2018 (r335186) @@ -145,6 +145,9 @@ coretemp_probe(device_t dev) device_set_desc(dev, "CPU On-Die Thermal Sensors"); + if (!bootverbose && device_get_unit(dev) != 0) + device_quiet(dev); + return (BUS_PROBE_GENERIC); } From owner-svn-src-head@freebsd.org Fri Jun 15 02:35:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BD351009472; Fri, 15 Jun 2018 02:35:24 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F0235721F2; Fri, 15 Jun 2018 02:35:23 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: by mail-wm0-f68.google.com with SMTP id z6-v6so5145264wma.0; Thu, 14 Jun 2018 19:35:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3YddyUFWzutdGAzfNHeeAEgwTnBxqI8YJYFWRr+qjE0=; b=crorEneQ2BKHi2AEXr8m+4t5WAYpi/Jkn8gAyCy2aGrYw5bLxVobNzJCr+Di96pW3P uUiZuBgIMMfrzNkIBRqVJ5NztEwMqz+utcTXLaojLO71sCvlG8vIhXeOlHQStUWir06j ymQfBWPSnsAriuu00VNu429aC9/QEXufqcrvxEJTm3BjkPUOiw1lKQtPvtKgUbTHQ+Vd VkrjNfvAHIjcAv99mrASLB9Q+6Btw5UrvrfhD2UPyMto6Sz/ot+Q3eXZwT7CV6rvChqz 4jwta12bnBELs/a2ooxBQfJIQr8FqirOgUanKzhWov0WOMFRGLWqbGBhsnRzf0ievU9i 0gJQ== X-Gm-Message-State: APt69E0siMmR89VstnywMkF7huFK3Rkhdm+MdyiD8HCKfRkLoCHDTRYH LAo82EoqjC4rTpCHY7PAWWCaKydT X-Google-Smtp-Source: ADUXVKKnU66q3SewgMo6T3DFy3lKZe6OsycuqLtFfNEw9QGNu21UKsF6UG1dBrv7xHvgfPv3r23drA== X-Received: by 2002:a50:c182:: with SMTP id m2-v6mr54475edf.249.1529028299635; Thu, 14 Jun 2018 19:04:59 -0700 (PDT) Received: from mail-wr0-f175.google.com (mail-wr0-f175.google.com. [209.85.128.175]) by smtp.gmail.com with ESMTPSA id x15-v6sm3119465edd.90.2018.06.14.19.04.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Jun 2018 19:04:59 -0700 (PDT) Received: by mail-wr0-f175.google.com with SMTP id h10-v6so8309257wrq.8; Thu, 14 Jun 2018 19:04:59 -0700 (PDT) X-Received: by 2002:adf:fa07:: with SMTP id m7-v6mr4540462wrr.228.1529028299039; Thu, 14 Jun 2018 19:04:59 -0700 (PDT) MIME-Version: 1.0 References: <201806131704.w5DH4gLv048134@repo.freebsd.org> <20180615002336.fcb966efe812cd60af59f68f@bidouilliste.com> <20180614231157.GA70834@ci0.org> In-Reply-To: <20180614231157.GA70834@ci0.org> From: "Jonathan T. Looney" Date: Thu, 14 Jun 2018 22:04:47 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335068 - in head: share/man/man9 sys/amd64/amd64 sys/i386/i386 sys/kern sys/net sys/sys sys/vm To: cognet@ci0.org Cc: manu@bidouilliste.com, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 02:35:24 -0000 On Thu, Jun 14, 2018 at 7:12 PM Olivier Houchard wrote: > On Fri, Jun 15, 2018 at 12:23:36AM +0200, Emmanuel Vadot wrote: > > This brake module loading on armv7 and arm64 > > I think I fixed it with r335182. > Jonathan probably missed it because modules are differnt on amd64 (and > mips), and the code that handles those are different, and doesn't use > malloc(). > Hi Olivier, Thanks for fixing that! FWIW, I do have plans to make some further enhancements to fine-tune the permissions used for kernel modules. Once I have a patch, I would appreciate it if a few of the people impacted by this change would be willing to test it. Jonathan From owner-svn-src-head@freebsd.org Fri Jun 15 03:28:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E91C8100E53F; Fri, 15 Jun 2018 03:28:05 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F9D07417B; Fri, 15 Jun 2018 03:28:05 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 80F6311EB2; Fri, 15 Jun 2018 03:28:05 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5F3S5Vk008295; Fri, 15 Jun 2018 03:28:05 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5F3S5eR008294; Fri, 15 Jun 2018 03:28:05 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201806150328.w5F3S5eR008294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 15 Jun 2018 03:28:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335187 - head/sys/dev/ofw X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/dev/ofw X-SVN-Commit-Revision: 335187 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 03:28:06 -0000 Author: jhibbits Date: Fri Jun 15 03:28:05 2018 New Revision: 335187 URL: https://svnweb.freebsd.org/changeset/base/335187 Log: ofw_reg_to_paddr(): Fix minor typo in KASSERT message Modified: head/sys/dev/ofw/ofw_subr.c Modified: head/sys/dev/ofw/ofw_subr.c ============================================================================== --- head/sys/dev/ofw/ofw_subr.c Fri Jun 15 02:28:36 2018 (r335186) +++ head/sys/dev/ofw/ofw_subr.c Fri Jun 15 03:28:05 2018 (r335187) @@ -170,7 +170,7 @@ ofw_reg_to_paddr(phandle_t dev, int regno, bus_addr_t } KASSERT(addr <= BUS_SPACE_MAXADDR, - ("Bus sddress is too large: %jx", (uintmax_t)addr)); + ("Bus address is too large: %jx", (uintmax_t)addr)); KASSERT(size <= BUS_SPACE_MAXSIZE, ("Bus size is too large: %jx", (uintmax_t)size)); From owner-svn-src-head@freebsd.org Fri Jun 15 03:31:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86318100EBA1; Fri, 15 Jun 2018 03:31:31 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D08674640; Fri, 15 Jun 2018 03:31:31 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D66111F05; Fri, 15 Jun 2018 03:31:31 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5F3VU5n010011; Fri, 15 Jun 2018 03:31:30 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5F3VUZ2010010; Fri, 15 Jun 2018 03:31:30 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201806150331.w5F3VUZ2010010@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 15 Jun 2018 03:31:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335188 - head/usr.bin/grep X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/grep X-SVN-Commit-Revision: 335188 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 03:31:31 -0000 Author: kevans Date: Fri Jun 15 03:31:30 2018 New Revision: 335188 URL: https://svnweb.freebsd.org/changeset/base/335188 Log: bsdgrep(1): Remove redundant initialization; unconditionally assigned later Modified: head/usr.bin/grep/util.c Modified: head/usr.bin/grep/util.c ============================================================================== --- head/usr.bin/grep/util.c Fri Jun 15 03:28:05 2018 (r335187) +++ head/usr.bin/grep/util.c Fri Jun 15 03:31:30 2018 (r335188) @@ -317,7 +317,6 @@ procfile(const char *fn) pc.cntlines = false; memset(&mc, 0, sizeof(mc)); mc.printmatch = true; - line_matched = false; if ((pc.binary && binbehave == BINFILE_BIN) || cflag || qflag || lflag || Lflag) mc.printmatch = false; From owner-svn-src-head@freebsd.org Fri Jun 15 04:34:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F88B1015644; Fri, 15 Jun 2018 04:34:52 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 4527476E06; Fri, 15 Jun 2018 04:34:50 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 1E4F43CCEB0; Fri, 15 Jun 2018 14:34:47 +1000 (AEST) Date: Fri, 15 Jun 2018 14:34:44 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Brooks Davis cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335177 - in head/sys: compat/freebsd32 compat/linux i386/ibcs2 kern vm In-Reply-To: <201806142127.w5ELRPoK022899@repo.freebsd.org> Message-ID: <20180615135333.C1111@besplex.bde.org> References: <201806142127.w5ELRPoK022899@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=cIaQihWN c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=S1YjR5Gf4vJTHfycKw0A:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 04:34:52 -0000 On Thu, 14 Jun 2018, Brooks Davis wrote: > ... > Log: > Name the implementation of brk and sbrk sys_break(). This API was actually named brk(2). Now brk(2) doesn't actually give this API. brk(2) doesn't exist in libc. Only brk(3) exists. It calls the actual brk(2) and adds complications. brk(3) doesn't exist according to its (nonexistent) man page. sbrk(2) hasn't existed in libc for much longer. Only sbrk(3) exists. It calls brk(3nonexistent) and adds complications. sbrk(3) doesn't exist according to its (nonexistent) man page. > ... > Modified: head/sys/compat/freebsd32/syscalls.master > ============================================================================== > --- head/sys/compat/freebsd32/syscalls.master Thu Jun 14 21:22:14 2018 (r335176) > +++ head/sys/compat/freebsd32/syscalls.master Thu Jun 14 21:27:25 2018 (r335177) > @@ -87,8 +87,7 @@ > int mode, int dev); } > 15 AUE_CHMOD NOPROTO { int chmod(char *path, int mode); } > 16 AUE_CHOWN NOPROTO { int chown(char *path, int uid, int gid); } > -17 AUE_NULL NOPROTO { caddr_t obreak(char *nsize); } break \ > - obreak_args int > +17 AUE_NULL NOPROTO { caddr_t break(char *nsize); } > 18 AUE_GETFSSTAT COMPAT4 { int freebsd32_getfsstat( \ > struct statfs32 *buf, long bufsize, \ > int mode); } > brk(2) under any name returns int, not caddr_t. Even its man page gets this correct. This was broken for all cases except one. The type checking of declarations generated by these pseudo-prototypes is too weak to detect the error. First the good name of these APIs is broken by adding a sys_ prefix. I think the return type is ignored. Syscall implementation functions all return int (just an error code). They return actual values in td_retval. Indirections break type checking for this especially well. Old versions that passed around a pointer to td_retval could have done type checking much like is done for args structs. The type checking is also weak for args structs, and this is useful for avoiding const poisoning. Type qualifiers get lost somewhere even when they are in the pseudo-prototypes. Lots of other errors like [signed] int instead of [unsigned] uid_t visible for chown() in the above go undetected. Even the size mismatch for 16-bit mode_t vs 32-bit int visible in the above for chmod() goes undetected. > Modified: head/sys/i386/ibcs2/syscalls.master > ============================================================================== > --- head/sys/i386/ibcs2/syscalls.master Thu Jun 14 21:22:14 2018 (r335176) > +++ head/sys/i386/ibcs2/syscalls.master Thu Jun 14 21:27:25 2018 (r335177) > @@ -57,7 +57,7 @@ > 15 AUE_CHMOD STD { int ibcs2_chmod(char *path, int mode); } > 16 AUE_CHOWN STD { int ibcs2_chown(char *path, int uid, \ > int gid); } > -17 AUE_NULL NOPROTO { int obreak(caddr_t nsize); } > +17 AUE_NULL NOPROTO { caddr_t break(caddr_t nsize); } > 18 AUE_STAT STD { int ibcs2_stat(char* path, \ > struct ibcs2_stat *st); } > 19 AUE_LSEEK STD { long ibcs2_lseek(int fd, long offset, \ This was the one instance with the correct return type. All of the arg types for break() are broken too. This one is different, but the difference happens to be just a misspelling of the same wrong type. brk(2) is documented to have the newfangled arg type void *. The implementation of [s]brk(3) uses the correct type, but the syscalls.master files haven't caught up yet. Most use char *, but this one uses caddr_t (which happens to be char *). Perhaps caddr_t is actually correct for ibcs2. But then it would be the ibcs2 caddr_t that is correct. Bruce From owner-svn-src-head@freebsd.org Fri Jun 15 06:03:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64EA4101EFBE; Fri, 15 Jun 2018 06:03:42 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 14E5B7AB38; Fri, 15 Jun 2018 06:03:42 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E87D513876; Fri, 15 Jun 2018 06:03:41 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5F63fVQ090720; Fri, 15 Jun 2018 06:03:41 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5F63fXk090717; Fri, 15 Jun 2018 06:03:41 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201806150603.w5F63fXk090717@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 15 Jun 2018 06:03:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335189 - head/sbin/newfs_msdos X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/sbin/newfs_msdos X-SVN-Commit-Revision: 335189 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 06:03:42 -0000 Author: delphij Date: Fri Jun 15 06:03:40 2018 New Revision: 335189 URL: https://svnweb.freebsd.org/changeset/base/335189 Log: Added option to cluster-align the start of the root directory. Obtained from: Android Obtained from: https://android.googlesource.com/platform/system/core/+/052f27562154d175267999106bd6bf18fc8c363e Obtained from: https://android.googlesource.com/platform/system/core/+/8218b6aae9cd4a19fa074a8a8203fe9275b35447 MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D15672 Modified: head/sbin/newfs_msdos/mkfs_msdos.c head/sbin/newfs_msdos/mkfs_msdos.h head/sbin/newfs_msdos/newfs_msdos.8 head/sbin/newfs_msdos/newfs_msdos.c Modified: head/sbin/newfs_msdos/mkfs_msdos.c ============================================================================== --- head/sbin/newfs_msdos/mkfs_msdos.c Fri Jun 15 03:31:30 2018 (r335188) +++ head/sbin/newfs_msdos/mkfs_msdos.c Fri Jun 15 06:03:40 2018 (r335189) @@ -242,6 +242,8 @@ mkfs_msdos(const char *fname, const char *dtype, const ssize_t n; time_t now; u_int fat, bss, rds, cls, dir, lsn, x, x1, x2; + u_int extra_res, alignment, saved_x, attempts=0; + bool set_res, set_spf, set_spc; int fd, fd1, rv; struct msdos_options o = *op; @@ -486,50 +488,83 @@ mkfs_msdos(const char *fname, const char *dtype, const if (bpb.bpbBackup != MAXU16 && x <= bpb.bpbBackup) x = bpb.bpbBackup + 1; } - if (!bpb.bpbResSectors) - bpb.bpbResSectors = fat == 32 ? - MAX(x, MAX(16384 / bpb.bpbBytesPerSec, 4)) : x; - else if (bpb.bpbResSectors < x) { - warnx("too few reserved sectors (need %d have %d)", x, - bpb.bpbResSectors); - goto done; - } - if (fat != 32 && !bpb.bpbRootDirEnts) - bpb.bpbRootDirEnts = DEFRDE; - rds = howmany(bpb.bpbRootDirEnts, bpb.bpbBytesPerSec / sizeof(struct de)); - if (!bpb.bpbSecPerClust) - for (bpb.bpbSecPerClust = howmany(fat == 16 ? DEFBLK16 : - DEFBLK, bpb.bpbBytesPerSec); - bpb.bpbSecPerClust < MAXSPC && - bpb.bpbResSectors + - howmany((RESFTE + maxcls(fat)) * (fat / BPN), - bpb.bpbBytesPerSec * NPB) * - bpb.bpbFATs + - rds + - (u_int64_t) (maxcls(fat) + 1) * - bpb.bpbSecPerClust <= bpb.bpbHugeSectors; - bpb.bpbSecPerClust <<= 1) - continue; - if (fat != 32 && bpb.bpbBigFATsecs > MAXU16) { - warnx("too many sectors/FAT for FAT12/16"); - goto done; - } - x1 = bpb.bpbResSectors + rds; - x = bpb.bpbBigFATsecs ? bpb.bpbBigFATsecs : 1; - if (x1 + (u_int64_t)x * bpb.bpbFATs > bpb.bpbHugeSectors) { - warnx("meta data exceeds file system size"); - goto done; - } - x1 += x * bpb.bpbFATs; - x = (u_int64_t)(bpb.bpbHugeSectors - x1) * bpb.bpbBytesPerSec * NPB / - (bpb.bpbSecPerClust * bpb.bpbBytesPerSec * NPB + fat / - BPN * bpb.bpbFATs); - x2 = howmany((RESFTE + MIN(x, maxcls(fat))) * (fat / BPN), - bpb.bpbBytesPerSec * NPB); - if (!bpb.bpbBigFATsecs) { - bpb.bpbBigFATsecs = x2; - x1 += (bpb.bpbBigFATsecs - 1) * bpb.bpbFATs; - } + + extra_res = 0; + alignment = 0; + set_res = (bpb.bpbResSectors == 0); + set_spf = (bpb.bpbBigFATsecs == 0); + set_spc = (bpb.bpbSecPerClust == 0); + saved_x = x; + + /* + * Attempt to align the root directory to cluster if o.align is set. + * This is done by padding with reserved blocks. Note that this can + * cause other factors to change, which can in turn change the alignment. + * This should take at most 2 iterations, as increasing the reserved + * amount may cause the FAT size to decrease by 1, requiring another + * bpbFATs reserved blocks. If bpbSecPerClust changes, it will + * be half of its previous size, and thus will not throw off alignment. + */ + do { + x = saved_x; + if (set_res) + bpb.bpbResSectors = ((fat == 32) ? + MAX(x, MAX(16384 / bpb.bpbBytesPerSec, 4)) : x) + extra_res; + else if (bpb.bpbResSectors < x) { + warnx("too few reserved sectors (need %d have %d)", x, + bpb.bpbResSectors); + goto done; + } + if (fat != 32 && !bpb.bpbRootDirEnts) + bpb.bpbRootDirEnts = DEFRDE; + rds = howmany(bpb.bpbRootDirEnts, + bpb.bpbBytesPerSec / sizeof(struct de)); + if (set_spc) { + for (bpb.bpbSecPerClust = howmany(fat == 16 ? DEFBLK16 : + DEFBLK, bpb.bpbBytesPerSec); + bpb.bpbSecPerClust < MAXSPC && (bpb.bpbResSectors + + howmany((RESFTE + maxcls(fat)) * (fat / BPN), + bpb.bpbBytesPerSec * NPB) * bpb.bpbFATs + + rds + + (u_int64_t) (maxcls(fat) + 1) * bpb.bpbSecPerClust) <= + bpb.bpbHugeSectors; + bpb.bpbSecPerClust <<= 1) + continue; + + } + if (fat != 32 && bpb.bpbBigFATsecs > MAXU16) { + warnx("too many sectors/FAT for FAT12/16"); + goto done; + } + x1 = bpb.bpbResSectors + rds; + x = bpb.bpbBigFATsecs ? bpb.bpbBigFATsecs : 1; + if (x1 + (u_int64_t)x * bpb.bpbFATs > bpb.bpbHugeSectors) { + warnx("meta data exceeds file system size"); + goto done; + } + x1 += x * bpb.bpbFATs; + x = (u_int64_t)(bpb.bpbHugeSectors - x1) * bpb.bpbBytesPerSec * NPB / + (bpb.bpbSecPerClust * bpb.bpbBytesPerSec * NPB + + fat / BPN * bpb.bpbFATs); + x2 = howmany((RESFTE + MIN(x, maxcls(fat))) * (fat / BPN), + bpb.bpbBytesPerSec * NPB); + if (set_spf) { + if (bpb.bpbBigFATsecs == 0) + bpb.bpbBigFATsecs = x2; + x1 += (bpb.bpbBigFATsecs - 1) * bpb.bpbFATs; + } + if (set_res) { + /* attempt to align root directory */ + alignment = (bpb.bpbResSectors + bpb.bpbBigFATsecs * bpb.bpbFATs) % + bpb.bpbSecPerClust; + if (o.align) + extra_res += bpb.bpbSecPerClust - alignment; + } + attempts++; + } while (o.align && alignment != 0 && attempts < 2); + if (o.align && alignment != 0) + warnx("warning: Alignment failed."); + cls = (bpb.bpbHugeSectors - x1) / bpb.bpbSecPerClust; x = (u_int64_t)bpb.bpbBigFATsecs * bpb.bpbBytesPerSec * NPB / (fat / BPN) - RESFTE; Modified: head/sbin/newfs_msdos/mkfs_msdos.h ============================================================================== --- head/sbin/newfs_msdos/mkfs_msdos.h Fri Jun 15 03:31:30 2018 (r335188) +++ head/sbin/newfs_msdos/mkfs_msdos.h Fri Jun 15 06:03:40 2018 (r335189) @@ -34,6 +34,7 @@ #include #define ALLOPTS \ AOPT('@', off_t, offset, 0, "Offset in device") \ +AOPT('A', bool, align, -2, "Attempt to cluster align root directory") \ AOPT('B', const char *, bootstrap, -1, "Bootstrap file") \ AOPT('C', off_t, create_size, 0, "Create file") \ AOPT('F', uint8_t, fat_type, 12, "FAT type (12, 16, or 32)") \ @@ -61,7 +62,7 @@ AOPT('u', uint16_t, sectors_per_track, 1, "Sectors per struct msdos_options { #define AOPT(_opt, _type, _name, _min, _desc) _type _name; ALLOPTS -#undef AOPT +#undef AOPT uint32_t timestamp_set:1; uint32_t volume_id_set:1; uint32_t media_descriptor_set:1; Modified: head/sbin/newfs_msdos/newfs_msdos.8 ============================================================================== --- head/sbin/newfs_msdos/newfs_msdos.8 Fri Jun 15 03:31:30 2018 (r335188) +++ head/sbin/newfs_msdos/newfs_msdos.8 Fri Jun 15 06:03:40 2018 (r335189) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 16, 2017 +.Dd June 14, 2018 .Dt NEWFS_MSDOS 8 .Os .Sh NAME @@ -35,6 +35,7 @@ .Nm .Op Fl N .Op Fl @ Ar offset +.Op Fl A .Op Fl B Ar boot .Op Fl C Ar create-size .Op Fl F Ar FAT-type @@ -91,6 +92,8 @@ Build the filesystem at the specified offset in bytes A suffix s, k, m, g (lower or upper case) appended to the offset specifies that the number is in sectors, kilobytes, megabytes or gigabytes, respectively. +.It Fl A +Attempt to cluster align root directory, useful for SD card. .It Fl B Ar boot Get bootstrap from file. .It Fl C Ar create-size Modified: head/sbin/newfs_msdos/newfs_msdos.c ============================================================================== --- head/sbin/newfs_msdos/newfs_msdos.c Fri Jun 15 03:31:30 2018 (r335188) +++ head/sbin/newfs_msdos/newfs_msdos.c Fri Jun 15 06:03:40 2018 (r335189) @@ -76,7 +76,7 @@ get_tstamp(const char *b) int main(int argc, char *argv[]) { - static const char opts[] = "@:NB:C:F:I:L:O:S:a:b:c:e:f:h:i:k:m:n:o:r:s:T:u:"; + static const char opts[] = "@:NAB:C:F:I:L:O:S:a:b:c:e:f:h:i:k:m:n:o:r:s:T:u:"; struct msdos_options o; const char *fname, *dtype; char buf[MAXPATHLEN]; @@ -92,6 +92,9 @@ main(int argc, char *argv[]) case 'N': o.no_create = 1; break; + case 'A': + o.align = true; + break; case 'B': o.bootstrap = optarg; break; @@ -175,6 +178,10 @@ main(int argc, char *argv[]) argv += optind; if (argc < 1 || argc > 2) usage(); + if (o.align) { + if (o.hidden_sectors_set) + errx(1, "align (-A) is incompatible with -r"); + } fname = *argv++; if (!o.create_size && !strchr(fname, '/')) { snprintf(buf, sizeof(buf), "%s%s", _PATH_DEV, fname); From owner-svn-src-head@freebsd.org Fri Jun 15 06:13:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 836F5101FDDB; Fri, 15 Jun 2018 06:13:07 +0000 (UTC) (envelope-from melounmichal@gmail.com) Received: from mail-wm0-x22f.google.com (mail-wm0-x22f.google.com [IPv6:2a00:1450:400c:c09::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E7D3F7B11A; Fri, 15 Jun 2018 06:13:06 +0000 (UTC) (envelope-from melounmichal@gmail.com) Received: by mail-wm0-x22f.google.com with SMTP id n5-v6so1722572wmc.5; Thu, 14 Jun 2018 23:13:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:reply-to:subject:to:references:openpgp:autocrypt:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=LG0fnmDppAgXo7L9Y951gZOinP+Hmk1KnxwnruNV6RM=; b=obQZNxAbLhKMDvJU0HvW2xdzCPon5+jlD+7bWtytXAVXumPMiAdLbVNG8MFlsDWKLc imLcertiluhbrmhWbRSUxLmXHFHIwE7TBOs3T/rM9ZY4bL8ZKs654FQT1IKcLkWyiar6 TtlOMCfzyBounpxv33pk8Z/zfcrCYTjIPZFkwJogivrhuZSePLRWEAN7StEgBafL1SPc yx8RYy3+pcWr/Rb5TB/scA8nqGblWaUvCUHrd3b3GPsms9L+aEed/N4gJGRVBvhPoMsQ ejJ/aWcke3sSahMeuPPuYiqkhTaS0ha91ShIAWdkCRcpd9d+atoX6PEAltC4/klZjRoT UP6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:reply-to:subject:to:references:openpgp :autocrypt:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=LG0fnmDppAgXo7L9Y951gZOinP+Hmk1KnxwnruNV6RM=; b=KusMjiTHbDMb1yVR0eU1y8znzcleN4ci1+htABAQgymk1W65jk3Q/gm6OWwfBaJ/ci bRQ5X/BwIg7VA66HVxam6hw0PENonYOC1746T5kZETHlnnFzIpKrSbsDwJ7I3SDhA+mz nkRp6Pu6KdJok0GGjGfkbs90gbVbpelmaAePyx6D2Zs7sTHZ2a5OKHLjuK5C+LRVfLt7 1hWbN9Kf+Oqy3d7ulLfTnZ2mVmzCu14NDYsMr5rN+Xif/LcZVprZ0f5qmLYdlP56UEfj Wjunh2+IJWqsRgKtnlBcNqMwZRi3t2fuAHaliSBaxfrbnOy8Eg+P9ETmt2qQpIhzx8FE sRkw== X-Gm-Message-State: APt69E11i8Vmwr89MoB6wZfnBxz+9hp9NndAWNyUXDn4eRGw/+aiGVaH q3Edn+VDlLoF18dRSkI/IarGlV30 X-Google-Smtp-Source: ADUXVKKU7IpQ5QpfPZyMzaQHcbaexJ8YDVo4T3MI83kVy4Zfq1K0yr/j0DYSP2gaPWbNaC+DQ3PiBg== X-Received: by 2002:a1c:e618:: with SMTP id d24-v6mr97910wmh.154.1529043185032; Thu, 14 Jun 2018 23:13:05 -0700 (PDT) Received: from [88.208.79.100] (halouny.humusoft.cz. [88.208.79.100]) by smtp.gmail.com with ESMTPSA id j131-v6sm1436617wmg.24.2018.06.14.23.13.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Jun 2018 23:13:04 -0700 (PDT) From: Michal Meloun X-Google-Original-From: Michal Meloun Reply-To: mmel@freebsd.org Subject: Re: svn commit: r335173 - head/sys/dev/extres/regulator To: Kyle Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201806142037.w5EKbP6S096772@repo.freebsd.org> Openpgp: preference=signencrypt Autocrypt: addr=mmel@freebsd.org; prefer-encrypt=mutual; keydata= xsBNBFYuVRkBCADZiwLCCne3wG9b9k+R2Neo5zVo2bLaZRfNNY/v9kg283i0sb1Da4EdEiNT 15El5UyozhphUIbIR/zrVpxF1TvvFdoCyzx6a68bNY2d9dBrDcNDZC+XnyDdHQoobN87DWT1 mRVkmbg9LHZ/SVUOkGYuWyE+8UYeDAcUizuXwSK5zFWmeTyIoWNa68ifrWLfQe0p4x5jC/AI VURCi17p360vU4fhgwoMvEEhrRBWCr4DYHToFjIt2WdBy3GR1qoO0+Xkd6G+OoBULo+XDfgu L2WdPvh0K69F9/LgHkMmG5Il7SCe62QGpG2vaCgRV7BQhLX+kxlvM+WrdRatWRml4Y/3ABEB AAHNIE1pY2hhbCBNZWxvdW4gPG1tZWxAZnJlZWJzZC5vcmc+wsCABBMBCgAqAhsDBQsJCAcD BRUKCQgLBRYDAgEAAh4BAheAAhkBBQJZjBHDBQkHICOqAAoJEGkesmtexaqqIKMIAJ9xTp1w ge86ns2ZYOac5++mAgpFatohSlxYUR3gwud3Y3Ej0eumavpv/C26N6dsLnspwRenKdLbIPKe 0N8lI7CcDBIJGiFyY3c4H79QjIkYpRgbWFyCM85zEyVJpB+U7BhsgXE2uwVjE9RNhEP0KBoj sp357uqq1B1+VUO4GJ+RjdmYSOcNrjR8tTfy02456qovGjJ4JcJBlhyK6GzBKvnZSoA0s+QP OMn3gd8gdomMLEJdS3kTsfhLh2rQPZa9EmzafIyjXrirWq4+4fVFgd8SiMZyyTM+Kz30ZSUe 6SmfaQTQ/WLRIl5jku2uYQWlrRIKT9xaQzRWtZO9UgtXFRHOwE0EVi5VGQEIALqgRkfS21D/ OqWE9mXfh2bIjrp9uC8T0MCuimbsrAdLKNNorGu2nE+rebgX8n5nYM377HOnalPGyOuXvCbQ 8MFVRdWOHxenJjXJialNdBsOf2wLva3vSSVsdoPzibWDIcJqhBOQ3EuhsILyWSPvYYKEiy95 mfhrDtuTTOAYVR9aNQBOENztB2TDJyMx/qZmtGroGV3N0Hqde/znHPtQO8RG5/FQGMfHMI5G FMuycr1ceHnLo/ovrqAl4TYV+UHSHJ+FDE9dt9wXHclWbWbC0yNugchZq6rho5Jjfv4a2v7P pyn3HoDinh1lWP7hYA0ZNExGHekLnXWVqO/lzGS6bMEAEQEAAcLAZQQYAQoADwIbDAUCWYwR wwUJByAjqgAKCRBpHrJrXsWqqrsrB/4g4ESK5TLxUxi8pLWcLPyvwtN4Fmf7VsCVefkhakaG rDPmfvfnG+OFwN60Xqoni7GBeakl01xwT4RINfvVfShDy6cHpLS7QL/M8pzfulVX38MkVkOD yGZhwjE+jyT/kZNA1Olaw3N3IefHq3brskQ7G4d9oPep2DDbw7C4Q76uOBjxy34JVB0WOsB6 NyMQB9h6LGljQtdEddyUqwnRZzzHiGvp0hPtdYQHQZlqbj4FV9lTRK7a8Ega+y7MgmeMiztG zeXyjNP02r3PRHCPagwa57bPxH2aAh4Q7UzBBZ0GTMm7DLKNtCP58WDxblrrhZ+7kHqGK8Fs bdeUpDdEYLVd Message-ID: Date: Fri, 15 Jun 2018 08:13:06 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <201806142037.w5EKbP6S096772@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 06:13:07 -0000 On 14.06.2018 22:37, Kyle Evans wrote: > Author: kevans > Date: Thu Jun 14 20:37:25 2018 > New Revision: 335173 > URL: https://svnweb.freebsd.org/changeset/base/335173 > > Log: > extres/regulator: Properly refcount gpio regulators > > regnode::enable_cnt is generally used to refcount regulator nodes. For > GPIOs, the refcount was done on the gpio_entry since more than one regulator > can share a GPIO. > > GPIO regulators were not taking part in the node refcount, since they had > their own mechanism. This caused some fallout after manu started disabling > everybody's unused regulators in r331989. > > Refcount it. This is, imho, wrong solution. The regnode::enable_cnt counts number of enable request from consumer and regulator framework calls regnode_enable() method only when first consumer wants enable it or last consumer disable it. regnode::enable_cnt doesn't reflect actual status (enabled/disabled) of given regulator. The gpio_entry::enable_cnt track number of enabled regulators on same gpio line and is unrelated to sum of regnode::enable_cnt or actual state of enable pin. Just look whats happen for regulator without boot_on or always_on property after standard regulator_enable() then regulator_disable() sequence. For regulator_enable(), the framework increments regnode::enable_cnt then invoke regnode_enable(..., true, ...) (because regnode::enable_cnt was zero). The regnode_enable() also increments regnode::enable_cnt. So final value of counter is 2. Subsequent regulator_disable() decrement regnode::enable_cnt and because it is not zero, it returns without any action. The real bug is that regulator framework transforms regulator_stop() (not refcounting method) to regnode_enable(..., false, ...) (refcounting method) and thus regnode_fixed_enable() cannot handle gpio_entry::enable_cnt properly. Can you, please, revert this? > > Glanced over by: manu > > Modified: > head/sys/dev/extres/regulator/regulator.c > head/sys/dev/extres/regulator/regulator.h > head/sys/dev/extres/regulator/regulator_fixed.c > > Modified: head/sys/dev/extres/regulator/regulator.c > ============================================================================== > --- head/sys/dev/extres/regulator/regulator.c Thu Jun 14 20:36:55 2018 (r335172) > +++ head/sys/dev/extres/regulator/regulator.c Thu Jun 14 20:37:25 2018 (r335173) > @@ -507,6 +507,20 @@ struct regnode_std_param *regnode_get_stdparam(struct > return (®node->std_param); > } > > +void > +regnode_enable_cnt_inc(struct regnode *regnode) > +{ > + > + regnode->enable_cnt++; > +} > + > +void > +regnode_enable_cnt_dec(struct regnode *regnode) > +{ > + > + regnode->enable_cnt--; > +} > + > void regnode_topo_unlock(void) > { > > > Modified: head/sys/dev/extres/regulator/regulator.h > ============================================================================== > --- head/sys/dev/extres/regulator/regulator.h Thu Jun 14 20:36:55 2018 (r335172) > +++ head/sys/dev/extres/regulator/regulator.h Thu Jun 14 20:37:25 2018 (r335173) > @@ -106,6 +106,8 @@ int regnode_get_flags(struct regnode *regnode); > void *regnode_get_softc(struct regnode *regnode); > device_t regnode_get_device(struct regnode *regnode); > struct regnode_std_param *regnode_get_stdparam(struct regnode *regnode); > +void regnode_enable_cnt_inc(struct regnode *regnode); > +void regnode_enable_cnt_dec(struct regnode *regnode); > void regnode_topo_unlock(void); > void regnode_topo_xlock(void); > void regnode_topo_slock(void); > > Modified: head/sys/dev/extres/regulator/regulator_fixed.c > ============================================================================== > --- head/sys/dev/extres/regulator/regulator_fixed.c Thu Jun 14 20:36:55 2018 (r335172) > +++ head/sys/dev/extres/regulator/regulator_fixed.c Thu Jun 14 20:37:25 2018 (r335173) > @@ -156,6 +156,8 @@ regnode_fixed_init(struct regnode *regnode) > if (sc->gpio_open_drain) > flags |= GPIO_PIN_OPENDRAIN; > enable = sc->param->boot_on || sc->param->always_on; > + if (enable) > + regnode_enable_cnt_inc(regnode); > if (!sc->param->enable_active_high) > enable = !enable; > rv = GPIO_PIN_SET(pin->dev, pin->pin, enable); > @@ -194,12 +196,14 @@ regnode_fixed_enable(struct regnode *regnode, bool ena > return (0); > pin = &sc->gpio_entry->gpio_pin; > if (enable) { > + regnode_enable_cnt_inc(regnode); > sc->gpio_entry->enable_cnt++; > if (sc->gpio_entry->enable_cnt > 1) > return (0); > } else { > KASSERT(sc->gpio_entry->enable_cnt > 0, > ("Invalid enable count")); > + regnode_enable_cnt_dec(regnode); > sc->gpio_entry->enable_cnt--; > if (sc->gpio_entry->enable_cnt >= 1) > return (0); > From owner-svn-src-head@freebsd.org Fri Jun 15 06:54:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A66651023CCC; Fri, 15 Jun 2018 06:54:31 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id BBC377C994; Fri, 15 Jun 2018 06:54:30 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id faae03f1; Fri, 15 Jun 2018 08:54:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h= mime-version:content-type:content-transfer-encoding:date:from:to :cc:subject:in-reply-to:references:message-id; s=mail; bh=x4o+jC EL0NFhQ0OxSGkzaJumHxc=; b=g4cmKw2mguXMhiX581oRIcJGCBkGRwjD8fZqg2 hYtDDKdkdt4fN/BV63NsChZnVhAlX6Ib4iVPsTywBxMlhRwNeprx7pdlcYRHFSP5 MXKTgFdsk3FXIqC52p1Y05sYKRXmZ4uMzUcynvgNsdcudHVLCVGchbK5Znkd+qtW 0gagQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h= mime-version:content-type:content-transfer-encoding:date:from:to :cc:subject:in-reply-to:references:message-id; q=dns; s=mail; b= tFxgaKv1uIds5TN6MTuHnLQTmZhT+mIoFd+M4PRAbTt6h5sey2AxRJkGpIZvpjwW CFOc2u+YeppTSnSmuz/aYt6+HkAi9hPjT3w9hAIPFbGhMGDa/cA6Js4acgIa8E/a MMqmKMAT+aUF7e8AD36nSQBKjTyP2Sie0/cj3rsKMKo= Received: from webmail.megadrive.org (www1.blih.net [212.83.177.180]) by mail.blih.net (OpenSMTPD) with ESMTP id a909bd9f; Fri, 15 Jun 2018 08:54:21 +0200 (CEST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 15 Jun 2018 08:54:21 +0200 From: Emmanuel Vadot To: "Jonathan T. Looney" Cc: cognet@ci0.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, owner-src-committers@freebsd.org Subject: Re: svn commit: r335068 - in head: share/man/man9 sys/amd64/amd64 sys/i386/i386 sys/kern sys/net sys/sys sys/vm Organization: Bidouilliste In-Reply-To: References: <201806131704.w5DH4gLv048134@repo.freebsd.org> <20180615002336.fcb966efe812cd60af59f68f@bidouilliste.com> <20180614231157.GA70834@ci0.org> Message-ID: <0c47db8b787641e6569e5b90d604005c@megadrive.org> X-Sender: manu@bidouilliste.com User-Agent: Roundcube Webmail/1.1.1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 06:54:31 -0000 On 2018-06-15 04:04, Jonathan T. Looney wrote: > On Thu, Jun 14, 2018 at 7:12 PM Olivier Houchard > wrote: > >> On Fri, Jun 15, 2018 at 12:23:36AM +0200, Emmanuel Vadot wrote: >>> This brake module loading on armv7 and arm64 >> >> I think I fixed it with r335182. >> Jonathan probably missed it because modules are differnt on amd64 >> (and >> mips), and the code that handles those are different, and doesn't >> use >> malloc(). > > Hi Olivier, > > Thanks for fixing that! Indeed thanks. > FWIW, I do have plans to make some further enhancements to fine-tune > the permissions used for kernel modules. Once I have a patch, I would > appreciate it if a few of the people impacted by this change would be > willing to test it. > > Jonathan Don't hesitate to put me on review so I can test on arm/arm64. -- Emmanuel Vadot From owner-svn-src-head@freebsd.org Fri Jun 15 08:36:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4EBAF1009BB1; Fri, 15 Jun 2018 08:36:23 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EF76580927; Fri, 15 Jun 2018 08:36:22 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D074E15095; Fri, 15 Jun 2018 08:36:22 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5F8aMlt067271; Fri, 15 Jun 2018 08:36:22 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5F8aLTb067264; Fri, 15 Jun 2018 08:36:21 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201806150836.w5F8aLTb067264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 15 Jun 2018 08:36:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335190 - head/sys/arm/allwinner/clkng X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner/clkng X-SVN-Commit-Revision: 335190 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 08:36:23 -0000 Author: manu Date: Fri Jun 15 08:36:21 2018 New Revision: 335190 URL: https://svnweb.freebsd.org/changeset/base/335190 Log: allwinner: ccung: Fully subclass the clock drivers Each clock drivers if now fully subclassed, this have the advantage that we can control the probe order. Some clocks can have parents from other drivers, for example clocks in the sun8i_r driver uses clocks from the main clock driver. This worked before because the sun8i_r node is after the main ccu node in the dtb and driver are probed in DTB order. This cannot work with the Display Engine clocks as it is the first node in the DTB. Tested on: A83T, H5 A64 Tested on: A20 (kevans) Deleted: head/sys/arm/allwinner/clkng/ccu_a10.h head/sys/arm/allwinner/clkng/ccu_a13.h head/sys/arm/allwinner/clkng/ccu_a31.h head/sys/arm/allwinner/clkng/ccu_a64.h head/sys/arm/allwinner/clkng/ccu_a83t.h head/sys/arm/allwinner/clkng/ccu_h3.h head/sys/arm/allwinner/clkng/ccu_sun8i_r.h Modified: head/sys/arm/allwinner/clkng/aw_ccung.c head/sys/arm/allwinner/clkng/aw_ccung.h head/sys/arm/allwinner/clkng/ccu_a10.c head/sys/arm/allwinner/clkng/ccu_a13.c head/sys/arm/allwinner/clkng/ccu_a31.c head/sys/arm/allwinner/clkng/ccu_a64.c head/sys/arm/allwinner/clkng/ccu_a83t.c head/sys/arm/allwinner/clkng/ccu_h3.c head/sys/arm/allwinner/clkng/ccu_sun8i_r.c Modified: head/sys/arm/allwinner/clkng/aw_ccung.c ============================================================================== --- head/sys/arm/allwinner/clkng/aw_ccung.c Fri Jun 15 06:03:40 2018 (r335189) +++ head/sys/arm/allwinner/clkng/aw_ccung.c Fri Jun 15 08:36:21 2018 (r335190) @@ -1,7 +1,8 @@ /*- - * Copyright (c) 2017 Emmanuel Vadot - * All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * + * Copyright (c) 2017,2018 Emmanuel Vadot + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -58,33 +59,6 @@ __FBSDID("$FreeBSD$"); #include "opt_soc.h" #endif -#if defined(SOC_ALLWINNER_A10) || defined(SOC_ALLWINNER_A20) -#include -#endif - -#if defined(SOC_ALLWINNER_A13) -#include -#endif - -#if defined(SOC_ALLWINNER_A31) -#include -#endif - -#if defined(SOC_ALLWINNER_A64) -#include -#include -#endif - -#if defined(SOC_ALLWINNER_H3) || defined(SOC_ALLWINNER_H5) -#include -#include -#endif - -#if defined(SOC_ALLWINNER_A83T) -#include -#include -#endif - #include "clkdev_if.h" #include "hwreset_if.h" @@ -93,35 +67,6 @@ static struct resource_spec aw_ccung_spec[] = { { -1, 0 } }; -static struct ofw_compat_data compat_data[] = { -#if defined(SOC_ALLWINNER_A10) - { "allwinner,sun4i-a10-ccu", A10_CCU }, -#endif -#if defined(SOC_ALLWINNER_A31) - { "allwinner,sun5i-a13-ccu", A13_CCU}, -#endif -#if defined(SOC_ALLWINNER_A20) - { "allwinner,sun7i-a20-ccu", A20_CCU }, -#endif -#if defined(SOC_ALLWINNER_H3) || defined(SOC_ALLWINNER_H5) - { "allwinner,sun8i-h3-ccu", H3_CCU }, - { "allwinner,sun50i-h5-ccu", H3_CCU }, - { "allwinner,sun8i-h3-r-ccu", H3_R_CCU }, -#endif -#if defined(SOC_ALLWINNER_A31) - { "allwinner,sun6i-a31-ccu", A31_CCU }, -#endif -#if defined(SOC_ALLWINNER_A64) - { "allwinner,sun50i-a64-ccu", A64_CCU }, - { "allwinner,sun50i-a64-r-ccu", A64_R_CCU }, -#endif -#if defined(SOC_ALLWINNER_A83T) - { "allwinner,sun8i-a83t-ccu", A83T_CCU }, - { "allwinner,sun8i-a83t-r-ccu", A83T_R_CCU }, -#endif - {NULL, 0 } -}; - #define CCU_READ4(sc, reg) bus_read_4((sc)->res, (reg)) #define CCU_WRITE4(sc, reg, val) bus_write_4((sc)->res, (reg), (val)) @@ -223,20 +168,6 @@ aw_ccung_device_unlock(device_t dev) } static int -aw_ccung_probe(device_t dev) -{ - - if (!ofw_bus_status_okay(dev)) - return (ENXIO); - - if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) - return (ENXIO); - - device_set_desc(dev, "Allwinner Clock Control Unit NG"); - return (BUS_PROBE_DEFAULT); -} - -static int aw_ccung_register_gates(struct aw_ccung_softc *sc) { struct clk_gate_def def; @@ -313,10 +244,11 @@ aw_ccung_init_clocks(struct aw_ccung_softc *sc) } } -static int +int aw_ccung_attach(device_t dev) { struct aw_ccung_softc *sc; + int i; sc = device_get_softc(dev); sc->dev = dev; @@ -328,57 +260,35 @@ aw_ccung_attach(device_t dev) mtx_init(&sc->mtx, device_get_nameunit(dev), NULL, MTX_DEF); - sc->type = ofw_bus_search_compatible(dev, compat_data)->ocd_data; - sc->clkdom = clkdom_create(dev); if (sc->clkdom == NULL) panic("Cannot create clkdom\n"); - switch (sc->type) { -#if defined(SOC_ALLWINNER_A10) - case A10_CCU: - ccu_a10_register_clocks(sc); - break; -#endif -#if defined(SOC_ALLWINNER_A13) - case A13_CCU: - ccu_a13_register_clocks(sc); - break; -#endif -#if defined(SOC_ALLWINNER_A20) - case A20_CCU: - ccu_a20_register_clocks(sc); - break; -#endif -#if defined(SOC_ALLWINNER_H3) || defined(SOC_ALLWINNER_H5) - case H3_CCU: - ccu_h3_register_clocks(sc); - break; - case H3_R_CCU: - ccu_sun8i_r_register_clocks(sc); - break; -#endif -#if defined(SOC_ALLWINNER_A31) - case A31_CCU: - ccu_a31_register_clocks(sc); - break; -#endif -#if defined(SOC_ALLWINNER_A64) - case A64_CCU: - ccu_a64_register_clocks(sc); - break; - case A64_R_CCU: - ccu_sun8i_r_register_clocks(sc); - break; -#endif -#if defined(SOC_ALLWINNER_A83T) - case A83T_CCU: - ccu_a83t_register_clocks(sc); - break; - case A83T_R_CCU: - ccu_sun8i_r_register_clocks(sc); - break; -#endif + for (i = 0; i < sc->nclks; i++) { + switch (sc->clks[i].type) { + case AW_CLK_UNDEFINED: + break; + case AW_CLK_MUX: + clknode_mux_register(sc->clkdom, sc->clks[i].clk.mux); + break; + case AW_CLK_DIV: + clknode_div_register(sc->clkdom, sc->clks[i].clk.div); + break; + case AW_CLK_FIXED: + clknode_fixed_register(sc->clkdom, + sc->clks[i].clk.fixed); + break; + case AW_CLK_NKMP: + aw_clk_nkmp_register(sc->clkdom, sc->clks[i].clk.nkmp); + break; + case AW_CLK_NM: + aw_clk_nm_register(sc->clkdom, sc->clks[i].clk.nm); + break; + case AW_CLK_PREDIV_MUX: + aw_clk_prediv_mux_register(sc->clkdom, + sc->clks[i].clk.prediv_mux); + break; + } } if (sc->gates) @@ -401,10 +311,6 @@ aw_ccung_attach(device_t dev) } static device_method_t aw_ccung_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, aw_ccung_probe), - DEVMETHOD(device_attach, aw_ccung_attach), - /* clkdev interface */ DEVMETHOD(clkdev_write_4, aw_ccung_write_4), DEVMETHOD(clkdev_read_4, aw_ccung_read_4), @@ -419,14 +325,5 @@ static device_method_t aw_ccung_methods[] = { DEVMETHOD_END }; -static driver_t aw_ccung_driver = { - "aw_ccung", - aw_ccung_methods, - sizeof(struct aw_ccung_softc), -}; - -static devclass_t aw_ccung_devclass; - -EARLY_DRIVER_MODULE(aw_ccung, simplebus, aw_ccung_driver, aw_ccung_devclass, - 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); -MODULE_VERSION(aw_ccung, 1); +DEFINE_CLASS_0(aw_ccung, aw_ccung_driver, aw_ccung_methods, + sizeof(struct aw_ccung_softc)); Modified: head/sys/arm/allwinner/clkng/aw_ccung.h ============================================================================== --- head/sys/arm/allwinner/clkng/aw_ccung.h Fri Jun 15 06:03:40 2018 (r335189) +++ head/sys/arm/allwinner/clkng/aw_ccung.h Fri Jun 15 08:36:21 2018 (r335190) @@ -1,7 +1,8 @@ /*- - * Copyright (c) 2017 Emmanuel Vadot - * All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * + * Copyright (c) 2017,2018 Emmanuel Vadot + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -29,29 +30,47 @@ #ifndef __CCU_NG_H__ #define __CCU_NG_H__ -enum aw_ccung_type { - H3_CCU = 1, - H3_R_CCU, - A31_CCU, - A64_CCU, - A64_R_CCU, - A13_CCU, - A83T_CCU, - A83T_R_CCU, - A10_CCU, - A20_CCU, +#include +#include +#include +#include +#include +#include +#include + +enum aw_ccung_clk_type { + AW_CLK_UNDEFINED = 0, + AW_CLK_MUX, + AW_CLK_DIV, + AW_CLK_FIXED, + AW_CLK_NKMP, + AW_CLK_NM, + AW_CLK_PREDIV_MUX, }; +struct aw_ccung_clk { + enum aw_ccung_clk_type type; + union { + struct clk_mux_def *mux; + struct clk_div_def *div; + struct clk_fixed_def *fixed; + struct aw_clk_nkmp_def *nkmp; + struct aw_clk_nm_def *nm; + struct aw_clk_prediv_mux_def *prediv_mux; + } clk; +}; + struct aw_ccung_softc { device_t dev; struct resource *res; struct clkdom *clkdom; struct mtx mtx; - int type; struct aw_ccung_reset *resets; int nresets; struct aw_ccung_gate *gates; int ngates; + struct aw_ccung_clk *clks; + int nclks; struct aw_clk_init *clk_init; int n_clk_init; }; @@ -68,5 +87,9 @@ struct aw_ccung_gate { uint32_t offset; uint32_t shift; }; + +DECLARE_CLASS(aw_ccung_driver); + +int aw_ccung_attach(device_t dev); #endif /* __CCU_NG_H__ */ Modified: head/sys/arm/allwinner/clkng/ccu_a10.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_a10.c Fri Jun 15 06:03:40 2018 (r335189) +++ head/sys/arm/allwinner/clkng/ccu_a10.c Fri Jun 15 08:36:21 2018 (r335190) @@ -33,23 +33,26 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include +#include +#include + +#include +#include + #include #include #include #include -#include -#include -#include -#include #include #include #include -#include "ccu_a10.h" - /* Non-exported resets */ /* Non-exported clocks */ #define CLK_PLL_CORE 2 @@ -524,89 +527,98 @@ NM_CLK(spi3_clk, /* MISSING CLK_I2S1, CLK_I2S2, DE Clocks */ -static struct aw_clk_nkmp_def *nkmp_clks[] = { - &pll_core_clk, - &pll_ddr_other_clk, - &pll_ddr_clk, - &pll6_clk, - &pll_periph_sata_clk, +static struct aw_ccung_clk a10_ccu_clks[] = { + { .type = AW_CLK_NKMP, .clk.nkmp = &pll_core_clk}, + { .type = AW_CLK_NKMP, .clk.nkmp = &pll_ddr_other_clk}, + { .type = AW_CLK_NKMP, .clk.nkmp = &pll_ddr_clk}, + { .type = AW_CLK_NKMP, .clk.nkmp = &pll6_clk}, + { .type = AW_CLK_NKMP, .clk.nkmp = &pll_periph_sata_clk}, + { .type = AW_CLK_NM, .clk.nm = &axi_clk}, + { .type = AW_CLK_NM, .clk.nm = &ahb_clk}, + { .type = AW_CLK_NM, .clk.nm = &apb0_clk}, + { .type = AW_CLK_NM, .clk.nm = &apb1_clk}, + { .type = AW_CLK_NM, .clk.nm = &pll_video0_clk}, + { .type = AW_CLK_NM, .clk.nm = &pll_video1_clk}, + { .type = AW_CLK_NM, .clk.nm = &nand_clk}, + { .type = AW_CLK_NM, .clk.nm = &ms_clk}, + { .type = AW_CLK_NM, .clk.nm = &mmc0_clk}, + { .type = AW_CLK_NM, .clk.nm = &mmc1_clk}, + { .type = AW_CLK_NM, .clk.nm = &mmc2_clk}, + { .type = AW_CLK_NM, .clk.nm = &mmc3_clk}, + { .type = AW_CLK_NM, .clk.nm = &ts_clk}, + { .type = AW_CLK_NM, .clk.nm = &ss_clk}, + { .type = AW_CLK_NM, .clk.nm = &spi0_clk}, + { .type = AW_CLK_NM, .clk.nm = &spi1_clk}, + { .type = AW_CLK_NM, .clk.nm = &spi2_clk}, + { .type = AW_CLK_NM, .clk.nm = &ir0_clk}, + { .type = AW_CLK_NM, .clk.nm = &ir1_clk}, + { .type = AW_CLK_NM, .clk.nm = &keypad_clk}, + { .type = AW_CLK_NM, .clk.nm = &sata_clk}, + { .type = AW_CLK_NM, .clk.nm = &spi3_clk}, + { .type = AW_CLK_MUX, .clk.mux = &cpu_clk}, + { .type = AW_CLK_FIXED, .clk.fixed = &pll_periph_clk}, + { .type = AW_CLK_FIXED, .clk.fixed = &pll_video0_2x_clk}, + { .type = AW_CLK_FIXED, .clk.fixed = &pll_video1_2x_clk}, }; -static struct aw_clk_nm_def *nm_clks[] = { - &axi_clk, - &ahb_clk, - &apb0_clk, - &apb1_clk, - &pll_video0_clk, - &pll_video1_clk, - &nand_clk, - &ms_clk, - &mmc0_clk, - &mmc1_clk, - &mmc2_clk, - &mmc3_clk, - &ts_clk, - &ss_clk, - &spi0_clk, - &spi1_clk, - &spi2_clk, - &ir0_clk, - &ir1_clk, - &keypad_clk, - &sata_clk, - &spi3_clk, +static struct aw_clk_init a10_init_clks[] = { }; -static struct aw_clk_prediv_mux_def *prediv_mux_clks[] = { +static struct ofw_compat_data compat_data[] = { +#if defined(SOC_ALLWINNER_A10) + { "allwinner,sun4i-a10-ccu", 1 }, +#endif +#if defined(SOC_ALLWINNER_A20) + { "allwinner,sun7i-a20-ccu", 1 }, +#endif + { NULL, 0}, }; -static struct clk_mux_def *mux_clks[] = { - &cpu_clk, -}; +static int +ccu_a10_probe(device_t dev) +{ -static struct clk_div_def *div_clks[] = { -}; + if (!ofw_bus_status_okay(dev)) + return (ENXIO); -static struct clk_fixed_def *fixed_factor_clks[] = { - &pll_periph_clk, - &pll_video0_2x_clk, - &pll_video1_2x_clk, -}; + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); -static struct aw_clk_init init_clks[] = { -}; + device_set_desc(dev, "Allwinner A10/A20 Clock Control Unit NG"); + return (BUS_PROBE_DEFAULT); +} -void -ccu_a10_register_clocks(struct aw_ccung_softc *sc) +static int +ccu_a10_attach(device_t dev) { - int i; + struct aw_ccung_softc *sc; + sc = device_get_softc(dev); + sc->resets = a10_ccu_resets; sc->nresets = nitems(a10_ccu_resets); sc->gates = a10_ccu_gates; sc->ngates = nitems(a10_ccu_gates); - sc->clk_init = init_clks; - sc->n_clk_init = nitems(init_clks); + sc->clks = a10_ccu_clks; + sc->nclks = nitems(a10_ccu_clks); + sc->clk_init = a10_init_clks; + sc->n_clk_init = nitems(a10_init_clks); - for (i = 0; i < nitems(nkmp_clks); i++) - aw_clk_nkmp_register(sc->clkdom, nkmp_clks[i]); - for (i = 0; i < nitems(nm_clks); i++) - aw_clk_nm_register(sc->clkdom, nm_clks[i]); - for (i = 0; i < nitems(prediv_mux_clks); i++) - aw_clk_prediv_mux_register(sc->clkdom, prediv_mux_clks[i]); - - for (i = 0; i < nitems(mux_clks); i++) - clknode_mux_register(sc->clkdom, mux_clks[i]); - for (i = 0; i < nitems(div_clks); i++) - clknode_div_register(sc->clkdom, div_clks[i]); - for (i = 0; i < nitems(fixed_factor_clks); i++) - clknode_fixed_register(sc->clkdom, fixed_factor_clks[i]); + return (aw_ccung_attach(dev)); } -void -ccu_a20_register_clocks(struct aw_ccung_softc *sc) -{ +static device_method_t ccu_a10ng_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ccu_a10_probe), + DEVMETHOD(device_attach, ccu_a10_attach), - /* XXX TODO: Implement the A20-specific clocks */ - ccu_a10_register_clocks(sc); -} + DEVMETHOD_END +}; + +static devclass_t ccu_a10ng_devclass; + +DEFINE_CLASS_1(ccu_a10ng, ccu_a10ng_driver, ccu_a10ng_methods, + sizeof(struct aw_ccung_softc), aw_ccung_driver); + +EARLY_DRIVER_MODULE(ccu_a10ng, simplebus, ccu_a10ng_driver, + ccu_a10ng_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); Modified: head/sys/arm/allwinner/clkng/ccu_a13.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_a13.c Fri Jun 15 06:03:40 2018 (r335189) +++ head/sys/arm/allwinner/clkng/ccu_a13.c Fri Jun 15 08:36:21 2018 (r335190) @@ -1,7 +1,8 @@ /*- - * Copyright (c) 2017 Emmanuel Vadot - * All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * + * Copyright (c) 2017,2018 Emmanuel Vadot + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -32,22 +33,25 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include +#include +#include + +#include +#include + #include #include #include #include -#include -#include -#include -#include #include #include -#include "ccu_a13.h" - /* Non-exported clocks */ #define CLK_PLL_CORE 2 @@ -496,71 +500,72 @@ static struct aw_clk_nm_def ir_clk = { /* Clocks list */ - -static struct aw_clk_nkmp_def *nkmp_clks[] = { - &pll_core, - &pll_audio, - &pll_ddr_base, - &pll_periph, +static struct aw_ccung_clk a13_ccu_clks[] = { + { .type = AW_CLK_NKMP, .clk.nkmp = &pll_core}, + { .type = AW_CLK_NKMP, .clk.nkmp = &pll_audio}, + { .type = AW_CLK_NKMP, .clk.nkmp = &pll_ddr_base}, + { .type = AW_CLK_NKMP, .clk.nkmp = &pll_periph}, + { .type = AW_CLK_NM, .clk.nm = &apb1_clk}, + { .type = AW_CLK_NM, .clk.nm = &nand_clk}, + { .type = AW_CLK_NM, .clk.nm = &mmc0_clk}, + { .type = AW_CLK_NM, .clk.nm = &mmc1_clk}, + { .type = AW_CLK_NM, .clk.nm = &mmc2_clk}, + { .type = AW_CLK_NM, .clk.nm = &ss_clk}, + { .type = AW_CLK_NM, .clk.nm = &spi0_clk}, + { .type = AW_CLK_NM, .clk.nm = &spi1_clk}, + { .type = AW_CLK_NM, .clk.nm = &spi2_clk}, + { .type = AW_CLK_NM, .clk.nm = &ir_clk}, + { .type = AW_CLK_PREDIV_MUX, .clk.prediv_mux = &cpu_clk}, + { .type = AW_CLK_PREDIV_MUX, .clk.prediv_mux = &ahb_clk}, + { .type = AW_CLK_DIV, .clk.div = &pll_ddr}, + { .type = AW_CLK_DIV, .clk.div = &pll_ddr_other}, + { .type = AW_CLK_DIV, .clk.div = &axi_clk}, + { .type = AW_CLK_DIV, .clk.div = &apb0_clk}, }; -static struct aw_clk_nm_def *nm_clks[] = { - &apb1_clk, - &nand_clk, - &mmc0_clk, - &mmc1_clk, - &mmc2_clk, - &ss_clk, - &spi0_clk, - &spi1_clk, - &spi2_clk, - &ir_clk, -}; +static int +ccu_a13_probe(device_t dev) +{ -static struct aw_clk_prediv_mux_def *prediv_mux_clks[] = { - &cpu_clk, - &ahb_clk, -}; + if (!ofw_bus_status_okay(dev)) + return (ENXIO); -static struct clk_div_def *div_clks[] = { - &pll_ddr, - &pll_ddr_other, - &axi_clk, - &apb0_clk, -}; + if (!ofw_bus_is_compatible(dev, "allwinner,sun5i-a13-ccu")) + return (ENXIO); -static struct clk_mux_def *mux_clks[] = { -}; + device_set_desc(dev, "Allwinner A13 Clock Control Unit NG"); + return (BUS_PROBE_DEFAULT); +} -static struct clk_fixed_def *fixed_factor_clks[] = { -}; - -static struct aw_clk_init init_clks[] = { -}; - -void -ccu_a13_register_clocks(struct aw_ccung_softc *sc) +static int +ccu_a13_attach(device_t dev) { - int i; + struct aw_ccung_softc *sc; + sc = device_get_softc(dev); + sc->resets = a13_ccu_resets; sc->nresets = nitems(a13_ccu_resets); sc->gates = a13_ccu_gates; sc->ngates = nitems(a13_ccu_gates); - sc->clk_init = init_clks; - sc->n_clk_init = nitems(init_clks); + sc->clks = a13_ccu_clks; + sc->nclks = nitems(a13_ccu_clks); - for (i = 0; i < nitems(nkmp_clks); i++) - aw_clk_nkmp_register(sc->clkdom, nkmp_clks[i]); - for (i = 0; i < nitems(nm_clks); i++) - aw_clk_nm_register(sc->clkdom, nm_clks[i]); - for (i = 0; i < nitems(prediv_mux_clks); i++) - aw_clk_prediv_mux_register(sc->clkdom, prediv_mux_clks[i]); - - for (i = 0; i < nitems(mux_clks); i++) - clknode_mux_register(sc->clkdom, mux_clks[i]); - for (i = 0; i < nitems(div_clks); i++) - clknode_div_register(sc->clkdom, div_clks[i]); - for (i = 0; i < nitems(fixed_factor_clks); i++) - clknode_fixed_register(sc->clkdom, fixed_factor_clks[i]); + return (aw_ccung_attach(dev)); } + +static device_method_t ccu_a13ng_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ccu_a13_probe), + DEVMETHOD(device_attach, ccu_a13_attach), + + DEVMETHOD_END +}; + +static devclass_t ccu_a13ng_devclass; + +DEFINE_CLASS_1(ccu_a13ng, ccu_a13ng_driver, ccu_a13ng_methods, + sizeof(struct aw_ccung_softc), aw_ccung_driver); + +EARLY_DRIVER_MODULE(ccu_a13ng, simplebus, ccu_a13ng_driver, + ccu_a13ng_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); Modified: head/sys/arm/allwinner/clkng/ccu_a31.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_a31.c Fri Jun 15 06:03:40 2018 (r335189) +++ head/sys/arm/allwinner/clkng/ccu_a31.c Fri Jun 15 08:36:21 2018 (r335190) @@ -1,7 +1,8 @@ /*- - * Copyright (c) 2017 Emmanuel Vadot - * All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * + * Copyright (c) 2017,2018 Emmanuel Vadot + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -32,22 +33,25 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include +#include +#include + +#include +#include + #include #include #include #include -#include -#include -#include -#include #include #include -#include "ccu_a31.h" - /* Non-exported clocks */ #define CLK_PLL_CPU 0 #define CLK_PLL_AUDIO_BASE 1 @@ -859,113 +863,114 @@ PREDIV_CLK(gpu_hyd_clk, /* ATS 0x1B0 */ /* Trace 0x1B4 */ - -static struct aw_clk_nkmp_def *nkmp_clks[] = { - &pll_cpu_clk, - &pll_audio_clk, - &pll_periph_clk, - &pll_ddr_clk, - &pll_mipi_clk, +static struct aw_ccung_clk a31_ccu_clks[] = { + { .type = AW_CLK_NKMP, .clk.nkmp = &pll_cpu_clk}, + { .type = AW_CLK_NKMP, .clk.nkmp = &pll_audio_clk}, + { .type = AW_CLK_NKMP, .clk.nkmp = &pll_periph_clk}, + { .type = AW_CLK_NKMP, .clk.nkmp = &pll_ddr_clk}, + { .type = AW_CLK_NKMP, .clk.nkmp = &pll_mipi_clk}, + { .type = AW_CLK_NM, .clk.nm = &pll_video0_clk}, + { .type = AW_CLK_NM, .clk.nm = &pll_ve_clk}, + { .type = AW_CLK_NM, .clk.nm = &pll_video1_clk}, + { .type = AW_CLK_NM, .clk.nm = &pll_gpu_clk}, + { .type = AW_CLK_NM, .clk.nm = &pll9_clk}, + { .type = AW_CLK_NM, .clk.nm = &pll10_clk}, + { .type = AW_CLK_NM, .clk.nm = &apb2_clk}, + { .type = AW_CLK_NM, .clk.nm = &nand0_clk}, + { .type = AW_CLK_NM, .clk.nm = &nand1_clk}, + { .type = AW_CLK_NM, .clk.nm = &mmc0_clk}, + { .type = AW_CLK_NM, .clk.nm = &mmc1_clk}, + { .type = AW_CLK_NM, .clk.nm = &mmc2_clk}, + { .type = AW_CLK_NM, .clk.nm = &mmc3_clk}, + { .type = AW_CLK_NM, .clk.nm = &ts_clk}, + { .type = AW_CLK_NM, .clk.nm = &ss_clk}, + { .type = AW_CLK_NM, .clk.nm = &spi0_clk}, + { .type = AW_CLK_NM, .clk.nm = &spi1_clk}, + { .type = AW_CLK_NM, .clk.nm = &spi2_clk}, + { .type = AW_CLK_NM, .clk.nm = &spi3_clk}, + { .type = AW_CLK_NM, .clk.nm = &mdfs_clk}, + { .type = AW_CLK_NM, .clk.nm = &sdram0_clk}, + { .type = AW_CLK_NM, .clk.nm = &sdram1_clk}, + { .type = AW_CLK_NM, .clk.nm = &be0_clk}, + { .type = AW_CLK_NM, .clk.nm = &be1_clk}, + { .type = AW_CLK_NM, .clk.nm = &fe0_clk}, + { .type = AW_CLK_NM, .clk.nm = &fe1_clk}, + { .type = AW_CLK_NM, .clk.nm = &mp_clk}, + { .type = AW_CLK_NM, .clk.nm = &lcd0_ch0_clk}, + { .type = AW_CLK_NM, .clk.nm = &lcd1_ch0_clk}, + { .type = AW_CLK_NM, .clk.nm = &lcd0_ch1_clk}, + { .type = AW_CLK_NM, .clk.nm = &lcd1_ch1_clk}, + { .type = AW_CLK_NM, .clk.nm = &ve_clk}, + { .type = AW_CLK_NM, .clk.nm = &hdmi_clk}, + { .type = AW_CLK_NM, .clk.nm = &mbus0_clk}, + { .type = AW_CLK_NM, .clk.nm = &mbus1_clk}, + { .type = AW_CLK_NM, .clk.nm = &mipi_dsi_clk}, + { .type = AW_CLK_NM, .clk.nm = &mipi_dsi_dphy_clk}, + { .type = AW_CLK_NM, .clk.nm = &mipi_csi_dphy_clk}, + { .type = AW_CLK_NM, .clk.nm = &iep_drc0_clk}, + { .type = AW_CLK_NM, .clk.nm = &iep_drc1_clk}, + { .type = AW_CLK_NM, .clk.nm = &iep_deu0_clk}, + { .type = AW_CLK_NM, .clk.nm = &iep_deu1_clk}, + { .type = AW_CLK_PREDIV_MUX, .clk.prediv_mux = &ahb1_clk}, + { .type = AW_CLK_PREDIV_MUX, .clk.prediv_mux = &gpu_core_clk}, + { .type = AW_CLK_PREDIV_MUX, .clk.prediv_mux = &gpu_memory_clk}, + { .type = AW_CLK_PREDIV_MUX, .clk.prediv_mux = &gpu_hyd_clk}, + { .type = AW_CLK_DIV, .clk.div = &axi_clk}, + { .type = AW_CLK_DIV, .clk.div = &apb1_clk}, + { .type = AW_CLK_MUX, .clk.mux = &cpu_clk}, + { .type = AW_CLK_MUX, .clk.mux = &daudio0mux_clk}, + { .type = AW_CLK_MUX, .clk.mux = &daudio1mux_clk}, + { .type = AW_CLK_FIXED, .clk.fixed = &pll_audio_2x_clk}, + { .type = AW_CLK_FIXED, .clk.fixed = &pll_audio_4x_clk}, + { .type = AW_CLK_FIXED, .clk.fixed = &pll_audio_8x_clk}, + { .type = AW_CLK_FIXED, .clk.fixed = &pll_video0_2x_clk}, + { .type = AW_CLK_FIXED, .clk.fixed = &pll_periph_2x_clk}, + { .type = AW_CLK_FIXED, .clk.fixed = &pll_video1_2x_clk}, }; -static struct aw_clk_nm_def *nm_clks[] = { - &pll_video0_clk, - &pll_ve_clk, - &pll_video1_clk, - &pll_gpu_clk, - &pll9_clk, - &pll10_clk, - &apb2_clk, - &nand0_clk, - &nand1_clk, - &mmc0_clk, - &mmc1_clk, - &mmc2_clk, - &mmc3_clk, - &ts_clk, - &ss_clk, - &spi0_clk, - &spi1_clk, - &spi2_clk, - &spi3_clk, - &mdfs_clk, - &sdram0_clk, - &sdram1_clk, - &be0_clk, - &be1_clk, - &fe0_clk, - &fe1_clk, - &mp_clk, - &lcd0_ch0_clk, - &lcd1_ch0_clk, - &lcd0_ch1_clk, - &lcd1_ch1_clk, - &ve_clk, - &hdmi_clk, - &mbus0_clk, - &mbus1_clk, - &mipi_dsi_clk, - &mipi_dsi_dphy_clk, - &mipi_csi_dphy_clk, - &iep_drc0_clk, - &iep_drc1_clk, - &iep_deu0_clk, - &iep_deu1_clk, -}; +static int +ccu_a31_probe(device_t dev) +{ -static struct aw_clk_prediv_mux_def *prediv_mux_clks[] = { - &ahb1_clk, - &gpu_core_clk, - &gpu_memory_clk, - &gpu_hyd_clk, -}; + if (!ofw_bus_status_okay(dev)) + return (ENXIO); -static struct clk_div_def *div_clks[] = { - &axi_clk, - &apb1_clk, -}; + if (!ofw_bus_is_compatible(dev, "allwinner,sun6i-a31-ccu")) + return (ENXIO); -static struct clk_mux_def *mux_clks[] = { - &cpu_clk, - &daudio0mux_clk, - &daudio1mux_clk, -}; + device_set_desc(dev, "Allwinner A31 Clock Control Unit NG"); + return (BUS_PROBE_DEFAULT); +} -static struct clk_fixed_def *fixed_factor_clks[] = { - &pll_audio_2x_clk, - &pll_audio_4x_clk, - &pll_audio_8x_clk, - &pll_video0_2x_clk, - &pll_periph_2x_clk, - &pll_video1_2x_clk, -}; - -static struct aw_clk_init init_clks[] = { -}; - -void -ccu_a31_register_clocks(struct aw_ccung_softc *sc) +static int +ccu_a31_attach(device_t dev) { - int i; + struct aw_ccung_softc *sc; + sc = device_get_softc(dev); + sc->resets = a31_ccu_resets; sc->nresets = nitems(a31_ccu_resets); sc->gates = a31_ccu_gates; sc->ngates = nitems(a31_ccu_gates); - sc->clk_init = init_clks; - sc->n_clk_init = nitems(init_clks); + sc->clks = a31_ccu_clks; + sc->nclks = nitems(a31_ccu_clks); - for (i = 0; i < nitems(nkmp_clks); i++) - aw_clk_nkmp_register(sc->clkdom, nkmp_clks[i]); - for (i = 0; i < nitems(nm_clks); i++) - aw_clk_nm_register(sc->clkdom, nm_clks[i]); - for (i = 0; i < nitems(prediv_mux_clks); i++) - aw_clk_prediv_mux_register(sc->clkdom, prediv_mux_clks[i]); - - for (i = 0; i < nitems(mux_clks); i++) - clknode_mux_register(sc->clkdom, mux_clks[i]); - for (i = 0; i < nitems(div_clks); i++) - clknode_div_register(sc->clkdom, div_clks[i]); - for (i = 0; i < nitems(fixed_factor_clks); i++) - clknode_fixed_register(sc->clkdom, fixed_factor_clks[i]); + return (aw_ccung_attach(dev)); } + +static device_method_t ccu_a31ng_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ccu_a31_probe), + DEVMETHOD(device_attach, ccu_a31_attach), + + DEVMETHOD_END +}; + +static devclass_t ccu_a31ng_devclass; + +DEFINE_CLASS_1(ccu_a31ng, ccu_a31ng_driver, ccu_a31ng_methods, + sizeof(struct aw_ccung_softc), aw_ccung_driver); + +EARLY_DRIVER_MODULE(ccu_a31ng, simplebus, ccu_a31ng_driver, + ccu_a31ng_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); Modified: head/sys/arm/allwinner/clkng/ccu_a64.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_a64.c Fri Jun 15 06:03:40 2018 (r335189) +++ head/sys/arm/allwinner/clkng/ccu_a64.c Fri Jun 15 08:36:21 2018 (r335190) @@ -1,7 +1,8 @@ /*- - * Copyright (c) 2017 Emmanuel Vadot - * All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * + * Copyright (c) 2017,2018 Emmanuel Vadot + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -32,22 +33,25 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include +#include +#include + +#include +#include + #include #include #include #include -#include -#include -#include -#include #include #include -#include "ccu_a64.h" - /* Non-exported clocks */ #define CLK_OSC_12M 0 @@ -680,99 +684,106 @@ NM_CLK(gpu_clk, 31, /* gate */ AW_CLK_HAS_GATE); /* flags */ -static struct aw_clk_nkmp_def *nkmp_clks[] = { - &pll_cpux_clk, - &pll_audio_clk, - &pll_periph0_2x_clk, - &pll_periph1_2x_clk, - &pll_ddr0_clk, - &pll_ddr1_clk, +static struct aw_ccung_clk a64_ccu_clks[] = { + { .type = AW_CLK_NKMP, .clk.nkmp = &pll_cpux_clk}, + { .type = AW_CLK_NKMP, .clk.nkmp = &pll_audio_clk}, + { .type = AW_CLK_NKMP, .clk.nkmp = &pll_periph0_2x_clk}, + { .type = AW_CLK_NKMP, .clk.nkmp = &pll_periph1_2x_clk}, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Jun 15 10:03:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A3671012BD2 for ; Fri, 15 Jun 2018 10:03:10 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A4AC984CB6 for ; Fri, 15 Jun 2018 10:03:09 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by mail-wm0-x243.google.com with SMTP id x6-v6so2608075wmc.3 for ; Fri, 15 Jun 2018 03:03:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=O5TwY3sk0xyGeJYrtR9yDm1hT9e2xxBwxa1ipBjD5qs=; b=hEGD2eMVse57+J7cW5+2Zz6Xck32X6ZqnJvudEtooI8McdP+owkleR+X/1zDInTy8W uqtd3yTC+5WGKxSwQOlc7GFj+yGMZeiZezVfgBqYcuu81mHa/owaLo61sDWYxr+TLqG0 Y+RsJ+w9gYZMP7mpem0iiV7KzVB27YUg80hyJsEwZbKZ+JLDnuPv4bZCTTh/NdSh0C/p UPBY0TqsGk1VD5J7eoQpqd+ihEKVqnN3GloVBqK6bsqamjokWhookhVDT7LgnGv6fxBZ Yt7XcGeaLeF2VofNCsCGELWHbkZxrzzmgwzzjp6i/HEmJ2ou5imV64V6rY5E+Gsrywlf jWuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=O5TwY3sk0xyGeJYrtR9yDm1hT9e2xxBwxa1ipBjD5qs=; b=r7N+BXVqgJMkjBVsmtxXd6YWT7vo7B3z7DklTLT+Axd+ARC1oUEUgOiea0zOKfALPL bFNX74QVr4VBPimBkel1xbO5CxRlPclzj+JVaaD1IYHxT55b0boAgIJmsbQ8CGZ7AQ2J XWX4eR436mF5GhZo8CpDRzHb3KJf+1I9jV8ZwRFAyrlHC9RNlPgtpnlXDfCUTZvwcEbK T67DyTiUqeYLuQSFacv7EvgXTA6FfJLpGxygz1vnnHC6pGsvCDs9foF+HmEQGSGJ1cEc /hzyMWZz0w5AWyY+77BnO8xZKONXDB/4q1cUJUWkTqPVOWWYpsNEnk8+VliaNPkbGaUM y0AA== X-Gm-Message-State: APt69E0g7iu0YXmwECBL45P5kT762nIwYsTl+rbRWFJIwPcGyipPPb01 K8Re6PgnLYhgFpRm8/CrU0InWkcJnJQ= X-Google-Smtp-Source: ADUXVKJoS89FHjZOhuZHkL1jmE5eLR3385AD7/38bKuBwAOcgXPw/lyBy22POY4+IYIlZ8euUyzprw== X-Received: by 2002:a50:d08e:: with SMTP id v14-v6mr1318594edd.182.1529056988254; Fri, 15 Jun 2018 03:03:08 -0700 (PDT) Received: from [10.44.128.75] ([161.12.40.153]) by smtp.gmail.com with ESMTPSA id p6-v6sm3454679eda.91.2018.06.15.03.03.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Jun 2018 03:03:06 -0700 (PDT) Subject: Re: svn commit: r335171 - head/sys/vm To: Alan Cox Cc: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201806141941.w5EJf2qa069373@repo.freebsd.org> From: Steven Hartland Message-ID: <603230da-cfe2-e3e2-bd9a-f5230b30e371@multiplay.co.uk> Date: Fri, 15 Jun 2018 11:03:06 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 10:03:10 -0000 On 15/06/2018 00:07, Alan Cox wrote: > >> On Jun 14, 2018, at 5:54 PM, Steven Hartland >> > > wrote: >> >> Out of interest, how would this exhibit itself? >> > > A panic in vm_page_insert_after(). > So just to confirm this couldn't cause random memory corruption of the parent process?     Regards     Steve From owner-svn-src-head@freebsd.org Fri Jun 15 11:03:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0A831018921; Fri, 15 Jun 2018 11:03:14 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A49687172; Fri, 15 Jun 2018 11:03:14 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTP id w5FB33Sf088054; Fri, 15 Jun 2018 14:03:06 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w5FB33Sf088054 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w5FB33YB088053; Fri, 15 Jun 2018 14:03:03 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 15 Jun 2018 14:03:03 +0300 From: Konstantin Belousov To: Steven Hartland Cc: Alan Cox , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335171 - head/sys/vm Message-ID: <20180615110303.GN2493@kib.kiev.ua> References: <201806141941.w5EJf2qa069373@repo.freebsd.org> <603230da-cfe2-e3e2-bd9a-f5230b30e371@multiplay.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <603230da-cfe2-e3e2-bd9a-f5230b30e371@multiplay.co.uk> User-Agent: Mutt/1.10.0 (2018-05-17) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 11:03:15 -0000 On Fri, Jun 15, 2018 at 11:03:06AM +0100, Steven Hartland wrote: > On 15/06/2018 00:07, Alan Cox wrote: > > > >> On Jun 14, 2018, at 5:54 PM, Steven Hartland > >> >> > wrote: > >> > >> Out of interest, how would this exhibit itself? > >> > > > > A panic in vm_page_insert_after(). > > > So just to confirm this couldn't cause random memory corruption of the > parent process? No, or to put it more sincere, I highly doubt it. Also, I do not think that this Go issue will be solved serendipitously by some FreeBSD bug fix. So far it is indicative that either the situation is too unique for the Go runtime so it is not exposed by other programs (which is quite doubtful), or this is a bug in Go runtime. The only way forward is to understand what exactly is broken for the situation. This requires at least deep knowledge the Go garbage collector internal working, which itself supposes understanding of the Go runtime and Go environment. I do not mean explanation of the assert, but the root cause that eventually triggers the assert. They are somewhat disjoint in time, I believe. I once tried to look at the Go gc, but after spending a day, realized that I need to use 2-3 weeks to learn the system, which made me abandon the attempt. So the pre-req for fixing this bug is for somebody who interested in Go, to spend enough time to explain the root-cause condition to the external world. I have no idea is it OS problem, Go runtime problem, or an issue with the port of Go runtime to FreeBSD. From owner-svn-src-head@freebsd.org Fri Jun 15 11:52:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75987101D8E8; Fri, 15 Jun 2018 11:52:35 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 289EE690AA; Fri, 15 Jun 2018 11:52:35 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 097E5170A1; Fri, 15 Jun 2018 11:52:35 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FBqYgt071124; Fri, 15 Jun 2018 11:52:34 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FBqYnU071121; Fri, 15 Jun 2018 11:52:34 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201806151152.w5FBqYnU071121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 15 Jun 2018 11:52:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335192 - head/usr.sbin/pnfsdskill X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/pnfsdskill X-SVN-Commit-Revision: 335192 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 11:52:35 -0000 Author: rmacklem Date: Fri Jun 15 11:52:34 2018 New Revision: 335192 URL: https://svnweb.freebsd.org/changeset/base/335192 Log: Add a command that disables a pNFS server mirrored DS. This command can be used by a sysadmin to disable a malfunctioning pNFS server mirrored DS. It is safe to use when a mirrored DS has already been disabled via an I/O or network partitioning error. Added: head/usr.sbin/pnfsdskill/ head/usr.sbin/pnfsdskill/Makefile (contents, props changed) head/usr.sbin/pnfsdskill/pnfsdskill.8 (contents, props changed) head/usr.sbin/pnfsdskill/pnfsdskill.c (contents, props changed) Added: head/usr.sbin/pnfsdskill/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pnfsdskill/Makefile Fri Jun 15 11:52:34 2018 (r335192) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +PROG= pnfsdskill +MAN= pnfsdskill.8 + +.include Added: head/usr.sbin/pnfsdskill/pnfsdskill.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pnfsdskill/pnfsdskill.8 Fri Jun 15 11:52:34 2018 (r335192) @@ -0,0 +1,64 @@ +.\" Copyright (c) 2018 Rick Macklem +.\" +.\" 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 March 9, 2018 +.Dt PNFSDSKILL 8 +.Os +.Sh NAME +.Nm pnfsdskill +.Nd +disables a pNFS data storage server (DS) +.Sh SYNOPSIS +.Nm +.Ar mounted-on-DS-dir +.Sh DESCRIPTION +The +.Nm +command disables one DS when mirroring is enabled. +If one mirrored DS is malfunctioning, a system administrator +may use this command on the metadata server (MDS) to disable use of this mirror. +This command must be used on the MDS and the +.Ar mounted-on-DS-dir +must be the exact pathname used when mounting the DS on the MDS. +.Pp +If this command fails with +.Dq Device not configured +(ENXIO), it probably +means that the DS has already been disabled due to an error either detected +by the MDS or reported to the MDS by a client. +.Pp +The pNFS service should continue to run normally so long as the number of +operational DSs is at least as many as the level of mirroring. +.El +.Sh SEE ALSO +.Xr nfsv4 4 , +.Xr pnfs 4 , +.Xr nfsd 8 , +.Xr pnfsdscopymr 8 , +.Xr pnfsdsfile 8 +.Sh HISTORY +The +.Nm +command appeared in FreeBSD12. Added: head/usr.sbin/pnfsdskill/pnfsdskill.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pnfsdskill/pnfsdskill.c Fri Jun 15 11:52:34 2018 (r335192) @@ -0,0 +1,76 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2017 Rick Macklem + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +static void usage(void); + +/* + * This program disables use of a DS mirror. The "dspath" command line + * argument must be an exact match for the mounted-on path of the DS. + * It should be done before any forced dismount is performed on the path + * and should work even when the mount point is hung. + */ +int +main(int argc, char *argv[]) +{ + struct nfsd_pnfsd_args pnfsdarg; + + if (argc != 2) + usage(); + if (geteuid() != 0) + errx(1, "Must be run as root/su"); + + pnfsdarg.op = PNFSDOP_DELDSSERVER; + pnfsdarg.dspath = argv[1]; + if (nfssvc(NFSSVC_PNFSDS, &pnfsdarg) < 0) + err(1, "Can't kill %s", argv[1]); +} + +static void +usage(void) +{ + + fprintf(stderr, "pnfsdsfile [filepath]\n"); + exit(1); +} + From owner-svn-src-head@freebsd.org Fri Jun 15 11:54:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B5A1101DCCF; Fri, 15 Jun 2018 11:54:56 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E225A69292; Fri, 15 Jun 2018 11:54:55 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF3ED170A4; Fri, 15 Jun 2018 11:54:55 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FBst02071261; Fri, 15 Jun 2018 11:54:55 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FBstNt071260; Fri, 15 Jun 2018 11:54:55 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201806151154.w5FBstNt071260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 15 Jun 2018 11:54:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335193 - head/usr.sbin X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin X-SVN-Commit-Revision: 335193 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 11:54:56 -0000 Author: rmacklem Date: Fri Jun 15 11:54:55 2018 New Revision: 335193 URL: https://svnweb.freebsd.org/changeset/base/335193 Log: Add an entry into the Makefile for pnfsdskill. pnfsdskill was added by r335192. This commit adds an entry for it to the Makefile. Modified: head/usr.sbin/Makefile Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Fri Jun 15 11:52:34 2018 (r335192) +++ head/usr.sbin/Makefile Fri Jun 15 11:54:55 2018 (r335193) @@ -59,6 +59,7 @@ SUBDIR= adduser \ nologin \ pciconf \ periodic \ + pnfsdskill \ powerd \ prometheus_sysctl_exporter \ pstat \ From owner-svn-src-head@freebsd.org Fri Jun 15 12:28:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3B9F1021740; Fri, 15 Jun 2018 12:28:44 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A8C86A910; Fri, 15 Jun 2018 12:28:44 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E78417584; Fri, 15 Jun 2018 12:28:44 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FCSis8086916; Fri, 15 Jun 2018 12:28:44 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FCSiBL086915; Fri, 15 Jun 2018 12:28:44 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201806151228.w5FCSiBL086915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 15 Jun 2018 12:28:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335194 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 335194 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 12:28:45 -0000 Author: tuexen Date: Fri Jun 15 12:28:43 2018 New Revision: 335194 URL: https://svnweb.freebsd.org/changeset/base/335194 Log: When retransmitting TCP SYN-ACK segments with the TCP timestamp option enabled use an updated timestamp instead of reusing the one used in the initial TCP SYN-ACK segment. This patch ensures that an updated timestamp is used when sending the SYN-ACK from the syncache code. It was already done if the SYN-ACK was retransmitted from the generic code. This makes the behaviour consistent and also conformant with the TCP specification. Reviewed by: jtl@, Jason Eggleston MFC after: 1 month Sponsored by: Neflix, Inc. Differential Revision: https://reviews.freebsd.org/D15634 Modified: head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_syncache.h Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Fri Jun 15 11:54:55 2018 (r335193) +++ head/sys/netinet/tcp_syncache.c Fri Jun 15 12:28:43 2018 (r335194) @@ -1168,25 +1168,6 @@ syncache_expand(struct in_conninfo *inc, struct tcpopt } } - /* - * If timestamps were negotiated, the reflected timestamp - * must be equal to what we actually sent in the SYN|ACK - * except in the case of 0. Some boxes are known for sending - * broken timestamp replies during the 3whs (and potentially - * during the connection also). - * - * Accept the final ACK of 3whs with reflected timestamp of 0 - * instead of sending a RST and deleting the syncache entry. - */ - if ((to->to_flags & TOF_TS) && to->to_tsecr && - to->to_tsecr != sc->sc_ts) { - if ((s = tcp_log_addrs(inc, th, NULL, NULL))) - log(LOG_DEBUG, "%s; %s: TSECR %u != TS %u, " - "segment rejected\n", - s, __func__, to->to_tsecr, sc->sc_ts); - goto failed; - } - *lsop = syncache_socket(sc, *lsop, m); if (*lsop == NULL) @@ -1513,7 +1494,6 @@ skip_alloc: */ if (to->to_flags & TOF_TS) { sc->sc_tsreflect = to->to_tsval; - sc->sc_ts = tcp_ts_getticks(); sc->sc_flags |= SCF_TIMESTAMP; } if (to->to_flags & TOF_SCALE) { @@ -1742,8 +1722,7 @@ syncache_respond(struct syncache *sc, struct syncache_ to.to_flags |= TOF_SCALE; } if (sc->sc_flags & SCF_TIMESTAMP) { - /* Virgin timestamp or TCP cookie enhanced one. */ - to.to_tsval = sc->sc_ts; + to.to_tsval = sc->sc_tsoff + tcp_ts_getticks(); to.to_tsecr = sc->sc_tsreflect; to.to_flags |= TOF_TS; } @@ -2050,8 +2029,7 @@ syncookie_generate(struct syncache_head *sch, struct s /* Randomize the timestamp. */ if (sc->sc_flags & SCF_TIMESTAMP) { - sc->sc_ts = arc4random(); - sc->sc_tsoff = sc->sc_ts - tcp_ts_getticks(); + sc->sc_tsoff = arc4random() - tcp_ts_getticks(); } TCPSTAT_INC(tcps_sc_sendcookie); @@ -2140,7 +2118,6 @@ syncookie_lookup(struct in_conninfo *inc, struct synca if (to->to_flags & TOF_TS) { sc->sc_flags |= SCF_TIMESTAMP; sc->sc_tsreflect = to->to_tsval; - sc->sc_ts = to->to_tsecr; sc->sc_tsoff = to->to_tsecr - tcp_ts_getticks(); } Modified: head/sys/netinet/tcp_syncache.h ============================================================================== --- head/sys/netinet/tcp_syncache.h Fri Jun 15 11:54:55 2018 (r335193) +++ head/sys/netinet/tcp_syncache.h Fri Jun 15 12:28:43 2018 (r335194) @@ -56,7 +56,6 @@ struct syncache { int sc_rxttime; /* retransmit time */ u_int16_t sc_rxmits; /* retransmit counter */ u_int32_t sc_tsreflect; /* timestamp to reflect */ - u_int32_t sc_ts; /* our timestamp to send */ u_int32_t sc_tsoff; /* ts offset w/ syncookies */ u_int32_t sc_flowlabel; /* IPv6 flowlabel */ tcp_seq sc_irs; /* seq from peer */ From owner-svn-src-head@freebsd.org Fri Jun 15 13:14:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47BD21002ECB; Fri, 15 Jun 2018 13:14:47 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F294C6C946; Fri, 15 Jun 2018 13:14:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B99B017D9B; Fri, 15 Jun 2018 13:14:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FDEkmm012919; Fri, 15 Jun 2018 13:14:46 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FDEkY9012916; Fri, 15 Jun 2018 13:14:46 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201806151314.w5FDEkY9012916@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 15 Jun 2018 13:14:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335195 - head/sys/dev/extres/regulator X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/extres/regulator X-SVN-Commit-Revision: 335195 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 13:14:47 -0000 Author: kevans Date: Fri Jun 15 13:14:45 2018 New Revision: 335195 URL: https://svnweb.freebsd.org/changeset/base/335195 Log: Revert r335173 at request of mmel@ This was the wrong solution to the problem; regulator_shutdown invokes regnode_stop. regulator_stop is not a refcounting method, but it invokes regnode_enable, which is. mmel@ has a proposed patch/solution to instead provide regnode_fixed_stop behavior that properly takes shared GPIO pins into account. Modified: head/sys/dev/extres/regulator/regulator.c head/sys/dev/extres/regulator/regulator.h head/sys/dev/extres/regulator/regulator_fixed.c Modified: head/sys/dev/extres/regulator/regulator.c ============================================================================== --- head/sys/dev/extres/regulator/regulator.c Fri Jun 15 12:28:43 2018 (r335194) +++ head/sys/dev/extres/regulator/regulator.c Fri Jun 15 13:14:45 2018 (r335195) @@ -507,20 +507,6 @@ struct regnode_std_param *regnode_get_stdparam(struct return (®node->std_param); } -void -regnode_enable_cnt_inc(struct regnode *regnode) -{ - - regnode->enable_cnt++; -} - -void -regnode_enable_cnt_dec(struct regnode *regnode) -{ - - regnode->enable_cnt--; -} - void regnode_topo_unlock(void) { Modified: head/sys/dev/extres/regulator/regulator.h ============================================================================== --- head/sys/dev/extres/regulator/regulator.h Fri Jun 15 12:28:43 2018 (r335194) +++ head/sys/dev/extres/regulator/regulator.h Fri Jun 15 13:14:45 2018 (r335195) @@ -106,8 +106,6 @@ int regnode_get_flags(struct regnode *regnode); void *regnode_get_softc(struct regnode *regnode); device_t regnode_get_device(struct regnode *regnode); struct regnode_std_param *regnode_get_stdparam(struct regnode *regnode); -void regnode_enable_cnt_inc(struct regnode *regnode); -void regnode_enable_cnt_dec(struct regnode *regnode); void regnode_topo_unlock(void); void regnode_topo_xlock(void); void regnode_topo_slock(void); Modified: head/sys/dev/extres/regulator/regulator_fixed.c ============================================================================== --- head/sys/dev/extres/regulator/regulator_fixed.c Fri Jun 15 12:28:43 2018 (r335194) +++ head/sys/dev/extres/regulator/regulator_fixed.c Fri Jun 15 13:14:45 2018 (r335195) @@ -156,8 +156,6 @@ regnode_fixed_init(struct regnode *regnode) if (sc->gpio_open_drain) flags |= GPIO_PIN_OPENDRAIN; enable = sc->param->boot_on || sc->param->always_on; - if (enable) - regnode_enable_cnt_inc(regnode); if (!sc->param->enable_active_high) enable = !enable; rv = GPIO_PIN_SET(pin->dev, pin->pin, enable); @@ -196,14 +194,12 @@ regnode_fixed_enable(struct regnode *regnode, bool ena return (0); pin = &sc->gpio_entry->gpio_pin; if (enable) { - regnode_enable_cnt_inc(regnode); sc->gpio_entry->enable_cnt++; if (sc->gpio_entry->enable_cnt > 1) return (0); } else { KASSERT(sc->gpio_entry->enable_cnt > 0, ("Invalid enable count")); - regnode_enable_cnt_dec(regnode); sc->gpio_entry->enable_cnt--; if (sc->gpio_entry->enable_cnt >= 1) return (0); From owner-svn-src-head@freebsd.org Fri Jun 15 13:53:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 377F310070EC; Fri, 15 Jun 2018 13:53:38 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E1F336E933; Fri, 15 Jun 2018 13:53:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C309218409; Fri, 15 Jun 2018 13:53:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FDrb3v033356; Fri, 15 Jun 2018 13:53:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FDrbcO033355; Fri, 15 Jun 2018 13:53:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806151353.w5FDrbcO033355@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 15 Jun 2018 13:53:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335198 - head/sys/compat/linprocfs X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/compat/linprocfs X-SVN-Commit-Revision: 335198 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 13:53:38 -0000 Author: emaste Date: Fri Jun 15 13:53:37 2018 New Revision: 335198 URL: https://svnweb.freebsd.org/changeset/base/335198 Log: Add stubbed arm64 linuxulator /proc/cpuinfo handler Sponsored by: Turing Robotic Industries Modified: head/sys/compat/linprocfs/linprocfs.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Fri Jun 15 13:49:11 2018 (r335197) +++ head/sys/compat/linprocfs/linprocfs.c Fri Jun 15 13:53:37 2018 (r335198) @@ -317,6 +317,32 @@ linprocfs_docpuinfo(PFS_FILL_ARGS) return (0); } +#else +/* ARM64TODO: implement non-stubbed linprocfs_docpuinfo */ +static int +linprocfs_docpuinfo(PFS_FILL_ARGS) +{ + int i; + + for (i = 0; i < mp_ncpus; ++i) { + sbuf_printf(sb, + "processor\t: %d\n" + "BogoMIPS\t: %d.%02d\n", + i, 0, 0); + sbuf_cat(sb, "Features\t: "); + sbuf_cat(sb, "\n"); + sbuf_printf(sb, + "CPU implementer\t: \n" + "CPU architecture: \n" + "CPU variant\t: 0x%x\n" + "CPU part\t: 0x%x\n" + "CPU revision\t: %d\n", + 0, 0, 0); + sbuf_cat(sb, "\n"); + } + + return (0); +} #endif /* __i386__ || __amd64__ */ /* @@ -1653,7 +1679,7 @@ linprocfs_uninit(PFS_INIT_ARGS) } PSEUDOFS(linprocfs, 1, VFCF_JAIL); -#if defined(__amd64__) +#if defined(__aarch64__) || defined(__amd64__) MODULE_DEPEND(linprocfs, linux_common, 1, 1, 1); #else MODULE_DEPEND(linprocfs, linux, 1, 1, 1); From owner-svn-src-head@freebsd.org Fri Jun 15 13:56:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B0801007675; Fri, 15 Jun 2018 13:56:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 325CA6EC66; Fri, 15 Jun 2018 13:56:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 133D41840B; Fri, 15 Jun 2018 13:56:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FDuwli033681; Fri, 15 Jun 2018 13:56:58 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FDuwq9033680; Fri, 15 Jun 2018 13:56:58 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201806151356.w5FDuwq9033680@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 15 Jun 2018 13:56:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335199 - head/sys/compat/linprocfs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/compat/linprocfs X-SVN-Commit-Revision: 335199 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 13:56:59 -0000 Author: kib Date: Fri Jun 15 13:56:58 2018 New Revision: 335199 URL: https://svnweb.freebsd.org/changeset/base/335199 Log: linprocfs: add TracerPid to /proc/pid/status. Also fix the value of parent pid if the process is traced. Submitted by: Yanko Yankulov MFC after: 1 week Modified: head/sys/compat/linprocfs/linprocfs.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Fri Jun 15 13:53:37 2018 (r335198) +++ head/sys/compat/linprocfs/linprocfs.c Fri Jun 15 13:56:58 2018 (r335199) @@ -829,8 +829,8 @@ linprocfs_doprocstatus(PFS_FILL_ARGS) * Credentials */ sbuf_printf(sb, "Pid:\t%d\n", p->p_pid); - sbuf_printf(sb, "PPid:\t%d\n", p->p_pptr ? - p->p_pptr->p_pid : 0); + sbuf_printf(sb, "PPid:\t%d\n", kp.ki_ppid ); + sbuf_printf(sb, "TracerPid:\t%d\n", kp.ki_tracer ); sbuf_printf(sb, "Uid:\t%d %d %d %d\n", p->p_ucred->cr_ruid, p->p_ucred->cr_uid, p->p_ucred->cr_svuid, From owner-svn-src-head@freebsd.org Fri Jun 15 14:29:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0723100AFC5; Fri, 15 Jun 2018 14:29:42 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 56B7970DB9; Fri, 15 Jun 2018 14:29:42 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3768B18914; Fri, 15 Jun 2018 14:29:42 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FETg4H050633; Fri, 15 Jun 2018 14:29:42 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FETgx7050632; Fri, 15 Jun 2018 14:29:42 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806151429.w5FETgx7050632@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 15 Jun 2018 14:29:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335200 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 335200 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 14:29:42 -0000 Author: emaste Date: Fri Jun 15 14:29:41 2018 New Revision: 335200 URL: https://svnweb.freebsd.org/changeset/base/335200 Log: Correct debug control for linuxulator faccessat The Linuxulator provides per-syscall debug control via the compat.linux.debug sysctl. There's generally a 1:1 mapping between sysctl setting and syscall, but faccessat was controlled by the access setting, perhaps due to copy-paste. Sponsored by: Turing Robotic Industries Modified: head/sys/compat/linux/linux_file.c Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Fri Jun 15 13:56:58 2018 (r335199) +++ head/sys/compat/linux/linux_file.c Fri Jun 15 14:29:41 2018 (r335200) @@ -554,7 +554,7 @@ linux_faccessat(struct thread *td, struct linux_facces LCONVPATHEXIST_AT(td, args->filename, &path, dfd); #ifdef DEBUG - if (ldebug(access)) + if (ldebug(faccessat)) printf(ARGS(access, "%s, %d"), path, args->amode); #endif From owner-svn-src-head@freebsd.org Fri Jun 15 14:41:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55408100C65A; Fri, 15 Jun 2018 14:41:54 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B235717D6; Fri, 15 Jun 2018 14:41:54 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E0F2618C10; Fri, 15 Jun 2018 14:41:53 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FEfrTh057609; Fri, 15 Jun 2018 14:41:53 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FEfqwu056379; Fri, 15 Jun 2018 14:41:52 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806151441.w5FEfqwu056379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 15 Jun 2018 14:41:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335201 - in head/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Commit-Revision: 335201 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 14:41:54 -0000 Author: emaste Date: Fri Jun 15 14:41:51 2018 New Revision: 335201 URL: https://svnweb.freebsd.org/changeset/base/335201 Log: linuxulator: do not include legacy syscalls on arm64 Existing linuxulator platforms (i386, amd64) support legacy syscalls, such as non-*at ones like open, but arm64 and other new platforms do not. Wrap these in #ifdef LINUX_LEGACY_SYSCALLS, #defined in the MD linux.h files. We may need finer grained control in the future but this is sufficient for now. Reviewed by: andrew Sponsored by: Turing Robotic Industries Differential Revision: https://reviews.freebsd.org/D15237 Modified: head/sys/amd64/linux/linux.h head/sys/amd64/linux32/linux.h head/sys/compat/linux/linux_event.c head/sys/compat/linux/linux_file.c head/sys/compat/linux/linux_fork.c head/sys/compat/linux/linux_misc.c head/sys/compat/linux/linux_stats.c head/sys/compat/linux/linux_sysctl.c head/sys/i386/linux/linux.h Modified: head/sys/amd64/linux/linux.h ============================================================================== --- head/sys/amd64/linux/linux.h Fri Jun 15 14:29:41 2018 (r335200) +++ head/sys/amd64/linux/linux.h Fri Jun 15 14:41:51 2018 (r335201) @@ -35,6 +35,8 @@ #include #include +#define LINUX_LEGACY_SYSCALLS + /* * debugging support */ Modified: head/sys/amd64/linux32/linux.h ============================================================================== --- head/sys/amd64/linux32/linux.h Fri Jun 15 14:29:41 2018 (r335200) +++ head/sys/amd64/linux32/linux.h Fri Jun 15 14:41:51 2018 (r335201) @@ -38,6 +38,8 @@ #include #include +#define LINUX_LEGACY_SYSCALLS + /* * debugging support */ Modified: head/sys/compat/linux/linux_event.c ============================================================================== --- head/sys/compat/linux/linux_event.c Fri Jun 15 14:29:41 2018 (r335200) +++ head/sys/compat/linux/linux_event.c Fri Jun 15 14:41:51 2018 (r335201) @@ -263,6 +263,7 @@ epoll_create_common(struct thread *td, int flags) return (0); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_epoll_create(struct thread *td, struct linux_epoll_create_args *args) { @@ -276,6 +277,7 @@ linux_epoll_create(struct thread *td, struct linux_epo return (epoll_create_common(td, 0)); } +#endif int linux_epoll_create1(struct thread *td, struct linux_epoll_create1_args *args) @@ -616,6 +618,7 @@ leave1: return (error); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_epoll_wait(struct thread *td, struct linux_epoll_wait_args *args) { @@ -623,6 +626,7 @@ linux_epoll_wait(struct thread *td, struct linux_epoll return (linux_epoll_wait_common(td, args->epfd, args->events, args->maxevents, args->timeout, NULL)); } +#endif int linux_epoll_pwait(struct thread *td, struct linux_epoll_pwait_args *args) @@ -707,12 +711,14 @@ eventfd_create(struct thread *td, uint32_t initval, in return (error); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_eventfd(struct thread *td, struct linux_eventfd_args *args) { return (eventfd_create(td, args->initval, 0)); } +#endif int linux_eventfd2(struct thread *td, struct linux_eventfd2_args *args) Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Fri Jun 15 14:29:41 2018 (r335200) +++ head/sys/compat/linux/linux_file.c Fri Jun 15 14:41:51 2018 (r335201) @@ -68,6 +68,7 @@ static int linux_common_open(struct thread *, int, cha static int linux_getdents_error(struct thread *, int, int); +#ifdef LINUX_LEGACY_SYSCALLS int linux_creat(struct thread *td, struct linux_creat_args *args) { @@ -84,8 +85,8 @@ linux_creat(struct thread *td, struct linux_creat_args LFREEPATH(path); return (error); } +#endif - static int linux_common_open(struct thread *td, int dirfd, char *path, int l_flags, int mode) { @@ -165,7 +166,11 @@ linux_common_open(struct thread *td, int dirfd, char * done: #ifdef DEBUG +#ifdef LINUX_LEGACY_SYSCALLS if (ldebug(open)) +#else + if (ldebug(openat)) +#endif printf(LMSG("open returns error %d"), error); #endif LFREEPATH(path); @@ -191,6 +196,7 @@ linux_openat(struct thread *td, struct linux_openat_ar return (linux_common_open(td, dfd, path, args->flags, args->mode)); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_open(struct thread *td, struct linux_open_args *args) { @@ -207,6 +213,7 @@ linux_open(struct thread *td, struct linux_open_args * #endif return (linux_common_open(td, AT_FDCWD, path, args->flags, args->mode)); } +#endif int linux_lseek(struct thread *td, struct linux_lseek_args *args) @@ -305,6 +312,7 @@ struct l_dirent64 { roundup(offsetof(struct l_dirent64, d_name) + (namlen) + 1, \ sizeof(uint64_t)) +#ifdef LINUX_LEGACY_SYSCALLS int linux_getdents(struct thread *td, struct linux_getdents_args *args) { @@ -384,6 +392,7 @@ out1: free(buf, M_TEMP); return (error); } +#endif int linux_getdents64(struct thread *td, struct linux_getdents64_args *args) @@ -517,6 +526,7 @@ out: * These exist mainly for hooks for doing /compat/linux translation. */ +#ifdef LINUX_LEGACY_SYSCALLS int linux_access(struct thread *td, struct linux_access_args *args) { @@ -539,6 +549,7 @@ linux_access(struct thread *td, struct linux_access_ar return (error); } +#endif int linux_faccessat(struct thread *td, struct linux_faccessat_args *args) @@ -564,6 +575,7 @@ linux_faccessat(struct thread *td, struct linux_facces return (error); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_unlink(struct thread *td, struct linux_unlink_args *args) { @@ -590,6 +602,7 @@ linux_unlink(struct thread *td, struct linux_unlink_ar LFREEPATH(path); return (error); } +#endif int linux_unlinkat(struct thread *td, struct linux_unlinkat_args *args) @@ -639,6 +652,7 @@ linux_chdir(struct thread *td, struct linux_chdir_args return (error); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_chmod(struct thread *td, struct linux_chmod_args *args) { @@ -656,6 +670,7 @@ linux_chmod(struct thread *td, struct linux_chmod_args LFREEPATH(path); return (error); } +#endif int linux_fchmodat(struct thread *td, struct linux_fchmodat_args *args) @@ -676,6 +691,7 @@ linux_fchmodat(struct thread *td, struct linux_fchmoda return (error); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_mkdir(struct thread *td, struct linux_mkdir_args *args) { @@ -692,6 +708,7 @@ linux_mkdir(struct thread *td, struct linux_mkdir_args LFREEPATH(path); return (error); } +#endif int linux_mkdirat(struct thread *td, struct linux_mkdirat_args *args) @@ -711,6 +728,7 @@ linux_mkdirat(struct thread *td, struct linux_mkdirat_ return (error); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_rmdir(struct thread *td, struct linux_rmdir_args *args) { @@ -751,6 +769,7 @@ linux_rename(struct thread *td, struct linux_rename_ar LFREEPATH(to); return (error); } +#endif int linux_renameat(struct thread *td, struct linux_renameat_args *args) @@ -778,6 +797,7 @@ linux_renameat(struct thread *td, struct linux_renamea return (error); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_symlink(struct thread *td, struct linux_symlink_args *args) { @@ -801,6 +821,7 @@ linux_symlink(struct thread *td, struct linux_symlink_ LFREEPATH(to); return (error); } +#endif int linux_symlinkat(struct thread *td, struct linux_symlinkat_args *args) @@ -828,6 +849,7 @@ linux_symlinkat(struct thread *td, struct linux_symlin return (error); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_readlink(struct thread *td, struct linux_readlink_args *args) { @@ -846,6 +868,7 @@ linux_readlink(struct thread *td, struct linux_readlin LFREEPATH(name); return (error); } +#endif int linux_readlinkat(struct thread *td, struct linux_readlinkat_args *args) @@ -913,6 +936,7 @@ linux_ftruncate(struct thread *td, struct linux_ftrunc return (kern_ftruncate(td, args->fd, args->length)); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_link(struct thread *td, struct linux_link_args *args) { @@ -937,6 +961,7 @@ linux_link(struct thread *td, struct linux_link_args * LFREEPATH(to); return (error); } +#endif int linux_linkat(struct thread *td, struct linux_linkat_args *args) @@ -1138,6 +1163,7 @@ linux_oldumount(struct thread *td, struct linux_oldumo } #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ +#ifdef LINUX_LEGACY_SYSCALLS int linux_umount(struct thread *td, struct linux_umount_args *args) { @@ -1147,6 +1173,7 @@ linux_umount(struct thread *td, struct linux_umount_ar bsd.flags = args->flags; /* XXX correct? */ return (sys_unmount(td, &bsd)); } +#endif /* * fcntl family of syscalls @@ -1458,6 +1485,7 @@ linux_fcntl64(struct thread *td, struct linux_fcntl64_ } #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ +#ifdef LINUX_LEGACY_SYSCALLS int linux_chown(struct thread *td, struct linux_chown_args *args) { @@ -1475,6 +1503,7 @@ linux_chown(struct thread *td, struct linux_chown_args LFREEPATH(path); return (error); } +#endif int linux_fchownat(struct thread *td, struct linux_fchownat_args *args) @@ -1501,6 +1530,7 @@ linux_fchownat(struct thread *td, struct linux_fchowna return (error); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_lchown(struct thread *td, struct linux_lchown_args *args) { @@ -1518,6 +1548,7 @@ linux_lchown(struct thread *td, struct linux_lchown_ar LFREEPATH(path); return (error); } +#endif static int convert_fadvice(int advice) @@ -1566,6 +1597,7 @@ linux_fadvise64_64(struct thread *td, struct linux_fad } #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ +#ifdef LINUX_LEGACY_SYSCALLS int linux_pipe(struct thread *td, struct linux_pipe_args *args) { @@ -1589,6 +1621,7 @@ linux_pipe(struct thread *td, struct linux_pipe_args * return (error); } +#endif int linux_pipe2(struct thread *td, struct linux_pipe2_args *args) Modified: head/sys/compat/linux/linux_fork.c ============================================================================== --- head/sys/compat/linux/linux_fork.c Fri Jun 15 14:29:41 2018 (r335200) +++ head/sys/compat/linux/linux_fork.c Fri Jun 15 14:41:51 2018 (r335201) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef LINUX_LEGACY_SYSCALLS int linux_fork(struct thread *td, struct linux_fork_args *args) { @@ -135,6 +136,7 @@ linux_vfork(struct thread *td, struct linux_vfork_args return (0); } +#endif static int linux_clone_proc(struct thread *td, struct linux_clone_args *args) Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Fri Jun 15 14:29:41 2018 (r335200) +++ head/sys/compat/linux/linux_misc.c Fri Jun 15 14:41:51 2018 (r335201) @@ -191,6 +191,7 @@ linux_sysinfo(struct thread *td, struct linux_sysinfo_ return (copyout(&sysinfo, args->info, sizeof(sysinfo))); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_alarm(struct thread *td, struct linux_alarm_args *args) { @@ -225,6 +226,7 @@ linux_alarm(struct thread *td, struct linux_alarm_args td->td_retval[0] = old_it.it_value.tv_sec; return (0); } +#endif int linux_brk(struct thread *td, struct linux_brk_args *args) @@ -494,6 +496,7 @@ cleanup: #endif /* __i386__ */ +#ifdef LINUX_LEGACY_SYSCALLS int linux_select(struct thread *td, struct linux_select_args *args) { @@ -585,6 +588,7 @@ select_out: #endif return (error); } +#endif int linux_mremap(struct thread *td, struct linux_mremap_args *args) @@ -646,6 +650,7 @@ linux_msync(struct thread *td, struct linux_msync_args args->fl & ~LINUX_MS_SYNC)); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_time(struct thread *td, struct linux_time_args *args) { @@ -665,6 +670,7 @@ linux_time(struct thread *td, struct linux_time_args * td->td_retval[0] = tm; return (0); } +#endif struct l_times_argv { l_clock_t tms_utime; @@ -761,6 +767,7 @@ struct l_utimbuf { l_time_t l_modtime; }; +#ifdef LINUX_LEGACY_SYSCALLS int linux_utime(struct thread *td, struct linux_utime_args *args) { @@ -794,7 +801,9 @@ linux_utime(struct thread *td, struct linux_utime_args LFREEPATH(fname); return (error); } +#endif +#ifdef LINUX_LEGACY_SYSCALLS int linux_utimes(struct thread *td, struct linux_utimes_args *args) { @@ -827,6 +836,7 @@ linux_utimes(struct thread *td, struct linux_utimes_ar LFREEPATH(fname); return (error); } +#endif static int linux_utimensat_nsec_valid(l_long nsec) @@ -921,6 +931,7 @@ linux_utimensat(struct thread *td, struct linux_utimen return (error); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_futimesat(struct thread *td, struct linux_futimesat_args *args) { @@ -953,6 +964,7 @@ linux_futimesat(struct thread *td, struct linux_futime LFREEPATH(fname); return (error); } +#endif int linux_common_wait(struct thread *td, int pid, int *status, @@ -1094,6 +1106,7 @@ linux_waitid(struct thread *td, struct linux_waitid_ar return (error); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_mknod(struct thread *td, struct linux_mknod_args *args) { @@ -1142,6 +1155,7 @@ linux_mknod(struct thread *td, struct linux_mknod_args LFREEPATH(path); return (error); } +#endif int linux_mknodat(struct thread *td, struct linux_mknodat_args *args) Modified: head/sys/compat/linux/linux_stats.c ============================================================================== --- head/sys/compat/linux/linux_stats.c Fri Jun 15 14:29:41 2018 (r335200) +++ head/sys/compat/linux/linux_stats.c Fri Jun 15 14:41:51 2018 (r335201) @@ -81,6 +81,7 @@ linux_kern_statat(struct thread *td, int flag, int fd, translate_vnhook_major_minor)); } +#ifdef LINUX_LEGACY_SYSCALLS static int linux_kern_stat(struct thread *td, char *path, enum uio_seg pathseg, struct stat *sbp) @@ -97,6 +98,7 @@ linux_kern_lstat(struct thread *td, char *path, enum u return (linux_kern_statat(td, AT_SYMLINK_NOFOLLOW, AT_FDCWD, path, pathseg, sbp)); } +#endif static void translate_fd_major_minor(struct thread *td, int fd, struct stat *buf) @@ -173,6 +175,7 @@ newstat_copyout(struct stat *buf, void *ubuf) return (copyout(&tbuf, ubuf, sizeof(tbuf))); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_newstat(struct thread *td, struct linux_newstat_args *args) { @@ -214,6 +217,7 @@ linux_newlstat(struct thread *td, struct linux_newlsta return (error); return (newstat_copyout(&sb, args->buf)); } +#endif int linux_newfstat(struct thread *td, struct linux_newfstat_args *args) @@ -524,6 +528,7 @@ struct l_ustat char f_fpack[6]; }; +#ifdef LINUX_LEGACY_SYSCALLS int linux_ustat(struct thread *td, struct linux_ustat_args *args) { @@ -534,6 +539,7 @@ linux_ustat(struct thread *td, struct linux_ustat_args return (EOPNOTSUPP); } +#endif #if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) Modified: head/sys/compat/linux/linux_sysctl.c ============================================================================== --- head/sys/compat/linux/linux_sysctl.c Fri Jun 15 14:29:41 2018 (r335200) +++ head/sys/compat/linux/linux_sysctl.c Fri Jun 15 14:41:51 2018 (r335201) @@ -115,6 +115,7 @@ handle_string(struct l___sysctl_args *la, char *value) return (0); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_sysctl(struct thread *td, struct linux_sysctl_args *args) { @@ -191,3 +192,4 @@ linux_sysctl(struct thread *td, struct linux_sysctl_ar LIN_SDT_PROBE1(sysctl, linux_sysctl, return, ENOTDIR); return (ENOTDIR); } +#endif Modified: head/sys/i386/linux/linux.h ============================================================================== --- head/sys/i386/linux/linux.h Fri Jun 15 14:29:41 2018 (r335200) +++ head/sys/i386/linux/linux.h Fri Jun 15 14:41:51 2018 (r335201) @@ -35,6 +35,8 @@ #include #include +#define LINUX_LEGACY_SYSCALLS + /* * debugging support */ From owner-svn-src-head@freebsd.org Fri Jun 15 15:22:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA4DD100F1B7; Fri, 15 Jun 2018 15:22:28 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5FD197363E; Fri, 15 Jun 2018 15:22:28 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4128B192D1; Fri, 15 Jun 2018 15:22:28 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FFMSvN079792; Fri, 15 Jun 2018 15:22:28 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FFMSZI079791; Fri, 15 Jun 2018 15:22:28 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <201806151522.w5FFMSZI079791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Fri, 15 Jun 2018 15:22:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335205 - head/sys/compat/linprocfs X-SVN-Group: head X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: head/sys/compat/linprocfs X-SVN-Commit-Revision: 335205 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 15:22:28 -0000 Author: chuck Date: Fri Jun 15 15:22:27 2018 New Revision: 335205 URL: https://svnweb.freebsd.org/changeset/base/335205 Log: Add linprocfs support for min_free_kbytes This adds linprocfs support for proc/sys/vm/min_free_kbytes which the free program requires for correct operation. The approach mirrors the approach used in illumos. Reviewed by: imp (mentor), emaste Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D15563 Modified: head/sys/compat/linprocfs/linprocfs.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Fri Jun 15 15:10:21 2018 (r335204) +++ head/sys/compat/linprocfs/linprocfs.c Fri Jun 15 15:22:27 2018 (r335205) @@ -1303,6 +1303,21 @@ linprocfs_dosem(PFS_FILL_ARGS) } /* + * Filler function for proc/sys/vm/min_free_kbytes + * + * This mirrors the approach in illumos to return zero for reads. Effectively, + * it says, no memory is kept in reserve for "atomic allocations". This class + * of allocation can be used at times when a thread cannot be suspended. + */ +static int +linprocfs_dominfree(PFS_FILL_ARGS) +{ + + sbuf_printf(sb, "%d\n", 0); + return (0); +} + +/* * Filler function for proc/scsi/device_info */ static int @@ -1562,6 +1577,7 @@ linprocfs_init(PFS_INIT_ARGS) { struct pfs_node *root; struct pfs_node *dir; + struct pfs_node *sys; root = pi->pi_root; @@ -1643,9 +1659,9 @@ linprocfs_init(PFS_INIT_ARGS) NULL, NULL, NULL, PFS_RD); /* /proc/sys/... */ - dir = pfs_create_dir(root, "sys", NULL, NULL, NULL, 0); + sys = pfs_create_dir(root, "sys", NULL, NULL, NULL, 0); /* /proc/sys/kernel/... */ - dir = pfs_create_dir(dir, "kernel", NULL, NULL, NULL, 0); + dir = pfs_create_dir(sys, "kernel", NULL, NULL, NULL, 0); pfs_create_file(dir, "osrelease", &linprocfs_doosrelease, NULL, NULL, NULL, PFS_RD); pfs_create_file(dir, "ostype", &linprocfs_doostype, @@ -1662,6 +1678,11 @@ linprocfs_init(PFS_INIT_ARGS) /* /proc/sys/kernel/random/... */ dir = pfs_create_dir(dir, "random", NULL, NULL, NULL, 0); pfs_create_file(dir, "uuid", &linprocfs_douuid, + NULL, NULL, NULL, PFS_RD); + + /* /proc/sys/vm/.... */ + dir = pfs_create_dir(sys, "vm", NULL, NULL, NULL, 0); + pfs_create_file(dir, "min_free_kbytes", &linprocfs_dominfree, NULL, NULL, NULL, PFS_RD); return (0); From owner-svn-src-head@freebsd.org Fri Jun 15 15:28:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46EFF100F601; Fri, 15 Jun 2018 15:28:32 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EEDE0739B6; Fri, 15 Jun 2018 15:28:31 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D1841192F6; Fri, 15 Jun 2018 15:28:31 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FFSVt8081005; Fri, 15 Jun 2018 15:28:31 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FFSVbp081004; Fri, 15 Jun 2018 15:28:31 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201806151528.w5FFSVbp081004@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Fri, 15 Jun 2018 15:28:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335206 - head/cddl/contrib/opensolaris/cmd/zfs X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/zfs X-SVN-Commit-Revision: 335206 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 15:28:32 -0000 Author: vangyzen Date: Fri Jun 15 15:28:31 2018 New Revision: 335206 URL: https://svnweb.freebsd.org/changeset/base/335206 Log: Fix markup in zfs(8); no content change Sponsored by: Dell EMC Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri Jun 15 15:22:27 2018 (r335205) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri Jun 15 15:28:31 2018 (r335206) @@ -2674,7 +2674,9 @@ feature. .It Fl c, -compressed Generate a more compact stream by using compressed WRITE records for blocks which are compressed on disk and in memory (see the -.Sy compression property for details). If the +.Sy compression +property for details). +If the .Sy lz4_compress feature is active on the sending system, then the receiving system must have that feature enabled as well. If the From owner-svn-src-head@freebsd.org Fri Jun 15 15:32:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67F97100F9E8; Fri, 15 Jun 2018 15:32:03 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C00B73F2F; Fri, 15 Jun 2018 15:32:03 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D4E821949F; Fri, 15 Jun 2018 15:32:02 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FFW2jv086078; Fri, 15 Jun 2018 15:32:02 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FFW2Qg086076; Fri, 15 Jun 2018 15:32:02 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201806151532.w5FFW2Qg086076@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 15 Jun 2018 15:32:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335207 - head/tests/sys/audit X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/audit X-SVN-Commit-Revision: 335207 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 15:32:03 -0000 Author: asomers Date: Fri Jun 15 15:32:02 2018 New Revision: 335207 URL: https://svnweb.freebsd.org/changeset/base/335207 Log: audit(4): add tests for access(2), chmod(2), and friends access(2), eaccess(2), faccessat(2), chmod(2), fchmod(2), lchmod(2), and fchmodat(2). Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15805 Differential Revision: https://reviews.freebsd.org/D15808 Modified: head/tests/sys/audit/file-attribute-access.c head/tests/sys/audit/file-attribute-modify.c Modified: head/tests/sys/audit/file-attribute-access.c ============================================================================== --- head/tests/sys/audit/file-attribute-access.c Fri Jun 15 15:28:31 2018 (r335206) +++ head/tests/sys/audit/file-attribute-access.c Fri Jun 15 15:32:02 2018 (r335207) @@ -529,6 +529,138 @@ ATF_TC_CLEANUP(fhstatfs_failure, tc) } +ATF_TC_WITH_CLEANUP(access_success); +ATF_TC_HEAD(access_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "access(2) call"); +} + +ATF_TC_BODY(access_success, tc) +{ + /* File needs to exist to call access(2) */ + ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, access(path, F_OK)); + check_audit(fds, successreg, pipefd); + close(filedesc); +} + +ATF_TC_CLEANUP(access_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(access_failure); +ATF_TC_HEAD(access_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "access(2) call"); +} + +ATF_TC_BODY(access_failure, tc) +{ + FILE *pipefd = setup(fds, auclass); + /* Failure reason: file does not exist */ + ATF_REQUIRE_EQ(-1, access(errpath, F_OK)); + check_audit(fds, failurereg, pipefd); +} + +ATF_TC_CLEANUP(access_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(eaccess_success); +ATF_TC_HEAD(eaccess_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "eaccess(2) call"); +} + +ATF_TC_BODY(eaccess_success, tc) +{ + /* File needs to exist to call eaccess(2) */ + ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, eaccess(path, F_OK)); + check_audit(fds, successreg, pipefd); + close(filedesc); +} + +ATF_TC_CLEANUP(eaccess_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(eaccess_failure); +ATF_TC_HEAD(eaccess_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "eaccess(2) call"); +} + +ATF_TC_BODY(eaccess_failure, tc) +{ + FILE *pipefd = setup(fds, auclass); + /* Failure reason: file does not exist */ + ATF_REQUIRE_EQ(-1, eaccess(errpath, F_OK)); + check_audit(fds, failurereg, pipefd); +} + +ATF_TC_CLEANUP(eaccess_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(faccessat_success); +ATF_TC_HEAD(faccessat_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "faccessat(2) call"); +} + +ATF_TC_BODY(faccessat_success, tc) +{ + /* File needs to exist to call faccessat(2) */ + ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, faccessat(AT_FDCWD, path, F_OK, AT_EACCESS)); + check_audit(fds, successreg, pipefd); + close(filedesc); +} + +ATF_TC_CLEANUP(faccessat_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(faccessat_failure); +ATF_TC_HEAD(faccessat_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "faccessat(2) call"); +} + +ATF_TC_BODY(faccessat_failure, tc) +{ + FILE *pipefd = setup(fds, auclass); + /* Failure reason: file does not exist */ + ATF_REQUIRE_EQ(-1, faccessat(AT_FDCWD, errpath, F_OK, AT_EACCESS)); + check_audit(fds, failurereg, pipefd); +} + +ATF_TC_CLEANUP(faccessat_failure, tc) +{ + cleanup(); +} + + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, stat_success); @@ -554,6 +686,13 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, fhstat_failure); ATF_TP_ADD_TC(tp, fhstatfs_success); ATF_TP_ADD_TC(tp, fhstatfs_failure); + + ATF_TP_ADD_TC(tp, access_success); + ATF_TP_ADD_TC(tp, access_failure); + ATF_TP_ADD_TC(tp, eaccess_success); + ATF_TP_ADD_TC(tp, eaccess_failure); + ATF_TP_ADD_TC(tp, faccessat_success); + ATF_TP_ADD_TC(tp, faccessat_failure); return (atf_no_error()); } Modified: head/tests/sys/audit/file-attribute-modify.c ============================================================================== --- head/tests/sys/audit/file-attribute-modify.c Fri Jun 15 15:28:31 2018 (r335206) +++ head/tests/sys/audit/file-attribute-modify.c Fri Jun 15 15:32:02 2018 (r335207) @@ -26,6 +26,7 @@ */ #include +#include #include #include @@ -40,6 +41,9 @@ static mode_t mode = 0777; static char extregex[80]; static const char *auclass = "fm"; static const char *path = "fileforaudit"; +static const char *errpath = "adirhasnoname/fileforaudit"; +static const char *successreg = "fileforaudit.*return,success"; +static const char *failurereg = "fileforaudit.*return,failure"; ATF_TC_WITH_CLEANUP(flock_success); @@ -186,6 +190,185 @@ ATF_TC_CLEANUP(fsync_failure, tc) } +ATF_TC_WITH_CLEANUP(chmod_success); +ATF_TC_HEAD(chmod_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "chmod(2) call"); +} + +ATF_TC_BODY(chmod_success, tc) +{ + /* File needs to exist to call chmod(2) */ + ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, chmod(path, mode)); + check_audit(fds, successreg, pipefd); + close(filedesc); +} + +ATF_TC_CLEANUP(chmod_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(chmod_failure); +ATF_TC_HEAD(chmod_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "chmod(2) call"); +} + +ATF_TC_BODY(chmod_failure, tc) +{ + FILE *pipefd = setup(fds, auclass); + /* Failure reason: file does not exist */ + ATF_REQUIRE_EQ(-1, chmod(errpath, mode)); + check_audit(fds, failurereg, pipefd); +} + +ATF_TC_CLEANUP(chmod_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(fchmod_success); +ATF_TC_HEAD(fchmod_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "fchmod(2) call"); +} + +ATF_TC_BODY(fchmod_success, tc) +{ + pid = getpid(); + snprintf(extregex, sizeof(extregex), "fchmod.*%d.*return,success", pid); + + /* File needs to exist to call fchmod(2) */ + ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, fchmod(filedesc, mode)); + check_audit(fds, extregex, pipefd); + close(filedesc); +} + +ATF_TC_CLEANUP(fchmod_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(fchmod_failure); +ATF_TC_HEAD(fchmod_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "fchmod(2) call"); +} + +ATF_TC_BODY(fchmod_failure, tc) +{ + const char *regex = "fchmod.*return,failure : Bad file descriptor"; + FILE *pipefd = setup(fds, auclass); + /* Failure reason: Invalid file descriptor */ + ATF_REQUIRE_EQ(-1, fchmod(-1, mode)); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(fchmod_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(lchmod_success); +ATF_TC_HEAD(lchmod_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "lchmod(2) call"); +} + +ATF_TC_BODY(lchmod_success, tc) +{ + /* Symbolic link needs to exist to call lchmod(2) */ + ATF_REQUIRE_EQ(0, symlink("symlink", path)); + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, lchmod(path, mode)); + check_audit(fds, successreg, pipefd); +} + +ATF_TC_CLEANUP(lchmod_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(lchmod_failure); +ATF_TC_HEAD(lchmod_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "lchmod(2) call"); +} + +ATF_TC_BODY(lchmod_failure, tc) +{ + FILE *pipefd = setup(fds, auclass); + /* Failure reason: file does not exist */ + ATF_REQUIRE_EQ(-1, lchmod(errpath, mode)); + check_audit(fds, failurereg, pipefd); +} + +ATF_TC_CLEANUP(lchmod_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(fchmodat_success); +ATF_TC_HEAD(fchmodat_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "fchmodat(2) call"); +} + +ATF_TC_BODY(fchmodat_success, tc) +{ + /* File needs to exist to call fchmodat(2) */ + ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, fchmodat(AT_FDCWD, path, mode, 0)); + check_audit(fds, successreg, pipefd); + close(filedesc); +} + +ATF_TC_CLEANUP(fchmodat_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(fchmodat_failure); +ATF_TC_HEAD(fchmodat_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "fchmodat(2) call"); +} + +ATF_TC_BODY(fchmodat_failure, tc) +{ + FILE *pipefd = setup(fds, auclass); + /* Failure reason: file does not exist */ + ATF_REQUIRE_EQ(-1, fchmodat(AT_FDCWD, errpath, mode, 0)); + check_audit(fds, failurereg, pipefd); +} + +ATF_TC_CLEANUP(fchmodat_failure, tc) +{ + cleanup(); +} + + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, flock_success); @@ -194,6 +377,15 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, fcntl_failure); ATF_TP_ADD_TC(tp, fsync_success); ATF_TP_ADD_TC(tp, fsync_failure); + + ATF_TP_ADD_TC(tp, chmod_success); + ATF_TP_ADD_TC(tp, chmod_failure); + ATF_TP_ADD_TC(tp, fchmod_success); + ATF_TP_ADD_TC(tp, fchmod_failure); + ATF_TP_ADD_TC(tp, lchmod_success); + ATF_TP_ADD_TC(tp, lchmod_failure); + ATF_TP_ADD_TC(tp, fchmodat_success); + ATF_TP_ADD_TC(tp, fchmodat_failure); return (atf_no_error()); } From owner-svn-src-head@freebsd.org Fri Jun 15 15:36:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 429EF100FC90; Fri, 15 Jun 2018 15:36:11 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E910D7420E; Fri, 15 Jun 2018 15:36:10 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BEFD1194E7; Fri, 15 Jun 2018 15:36:10 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FFaA80086307; Fri, 15 Jun 2018 15:36:10 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FFaAWS086306; Fri, 15 Jun 2018 15:36:10 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201806151536.w5FFaAWS086306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 15 Jun 2018 15:36:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335208 - head/tests/sys/audit X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/audit X-SVN-Commit-Revision: 335208 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 15:36:11 -0000 Author: asomers Date: Fri Jun 15 15:36:10 2018 New Revision: 335208 URL: https://svnweb.freebsd.org/changeset/base/335208 Log: audit(4): improve formatting in tests/sys/audit/open.c [skip ci] Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15797 Modified: head/tests/sys/audit/open.c Modified: head/tests/sys/audit/open.c ============================================================================== --- head/tests/sys/audit/open.c Fri Jun 15 15:32:02 2018 (r335207) +++ head/tests/sys/audit/open.c Fri Jun 15 15:36:10 2018 (r335208) @@ -60,97 +60,97 @@ static const char *errpath = "adirhasnoname/fileforaud /* * Define test-cases for success and failure modes of both open(2) and openat(2) */ -#define OPEN_AT_TC_DEFINE(mode, regex, flag, class) \ -ATF_TC_WITH_CLEANUP(open_ ## mode ## _success); \ -ATF_TC_HEAD(open_ ## mode ## _success, tc) \ -{ \ - atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " \ - "open(2) call with flags = %s", #flag); \ -} \ -ATF_TC_BODY(open_ ## mode ## _success, tc) \ -{ \ - snprintf(extregex, sizeof(extregex), \ - "open.*%s.*fileforaudit.*return,success", regex); \ - /* File needs to exist for successful open(2) invocation */ \ - ATF_REQUIRE((filedesc = open(path, O_CREAT, o_mode)) != -1); \ - FILE *pipefd = setup(fds, class); \ - ATF_REQUIRE(syscall(SYS_open, path, flag) != -1); \ - check_audit(fds, extregex, pipefd); \ - close(filedesc); \ -} \ -ATF_TC_CLEANUP(open_ ## mode ## _success, tc) \ -{ \ - cleanup(); \ -} \ -ATF_TC_WITH_CLEANUP(open_ ## mode ## _failure); \ -ATF_TC_HEAD(open_ ## mode ## _failure, tc) \ -{ \ - atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " \ - "open(2) call with flags = %s", #flag); \ -} \ -ATF_TC_BODY(open_ ## mode ## _failure, tc) \ -{ \ - snprintf(extregex, sizeof(extregex), \ - "open.*%s.*fileforaudit.*return,failure", regex); \ - FILE *pipefd = setup(fds, class); \ - ATF_REQUIRE_EQ(-1, syscall(SYS_open, errpath, flag)); \ - check_audit(fds, extregex, pipefd); \ -} \ -ATF_TC_CLEANUP(open_ ## mode ## _failure, tc) \ -{ \ - cleanup(); \ -} \ -ATF_TC_WITH_CLEANUP(openat_ ## mode ## _success); \ -ATF_TC_HEAD(openat_ ## mode ## _success, tc) \ -{ \ - atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " \ - "openat(2) call with flags = %s", #flag); \ -} \ -ATF_TC_BODY(openat_ ## mode ## _success, tc) \ -{ \ - int filedesc2; \ - snprintf(extregex, sizeof(extregex), \ - "openat.*%s.*fileforaudit.*return,success", regex); \ - /* File needs to exist for successful openat(2) invocation */ \ - ATF_REQUIRE((filedesc = open(path, O_CREAT, o_mode)) != -1); \ - FILE *pipefd = setup(fds, class); \ - ATF_REQUIRE((filedesc2 = openat(AT_FDCWD, path, flag)) != -1); \ - check_audit(fds, extregex, pipefd); \ - close(filedesc2); \ - close(filedesc); \ -} \ -ATF_TC_CLEANUP(openat_ ## mode ## _success, tc) \ -{ \ - cleanup(); \ -} \ -ATF_TC_WITH_CLEANUP(openat_ ## mode ## _failure); \ -ATF_TC_HEAD(openat_ ## mode ## _failure, tc) \ -{ \ - atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " \ - "openat(2) call with flags = %s", #flag); \ -} \ -ATF_TC_BODY(openat_ ## mode ## _failure, tc) \ -{ \ - snprintf(extregex, sizeof(extregex), \ - "openat.*%s.*fileforaudit.*return,failure", regex); \ - FILE *pipefd = setup(fds, class); \ - ATF_REQUIRE_EQ(-1, openat(AT_FDCWD, errpath, flag)); \ - check_audit(fds, extregex, pipefd); \ -} \ -ATF_TC_CLEANUP(openat_ ## mode ## _failure, tc) \ -{ \ - cleanup(); \ +#define OPEN_AT_TC_DEFINE(mode, regex, flag, class) \ +ATF_TC_WITH_CLEANUP(open_ ## mode ## _success); \ +ATF_TC_HEAD(open_ ## mode ## _success, tc) \ +{ \ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " \ + "open(2) call with flags = %s", #flag); \ +} \ +ATF_TC_BODY(open_ ## mode ## _success, tc) \ +{ \ + snprintf(extregex, sizeof(extregex), \ + "open.*%s.*fileforaudit.*return,success", regex); \ + /* File needs to exist for successful open(2) invocation */ \ + ATF_REQUIRE((filedesc = open(path, O_CREAT, o_mode)) != -1); \ + FILE *pipefd = setup(fds, class); \ + ATF_REQUIRE(syscall(SYS_open, path, flag) != -1); \ + check_audit(fds, extregex, pipefd); \ + close(filedesc); \ +} \ +ATF_TC_CLEANUP(open_ ## mode ## _success, tc) \ +{ \ + cleanup(); \ +} \ +ATF_TC_WITH_CLEANUP(open_ ## mode ## _failure); \ +ATF_TC_HEAD(open_ ## mode ## _failure, tc) \ +{ \ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " \ + "open(2) call with flags = %s", #flag); \ +} \ +ATF_TC_BODY(open_ ## mode ## _failure, tc) \ +{ \ + snprintf(extregex, sizeof(extregex), \ + "open.*%s.*fileforaudit.*return,failure", regex); \ + FILE *pipefd = setup(fds, class); \ + ATF_REQUIRE_EQ(-1, syscall(SYS_open, errpath, flag)); \ + check_audit(fds, extregex, pipefd); \ +} \ +ATF_TC_CLEANUP(open_ ## mode ## _failure, tc) \ +{ \ + cleanup(); \ +} \ +ATF_TC_WITH_CLEANUP(openat_ ## mode ## _success); \ +ATF_TC_HEAD(openat_ ## mode ## _success, tc) \ +{ \ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " \ + "openat(2) call with flags = %s", #flag); \ +} \ +ATF_TC_BODY(openat_ ## mode ## _success, tc) \ +{ \ + int filedesc2; \ + snprintf(extregex, sizeof(extregex), \ + "openat.*%s.*fileforaudit.*return,success", regex); \ + /* File needs to exist for successful openat(2) invocation */ \ + ATF_REQUIRE((filedesc = open(path, O_CREAT, o_mode)) != -1); \ + FILE *pipefd = setup(fds, class); \ + ATF_REQUIRE((filedesc2 = openat(AT_FDCWD, path, flag)) != -1); \ + check_audit(fds, extregex, pipefd); \ + close(filedesc2); \ + close(filedesc); \ +} \ +ATF_TC_CLEANUP(openat_ ## mode ## _success, tc) \ +{ \ + cleanup(); \ +} \ +ATF_TC_WITH_CLEANUP(openat_ ## mode ## _failure); \ +ATF_TC_HEAD(openat_ ## mode ## _failure, tc) \ +{ \ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " \ + "openat(2) call with flags = %s", #flag); \ +} \ +ATF_TC_BODY(openat_ ## mode ## _failure, tc) \ +{ \ + snprintf(extregex, sizeof(extregex), \ + "openat.*%s.*fileforaudit.*return,failure", regex); \ + FILE *pipefd = setup(fds, class); \ + ATF_REQUIRE_EQ(-1, openat(AT_FDCWD, errpath, flag)); \ + check_audit(fds, extregex, pipefd); \ +} \ +ATF_TC_CLEANUP(openat_ ## mode ## _failure, tc) \ +{ \ + cleanup(); \ } /* * Add both success and failure modes of open(2) and openat(2) */ -#define OPEN_AT_TC_ADD(tp, mode) \ -do { \ - ATF_TP_ADD_TC(tp, open_ ## mode ## _success); \ - ATF_TP_ADD_TC(tp, open_ ## mode ## _failure); \ - ATF_TP_ADD_TC(tp, openat_ ## mode ## _success); \ - ATF_TP_ADD_TC(tp, openat_ ## mode ## _failure); \ +#define OPEN_AT_TC_ADD(tp, mode) \ +do { \ + ATF_TP_ADD_TC(tp, open_ ## mode ## _success); \ + ATF_TP_ADD_TC(tp, open_ ## mode ## _failure); \ + ATF_TP_ADD_TC(tp, openat_ ## mode ## _success); \ + ATF_TP_ADD_TC(tp, openat_ ## mode ## _failure); \ } while (0) From owner-svn-src-head@freebsd.org Fri Jun 15 16:14:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AC9A1011496; Fri, 15 Jun 2018 16:14:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 01146757C8; Fri, 15 Jun 2018 16:14:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D266219B7D; Fri, 15 Jun 2018 16:14:42 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FGEgKn006501; Fri, 15 Jun 2018 16:14:42 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FGEgWk006500; Fri, 15 Jun 2018 16:14:42 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806151614.w5FGEgWk006500@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 15 Jun 2018 16:14:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335209 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 335209 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 16:14:43 -0000 Author: emaste Date: Fri Jun 15 16:14:42 2018 New Revision: 335209 URL: https://svnweb.freebsd.org/changeset/base/335209 Log: elf.5: add readelf cross-reference objdump is sometimes used in cases where readelf is more appropriate, but the obsolete GNU objdump we have in the base system will be removed in the future. .Xr readelf from elf.5 to improve the odds the more appropriate tool will be found. PR: 229046 MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/share/man/man5/elf.5 Modified: head/share/man/man5/elf.5 ============================================================================== --- head/share/man/man5/elf.5 Fri Jun 15 15:36:10 2018 (r335208) +++ head/share/man/man5/elf.5 Fri Jun 15 16:14:42 2018 (r335209) @@ -1281,6 +1281,7 @@ stored into the relocatable field. .Xr gdb 1 , .Xr ld 1 , .Xr objdump 1 , +.Xr readelf 1 , .Xr execve 2 , .Xr ar 5 , .Xr core 5 From owner-svn-src-head@freebsd.org Fri Jun 15 16:18:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B274D101188E; Fri, 15 Jun 2018 16:18:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 68A6A75BD4; Fri, 15 Jun 2018 16:18:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 49C4119B86; Fri, 15 Jun 2018 16:18:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FGIeoc006812; Fri, 15 Jun 2018 16:18:40 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FGIdXX006808; Fri, 15 Jun 2018 16:18:39 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806151618.w5FGIdXX006808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 15 Jun 2018 16:18:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335210 - head/tools/build/options X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/build/options X-SVN-Commit-Revision: 335210 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 16:18:41 -0000 Author: emaste Date: Fri Jun 15 16:18:39 2018 New Revision: 335210 URL: https://svnweb.freebsd.org/changeset/base/335210 Log: Remove objcopy from BINUTILS option descriptions As of r306649 objcopy is always ELF Tool Chain's elfcopy; binutils objcopy is never used. PR: 229046 MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/tools/build/options/WITHOUT_BINUTILS head/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP head/tools/build/options/WITH_BINUTILS head/tools/build/options/WITH_BINUTILS_BOOTSTRAP Modified: head/tools/build/options/WITHOUT_BINUTILS ============================================================================== --- head/tools/build/options/WITHOUT_BINUTILS Fri Jun 15 16:14:42 2018 (r335209) +++ head/tools/build/options/WITHOUT_BINUTILS Fri Jun 15 16:18:39 2018 (r335210) @@ -1,4 +1,4 @@ .\" $FreeBSD$ -Set to not build or install binutils (as, ld, objcopy, and objdump) as part +Set to not build or install binutils (as, ld, and objdump) as part of the normal system build. The resulting system cannot build programs from source. Modified: head/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP ============================================================================== --- head/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP Fri Jun 15 16:14:42 2018 (r335209) +++ head/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP Fri Jun 15 16:18:39 2018 (r335210) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -Set to not build binutils (as, ld, objcopy and objdump) +Set to not build binutils (as, ld, and objdump) as part of the bootstrap process. .Bf -symbolic The option does not work for build targets unless some alternative Modified: head/tools/build/options/WITH_BINUTILS ============================================================================== --- head/tools/build/options/WITH_BINUTILS Fri Jun 15 16:14:42 2018 (r335209) +++ head/tools/build/options/WITH_BINUTILS Fri Jun 15 16:18:39 2018 (r335210) @@ -1,3 +1,3 @@ .\" $FreeBSD$ -Set to build and install binutils (as, ld, objcopy, and objdump) as part +Set to build and install binutils (as, ld, and objdump) as part of the normal system build. Modified: head/tools/build/options/WITH_BINUTILS_BOOTSTRAP ============================================================================== --- head/tools/build/options/WITH_BINUTILS_BOOTSTRAP Fri Jun 15 16:14:42 2018 (r335209) +++ head/tools/build/options/WITH_BINUTILS_BOOTSTRAP Fri Jun 15 16:18:39 2018 (r335210) @@ -1,3 +1,3 @@ .\" $FreeBSD$ -Set build binutils (as, ld, objcopy and objdump) +Set build binutils (as, ld, and objdump) as part of the bootstrap process. From owner-svn-src-head@freebsd.org Fri Jun 15 16:19:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 991EF1011940; Fri, 15 Jun 2018 16:19:11 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F92075D43; Fri, 15 Jun 2018 16:19:11 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 31CD019B88; Fri, 15 Jun 2018 16:19:11 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FGJBEM006895; Fri, 15 Jun 2018 16:19:11 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FGJB87006894; Fri, 15 Jun 2018 16:19:11 GMT (envelope-from br@FreeBSD.org) Message-Id: <201806151619.w5FGJB87006894@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 15 Jun 2018 16:19:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335211 - head/sys/dev/virtio/mmio X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/dev/virtio/mmio X-SVN-Commit-Revision: 335211 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 16:19:11 -0000 Author: br Date: Fri Jun 15 16:19:10 2018 New Revision: 335211 URL: https://svnweb.freebsd.org/changeset/base/335211 Log: Make virtio queue re-initialization steps to be similar to original initialization, so we don't miss few registers to configure. This fixes vtnet(4) operation with QEMU's virtio-net-device. Tested in QEMU with FreeBSD/RISC-V. Reviewed by: bryanv Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D15821 Modified: head/sys/dev/virtio/mmio/virtio_mmio.c Modified: head/sys/dev/virtio/mmio/virtio_mmio.c ============================================================================== --- head/sys/dev/virtio/mmio/virtio_mmio.c Fri Jun 15 16:18:39 2018 (r335210) +++ head/sys/dev/virtio/mmio/virtio_mmio.c Fri Jun 15 16:19:10 2018 (r335211) @@ -512,7 +512,8 @@ vtmmio_alloc_virtqueues(device_t dev, int flags, int n if (sc->vtmmio_vqs == NULL) return (ENOMEM); - vtmmio_write_config_4(sc, VIRTIO_MMIO_GUEST_PAGE_SIZE, 1 << PAGE_SHIFT); + vtmmio_write_config_4(sc, VIRTIO_MMIO_GUEST_PAGE_SIZE, + (1 << PAGE_SHIFT)); for (idx = 0; idx < nvqs; idx++) { vqx = &sc->vtmmio_vqs[idx]; @@ -537,10 +538,10 @@ vtmmio_alloc_virtqueues(device_t dev, int flags, int n VIRTIO_MMIO_VRING_ALIGN); #if 0 device_printf(dev, "virtqueue paddr 0x%08lx\n", - (uint64_t)virtqueue_paddr(vq)); + (uint64_t)virtqueue_paddr(vq)); #endif vtmmio_write_config_4(sc, VIRTIO_MMIO_QUEUE_PFN, - virtqueue_paddr(vq) >> PAGE_SHIFT); + virtqueue_paddr(vq) >> PAGE_SHIFT); vqx->vtv_vq = *info->vqai_vq = vq; vqx->vtv_no_intr = info->vqai_intr == NULL; @@ -592,6 +593,9 @@ vtmmio_reinit(device_t dev, uint64_t features) vtmmio_negotiate_features(dev, features); + vtmmio_write_config_4(sc, VIRTIO_MMIO_GUEST_PAGE_SIZE, + (1 << PAGE_SHIFT)); + for (idx = 0; idx < sc->vtmmio_nvqs; idx++) { error = vtmmio_reinit_virtqueue(sc, idx); if (error) @@ -766,6 +770,13 @@ vtmmio_reinit_virtqueue(struct vtmmio_softc *sc, int i if (error) return (error); + vtmmio_write_config_4(sc, VIRTIO_MMIO_QUEUE_NUM, size); + vtmmio_write_config_4(sc, VIRTIO_MMIO_QUEUE_ALIGN, + VIRTIO_MMIO_VRING_ALIGN); +#if 0 + device_printf(sc->dev, "virtqueue paddr 0x%08lx\n", + (uint64_t)virtqueue_paddr(vq)); +#endif vtmmio_write_config_4(sc, VIRTIO_MMIO_QUEUE_PFN, virtqueue_paddr(vq) >> PAGE_SHIFT); From owner-svn-src-head@freebsd.org Fri Jun 15 16:25:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDBA210123DF; Fri, 15 Jun 2018 16:25:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 83F74765AE; Fri, 15 Jun 2018 16:25:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5EACE19D40; Fri, 15 Jun 2018 16:25:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FGPbGB011698; Fri, 15 Jun 2018 16:25:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FGPbkR011697; Fri, 15 Jun 2018 16:25:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806151625.w5FGPbkR011697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 15 Jun 2018 16:25:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335212 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 335212 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 16:25:38 -0000 Author: emaste Date: Fri Jun 15 16:25:36 2018 New Revision: 335212 URL: https://svnweb.freebsd.org/changeset/base/335212 Log: src.conf.5: regen after r335210, *BINUTILS description updates Sponsored by: The FreeBSD Foundation Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Fri Jun 15 16:19:10 2018 (r335211) +++ head/share/man/man5/src.conf.5 Fri Jun 15 16:25:36 2018 (r335212) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd May 30, 2018 +.Dd June 15, 2018 .Dt SRC.CONF 5 .Os .Sh NAME @@ -144,7 +144,7 @@ associated utilities, and examples. .Pp This option only affects amd64/amd64. .It Va WITHOUT_BINUTILS -Set to not build or install binutils (as, ld, objcopy, and objdump) as part +Set to not build or install binutils (as, ld, and objdump) as part of the normal system build. The resulting system cannot build programs from source. .Pp @@ -157,13 +157,13 @@ When set, it enforces these options: .Va WITHOUT_GDB .El .It Va WITH_BINUTILS -Set to build and install binutils (as, ld, objcopy, and objdump) as part +Set to build and install binutils (as, ld, and objdump) as part of the normal system build. .Pp This is a default setting on amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv7, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITHOUT_BINUTILS_BOOTSTRAP -Set to not build binutils (as, ld, objcopy and objdump) +Set to not build binutils (as, ld, and objdump) as part of the bootstrap process. .Bf -symbolic The option does not work for build targets unless some alternative @@ -173,7 +173,7 @@ toolchain is provided. This is a default setting on arm64/aarch64, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_BINUTILS_BOOTSTRAP -Set build binutils (as, ld, objcopy and objdump) +Set build binutils (as, ld, and objdump) as part of the bootstrap process. .Pp This is a default setting on From owner-svn-src-head@freebsd.org Fri Jun 15 16:28:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 417291012626; Fri, 15 Jun 2018 16:28:51 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EAD9F767F5; Fri, 15 Jun 2018 16:28:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C73A119D41; Fri, 15 Jun 2018 16:28:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FGSoTw011868; Fri, 15 Jun 2018 16:28:50 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FGSoh9011867; Fri, 15 Jun 2018 16:28:50 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806151628.w5FGSoh9011867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 15 Jun 2018 16:28:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335213 - head/usr.bin/ldd X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/ldd X-SVN-Commit-Revision: 335213 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 16:28:51 -0000 Author: emaste Date: Fri Jun 15 16:28:50 2018 New Revision: 335213 URL: https://svnweb.freebsd.org/changeset/base/335213 Log: ldd: reference readelf instead of objdump in warning message We have an obsolete GNU objdump 2.17.50 in the base system, which will be removed in the future. Suggest readelf(1) for examining ELF files instead; for most use cases it is the preferred tool anyhow. PR: 229046 MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/ldd/sods.c Modified: head/usr.bin/ldd/sods.c ============================================================================== --- head/usr.bin/ldd/sods.c Fri Jun 15 16:25:36 2018 (r335212) +++ head/usr.bin/ldd/sods.c Fri Jun 15 16:28:50 2018 (r335213) @@ -203,7 +203,7 @@ dump_file(const char *fname) file_base = (const char *) objbase; /* Makes address arithmetic easier */ if (IS_ELF(*(const Elf32_Ehdr*) align_struct(file_base))) { - warnx("%s: this is an ELF program; use objdump to examine", fname); + warnx("%s: this is an ELF program; use readelf to examine", fname); ++error_count; munmap(objbase, sb.st_size); return; From owner-svn-src-head@freebsd.org Fri Jun 15 16:32:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 540B010129A4; Fri, 15 Jun 2018 16:32:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B1F776D5F; Fri, 15 Jun 2018 16:32:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E08CE19ED8; Fri, 15 Jun 2018 16:32:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FGWI31017002; Fri, 15 Jun 2018 16:32:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FGWIdL017001; Fri, 15 Jun 2018 16:32:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806151632.w5FGWIdL017001@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 15 Jun 2018 16:32:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335214 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 335214 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 16:32:19 -0000 Author: emaste Date: Fri Jun 15 16:32:18 2018 New Revision: 335214 URL: https://svnweb.freebsd.org/changeset/base/335214 Log: Correct kern.pre.mk comment: objcopy, not objdump, copies objects. PR: 229046 MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/kern.pre.mk Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Fri Jun 15 16:28:50 2018 (r335213) +++ head/sys/conf/kern.pre.mk Fri Jun 15 16:32:18 2018 (r335214) @@ -243,7 +243,7 @@ MKMODULESENV+= DEBUG_FLAGS="${DEBUG}" MKMODULESENV+= __MPATH="${__MPATH}" .endif -# Architecture and output format arguments for objdump to convert image to +# Architecture and output format arguments for objcopy to convert image to # object file .if ${MFS_IMAGE:Uno} != "no" From owner-svn-src-head@freebsd.org Fri Jun 15 16:41:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EBED10130FC; Fri, 15 Jun 2018 16:41:29 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 44BCA77587; Fri, 15 Jun 2018 16:41:29 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 25C4C1A026; Fri, 15 Jun 2018 16:41:29 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FGfTWk017459; Fri, 15 Jun 2018 16:41:29 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FGfS0h017457; Fri, 15 Jun 2018 16:41:28 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201806151641.w5FGfS0h017457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 15 Jun 2018 16:41:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335215 - head/tests/sys/audit X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/audit X-SVN-Commit-Revision: 335215 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 16:41:29 -0000 Author: asomers Date: Fri Jun 15 16:41:28 2018 New Revision: 335215 URL: https://svnweb.freebsd.org/changeset/base/335215 Log: audit(4): Add a few tests for network-related syscalls Add tests for socket(2), socketpair(2), and setsockopt(2) Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15803 Added: head/tests/sys/audit/network.c (contents, props changed) Modified: head/tests/sys/audit/Makefile Modified: head/tests/sys/audit/Makefile ============================================================================== --- head/tests/sys/audit/Makefile Fri Jun 15 16:32:18 2018 (r335214) +++ head/tests/sys/audit/Makefile Fri Jun 15 16:41:28 2018 (r335215) @@ -10,6 +10,7 @@ ATF_TESTS_C+= file-close ATF_TESTS_C+= file-write ATF_TESTS_C+= file-read ATF_TESTS_C+= open +ATF_TESTS_C+= network SRCS.file-attribute-access+= file-attribute-access.c SRCS.file-attribute-access+= utils.c @@ -27,6 +28,8 @@ SRCS.file-read+= file-read.c SRCS.file-read+= utils.c SRCS.open+= open.c SRCS.open+= utils.c +SRCS.network+= network.c +SRCS.network+= utils.c TEST_METADATA+= timeout="30" TEST_METADATA+= required_user="root" Added: head/tests/sys/audit/network.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/audit/network.c Fri Jun 15 16:41:28 2018 (r335215) @@ -0,0 +1,214 @@ +/*- + * Copyright (c) 2018 Aniket Pandey + * + * 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 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * 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 + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include + +#include +#include +#include + +#include "utils.h" + +static int sockfd; +static struct pollfd fds[1]; +static char extregex[80]; +static const char *auclass = "nt"; +static const char *failregex = "return,failure : Address family " + "not supported by protocol family"; + +/* + * Variadic function to close socket descriptors + */ +static void +close_sockets(int count, ...) +{ + int sockd; + va_list socklist; + va_start(socklist, count); + for (sockd = 0; sockd < count; sockd++) { + close(va_arg(socklist, int)); + } + va_end(socklist); +} + + +ATF_TC_WITH_CLEANUP(socket_success); +ATF_TC_HEAD(socket_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "socket(2) call"); +} + +ATF_TC_BODY(socket_success, tc) +{ + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE((sockfd = socket(PF_UNIX, SOCK_STREAM, 0)) != -1); + /* Check the presence of sockfd in audit record */ + snprintf(extregex, sizeof(extregex), "socket.*ret.*success,%d", sockfd); + check_audit(fds, extregex, pipefd); + close(sockfd); +} + +ATF_TC_CLEANUP(socket_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(socket_failure); +ATF_TC_HEAD(socket_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "socket(2) call"); +} + +ATF_TC_BODY(socket_failure, tc) +{ + snprintf(extregex, sizeof(extregex), "socket.*%s", failregex); + FILE *pipefd = setup(fds, auclass); + /* Failure reason: Unsupported value of 'domain' argument: 0 */ + ATF_REQUIRE_EQ(-1, socket(0, SOCK_STREAM, 0)); + check_audit(fds, extregex, pipefd); +} + +ATF_TC_CLEANUP(socket_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(socketpair_success); +ATF_TC_HEAD(socketpair_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "socketpair(2) call"); +} + +ATF_TC_BODY(socketpair_success, tc) +{ + int sv[2]; + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, socketpair(PF_UNIX, SOCK_STREAM, 0, sv)); + + /* Check for 0x0 (argument 3: default protocol) in the audit record */ + snprintf(extregex, sizeof(extregex), "socketpair.*0x0.*return,success"); + check_audit(fds, extregex, pipefd); + close_sockets(2, sv[0], sv[1]); +} + +ATF_TC_CLEANUP(socketpair_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(socketpair_failure); +ATF_TC_HEAD(socketpair_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "socketpair(2) call"); +} + +ATF_TC_BODY(socketpair_failure, tc) +{ + snprintf(extregex, sizeof(extregex), "socketpair.*%s", failregex); + FILE *pipefd = setup(fds, auclass); + /* Failure reason: Unsupported value of 'domain' argument: 0 */ + ATF_REQUIRE_EQ(-1, socketpair(0, SOCK_STREAM, 0, NULL)); + check_audit(fds, extregex, pipefd); +} + +ATF_TC_CLEANUP(socketpair_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(setsockopt_success); +ATF_TC_HEAD(setsockopt_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "setsockopt(2) call"); +} + +ATF_TC_BODY(setsockopt_success, tc) +{ + int tr = 1; + ATF_REQUIRE((sockfd = socket(PF_UNIX, SOCK_STREAM, 0)) != -1); + /* Check the presence of sockfd in audit record */ + snprintf(extregex, sizeof(extregex), + "setsockopt.*0x%x.*return,success", sockfd); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, setsockopt(sockfd, SOL_SOCKET, + SO_REUSEADDR, &tr, sizeof(int))); + check_audit(fds, extregex, pipefd); + close(sockfd); +} + +ATF_TC_CLEANUP(setsockopt_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(setsockopt_failure); +ATF_TC_HEAD(setsockopt_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "setsockopt(2) call"); +} + +ATF_TC_BODY(setsockopt_failure, tc) +{ + int tr = 1; + const char *regex = "setsockopt.*fail.*Socket operation on non-socket"; + FILE *pipefd = setup(fds, auclass); + /* Failure reason: No socket descriptor with the value of 0 exists */ + ATF_REQUIRE_EQ(-1, setsockopt(0, SOL_SOCKET, + SO_REUSEADDR, &tr, sizeof(int))); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(setsockopt_failure, tc) +{ + cleanup(); +} + + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, socket_success); + ATF_TP_ADD_TC(tp, socket_failure); + ATF_TP_ADD_TC(tp, socketpair_success); + ATF_TP_ADD_TC(tp, socketpair_failure); + ATF_TP_ADD_TC(tp, setsockopt_success); + ATF_TP_ADD_TC(tp, setsockopt_failure); + + return (atf_no_error()); +} From owner-svn-src-head@freebsd.org Fri Jun 15 16:48:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B97F2101382B; Fri, 15 Jun 2018 16:48:10 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7032A77D93; Fri, 15 Jun 2018 16:48:10 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D3291A08E; Fri, 15 Jun 2018 16:48:10 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FGmAJ7022145; Fri, 15 Jun 2018 16:48:10 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FGm9fV022143; Fri, 15 Jun 2018 16:48:09 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201806151648.w5FGm9fV022143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 15 Jun 2018 16:48:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335216 - head X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 335216 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 16:48:10 -0000 Author: bdrewery Date: Fri Jun 15 16:48:09 2018 New Revision: 335216 URL: https://svnweb.freebsd.org/changeset/base/335216 Log: Only build jevents if MK_PMC is yes and only for amd64 in libcompat. Sponsored by: Dell EMC Modified: head/Makefile.inc1 head/Makefile.libcompat Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Jun 15 16:41:28 2018 (r335215) +++ head/Makefile.inc1 Fri Jun 15 16:48:09 2018 (r335216) @@ -2033,7 +2033,8 @@ _tcsh=bin/csh _libmagic=lib/libmagic .endif -.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386" +.if ${MK_PMC} != "no" && \ + (${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386") _jevents=lib/libpmc/pmu-events .endif Modified: head/Makefile.libcompat ============================================================================== --- head/Makefile.libcompat Fri Jun 15 16:41:28 2018 (r335215) +++ head/Makefile.libcompat Fri Jun 15 16:48:09 2018 (r335216) @@ -155,6 +155,11 @@ _LC_INCDIRS= \ lib/ncurses/ncursesw \ ${_LC_LIBDIRS.yes} +.if ${MK_PMC} != "no" && ${TARGET_ARCH} == "amd64" +_jevents= lib/libpmc/pmu-events +.endif + + # Shared logic build${libcompat}: .PHONY @echo @@ -192,7 +197,7 @@ build${libcompat}: .PHONY DIRPRFX=${_dir}/ ${_t} .endfor .endfor -.for _dir in lib/ncurses/ncurses lib/ncurses/ncursesw lib/libmagic lib/libpmc/pmu-events +.for _dir in lib/ncurses/ncurses lib/ncurses/ncursesw lib/libmagic ${_jevents} ${_+_}cd ${.CURDIR}/${_dir}; \ WORLDTMP=${WORLDTMP} \ MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" \ From owner-svn-src-head@freebsd.org Fri Jun 15 17:03:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 426501014328; Fri, 15 Jun 2018 17:03:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EB9DD78967; Fri, 15 Jun 2018 17:03:49 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CCE6A1A3CC; Fri, 15 Jun 2018 17:03:49 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FH3nTj032381; Fri, 15 Jun 2018 17:03:49 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FH3neN032380; Fri, 15 Jun 2018 17:03:49 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806151703.w5FH3neN032380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 15 Jun 2018 17:03:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335217 - head/contrib/binutils/binutils/doc X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/binutils/binutils/doc X-SVN-Commit-Revision: 335217 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 17:03:50 -0000 Author: emaste Date: Fri Jun 15 17:03:49 2018 New Revision: 335217 URL: https://svnweb.freebsd.org/changeset/base/335217 Log: Add deprecation notice to objdump man page PR: 229046 MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D13881 Modified: head/contrib/binutils/binutils/doc/binutils.texi Modified: head/contrib/binutils/binutils/doc/binutils.texi ============================================================================== --- head/contrib/binutils/binutils/doc/binutils.texi Fri Jun 15 16:48:09 2018 (r335216) +++ head/contrib/binutils/binutils/doc/binutils.texi Fri Jun 15 17:03:49 2018 (r335217) @@ -1624,6 +1624,10 @@ program to compile and work. specify archives, @command{objdump} shows information on each of the member object files. +@command{objdump} will be removed from a future version of the +FreeBSD base system. Users who require @command{objdump} are advised +to install the binutils port or package. + @c man end @c man begin OPTIONS objdump From owner-svn-src-head@freebsd.org Fri Jun 15 17:03:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43F2E1014360; Fri, 15 Jun 2018 17:03:58 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E6EC678A4C; Fri, 15 Jun 2018 17:03:57 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A07E1A3CE; Fri, 15 Jun 2018 17:03:57 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FH3v8X032441; Fri, 15 Jun 2018 17:03:57 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FH3vN9032440; Fri, 15 Jun 2018 17:03:57 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201806151703.w5FH3vN9032440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 15 Jun 2018 17:03:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335218 - head X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 335218 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 17:03:58 -0000 Author: bdrewery Date: Fri Jun 15 17:03:57 2018 New Revision: 335218 URL: https://svnweb.freebsd.org/changeset/base/335218 Log: libcompat: Only build libmagic build tool if MK_FILE is yes. Sponsored by: Dell EMC Modified: head/Makefile.libcompat Modified: head/Makefile.libcompat ============================================================================== --- head/Makefile.libcompat Fri Jun 15 17:03:49 2018 (r335217) +++ head/Makefile.libcompat Fri Jun 15 17:03:57 2018 (r335218) @@ -155,6 +155,9 @@ _LC_INCDIRS= \ lib/ncurses/ncursesw \ ${_LC_LIBDIRS.yes} +.if ${MK_FILE} != "no" +_libmagic= lib/libmagic +.endif .if ${MK_PMC} != "no" && ${TARGET_ARCH} == "amd64" _jevents= lib/libpmc/pmu-events .endif @@ -197,7 +200,7 @@ build${libcompat}: .PHONY DIRPRFX=${_dir}/ ${_t} .endfor .endfor -.for _dir in lib/ncurses/ncurses lib/ncurses/ncursesw lib/libmagic ${_jevents} +.for _dir in lib/ncurses/ncurses lib/ncurses/ncursesw ${_libmagic} ${_jevents} ${_+_}cd ${.CURDIR}/${_dir}; \ WORLDTMP=${WORLDTMP} \ MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" \ From owner-svn-src-head@freebsd.org Fri Jun 15 17:16:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A2B91014CDE; Fri, 15 Jun 2018 17:16:28 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1032C793E3; Fri, 15 Jun 2018 17:16:28 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E0FB01A56D; Fri, 15 Jun 2018 17:16:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FHGRgu037502; Fri, 15 Jun 2018 17:16:27 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FHGRB4037501; Fri, 15 Jun 2018 17:16:27 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806151716.w5FHGRB4037501@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 15 Jun 2018 17:16:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335219 - head/gnu/usr.bin/binutils/objdump X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/gnu/usr.bin/binutils/objdump X-SVN-Commit-Revision: 335219 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 17:16:28 -0000 Author: emaste Date: Fri Jun 15 17:16:27 2018 New Revision: 335219 URL: https://svnweb.freebsd.org/changeset/base/335219 Log: objdump.1: manually apply r229046 to the rendered man page Modified: head/gnu/usr.bin/binutils/objdump/objdump.1 Modified: head/gnu/usr.bin/binutils/objdump/objdump.1 ============================================================================== --- head/gnu/usr.bin/binutils/objdump/objdump.1 Fri Jun 15 17:03:57 2018 (r335218) +++ head/gnu/usr.bin/binutils/objdump/objdump.1 Fri Jun 15 17:16:27 2018 (r335219) @@ -179,6 +179,10 @@ information is mostly useful to programmers who are wo compilation tools, as opposed to programmers who just want their program to compile and work. .PP +\&\fBobjdump\fR will be removed from a future version of the +FreeBSD base system. Users who require \&\fBobjdump\fR are advised +to install the binutils port or package. +.PP \&\fIobjfile\fR... are the object files to be examined. When you specify archives, \fBobjdump\fR shows information on each of the member object files. From owner-svn-src-head@freebsd.org Fri Jun 15 17:29:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D85F1015450; Fri, 15 Jun 2018 17:29:33 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2164279C79; Fri, 15 Jun 2018 17:29:33 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 035141A71C; Fri, 15 Jun 2018 17:29:33 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FHTWp0042872; Fri, 15 Jun 2018 17:29:32 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FHTWUA042871; Fri, 15 Jun 2018 17:29:32 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201806151729.w5FHTWUA042871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 15 Jun 2018 17:29:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335220 - head/sys/dev/extres/regulator X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/extres/regulator X-SVN-Commit-Revision: 335220 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 17:29:33 -0000 Author: kevans Date: Fri Jun 15 17:29:32 2018 New Revision: 335220 URL: https://svnweb.freebsd.org/changeset/base/335220 Log: extres/regulator: Switch boot_on/always_on sysctl to uint8 These are represented as booleans on the kernel-side, but were being exposed as int. This was causing some funky things to happen when read later with sysctl(8), e.g. randomly reading super-high when the value was actually '0'/false. Reviewed by: manu Modified: head/sys/dev/extres/regulator/regulator.c Modified: head/sys/dev/extres/regulator/regulator.c ============================================================================== --- head/sys/dev/extres/regulator/regulator.c Fri Jun 15 17:16:27 2018 (r335219) +++ head/sys/dev/extres/regulator/regulator.c Fri Jun 15 17:29:32 2018 (r335220) @@ -379,15 +379,15 @@ regnode_create(device_t pdev, regnode_class_t regnode_ OID_AUTO, "enable_cnt", CTLFLAG_RD, ®node->enable_cnt, 0, "The regulator enable counter"); - SYSCTL_ADD_INT(®node->sysctl_ctx, + SYSCTL_ADD_U8(®node->sysctl_ctx, SYSCTL_CHILDREN(regnode_oid), OID_AUTO, "boot_on", - CTLFLAG_RD, (int *) ®node->std_param.boot_on, 0, + CTLFLAG_RD, (uint8_t *) ®node->std_param.boot_on, 0, "Is enabled on boot"); - SYSCTL_ADD_INT(®node->sysctl_ctx, + SYSCTL_ADD_U8(®node->sysctl_ctx, SYSCTL_CHILDREN(regnode_oid), OID_AUTO, "always_on", - CTLFLAG_RD, (int *)®node->std_param.always_on, 0, + CTLFLAG_RD, (uint8_t *)®node->std_param.always_on, 0, "Is always enabled"); SYSCTL_ADD_PROC(®node->sysctl_ctx, From owner-svn-src-head@freebsd.org Fri Jun 15 17:38:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC0461015C9A; Fri, 15 Jun 2018 17:38:08 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 631087A4EE; Fri, 15 Jun 2018 17:38:08 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45C241A8B8; Fri, 15 Jun 2018 17:38:08 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FHc8Sx048055; Fri, 15 Jun 2018 17:38:08 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FHc89H048054; Fri, 15 Jun 2018 17:38:08 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806151738.w5FHc89H048054@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 15 Jun 2018 17:38:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335221 - head/usr.sbin/asf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/asf X-SVN-Commit-Revision: 335221 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 17:38:08 -0000 Author: emaste Date: Fri Jun 15 17:38:07 2018 New Revision: 335221 URL: https://svnweb.freebsd.org/changeset/base/335221 Log: Add deprecation notice in asf.8 PR: 229046 Reviewed by: jhb MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/asf/asf.8 Modified: head/usr.sbin/asf/asf.8 ============================================================================== --- head/usr.sbin/asf/asf.8 Fri Jun 15 17:29:32 2018 (r335220) +++ head/usr.sbin/asf/asf.8 Fri Jun 15 17:38:07 2018 (r335221) @@ -37,6 +37,15 @@ .Op Fl o Ar outfile .Op Fl X Ar suffix .Op Ar modules-path Op Ar outfile +.Sh DEPRECATION NOTICE +The +.Nm +utility is not present in +.Fx 12.0 +and later. +The +.Xr kgdb 1 +debugger handles kernel module state internally. .Sh DESCRIPTION By default, .Nm From owner-svn-src-head@freebsd.org Fri Jun 15 17:44:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5EEF1016165; Fri, 15 Jun 2018 17:44:22 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B01D7AD4D; Fri, 15 Jun 2018 17:44:22 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 332621AA61; Fri, 15 Jun 2018 17:44:22 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FHiMms053720; Fri, 15 Jun 2018 17:44:22 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FHiLTc053716; Fri, 15 Jun 2018 17:44:21 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806151744.w5FHiLTc053716@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 15 Jun 2018 17:44:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335222 - in head: . targets/pseudo/userland usr.sbin usr.sbin/asf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: . targets/pseudo/userland usr.sbin usr.sbin/asf X-SVN-Commit-Revision: 335222 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 17:44:23 -0000 Author: emaste Date: Fri Jun 15 17:44:21 2018 New Revision: 335222 URL: https://svnweb.freebsd.org/changeset/base/335222 Log: Remove obsolete asf(8) kgdb now handles kernel module state internally, so the asf tool serves no purpose. PR: 229046 Reviewed by: brooks Relnotes: yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D15827 Deleted: head/usr.sbin/asf/ Modified: head/ObsoleteFiles.inc head/targets/pseudo/userland/Makefile.depend head/usr.sbin/Makefile.amd64 head/usr.sbin/Makefile.i386 Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Jun 15 17:38:07 2018 (r335221) +++ head/ObsoleteFiles.inc Fri Jun 15 17:44:21 2018 (r335222) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20180615: asf(8) removed +OLD_FILES+=usr/bin/asf +OLD_FILES+=usr/share/man/man8/asf.8.gz # 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 Modified: head/targets/pseudo/userland/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/Makefile.depend Fri Jun 15 17:38:07 2018 (r335221) +++ head/targets/pseudo/userland/Makefile.depend Fri Jun 15 17:44:21 2018 (r335222) @@ -810,7 +810,6 @@ DIRDEPS.amd64= \ usr.sbin/acpi/acpidump \ usr.sbin/acpi/iasl \ usr.sbin/apm \ - usr.sbin/asf \ usr.sbin/bhyve \ usr.sbin/bhyvectl \ usr.sbin/bhyveload \ @@ -842,7 +841,6 @@ DIRDEPS.i386= \ sbin/sconfig \ usr.sbin/apm \ usr.sbin/apmd \ - usr.sbin/asf \ usr.sbin/btxld \ usr.sbin/cpucontrol \ usr.sbin/hyperv/tools \ Modified: head/usr.sbin/Makefile.amd64 ============================================================================== --- head/usr.sbin/Makefile.amd64 Fri Jun 15 17:38:07 2018 (r335221) +++ head/usr.sbin/Makefile.amd64 Fri Jun 15 17:44:21 2018 (r335222) @@ -9,7 +9,6 @@ SUBDIR+= acpi .if ${MK_APM} != "no" SUBDIR+= apm .endif -SUBDIR+= asf .if ${MK_BHYVE} != "no" SUBDIR+= bhyve SUBDIR+= bhyvectl Modified: head/usr.sbin/Makefile.i386 ============================================================================== --- head/usr.sbin/Makefile.i386 Fri Jun 15 17:38:07 2018 (r335221) +++ head/usr.sbin/Makefile.i386 Fri Jun 15 17:44:21 2018 (r335222) @@ -7,7 +7,6 @@ SUBDIR+= acpi SUBDIR+= apm SUBDIR+= apmd .endif -SUBDIR+= asf SUBDIR+= boot0cfg .if ${MK_TOOLCHAIN} != "no" SUBDIR+= btxld From owner-svn-src-head@freebsd.org Fri Jun 15 18:04:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7027B1016BCC; Fri, 15 Jun 2018 18:04:45 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 252927BABC; Fri, 15 Jun 2018 18:04:45 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 063CF1ADC2; Fri, 15 Jun 2018 18:04:45 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FI4ieo064042; Fri, 15 Jun 2018 18:04:44 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FI4i46064041; Fri, 15 Jun 2018 18:04:44 GMT (envelope-from np@FreeBSD.org) Message-Id: <201806151804.w5FI4i46064041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 15 Jun 2018 18:04:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335223 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 335223 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 18:04:45 -0000 Author: np Date: Fri Jun 15 18:04:44 2018 New Revision: 335223 URL: https://svnweb.freebsd.org/changeset/base/335223 Log: cxgbe(4): sysctls to display the local and intr CPUs for the adapter. The driver assumes the list can change (even though it does't right now) and queries it every time the sysctl runs. sysctl dev...local_cpus sysctl dev...intr_cpus sysctl dev.t6nex.0.local_cpus sysctl dev.t6nex.0.intr_cpus Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Fri Jun 15 17:44:21 2018 (r335222) +++ head/sys/dev/cxgbe/t4_main.c Fri Jun 15 18:04:44 2018 (r335223) @@ -588,6 +588,7 @@ static int sysctl_tx_rate(SYSCTL_HANDLER_ARGS); static int sysctl_ulprx_la(SYSCTL_HANDLER_ARGS); static int sysctl_wcwr_stats(SYSCTL_HANDLER_ARGS); static int sysctl_tc_params(SYSCTL_HANDLER_ARGS); +static int sysctl_cpus(SYSCTL_HANDLER_ARGS); #ifdef TCP_OFFLOAD static int sysctl_tls_rx_ports(SYSCTL_HANDLER_ARGS); static int sysctl_tp_tick(SYSCTL_HANDLER_ARGS); @@ -5547,6 +5548,14 @@ t4_sysctls(struct adapter *sc) SYSCTL_ADD_INT(ctx, children, OID_AUTO, "core_vdd", CTLFLAG_RD, &sc->params.core_vdd, 0, "core Vdd (in mV)"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "local_cpus", + CTLTYPE_STRING | CTLFLAG_RD, sc, LOCAL_CPUS, + sysctl_cpus, "A", "local CPUs"); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_cpus", + CTLTYPE_STRING | CTLFLAG_RD, sc, INTR_CPUS, + sysctl_cpus, "A", "preferred CPUs for interrupts"); + /* * dev.t4nex.X.misc. Marked CTLFLAG_SKIP to avoid information overload. */ @@ -8610,6 +8619,39 @@ done: sbuf_delete(sb); return (rc); +} + +static int +sysctl_cpus(SYSCTL_HANDLER_ARGS) +{ + struct adapter *sc = arg1; + enum cpu_sets op = arg2; + cpuset_t cpuset; + struct sbuf *sb; + int i, rc; + + MPASS(op == LOCAL_CPUS || op == INTR_CPUS); + + CPU_ZERO(&cpuset); + rc = bus_get_cpus(sc->dev, op, sizeof(cpuset), &cpuset); + if (rc != 0) + return (rc); + + rc = sysctl_wire_old_buffer(req, 0); + if (rc != 0) + return (rc); + + sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); + if (sb == NULL) + return (ENOMEM); + + CPU_FOREACH(i) + sbuf_printf(sb, "%d ", i); + rc = sbuf_finish(sb); + sbuf_delete(sb); + + return (rc); + } #ifdef TCP_OFFLOAD From owner-svn-src-head@freebsd.org Fri Jun 15 18:35:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 955B01017743; Fri, 15 Jun 2018 18:35:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02D717CDE7; Fri, 15 Jun 2018 18:35:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id D2A1110AFAD; Fri, 15 Jun 2018 14:35:41 -0400 (EDT) Subject: Re: svn commit: r335210 - head/tools/build/options To: Ed Maste , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201806151618.w5FGIdXX006808@repo.freebsd.org> From: John Baldwin Message-ID: <8c9be7aa-649a-3df3-b485-c30230c13a4a@FreeBSD.org> Date: Fri, 15 Jun 2018 11:35:41 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <201806151618.w5FGIdXX006808@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 15 Jun 2018 14:35:42 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 18:35:43 -0000 On 6/15/18 9:18 AM, Ed Maste wrote: > Author: emaste > Date: Fri Jun 15 16:18:39 2018 > New Revision: 335210 > URL: https://svnweb.freebsd.org/changeset/base/335210 > > Log: > Remove objcopy from BINUTILS option descriptions > > As of r306649 objcopy is always ELF Tool Chain's elfcopy; binutils > objcopy is never used. > > PR: 229046 > MFC after: 1 week > Sponsored by: The FreeBSD Foundation BTW, I found it confusing recently that objcopy's build glue was in usr.bin/elfcopy. That perhaps made sense during the transition, but should we just rename that to usr.bin/objcopy now? -- John Baldwin From owner-svn-src-head@freebsd.org Fri Jun 15 18:46:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45256101801A; Fri, 15 Jun 2018 18:46:02 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EBA7D7D792; Fri, 15 Jun 2018 18:46:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B290A1B507; Fri, 15 Jun 2018 18:46:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FIk16l085658; Fri, 15 Jun 2018 18:46:01 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FIk1dL085657; Fri, 15 Jun 2018 18:46:01 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806151846.w5FIk1dL085657@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 15 Jun 2018 18:46:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335224 - head/stand/arm/loader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/arm/loader X-SVN-Commit-Revision: 335224 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 18:46:02 -0000 Author: imp Date: Fri Jun 15 18:46:01 2018 New Revision: 335224 URL: https://svnweb.freebsd.org/changeset/base/335224 Log: Remove empty directory Deleted: head/stand/arm/loader/ From owner-svn-src-head@freebsd.org Fri Jun 15 18:50:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF69E10181CD; Fri, 15 Jun 2018 18:50:25 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 958857DA2F; Fri, 15 Jun 2018 18:50:25 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 738571B50D; Fri, 15 Jun 2018 18:50:25 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FIoP4S086026; Fri, 15 Jun 2018 18:50:25 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FIoPGx086025; Fri, 15 Jun 2018 18:50:25 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201806151850.w5FIoPGx086025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 15 Jun 2018 18:50:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335225 - head X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 335225 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 18:50:26 -0000 Author: bdrewery Date: Fri Jun 15 18:50:24 2018 New Revision: 335225 URL: https://svnweb.freebsd.org/changeset/base/335225 Log: lib32: Fix lib/libpmc/pmu-events files ending up in source directory. This could happen with either WITHOUT_AUTO_OBJ=yes or MAKELEVEL>0 for the initial 'make buildworld' command. This now ensures that build-tools targets have 'make obj' ran if needed. This is especially problematic for pmu-events since it is not directly connected in the build. Normally the 'make includes' call right before this implicitly creates the objdir with a 'make obj' already but misses pmu-events because it is disconnected from lib/libpmc. Fixing that would make this new 'make obj' pointless but it is being added to avoid this problem in the future should another tool be connected like this. Reported by: rgrimes, kib, kevans Sponsored by: Dell EMC Modified: head/Makefile.libcompat Modified: head/Makefile.libcompat ============================================================================== --- head/Makefile.libcompat Fri Jun 15 18:46:01 2018 (r335224) +++ head/Makefile.libcompat Fri Jun 15 18:50:24 2018 (r335225) @@ -201,6 +201,7 @@ build${libcompat}: .PHONY .endfor .endfor .for _dir in lib/ncurses/ncurses lib/ncurses/ncursesw ${_libmagic} ${_jevents} +.for _t in ${_obj} build-tools ${_+_}cd ${.CURDIR}/${_dir}; \ WORLDTMP=${WORLDTMP} \ MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" \ @@ -209,7 +210,8 @@ build${libcompat}: .PHONY OBJROOT='$${OBJTOP}/' \ MAKEOBJDIRPREFIX= \ DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ - build-tools + ${_t} +.endfor .endfor ${_+_}cd ${.CURDIR}; \ ${LIBCOMPATWMAKE} -f Makefile.inc1 -DNO_FSCHG libraries From owner-svn-src-head@freebsd.org Fri Jun 15 18:55:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C2F010184B3; Fri, 15 Jun 2018 18:55:03 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B5B77DF1F; Fri, 15 Jun 2018 18:55:03 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D811D1B69E; Fri, 15 Jun 2018 18:55:02 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FIt2aO090778; Fri, 15 Jun 2018 18:55:02 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FIt2Qo090777; Fri, 15 Jun 2018 18:55:02 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201806151855.w5FIt2Qo090777@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 15 Jun 2018 18:55:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335226 - head/sys/dev/ofw X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/dev/ofw X-SVN-Commit-Revision: 335226 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 18:55:03 -0000 Author: jhibbits Date: Fri Jun 15 18:55:02 2018 New Revision: 335226 URL: https://svnweb.freebsd.org/changeset/base/335226 Log: Check for a 'pci' prefix rather than a full match in get_addr_props Summary: Newer OPAL device trees, such as those on POWER9 systems, use 'pciex' for device_type, not 'pci'. Rather than enumerating all possible variants, just check for a 'pci' prefix. Reviewed by: nwhitehorn, breno.leitao_gmail.com Differential Revision: https://reviews.freebsd.org/D15817 Modified: head/sys/dev/ofw/ofw_subr.c Modified: head/sys/dev/ofw/ofw_subr.c ============================================================================== --- head/sys/dev/ofw/ofw_subr.c Fri Jun 15 18:50:24 2018 (r335225) +++ head/sys/dev/ofw/ofw_subr.c Fri Jun 15 18:55:02 2018 (r335226) @@ -61,7 +61,9 @@ get_addr_props(phandle_t node, uint32_t *addrp, uint32 res = OF_getprop(node, "device_type", type, sizeof(type)); if (res != -1) { type[sizeof(type) - 1] = '\0'; - pci = (strcmp(type, "pci") == 0) ? 1 : 0; + if (strcmp(type, "pci") == 0 || + strcmp(type, "pciex")== 0) + pci = 1; } } if (addrp != NULL) From owner-svn-src-head@freebsd.org Fri Jun 15 19:02:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C4C91018AC7; Fri, 15 Jun 2018 19:02:54 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 239397E70B; Fri, 15 Jun 2018 19:02:54 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 064851B85C; Fri, 15 Jun 2018 19:02:54 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FJ2rQS095858; Fri, 15 Jun 2018 19:02:53 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FJ2r1c095857; Fri, 15 Jun 2018 19:02:53 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201806151902.w5FJ2r1c095857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 15 Jun 2018 19:02:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335227 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 335227 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 19:02:54 -0000 Author: cem Date: Fri Jun 15 19:02:53 2018 New Revision: 335227 URL: https://svnweb.freebsd.org/changeset/base/335227 Log: Retain offset compatibility with pre-12.0 dumps As a follow-up to r324965, which adds support for compressed kernel dumps, readjust dump header members slightly to mostly preserve ABI with earlier (11.x and older) dumps. Reviewed by: markj X-MFC-With: r324965 Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D15829 Modified: head/sys/sys/kerneldump.h Modified: head/sys/sys/kerneldump.h ============================================================================== --- head/sys/sys/kerneldump.h Fri Jun 15 18:55:02 2018 (r335226) +++ head/sys/sys/kerneldump.h Fri Jun 15 19:02:53 2018 (r335227) @@ -81,8 +81,8 @@ struct kerneldumpheader { #define KERNELDUMPMAGIC_CLEARED "Cleared Kernel Dump" char architecture[12]; uint32_t version; -#define KERNELDUMPVERSION 3 -#define KERNELDUMP_TEXT_VERSION 3 +#define KERNELDUMPVERSION 4 +#define KERNELDUMP_TEXT_VERSION 4 uint32_t architectureversion; #define KERNELDUMP_AARCH64_VERSION 1 #define KERNELDUMP_AMD64_VERSION 2 @@ -93,14 +93,15 @@ struct kerneldumpheader { #define KERNELDUMP_RISCV_VERSION 1 #define KERNELDUMP_SPARC64_VERSION 1 uint64_t dumplength; /* excl headers */ - uint64_t dumpextent; uint64_t dumptime; uint32_t dumpkeysize; uint32_t blocksize; - uint8_t compression; char hostname[64]; char versionstring[192]; - char panicstring[179]; + char panicstring[175]; + uint8_t compression; + uint64_t dumpextent; + char unused[4]; uint32_t parity; }; From owner-svn-src-head@freebsd.org Fri Jun 15 19:07:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC6981018CDA; Fri, 15 Jun 2018 19:07:04 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-lf0-f42.google.com (mail-lf0-f42.google.com [209.85.215.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 289FA7E93D; Fri, 15 Jun 2018 19:07:04 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-lf0-f42.google.com with SMTP id g21-v6so16107134lfb.4; Fri, 15 Jun 2018 12:07:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=H4CE+x1dnSk5CT2OZzQKeOit7IwVCV8vcKIuWOKgdSM=; b=oYrqWjt1ac4QuLGiwotpWw1rViRIBScl5Og26EB7aAAXQPjNMz2HyJzbCF832/mSij 0sJnysiW8KlK+AHVDr3En307qcD7uzCojMGyXTSb4Ad0JX1k5pqoS3n0La1qAF26YHb8 zp1Dxs/4wvv97LaYgl4X1gyKftFy8PnKEsFOnyH1RLV9q2LmCCJfffZPSXk26dRstk2v 1CFTKc39KBNKkne2atZ60dnYaAnvelYS0Fo/h9y8rBYjylFLivvt7dJ298P21OoleAgp NNReFnFdi6gEH81H/os3ZGhaw9k8dOYolS0CT80CyQv7vaje1+JgSiNvJpN5P5DpP0DG M6jA== X-Gm-Message-State: APt69E2lZ3UfTIT0uV8kJxKkKSN8zU6zFVpGKtz1/fbxg6BXhVy8i4VM qlSoLq2roqIVRmn1gRPWa/JmAtH3fa/q0+vQXmg= X-Google-Smtp-Source: ADUXVKLvy8e/zvvA8VMEe269BVkhL20TbMXamS6wBhA6wi2FiKhINrRyGPiqqvPaA8Kfzq/f0DumkfsBqb+qsLawzhU= X-Received: by 2002:a2e:e1a:: with SMTP id 26-v6mr1988083ljo.107.1529089616500; Fri, 15 Jun 2018 12:06:56 -0700 (PDT) MIME-Version: 1.0 References: <201806151855.w5FIt2Qo090777@repo.freebsd.org> In-Reply-To: <201806151855.w5FIt2Qo090777@repo.freebsd.org> From: Justin Hibbits Date: Fri, 15 Jun 2018 14:06:45 -0500 Message-ID: Subject: Re: svn commit: r335226 - head/sys/dev/ofw To: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 19:07:04 -0000 On Fri, Jun 15, 2018, 13:55 Justin Hibbits wrote: > Author: jhibbits > Date: Fri Jun 15 18:55:02 2018 > New Revision: 335226 > URL: https://svnweb.freebsd.org/changeset/base/335226 > > Log: > Check for a 'pci' prefix rather than a full match in get_addr_props > > Summary: > Newer OPAL device trees, such as those on POWER9 systems, use 'pciex' for > device_type, not 'pci'. Rather than enumerating all possible variants, > just > check for a 'pci' prefix. > And, given the changes made, the commit message is incorrect. It does enumerate all current variants. - Justin From owner-svn-src-head@freebsd.org Fri Jun 15 19:07:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 928031018CF2; Fri, 15 Jun 2018 19:07:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4112C7E943; Fri, 15 Jun 2018 19:07:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 183AC1B864; Fri, 15 Jun 2018 19:07:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FJ7608096081; Fri, 15 Jun 2018 19:07:06 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FJ76w1096080; Fri, 15 Jun 2018 19:07:06 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806151907.w5FJ76w1096080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 15 Jun 2018 19:07:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335228 - head/stand/efi/loader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/loader X-SVN-Commit-Revision: 335228 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 19:07:07 -0000 Author: imp Date: Fri Jun 15 19:07:06 2018 New Revision: 335228 URL: https://svnweb.freebsd.org/changeset/base/335228 Log: Migrate has_keyboard to bool. Modified: head/stand/efi/loader/main.c Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Fri Jun 15 19:02:53 2018 (r335227) +++ head/stand/efi/loader/main.c Fri Jun 15 19:07:06 2018 (r335228) @@ -92,14 +92,14 @@ efi_zfs_is_preferred(EFI_HANDLE *h) } #endif -static int +static bool has_keyboard(void) { EFI_STATUS status; EFI_DEVICE_PATH *path; EFI_HANDLE *hin, *hin_end, *walker; UINTN sz; - int retval = 0; + bool retval = false; /* * Find all the handles that support the SIMPLE_TEXT_INPUT_PROTOCOL and @@ -146,7 +146,7 @@ has_keyboard(void) acpi = (ACPI_HID_DEVICE_PATH *)(void *)path; if ((EISA_ID_TO_NUM(acpi->HID) & 0xff00) == 0x300 && (acpi->HID & 0xffff) == PNP_EISA_ID_CONST) { - retval = 1; + retval = true; goto out; } /* @@ -162,7 +162,7 @@ has_keyboard(void) if (usb->DeviceClass == 3 && /* HID */ usb->DeviceSubClass == 1 && /* Boot devices */ usb->DeviceProtocol == 1) { /* Boot keyboards */ - retval = 1; + retval = true; goto out; } } @@ -416,7 +416,7 @@ main(int argc, CHAR16 *argv[]) int i, j, howto; bool vargood; UINTN k; - int has_kbd; + bool has_kbd; char *s; EFI_DEVICE_PATH *imgpath; CHAR16 *text; From owner-svn-src-head@freebsd.org Fri Jun 15 19:07:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79A1F1018D34; Fri, 15 Jun 2018 19:07:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2FA817EB37; Fri, 15 Jun 2018 19:07:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 10CF71B865; Fri, 15 Jun 2018 19:07:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FJ7QAU096144; Fri, 15 Jun 2018 19:07:26 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FJ7Qnj096140; Fri, 15 Jun 2018 19:07:26 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806151907.w5FJ7Qnj096140@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 15 Jun 2018 19:07:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335229 - in head/stand/efi: include libefi loader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/stand/efi: include libefi loader X-SVN-Commit-Revision: 335229 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 19:07:27 -0000 Author: imp Date: Fri Jun 15 19:07:26 2018 New Revision: 335229 URL: https://svnweb.freebsd.org/changeset/base/335229 Log: Provide a more direct interface to tell ZFS what the preferred handle is. We tell the ZFS code now, and it checks rather than having a callback to do the checks. This will allow us to have a more graceful fallback code. In the future, it's anticipated that we may fallback to a more global search (or implement a command to do so) when reqeusted by the user, or we detect a violation of the UEFI Boot Manager protocol severe enough to warrant this backstop. For now, it just allows us to get rid of img as a global. Sponsored by: Netflix Modified: head/stand/efi/include/efizfs.h head/stand/efi/libefi/efizfs.c head/stand/efi/loader/main.c Modified: head/stand/efi/include/efizfs.h ============================================================================== --- head/stand/efi/include/efizfs.h Fri Jun 15 19:07:06 2018 (r335228) +++ head/stand/efi/include/efizfs.h Fri Jun 15 19:07:26 2018 (r335229) @@ -44,11 +44,11 @@ typedef struct zfsinfo extern uint64_t pool_guid; -extern void efi_zfs_probe(void); -extern zfsinfo_list_t *efizfs_get_zfsinfo_list(void); -extern bool efi_zfs_is_preferred(EFI_HANDLE *h); -extern EFI_HANDLE efizfs_get_handle_by_guid(uint64_t); -extern bool efizfs_get_guid_by_handle(EFI_HANDLE, uint64_t *); +void efi_zfs_probe(void); +EFI_HANDLE efizfs_get_handle_by_guid(uint64_t); +bool efizfs_get_guid_by_handle(EFI_HANDLE, uint64_t *); +zfsinfo_list_t *efizfs_get_zfsinfo_list(void); +void efizfs_set_preferred(EFI_HANDLE); #endif Modified: head/stand/efi/libefi/efizfs.c ============================================================================== --- head/stand/efi/libefi/efizfs.c Fri Jun 15 19:07:06 2018 (r335228) +++ head/stand/efi/libefi/efizfs.c Fri Jun 15 19:07:26 2018 (r335229) @@ -45,6 +45,14 @@ static zfsinfo_list_t zfsinfo; uint64_t pool_guid; +static EFI_HANDLE preferred; + +void +efizfs_set_preferred(EFI_HANDLE h) +{ + preferred = h; +} + zfsinfo_list_t * efizfs_get_zfsinfo_list(void) { @@ -110,16 +118,13 @@ efi_zfs_probe(void) */ STAILQ_FOREACH(hd, hdi, pd_link) { STAILQ_FOREACH(pd, &hd->pd_part, pd_link) { - snprintf(devname, sizeof(devname), "%s%dp%d:", efipart_hddev.dv_name, hd->pd_unit, pd->pd_unit); - - if (zfs_probe_dev(devname, &guid) == 0) { - insert_zfs(pd->pd_handle, guid); - - if (efi_zfs_is_preferred(pd->pd_handle)) - pool_guid = guid; - } + if (zfs_probe_dev(devname, &guid) == 0) { + insert_zfs(pd->pd_handle, guid); + if (pd->pd_handle == preferred) + pool_guid = guid; + } } } Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Fri Jun 15 19:07:06 2018 (r335228) +++ head/stand/efi/loader/main.c Fri Jun 15 19:07:26 2018 (r335229) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #ifdef EFI_ZFS_BOOT #include - #include "efizfs.h" #endif @@ -73,8 +72,6 @@ EFI_GUID debugimg = DEBUG_IMAGE_INFO_TABLE_GUID; EFI_GUID fdtdtb = FDT_TABLE_GUID; EFI_GUID inputid = SIMPLE_TEXT_INPUT_PROTOCOL; -static EFI_LOADED_IMAGE *img; - /* * Number of seconds to wait for a keystroke before exiting with failure * in the event no currdev is found. -2 means always break, -1 means @@ -84,14 +81,6 @@ static EFI_LOADED_IMAGE *img; */ static int fail_timeout = 5; -#ifdef EFI_ZFS_BOOT -bool -efi_zfs_is_preferred(EFI_HANDLE *h) -{ - return (h == img->DeviceHandle); -} -#endif - static bool has_keyboard(void) { @@ -424,6 +413,7 @@ main(int argc, CHAR16 *argv[]) UINT16 boot_current; size_t sz; UINT16 boot_order[100]; + EFI_LOADED_IMAGE *img; #if !defined(__arm__) char buf[40]; #endif @@ -441,6 +431,10 @@ main(int argc, CHAR16 *argv[]) /* Get our loaded image protocol interface structure. */ BS->HandleProtocol(IH, &imgid, (VOID**)&img); +#ifdef EFI_ZFS_BOOT + /* Tell ZFS probe code where we booted from */ + efizfs_set_preferred(img->DeviceHandle); +#endif /* Init the time source */ efi_time_init(); From owner-svn-src-head@freebsd.org Fri Jun 15 19:07:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0F7F1018D6A; Fri, 15 Jun 2018 19:07:34 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 661807EBDF; Fri, 15 Jun 2018 19:07:32 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4EC961B866; Fri, 15 Jun 2018 19:07:32 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FJ7WW7096197; Fri, 15 Jun 2018 19:07:32 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FJ7W9Z096196; Fri, 15 Jun 2018 19:07:32 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806151907.w5FJ7W9Z096196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 15 Jun 2018 19:07:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335230 - head/stand/efi/loader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/loader X-SVN-Commit-Revision: 335230 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 19:07:35 -0000 Author: imp Date: Fri Jun 15 19:07:31 2018 New Revision: 335230 URL: https://svnweb.freebsd.org/changeset/base/335230 Log: Move arg parsing into its own routine for possible later reuse. Modified: head/stand/efi/loader/main.c Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Fri Jun 15 19:07:26 2018 (r335229) +++ head/stand/efi/loader/main.c Fri Jun 15 19:07:31 2018 (r335230) @@ -397,63 +397,14 @@ interactive_interrupt(const char *msg) return (false); } -EFI_STATUS -main(int argc, CHAR16 *argv[]) +int +parse_args(int argc, CHAR16 *argv[], bool has_kbd) { - char var[128]; - EFI_GUID *guid; int i, j, howto; bool vargood; - UINTN k; - bool has_kbd; - char *s; - EFI_DEVICE_PATH *imgpath; - CHAR16 *text; - EFI_STATUS status; - UINT16 boot_current; - size_t sz; - UINT16 boot_order[100]; - EFI_LOADED_IMAGE *img; -#if !defined(__arm__) - char buf[40]; -#endif + char var[128]; - archsw.arch_autoload = efi_autoload; - archsw.arch_getdev = efi_getdev; - archsw.arch_copyin = efi_copyin; - archsw.arch_copyout = efi_copyout; - archsw.arch_readin = efi_readin; -#ifdef EFI_ZFS_BOOT - /* Note this needs to be set before ZFS init. */ - archsw.arch_zfs_probe = efi_zfs_probe; -#endif - - /* Get our loaded image protocol interface structure. */ - BS->HandleProtocol(IH, &imgid, (VOID**)&img); - -#ifdef EFI_ZFS_BOOT - /* Tell ZFS probe code where we booted from */ - efizfs_set_preferred(img->DeviceHandle); -#endif - /* Init the time source */ - efi_time_init(); - - has_kbd = has_keyboard(); - /* - * XXX Chicken-and-egg problem; we want to have console output - * early, but some console attributes may depend on reading from - * eg. the boot device, which we can't do yet. We can use - * printf() etc. once this is done. - */ - cons_probe(); - - /* - * Initialise the block cache. Set the upper limit. - */ - bcache_init(32768, 512); - - /* * Parse the args to set the console settings, etc * boot1.efi passes these in, if it can read /boot.config or /boot/config * or iPXE may be setup to pass these in. Or the optional argument in the @@ -541,6 +492,65 @@ main(int argc, CHAR16 *argv[]) } } } + return (howto); +} + + +EFI_STATUS +main(int argc, CHAR16 *argv[]) +{ + EFI_GUID *guid; + int howto, i; + UINTN k; + bool has_kbd; + char *s; + EFI_DEVICE_PATH *imgpath; + CHAR16 *text; + EFI_STATUS status; + UINT16 boot_current; + size_t sz; + UINT16 boot_order[100]; + EFI_LOADED_IMAGE *img; +#if !defined(__arm__) + char buf[40]; +#endif + + archsw.arch_autoload = efi_autoload; + archsw.arch_getdev = efi_getdev; + archsw.arch_copyin = efi_copyin; + archsw.arch_copyout = efi_copyout; + archsw.arch_readin = efi_readin; +#ifdef EFI_ZFS_BOOT + /* Note this needs to be set before ZFS init. */ + archsw.arch_zfs_probe = efi_zfs_probe; +#endif + + /* Get our loaded image protocol interface structure. */ + BS->HandleProtocol(IH, &imgid, (VOID**)&img); + +#ifdef EFI_ZFS_BOOT + /* Tell ZFS probe code where we booted from */ + efizfs_set_preferred(img->DeviceHandle); +#endif + /* Init the time source */ + efi_time_init(); + + has_kbd = has_keyboard(); + + /* + * XXX Chicken-and-egg problem; we want to have console output + * early, but some console attributes may depend on reading from + * eg. the boot device, which we can't do yet. We can use + * printf() etc. once this is done. + */ + cons_probe(); + + /* + * Initialise the block cache. Set the upper limit. + */ + bcache_init(32768, 512); + + howto = parse_args(argc, argv, has_kbd); bootenv_set(howto); From owner-svn-src-head@freebsd.org Fri Jun 15 19:07:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BF841018D8D; Fri, 15 Jun 2018 19:07:40 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B8B17EC43; Fri, 15 Jun 2018 19:07:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D1E801B867; Fri, 15 Jun 2018 19:07:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FJ7bbu096251; Fri, 15 Jun 2018 19:07:37 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FJ7baq096250; Fri, 15 Jun 2018 19:07:37 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806151907.w5FJ7baq096250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 15 Jun 2018 19:07:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335231 - head/stand/efi/loader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/loader X-SVN-Commit-Revision: 335231 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 19:07:40 -0000 Author: imp Date: Fri Jun 15 19:07:37 2018 New Revision: 335231 URL: https://svnweb.freebsd.org/changeset/base/335231 Log: There's no need to walk through the tables looking for the smbios table if we're just going to ignore it on arm, so expand, slightly, the reach of the ifdef. Move the buffer to the inner block so we don't have a separate #ifdef far away from these lines. The issue on arm is that smbios_detect does unaligned accesses, which in the u-boot implementing EFI context causes a crash. Modified: head/stand/efi/loader/main.c Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Fri Jun 15 19:07:31 2018 (r335230) +++ head/stand/efi/loader/main.c Fri Jun 15 19:07:37 2018 (r335231) @@ -511,9 +511,6 @@ main(int argc, CHAR16 *argv[]) size_t sz; UINT16 boot_order[100]; EFI_LOADED_IMAGE *img; -#if !defined(__arm__) - char buf[40]; -#endif archsw.arch_autoload = efi_autoload; archsw.arch_getdev = efi_getdev; @@ -655,18 +652,20 @@ main(int argc, CHAR16 *argv[]) efi_init_environment(); setenv("LINES", "24", 1); /* optional */ +#if !defined(__arm__) for (k = 0; k < ST->NumberOfTableEntries; k++) { guid = &ST->ConfigurationTable[k].VendorGuid; -#if !defined(__arm__) if (!memcmp(guid, &smbios, sizeof(EFI_GUID))) { + char buf[40]; + snprintf(buf, sizeof(buf), "%p", ST->ConfigurationTable[k].VendorTable); setenv("hint.smbios.0.mem", buf, 1); smbios_detect(ST->ConfigurationTable[k].VendorTable); break; } -#endif } +#endif interact(); /* doesn't return */ From owner-svn-src-head@freebsd.org Fri Jun 15 19:09:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93D241018EE1; Fri, 15 Jun 2018 19:09:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4823D7EF8A; Fri, 15 Jun 2018 19:09:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A0941B86B; Fri, 15 Jun 2018 19:09:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FJ9IXe096373; Fri, 15 Jun 2018 19:09:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FJ9ICo096372; Fri, 15 Jun 2018 19:09:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806151909.w5FJ9ICo096372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 15 Jun 2018 19:09:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335232 - head/sys/arm64/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/arm64/linux X-SVN-Commit-Revision: 335232 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 19:09:18 -0000 Author: emaste Date: Fri Jun 15 19:09:17 2018 New Revision: 335232 URL: https://svnweb.freebsd.org/changeset/base/335232 Log: arm64: add arm64 linux.h based on i386 linuxulator and Linux headers Sponsored by: Turing Robotic Industries Added: head/sys/arm64/linux/linux.h (contents, props changed) Added: head/sys/arm64/linux/linux.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/linux/linux.h Fri Jun 15 19:09:17 2018 (r335232) @@ -0,0 +1,321 @@ +/*- + * Copyright (c) 1994-1996 Søren Schmidt + * Copyright (c) 2013 Dmitry Chagin + * Copyright (c) 2018 Turing Robotic Industries Inc. + * + * 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$ + */ +#ifndef _ARM64_LINUX_H_ +#define _ARM64_LINUX_H_ + +#include +#include + +/* Debugging support */ +#define DEBUG +extern u_char linux_debug_map[]; +#define ldebug(name) isclr(linux_debug_map, LINUX_SYS_linux_ ## name) +#define ARGS(nm, fmt) "linux(%ld/%ld): "#nm"("fmt")\n", \ + (long)td->td_proc->p_pid, (long)td->td_tid +#define LMSG(fmt) "linux(%ld/%ld): "fmt"\n", \ + (long)td->td_proc->p_pid, (long)td->td_tid +#define LINUX_DTRACE linuxulator + +#define PTRIN(v) (void *)(v) +#define PTROUT(v) (uintptr_t)(v) + +#define CP(src,dst,fld) do { (dst).fld = (src).fld; } while (0) +#define CP2(src,dst,sfld,dfld) do { (dst).dfld = (src).sfld; } while (0) +#define PTRIN_CP(src,dst,fld) \ + do { (dst).fld = PTRIN((src).fld); } while (0) + +/* Provide a separate set of types for the Linux types */ +typedef int32_t l_int; +typedef int64_t l_long; +typedef int16_t l_short; +typedef uint32_t l_uint; +typedef uint64_t l_ulong; +typedef uint16_t l_ushort; + +typedef l_ulong l_uintptr_t; +typedef l_long l_clock_t; +typedef l_int l_daddr_t; +typedef l_ulong l_dev_t; +typedef l_uint l_gid_t; +typedef l_ushort l_gid16_t; /* XXX */ +typedef l_uint l_uid_t; +typedef l_ushort l_uid16_t; /* XXX */ +typedef l_ulong l_ino_t; +typedef l_int l_key_t; +typedef l_long l_loff_t; +typedef l_uint l_mode_t; +typedef l_long l_off_t; +typedef l_int l_pid_t; +typedef l_ulong l_size_t; +typedef l_long l_suseconds_t; +typedef l_long l_time_t; +typedef l_int l_timer_t; /* XXX */ +typedef l_ulong l_fd_mask; + +typedef struct { + l_int val[2]; +} l_fsid_t; + +typedef struct { + l_time_t tv_sec; + l_suseconds_t tv_usec; +} l_timeval; + +#define l_fd_set fd_set + +/* Miscellaneous */ +#define LINUX_AT_COUNT 20 + +struct l___sysctl_args +{ + l_uintptr_t name; + l_int nlen; + l_uintptr_t oldval; + l_uintptr_t oldlenp; + l_uintptr_t newval; + l_uintptr_t newlen; + l_ulong __spare[4]; +}; + +/* Resource limits */ +#define LINUX_RLIMIT_CPU 0 +#define LINUX_RLIMIT_FSIZE 1 +#define LINUX_RLIMIT_DATA 2 +#define LINUX_RLIMIT_STACK 3 +#define LINUX_RLIMIT_CORE 4 +#define LINUX_RLIMIT_RSS 5 +#define LINUX_RLIMIT_NPROC 6 +#define LINUX_RLIMIT_NOFILE 7 +#define LINUX_RLIMIT_MEMLOCK 8 +#define LINUX_RLIMIT_AS 9 /* Address space limit */ + +#define LINUX_RLIM_NLIMITS 10 + +struct l_rlimit { + l_ulong rlim_cur; + l_ulong rlim_max; +}; + +/* stat family of syscalls */ +struct l_timespec { + l_time_t tv_sec; + l_long tv_nsec; +}; + +struct l_newstat { + l_dev_t st_dev; + l_ino_t st_ino; + l_uint st_mode; + l_uint st_nlink; + + l_uid_t st_uid; + l_gid_t st_gid; + + l_dev_t st_rdev; + l_ulong __st_pad1; + l_off_t st_size; + l_int st_blksize; + l_int __st_pad2; + l_long st_blocks; + + struct l_timespec st_atim; + struct l_timespec st_mtim; + struct l_timespec st_ctim; + l_uint __unused1; + l_uint __unused2; +}; + +/* sigaction flags */ +#define LINUX_SA_NOCLDSTOP 0x00000001 +#define LINUX_SA_NOCLDWAIT 0x00000002 +#define LINUX_SA_SIGINFO 0x00000004 +#define LINUX_SA_RESTORER 0x04000000 +#define LINUX_SA_ONSTACK 0x08000000 +#define LINUX_SA_RESTART 0x10000000 +#define LINUX_SA_INTERRUPT 0x20000000 /* XXX */ +#define LINUX_SA_NOMASK 0x40000000 /* SA_NODEFER */ +#define LINUX_SA_ONESHOT 0x80000000 /* SA_RESETHAND */ + +/* sigprocmask actions */ +#define LINUX_SIG_BLOCK 0 +#define LINUX_SIG_UNBLOCK 1 +#define LINUX_SIG_SETMASK 2 + +/* sigaltstack */ +#define LINUX_MINSIGSTKSZ 2048 /* XXX */ + +typedef void (*l_handler_t)(l_int); + +typedef struct { + l_handler_t lsa_handler; + l_sigset_t lsa_mask; + l_ulong lsa_flags; + l_uintptr_t lsa_restorer; +} l_sigaction_t; /* XXX */ + +typedef struct { + l_uintptr_t ss_sp; + l_int ss_flags; + l_size_t ss_size; +} l_stack_t; + +#define LINUX_SI_PREAMBLE_SIZE (4 * sizeof(int)) +#define LINUX_SI_MAX_SIZE 128 +#define LINUX_SI_PAD_SIZE ((LINUX_SI_MAX_SIZE - \ + LINUX_SI_PREAMBLE_SIZE) / sizeof(l_int)) +typedef union l_sigval { + l_int sival_int; + l_uintptr_t sival_ptr; +} l_sigval_t; + +typedef struct l_siginfo { + l_int lsi_signo; + l_int lsi_errno; + l_int lsi_code; + union { + l_int _pad[LINUX_SI_PAD_SIZE]; + + struct { + l_pid_t _pid; + l_uid_t _uid; + } _kill; + + struct { + l_timer_t _tid; + l_int _overrun; + char _pad[sizeof(l_uid_t) - sizeof(int)]; + union l_sigval _sigval; + l_uint _sys_private; + } _timer; + + struct { + l_pid_t _pid; /* sender's pid */ + l_uid_t _uid; /* sender's uid */ + union l_sigval _sigval; + } _rt; + + struct { + l_pid_t _pid; /* which child */ + l_uid_t _uid; /* sender's uid */ + l_int _status; /* exit code */ + l_clock_t _utime; + l_clock_t _stime; + } _sigchld; + + struct { + l_uintptr_t _addr; /* Faulting insn/memory ref. */ + } _sigfault; + + struct { + l_long _band; /* POLL_IN,POLL_OUT,POLL_MSG */ + l_int _fd; + } _sigpoll; + } _sifields; +} l_siginfo_t; + +#define lsi_pid _sifields._kill._pid +#define lsi_uid _sifields._kill._uid +#define lsi_tid _sifields._timer._tid +#define lsi_overrun _sifields._timer._overrun +#define lsi_sys_private _sifields._timer._sys_private +#define lsi_status _sifields._sigchld._status +#define lsi_utime _sifields._sigchld._utime +#define lsi_stime _sifields._sigchld._stime +#define lsi_value _sifields._rt._sigval +#define lsi_int _sifields._rt._sigval.sival_int +#define lsi_ptr _sifields._rt._sigval.sival_ptr +#define lsi_addr _sifields._sigfault._addr +#define lsi_band _sifields._sigpoll._band +#define lsi_fd _sifields._sigpoll._fd + +union l_semun { + l_int val; + l_uintptr_t buf; + l_uintptr_t array; + l_uintptr_t __buf; + l_uintptr_t __pad; +}; + +struct l_sockaddr { + l_ushort sa_family; + char sa_data[14]; +}; + +struct l_ifmap { + l_ulong mem_start; + l_ulong mem_end; + l_ushort base_addr; + u_char irq; + u_char dma; + u_char port; +} __packed; + +#define LINUX_IFHWADDRLEN 6 +#define LINUX_IFNAMSIZ 16 + +struct l_ifreq { + union { + char ifrn_name[LINUX_IFNAMSIZ]; + } ifr_ifrn; + + union { + struct l_sockaddr ifru_addr; + struct l_sockaddr ifru_dstaddr; + struct l_sockaddr ifru_broadaddr; + struct l_sockaddr ifru_netmask; + struct l_sockaddr ifru_hwaddr; + l_short ifru_flags[1]; + l_int ifru_ivalue; + l_int ifru_mtu; + struct l_ifmap ifru_map; + char ifru_slave[LINUX_IFNAMSIZ]; + l_uintptr_t ifru_data; + } ifr_ifru; +} __packed; + +#define ifr_name ifr_ifrn.ifrn_name /* Interface name */ +#define ifr_hwaddr ifr_ifru.ifru_hwaddr /* MAC address */ +#define ifr_ifindex ifr_ifru.ifru_ivalue /* Interface index */ + +#define linux_copyout_rusage(r, u) copyout(r, u, sizeof(*r)) + +/* robust futexes */ +struct linux_robust_list { + l_uintptr_t next; +}; + +struct linux_robust_list_head { + struct linux_robust_list list; + l_long futex_offset; + l_uintptr_t pending_list; +}; + +#endif /* _ARM64_LINUX_H_ */ From owner-svn-src-head@freebsd.org Fri Jun 15 19:19:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 107001019367; Fri, 15 Jun 2018 19:19:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B122B7F643; Fri, 15 Jun 2018 19:19:36 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9225D1BA20; Fri, 15 Jun 2018 19:19:36 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FJJaFv001781; Fri, 15 Jun 2018 19:19:36 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FJJavu001780; Fri, 15 Jun 2018 19:19:36 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201806151919.w5FJJavu001780@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 15 Jun 2018 19:19:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335233 - head/lib/libpmc X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/lib/libpmc X-SVN-Commit-Revision: 335233 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 19:19:37 -0000 Author: bdrewery Date: Fri Jun 15 19:19:36 2018 New Revision: 335233 URL: https://svnweb.freebsd.org/changeset/base/335233 Log: Put in temporary hacks for jevents. - Handle 'make clean' - Don't try building it locally, just fail instead. jevents should really be merged into lib/libpmc/Makefile. Modified: head/lib/libpmc/Makefile Modified: head/lib/libpmc/Makefile ============================================================================== --- head/lib/libpmc/Makefile Fri Jun 15 19:09:17 2018 (r335232) +++ head/lib/libpmc/Makefile Fri Jun 15 19:19:36 2018 (r335233) @@ -20,9 +20,11 @@ EVENT_ARCH="powerpc" .endif JEVENTS= ${BTOOLSPATH:U.}/pmu-events/jevents -# This file is built in a subdirectory so never try to rebuild -# it here due to missing meta file. -${JEVENTS}: .NOMETA +# This file is built in a subdirectory so never try to rebuild it here. +${JEVENTS}: .PHONY +.if make(*clean*) +SUBDIR+= pmu-events +.endif libpmc_events.c: ${JEVENTS} ${JEVENTS} ${EVENT_ARCH} ${.CURDIR}/pmu-events/arch libpmc_events.c From owner-svn-src-head@freebsd.org Fri Jun 15 19:31:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18A4F1019985; Fri, 15 Jun 2018 19:31:59 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B1BC47FD1D; Fri, 15 Jun 2018 19:31:58 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 7DA56B66F; Fri, 15 Jun 2018 19:31:58 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id AEAA49D7E; Fri, 15 Jun 2018 19:31:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id osuiEsGLpKtl; Fri, 15 Jun 2018 19:31:54 +0000 (UTC) Subject: Re: svn commit: r335233 - head/lib/libpmc DKIM-Filter: OpenDKIM Filter v2.10.3 mail.xzibition.com 944579D6B From: Bryan Drewery To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201806151919.w5FJJavu001780@repo.freebsd.org> Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Autocrypt: addr=bdrewery@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFJphmsBCADiFgmS4bIzwZijrS31SjEMzg+n5zNellgM+HkShwehpqCiyhXdWrvH6dTZ a6u50pbUIX7doTR7W7PQHCjCTqtpwvcj0eulZva+iHFp+XrbgSFHn+VVXgkYP2MFySyZRFab D2qqzJBEJofhpv4HvY6uQI5K99pMqKr1Z/lHqsijYYu4RH2OfwB5PinId7xeldzWEonVoCr+ rfxzO/UrgA6v/3layGZcKNHFjmc3NqoN1DXtdaEHqtjIozzbndVkH6lkFvIpIrI6i5ox8pwp VxsxLCr/4Musd5CWgHiet5kSw2SzNeA8FbxdLYCpXNVu+uBACEbCUP+CSNy3NVfEUxsBABEB AAHNJEJyeWFuIERyZXdlcnkgPGJkcmV3ZXJ5QEZyZWVCU0Qub3JnPsLAgAQTAQoAKgIbAwUL CQgHAwUVCgkICwUWAwIBAAIeAQIXgAIZAQUCWujOIgUJCmB7NwAKCRA113G7bkaXz/xpB/9b /UWIPbieY1IeIuHF2pyYPE7Hytkh3HVsxMA0F5Ma2AYQsXZZeKNKWrF7RPyDyDwUklLHJkhm k3EfClBbHxf08kMIm1vWCJRtgxic9knY/bzYGiWMpHjg3cSd1XfrYH1autYqTZAjDwIkgOjU dR//Tbn4V36sY7y2jz+kdMVWvK53U32aZqiwBbCn4DPe1wSZcUs17mV/0uZdIoGdj74B1orN A/0py5vHYo6HcbBNoaR8pKRLf5VZNRsxqGIMhTucx4SJWcHpuRBWYyvJSFzwvxdK4ZD4Yqoc kFGPVtOXktVMai9exrLvP3G77fKMu8DI6j4QRU4wCesnHuIfRPFuzsBNBFJphmsBCACiVFPf kNfaFtUSuY0395ueo/rMyHPGPQ2iwvERFCpeFGSQSgagpenNHLpFQKTg/dl6FOoST5tqyxMq fyHGHDzzU51bvA/IfaGoNi/BIhTe/toZNMRvpcI3PLjiGcnJnuwCCbAVOAGdb+t5cZtpNdOI cKYmrYG3u9RiBpe6dTF+qLrD/8Bs1wjhduQ8fcNNgnkXu8xDH4ZxY0lIc3QgvYWp9vimlQe6 iKjUd2/DX28ETZcD5h6pYV331KMPTrEI0p0yvFijUZce8c1XHFyL1j9sBAha5qpszJl6Uq5i LolhKRcGfcdmtD72vHQjUYglUyudSJUVyo2gMYjdbiFKzJulABEBAAHCwGUEGAEKAA8CGwwF AlrozigFCQpgez0ACgkQNddxu25Gl8+m5Af/R3VEdxNMAcDIes9ADhQyofj20SPV3eCJ3HYR OebTSuNdOudGt4AAyA8Ks94u9hiIp5IGsc6RDsT9W7O2vgXhd6eV3eiY5Oif5xLIYrIDVu1Y 1GyRxRrPEn/QOqDN6uFZCPwK1aOapGcYCrO9lB0gMuTVfgHanU61rgC9tMX0OoAOyRd+V3/M 8lDNhjJdF/IpO3SdYzKfkwduy4qamw4Gphcx/RfYQvYLq/eDkP8d50PphWdboqWBwNRHayro W/07OGzfxM5fJ5mBsXPQcO2QcRjkyHf6xCM6Hi1qQL4OnXMNE/ZTX0lnOj1/pH93TlzSHZMP TaiiA/MBD3vGsXBmBg== Organization: FreeBSD Message-ID: <428a1d2a-92d2-94a3-eeee-921f6ff865ba@FreeBSD.org> Date: Fri, 15 Jun 2018 12:31:55 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <201806151919.w5FJJavu001780@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="t1aW6H7gGiomo13QWnHY2bxrQ0G4MLrhb" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 19:31:59 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --t1aW6H7gGiomo13QWnHY2bxrQ0G4MLrhb Content-Type: multipart/mixed; boundary="DmvSMQpvfYToRIcAsmRFVNr9mGAv8u6RU"; protected-headers="v1" From: Bryan Drewery To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <428a1d2a-92d2-94a3-eeee-921f6ff865ba@FreeBSD.org> Subject: Re: svn commit: r335233 - head/lib/libpmc References: <201806151919.w5FJJavu001780@repo.freebsd.org> In-Reply-To: <201806151919.w5FJJavu001780@repo.freebsd.org> --DmvSMQpvfYToRIcAsmRFVNr9mGAv8u6RU Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 6/15/2018 12:19 PM, Bryan Drewery wrote: > Author: bdrewery > Date: Fri Jun 15 19:19:36 2018 > New Revision: 335233 > URL: https://svnweb.freebsd.org/changeset/base/335233 >=20 > Log: > Put in temporary hacks for jevents. > =20 > - Handle 'make clean' > - Don't try building it locally, just fail instead. > =20 > jevents should really be merged into lib/libpmc/Makefile. >=20 > Modified: > head/lib/libpmc/Makefile >=20 > Modified: head/lib/libpmc/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/lib/libpmc/Makefile Fri Jun 15 19:09:17 2018 (r335232) > +++ head/lib/libpmc/Makefile Fri Jun 15 19:19:36 2018 (r335233) > @@ -20,9 +20,11 @@ EVENT_ARCH=3D"powerpc" > .endif > =20 > JEVENTS=3D ${BTOOLSPATH:U.}/pmu-events/jevents > -# This file is built in a subdirectory so never try to rebuild > -# it here due to missing meta file. > -${JEVENTS}: .NOMETA > +# This file is built in a subdirectory so never try to rebuild it here= =2E > +${JEVENTS}: .PHONY FYI .NOMETA was removed since .PHONY essentially implies it. > +.if make(*clean*) > +SUBDIR+=3D pmu-events > +.endif > =20 > libpmc_events.c: ${JEVENTS} > ${JEVENTS} ${EVENT_ARCH} ${.CURDIR}/pmu-events/arch libpmc_events.c >=20 --=20 Regards, Bryan Drewery --DmvSMQpvfYToRIcAsmRFVNr9mGAv8u6RU-- --t1aW6H7gGiomo13QWnHY2bxrQ0G4MLrhb Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJbJBQrAAoJEDXXcbtuRpfP9RMH/RkM2Lq514naL5hR5QaAwfnl 1T8bfmdWeAb20LFFyqgTBn/7ytD6nD/u5M0L8KtiSUQZ/Cdm4rOU6gbHN49NF/a2 pF+aJ8My5a1qpKQjF41S/NL0rS8UEqq3FF3J1TNcO+mC6r/gJmUuJ4i0e8UDn5LG 9lNIhkvOQ1krdsU0mn1JFHK0a6eZqS3LKzp0DwDI89dr4segIDFEB34dpmIL2MUy xVseFZBWXhyqe6ZZhFHWcOYSV5gfXWmhEbOPW3JSMrFUeC8KxPoGyn8W4kZuekFq FUvjdCzxj3ObUB11miCJg1GKPVcdDLG/WwKLodoJxQRprCDkw0eNplBQHtKWUGc= =xskg -----END PGP SIGNATURE----- --t1aW6H7gGiomo13QWnHY2bxrQ0G4MLrhb-- From owner-svn-src-head@freebsd.org Fri Jun 15 19:35:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 341BA1019A70; Fri, 15 Jun 2018 19:35:10 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CCD4880016; Fri, 15 Jun 2018 19:35:09 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8EDB1BD50; Fri, 15 Jun 2018 19:35:09 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FJZ9Dp011826; Fri, 15 Jun 2018 19:35:09 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FJZ80v011822; Fri, 15 Jun 2018 19:35:08 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201806151935.w5FJZ80v011822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 15 Jun 2018 19:35:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335234 - in head/usr.sbin: . pnfsdsfile X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in head/usr.sbin: . pnfsdsfile X-SVN-Commit-Revision: 335234 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 19:35:10 -0000 Author: rmacklem Date: Fri Jun 15 19:35:08 2018 New Revision: 335234 URL: https://svnweb.freebsd.org/changeset/base/335234 Log: Add a command the displays and modifies the pNFS server's extended attribute. This command allows a sysadmin to display or modify the pnfsd.dsfile extended attribute used by the pNFS MDS server in various ways. Its main use is to set a DS's IP address to 0.0.0.0 when that DS has failed, so that it will not be used for the file when brought back online after being repaired. Added: head/usr.sbin/pnfsdsfile/ head/usr.sbin/pnfsdsfile/Makefile (contents, props changed) head/usr.sbin/pnfsdsfile/pnfsdsfile.8 (contents, props changed) head/usr.sbin/pnfsdsfile/pnfsdsfile.c (contents, props changed) Modified: head/usr.sbin/Makefile Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Fri Jun 15 19:19:36 2018 (r335233) +++ head/usr.sbin/Makefile Fri Jun 15 19:35:08 2018 (r335234) @@ -59,6 +59,7 @@ SUBDIR= adduser \ nologin \ pciconf \ periodic \ + pnfsdsfile \ pnfsdskill \ powerd \ prometheus_sysctl_exporter \ Added: head/usr.sbin/pnfsdsfile/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pnfsdsfile/Makefile Fri Jun 15 19:35:08 2018 (r335234) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +PROG= pnfsdsfile +MAN= pnfsdsfile.8 + +.include Added: head/usr.sbin/pnfsdsfile/pnfsdsfile.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pnfsdsfile/pnfsdsfile.8 Fri Jun 15 19:35:08 2018 (r335234) @@ -0,0 +1,133 @@ +.\" Copyright (c) 2017 Rick Macklem +.\" +.\" 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 March 11, 2018 +.Dt PNFSDSFILE 8 +.Os +.Sh NAME +.Nm pnfsdsfile +.Nd display +a pNFS data storage file's location(s) and/or modify the +.Dq pnfsd.dsfile +extended attribute for them +.Sh SYNOPSIS +.Nm +.Op Fl qz +.Op Fl s Ar dshostname +.Op Fl c Ar old-dshostname,new-dshostname +.Op Fl r Ar dshostname +.Ar mdsfile +.Sh DESCRIPTION +The +.Nm +command displays the data storage file's location(s) for a pNFS service and/or +modifies the +.Dq pnfsd.dsfile +extended attribute on the +.Ar mdsfile . +A pNFS service maintains a data storage file for each regular file on +the MetaData Server (MDS) on one or more of the Data Servers (DS). +If mirroring is enabled, the data storage file will be on more that one of the DSs. +Unless command options are specified, this command displays the location(s) +of the data storage file for the MDS file +.Ar mdsfile . +It must be used on the MDS and the +.Ar mdsfile +must be a file on the exported local file system and not an NFSv4.1 mount. +This information is stored in the +.Dq pnfsd.dsfile +extended attribute for this +.Ar mdsfile . +The command line options allow the information in the +.Dq pnfsd.dsfile +extended attribute to be changed. +.Pp +The following options are available: +.Bl -tag -width Ds +.It Fl q +This option suppresses printing of the DS file's location(s). +.It Fl z +This option specifies that the file handle field of the pnfsd.dsfile +extended attribute is to filled with all zero bits. +This forces the pNFS MDS to do a Lookup RPC against the DS to acquire the file +handle to update it. +Normally this will only be necessary after the DS file has been recovered +from a backup, causing the file handle to change. +.It Fl s Ar dshostname +This option can be used with +.Fl z +so that the zeroing out of the file handle is only done if the DS server +is the one specified by this option. +.It Fl c Ar old-dshostname,new-dshostname +This option allows a sysadmin to replace the host IP# for the DS in the +pnfsd.dsfile extended attribute. +The old-hostname must resolve to the IP# already in the pnfsd.dsfile extended +attribute or the replacement will not be done. +If the old-dshostname matches, then the IP# is replaced by the first AF_INET +or AF_INET6 address that +.Xr getaddrinfo 3 +returns for the new-dshostname. +Changing a DS server's host IP# should be avoided, but this option will +allow it to be changed, if the change is unavoidable. +.It Fl r Ar dshostname +This option sets the IP address of the extended attribute entry for the +.Ar dshostname +to 0.0.0.0 so that it will no longer be used. +.Pp +This is meant to be used when mirroring is enabled and the +.Ar dshostname +DS is disabled, so that it can be re-enabled once it is repaired. +This needs to be done for all files in the exported MDS tree where +the data may not be up-to-date on the repaired DS when it is re-enabled. +After being re-enabled, the command +.Xr pnfsdscopymr 1 +with the +.Dq -r +option +will be used to copy the the file's data to this repaired DS and then update the +extended attribute to use it. +.Pp +A typical use of this will be within a +.Xr find 1 +for all regular files in the MDS's exported tree. +.sp +For example, if the disabled DS is nfsv4-data3: +.br +# cd +.br +# find . -type f -exec pnfsdsfile -q -r nfsv4-data3 {} \\; +.El +.Sh SEE ALSO +.Xr find 1 , +.Xr getaddrinfo 3 , +.Xr nfsv4 4 , +.Xr pnfs 4 , +.Xr nfsd 8 , +.Xr pnfsdscopymr 8 , +.Xr pnfsdskill 8 +.Sh HISTORY +The +.Nm +command appeared in FreeBSD12. Added: head/usr.sbin/pnfsdsfile/pnfsdsfile.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pnfsdsfile/pnfsdsfile.c Fri Jun 15 19:35:08 2018 (r335234) @@ -0,0 +1,330 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2017 Rick Macklem + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static void usage(void); + +static struct option longopts[] = { + { "changeds", required_argument, NULL, 'c' }, + { "quiet", no_argument, NULL, 'q' }, + { "zerods", required_argument, NULL, 'r' }, + { "ds", required_argument, NULL, 's' }, + { "zerofh", no_argument, NULL, 'z' }, + { NULL, 0, NULL, 0 } +}; + +/* + * This program displays the location information of a data storage file + * for a given file on a MetaData Server (MDS) in a pNFS service. This program + * must be run on the MDS and the file argument must be a file in a local + * file system that has been exported for the pNFS service. + */ +int +main(int argc, char *argv[]) +{ + struct addrinfo *res, *ad, *newres; + struct sockaddr_in *sin, adsin; + struct sockaddr_in6 *sin6, adsin6; + char hostn[2 * NI_MAXHOST + 2], *cp; + struct pnfsdsfile dsfile[NFSDEV_MAXMIRRORS]; + int ch, dosetxattr, i, mirrorcnt, quiet, zerods, zerofh; + in_port_t tport; + ssize_t xattrsize, xattrsize2; + + zerods = 0; + zerofh = 0; + quiet = 0; + dosetxattr = 0; + res = NULL; + newres = NULL; + cp = NULL; + while ((ch = getopt_long(argc, argv, "c:qr:s:z", longopts, NULL)) != -1) + { + switch (ch) { + case 'c': + /* Replace the first DS server with the second one. */ + if (zerofh != 0 || zerods != 0) + errx(1, "-c, -r and -z are mutually " + "exclusive"); + if (res != NULL) + errx(1, "-c and -s are mutually exclusive"); + strlcpy(hostn, optarg, 2 * NI_MAXHOST + 2); + cp = strchr(hostn, ','); + if (cp == NULL) + errx(1, "Bad -c argument %s", hostn); + *cp = '\0'; + if (getaddrinfo(hostn, NULL, NULL, &res) != 0) + errx(1, "Can't get IP# for %s", hostn); + *cp++ = ','; + if (getaddrinfo(cp, NULL, NULL, &newres) != 0) + errx(1, "Can't get IP# for %s", cp); + break; + case 'q': + quiet = 1; + break; + case 'r': + /* Reset the DS server in a mirror with 0.0.0.0. */ + if (zerofh != 0 || res != NULL || newres != NULL) + errx(1, "-r and -s, -z or -c are mutually " + "exclusive"); + zerods = 1; + /* Translate the server name to an IP address. */ + if (getaddrinfo(optarg, NULL, NULL, &res) != 0) + errx(1, "Can't get IP# for %s", optarg); + break; + case 's': + if (res != NULL) + errx(1, "-s, -c and -r are mutually " + "exclusive"); + /* Translate the server name to an IP address. */ + if (getaddrinfo(optarg, NULL, NULL, &res) != 0) + errx(1, "Can't get IP# for %s", optarg); + break; + case 'z': + if (newres != NULL || zerods != 0) + errx(1, "-c, -r and -z are mutually " + "exclusive"); + zerofh = 1; + break; + default: + usage(); + } + } + argc -= optind; + if (argc != 1) + usage(); + argv += optind; + + /* + * The host address and directory where the data storage file is + * located is in the extended attribute "pnfsd.dsfile". + */ + xattrsize = extattr_get_file(*argv, EXTATTR_NAMESPACE_SYSTEM, + "pnfsd.dsfile", dsfile, sizeof(dsfile)); + mirrorcnt = xattrsize / sizeof(struct pnfsdsfile); + xattrsize2 = mirrorcnt * sizeof(struct pnfsdsfile); + if (mirrorcnt < 1 || xattrsize != xattrsize2) + err(1, "Can't get extattr pnfsd.dsfile for %s", *argv); + + if (quiet == 0) + printf("%s:\t", *argv); + for (i = 0; i < mirrorcnt; i++) { + if (i > 0 && quiet == 0) + printf("\t"); + /* Do the zerofh option. You must be root. */ + if (zerofh != 0) { + if (geteuid() != 0) + errx(1, "Must be root/su to zerofh"); + + /* + * Do it for the server specified by -s/--ds or all + * servers, if -s/--ds was not specified. + */ + sin = &dsfile[i].dsf_sin; + sin6 = &dsfile[i].dsf_sin6; + ad = res; + while (ad != NULL) { + if (ad->ai_addr->sa_family == AF_INET && + sin->sin_family == AF_INET && + ad->ai_addrlen >= sizeof(adsin)) { + memcpy(&adsin, ad->ai_addr, + sizeof(adsin)); + if (sin->sin_addr.s_addr == + adsin.sin_addr.s_addr) + break; + } + if (ad->ai_addr->sa_family == AF_INET6 && + sin6->sin6_family == AF_INET6 && + ad->ai_addrlen >= sizeof(adsin6)) { + memcpy(&adsin6, ad->ai_addr, + sizeof(adsin6)); + if (IN6_ARE_ADDR_EQUAL(&sin6->sin6_addr, + &adsin6.sin6_addr)) + break; + } + ad = ad->ai_next; + } + if (res == NULL || ad != NULL) { + memset(&dsfile[i].dsf_fh, 0, sizeof(fhandle_t)); + dosetxattr = 1; + } + } + + /* Do the zerods option. You must be root. */ + if (zerods != 0 && mirrorcnt > 1) { + if (geteuid() != 0) + errx(1, "Must be root/su to zerods"); + + /* + * Do it for the server specified. + */ + sin = &dsfile[i].dsf_sin; + sin6 = &dsfile[i].dsf_sin6; + ad = res; + while (ad != NULL) { + if (ad->ai_addr->sa_family == AF_INET && + sin->sin_family == AF_INET && + ad->ai_addrlen >= sizeof(adsin)) { + memcpy(&adsin, ad->ai_addr, + sizeof(adsin)); + if (sin->sin_addr.s_addr == + adsin.sin_addr.s_addr) + break; + } + if (ad->ai_addr->sa_family == AF_INET6 && + sin6->sin6_family == AF_INET6 && + ad->ai_addrlen >= sizeof(adsin6)) { + memcpy(&adsin6, ad->ai_addr, + sizeof(adsin6)); + if (IN6_ARE_ADDR_EQUAL(&sin6->sin6_addr, + &adsin6.sin6_addr)) + break; + } + ad = ad->ai_next; + } + if (ad != NULL) { + sin->sin_family = AF_INET; + sin->sin_len = sizeof(*sin); + sin->sin_port = 0; + sin->sin_addr.s_addr = 0; + dosetxattr = 1; + } + } + + /* Do the -c option to replace the DS host address. */ + if (newres != NULL) { + if (geteuid() != 0) + errx(1, "Must be root/su to replace the host" + " addr"); + + /* + * Check that the old host address matches. + */ + sin = &dsfile[i].dsf_sin; + sin6 = &dsfile[i].dsf_sin6; + ad = res; + while (ad != NULL) { + if (ad->ai_addr->sa_family == AF_INET && + sin->sin_family == AF_INET && + ad->ai_addrlen >= sizeof(adsin)) { + memcpy(&adsin, ad->ai_addr, + sizeof(adsin)); + if (sin->sin_addr.s_addr == + adsin.sin_addr.s_addr) + break; + } + if (ad->ai_addr->sa_family == AF_INET6 && + sin6->sin6_family == AF_INET6 && + ad->ai_addrlen >= sizeof(adsin6)) { + memcpy(&adsin6, ad->ai_addr, + sizeof(adsin6)); + if (IN6_ARE_ADDR_EQUAL(&sin6->sin6_addr, + &adsin6.sin6_addr)) + break; + } + ad = ad->ai_next; + } + if (ad != NULL) { + if (sin->sin_family == AF_INET) + tport = sin->sin_port; + else + tport = sin6->sin6_port; + /* + * We have a match, so replace it with the first + * AF_INET or AF_INET6 address in the newres + * list. + */ + while (newres->ai_addr->sa_family != AF_INET && + newres->ai_addr->sa_family != AF_INET6) { + newres = newres->ai_next; + if (newres == NULL) + errx(1, "Hostname %s has no" + " IP#", cp); + } + if (newres->ai_addr->sa_family == AF_INET) { + memcpy(sin, newres->ai_addr, + sizeof(*sin)); + sin->sin_port = tport; + } else if (newres->ai_addr->sa_family == + AF_INET6) { + memcpy(sin6, newres->ai_addr, + sizeof(*sin6)); + sin6->sin6_port = tport; + } + dosetxattr = 1; + } + } + + if (quiet == 0) { + /* Translate the IP address to a hostname. */ + if (getnameinfo((struct sockaddr *)&dsfile[i].dsf_sin, + dsfile[i].dsf_sin.sin_len, hostn, sizeof(hostn), + NULL, 0, 0) < 0) + err(1, "Can't get hostname"); + printf("%s\tds%d/%s", hostn, dsfile[i].dsf_dir, + dsfile[i].dsf_filename); + } + } + if (quiet == 0) + printf("\n"); + if (dosetxattr != 0 && extattr_set_file(*argv, EXTATTR_NAMESPACE_SYSTEM, + "pnfsd.dsfile", dsfile, xattrsize) != xattrsize) + err(1, "Can't set pnfsd.dsfile"); +} + +static void +usage(void) +{ + + fprintf(stderr, "pnfsdsfile [-q/--quiet] [-z/--zerofh] " + "[-c/--changeds ] " + "[-r/--zerods ] " + "[-s/--ds ] " + "\n"); + exit(1); +} + From owner-svn-src-head@freebsd.org Fri Jun 15 19:42:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E26F1019DEC; Fri, 15 Jun 2018 19:42:53 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D61D5804D9; Fri, 15 Jun 2018 19:42:52 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B3BB01BEEC; Fri, 15 Jun 2018 19:42:52 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FJgqlY016784; Fri, 15 Jun 2018 19:42:52 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FJgqOw016783; Fri, 15 Jun 2018 19:42:52 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806151942.w5FJgqOw016783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 15 Jun 2018 19:42:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335235 - head/sys/arm64/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/arm64/linux X-SVN-Commit-Revision: 335235 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 19:42:53 -0000 Author: emaste Date: Fri Jun 15 19:42:52 2018 New Revision: 335235 URL: https://svnweb.freebsd.org/changeset/base/335235 Log: arm64 linuxulator: add linux_dummy.c based on amd64 A later change should deduplicate the multiple copies of this file. Sponsored by: Turing Robotic Industries Added: head/sys/arm64/linux/linux_dummy.c - copied, changed from r335234, head/sys/amd64/linux/linux_dummy.c Copied and modified: head/sys/arm64/linux/linux_dummy.c (from r335234, head/sys/amd64/linux/linux_dummy.c) ============================================================================== --- head/sys/amd64/linux/linux_dummy.c Fri Jun 15 19:35:08 2018 (r335234, copy source) +++ head/sys/arm64/linux/linux_dummy.c Fri Jun 15 19:42:52 2018 (r335235) @@ -29,17 +29,22 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_compat.h" + #include #include #include #include #include -#include -#include +#include +#include #include #include +// LINUXTODO: deduplicate arm64 dummy against other archs? +// LINUXTODO: review/update/add unimplemented syscalls + /* DTrace init */ LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); @@ -63,14 +68,12 @@ DUMMY(sendfile); DUMMY(syslog); DUMMY(setfsuid); DUMMY(setfsgid); -DUMMY(sysfs); DUMMY(vhangup); DUMMY(pivot_root); DUMMY(adjtimex); DUMMY(swapoff); DUMMY(init_module); DUMMY(delete_module); -DUMMY(quotactl); DUMMY(lookup_dcookie); DUMMY(remap_file_pages); DUMMY(semtimedop); @@ -91,7 +94,6 @@ DUMMY(keyctl); /* Linux 2.6.13: */ DUMMY(ioprio_set); DUMMY(ioprio_get); -DUMMY(inotify_init); DUMMY(inotify_add_watch); DUMMY(inotify_rm_watch); /* Linux 2.6.16: */ @@ -104,8 +106,6 @@ DUMMY(sync_file_range); DUMMY(vmsplice); /* Linux 2.6.18: */ DUMMY(move_pages); -/* Linux 2.6.22: */ -DUMMY(signalfd); /* Linux 2.6.27: */ DUMMY(signalfd4); DUMMY(inotify_init1); @@ -135,7 +135,6 @@ DUMMY(renameat2); /* Linux 3.15: */ DUMMY(seccomp); DUMMY(memfd_create); -DUMMY(kexec_file_load); /* Linux 3.18: */ DUMMY(bpf); /* Linux 3.19: */ From owner-svn-src-head@freebsd.org Fri Jun 15 19:45:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3B371019ECA; Fri, 15 Jun 2018 19:45:16 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7866780673; Fri, 15 Jun 2018 19:45:16 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 59B5A1BEEF; Fri, 15 Jun 2018 19:45:16 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FJjG0n016952; Fri, 15 Jun 2018 19:45:16 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FJjFom016946; Fri, 15 Jun 2018 19:45:15 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201806151945.w5FJjFom016946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 15 Jun 2018 19:45:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335236 - in head/usr.sbin: . pnfsdscopymr X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in head/usr.sbin: . pnfsdscopymr X-SVN-Commit-Revision: 335236 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 19:45:17 -0000 Author: rmacklem Date: Fri Jun 15 19:45:15 2018 New Revision: 335236 URL: https://svnweb.freebsd.org/changeset/base/335236 Log: Add a command that copies or migrates a data file from one DS to another. This command can be used by a sysadmin to either copy or migrate a data file on one DS to another DS. Its main use is to recover data files onto a mirrored DS after the DS has been repaired and brought back online. Added: head/usr.sbin/pnfsdscopymr/ head/usr.sbin/pnfsdscopymr/Makefile (contents, props changed) head/usr.sbin/pnfsdscopymr/pnfsdscopymr.8 (contents, props changed) head/usr.sbin/pnfsdscopymr/pnfsdscopymr.c (contents, props changed) Modified: head/usr.sbin/Makefile Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Fri Jun 15 19:42:52 2018 (r335235) +++ head/usr.sbin/Makefile Fri Jun 15 19:45:15 2018 (r335236) @@ -59,6 +59,7 @@ SUBDIR= adduser \ nologin \ pciconf \ periodic \ + pnfsdscopymr \ pnfsdsfile \ pnfsdskill \ powerd \ Added: head/usr.sbin/pnfsdscopymr/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pnfsdscopymr/Makefile Fri Jun 15 19:45:15 2018 (r335236) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +PROG= pnfsdscopymr +MAN= pnfsdscopymr.8 + +.include Added: head/usr.sbin/pnfsdscopymr/pnfsdscopymr.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pnfsdscopymr/pnfsdscopymr.8 Fri Jun 15 19:45:15 2018 (r335236) @@ -0,0 +1,99 @@ +.\" Copyright (c) 2018 Rick Macklem +.\" +.\" 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 2, 2018 +.Dt PNFSDSCOPYMR 8 +.Os +.Sh NAME +.Nm pnfsdscopymr +.Nd +copy or move a data storage file for a MDS file to a different DS +.Sh SYNOPSIS +.Nm +.Op Fl r Ar mounted-on-DS-dir +.Op Fl m Ar source-mounted-on-DS-dir destination-mounted-on-DS-dir +.Ar mdsfile +.Sh DESCRIPTION +The +.Nm +command copies a data storage file for an MDS file from one DS to another DS. +It is normally used to recover data files onto a repaired DS, but can also +be used to manually migrate a data storage file from one DS to a different one. +By default, the command will copy the data storage file for +.Dq mdsfile +to one of the other DSs to create a mirror of it. +This might be done if the file was created before mirroring was enabled on +the pNFS service and now needs to be mirrored. +.Pp +The following options are available: +.Bl -tag -width Ds +.It Fl r Ar mounted-on-DS-dir +This option indicates that the data storage file should be created on the DS +that is mounted on the directory +.Dq mounted-on-DS-dir . +It will only do the copy if there is an entry in the pnfsd.dsfile extended +attribute that has an IP address of 0.0.0.0. +See +.Xr pnfsdsfile 1 +for how to do this. +This is normally done for all regular files via +.Xr find 1 +in order to recover the data +storage files onto a repaired DS. +.It Fl m Ar source-mounted-on-DS-dir destination-mounted-on-DS-dir +This option indicates that the data storage file is to be migrated from +the source DS mounted on the diectory +.Dq source-mounted-on-DS-dir +to the DS mounted on the directory +.Dq destination-mounted-on-DS-dir . +In this case, the data storage file will be removed from the source DS +when the copy is completed. +.El +If the copy/migration is already done, the command will simply exit(0), +so that it can safely be used on all regular files in the exported directory +tree on the MDS. +.Pp +This command must be run on the MDS and a typical usage would be as an +argument for +.Xr find 1 +for all regular files. +.sp +For example, if the repaired DS is mounted on /data3 and files previously +stored on the repaired DS have had the DS's IP address set to 0.0.0.0: +.br +# cd +.br +# find . -type f -exec pnfsdscopymr -r /data3 {} \\; +.Sh SEE ALSO +.Xr find 1 , +.Xr nfsv4 4 , +.Xr pnfs 4 , +.Xr nfsd 8 , +.Xr pnfsdsfile 8 , +.Xr pnfsdskill 8 +.Sh HISTORY +The +.Nm +command appeared in FreeBSD12. Added: head/usr.sbin/pnfsdscopymr/pnfsdscopymr.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pnfsdscopymr/pnfsdscopymr.c Fri Jun 15 19:45:15 2018 (r335236) @@ -0,0 +1,311 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2017 Rick Macklem + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +static void usage(void); + +static struct option longopts[] = { + { "migrate", required_argument, NULL, 'm' }, + { "mirror", required_argument, NULL, 'r' }, + { NULL, 0, NULL, 0 } +}; + +/* + * This program creates a copy of the file's (first argument) data on the + * new/recovering DS mirror. If the file is already on the new/recovering + * DS, it will simply exit(0). + */ +int +main(int argc, char *argv[]) +{ + struct nfsd_pnfsd_args pnfsdarg; + struct pnfsdsfile dsfile[NFSDEV_MAXMIRRORS]; + struct stat sb; + struct statfs sf; + struct addrinfo hints, *res, *nres; + struct sockaddr_in sin; + struct sockaddr_in6 sin6; + ssize_t xattrsize, xattrsize2; + size_t mirlen; + int ch, fnd, fndzero, i, migrateit, mirrorcnt, mirrorit, ret; + int mirrorlevel; + char host[MNAMELEN + NI_MAXHOST + 2], *cp; + + if (geteuid() != 0) + errx(1, "Must be run as root/su"); + + mirrorit = migrateit = 0; + pnfsdarg.dspath = pnfsdarg.curdspath = NULL; + while ((ch = getopt_long(argc, argv, "m:r:", longopts, NULL)) != -1) { + switch (ch) { + case 'm': + /* Migrate the file from the second DS to the first. */ + if (mirrorit != 0) + errx(1, "-r and -m are mutually exclusive"); + migrateit = 1; + pnfsdarg.curdspath = optarg; + break; + case 'r': + /* Mirror the file on the specified DS. */ + if (migrateit != 0) + errx(1, "-r and -m are mutually exclusive"); + mirrorit = 1; + pnfsdarg.dspath = optarg; + break; + default: + usage(); + } + } + argc -= optind; + argv += optind; + if (migrateit != 0) { + if (argc != 2) + usage(); + pnfsdarg.dspath = *argv++; + } else if (argc != 1) + usage(); + + /* Get the pNFS service's mirror level. */ + mirlen = sizeof(mirrorlevel); + ret = sysctlbyname("vfs.nfs.pnfsmirror", &mirrorlevel, &mirlen, + NULL, 0); + if (ret < 0) + errx(1, "Can't get vfs.nfs.pnfsmirror"); + + if (pnfsdarg.dspath != NULL && pnfsdarg.curdspath != NULL && + strcmp(pnfsdarg.dspath, pnfsdarg.curdspath) == 0) + errx(1, "Can't migrate to same server"); + + /* + * The host address and directory where the data storage file is + * located is in the extended attribute "pnfsd.dsfile". + */ + xattrsize = extattr_get_file(*argv, EXTATTR_NAMESPACE_SYSTEM, + "pnfsd.dsfile", dsfile, sizeof(dsfile)); + mirrorcnt = xattrsize / sizeof(struct pnfsdsfile); + xattrsize2 = mirrorcnt * sizeof(struct pnfsdsfile); + if (mirrorcnt < 1 || xattrsize != xattrsize2) + errx(1, "Can't get extattr pnfsd.dsfile for %s", *argv); + + /* See if there is a 0.0.0.0 entry. */ + fndzero = 0; + for (i = 0; i < mirrorcnt; i++) { + if (dsfile[i].dsf_sin.sin_family == AF_INET && + dsfile[i].dsf_sin.sin_addr.s_addr == 0) + fndzero = 1; + } + + /* If already mirrored for default case, just exit(0); */ + if (mirrorit == 0 && migrateit == 0 && (mirrorlevel < 2 || + (fndzero == 0 && mirrorcnt >= mirrorlevel) || + (fndzero != 0 && mirrorcnt > mirrorlevel))) + exit(0); + + /* For the "-r" case, there must be a 0.0.0.0 entry. */ + if (mirrorit != 0 && (fndzero == 0 || mirrorlevel < 2 || + mirrorcnt < 2 || mirrorcnt > mirrorlevel)) + exit(0); + + /* For pnfsdarg.dspath set, if it is already in list, just exit(0); */ + if (pnfsdarg.dspath != NULL) { + /* Check the dspath to see that it's an NFS mount. */ + if (stat(pnfsdarg.dspath, &sb) < 0) + errx(1, "Can't stat %s", pnfsdarg.dspath); + if (!S_ISDIR(sb.st_mode)) + errx(1, "%s is not a directory", pnfsdarg.dspath); + if (statfs(pnfsdarg.dspath, &sf) < 0) + errx(1, "Can't fsstat %s", pnfsdarg.dspath); + if (strcmp(sf.f_fstypename, "nfs") != 0) + errx(1, "%s is not an NFS mount", pnfsdarg.dspath); + if (strcmp(sf.f_mntonname, pnfsdarg.dspath) != 0) + errx(1, "%s is not the mounted-on dir for the new DS", + pnfsdarg.dspath); + + /* + * Check the IP address of the NFS server against the entrie(s) + * in the extended attribute. + */ + strlcpy(host, sf.f_mntfromname, sizeof(host)); + cp = strchr(host, ':'); + if (cp == NULL) + errx(1, "No : in mount %s", host); + *cp = '\0'; + memset(&hints, 0, sizeof(hints)); + hints.ai_family = PF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + if (getaddrinfo(host, NULL, &hints, &res) != 0) + errx(1, "Can't get address for %s", host); + for (i = 0; i < mirrorcnt; i++) { + nres = res; + while (nres != NULL) { + if (dsfile[i].dsf_sin.sin_family == + nres->ai_family) { + /* + * If there is already an entry for this + * DS, just exit(0), since copying isn't + * required. + */ + if (nres->ai_family == AF_INET && + nres->ai_addrlen >= sizeof(sin)) { + memcpy(&sin, nres->ai_addr, + sizeof(sin)); + if (sin.sin_addr.s_addr == + dsfile[i].dsf_sin.sin_addr.s_addr) + exit(0); + } else if (nres->ai_family == + AF_INET6 && nres->ai_addrlen >= + sizeof(sin6)) { + memcpy(&sin6, nres->ai_addr, + sizeof(sin6)); + if (IN6_ARE_ADDR_EQUAL(&sin6.sin6_addr, + &dsfile[i].dsf_sin6.sin6_addr)) + exit(0); + } + } + nres = nres->ai_next; + } + } + freeaddrinfo(res); + } + + /* For "-m", the pnfsdarg.curdspath must be in the list. */ + if (pnfsdarg.curdspath != NULL) { + /* Check pnfsdarg.curdspath to see that it's an NFS mount. */ + if (stat(pnfsdarg.curdspath, &sb) < 0) + errx(1, "Can't stat %s", pnfsdarg.curdspath); + if (!S_ISDIR(sb.st_mode)) + errx(1, "%s is not a directory", pnfsdarg.curdspath); + if (statfs(pnfsdarg.curdspath, &sf) < 0) + errx(1, "Can't fsstat %s", pnfsdarg.curdspath); + if (strcmp(sf.f_fstypename, "nfs") != 0) + errx(1, "%s is not an NFS mount", pnfsdarg.curdspath); + if (strcmp(sf.f_mntonname, pnfsdarg.curdspath) != 0) + errx(1, "%s is not the mounted-on dir of the cur DS", + pnfsdarg.curdspath); + + /* + * Check the IP address of the NFS server against the entrie(s) + * in the extended attribute. + */ + strlcpy(host, sf.f_mntfromname, sizeof(host)); + cp = strchr(host, ':'); + if (cp == NULL) + errx(1, "No : in mount %s", host); + *cp = '\0'; + memset(&hints, 0, sizeof(hints)); + hints.ai_family = PF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + if (getaddrinfo(host, NULL, &hints, &res) != 0) + errx(1, "Can't get address for %s", host); + fnd = 0; + for (i = 0; i < mirrorcnt && fnd == 0; i++) { + nres = res; + while (nres != NULL) { + if (dsfile[i].dsf_sin.sin_family == + nres->ai_family) { + /* + * Note if the entry is found. + */ + if (nres->ai_family == AF_INET && + nres->ai_addrlen >= sizeof(sin)) { + memcpy(&sin, nres->ai_addr, + sizeof(sin)); + if (sin.sin_addr.s_addr == + dsfile[i].dsf_sin.sin_addr.s_addr) { + fnd = 1; + break; + } + } else if (nres->ai_family == + AF_INET6 && nres->ai_addrlen >= + sizeof(sin6)) { + memcpy(&sin6, nres->ai_addr, + sizeof(sin6)); + if (IN6_ARE_ADDR_EQUAL(&sin6.sin6_addr, + &dsfile[i].dsf_sin6.sin6_addr)) { + fnd = 1; + break; + } + } + } + nres = nres->ai_next; + } + } + freeaddrinfo(res); + /* + * If not found just exit(0), since it is not on the + * source DS. + */ + if (fnd == 0) + exit(0); + } + + /* Do the copy via the nfssvc() syscall. */ + pnfsdarg.op = PNFSDOP_COPYMR; + pnfsdarg.mdspath = *argv; + ret = nfssvc(NFSSVC_PNFSDS, &pnfsdarg); + if (ret < 0 && errno != EEXIST) + err(1, "Copymr failed args %s, %s", argv[1], argv[2]); + exit(0); +} + +static void +usage(void) +{ + + fprintf(stderr, "pnfsdscopymr [-r recovered-DS-mounted-on-path] " + "[-m soure-DS-mounted-on-path destination-DS-mounted-on-path] " + "mds-filename"); + exit(1); +} + From owner-svn-src-head@freebsd.org Fri Jun 15 20:57:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A7B0101BE88; Fri, 15 Jun 2018 20:57:03 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 10ABE82B04; Fri, 15 Jun 2018 20:57:03 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E1E9A1CA68; Fri, 15 Jun 2018 20:57:02 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FKv2sV052674; Fri, 15 Jun 2018 20:57:02 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FKv21W052673; Fri, 15 Jun 2018 20:57:02 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201806152057.w5FKv21W052673@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 15 Jun 2018 20:57:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335237 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 335237 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 20:57:03 -0000 Author: cem Date: Fri Jun 15 20:57:02 2018 New Revision: 335237 URL: https://svnweb.freebsd.org/changeset/base/335237 Log: Bump __FreeBSD_version after r335227 The kerneldumpheader ABI is used by at least the netdumpd port. Bump __FreeBSD_version to reflect the change. Reported by: markj Sponsored by: Dell EMC Isilon Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri Jun 15 19:45:15 2018 (r335236) +++ head/sys/sys/param.h Fri Jun 15 20:57:02 2018 (r335237) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200068 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200069 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Fri Jun 15 21:02:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD053101C4C5; Fri, 15 Jun 2018 21:02:34 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 614B1830DD; Fri, 15 Jun 2018 21:02:34 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 427C71CC09; Fri, 15 Jun 2018 21:02:34 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FL2YOg057521; Fri, 15 Jun 2018 21:02:34 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FL2Y4L057520; Fri, 15 Jun 2018 21:02:34 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201806152102.w5FL2Y4L057520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 15 Jun 2018 21:02:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335238 - head/usr.sbin/pnfsdskill X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/pnfsdskill X-SVN-Commit-Revision: 335238 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 21:02:34 -0000 Author: rmacklem Date: Fri Jun 15 21:02:33 2018 New Revision: 335238 URL: https://svnweb.freebsd.org/changeset/base/335238 Log: Use the .Fx macro in the man page. Reported by: bjk Modified: head/usr.sbin/pnfsdskill/pnfsdskill.8 Modified: head/usr.sbin/pnfsdskill/pnfsdskill.8 ============================================================================== --- head/usr.sbin/pnfsdskill/pnfsdskill.8 Fri Jun 15 20:57:02 2018 (r335237) +++ head/usr.sbin/pnfsdskill/pnfsdskill.8 Fri Jun 15 21:02:33 2018 (r335238) @@ -61,4 +61,5 @@ operational DSs is at least as many as the level of mi .Sh HISTORY The .Nm -command appeared in FreeBSD12. +command first appeared in +.Fx 12.0 . From owner-svn-src-head@freebsd.org Fri Jun 15 21:04:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90582101C7F1; Fri, 15 Jun 2018 21:04:29 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E53C83278; Fri, 15 Jun 2018 21:04:29 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1BB781CC0D; Fri, 15 Jun 2018 21:04:29 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FL4SLl057645; Fri, 15 Jun 2018 21:04:28 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FL4SaB057644; Fri, 15 Jun 2018 21:04:28 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201806152104.w5FL4SaB057644@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 15 Jun 2018 21:04:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335239 - head/usr.sbin/pnfsdsfile X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/pnfsdsfile X-SVN-Commit-Revision: 335239 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 21:04:29 -0000 Author: rmacklem Date: Fri Jun 15 21:04:28 2018 New Revision: 335239 URL: https://svnweb.freebsd.org/changeset/base/335239 Log: Use the .Fx macro in the man page. Reported by: bjk Modified: head/usr.sbin/pnfsdsfile/pnfsdsfile.8 Modified: head/usr.sbin/pnfsdsfile/pnfsdsfile.8 ============================================================================== --- head/usr.sbin/pnfsdsfile/pnfsdsfile.8 Fri Jun 15 21:02:33 2018 (r335238) +++ head/usr.sbin/pnfsdsfile/pnfsdsfile.8 Fri Jun 15 21:04:28 2018 (r335239) @@ -130,4 +130,5 @@ For example, if the disabled DS is nfsv4-data3: .Sh HISTORY The .Nm -command appeared in FreeBSD12. +command first appeared in +.Fx 12.0 . From owner-svn-src-head@freebsd.org Fri Jun 15 21:07:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4870A101C9BD; Fri, 15 Jun 2018 21:07:15 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F2C5E8355D; Fri, 15 Jun 2018 21:07:14 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D40441CC1B; Fri, 15 Jun 2018 21:07:14 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FL7E8n057952; Fri, 15 Jun 2018 21:07:14 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FL7EDV057951; Fri, 15 Jun 2018 21:07:14 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201806152107.w5FL7EDV057951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 15 Jun 2018 21:07:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335240 - head/usr.sbin/pnfsdscopymr X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/pnfsdscopymr X-SVN-Commit-Revision: 335240 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 21:07:15 -0000 Author: rmacklem Date: Fri Jun 15 21:07:14 2018 New Revision: 335240 URL: https://svnweb.freebsd.org/changeset/base/335240 Log: Use the .Fx macro in the man page. Reported by: bjk Modified: head/usr.sbin/pnfsdscopymr/pnfsdscopymr.8 Modified: head/usr.sbin/pnfsdscopymr/pnfsdscopymr.8 ============================================================================== --- head/usr.sbin/pnfsdscopymr/pnfsdscopymr.8 Fri Jun 15 21:04:28 2018 (r335239) +++ head/usr.sbin/pnfsdscopymr/pnfsdscopymr.8 Fri Jun 15 21:07:14 2018 (r335240) @@ -96,4 +96,5 @@ stored on the repaired DS have had the DS's IP address .Sh HISTORY The .Nm -command appeared in FreeBSD12. +command first appeared in +.Fx 12.0 . From owner-svn-src-head@freebsd.org Fri Jun 15 21:20:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C87AD101D069; Fri, 15 Jun 2018 21:20:42 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f181.google.com (mail-io0-f181.google.com [209.85.223.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 69E7B840A3; Fri, 15 Jun 2018 21:20:42 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f181.google.com with SMTP id d185-v6so11946496ioe.0; Fri, 15 Jun 2018 14:20:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=EY9hwJplPCSOiAXV/cOVQzii5fI3hNKGAZ9T5eWhjv0=; b=bnQomT/oR9LBF9d4+aU4E7zZ8bbD7G7RXMOR4CPnJ/aE9w5MGZ2JR3d/1hhEpmAWVB CoRjDsKdZ22rMzQipYjx8+TLUCwDFUsFT2ho8VUeib71B52z7i8UELfaCxsK8LXiCoa1 aBV/bFURKaiP7LwFfQ13CV6AVotuSttv+K7YC11Y3RQAZ25hFjXvdQbd/hYqsCgVIP6u RlgdGMihkyYy0eZs+nH6TP5NqlI8K70MKbRmuF+B0zLqj/hW8GkghTZbVe+v4POCVir0 u4noeFGQooKY2KbpDFRd0iUqtyQVx9RUtUITNhHYkVaoClWZyKKB05RyV4aOZ743JguV ZbxA== X-Gm-Message-State: APt69E2q7swOi6UKAxt6vL8mPkNbvzAOFK2vmiHXlYRJPBmukJAyPm61 hajMXkRINj92hT326pf9WEEFVF3H X-Google-Smtp-Source: ADUXVKL4nG2JNvmn/s1IwpScrHj5i1DQprwhqJSr4Jc171bgP6KdBkKeH4NMtml4fcMwjxlj9o2Yyg== X-Received: by 2002:a6b:2550:: with SMTP id l77-v6mr2774918iol.47.1529097276043; Fri, 15 Jun 2018 14:14:36 -0700 (PDT) Received: from mail-it0-f46.google.com (mail-it0-f46.google.com. [209.85.214.46]) by smtp.gmail.com with ESMTPSA id m13-v6sm3411491iob.86.2018.06.15.14.14.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Jun 2018 14:14:35 -0700 (PDT) Received: by mail-it0-f46.google.com with SMTP id v83-v6so4600084itc.3; Fri, 15 Jun 2018 14:14:35 -0700 (PDT) X-Received: by 2002:a24:ed4a:: with SMTP id r71-v6mr2684082ith.53.1529097275795; Fri, 15 Jun 2018 14:14:35 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:5995:0:0:0:0:0 with HTTP; Fri, 15 Jun 2018 14:14:35 -0700 (PDT) In-Reply-To: <201806151804.w5FI4i46064041@repo.freebsd.org> References: <201806151804.w5FI4i46064041@repo.freebsd.org> From: Conrad Meyer Date: Fri, 15 Jun 2018 14:14:35 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335223 - head/sys/dev/cxgbe To: Navdeep Parhar Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 21:20:43 -0000 This seems generally useful, and nothing about the code is specific to cxgbe. Could it be adapted to be driver-agnostic? Thanks, Conrad On Fri, Jun 15, 2018 at 11:04 AM, Navdeep Parhar wrote: > Author: np > Date: Fri Jun 15 18:04:44 2018 > New Revision: 335223 > URL: https://svnweb.freebsd.org/changeset/base/335223 > > Log: > cxgbe(4): sysctls to display the local and intr CPUs for the adapter. > ... > +} > + > +static int > +sysctl_cpus(SYSCTL_HANDLER_ARGS) > +{ >... > + rc = bus_get_cpus(sc->dev, op, sizeof(cpuset), &cpuset); > + if (rc != 0) > + return (rc); > + >... > + CPU_FOREACH(i) > + sbuf_printf(sb, "%d ", i); > + rc = sbuf_finish(sb); > + sbuf_delete(sb); From owner-svn-src-head@freebsd.org Fri Jun 15 21:23:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B45E2101D2E7; Fri, 15 Jun 2018 21:23:04 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 698C3844B3; Fri, 15 Jun 2018 21:23:04 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4AB1A1CF5F; Fri, 15 Jun 2018 21:23:04 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FLN4V6069035; Fri, 15 Jun 2018 21:23:04 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FLN4Zt069034; Fri, 15 Jun 2018 21:23:04 GMT (envelope-from np@FreeBSD.org) Message-Id: <201806152123.w5FLN4Zt069034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 15 Jun 2018 21:23:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335241 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 335241 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 21:23:05 -0000 Author: np Date: Fri Jun 15 21:23:03 2018 New Revision: 335241 URL: https://svnweb.freebsd.org/changeset/base/335241 Log: cxgbe(4): Track the number of received frames separately from the number of descriptors processed. Add the ability to gather a certain maximum number of frames in the driver's rx before waking up netmap rx. If there aren't enough frames then netmap rx will be woken up as usual. hw.cxgbe.nm_rx_nframes Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_netmap.c Modified: head/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- head/sys/dev/cxgbe/t4_netmap.c Fri Jun 15 21:07:14 2018 (r335240) +++ head/sys/dev/cxgbe/t4_netmap.c Fri Jun 15 21:23:03 2018 (r335241) @@ -72,6 +72,10 @@ int rx_ndesc = 256; SYSCTL_INT(_hw_cxgbe, OID_AUTO, nm_rx_ndesc, CTLFLAG_RWTUN, &rx_ndesc, 0, "# of rx descriptors after which the hw cidx is updated."); +int rx_nframes = 64; +SYSCTL_INT(_hw_cxgbe, OID_AUTO, nm_rx_nframes, CTLFLAG_RWTUN, + &rx_nframes, 0, "max # of frames received before waking up netmap rx."); + int holdoff_tmr_idx = 2; SYSCTL_INT(_hw_cxgbe, OID_AUTO, nm_holdoff_tmr_idx, CTLFLAG_RWTUN, &holdoff_tmr_idx, 0, "Holdoff timer index for netmap rx queues."); @@ -938,10 +942,12 @@ t4_nm_intr(void *arg) struct iq_desc *d = &nm_rxq->iq_desc[nm_rxq->iq_cidx]; const void *cpl; uint32_t lq; - u_int n = 0, work = 0; + u_int work = 0; uint8_t opcode; uint32_t fl_cidx = atomic_load_acq_32(&nm_rxq->fl_cidx); u_int fl_credits = fl_cidx & 7; + u_int ndesc = 0; /* desc processed since last cidx update */ + u_int nframes = 0; /* frames processed since last netmap wakeup */ while ((d->rsp.u.type_gen & F_RSPD_GEN) == nm_rxq->iq_gen) { @@ -953,10 +959,6 @@ t4_nm_intr(void *arg) switch (G_RSPD_TYPE(d->rsp.u.type_gen)) { case X_RSPD_TYPE_FLBUF: - if (black_hole != 2) { - /* No buffer packing so new buf every time */ - MPASS(lq & F_RSPD_NEWBUF); - } /* fall through */ @@ -975,9 +977,13 @@ t4_nm_intr(void *arg) ring->slot[fl_cidx].len = G_RSPD_LEN(lq) - sc->params.sge.fl_pktshift; ring->slot[fl_cidx].flags = 0; - fl_cidx += (lq & F_RSPD_NEWBUF) ? 1 : 0; - fl_credits += (lq & F_RSPD_NEWBUF) ? 1 : 0; - if (__predict_false(fl_cidx == nm_rxq->fl_sidx)) + nframes++; + if (!(lq & F_RSPD_NEWBUF)) { + MPASS(black_hole == 2); + break; + } + fl_credits++; + if (__predict_false(++fl_cidx == nm_rxq->fl_sidx)) fl_cidx = 0; break; default: @@ -1003,8 +1009,13 @@ t4_nm_intr(void *arg) nm_rxq->iq_gen ^= F_RSPD_GEN; } - if (__predict_false(++n == rx_ndesc)) { + if (__predict_false(++nframes == rx_nframes) && !black_hole) { atomic_store_rel_32(&nm_rxq->fl_cidx, fl_cidx); + netmap_rx_irq(ifp, nm_rxq->nid, &work); + nframes = 0; + } + + if (__predict_false(++ndesc == rx_ndesc)) { if (black_hole && fl_credits >= 8) { fl_credits /= 8; IDXINCR(nm_rxq->fl_pidx, fl_credits * 8, @@ -1012,14 +1023,12 @@ t4_nm_intr(void *arg) t4_write_reg(sc, sc->sge_kdoorbell_reg, nm_rxq->fl_db_val | V_PIDX(fl_credits)); fl_credits = fl_cidx & 7; - } else if (!black_hole) { - netmap_rx_irq(ifp, nm_rxq->nid, &work); - MPASS(work != 0); } t4_write_reg(sc, sc->sge_gts_reg, - V_CIDXINC(n) | V_INGRESSQID(nm_rxq->iq_cntxt_id) | + V_CIDXINC(ndesc) | + V_INGRESSQID(nm_rxq->iq_cntxt_id) | V_SEINTARM(V_QINTR_TIMER_IDX(X_TIMERREG_UPDATE_CIDX))); - n = 0; + ndesc = 0; } } @@ -1029,10 +1038,10 @@ t4_nm_intr(void *arg) IDXINCR(nm_rxq->fl_pidx, fl_credits * 8, nm_rxq->fl_sidx); t4_write_reg(sc, sc->sge_kdoorbell_reg, nm_rxq->fl_db_val | V_PIDX(fl_credits)); - } else + } else if (nframes > 0) netmap_rx_irq(ifp, nm_rxq->nid, &work); - t4_write_reg(sc, sc->sge_gts_reg, V_CIDXINC(n) | + t4_write_reg(sc, sc->sge_gts_reg, V_CIDXINC(ndesc) | V_INGRESSQID((u32)nm_rxq->iq_cntxt_id) | V_SEINTARM(V_QINTR_TIMER_IDX(holdoff_tmr_idx))); } From owner-svn-src-head@freebsd.org Fri Jun 15 21:34:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D1CD101D7AE; Fri, 15 Jun 2018 21:34:35 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pf0-x235.google.com (mail-pf0-x235.google.com [IPv6:2607:f8b0:400e:c00::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B8C6084CAA; Fri, 15 Jun 2018 21:34:34 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: by mail-pf0-x235.google.com with SMTP id a12-v6so5444101pfi.3; Fri, 15 Jun 2018 14:34:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:openpgp:autocrypt:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=3WZXTQJHA9SxZ2tfjxNqCPdxg3ryT4G7eGT+uDrq5ko=; b=urYdXN3x6O/6dYTCjKMQ+foahrthuoHRvmCFhDn7GR2gBO4M8h6p48+adJGWrQdMI8 Y5I3bdpZ9IAkuCGcXQwFmMlYj5E99GEr0FYjvo9FQhfjT7rgxUQFAlusNmbK6SdT9yua QuYkUtVafHQ6/+bDFQ+mRoZHZMkbcyAL1YS9dH/xYxPw3qdOv0P2eFYmtmtTBYtJ0Inp LaFB7QUW/TwBjes4EHmasfQyMRtCsOU1YW3put8iCJ+/T3bOtdwaC//tEvPy3uJw2FVW 1/LE7I6NjAKEmF/sMI6dNWmCigHETVOszwukpCktoICS7fyGwa5UZfRBV3p4z+x7W2/X Rv4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:openpgp :autocrypt:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=3WZXTQJHA9SxZ2tfjxNqCPdxg3ryT4G7eGT+uDrq5ko=; b=nFRmAGu6JWsNg9GmlvRjcmJn5EXMvYiPYIhyMd1olFJN3zSnm5XGCWK1dHQP5q2v99 nRxKDhKlJKdSmEwWgNyXDtDUZ0Mlp6cXCBq3SUkjlA8Dtv8N1yWjhTLzbdNLW/6fJmsO 3gSzqMMmcaMD0eSHWk/Z367WrYKFpn023Q+JVMCo2Bcw3jGAE5eoV5GQDp0OiRJS8k3Y i91Y/PISPPCzRgqbLCu9DFmmJsnjqI47OFF7Ce634c6tiEA/trJOdIYbYg/2xuSKOyyr UxZ5QQKbEFyse17kAB1Vo+f4m+gcmCSMtPN4mvSbmzxv86rpjYa4DwvMG1L4BaUvv2wa MaWQ== X-Gm-Message-State: APt69E01bqXLTReYfGsga6DSiRR2+uagnF2cf0cnHDwh9s37ZySOD7KZ JJtyFnl4AvhkIi4Dje2yNMp04Q== X-Google-Smtp-Source: ADUXVKI9adzSDK9UMZ7P04tWkigyiik8F8ZXy6ooHFIUqg+5XfnT8bhbPHiSXbfgEDiCd6oT9GCHJw== X-Received: by 2002:a63:69c4:: with SMTP id e187-v6mr3046528pgc.294.1529098473524; Fri, 15 Jun 2018 14:34:33 -0700 (PDT) Received: from [10.192.166.0] (stargate.chelsio.com. [12.32.117.8]) by smtp.googlemail.com with ESMTPSA id m16-v6sm10438078pgu.67.2018.06.15.14.34.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Jun 2018 14:34:32 -0700 (PDT) Sender: Navdeep Parhar Subject: Re: svn commit: r335223 - head/sys/dev/cxgbe To: cem@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201806151804.w5FI4i46064041@repo.freebsd.org> From: Navdeep Parhar Openpgp: preference=signencrypt Autocrypt: addr=np@FreeBSD.org; prefer-encrypt=mutual; keydata= xsDiBEosaGcRBACOXnXquGEW53BjpMt2jViod/TUf1xgjMekcbDxqOODPeX7eYfrwJ8G6BCN OpGjBmWDu/JcNj4Z+gmTilJ6WLZQ7ecFZfEeO91pt6ys0cyWh0xfO+/mT83D7W81S/kqrJBk QbBIdV6LumevdErHo272r8RcMELC4Ru87eRtX3hmEwCgnnGNJMpQFUfYTt5XE7nY0yQoeV8D /0OcWmJbEZWxX9O7AuliCe3zd2Dw0B4LB9SZ2Dis7+gpVd3xVgYnt5wRE9kM+ThgrMA/wqr8 07qmEG6bcfUsfwwGN9YUtNF3xAN07cXTs026sCIFNZK816PrThBzCgkwR7pDpkMzGWIBr8Wi XXy0eB+JlQ6UV4PEiXuZ5ulzP0b1A/9CZm3wJfrNC0r1gMyrfVedg4zwKU997bmPLGcYs+rW XDTI9CvMseOUYn4CoDZQCp/9zxuHK+VU7Y/w0c/hVE5ERACSn4SjN2unEDstK9njZBMHEPVk Ae/YvSG5cmc97SHlVE+eu/bbLKcvFb6rRLPOaVFQJMJA2VJEGWtYhvP7Zc0fTmF2ZGVlcCBQ YXJoYXIgPG5wQEZyZWVCU0Qub3JnPsJgBBMRAgAgBQJKLGhnAhsDBgsJCAcDAgQVAggDBBYC AwECHgECF4AACgkQyrIrk6yriBL0MQCfUJOiS2PbJFDeiav1ylcXXwfpggAAoJRoS7GDENGy M4BzjJ4b0ptZqTLRzsFNBEosaGcQCACFCWs47SL4DQA6bNDlVJu4w8wLf8uVOyatuGmdXX8Y /OTVQJgA3vS+ODNVJCxhKVlvhcn7bhBdGdWKS9K+lr8+eEvr4hf2bQpesoHC+uFgKyILkCBN L8raixbhysyq0pfZWWDJMyn+G42BG1yJJi+bykygdpYnbIVA8dYHmBibI8mkPKOHSohjXT1S RfGGn+l1w54OO4NlJhCXMkjTA/Z9Bt4XeaiR85uJi0UUfV8FGZHhgSvT+/P1xIvz+nytuehS P/QLXl13CtAG/nKVkAcZnsT/3NrJ4Z2r45k+c50Wrf210scAaBogrrV5eIHfNGgOANApN8+8 vj+aXO4pXRuXAAMFB/44ea8rd+P5N3OMrfuM8i91Qe1bJ+BIoroKPOr8jvCry0h3QpdfLKUN IgaqbS3JZeBJ8HHnWSGCF+o6H5gzRe1hvylPEclLPDCuPe7T746h9Mzejf2hNDJvOg+BuweD ZW4KhovVbdS+syJEvpGF4bO8qgHT2CKgruXSHbFetdQWbkM0rfMmTuo0GcR2BEVrPb/SPFv6 4ZZyAZzmnGO4vT1bzClnTzJixrDpH74M3vSEYegMB4KdbLYBi8Jx4QUKgVEhJHjJubKWX4et yU/uuehOC3xYrmr1UXvsom3U8r36Dvdo77Yr3dgDVXa7bolNx0TIhdWxZI+R4z9E75QY+/wg wkkEGBECAAkFAkosaGcCGwwACgkQyrIrk6yriBI+JQCfUxgyqGtzZvLh5Al7gsTmRc11PLwA niD3NfWGRcO2+9uxSSQqRH1ywC4n Message-ID: Date: Fri, 15 Jun 2018 14:34:31 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 21:34:35 -0000 I'm all for these sysctls becoming %intr_cpus and %local_cpus and being filled up by the device's parent automatically. But I'd like to tweak the output a bit so that it can be fed directly to cpuset -l. Regards, Navdeep On 06/15/18 14:14, Conrad Meyer wrote: > This seems generally useful, and nothing about the code is specific to > cxgbe. Could it be adapted to be driver-agnostic? > > Thanks, > Conrad > > On Fri, Jun 15, 2018 at 11:04 AM, Navdeep Parhar wrote: >> Author: np >> Date: Fri Jun 15 18:04:44 2018 >> New Revision: 335223 >> URL: https://svnweb.freebsd.org/changeset/base/335223 >> >> Log: >> cxgbe(4): sysctls to display the local and intr CPUs for the adapter. >> ... >> +} >> + >> +static int >> +sysctl_cpus(SYSCTL_HANDLER_ARGS) >> +{ >> ... >> + rc = bus_get_cpus(sc->dev, op, sizeof(cpuset), &cpuset); >> + if (rc != 0) >> + return (rc); >> + >> ... >> + CPU_FOREACH(i) >> + sbuf_printf(sb, "%d ", i); >> + rc = sbuf_finish(sb); >> + sbuf_delete(sb); From owner-svn-src-head@freebsd.org Fri Jun 15 21:36:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 614E2101D865; Fri, 15 Jun 2018 21:36:17 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 15C4B84E14; Fri, 15 Jun 2018 21:36:17 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E6E681D113; Fri, 15 Jun 2018 21:36:16 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FLaGdr074335; Fri, 15 Jun 2018 21:36:16 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FLaGCP074334; Fri, 15 Jun 2018 21:36:16 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201806152136.w5FLaGCP074334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 15 Jun 2018 21:36:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335242 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 335242 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 21:36:17 -0000 Author: glebius Date: Fri Jun 15 21:36:16 2018 New Revision: 335242 URL: https://svnweb.freebsd.org/changeset/base/335242 Log: Since 'ticks' is an int, it may wrap around and cr_ticks at a certain counter_rate will be greater than ticks, resulting in counter_ratecheck() failure. To fix this take an absolute value of the difference between ticks and cr_ticks. Reported by: jtl Sponsored by: Netflix Modified: head/sys/kern/subr_counter.c Modified: head/sys/kern/subr_counter.c ============================================================================== --- head/sys/kern/subr_counter.c Fri Jun 15 21:23:03 2018 (r335241) +++ head/sys/kern/subr_counter.c Fri Jun 15 21:36:16 2018 (r335242) @@ -140,7 +140,7 @@ counter_ratecheck(struct counter_rate *cr, int64_t lim val = cr->cr_over; now = ticks; - if (now - cr->cr_ticks >= hz) { + if (abs(now - cr->cr_ticks) >= hz) { /* * Time to clear the structure, we are in the next second. * First try unlocked read, and then proceed with atomic. @@ -151,7 +151,7 @@ counter_ratecheck(struct counter_rate *cr, int64_t lim * Check if other thread has just went through the * reset sequence before us. */ - if (now - cr->cr_ticks >= hz) { + if (abs(now - cr->cr_ticks) >= hz) { val = counter_u64_fetch(cr->cr_rate); counter_u64_zero(cr->cr_rate); cr->cr_over = 0; From owner-svn-src-head@freebsd.org Fri Jun 15 23:42:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE407102125C; Fri, 15 Jun 2018 23:42:23 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7366B68B95; Fri, 15 Jun 2018 23:42:23 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A5A81E50C; Fri, 15 Jun 2018 23:42:23 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FNgN8F041075; Fri, 15 Jun 2018 23:42:23 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FNgMpU041074; Fri, 15 Jun 2018 23:42:22 GMT (envelope-from np@FreeBSD.org) Message-Id: <201806152342.w5FNgMpU041074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 15 Jun 2018 23:42:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335243 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 335243 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 23:42:24 -0000 Author: np Date: Fri Jun 15 23:42:22 2018 New Revision: 335243 URL: https://svnweb.freebsd.org/changeset/base/335243 Log: cxgbe(4): Add a hw.cxgbe.starve_fl sysctl that can be used to starve the freelists of netmap receive queues. This is primarily to test various congestion scenarios in the chip. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_netmap.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Fri Jun 15 21:36:16 2018 (r335242) +++ head/sys/dev/cxgbe/adapter.h Fri Jun 15 23:42:22 2018 (r335243) @@ -682,6 +682,7 @@ struct sge_nm_rxq { uint32_t fl_db_val; u_int fl_hwidx:4; + u_int fl_db_saved; u_int nid; /* netmap ring # for this queue */ /* infrequently used items after this */ Modified: head/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- head/sys/dev/cxgbe/t4_netmap.c Fri Jun 15 21:36:16 2018 (r335242) +++ head/sys/dev/cxgbe/t4_netmap.c Fri Jun 15 23:42:22 2018 (r335243) @@ -89,6 +89,10 @@ SYSCTL_INT(_hw_cxgbe, OID_AUTO, nm_holdoff_tmr_idx, CT static int nm_cong_drop = 1; TUNABLE_INT("hw.cxgbe.nm_cong_drop", &nm_cong_drop); +int starve_fl = 0; +SYSCTL_INT(_hw_cxgbe, OID_AUTO, starve_fl, CTLFLAG_RWTUN, + &starve_fl, 0, "Don't ring fl db for netmap rx queues."); + static int alloc_nm_rxq_hwq(struct vi_info *vi, struct sge_nm_rxq *nm_rxq, int cong) { @@ -806,6 +810,13 @@ cxgbe_netmap_rxsync(struct netmap_kring *kring, int fl kring->nr_kflags &= ~NKR_PENDINTR; } + if (nm_rxq->fl_db_saved > 0 && starve_fl == 0) { + wmb(); + t4_write_reg(sc, sc->sge_kdoorbell_reg, + nm_rxq->fl_db_val | V_PIDX(nm_rxq->fl_db_saved)); + nm_rxq->fl_db_saved = 0; + } + /* Userspace done with buffers from kring->nr_hwcur to head */ n = head >= kring->nr_hwcur ? head - kring->nr_hwcur : kring->nkr_num_slots - kring->nr_hwcur + head; @@ -842,8 +853,12 @@ cxgbe_netmap_rxsync(struct netmap_kring *kring, int fl } if (++dbinc == 8 && n >= 32) { wmb(); - t4_write_reg(sc, sc->sge_kdoorbell_reg, - nm_rxq->fl_db_val | V_PIDX(dbinc)); + if (starve_fl) + nm_rxq->fl_db_saved += dbinc; + else { + t4_write_reg(sc, sc->sge_kdoorbell_reg, + nm_rxq->fl_db_val | V_PIDX(dbinc)); + } dbinc = 0; } } @@ -851,8 +866,12 @@ cxgbe_netmap_rxsync(struct netmap_kring *kring, int fl if (dbinc > 0) { wmb(); - t4_write_reg(sc, sc->sge_kdoorbell_reg, - nm_rxq->fl_db_val | V_PIDX(dbinc)); + if (starve_fl) + nm_rxq->fl_db_saved += dbinc; + else { + t4_write_reg(sc, sc->sge_kdoorbell_reg, + nm_rxq->fl_db_val | V_PIDX(dbinc)); + } } } From owner-svn-src-head@freebsd.org Sat Jun 16 00:35:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42F36102288C; Sat, 16 Jun 2018 00:35:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EB1F76A265; Sat, 16 Jun 2018 00:35:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C93DC1EE4E; Sat, 16 Jun 2018 00:35:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5G0ZJxQ066326; Sat, 16 Jun 2018 00:35:19 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5G0ZJfd066325; Sat, 16 Jun 2018 00:35:19 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201806160035.w5G0ZJfd066325@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 16 Jun 2018 00:35:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335244 - head X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 335244 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2018 00:35:20 -0000 Author: bdrewery Date: Sat Jun 16 00:35:19 2018 New Revision: 335244 URL: https://svnweb.freebsd.org/changeset/base/335244 Log: Assert that a build is done before an install. This should also catch cases where the wrong MAKEOBJDIRPREFIX is used for install. MFC after: 2 weeks Sponsored by: Dell EMC Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Jun 15 23:42:22 2018 (r335243) +++ head/Makefile.inc1 Sat Jun 16 00:35:19 2018 (r335244) @@ -89,7 +89,10 @@ MK_GCC_BOOTSTRAP= no .if make(installworld) || make(install) || make(distributeworld) || \ make(stageworld) .-include "${OBJTOP}/compiler-metadata.mk" +.if !defined(_LOADED_COMPILER_METADATA) +.error A build is required first. You may have the wrong MAKEOBJDIRPREFIX set. .endif +.endif # Pull in COMPILER_TYPE and COMPILER_FREEBSD_VERSION early. Pull it from the # tree to be friendlier to foreign OS builds. It's safe to do so unconditionally @@ -195,6 +198,7 @@ compiler-metadata.mk: .PHONY .META @: > ${.TARGET} @echo ".info Using cached compiler metadata from build at $$(hostname) on $$(date)" \ > ${.TARGET} + @echo "_LOADED_COMPILER_METADATA=t" >> ${.TARGET} .for v in ${_COMPILER_METADATA_VARS} @echo "${v}=${${v}}" >> ${.TARGET} .endfor From owner-svn-src-head@freebsd.org Sat Jun 16 02:50:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22636100532B; Sat, 16 Jun 2018 02:50:30 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C1F196F972; Sat, 16 Jun 2018 02:50:29 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9ED6820544; Sat, 16 Jun 2018 02:50:29 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5G2oTZs033520; Sat, 16 Jun 2018 02:50:29 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5G2oT5Y033519; Sat, 16 Jun 2018 02:50:29 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201806160250.w5G2oT5Y033519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sat, 16 Jun 2018 02:50:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335245 - head/stand/i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: head/stand/i386/libi386 X-SVN-Commit-Revision: 335245 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2018 02:50:30 -0000 Author: allanjude Date: Sat Jun 16 02:50:29 2018 New Revision: 335245 URL: https://svnweb.freebsd.org/changeset/base/335245 Log: Correct logic error in biosdisk.c:bd_realstrategy() The wrong condition is used when evaluating the return of disk_ioctl() This results in reaching the 'We should not get here' branch in most casts Reviewed by: imp Sponsored by: Klara Systems Differential Revision: https://reviews.freebsd.org/D15839 Modified: head/stand/i386/libi386/biosdisk.c Modified: head/stand/i386/libi386/biosdisk.c ============================================================================== --- head/stand/i386/libi386/biosdisk.c Sat Jun 16 00:35:19 2018 (r335244) +++ head/stand/i386/libi386/biosdisk.c Sat Jun 16 02:50:29 2018 (r335245) @@ -594,8 +594,8 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s *rsize = 0; /* Get disk blocks, this value is either for whole disk or for partition */ - if (disk_ioctl(dev, DIOCGMEDIASIZE, &disk_blocks)) { - /* DIOCGMEDIASIZE does return bytes. */ + if (disk_ioctl(dev, DIOCGMEDIASIZE, &disk_blocks) == 0) { + /* DIOCGMEDIASIZE returns bytes. */ disk_blocks /= BD(dev).bd_sectorsize; } else { /* We should not get here. Just try to survive. */ From owner-svn-src-head@freebsd.org Sat Jun 16 03:34:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7C2B1007A61; Sat, 16 Jun 2018 03:34:46 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it0-f53.google.com (mail-it0-f53.google.com [209.85.214.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7FDE1716E9; Sat, 16 Jun 2018 03:34:46 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-f53.google.com with SMTP id n7-v6so5357834itn.1; Fri, 15 Jun 2018 20:34:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=UUdPW5tcPxtVmkmIZgjeXgLc6WmuzU/yREBV1R/OF9k=; b=pPyFTOor7uei9537+5Lg05FgrVZnc/QOl2EiX7+XF2IEsqyCYx9XWSbqhRynVy8Va6 +y2B0J9+szr1zRpK8jy5D78SrHcvrNFp16HZhqDDhzapMLZ9Lp3o1EmnYX1Aeh5Y+eFk DzwU6ERK2wvSaGghbi5Yw0XONidm5C6k0OxxmgXFr4gV+2/z52MBwEpewVw0lAk1+BKG 4a7pSAVT6ThcbZoNISJ2TXyoo98Q/gqw7/wy3gfndk0akU/wRTt9BazLqONFZ+yCW4NS 62+1pQ+Ghd4cWotFCADmvV1HtIn/XmtvPgGRXT/N80AKiHw7t8dh9RgeXwTmqNbFJbIi uqSA== X-Gm-Message-State: APt69E2WiP/x7NdYQMkDl/fmLmVwd5bUexX5kelgzv+vN5jRih3hxIEP yUW4TSUpN51rFUY993rxAEKBDYy1KLrL6FIf8KnQ4g== X-Google-Smtp-Source: ADUXVKJe/5tHovrKr9VmTLMBWHWn47xzzLgAiHumOZQDzRUVkb/qhdlGJRQJcw8q5LMbNuPy0RLg1yUOHQaED++0jRk= X-Received: by 2002:a02:88cc:: with SMTP id b12-v6mr3089043jak.76.1529120085501; Fri, 15 Jun 2018 20:34:45 -0700 (PDT) MIME-Version: 1.0 References: <201806151618.w5FGIdXX006808@repo.freebsd.org> <8c9be7aa-649a-3df3-b485-c30230c13a4a@FreeBSD.org> In-Reply-To: <8c9be7aa-649a-3df3-b485-c30230c13a4a@FreeBSD.org> From: Ed Maste Date: Fri, 15 Jun 2018 23:34:33 -0400 Message-ID: Subject: Re: svn commit: r335210 - head/tools/build/options To: John Baldwin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2018 03:34:47 -0000 On Fri, 15 Jun 2018 at 14:35, John Baldwin wrote: > > > BTW, I found it confusing recently that objcopy's build glue was in > usr.bin/elfcopy. That perhaps made sense during the transition, but > should we just rename that to usr.bin/objcopy now? Probably, yes. I'm happy if you want to go ahead and do it, otherwise I'll get to it sometime later on. From owner-svn-src-head@freebsd.org Sat Jun 16 04:36:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0679A10092DD; Sat, 16 Jun 2018 04:36:43 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F10E7354F; Sat, 16 Jun 2018 04:36:41 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id U2x0fDFZIuYopU2x1f0WKO; Fri, 15 Jun 2018 22:36:35 -0600 X-Authority-Analysis: v=2.3 cv=GopsBH9C c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=7mUfYlMuFuIA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=tttBFcZZRunaQQgWgm4A:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id E1D59FE; Fri, 15 Jun 2018 21:36:33 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w5G4aXIf039569; Fri, 15 Jun 2018 21:36:33 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id w5G4aXks039566; Fri, 15 Jun 2018 21:36:33 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201806160436.w5G4aXks039566@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Bryan Drewery cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335244 - head In-Reply-To: Message from Bryan Drewery of "Sat, 16 Jun 2018 00:35:19 -0000." <201806160035.w5G0ZJfd066325@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 15 Jun 2018 21:36:33 -0700 X-CMAE-Envelope: MS4wfAhsD3cs68KJV4dbM3M5hTr7Z7nzDOoQ9iGcY3PBxY986jtlJ8buVI9Bi5MyyyLbyqAfpA2Ot3xYi+tfX3CW9vrg7L7/TyTlyupwjZFgeP09aknSjz7B kKPNGxUdNBLNJzGJkmgskGSy5fMN91zz+yN2rP1d0wUsKXJFjPzdUb3yCA9r9Vt616uiX6Y+NR8VNEH4t0Acg0pUqHF17DP2joTJ7b2HjhalI9KjYXmqMz/3 blSi7MmWvOJFIB5AD811c8jVI3Shu6TedxyENWx7t6yv4iPrWmlqy5xO9oF3xhOO X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2018 04:36:43 -0000 In message <201806160035.w5G0ZJfd066325@repo.freebsd.org>, Bryan Drewery writes : > Author: bdrewery > Date: Sat Jun 16 00:35:19 2018 > New Revision: 335244 > URL: https://svnweb.freebsd.org/changeset/base/335244 > > Log: > Assert that a build is done before an install. > > This should also catch cases where the wrong MAKEOBJDIRPREFIX is used for > install. > > MFC after: 2 weeks > Sponsored by: Dell EMC > > Modified: > head/Makefile.inc1 > > Modified: head/Makefile.inc1 > ============================================================================= > = > --- head/Makefile.inc1 Fri Jun 15 23:42:22 2018 (r335243) > +++ head/Makefile.inc1 Sat Jun 16 00:35:19 2018 (r335244) > @@ -89,7 +89,10 @@ MK_GCC_BOOTSTRAP= no > .if make(installworld) || make(install) || make(distributeworld) || \ > make(stageworld) > .-include "${OBJTOP}/compiler-metadata.mk" > +.if !defined(_LOADED_COMPILER_METADATA) > +.error A build is required first. You may have the wrong MAKEOBJDIRPREFIX s > et. > .endif > +.endif > > # Pull in COMPILER_TYPE and COMPILER_FREEBSD_VERSION early. Pull it from the > # tree to be friendlier to foreign OS builds. It's safe to do so uncondition > ally > @@ -195,6 +198,7 @@ compiler-metadata.mk: .PHONY .META > @: > ${.TARGET} > @echo ".info Using cached compiler metadata from build at $$(hostname) > on $$(date)" \ > > ${.TARGET} > + @echo "_LOADED_COMPILER_METADATA=t" >> ${.TARGET} > .for v in ${_COMPILER_METADATA_VARS} > @echo "${v}=${${v}}" >> ${.TARGET} > .endfor > Another data point: This also broke the following: cwsys# poudriere jail -c -m src=/opt/src/svn-current -j HEADi386 -a i386 [00:00:00] Creating HEADi386 fs at /poudriere/amd64/jails/HEADi386... done [00:00:01] Copying /opt/src/svn-current to /poudriere/amd64/jails/HEADi3 86/usr/src... done [00:06:01] Starting make installworld --- installworld --- make[1]: "/export/obj/opt/src/svn-current/i386.i386/compiler-metadata.mk " line 1: Using cached compiler metadata from build at cwsys on Fri Jun 15 18:39:46 PDT 2018 make[1]: "/opt/src/svn-current/Makefile.inc1" line 93: A build is required first. You may have the wrong MAKEOBJDIRPREFIX set. *** [installworld] Error code 1 make: stopped in /opt/src/svn-current 1 error make: stopped in /opt/src/svn-current [00:06:01] Error: Failed to 'make installworld' [00:06:01] Error while creating jail, cleaning up. [00:06:01] Removing HEADi386 jail... done [00:06:03] Cleaning HEADi386 data... done cwsys# -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Sat Jun 16 04:36:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 706BA10092E6; Sat, 16 Jun 2018 04:36:44 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id CA0FA73551; Sat, 16 Jun 2018 04:36:43 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id U2uOfDEdSuYopU2uPf0W5W; Fri, 15 Jun 2018 22:33:54 -0600 X-Authority-Analysis: v=2.3 cv=GopsBH9C c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=7mUfYlMuFuIA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=OF3UqqUGJZTPdCVrdNoA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id A2642FD; Fri, 15 Jun 2018 21:33:51 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w5G4XpgF039543; Fri, 15 Jun 2018 21:33:51 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id w5G4XpjI039540; Fri, 15 Jun 2018 21:33:51 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201806160433.w5G4XpjI039540@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Bryan Drewery cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335244 - head In-Reply-To: Message from Bryan Drewery of "Sat, 16 Jun 2018 00:35:19 -0000." <201806160035.w5G0ZJfd066325@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 15 Jun 2018 21:33:51 -0700 X-CMAE-Envelope: MS4wfHgVVmpDSGedzQX0L2I6f9jUzd8G/vQ9OBrfGgJ3Xe+fAnYhQ3XefOcYRsjgePUPW+G7/1z9kGV8ojXjOLmE+i89PsGbKdfr20IRyzWseQtDHEpDGJtH GWCUm6K8ja1/Q/ypxAwo2euJThzKClN1ghXUI7f9qsyyQSDGD0NQ80MNkKcb6CoPryjjoQ/nDzP0zj1spMqTGD6AfG90s29XeDh20asLsKpMO3D18sZjjFNQ MbpuyWmTrIG1UotaMDgUXcu1270xKWoT29jiQQu/2W0uVRIi8/1SbjLVfG0MCRGo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2018 04:36:44 -0000 In message <201806160035.w5G0ZJfd066325@repo.freebsd.org>, Bryan Drewery writes : > Author: bdrewery > Date: Sat Jun 16 00:35:19 2018 > New Revision: 335244 > URL: https://svnweb.freebsd.org/changeset/base/335244 > > Log: > Assert that a build is done before an install. > > This should also catch cases where the wrong MAKEOBJDIRPREFIX is used for > install. > > MFC after: 2 weeks > Sponsored by: Dell EMC > > Modified: > head/Makefile.inc1 > > Modified: head/Makefile.inc1 > ============================================================================= > = > --- head/Makefile.inc1 Fri Jun 15 23:42:22 2018 (r335243) > +++ head/Makefile.inc1 Sat Jun 16 00:35:19 2018 (r335244) > @@ -89,7 +89,10 @@ MK_GCC_BOOTSTRAP= no > .if make(installworld) || make(install) || make(distributeworld) || \ > make(stageworld) > .-include "${OBJTOP}/compiler-metadata.mk" > +.if !defined(_LOADED_COMPILER_METADATA) > +.error A build is required first. You may have the wrong MAKEOBJDIRPREFIX s > et. > .endif > +.endif > > # Pull in COMPILER_TYPE and COMPILER_FREEBSD_VERSION early. Pull it from the > # tree to be friendlier to foreign OS builds. It's safe to do so uncondition > ally > @@ -195,6 +198,7 @@ compiler-metadata.mk: .PHONY .META > @: > ${.TARGET} > @echo ".info Using cached compiler metadata from build at $$(hostname) > on $$(date)" \ > > ${.TARGET} > + @echo "_LOADED_COMPILER_METADATA=t" >> ${.TARGET} > .for v in ${_COMPILER_METADATA_VARS} > @echo "${v}=${${v}}" >> ${.TARGET} > .endfor > Hi Bryan, This broke poudriere. I don't update my poudriere jails in the traditional sense. I buildworld on one of my poudriere build machine, installworld & kernel, then update jail using poudriere jail -j HEADamd64 -u. To create my jails I do the following: poudriere jail -c -m src=/opt/src/svn-current -j HEADi386 -a i386 poudriere jail -c -m src=/opt/src/svn-current -j HEADamd64 The error that poudriere jail -j HEADamd64 -u produces is: [00:00:00] Upgrading using src=/opt/src/svn-current [00:00:00] Copying /opt/src/svn-current to /poudriere/amd64/jails/HEADam d64/usr/src... done [00:00:50] Starting make installworld --- installworld --- make[1]: "/export/obj/opt/src/svn-current/amd64.amd64/compiler-metadata. mk" line 1: Using cached compiler metadata from build at cwsys on Fri Jun 15 16:34:46 PDT 2018 make[1]: "/opt/src/svn-current/Makefile.inc1" line 93: A build is required first. You may have the wrong MAKEOBJDIRPREFIX set. *** [installworld] Error code 1 make: stopped in /opt/src/svn-current 1 error make: stopped in /opt/src/svn-current [00:00:50] Error: Failed to 'make installworld' To build the object I do a standard buildworld and buildkernel first (and install on the host system first). -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Sat Jun 16 04:50:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F386F100971B; Sat, 16 Jun 2018 04:50:41 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0459573C02; Sat, 16 Jun 2018 04:50:41 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DAAD121A15; Sat, 16 Jun 2018 04:50:40 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5G4oeTx095889; Sat, 16 Jun 2018 04:50:40 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5G4oe5M095888; Sat, 16 Jun 2018 04:50:40 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201806160450.w5G4oe5M095888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sat, 16 Jun 2018 04:50:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335246 - head/stand/i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: head/stand/i386/libi386 X-SVN-Commit-Revision: 335246 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2018 04:50:42 -0000 Author: allanjude Date: Sat Jun 16 04:50:40 2018 New Revision: 335246 URL: https://svnweb.freebsd.org/changeset/base/335246 Log: biosdisk.c remove redundant variable `rdev` and `disk` serve the same purpose, read the partition table without the `d_offset` or `d_slice` set, so the read is relative to the start of the disk. Reuse the already initialized `disk` instead of making another copy later. Sponsored by: Klara Systems Modified: head/stand/i386/libi386/biosdisk.c Modified: head/stand/i386/libi386/biosdisk.c ============================================================================== --- head/stand/i386/libi386/biosdisk.c Sat Jun 16 02:50:29 2018 (r335245) +++ head/stand/i386/libi386/biosdisk.c Sat Jun 16 04:50:40 2018 (r335246) @@ -379,7 +379,7 @@ bd_print(int verbose) static int bd_open(struct open_file *f, ...) { - struct disk_devdesc *dev, rdev; + struct disk_devdesc *dev; struct disk_devdesc disk; int err, g_err; va_list ap; @@ -445,11 +445,8 @@ bd_open(struct open_file *f, ...) dskp.part = dev->d_partition; dskp.start = dev->d_offset; - memcpy(&rdev, dev, sizeof(rdev)); - /* to read the GPT table, we need to read the first sector */ - rdev.d_offset = 0; /* We need the LBA of the end of the partition */ - table = ptable_open(&rdev, BD(dev).bd_sectors, + table = ptable_open(&disk, BD(dev).bd_sectors, BD(dev).bd_sectorsize, ptblread); if (table == NULL) { DEBUG("Can't read partition table"); From owner-svn-src-head@freebsd.org Sat Jun 16 05:02:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 879CE1009C14; Sat, 16 Jun 2018 05:02:24 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E48D07430A; Sat, 16 Jun 2018 05:02:23 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id U3Lqfpjmx5wO5U3LrfrPN0; Fri, 15 Jun 2018 23:02:16 -0600 X-Authority-Analysis: v=2.3 cv=SJtsqtnH c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=7mUfYlMuFuIA:10 a=VxmjJ2MpAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=pFPmQLvFyrIsco2Ow2sA:9 a=CjuIK1q_8ugA:10 a=tPJkxjwt9L8A:10 a=7gXAzLPJhVmCkEl4_tsf:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 6CDB213E; Fri, 15 Jun 2018 22:02:13 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w5G52DRR039777; Fri, 15 Jun 2018 22:02:13 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id w5G52CIO039774; Fri, 15 Jun 2018 22:02:12 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201806160502.w5G52CIO039774@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Cy Schubert cc: Bryan Drewery , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335244 - head In-Reply-To: Message from Cy Schubert of "Fri, 15 Jun 2018 21:36:33 -0700." <201806160436.w5G4aXks039566@slippy.cwsent.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 15 Jun 2018 22:02:12 -0700 X-CMAE-Envelope: MS4wfPKXFvWvflrV/41Mddlo+XgOs3dUuGc2qeftDXLeNsYsCqrEPLTWF4GN15rxmysxeOGTB+xqhwxA2osvrSpcANJg1Dxymn2PxB8cmoGn/gTg4sKkt6Fz queUxDTuOZddA7edCsTwAPDC4YjhObYkEAzTuLDjOfbvu041hH9iP8TZRUoC6dCIe/cXqYekOdGDQjjcXe+GZKGLrIwgAPzOxy5WUgxH+dxK5TqpSLlOpoS5 EAOCr7+hZ0FGDnka+sGqspSrNCScV4iDYLPX9+pEZUurK8h3JEkSAv3v3U4hz68c X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2018 05:02:24 -0000 In message <201806160436.w5G4aXks039566@slippy.cwsent.com>, Cy Schubert writes: > In message <201806160035.w5G0ZJfd066325@repo.freebsd.org>, Bryan > Drewery writes > : > > Author: bdrewery > > Date: Sat Jun 16 00:35:19 2018 > > New Revision: 335244 > > URL: https://svnweb.freebsd.org/changeset/base/335244 > > > > Log: > > Assert that a build is done before an install. > > > > This should also catch cases where the wrong MAKEOBJDIRPREFIX is used for > > install. > > > > MFC after: 2 weeks > > Sponsored by: Dell EMC > > > > Modified: > > head/Makefile.inc1 > > > > Modified: head/Makefile.inc1 > > =========================================================================== > == > > = > > --- head/Makefile.inc1 Fri Jun 15 23:42:22 2018 (r335243) > > +++ head/Makefile.inc1 Sat Jun 16 00:35:19 2018 (r335244) > > @@ -89,7 +89,10 @@ MK_GCC_BOOTSTRAP= no > > .if make(installworld) || make(install) || make(distributeworld) || \ > > make(stageworld) > > .-include "${OBJTOP}/compiler-metadata.mk" > > +.if !defined(_LOADED_COMPILER_METADATA) > > +.error A build is required first. You may have the wrong MAKEOBJDIRPREFIX > s > > et. > > .endif > > +.endif > > > > # Pull in COMPILER_TYPE and COMPILER_FREEBSD_VERSION early. Pull it from t > he > > # tree to be friendlier to foreign OS builds. It's safe to do so unconditi > on > > ally > > @@ -195,6 +198,7 @@ compiler-metadata.mk: .PHONY .META > > @: > ${.TARGET} > > @echo ".info Using cached compiler metadata from build at $$(hostname) > > on $$(date)" \ > > > ${.TARGET} > > + @echo "_LOADED_COMPILER_METADATA=t" >> ${.TARGET} > > .for v in ${_COMPILER_METADATA_VARS} > > @echo "${v}=${${v}}" >> ${.TARGET} > > .endfor > > > > Another data point: This also broke the following: > > cwsys# poudriere jail -c -m src=/opt/src/svn-current -j HEADi386 -a i386 > [00:00:00] Creating HEADi386 fs at /poudriere/amd64/jails/HEADi386... > done > [00:00:01] Copying /opt/src/svn-current to /poudriere/amd64/jails/HEADi3 > 86/usr/src... done > [00:06:01] Starting make installworld > --- installworld --- > make[1]: "/export/obj/opt/src/svn-current/i386.i386/compiler-metadata.mk > " line 1: Using cached compiler metadata from build at cwsys on Fri Jun > 15 18:39:46 PDT 2018 > make[1]: "/opt/src/svn-current/Makefile.inc1" line 93: A build is > required first. You may have the wrong MAKEOBJDIRPREFIX set. > *** [installworld] Error code 1 > > make: stopped in /opt/src/svn-current > 1 error > > make: stopped in /opt/src/svn-current > [00:06:01] Error: Failed to 'make installworld' > [00:06:01] Error while creating jail, cleaning up. > [00:06:01] Removing HEADi386 jail... done > [00:06:03] Cleaning HEADi386 data... done > cwsys# Nevermind. I found it. Stupid error on my part. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Sat Jun 16 05:39:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 940A6100A89B; Sat, 16 Jun 2018 05:39:39 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 9E75374F95; Sat, 16 Jun 2018 05:39:38 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id A2E1D1A087B; Sat, 16 Jun 2018 15:39:27 +1000 (AEST) Date: Sat, 16 Jun 2018 15:39:24 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Gleb Smirnoff cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335242 - head/sys/kern In-Reply-To: <201806152136.w5FLaGCP074334@repo.freebsd.org> Message-ID: <20180616123220.K976@besplex.bde.org> References: <201806152136.w5FLaGCP074334@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=cIaQihWN c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=H_4jZ2QBzDgs3DYR_ncA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2018 05:39:39 -0000 On Fri, 15 Jun 2018, Gleb Smirnoff wrote: > Log: > Since 'ticks' is an int, it may wrap around and cr_ticks at a certain > counter_rate will be greater than ticks, resulting in counter_ratecheck() > failure. To fix this take an absolute value of the difference between > ticks and cr_ticks. This only works accidentally, and only half as well as possible. It is much easier to see that the normal method to u_int works as well as possible, esepecially for cases where it doesn't work. > Modified: head/sys/kern/subr_counter.c > ============================================================================== > --- head/sys/kern/subr_counter.c Fri Jun 15 21:23:03 2018 (r335241) > +++ head/sys/kern/subr_counter.c Fri Jun 15 21:36:16 2018 (r335242) > @@ -140,7 +140,7 @@ counter_ratecheck(struct counter_rate *cr, int64_t lim > val = cr->cr_over; > now = ticks; > > - if (now - cr->cr_ticks >= hz) { > + if (abs(now - cr->cr_ticks) >= hz) { > /* > * Time to clear the structure, we are in the next second. > * First try unlocked read, and then proceed with atomic. The normal way writing this is '(u_int)(now - cr->cr_ticks) >= hz'. Networking code has hundreds of examples of this just in the SEQ_* macros. The SEQ_*() macros handle signed differences of unsigned sequence numbers. Sequence numbers that need to be compared must be kept closer together than their full unsigned range for this to work. Here we want unsigned difference of (bogusly) signed tick counts, and the full unsigned range is available, but was not used (giving large bugs). The tick counts are usually kept close together by resetting cr_ticks often, but when this function is not called for a long time (~2**31 ticks) cr_ticks has not been reset, and then the check for resetting it remains broken for another long time (~2**31 ticks). Overflow of 'ticks' itself eventually accidentally fixes the brokenness of the check. The cycle repeats every 2**32 ticks. The only correct (not so quick) ways to fix this are to enlarge tick counters so that overflow never occurs, or to arrange to call this function more often (for every counter). Otherwise, undetectable wrap occurs whenever the function is not called for 2**32 ticks. Then further calls are incorrectly rate-limited for the next second. With hz = 1000, this only happens every 49.7 days, so isn't much of a problem. This commit fixes the larger problem that detectable but undetected overflow occurs whenever the function is not called for 2**31 ticks. Then further calls are incorrectly rate-limited for the next 2**31 ticks, With hz = 1000, this gives 24.8 days of brokeness which is too much. But using abs() only works accidentally. It gives 2 more intervals of brokenness every 2**32 ticks. These intervals happen to be short, so aren't much of a problem, but understanding this is harder: - when the unsigned difference (mod 2**32) is INT32_MAX + 1U, the signed difference is INT32_MIN. abs() on this overflows to INT32_MIN. The check misclassifies this and gives another tick of rate limiting every cycle. 1 tick of brokenness is not very long. - when the unsigned difference (mod 2**32) is >= UINT32_MAX - hz and <= UINT32_MAX, the signed difference is >= 1 - hz and <= -1. abs() on this gives a value between 1 and hz - 1. The check misclassifies this and gives another tick of rate limiting every cycle. abs() essentially gives a complement of the correct value, and the range here is almost a reflection of the range from 2**32 to 2**32 + hz - 1 starting 1 tick higher. 1 second (less 1 tick) of brokenness is a bit too long, but we already have to put up with 1 second of brokenness after undetectable wrap. - when the unsigned difference (mod 2**32) is >= INT32_MAX + 2U and < UINT32_MAX - hz, the value given by abs() happens to be >= hz, so the check accidentally does the correct classification. This fixes most broken cases. Bruce From owner-svn-src-head@freebsd.org Sat Jun 16 05:58:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CA92100B23D; Sat, 16 Jun 2018 05:58:34 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BBCCF75ADF; Sat, 16 Jun 2018 05:58:33 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9CFD722542; Sat, 16 Jun 2018 05:58:33 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5G5wXPH031478; Sat, 16 Jun 2018 05:58:33 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5G5wXxc031477; Sat, 16 Jun 2018 05:58:33 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201806160558.w5G5wXxc031477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sat, 16 Jun 2018 05:58:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335247 - head/stand/i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: head/stand/i386/libi386 X-SVN-Commit-Revision: 335247 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2018 05:58:34 -0000 Author: allanjude Date: Sat Jun 16 05:58:33 2018 New Revision: 335247 URL: https://svnweb.freebsd.org/changeset/base/335247 Log: biosdisk.c: add missing \n to error message Sponsored by: Klara Systems Modified: head/stand/i386/libi386/biosdisk.c Modified: head/stand/i386/libi386/biosdisk.c ============================================================================== --- head/stand/i386/libi386/biosdisk.c Sat Jun 16 04:50:40 2018 (r335246) +++ head/stand/i386/libi386/biosdisk.c Sat Jun 16 05:58:33 2018 (r335247) @@ -619,7 +619,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s if (blks && (rc = bd_read(dev, dblk, blks, buf))) { /* Filter out floppy controller errors */ if (BD(dev).bd_flags != BD_FLOPPY || rc != 0x20) { - printf("read %d from %lld to %p, error: 0x%x", blks, dblk, + printf("read %d from %lld to %p, error: 0x%x\n", blks, dblk, buf, rc); } return (EIO); From owner-svn-src-head@freebsd.org Sat Jun 16 06:23:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68921100BB56; Sat, 16 Jun 2018 06:23:08 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1AB87766D6; Sat, 16 Jun 2018 06:23:08 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF72622A19; Sat, 16 Jun 2018 06:23:07 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5G6N71b046584; Sat, 16 Jun 2018 06:23:07 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5G6N7qK046583; Sat, 16 Jun 2018 06:23:07 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201806160623.w5G6N7qK046583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sat, 16 Jun 2018 06:23:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335248 - head/stand/i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: head/stand/i386/libi386 X-SVN-Commit-Revision: 335248 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2018 06:23:08 -0000 Author: allanjude Date: Sat Jun 16 06:23:07 2018 New Revision: 335248 URL: https://svnweb.freebsd.org/changeset/base/335248 Log: biosdisk.c: fix type in debug printf Sponsored by: Klara Systems Modified: head/stand/i386/libi386/biosdisk.c Modified: head/stand/i386/libi386/biosdisk.c ============================================================================== --- head/stand/i386/libi386/biosdisk.c Sat Jun 16 05:58:33 2018 (r335247) +++ head/stand/i386/libi386/biosdisk.c Sat Jun 16 06:23:07 2018 (r335248) @@ -635,7 +635,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s #endif break; case F_WRITE : - DEBUG("write %d from %d to %p", blks, dblk, buf); + DEBUG("write %d from %lld to %p", blks, dblk, buf); if (blks && bd_write(dev, dblk, blks, buf)) { DEBUG("write error"); From owner-svn-src-head@freebsd.org Sat Jun 16 08:25:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9ACFC100E75C; Sat, 16 Jun 2018 08:25:39 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 51B3C796C0; Sat, 16 Jun 2018 08:25:39 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 32CB623D92; Sat, 16 Jun 2018 08:25:39 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5G8PdUF008040; Sat, 16 Jun 2018 08:25:39 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5G8PcE7008038; Sat, 16 Jun 2018 08:25:38 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201806160825.w5G8PcE7008038@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sat, 16 Jun 2018 08:25:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335249 - head/sys/dev/extres/regulator X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/sys/dev/extres/regulator X-SVN-Commit-Revision: 335249 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2018 08:25:39 -0000 Author: mmel Date: Sat Jun 16 08:25:38 2018 New Revision: 335249 URL: https://svnweb.freebsd.org/changeset/base/335249 Log: Fix handling of enable counter for shared GPIO line in fixed regulator. For most regulators, the regulator_stop() method can be transformed to regulator disable. But, in some cases, we needs to maintain shared data across multiple regulators (e.g. single GPIO pin which works as enable for multiple regulates). In this case, the implementation of regulator should perform his own enable counting therefore it is necessary to distinguish between the regulator enable/disable method (which increments/decrements enable counter for shared resource) and regulator stop method (which don't affect it). So: - add regnode_stop() method to regulator framework and default it to regnode_enable(..., false, ...) - implement it in regulator_fixed with proper enable counting. While I'm in, also fix handling of always_on property. If any of regulators sharing same GPIO pin have it enabled, then none of them can disable regulator. Tested by: kevans MFC after: 3 weeks Modified: head/sys/dev/extres/regulator/regnode_if.m head/sys/dev/extres/regulator/regulator.c head/sys/dev/extres/regulator/regulator_fixed.c Modified: head/sys/dev/extres/regulator/regnode_if.m ============================================================================== --- head/sys/dev/extres/regulator/regnode_if.m Sat Jun 16 06:23:07 2018 (r335248) +++ head/sys/dev/extres/regulator/regnode_if.m Sat Jun 16 08:25:38 2018 (r335249) @@ -31,6 +31,15 @@ HEADER { struct regnode; } +CODE { + static int + regnode_default_stop(struct regnode *regnode, int *udelay) + { + + return(REGNODE_ENABLE(regnode, false, udelay)); + } +} + # # Initialize regulator # Returns 0 on success or a standard errno value. @@ -80,3 +89,12 @@ METHOD int get_voltage { struct regnode *regnode; int *uvolt; }; + +# +# Stop (shutdown) regulator +# Returns 0 on success or a standard errno value. +# +METHOD int stop { + struct regnode *regnode; + int *udelay; +} DEFAULT regnode_default_stop; Modified: head/sys/dev/extres/regulator/regulator.c ============================================================================== --- head/sys/dev/extres/regulator/regulator.c Sat Jun 16 06:23:07 2018 (r335248) +++ head/sys/dev/extres/regulator/regulator.c Sat Jun 16 08:25:38 2018 (r335249) @@ -636,7 +636,7 @@ regnode_stop(struct regnode *regnode, int depth) /* Disable regulator for each node in chain, starting from consumer */ if ((regnode->enable_cnt == 0) && ((regnode->flags & REGULATOR_FLAGS_NOT_DISABLE) == 0)) { - rv = REGNODE_ENABLE(regnode, false, &udelay); + rv = REGNODE_STOP(regnode, &udelay); if (rv != 0) { REGNODE_UNLOCK(regnode); return (rv); @@ -648,7 +648,7 @@ regnode_stop(struct regnode *regnode, int depth) rv = regnode_resolve_parent(regnode); if (rv != 0) return (rv); - if (regnode->parent != NULL) + if (regnode->parent != NULL && regnode->parent->enable_cnt == 0) rv = regnode_stop(regnode->parent, depth + 1); return (rv); } Modified: head/sys/dev/extres/regulator/regulator_fixed.c ============================================================================== --- head/sys/dev/extres/regulator/regulator_fixed.c Sat Jun 16 06:23:07 2018 (r335248) +++ head/sys/dev/extres/regulator/regulator_fixed.c Sat Jun 16 08:25:38 2018 (r335249) @@ -56,6 +56,7 @@ struct gpio_entry { struct gpiobus_pin gpio_pin; int use_cnt; int enable_cnt; + bool always_on; }; static gpio_list_t gpio_list = TAILQ_HEAD_INITIALIZER(gpio_list); static struct mtx gpio_list_mtx; @@ -71,12 +72,14 @@ static int regnode_fixed_init(struct regnode *regnode) static int regnode_fixed_enable(struct regnode *regnode, bool enable, int *udelay); static int regnode_fixed_status(struct regnode *regnode, int *status); +static int regnode_fixed_stop(struct regnode *regnode, int *udelay); static regnode_method_t regnode_fixed_methods[] = { /* Regulator interface */ REGNODEMETHOD(regnode_init, regnode_fixed_init), REGNODEMETHOD(regnode_enable, regnode_fixed_enable), REGNODEMETHOD(regnode_status, regnode_fixed_status), + REGNODEMETHOD(regnode_stop, regnode_fixed_stop), REGNODEMETHOD_END }; DEFINE_CLASS_1(regnode_fixed, regnode_fixed_class, regnode_fixed_methods, @@ -188,8 +191,6 @@ regnode_fixed_enable(struct regnode *regnode, bool ena dev = regnode_get_device(regnode); *udelay = 0; - if (sc->param->always_on && !enable) - return (0); if (sc->gpio_entry == NULL) return (0); pin = &sc->gpio_entry->gpio_pin; @@ -204,6 +205,8 @@ regnode_fixed_enable(struct regnode *regnode, bool ena if (sc->gpio_entry->enable_cnt >= 1) return (0); } + if (sc->gpio_entry->always_on && !enable) + return (0); if (!sc->param->enable_active_high) enable = !enable; rv = GPIO_PIN_SET(pin->dev, pin->pin, enable); @@ -215,7 +218,43 @@ regnode_fixed_enable(struct regnode *regnode, bool ena return (0); } +/* + * Stop (physicaly shutdown) regulator. + * Take shared GPIO pins in account + */ static int +regnode_fixed_stop(struct regnode *regnode, int *udelay) +{ + device_t dev; + struct regnode_fixed_sc *sc; + struct gpiobus_pin *pin; + int rv; + + sc = regnode_get_softc(regnode); + dev = regnode_get_device(regnode); + + *udelay = 0; + if (sc->gpio_entry == NULL) + return (0); + if (sc->gpio_entry->always_on) + return (0); + pin = &sc->gpio_entry->gpio_pin; + if (sc->gpio_entry->enable_cnt > 0) { + /* Other regulator(s) are enabled. */ + /* XXXX Any diagnostic message? Or error? */ + return (0); + } + rv = GPIO_PIN_SET(pin->dev, pin->pin, + sc->param->enable_active_high ? false: true); + if (rv != 0) { + device_printf(dev, "Cannot set GPIO pin: %d\n", pin->pin); + return (rv); + } + *udelay = sc->param->enable_delay; + return (0); +} + +static int regnode_fixed_status(struct regnode *regnode, int *status) { struct regnode_fixed_sc *sc; @@ -264,6 +303,10 @@ regnode_fixed_register(device_t dev, struct regnode_fi device_printf(dev, "Cannot register regulator.\n"); return(ENXIO); } + + if (sc->gpio_entry != NULL) + sc->gpio_entry->always_on |= sc->param->always_on; + return (0); } From owner-svn-src-head@freebsd.org Sat Jun 16 08:26:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D3E7100E7A8; Sat, 16 Jun 2018 08:26:27 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E6A67797E4; Sat, 16 Jun 2018 08:26:26 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C79CD23D93; Sat, 16 Jun 2018 08:26:26 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5G8QQxb008128; Sat, 16 Jun 2018 08:26:26 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5G8QOLU008115; Sat, 16 Jun 2018 08:26:24 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201806160826.w5G8QOLU008115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sat, 16 Jun 2018 08:26:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335250 - in head/sys: kern net netinet netinet6 netpfil/ipfw nfs X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in head/sys: kern net netinet netinet6 netpfil/ipfw nfs X-SVN-Commit-Revision: 335250 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2018 08:26:27 -0000 Author: ae Date: Sat Jun 16 08:26:23 2018 New Revision: 335250 URL: https://svnweb.freebsd.org/changeset/base/335250 Log: Switch RIB and RADIX_NODE_HEAD lock from rwlock(9) to rmlock(9). Using of rwlock with multiqueue NICs for IP forwarding on high pps produces high lock contention and inefficient. Rmlock fits better for such workloads. Reviewed by: melifaro, olivier Obtained from: Yandex LLC Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D15789 Modified: head/sys/kern/subr_witness.c head/sys/kern/vfs_export.c head/sys/net/radix.c head/sys/net/radix.h head/sys/net/radix_mpath.c head/sys/net/route.c head/sys/net/route_var.h head/sys/net/rtsock.c head/sys/netinet/in_fib.c head/sys/netinet6/in6_fib.c head/sys/netpfil/ipfw/ip_fw_table_algo.c head/sys/nfs/bootp_subr.c Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Sat Jun 16 08:25:38 2018 (r335249) +++ head/sys/kern/subr_witness.c Sat Jun 16 08:26:23 2018 (r335250) @@ -524,7 +524,7 @@ static struct witness_order_list_entry order_lists[] = * Routing */ { "so_rcv", &lock_class_mtx_sleep }, - { "radix node head", &lock_class_rw }, + { "radix node head", &lock_class_rm }, { "rtentry", &lock_class_mtx_sleep }, { "ifaddr", &lock_class_mtx_sleep }, { NULL, NULL }, Modified: head/sys/kern/vfs_export.c ============================================================================== --- head/sys/kern/vfs_export.c Sat Jun 16 08:25:38 2018 (r335249) +++ head/sys/kern/vfs_export.c Sat Jun 16 08:26:23 2018 (r335250) @@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include @@ -449,6 +449,7 @@ vfs_setpublicfs(struct mount *mp, struct netexport *ne static struct netcred * vfs_export_lookup(struct mount *mp, struct sockaddr *nam) { + RADIX_NODE_HEAD_RLOCK_TRACKER; struct netexport *nep; struct netcred *np = NULL; struct radix_node_head *rnh; Modified: head/sys/net/radix.c ============================================================================== --- head/sys/net/radix.c Sat Jun 16 08:25:38 2018 (r335249) +++ head/sys/net/radix.c Sat Jun 16 08:26:23 2018 (r335250) @@ -39,7 +39,7 @@ #ifdef _KERNEL #include #include -#include +#include #include #include #include Modified: head/sys/net/radix.h ============================================================================== --- head/sys/net/radix.h Sat Jun 16 08:25:38 2018 (r335249) +++ head/sys/net/radix.h Sat Jun 16 08:26:23 2018 (r335250) @@ -38,7 +38,7 @@ #ifdef _KERNEL #include #include -#include +#include #endif #ifdef MALLOC_DECLARE @@ -138,7 +138,7 @@ struct radix_node_head { rn_close_t *rnh_close; /*do something when the last ref drops*/ struct radix_node rnh_nodes[3]; /* empty tree for common case */ #ifdef _KERNEL - struct rwlock rnh_lock; /* locks entire radix tree */ + struct rmlock rnh_lock; /* locks entire radix tree */ #endif }; @@ -159,18 +159,18 @@ void rn_inithead_internal(struct radix_head *rh, struc #define R_Zalloc(p, t, n) (p = (t) malloc((unsigned long)(n), M_RTABLE, M_NOWAIT | M_ZERO)) #define R_Free(p) free((caddr_t)p, M_RTABLE); +#define RADIX_NODE_HEAD_RLOCK_TRACKER struct rm_priotracker _rhn_tracker #define RADIX_NODE_HEAD_LOCK_INIT(rnh) \ - rw_init_flags(&(rnh)->rnh_lock, "radix node head", 0) -#define RADIX_NODE_HEAD_LOCK(rnh) rw_wlock(&(rnh)->rnh_lock) -#define RADIX_NODE_HEAD_UNLOCK(rnh) rw_wunlock(&(rnh)->rnh_lock) -#define RADIX_NODE_HEAD_RLOCK(rnh) rw_rlock(&(rnh)->rnh_lock) -#define RADIX_NODE_HEAD_RUNLOCK(rnh) rw_runlock(&(rnh)->rnh_lock) -#define RADIX_NODE_HEAD_LOCK_TRY_UPGRADE(rnh) rw_try_upgrade(&(rnh)->rnh_lock) - - -#define RADIX_NODE_HEAD_DESTROY(rnh) rw_destroy(&(rnh)->rnh_lock) -#define RADIX_NODE_HEAD_LOCK_ASSERT(rnh) rw_assert(&(rnh)->rnh_lock, RA_LOCKED) -#define RADIX_NODE_HEAD_WLOCK_ASSERT(rnh) rw_assert(&(rnh)->rnh_lock, RA_WLOCKED) + rm_init(&(rnh)->rnh_lock, "radix node head") +#define RADIX_NODE_HEAD_LOCK(rnh) rm_wlock(&(rnh)->rnh_lock) +#define RADIX_NODE_HEAD_UNLOCK(rnh) rm_wunlock(&(rnh)->rnh_lock) +#define RADIX_NODE_HEAD_RLOCK(rnh) rm_rlock(&(rnh)->rnh_lock,\ + &_rhn_tracker) +#define RADIX_NODE_HEAD_RUNLOCK(rnh) rm_runlock(&(rnh)->rnh_lock,\ + &_rhn_tracker) +#define RADIX_NODE_HEAD_DESTROY(rnh) rm_destroy(&(rnh)->rnh_lock) +#define RADIX_NODE_HEAD_LOCK_ASSERT(rnh) rm_assert(&(rnh)->rnh_lock, RA_LOCKED) +#define RADIX_NODE_HEAD_WLOCK_ASSERT(rnh) rm_assert(&(rnh)->rnh_lock, RA_WLOCKED) #endif /* _KERNEL */ int rn_inithead(void **, int); Modified: head/sys/net/radix_mpath.c ============================================================================== --- head/sys/net/radix_mpath.c Sat Jun 16 08:25:38 2018 (r335249) +++ head/sys/net/radix_mpath.c Sat Jun 16 08:26:23 2018 (r335250) @@ -43,12 +43,15 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include #include #include #include #include #include +#include #include #include #include Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Sat Jun 16 08:25:38 2018 (r335249) +++ head/sys/net/route.c Sat Jun 16 08:26:23 2018 (r335250) @@ -54,6 +54,8 @@ #include #include #include +#include +#include #include #include @@ -440,6 +442,7 @@ struct rtentry * rtalloc1_fib(struct sockaddr *dst, int report, u_long ignflags, u_int fibnum) { + RIB_RLOCK_TRACKER; struct rib_head *rh; struct radix_node *rn; struct rtentry *newrt; @@ -923,6 +926,7 @@ int rib_lookup_info(uint32_t fibnum, const struct sockaddr *dst, uint32_t flags, uint32_t flowid, struct rt_addrinfo *info) { + RIB_RLOCK_TRACKER; struct rib_head *rh; struct radix_node *rn; struct rtentry *rt; @@ -1944,6 +1948,7 @@ rt_maskedcopy(struct sockaddr *src, struct sockaddr *d static inline int rtinit1(struct ifaddr *ifa, int cmd, int flags, int fibnum) { + RIB_RLOCK_TRACKER; struct sockaddr *dst; struct sockaddr *netmask; struct rtentry *rt = NULL; Modified: head/sys/net/route_var.h ============================================================================== --- head/sys/net/route_var.h Sat Jun 16 08:25:38 2018 (r335249) +++ head/sys/net/route_var.h Sat Jun 16 08:26:23 2018 (r335250) @@ -44,18 +44,19 @@ struct rib_head { rt_gen_t rnh_gen; /* generation counter */ int rnh_multipath; /* multipath capable ? */ struct radix_node rnh_nodes[3]; /* empty tree for common case */ - struct rwlock rib_lock; /* config/data path lock */ + struct rmlock rib_lock; /* config/data path lock */ struct radix_mask_head rmhead; /* masks radix head */ }; -#define RIB_LOCK_INIT(rh) rw_init(&(rh)->rib_lock, "rib head lock") -#define RIB_LOCK_DESTROY(rh) rw_destroy(&(rh)->rib_lock) -#define RIB_RLOCK(rh) rw_rlock(&(rh)->rib_lock) -#define RIB_RUNLOCK(rh) rw_runlock(&(rh)->rib_lock) -#define RIB_WLOCK(rh) rw_wlock(&(rh)->rib_lock) -#define RIB_WUNLOCK(rh) rw_wunlock(&(rh)->rib_lock) -#define RIB_LOCK_ASSERT(rh) rw_assert(&(rh)->rib_lock, RA_LOCKED) -#define RIB_WLOCK_ASSERT(rh) rw_assert(&(rh)->rib_lock, RA_WLOCKED) +#define RIB_RLOCK_TRACKER struct rm_priotracker _rib_tracker +#define RIB_LOCK_INIT(rh) rm_init(&(rh)->rib_lock, "rib head lock") +#define RIB_LOCK_DESTROY(rh) rm_destroy(&(rh)->rib_lock) +#define RIB_RLOCK(rh) rm_rlock(&(rh)->rib_lock, &_rib_tracker) +#define RIB_RUNLOCK(rh) rm_runlock(&(rh)->rib_lock, &_rib_tracker) +#define RIB_WLOCK(rh) rm_wlock(&(rh)->rib_lock) +#define RIB_WUNLOCK(rh) rm_wunlock(&(rh)->rib_lock) +#define RIB_LOCK_ASSERT(rh) rm_assert(&(rh)->rib_lock, RA_LOCKED) +#define RIB_WLOCK_ASSERT(rh) rm_assert(&(rh)->rib_lock, RA_WLOCKED) struct rib_head *rt_tables_get_rnh(int fib, int family); Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Sat Jun 16 08:25:38 2018 (r335249) +++ head/sys/net/rtsock.c Sat Jun 16 08:26:23 2018 (r335250) @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -542,6 +543,7 @@ rtm_get_jailed(struct rt_addrinfo *info, struct ifnet static int route_output(struct mbuf *m, struct socket *so, ...) { + RIB_RLOCK_TRACKER; struct rt_msghdr *rtm = NULL; struct rtentry *rt = NULL; struct rib_head *rnh; @@ -1850,6 +1852,7 @@ sysctl_ifmalist(int af, struct walkarg *w) static int sysctl_rtsock(SYSCTL_HANDLER_ARGS) { + RIB_RLOCK_TRACKER; int *name = (int *)arg1; u_int namelen = arg2; struct rib_head *rnh = NULL; /* silence compiler. */ Modified: head/sys/netinet/in_fib.c ============================================================================== --- head/sys/netinet/in_fib.c Sat Jun 16 08:25:38 2018 (r335249) +++ head/sys/netinet/in_fib.c Sat Jun 16 08:26:23 2018 (r335250) @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include @@ -134,6 +134,7 @@ int fib4_lookup_nh_basic(uint32_t fibnum, struct in_addr dst, uint32_t flags, uint32_t flowid, struct nhop4_basic *pnh4) { + RIB_RLOCK_TRACKER; struct rib_head *rh; struct radix_node *rn; struct sockaddr_in sin; @@ -182,6 +183,7 @@ int fib4_lookup_nh_ext(uint32_t fibnum, struct in_addr dst, uint32_t flags, uint32_t flowid, struct nhop4_extended *pnh4) { + RIB_RLOCK_TRACKER; struct rib_head *rh; struct radix_node *rn; struct sockaddr_in sin; Modified: head/sys/netinet6/in6_fib.c ============================================================================== --- head/sys/netinet6/in6_fib.c Sat Jun 16 08:25:38 2018 (r335249) +++ head/sys/netinet6/in6_fib.c Sat Jun 16 08:26:23 2018 (r335250) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include @@ -171,6 +171,7 @@ int fib6_lookup_nh_basic(uint32_t fibnum, const struct in6_addr *dst, uint32_t scopeid, uint32_t flags, uint32_t flowid, struct nhop6_basic *pnh6) { + RIB_RLOCK_TRACKER; struct rib_head *rh; struct radix_node *rn; struct sockaddr_in6 sin6; @@ -220,6 +221,7 @@ int fib6_lookup_nh_ext(uint32_t fibnum, const struct in6_addr *dst,uint32_t scopeid, uint32_t flags, uint32_t flowid, struct nhop6_extended *pnh6) { + RIB_RLOCK_TRACKER; struct rib_head *rh; struct radix_node *rn; struct sockaddr_in6 sin6; Modified: head/sys/netpfil/ipfw/ip_fw_table_algo.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_table_algo.c Sat Jun 16 08:25:38 2018 (r335249) +++ head/sys/netpfil/ipfw/ip_fw_table_algo.c Sat Jun 16 08:26:23 2018 (r335250) @@ -4047,6 +4047,7 @@ static void ta_foreach_kfib(void *ta_state, struct table_info *ti, ta_foreach_f *f, void *arg) { + RIB_RLOCK_TRACKER; struct rib_head *rh; int error; Modified: head/sys/nfs/bootp_subr.c ============================================================================== --- head/sys/nfs/bootp_subr.c Sat Jun 16 08:25:38 2018 (r335249) +++ head/sys/nfs/bootp_subr.c Sat Jun 16 08:26:23 2018 (r335250) @@ -376,6 +376,7 @@ bootpboot_p_tree(struct radix_node *rn) void bootpboot_p_rtlist(void) { + RIB_RLOCK_TRACKER; struct rib_head *rnh; printf("Routing table:\n"); From owner-svn-src-head@freebsd.org Sat Jun 16 14:57:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CF671018D22; Sat, 16 Jun 2018 14:57:45 +0000 (UTC) (envelope-from lidl@pix.net) Received: from hydra.pix.net (hydra.pix.net [IPv6:2001:470:e254::4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.pix.net", Issuer "Pix.Com Technologies LLC CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E252B8419B; Sat, 16 Jun 2018 14:57:44 +0000 (UTC) (envelope-from lidl@pix.net) Received: from torb.pix.net (torb.pix.net [192.168.16.32]) (authenticated bits=0) by hydra.pix.net (8.15.2/8.15.2) with ESMTPA id w5GEvic0034848; Sat, 16 Jun 2018 10:57:44 -0400 (EDT) (envelope-from lidl@pix.net) Subject: Re: svn commit: r334947 - head/sys/modules To: Dimitry Andric , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201806110842.w5B8g4we013345@repo.freebsd.org> From: Kurt Lidl Message-ID: Date: Sat, 16 Jun 2018 10:57:44 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <201806110842.w5B8g4we013345@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2018 14:57:45 -0000 On 6/11/18 4:42 AM, Dimitry Andric wrote: > Author: dim > Date: Mon Jun 11 08:42:03 2018 > New Revision: 334947 > URL: https://svnweb.freebsd.org/changeset/base/334947 > > Log: > Disable building aesni with base gcc > > Because base gcc does not support the required intrinsics, do not > attempt to compile the aesni module with it. > > Noticed by: Dan Allen > MFC after: 3 days > > Modified: > head/sys/modules/Makefile > > Modified: head/sys/modules/Makefile > ============================================================================== > --- head/sys/modules/Makefile Mon Jun 11 08:11:35 2018 (r334946) > +++ head/sys/modules/Makefile Mon Jun 11 08:42:03 2018 (r334947) > @@ -627,7 +627,9 @@ _aac= aac > _aacraid= aacraid > _acpi= acpi > .if ${MK_CRYPT} != "no" || defined(ALL_MODULES) > +.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} > 40201 > _aesni= aesni > +.endif > .endif > _amd_ecc_inject=amd_ecc_inject > _amdsbwd= amdsbwd > I thought that FreeBSD's base gcc (but not a stock 4.2.1 gcc) had support for this. As documented in UPDATING: 20130903: AES-NI intrinsic support has been added to gcc. The AES-NI module has been updated to use this support. A new gcc is required to build the aesni module on both i386 and amd64. -Kurt From owner-svn-src-head@freebsd.org Sat Jun 16 15:05:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 326141019018; Sat, 16 Jun 2018 15:05:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CF14E846BD; Sat, 16 Jun 2018 15:05:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD34927E60; Sat, 16 Jun 2018 15:05:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5GF5HuU012891; Sat, 16 Jun 2018 15:05:17 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5GF56qH012827; Sat, 16 Jun 2018 15:05:06 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201806161505.w5GF56qH012827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 16 Jun 2018 15:05:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335253 - in head: . contrib/ofed contrib/ofed/include contrib/ofed/infiniband-diags/build contrib/ofed/libcxgb4 contrib/ofed/libibcm contrib/ofed/libibmad contrib/ofed/libibnetdisc con... X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: . contrib/ofed contrib/ofed/include contrib/ofed/infiniband-diags/build contrib/ofed/libcxgb4 contrib/ofed/libibcm contrib/ofed/libibmad contrib/ofed/libibnetdisc contrib/ofed/libibumad contr... X-SVN-Commit-Revision: 335253 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2018 15:05:18 -0000 Author: kib Date: Sat Jun 16 15:05:05 2018 New Revision: 335253 URL: https://svnweb.freebsd.org/changeset/base/335253 Log: Rework ofed build. Aligns the build with the FreeBSD traditional approach to not build in contrib/, and to track inter-dependencies between libraries. With help from: bdrewery Reviewed by: bdrewery, hselasky Sponsored by: Mellanox Technologies MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D15648 Added: head/lib/ofed/ head/lib/ofed/Makefile (contents, props changed) head/lib/ofed/Makefile.inc (contents, props changed) head/lib/ofed/complib/ head/lib/ofed/complib/Makefile - copied, changed from r335252, head/contrib/ofed/opensm/complib/Makefile head/lib/ofed/include/ head/lib/ofed/include/Makefile - copied, changed from r335252, head/contrib/ofed/include/Makefile head/lib/ofed/libcxgb4/ head/lib/ofed/libcxgb4/Makefile - copied, changed from r335252, head/contrib/ofed/libcxgb4/Makefile head/lib/ofed/libibcm/ head/lib/ofed/libibcm/Makefile - copied, changed from r335252, head/contrib/ofed/libibcm/Makefile head/lib/ofed/libibmad/ head/lib/ofed/libibmad/Makefile - copied, changed from r335252, head/contrib/ofed/libibmad/Makefile head/lib/ofed/libibnetdisc/ head/lib/ofed/libibnetdisc/Makefile - copied, changed from r335252, head/contrib/ofed/libibnetdisc/Makefile head/lib/ofed/libibumad/ head/lib/ofed/libibumad/Makefile - copied, changed from r335252, head/contrib/ofed/libibumad/Makefile head/lib/ofed/libibverbs/ head/lib/ofed/libibverbs/Makefile - copied, changed from r335252, head/contrib/ofed/libibverbs/Makefile head/lib/ofed/libmlx4/ head/lib/ofed/libmlx4/Makefile - copied, changed from r335252, head/contrib/ofed/libmlx4/Makefile head/lib/ofed/libmlx5/ head/lib/ofed/libmlx5/Makefile - copied, changed from r335252, head/contrib/ofed/libmlx5/Makefile head/lib/ofed/libopensm/ head/lib/ofed/libopensm/Makefile - copied, changed from r335252, head/contrib/ofed/opensm/libopensm/Makefile head/lib/ofed/librdmacm/ head/lib/ofed/librdmacm/Makefile - copied, changed from r335252, head/contrib/ofed/librdmacm/Makefile head/lib/ofed/libvendor/ head/lib/ofed/libvendor/Makefile - copied, changed from r335252, head/contrib/ofed/opensm/libvendor/Makefile head/usr.bin/ofed/ head/usr.bin/ofed/Makefile (contents, props changed) head/usr.bin/ofed/infiniband-diags/ head/usr.bin/ofed/infiniband-diags/Makefile - copied unchanged from r335252, head/contrib/ofed/infiniband-diags/build/Makefile head/usr.bin/ofed/infiniband-diags/Makefile.inc - copied, changed from r335252, head/contrib/ofed/infiniband-diags/build/Makefile.inc head/usr.bin/ofed/infiniband-diags/dump_fts/ head/usr.bin/ofed/infiniband-diags/dump_fts/Makefile - copied unchanged from r335252, head/contrib/ofed/infiniband-diags/build/dump_fts/Makefile head/usr.bin/ofed/infiniband-diags/ibaddr/ head/usr.bin/ofed/infiniband-diags/ibaddr/Makefile - copied unchanged from r335252, head/contrib/ofed/infiniband-diags/build/ibaddr/Makefile head/usr.bin/ofed/infiniband-diags/ibcacheedit/ head/usr.bin/ofed/infiniband-diags/ibcacheedit/Makefile - copied unchanged from r335252, head/contrib/ofed/infiniband-diags/build/ibcacheedit/Makefile head/usr.bin/ofed/infiniband-diags/ibccconfig/ head/usr.bin/ofed/infiniband-diags/ibccconfig/Makefile - copied unchanged from r335252, head/contrib/ofed/infiniband-diags/build/ibccconfig/Makefile head/usr.bin/ofed/infiniband-diags/ibccquery/ head/usr.bin/ofed/infiniband-diags/ibccquery/Makefile - copied unchanged from r335252, head/contrib/ofed/infiniband-diags/build/ibccquery/Makefile head/usr.bin/ofed/infiniband-diags/iblinkinfo/ head/usr.bin/ofed/infiniband-diags/iblinkinfo/Makefile - copied unchanged from r335252, head/contrib/ofed/infiniband-diags/build/iblinkinfo/Makefile head/usr.bin/ofed/infiniband-diags/ibmirror/ head/usr.bin/ofed/infiniband-diags/ibmirror/Makefile - copied unchanged from r335252, head/contrib/ofed/infiniband-diags/build/ibmirror/Makefile head/usr.bin/ofed/infiniband-diags/ibnetdiscover/ head/usr.bin/ofed/infiniband-diags/ibnetdiscover/Makefile - copied unchanged from r335252, head/contrib/ofed/infiniband-diags/build/ibnetdiscover/Makefile head/usr.bin/ofed/infiniband-diags/ibping/ head/usr.bin/ofed/infiniband-diags/ibping/Makefile - copied unchanged from r335252, head/contrib/ofed/infiniband-diags/build/ibping/Makefile head/usr.bin/ofed/infiniband-diags/ibportstate/ head/usr.bin/ofed/infiniband-diags/ibportstate/Makefile - copied unchanged from r335252, head/contrib/ofed/infiniband-diags/build/ibportstate/Makefile head/usr.bin/ofed/infiniband-diags/ibqueryerrors/ head/usr.bin/ofed/infiniband-diags/ibqueryerrors/Makefile - copied unchanged from r335252, head/contrib/ofed/infiniband-diags/build/ibqueryerrors/Makefile head/usr.bin/ofed/infiniband-diags/ibroute/ head/usr.bin/ofed/infiniband-diags/ibroute/Makefile - copied unchanged from r335252, head/contrib/ofed/infiniband-diags/build/ibroute/Makefile head/usr.bin/ofed/infiniband-diags/ibstat/ head/usr.bin/ofed/infiniband-diags/ibstat/Makefile - copied unchanged from r335252, head/contrib/ofed/infiniband-diags/build/ibstat/Makefile head/usr.bin/ofed/infiniband-diags/ibsysstat/ head/usr.bin/ofed/infiniband-diags/ibsysstat/Makefile - copied unchanged from r335252, head/contrib/ofed/infiniband-diags/build/ibsysstat/Makefile head/usr.bin/ofed/infiniband-diags/ibtracert/ head/usr.bin/ofed/infiniband-diags/ibtracert/Makefile - copied unchanged from r335252, head/contrib/ofed/infiniband-diags/build/ibtracert/Makefile head/usr.bin/ofed/infiniband-diags/perfquery/ head/usr.bin/ofed/infiniband-diags/perfquery/Makefile - copied unchanged from r335252, head/contrib/ofed/infiniband-diags/build/perfquery/Makefile head/usr.bin/ofed/infiniband-diags/saquery/ head/usr.bin/ofed/infiniband-diags/saquery/Makefile - copied unchanged from r335252, head/contrib/ofed/infiniband-diags/build/saquery/Makefile head/usr.bin/ofed/infiniband-diags/sminfo/ head/usr.bin/ofed/infiniband-diags/sminfo/Makefile - copied unchanged from r335252, head/contrib/ofed/infiniband-diags/build/sminfo/Makefile head/usr.bin/ofed/infiniband-diags/smpdump/ head/usr.bin/ofed/infiniband-diags/smpdump/Makefile - copied unchanged from r335252, head/contrib/ofed/infiniband-diags/build/smpdump/Makefile head/usr.bin/ofed/infiniband-diags/smpquery/ head/usr.bin/ofed/infiniband-diags/smpquery/Makefile - copied unchanged from r335252, head/contrib/ofed/infiniband-diags/build/smpquery/Makefile head/usr.bin/ofed/infiniband-diags/vendstat/ head/usr.bin/ofed/infiniband-diags/vendstat/Makefile - copied unchanged from r335252, head/contrib/ofed/infiniband-diags/build/vendstat/Makefile head/usr.bin/ofed/libibverbs/ head/usr.bin/ofed/libibverbs/Makefile - copied, changed from r335252, head/contrib/ofed/libibverbs/examples/build/Makefile head/usr.bin/ofed/libibverbs/Makefile.inc (contents, props changed) head/usr.bin/ofed/libibverbs/asyncwatch/ head/usr.bin/ofed/libibverbs/asyncwatch/Makefile - copied, changed from r335252, head/contrib/ofed/libibverbs/examples/build/asyncwatch/Makefile head/usr.bin/ofed/libibverbs/devices/ head/usr.bin/ofed/libibverbs/devices/Makefile - copied, changed from r335252, head/contrib/ofed/libibverbs/examples/build/devices/Makefile head/usr.bin/ofed/libibverbs/devinfo/ head/usr.bin/ofed/libibverbs/devinfo/Makefile - copied, changed from r335252, head/contrib/ofed/libibverbs/examples/build/devinfo/Makefile head/usr.bin/ofed/libibverbs/rc_pingpong/ head/usr.bin/ofed/libibverbs/rc_pingpong/Makefile - copied, changed from r335252, head/contrib/ofed/libibverbs/examples/build/rc_pingpong/Makefile head/usr.bin/ofed/libibverbs/srq_pingpong/ head/usr.bin/ofed/libibverbs/srq_pingpong/Makefile - copied, changed from r335252, head/contrib/ofed/libibverbs/examples/build/srq_pingpong/Makefile head/usr.bin/ofed/libibverbs/uc_pingpong/ head/usr.bin/ofed/libibverbs/uc_pingpong/Makefile - copied, changed from r335252, head/contrib/ofed/libibverbs/examples/build/uc_pingpong/Makefile head/usr.bin/ofed/libibverbs/ud_pingpong/ head/usr.bin/ofed/libibverbs/ud_pingpong/Makefile - copied, changed from r335252, head/contrib/ofed/libibverbs/examples/build/ud_pingpong/Makefile head/usr.bin/ofed/librdmacm/ head/usr.bin/ofed/librdmacm/Makefile - copied unchanged from r335252, head/contrib/ofed/librdmacm/examples/build/Makefile head/usr.bin/ofed/librdmacm/Makefile.inc (contents, props changed) head/usr.bin/ofed/librdmacm/mckey/ head/usr.bin/ofed/librdmacm/mckey/Makefile - copied, changed from r335252, head/contrib/ofed/librdmacm/examples/build/mckey/Makefile head/usr.bin/ofed/librdmacm/rping/ head/usr.bin/ofed/librdmacm/rping/Makefile - copied, changed from r335252, head/contrib/ofed/librdmacm/examples/build/rping/Makefile head/usr.bin/ofed/librdmacm/ucmatose/ head/usr.bin/ofed/librdmacm/ucmatose/Makefile - copied, changed from r335252, head/contrib/ofed/librdmacm/examples/build/ucmatose/Makefile head/usr.bin/ofed/librdmacm/udaddy/ head/usr.bin/ofed/librdmacm/udaddy/Makefile - copied, changed from r335252, head/contrib/ofed/librdmacm/examples/build/udaddy/Makefile head/usr.bin/ofed/opensm/ head/usr.bin/ofed/opensm/Makefile - copied, changed from r335252, head/contrib/ofed/opensm/opensm/Makefile Deleted: head/contrib/ofed/Makefile head/contrib/ofed/include/Makefile head/contrib/ofed/infiniband-diags/build/ head/contrib/ofed/libcxgb4/Makefile head/contrib/ofed/libibcm/Makefile head/contrib/ofed/libibmad/Makefile head/contrib/ofed/libibnetdisc/Makefile head/contrib/ofed/libibumad/Makefile head/contrib/ofed/libibverbs/Makefile head/contrib/ofed/libibverbs/examples/build/ head/contrib/ofed/libmlx4/Makefile head/contrib/ofed/libmlx5/Makefile head/contrib/ofed/librdmacm/Makefile head/contrib/ofed/librdmacm/examples/build/ head/contrib/ofed/opensm/complib/Makefile head/contrib/ofed/opensm/libopensm/ head/contrib/ofed/opensm/libvendor/Makefile head/contrib/ofed/opensm/opensm/Makefile head/contrib/ofed/usr.bin/ head/contrib/ofed/usr.lib/ Modified: head/Makefile.inc1 head/lib/Makefile head/share/mk/src.libnames.mk head/usr.bin/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat Jun 16 11:42:27 2018 (r335252) +++ head/Makefile.inc1 Sat Jun 16 15:05:05 2018 (r335253) @@ -274,9 +274,6 @@ SUBDIR+=sys usr.bin usr.sbin .if ${MK_TESTS} != "no" SUBDIR+= tests .endif -.if ${MK_OFED} != "no" -SUBDIR+=contrib/ofed -.endif # Local directories are built in parallel with the base system directories. # Users may insert a .WAIT directive at the beginning or elsewhere within @@ -2462,24 +2459,16 @@ _lib_libradius= lib/libradius .endif .if ${MK_OFED} != "no" -# -# The OFED libraries are built in four steps -# as reflected below, due to interdependencies. -# -# NOTE: Depending on contrib/ofed/include is only needed for -# the lib32 compat build. -# -_ofed_lib= \ -contrib/ofed/include \ -contrib/ofed/usr.lib/0 \ -contrib/ofed/usr.lib/1 \ -contrib/ofed/usr.lib/2 \ -contrib/ofed/usr.lib/3 +_prebuild_libs+= \ + lib/ofed/libibverbs \ + lib/ofed/libibmad \ + lib/ofed/libibumad \ + lib/ofed/complib \ + lib/ofed/libmlx5 -contrib/ofed/usr.lib/0__L: contrib/ofed/include__L lib/libthr__L -contrib/ofed/usr.lib/1__L: contrib/ofed/usr.lib/0__L -contrib/ofed/usr.lib/2__L: contrib/ofed/usr.lib/1__L -contrib/ofed/usr.lib/3__L: contrib/ofed/usr.lib/2__L +lib/ofed/libibmad__L: lib/ofed/libibumad__L +lib/ofed/complib__L: lib/libthr__L +lib/ofed/libmlx5__L: lib/ofed/libibverbs__L lib/libthr__L .endif .if ${MK_CASPER} != "no" @@ -2490,7 +2479,7 @@ lib/libpjdlog__L: lib/libutil__L lib/libcasper__L: lib/libnv__L lib/liblzma__L: lib/libthr__L -_generic_libs= ${_cddl_lib} gnu/lib ${_kerberos5_lib} lib ${_secure_lib} usr.bin/lex/lib ${_ofed_lib} +_generic_libs= ${_cddl_lib} gnu/lib ${_kerberos5_lib} lib ${_secure_lib} usr.bin/lex/lib .if ${MK_IPFILTER} != "no" _generic_libs+= sbin/ipf/libipf .endif Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Sat Jun 16 11:42:27 2018 (r335252) +++ head/lib/Makefile Sat Jun 16 15:05:05 2018 (r335253) @@ -67,7 +67,7 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \ libopie \ libpam \ libpathconv \ - ${_libpcap} \ + libpcap \ libpjdlog \ ${_libproc} \ libprocstat \ @@ -124,6 +124,9 @@ SUBDIR_DEPEND_libtacplus= libmd SUBDIR_DEPEND_libulog= libmd SUBDIR_DEPEND_libunbound= ${_libldns} SUBDIR_DEPEND_liblzma= ${_libthr} +.if ${MK_OFED} != "no" +SUBDIR_DEPEND_libpcap= ofed +.endif # NB: keep these sorted by MK_* knobs @@ -184,14 +187,6 @@ SUBDIR.${MK_PMC}+= libipt SUBDIR.${MK_BHYVE}+= libvmmapi .endif -.if ${MK_OFED} == "no" -# -# When OFED is enabled libpcap is built as part of -# OFED due to library dependencies -# -_libpcap= libpcap -.endif - .if ${MACHINE_CPUARCH} != "sparc64" _libproc= libproc _librtld_db= librtld_db @@ -212,6 +207,7 @@ SUBDIR.${MK_TESTS_SUPPORT}+= atf SUBDIR.${MK_TESTS}+= tests SUBDIR.${MK_UNBOUND}+= libunbound SUBDIR.${MK_USB}+= libusbhid libusb +SUBDIR.${MK_OFED}+= ofed .if !make(install) SUBDIR_PARALLEL= Added: head/lib/ofed/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/ofed/Makefile Sat Jun 16 15:05:05 2018 (r335253) @@ -0,0 +1,30 @@ +# $FreeBSD$ + +SUBDIR= \ + include \ + libibverbs \ + libibcm \ + libibumad \ + librdmacm \ + libibmad \ + complib \ + libvendor \ + libcxgb4 \ + libmlx4 \ + libmlx5 \ + libibnetdisc \ + libopensm + +SUBDIR_DEPEND_libibcm= libibverbs +SUBDIR_DEPEND_librdmacm= libibverbs +SUBDIR_DEPEND_libibmad= libibumad +SUBDIR_DEPEND_libvendor= libibumad +SUBDIR_DEPEND_libcxgb4= libibverbs +SUBDIR_DEPEND_libmlx4= libibverbs +SUBDIR_DEPEND_libmlx5= libibverbs +SUBDIR_DEPEND_libibnetdisc= libibmad libibumad complib + +SUBDIR_PARALLEL= + +.include + Added: head/lib/ofed/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/ofed/Makefile.inc Sat Jun 16 15:05:05 2018 (r335253) @@ -0,0 +1 @@ +# $FreeBSD$ Copied and modified: head/lib/ofed/complib/Makefile (from r335252, head/contrib/ofed/opensm/complib/Makefile) ============================================================================== --- head/contrib/ofed/opensm/complib/Makefile Sat Jun 16 11:42:27 2018 (r335252, copy source) +++ head/lib/ofed/complib/Makefile Sat Jun 16 15:05:05 2018 (r335253) @@ -1,6 +1,7 @@ # $FreeBSD$ -.PATH: ${.CURDIR} +_spath= ${SRCTOP}/contrib/ofed/opensm/complib +.PATH: ${_spath} SHLIBDIR?= /usr/lib LIB= osmcomp @@ -26,9 +27,9 @@ cl_timer.c \ cl_vector.c \ ib_statustext.c -CFLAGS+= -I${.CURDIR}/.. -DHAVE_CONFIG_H=1 +CFLAGS+= -I${_spath}/.. -DHAVE_CONFIG_H=1 CFLAGS+= -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/infiniband LIBADD= pthread -VERSION_MAP= ${.CURDIR}/libosmcomp.map +VERSION_MAP= ${_spath}/libosmcomp.map .include Copied and modified: head/lib/ofed/include/Makefile (from r335252, head/contrib/ofed/include/Makefile) ============================================================================== --- head/contrib/ofed/include/Makefile Sat Jun 16 11:42:27 2018 (r335252, copy source) +++ head/lib/ofed/include/Makefile Sat Jun 16 15:05:05 2018 (r335253) @@ -1,20 +1,21 @@ # $FreeBSD$ -IBVERBS= ${.CURDIR}/../libibverbs -IBMAD= ${.CURDIR}/../libibmad -IBUMAD= ${.CURDIR}/../libibumad -IBCM= ${.CURDIR}/../libibcm -IBND= ${.CURDIR}/../libibnetdisc -RDMACM= ${.CURDIR}/../librdmacm -RDMA= ${.CURDIR}/../../../sys/ofed/include/uapi/rdma -OSM= ${.CURDIR}/../opensm/include +OFEDINCS= ${SRCTOP}/contrib/ofed/include +IBVERBS= ${SRCTOP}/contrib/ofed/libibverbs +IBMAD= ${SRCTOP}/contrib/ofed/libibmad +IBUMAD= ${SRCTOP}/contrib/ofed/libibumad +IBCM= ${SRCTOP}/contrib/ofed/libibcm +IBND= ${SRCTOP}/contrib/ofed/libibnetdisc +RDMACM= ${SRCTOP}/contrib/ofed/librdmacm +RDMA= ${SRCTOP}/sys/ofed/include/uapi/rdma +OSM= ${SRCTOP}/contrib/ofed/opensm/include IBINCS= \ -byteorder.h \ -byteswap.h \ -endian.h \ -types.h \ -udma_barrier.h \ +${OFEDINCS}/byteorder.h \ +${OFEDINCS}/byteswap.h \ +${OFEDINCS}/endian.h \ +${OFEDINCS}/types.h \ +${OFEDINCS}/udma_barrier.h \ ${IBVERBS}/arch.h \ ${IBVERBS}/driver.h \ ${IBVERBS}/kern-abi.h \ Copied and modified: head/lib/ofed/libcxgb4/Makefile (from r335252, head/contrib/ofed/libcxgb4/Makefile) ============================================================================== --- head/contrib/ofed/libcxgb4/Makefile Sat Jun 16 11:42:27 2018 (r335252, copy source) +++ head/lib/ofed/libcxgb4/Makefile Sat Jun 16 15:05:05 2018 (r335253) @@ -1,6 +1,7 @@ # $FreeBSD$ -.PATH: ${.CURDIR} +_spath= ${SRCTOP}/contrib/ofed/libcxgb4 +.PATH: ${_spath} SHLIBDIR?= /usr/lib LIB= cxgb4 @@ -14,6 +15,6 @@ qp.c \ verbs.c LIBADD= ibverbs pthread -CFLAGS+= -I${.CURDIR} +CFLAGS+= -I${_spath} .include Copied and modified: head/lib/ofed/libibcm/Makefile (from r335252, head/contrib/ofed/libibcm/Makefile) ============================================================================== --- head/contrib/ofed/libibcm/Makefile Sat Jun 16 11:42:27 2018 (r335252, copy source) +++ head/lib/ofed/libibcm/Makefile Sat Jun 16 15:05:05 2018 (r335253) @@ -1,6 +1,7 @@ # $FreeBSD$ -.PATH: ${.CURDIR} +_spath= ${SRCTOP}/contrib/ofed/libibcm +.PATH: ${_spath} SHLIBDIR?= /usr/lib LIB= ibcm @@ -8,8 +9,8 @@ SHLIB_MAJOR= 1 MK_PROFILE= no SRCS= cm.c LIBADD= ibverbs -CFLAGS+= -I${.CURDIR} +CFLAGS+= -I${_spath} MAN= -VERSION_MAP= ${.CURDIR}/libibcm.map +VERSION_MAP= ${_spath}/libibcm.map .include Copied and modified: head/lib/ofed/libibmad/Makefile (from r335252, head/contrib/ofed/libibmad/Makefile) ============================================================================== --- head/contrib/ofed/libibmad/Makefile Sat Jun 16 11:42:27 2018 (r335252, copy source) +++ head/lib/ofed/libibmad/Makefile Sat Jun 16 15:05:05 2018 (r335253) @@ -1,6 +1,7 @@ # $FreeBSD$ -.PATH: ${.CURDIR} +_spath= ${SRCTOP}/contrib/ofed/libibmad +.PATH: ${_spath} SHLIBDIR?= /usr/lib LIB= ibmad @@ -25,8 +26,8 @@ vendor.c LIBADD= ibumad CFLAGS+= -DHAVE_CONFIG_H=1 -CFLAGS+= -I${.CURDIR} -VERSION_MAP= ${.CURDIR}/libibmad.map +CFLAGS+= -I${_spath} +VERSION_MAP= ${_spath}/libibmad.map .include Copied and modified: head/lib/ofed/libibnetdisc/Makefile (from r335252, head/contrib/ofed/libibnetdisc/Makefile) ============================================================================== --- head/contrib/ofed/libibnetdisc/Makefile Sat Jun 16 11:42:27 2018 (r335252, copy source) +++ head/lib/ofed/libibnetdisc/Makefile Sat Jun 16 15:05:05 2018 (r335253) @@ -2,7 +2,8 @@ .include -.PATH: ${.CURDIR} ${.CURDIR}/man +_spath= ${SRCTOP}/contrib/ofed/libibnetdisc +.PATH: ${_spath} ${_spath}/man SHLIBDIR?= /usr/lib LIB_CXX= ibnetdisc @@ -28,11 +29,11 @@ ibnd_show_progress.3 LIBADD= osmcomp ibmad ibumad CFLAGS+= -DHAVE_CONFIG_H=1 -CFLAGS+= -I${.CURDIR} +CFLAGS+= -I${_spath} CFLAGS+= -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/infiniband .if ${COMPILER_FEATURES:Mc++11} CXXFLAGS+= -std=c++11 .endif -VERSION_MAP= ${.CURDIR}/libibnetdisc.map +VERSION_MAP= ${_spath}/libibnetdisc.map .include Copied and modified: head/lib/ofed/libibumad/Makefile (from r335252, head/contrib/ofed/libibumad/Makefile) ============================================================================== --- head/contrib/ofed/libibumad/Makefile Sat Jun 16 11:42:27 2018 (r335252, copy source) +++ head/lib/ofed/libibumad/Makefile Sat Jun 16 15:05:05 2018 (r335253) @@ -1,6 +1,7 @@ # $FreeBSD$ -.PATH: ${.CURDIR} +_spath= ${SRCTOP}/contrib/ofed/libibumad +.PATH: ${_spath} SHLIBDIR?= /usr/lib LIB= ibumad @@ -10,7 +11,7 @@ SRCS= \ umad.c \ umad_str.c \ sysfs.c -CFLAGS+= -I${.CURDIR} -VERSION_MAP= ${.CURDIR}/libibumad.map +CFLAGS+= -I${_spath} +VERSION_MAP= ${_spath}/libibumad.map .include Copied and modified: head/lib/ofed/libibverbs/Makefile (from r335252, head/contrib/ofed/libibverbs/Makefile) ============================================================================== --- head/contrib/ofed/libibverbs/Makefile Sat Jun 16 11:42:27 2018 (r335252, copy source) +++ head/lib/ofed/libibverbs/Makefile Sat Jun 16 15:05:05 2018 (r335253) @@ -1,14 +1,15 @@ # $FreeBSD$ -.PATH: ${.CURDIR} ${.CURDIR}/man +_spath= ${SRCTOP}/contrib/ofed/libibverbs +.PATH: ${_spath} ${_spath}/man LIB= ibverbs SHLIB_MAJOR= 1 SHLIBDIR?= /usr/lib MK_PROFILE= no -VERSION_MAP= ${.CURDIR}/libibverbs.map +VERSION_MAP= ${_spath}/libibverbs.map -CFLAGS+= -I${.CURDIR} +CFLAGS+= -I${_spath} SRCS= \ cmd.c \ Copied and modified: head/lib/ofed/libmlx4/Makefile (from r335252, head/contrib/ofed/libmlx4/Makefile) ============================================================================== --- head/contrib/ofed/libmlx4/Makefile Sat Jun 16 11:42:27 2018 (r335252, copy source) +++ head/lib/ofed/libmlx4/Makefile Sat Jun 16 15:05:05 2018 (r335253) @@ -1,6 +1,7 @@ # $FreeBSD$ -.PATH: ${.CURDIR} +_spath= ${SRCTOP}/contrib/ofed/libmlx4 +.PATH: ${_spath} SHLIBDIR?= /usr/lib LIB= mlx4 @@ -17,6 +18,6 @@ srq.c \ verbs.c LIBADD= ibverbs pthread -CFLAGS+= -I${.CURDIR} +CFLAGS+= -I${_spath} .include Copied and modified: head/lib/ofed/libmlx5/Makefile (from r335252, head/contrib/ofed/libmlx5/Makefile) ============================================================================== --- head/contrib/ofed/libmlx5/Makefile Sat Jun 16 11:42:27 2018 (r335252, copy source) +++ head/lib/ofed/libmlx5/Makefile Sat Jun 16 15:05:05 2018 (r335253) @@ -1,6 +1,7 @@ # $FreeBSD$ -.PATH: ${.CURDIR} +_spath= ${SRCTOP}/contrib/ofed/libmlx5 +.PATH: ${_spath} SHLIBDIR?= /usr/lib LIB= mlx5 @@ -17,8 +18,8 @@ srq.c \ verbs.c LIBADD= ibverbs pthread -CFLAGS+= -I${.CURDIR} -VERSION_MAP= ${.CURDIR}/libmlx5.map +CFLAGS+= -I${_spath} +VERSION_MAP= ${_spath}/libmlx5.map .include Copied and modified: head/lib/ofed/libopensm/Makefile (from r335252, head/contrib/ofed/opensm/libopensm/Makefile) ============================================================================== --- head/contrib/ofed/opensm/libopensm/Makefile Sat Jun 16 11:42:27 2018 (r335252, copy source) +++ head/lib/ofed/libopensm/Makefile Sat Jun 16 15:05:05 2018 (r335253) @@ -1,6 +1,7 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../opensm +_spath= ${SRCTOP}/contrib/ofed/opensm/opensm +.PATH: ${_spath} SHLIBDIR?= /usr/lib LIB= opensm @@ -13,8 +14,8 @@ osm_mad_pool.c \ osm_helper.c LIBADD= pthread -CFLAGS+= -I${.CURDIR}/.. -DHAVE_CONFIG_H=1 +CFLAGS+= -I${_spath} -I${_spath}/.. -DHAVE_CONFIG_H=1 CFLAGS+= -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/infiniband -VERSION_MAP= ${.CURDIR}/../opensm/libopensm.map +VERSION_MAP= ${_spath}/libopensm.map .include Copied and modified: head/lib/ofed/librdmacm/Makefile (from r335252, head/contrib/ofed/librdmacm/Makefile) ============================================================================== --- head/contrib/ofed/librdmacm/Makefile Sat Jun 16 11:42:27 2018 (r335252, copy source) +++ head/lib/ofed/librdmacm/Makefile Sat Jun 16 15:05:05 2018 (r335253) @@ -1,12 +1,13 @@ # $FreeBSD$ -.PATH: ${.CURDIR} ${.CURDIR}/man +_spath= ${SRCTOP}/contrib/ofed/librdmacm +.PATH: ${_spath} ${_spath}/man SHLIBDIR?= /usr/lib LIB= rdmacm SHLIB_MAJOR= 1 MK_PROFILE= no -CFLAGS+= -I${.CURDIR} +CFLAGS+= -I${_spath} SRCS= \ acm.c \ @@ -66,6 +67,6 @@ rdma_resolve_route.3 \ rdma_set_option.3 LIBADD= ibverbs -VERSION_MAP= ${.CURDIR}/librdmacm.map +VERSION_MAP= ${_spath}/librdmacm.map .include Copied and modified: head/lib/ofed/libvendor/Makefile (from r335252, head/contrib/ofed/opensm/libvendor/Makefile) ============================================================================== --- head/contrib/ofed/opensm/libvendor/Makefile Sat Jun 16 11:42:27 2018 (r335252, copy source) +++ head/lib/ofed/libvendor/Makefile Sat Jun 16 15:05:05 2018 (r335253) @@ -1,6 +1,7 @@ # $FreeBSD$ -.PATH: ${.CURDIR} +_spath= ${SRCTOP}/contrib/ofed/opensm/libvendor +.PATH: ${_spath} SHLIBDIR?= /usr/lib LIB= osmvendor @@ -12,8 +13,8 @@ osm_vendor_ibumad.c \ osm_vendor_ibumad_sa.c LIBADD= ibumad pthread -CFLAGS+= -I${.CURDIR}/.. -DHAVE_CONFIG_H=1 +CFLAGS+= -I${_spath}/.. -DHAVE_CONFIG_H=1 CFLAGS+= -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/infiniband -VERSION_MAP= ${.CURDIR}/libosmvendor.map +VERSION_MAP= ${_spath}/libosmvendor.map .include Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Sat Jun 16 11:42:27 2018 (r335252) +++ head/share/mk/src.libnames.mk Sat Jun 16 15:05:05 2018 (r335253) @@ -492,18 +492,18 @@ LIBZFS_COREDIR= ${OBJTOP}/cddl/lib/libzfs_core LIBZPOOLDIR= ${OBJTOP}/cddl/lib/libzpool # OFED support -LIBCXGB4DIR= ${OBJTOP}/contrib/ofed/libcxgb4 -LIBIBCMDIR= ${OBJTOP}/contrib/ofed/libibcm -LIBIBMADDIR= ${OBJTOP}/contrib/ofed/libibmad -LIBIBNETDISCDIR=${OBJTOP}/contrib/ofed/libibnetdisc -LIBIBUMADDIR= ${OBJTOP}/contrib/ofed/libibumad -LIBIBVERBSDIR= ${OBJTOP}/contrib/ofed/libibverbs -LIBMLX4DIR= ${OBJTOP}/contrib/ofed/libmlx4 -LIBMLX5DIR= ${OBJTOP}/contrib/ofed/libmlx5 -LIBRDMACMDIR= ${OBJTOP}/contrib/ofed/librdmacm -LIBOSMCOMPDIR= ${OBJTOP}/contrib/ofed/opensm/complib -LIBOPENSMDIR= ${OBJTOP}/contrib/ofed/opensm/libopensm -LIBOSMVENDORDIR=${OBJTOP}/contrib/ofed/opensm/libvendor +LIBCXGB4DIR= ${OBJTOP}/lib/ofed/libcxgb4 +LIBIBCMDIR= ${OBJTOP}/lib/ofed/libibcm +LIBIBMADDIR= ${OBJTOP}/lib/ofed/libibmad +LIBIBNETDISCDIR=${OBJTOP}/lib/ofed/libibnetdisc +LIBIBUMADDIR= ${OBJTOP}/lib/ofed/libibumad +LIBIBVERBSDIR= ${OBJTOP}/lib/ofed/libibverbs +LIBMLX4DIR= ${OBJTOP}/lib/ofed/libmlx4 +LIBMLX5DIR= ${OBJTOP}/lib/ofed/libmlx5 +LIBRDMACMDIR= ${OBJTOP}/lib/ofed/librdmacm +LIBOSMCOMPDIR= ${OBJTOP}/lib/ofed/complib +LIBOPENSMDIR= ${OBJTOP}/lib/ofed/libopensm +LIBOSMVENDORDIR=${OBJTOP}/lib/ofed/libvendor LIBDIALOGDIR= ${OBJTOP}/gnu/lib/libdialog LIBGCOVDIR= ${OBJTOP}/gnu/lib/libgcov Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Sat Jun 16 11:42:27 2018 (r335252) +++ head/usr.bin/Makefile Sat Jun 16 15:05:05 2018 (r335253) @@ -292,6 +292,7 @@ SUBDIR.${MK_UTMPX}+= users SUBDIR.${MK_UTMPX}+= who SUBDIR.${MK_SVN}+= svn SUBDIR.${MK_SVNLITE}+= svn +SUBDIR.${MK_OFED}+= ofed # These are normally only handled for build-tools. .if make(clean*) Added: head/usr.bin/ofed/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/ofed/Makefile Sat Jun 16 15:05:05 2018 (r335253) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +SUBDIR= \ + libibverbs \ + librdmacm \ + opensm \ + infiniband-diags + +SUBDIR_PARALLEL= + +.include Copied: head/usr.bin/ofed/infiniband-diags/Makefile (from r335252, head/contrib/ofed/infiniband-diags/build/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/ofed/infiniband-diags/Makefile Sat Jun 16 15:05:05 2018 (r335253, copy of r335252, head/contrib/ofed/infiniband-diags/build/Makefile) @@ -0,0 +1,29 @@ +# $FreeBSD$ + +SUBDIR= \ +dump_fts \ +ibaddr \ +ibcacheedit \ +ibccconfig \ +ibccquery \ +iblinkinfo \ +ibmirror \ +ibnetdiscover \ +ibping \ +ibportstate \ +ibqueryerrors \ +ibroute \ +ibstat \ +ibsysstat \ +ibtracert \ +perfquery \ +saquery \ +sminfo \ +smpdump \ +smpquery \ +vendstat + +SUBDIR_PARALLEL= + +.include + Copied and modified: head/usr.bin/ofed/infiniband-diags/Makefile.inc (from r335252, head/contrib/ofed/infiniband-diags/build/Makefile.inc) ============================================================================== --- head/contrib/ofed/infiniband-diags/build/Makefile.inc Sat Jun 16 11:42:27 2018 (r335252, copy source) +++ head/usr.bin/ofed/infiniband-diags/Makefile.inc Sat Jun 16 15:05:05 2018 (r335253) @@ -1,12 +1,12 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../src ${.CURDIR}/../../man +_spath= ${SRCTOP}/contrib/ofed/infiniband-diags +.PATH: ${_spath}/src ${_spath}/man BINDIR?= /usr/bin SRCS+= ibdiag_common.c ibdiag_sa.c CFLAGS+= -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/infiniband CFLAGS+= -DHAVE_CONFIG_H=1 -CFLAGS+= -I${.CURDIR}/../../ -CFLAGS+= -I${.CURDIR}/../../src +CFLAGS+= -I${_spath} -I${_spath}/src LIBADD+= osmcomp ibmad ibumad Copied: head/usr.bin/ofed/infiniband-diags/dump_fts/Makefile (from r335252, head/contrib/ofed/infiniband-diags/build/dump_fts/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/ofed/infiniband-diags/dump_fts/Makefile Sat Jun 16 15:05:05 2018 (r335253, copy of r335252, head/contrib/ofed/infiniband-diags/build/dump_fts/Makefile) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +PROG= dump_fts +SRCS= dump_fts.c +LIBADD= ibnetdisc +MAN= dump_fts.8 + +.include Copied: head/usr.bin/ofed/infiniband-diags/ibaddr/Makefile (from r335252, head/contrib/ofed/infiniband-diags/build/ibaddr/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/ofed/infiniband-diags/ibaddr/Makefile Sat Jun 16 15:05:05 2018 (r335253, copy of r335252, head/contrib/ofed/infiniband-diags/build/ibaddr/Makefile) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +PROG= ibaddr +SRCS= ibaddr.c +MAN= ibaddr.8 + +.include Copied: head/usr.bin/ofed/infiniband-diags/ibcacheedit/Makefile (from r335252, head/contrib/ofed/infiniband-diags/build/ibcacheedit/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/ofed/infiniband-diags/ibcacheedit/Makefile Sat Jun 16 15:05:05 2018 (r335253, copy of r335252, head/contrib/ofed/infiniband-diags/build/ibcacheedit/Makefile) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +PROG= ibcacheedit +SRCS= ibcacheedit.c +LIBADD= ibnetdisc +MAN= ibcacheedit.8 + +.include Copied: head/usr.bin/ofed/infiniband-diags/ibccconfig/Makefile (from r335252, head/contrib/ofed/infiniband-diags/build/ibccconfig/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/ofed/infiniband-diags/ibccconfig/Makefile Sat Jun 16 15:05:05 2018 (r335253, copy of r335252, head/contrib/ofed/infiniband-diags/build/ibccconfig/Makefile) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +PROG= ibccconfig +SRCS= ibccconfig.c +MAN= ibccconfig.8 + +.include Copied: head/usr.bin/ofed/infiniband-diags/ibccquery/Makefile (from r335252, head/contrib/ofed/infiniband-diags/build/ibccquery/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/ofed/infiniband-diags/ibccquery/Makefile Sat Jun 16 15:05:05 2018 (r335253, copy of r335252, head/contrib/ofed/infiniband-diags/build/ibccquery/Makefile) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +PROG= ibccquery +SRCS= ibccquery.c +MAN= ibccquery.8 + +.include Copied: head/usr.bin/ofed/infiniband-diags/iblinkinfo/Makefile (from r335252, head/contrib/ofed/infiniband-diags/build/iblinkinfo/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/ofed/infiniband-diags/iblinkinfo/Makefile Sat Jun 16 15:05:05 2018 (r335253, copy of r335252, head/contrib/ofed/infiniband-diags/build/iblinkinfo/Makefile) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +PROG= iblinkinfo +SRCS= iblinkinfo.c +LIBADD= ibnetdisc +MAN= iblinkinfo.8 + +.include Copied: head/usr.bin/ofed/infiniband-diags/ibmirror/Makefile (from r335252, head/contrib/ofed/infiniband-diags/build/ibmirror/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/ofed/infiniband-diags/ibmirror/Makefile Sat Jun 16 15:05:05 2018 (r335253, copy of r335252, head/contrib/ofed/infiniband-diags/build/ibmirror/Makefile) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +PROG= ibmirror +SRCS= ibmirror.c +MAN= + +.include Copied: head/usr.bin/ofed/infiniband-diags/ibnetdiscover/Makefile (from r335252, head/contrib/ofed/infiniband-diags/build/ibnetdiscover/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/ofed/infiniband-diags/ibnetdiscover/Makefile Sat Jun 16 15:05:05 2018 (r335253, copy of r335252, head/contrib/ofed/infiniband-diags/build/ibnetdiscover/Makefile) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +PROG= ibnetdiscover +SRCS= ibnetdiscover.c +LIBADD= ibnetdisc +MAN= ibnetdiscover.8 + +.include Copied: head/usr.bin/ofed/infiniband-diags/ibping/Makefile (from r335252, head/contrib/ofed/infiniband-diags/build/ibping/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/ofed/infiniband-diags/ibping/Makefile Sat Jun 16 15:05:05 2018 (r335253, copy of r335252, head/contrib/ofed/infiniband-diags/build/ibping/Makefile) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +PROG= ibping +SRCS= ibping.c +MAN= ibping.8 + +.include Copied: head/usr.bin/ofed/infiniband-diags/ibportstate/Makefile (from r335252, head/contrib/ofed/infiniband-diags/build/ibportstate/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/ofed/infiniband-diags/ibportstate/Makefile Sat Jun 16 15:05:05 2018 (r335253, copy of r335252, head/contrib/ofed/infiniband-diags/build/ibportstate/Makefile) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +PROG= ibportstate +SRCS= ibportstate.c +MAN= ibportstate.8 + +.include Copied: head/usr.bin/ofed/infiniband-diags/ibqueryerrors/Makefile (from r335252, head/contrib/ofed/infiniband-diags/build/ibqueryerrors/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/ofed/infiniband-diags/ibqueryerrors/Makefile Sat Jun 16 15:05:05 2018 (r335253, copy of r335252, head/contrib/ofed/infiniband-diags/build/ibqueryerrors/Makefile) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +PROG= ibqueryerrors +SRCS= ibqueryerrors.c +LIBADD= ibnetdisc +MAN= ibqueryerrors.8 + +.include Copied: head/usr.bin/ofed/infiniband-diags/ibroute/Makefile (from r335252, head/contrib/ofed/infiniband-diags/build/ibroute/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/ofed/infiniband-diags/ibroute/Makefile Sat Jun 16 15:05:05 2018 (r335253, copy of r335252, head/contrib/ofed/infiniband-diags/build/ibroute/Makefile) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +PROG= ibroute +SRCS= ibroute.c +MAN= ibroute.8 + +.include Copied: head/usr.bin/ofed/infiniband-diags/ibstat/Makefile (from r335252, head/contrib/ofed/infiniband-diags/build/ibstat/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/ofed/infiniband-diags/ibstat/Makefile Sat Jun 16 15:05:05 2018 (r335253, copy of r335252, head/contrib/ofed/infiniband-diags/build/ibstat/Makefile) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +PROG= ibstat +SRCS= ibstat.c +MAN= ibstat.8 + +.include Copied: head/usr.bin/ofed/infiniband-diags/ibsysstat/Makefile (from r335252, head/contrib/ofed/infiniband-diags/build/ibsysstat/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/ofed/infiniband-diags/ibsysstat/Makefile Sat Jun 16 15:05:05 2018 (r335253, copy of r335252, head/contrib/ofed/infiniband-diags/build/ibsysstat/Makefile) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +PROG= ibsysstat +SRCS= ibsysstat.c +MAN= ibsysstat.8 + +.include Copied: head/usr.bin/ofed/infiniband-diags/ibtracert/Makefile (from r335252, head/contrib/ofed/infiniband-diags/build/ibtracert/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/ofed/infiniband-diags/ibtracert/Makefile Sat Jun 16 15:05:05 2018 (r335253, copy of r335252, head/contrib/ofed/infiniband-diags/build/ibtracert/Makefile) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +PROG= ibtracert +SRCS= ibtracert.c +MAN= ibtracert.8 + +.include Copied: head/usr.bin/ofed/infiniband-diags/perfquery/Makefile (from r335252, head/contrib/ofed/infiniband-diags/build/perfquery/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/ofed/infiniband-diags/perfquery/Makefile Sat Jun 16 15:05:05 2018 (r335253, copy of r335252, head/contrib/ofed/infiniband-diags/build/perfquery/Makefile) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +PROG= perfquery +SRCS= perfquery.c +MAN= perfquery.8 + +.include Copied: head/usr.bin/ofed/infiniband-diags/saquery/Makefile (from r335252, head/contrib/ofed/infiniband-diags/build/saquery/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/ofed/infiniband-diags/saquery/Makefile Sat Jun 16 15:05:05 2018 (r335253, copy of r335252, head/contrib/ofed/infiniband-diags/build/saquery/Makefile) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +PROG= saquery +SRCS= saquery.c +MAN= saquery.8 + +.include Copied: head/usr.bin/ofed/infiniband-diags/sminfo/Makefile (from r335252, head/contrib/ofed/infiniband-diags/build/sminfo/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/ofed/infiniband-diags/sminfo/Makefile Sat Jun 16 15:05:05 2018 (r335253, copy of r335252, head/contrib/ofed/infiniband-diags/build/sminfo/Makefile) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +PROG= sminfo +SRCS= sminfo.c +MAN= sminfo.8 + +.include Copied: head/usr.bin/ofed/infiniband-diags/smpdump/Makefile (from r335252, head/contrib/ofed/infiniband-diags/build/smpdump/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/ofed/infiniband-diags/smpdump/Makefile Sat Jun 16 15:05:05 2018 (r335253, copy of r335252, head/contrib/ofed/infiniband-diags/build/smpdump/Makefile) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +PROG= smpdump +SRCS= smpdump.c +MAN= smpdump.8 + +.include Copied: head/usr.bin/ofed/infiniband-diags/smpquery/Makefile (from r335252, head/contrib/ofed/infiniband-diags/build/smpquery/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/ofed/infiniband-diags/smpquery/Makefile Sat Jun 16 15:05:05 2018 (r335253, copy of r335252, head/contrib/ofed/infiniband-diags/build/smpquery/Makefile) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +PROG= smpquery +SRCS= smpquery.c +MAN= smpquery.8 + +.include Copied: head/usr.bin/ofed/infiniband-diags/vendstat/Makefile (from r335252, head/contrib/ofed/infiniband-diags/build/vendstat/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/ofed/infiniband-diags/vendstat/Makefile Sat Jun 16 15:05:05 2018 (r335253, copy of r335252, head/contrib/ofed/infiniband-diags/build/vendstat/Makefile) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +PROG= vendstat +SRCS= vendstat.c +MAN= vendstat.8 + +.include Copied and modified: head/usr.bin/ofed/libibverbs/Makefile (from r335252, head/contrib/ofed/libibverbs/examples/build/Makefile) ============================================================================== --- head/contrib/ofed/libibverbs/examples/build/Makefile Sat Jun 16 11:42:27 2018 (r335252, copy source) +++ head/usr.bin/ofed/libibverbs/Makefile Sat Jun 16 15:05:05 2018 (r335253) @@ -1,3 +1,5 @@ +# $FreeBSD$ + SUBDIR= \ asyncwatch \ devinfo \ Added: head/usr.bin/ofed/libibverbs/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/ofed/libibverbs/Makefile.inc Sat Jun 16 15:05:05 2018 (r335253) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +_spath=${SRCTOP}/contrib/ofed/libibverbs +.PATH: ${_spath}/examples ${_spath}/man + +BINDIR?= /usr/bin +CFLAGS+= -I${_spath} +LIBADD+= ibverbs mlx4 mlx5 cxgb4 pthread + Copied and modified: head/usr.bin/ofed/libibverbs/asyncwatch/Makefile (from r335252, head/contrib/ofed/libibverbs/examples/build/asyncwatch/Makefile) ============================================================================== --- head/contrib/ofed/libibverbs/examples/build/asyncwatch/Makefile Sat Jun 16 11:42:27 2018 (r335252, copy source) +++ head/usr.bin/ofed/libibverbs/asyncwatch/Makefile Sat Jun 16 15:05:05 2018 (r335253) @@ -1,5 +1,4 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../.. ${.CURDIR}/../../../man PROG= ibv_asyncwatch MAN= ibv_asyncwatch.1 Copied and modified: head/usr.bin/ofed/libibverbs/devices/Makefile (from r335252, head/contrib/ofed/libibverbs/examples/build/devices/Makefile) ============================================================================== --- head/contrib/ofed/libibverbs/examples/build/devices/Makefile Sat Jun 16 11:42:27 2018 (r335252, copy source) +++ head/usr.bin/ofed/libibverbs/devices/Makefile Sat Jun 16 15:05:05 2018 (r335253) @@ -1,5 +1,4 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../.. ${.CURDIR}/../../../man PROG= ibv_devices MAN= ibv_devices.1 Copied and modified: head/usr.bin/ofed/libibverbs/devinfo/Makefile (from r335252, head/contrib/ofed/libibverbs/examples/build/devinfo/Makefile) ============================================================================== --- head/contrib/ofed/libibverbs/examples/build/devinfo/Makefile Sat Jun 16 11:42:27 2018 (r335252, copy source) +++ head/usr.bin/ofed/libibverbs/devinfo/Makefile Sat Jun 16 15:05:05 2018 (r335253) @@ -1,5 +1,4 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../.. ${.CURDIR}/../../../man PROG= ibv_devinfo MAN= ibv_devinfo.1 Copied and modified: head/usr.bin/ofed/libibverbs/rc_pingpong/Makefile (from r335252, head/contrib/ofed/libibverbs/examples/build/rc_pingpong/Makefile) ============================================================================== --- head/contrib/ofed/libibverbs/examples/build/rc_pingpong/Makefile Sat Jun 16 11:42:27 2018 (r335252, copy source) +++ head/usr.bin/ofed/libibverbs/rc_pingpong/Makefile Sat Jun 16 15:05:05 2018 (r335253) @@ -1,5 +1,4 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../.. ${.CURDIR}/../../../man PROG= ibv_rc_pingpong MAN= ibv_rc_pingpong.1 Copied and modified: head/usr.bin/ofed/libibverbs/srq_pingpong/Makefile (from r335252, head/contrib/ofed/libibverbs/examples/build/srq_pingpong/Makefile) ============================================================================== --- head/contrib/ofed/libibverbs/examples/build/srq_pingpong/Makefile Sat Jun 16 11:42:27 2018 (r335252, copy source) +++ head/usr.bin/ofed/libibverbs/srq_pingpong/Makefile Sat Jun 16 15:05:05 2018 (r335253) @@ -1,5 +1,4 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../.. ${.CURDIR}/../../../man PROG= ibv_srq_pingpong MAN= ibv_srq_pingpong.1 Copied and modified: head/usr.bin/ofed/libibverbs/uc_pingpong/Makefile (from r335252, head/contrib/ofed/libibverbs/examples/build/uc_pingpong/Makefile) ============================================================================== --- head/contrib/ofed/libibverbs/examples/build/uc_pingpong/Makefile Sat Jun 16 11:42:27 2018 (r335252, copy source) +++ head/usr.bin/ofed/libibverbs/uc_pingpong/Makefile Sat Jun 16 15:05:05 2018 (r335253) @@ -1,5 +1,4 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../.. ${.CURDIR}/../../../man PROG= ibv_uc_pingpong MAN= ibv_uc_pingpong.1 Copied and modified: head/usr.bin/ofed/libibverbs/ud_pingpong/Makefile (from r335252, head/contrib/ofed/libibverbs/examples/build/ud_pingpong/Makefile) ============================================================================== --- head/contrib/ofed/libibverbs/examples/build/ud_pingpong/Makefile Sat Jun 16 11:42:27 2018 (r335252, copy source) +++ head/usr.bin/ofed/libibverbs/ud_pingpong/Makefile Sat Jun 16 15:05:05 2018 (r335253) @@ -1,5 +1,4 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../.. ${.CURDIR}/../../../man PROG= ibv_ud_pingpong MAN= ibv_ud_pingpong.1 Copied: head/usr.bin/ofed/librdmacm/Makefile (from r335252, head/contrib/ofed/librdmacm/examples/build/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/ofed/librdmacm/Makefile Sat Jun 16 15:05:05 2018 (r335253, copy of r335252, head/contrib/ofed/librdmacm/examples/build/Makefile) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +SUBDIR= ucmatose mckey rping udaddy + +SUBDIR_PARALLEL= + +.include Added: head/usr.bin/ofed/librdmacm/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/ofed/librdmacm/Makefile.inc Sat Jun 16 15:05:05 2018 (r335253) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +_spath=${SRCTOP}/contrib/ofed/librdmacm +.PATH: ${_spath}/examples ${_spath}/man + +BINDIR?= /usr/bin +CFLAGS+= -I${SRCTOP}/contrib/ofed +LIBADD+= ibverbs rdmacm mlx4 mlx5 cxgb4 pthread Copied and modified: head/usr.bin/ofed/librdmacm/mckey/Makefile (from r335252, head/contrib/ofed/librdmacm/examples/build/mckey/Makefile) ============================================================================== --- head/contrib/ofed/librdmacm/examples/build/mckey/Makefile Sat Jun 16 11:42:27 2018 (r335252, copy source) +++ head/usr.bin/ofed/librdmacm/mckey/Makefile Sat Jun 16 15:05:05 2018 (r335253) @@ -1,7 +1,5 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../.. ${.CURDIR}/../../../man - PROG= mckey MAN= mckey.1 SRCS= mckey.c Copied and modified: head/usr.bin/ofed/librdmacm/rping/Makefile (from r335252, head/contrib/ofed/librdmacm/examples/build/rping/Makefile) ============================================================================== --- head/contrib/ofed/librdmacm/examples/build/rping/Makefile Sat Jun 16 11:42:27 2018 (r335252, copy source) +++ head/usr.bin/ofed/librdmacm/rping/Makefile Sat Jun 16 15:05:05 2018 (r335253) @@ -1,7 +1,5 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../.. ${.CURDIR}/../../../man - PROG= rping MAN= rping.1 SRCS= rping.c common.c Copied and modified: head/usr.bin/ofed/librdmacm/ucmatose/Makefile (from r335252, head/contrib/ofed/librdmacm/examples/build/ucmatose/Makefile) ============================================================================== --- head/contrib/ofed/librdmacm/examples/build/ucmatose/Makefile Sat Jun 16 11:42:27 2018 (r335252, copy source) +++ head/usr.bin/ofed/librdmacm/ucmatose/Makefile Sat Jun 16 15:05:05 2018 (r335253) @@ -1,7 +1,5 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../.. ${.CURDIR}/../../../man - PROG= ucmatose MAN= ucmatose.1 SRCS= cmatose.c common.c Copied and modified: head/usr.bin/ofed/librdmacm/udaddy/Makefile (from r335252, head/contrib/ofed/librdmacm/examples/build/udaddy/Makefile) ============================================================================== --- head/contrib/ofed/librdmacm/examples/build/udaddy/Makefile Sat Jun 16 11:42:27 2018 (r335252, copy source) +++ head/usr.bin/ofed/librdmacm/udaddy/Makefile Sat Jun 16 15:05:05 2018 (r335253) @@ -1,7 +1,5 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../.. ${.CURDIR}/../../../man - PROG= udaddy MAN= udaddy.1 SRCS= udaddy.c common.c Copied and modified: head/usr.bin/ofed/opensm/Makefile (from r335252, head/contrib/ofed/opensm/opensm/Makefile) ============================================================================== --- head/contrib/ofed/opensm/opensm/Makefile Sat Jun 16 11:42:27 2018 (r335252, copy source) +++ head/usr.bin/ofed/opensm/Makefile Sat Jun 16 15:05:05 2018 (r335253) @@ -1,6 +1,7 @@ # $FreeBSD$ -.PATH: ${.CURDIR} ${.CURDIR}/../man +_spath= ${SRCTOP}/contrib/ofed/opensm/opensm +.PATH: ${_spath} ${_spath:H}/man BINDIR?= /usr/bin PROG= opensm @@ -94,7 +95,7 @@ osm_vl_arb_rcv.c \ st.c MAN= opensm.8 -CFLAGS+= -I${.CURDIR}/.. -DHAVE_CONFIG_H=1 +CFLAGS+= -I${_spath:H} -DHAVE_CONFIG_H=1 CFLAGS+= -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/infiniband LIBADD= opensm osmvendor osmcomp wrap pthread From owner-svn-src-head@freebsd.org Sat Jun 16 15:16:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CD311019341; Sat, 16 Jun 2018 15:16:04 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B280884B53; Sat, 16 Jun 2018 15:16:03 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 706F327FFB; Sat, 16 Jun 2018 15:16:03 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5GFG38U017899; Sat, 16 Jun 2018 15:16:03 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5GFG33p017898; Sat, 16 Jun 2018 15:16:03 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201806161516.w5GFG33p017898@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sat, 16 Jun 2018 15:16:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335254 - in head/stand/i386: libi386 zfsboot X-SVN-Group: head X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: in head/stand/i386: libi386 zfsboot X-SVN-Commit-Revision: 335254 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2018 15:16:04 -0000 Author: allanjude Date: Sat Jun 16 15:16:02 2018 New Revision: 335254 URL: https://svnweb.freebsd.org/changeset/base/335254 Log: Avoid reading past the end of the disk in zfsboot.c and biosdisk.c The GELI boot code rounds reads up to 4k, since the encrypted sectors are 4k, and must be decrypted as a unit. With oddball sized disks (almost always virtual), this can lead to reading past the end of the disk. Reviewed by: imp, tsoome Sponsored by: Klara Systems Differential Revision: https://reviews.freebsd.org/D15844 Modified: head/stand/i386/libi386/biosdisk.c head/stand/i386/zfsboot/zfsboot.c Modified: head/stand/i386/libi386/biosdisk.c ============================================================================== --- head/stand/i386/libi386/biosdisk.c Sat Jun 16 15:05:05 2018 (r335253) +++ head/stand/i386/libi386/biosdisk.c Sat Jun 16 15:16:02 2018 (r335254) @@ -882,6 +882,12 @@ bd_read(struct disk_devdesc *dev, daddr_t dblk, int bl } } + if (alignlba + alignblks > BD(dev).bd_sectors) { + DEBUG("Shorted read at %llu from %d to %llu blocks", + alignlba, alignblks, BD(dev).bd_sectors - alignlba); + alignblks = BD(dev).bd_sectors - alignlba; + } + err = bd_io(dev, alignlba, alignblks, tmpbuf, 0); if (err) return (err); Modified: head/stand/i386/zfsboot/zfsboot.c ============================================================================== --- head/stand/i386/zfsboot/zfsboot.c Sat Jun 16 15:05:05 2018 (r335253) +++ head/stand/i386/zfsboot/zfsboot.c Sat Jun 16 15:16:02 2018 (r335254) @@ -209,6 +209,12 @@ vdev_read(void *xvdev, void *priv, off_t off, void *bu alignnb = roundup2(nb * DEV_BSIZE + diff, DEV_GELIBOOT_BSIZE) / DEV_BSIZE; + if (dsk->size > 0 && alignlba + alignnb > dsk->size + dsk->start) { + printf("Shortening read at %lld from %d to %lld\n", alignlba, + alignnb, (dsk->size + dsk->start) - alignlba); + alignnb = (dsk->size + dsk->start) - alignlba; + } + if (drvread(dsk, dmadat->rdbuf, alignlba, alignnb)) return -1; #ifdef LOADER_GELI_SUPPORT @@ -694,7 +700,7 @@ main(void) dsk->slice = *(uint8_t *)PTOV(ARGS + 1) + 1; dsk->part = 0; dsk->start = 0; - dsk->size = 0; + dsk->size = drvsize_ext(dsk); bootinfo.bi_version = BOOTINFO_VERSION; bootinfo.bi_size = sizeof(bootinfo); @@ -745,7 +751,7 @@ main(void) dsk->slice = 0; dsk->part = 0; dsk->start = 0; - dsk->size = 0; + dsk->size = drvsize_ext(dsk); probe_drive(dsk); } From owner-svn-src-head@freebsd.org Sat Jun 16 15:25:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E130D1019674; Sat, 16 Jun 2018 15:25:08 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9324A84FA5; Sat, 16 Jun 2018 15:25:08 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 748791E4; Sat, 16 Jun 2018 15:25:08 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5GFP8fs023474; Sat, 16 Jun 2018 15:25:08 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5GFP8hJ023473; Sat, 16 Jun 2018 15:25:08 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201806161525.w5GFP8hJ023473@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sat, 16 Jun 2018 15:25:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335255 - head/tests/sys/audit X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/audit X-SVN-Commit-Revision: 335255 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2018 15:25:09 -0000 Author: asomers Date: Sat Jun 16 15:25:08 2018 New Revision: 335255 URL: https://svnweb.freebsd.org/changeset/base/335255 Log: audit(4): add tests for bind(2), bindat(2), and listen(2) Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15843 Modified: head/tests/sys/audit/network.c Modified: head/tests/sys/audit/network.c ============================================================================== --- head/tests/sys/audit/network.c Sat Jun 16 15:16:02 2018 (r335254) +++ head/tests/sys/audit/network.c Sat Jun 16 15:25:08 2018 (r335255) @@ -27,19 +27,25 @@ #include #include +#include #include +#include #include #include #include "utils.h" +#define SERVER_PATH "server" + static int sockfd; +static socklen_t len; static struct pollfd fds[1]; static char extregex[80]; static const char *auclass = "nt"; -static const char *failregex = "return,failure : Address family " - "not supported by protocol family"; +static const char *nosupregex = "return,failure : Address family " + "not supported by protocol family"; +static const char *invalregex = "return,failur.*Socket operation on non-socket"; /* * Variadic function to close socket descriptors @@ -56,7 +62,18 @@ close_sockets(int count, ...) va_end(socklist); } +/* + * Assign local filesystem address to a Unix domain socket + */ +static void +assign_address(struct sockaddr_un *server) +{ + memset(server, 0, sizeof(*server)); + server->sun_family = AF_UNIX; + strcpy(server->sun_path, SERVER_PATH); +} + ATF_TC_WITH_CLEANUP(socket_success); ATF_TC_HEAD(socket_success, tc) { @@ -89,7 +106,7 @@ ATF_TC_HEAD(socket_failure, tc) ATF_TC_BODY(socket_failure, tc) { - snprintf(extregex, sizeof(extregex), "socket.*%s", failregex); + snprintf(extregex, sizeof(extregex), "socket.*%s", nosupregex); FILE *pipefd = setup(fds, auclass); /* Failure reason: Unsupported value of 'domain' argument: 0 */ ATF_REQUIRE_EQ(-1, socket(0, SOCK_STREAM, 0)); @@ -136,7 +153,7 @@ ATF_TC_HEAD(socketpair_failure, tc) ATF_TC_BODY(socketpair_failure, tc) { - snprintf(extregex, sizeof(extregex), "socketpair.*%s", failregex); + snprintf(extregex, sizeof(extregex), "socketpair.*%s", nosupregex); FILE *pipefd = setup(fds, auclass); /* Failure reason: Unsupported value of 'domain' argument: 0 */ ATF_REQUIRE_EQ(-1, socketpair(0, SOCK_STREAM, 0, NULL)); @@ -187,12 +204,12 @@ ATF_TC_HEAD(setsockopt_failure, tc) ATF_TC_BODY(setsockopt_failure, tc) { int tr = 1; - const char *regex = "setsockopt.*fail.*Socket operation on non-socket"; + snprintf(extregex, sizeof(extregex), "setsockopt.*%s", invalregex); FILE *pipefd = setup(fds, auclass); - /* Failure reason: No socket descriptor with the value of 0 exists */ + /* Failure reason: Invalid socket descriptor */ ATF_REQUIRE_EQ(-1, setsockopt(0, SOL_SOCKET, SO_REUSEADDR, &tr, sizeof(int))); - check_audit(fds, regex, pipefd); + check_audit(fds, extregex, pipefd); } ATF_TC_CLEANUP(setsockopt_failure, tc) @@ -201,6 +218,180 @@ ATF_TC_CLEANUP(setsockopt_failure, tc) } +ATF_TC_WITH_CLEANUP(bind_success); +ATF_TC_HEAD(bind_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "bind(2) call"); +} + +ATF_TC_BODY(bind_success, tc) +{ + struct sockaddr_un server; + assign_address(&server); + len = sizeof(struct sockaddr_un); + + /* Preliminary socket setup */ + ATF_REQUIRE((sockfd = socket(PF_UNIX, SOCK_STREAM, 0)) != -1); + /* Check the presence of AF_UNIX address path in audit record */ + snprintf(extregex, sizeof(extregex), + "bind.*unix.*%s.*return,success", SERVER_PATH); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, bind(sockfd, (struct sockaddr *)&server, len)); + check_audit(fds, extregex, pipefd); + close(sockfd); +} + +ATF_TC_CLEANUP(bind_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(bind_failure); +ATF_TC_HEAD(bind_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "bind(2) call"); +} + +ATF_TC_BODY(bind_failure, tc) +{ + /* Preliminary socket setup */ + struct sockaddr_un server; + assign_address(&server); + len = sizeof(struct sockaddr_un); + /* Check the presence of AF_UNIX path in audit record */ + snprintf(extregex, sizeof(extregex), + "bind.*%s.*return,failure", SERVER_PATH); + + FILE *pipefd = setup(fds, auclass); + /* Failure reason: Invalid socket descriptor */ + ATF_REQUIRE_EQ(-1, bind(0, (struct sockaddr *)&server, len)); + check_audit(fds, extregex, pipefd); +} + +ATF_TC_CLEANUP(bind_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(bindat_success); +ATF_TC_HEAD(bindat_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "bindat(2) call"); +} + +ATF_TC_BODY(bindat_success, tc) +{ + struct sockaddr_un server; + assign_address(&server); + len = sizeof(struct sockaddr_un); + + /* Preliminary socket setup */ + ATF_REQUIRE((sockfd = socket(PF_UNIX, SOCK_STREAM, 0)) != -1); + /* Check the presence of socket descriptor in audit record */ + snprintf(extregex, sizeof(extregex), + "bindat.*0x%x.*return,success", sockfd); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, bindat(AT_FDCWD, sockfd, + (struct sockaddr *)&server, len)); + check_audit(fds, extregex, pipefd); + close(sockfd); +} + +ATF_TC_CLEANUP(bindat_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(bindat_failure); +ATF_TC_HEAD(bindat_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "bindat(2) call"); +} + +ATF_TC_BODY(bindat_failure, tc) +{ + /* Preliminary socket setup */ + struct sockaddr_un server; + assign_address(&server); + len = sizeof(struct sockaddr_un); + snprintf(extregex, sizeof(extregex), "bindat.*%s", invalregex); + + FILE *pipefd = setup(fds, auclass); + /* Failure reason: Invalid socket descriptor */ + ATF_REQUIRE_EQ(-1, bindat(AT_FDCWD, 0, + (struct sockaddr *)&server, len)); + check_audit(fds, extregex, pipefd); +} + +ATF_TC_CLEANUP(bindat_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(listen_success); +ATF_TC_HEAD(listen_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "listen(2) call"); +} + +ATF_TC_BODY(listen_success, tc) +{ + struct sockaddr_un server; + assign_address(&server); + len = sizeof(struct sockaddr_un); + + /* Preliminary socket setup */ + ATF_REQUIRE((sockfd = socket(PF_UNIX, SOCK_STREAM, 0)) != -1); + ATF_REQUIRE_EQ(0, bind(sockfd, (struct sockaddr *)&server, len)); + /* Check the presence of socket descriptor in the audit record */ + snprintf(extregex, sizeof(extregex), + "listen.*0x%x.*return,success", sockfd); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, listen(sockfd, 1)); + check_audit(fds, extregex, pipefd); + close(sockfd); +} + +ATF_TC_CLEANUP(listen_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(listen_failure); +ATF_TC_HEAD(listen_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "listen(2) call"); +} + +ATF_TC_BODY(listen_failure, tc) +{ + snprintf(extregex, sizeof(extregex), "listen.*%s", invalregex); + FILE *pipefd = setup(fds, auclass); + /* Failure reason: Invalid socket descriptor */ + ATF_REQUIRE_EQ(-1, listen(0, 1)); + check_audit(fds, extregex, pipefd); +} + +ATF_TC_CLEANUP(listen_failure, tc) +{ + cleanup(); +} + + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, socket_success); @@ -209,6 +400,13 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, socketpair_failure); ATF_TP_ADD_TC(tp, setsockopt_success); ATF_TP_ADD_TC(tp, setsockopt_failure); + + ATF_TP_ADD_TC(tp, bind_success); + ATF_TP_ADD_TC(tp, bind_failure); + ATF_TP_ADD_TC(tp, bindat_success); + ATF_TP_ADD_TC(tp, bindat_failure); + ATF_TP_ADD_TC(tp, listen_success); + ATF_TP_ADD_TC(tp, listen_failure); return (atf_no_error()); } From owner-svn-src-head@freebsd.org Sat Jun 16 15:35:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C373101999C; Sat, 16 Jun 2018 15:35:31 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9860854BD; Sat, 16 Jun 2018 15:35:30 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w5GFZSPF056255; Sat, 16 Jun 2018 08:35:28 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w5GFZSOG056254; Sat, 16 Jun 2018 08:35:28 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806161535.w5GFZSOG056254@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r334979 - head/sbin/dump In-Reply-To: <201806112038.w5BKcQ7T077645@repo.freebsd.org> To: Warner Losh Date: Sat, 16 Jun 2018 08:35:28 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2018 15:35:31 -0000 > Author: imp > Date: Mon Jun 11 20:38:26 2018 > New Revision: 334979 > URL: https://svnweb.freebsd.org/changeset/base/334979 > > Log: > Fix a bug in the counting of blks. > > We shouldn't count the bytes set in c_addr for TS_CLRI and TS_BITS > nodes. Those block overload c_count to communicate how many blocks > follow, not now many c_addr spaces are used. Dump would dump core > (now) because memory layout moved around and we'd access elements past > the end to make a count. > > Reviewed by: kib@ Warner, I have finally confirmed that I get the SEGV using dump.r334814, and that I can not make dump.r335244 SEGV. Thanks for fixing this! Rod > Modified: > head/sbin/dump/tape.c > > Modified: head/sbin/dump/tape.c > ============================================================================== > --- head/sbin/dump/tape.c Mon Jun 11 20:26:10 2018 (r334978) > +++ head/sbin/dump/tape.c Mon Jun 11 20:38:26 2018 (r334979) > @@ -279,7 +279,8 @@ flushtape(void) > } > > blks = 0; > - if (spcl.c_type != TS_END) { > + if (spcl.c_type != TS_END && spcl.c_type != TS_CLRI && > + spcl.c_type != TS_BITS) { > assert(spcl.c_count <= TP_NINDIR); > for (i = 0; i < spcl.c_count; i++) > if (spcl.c_addr[i] != 0) > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sat Jun 16 15:39:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 806FC1019A78; Sat, 16 Jun 2018 15:39:00 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 33B6085804; Sat, 16 Jun 2018 15:39:00 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EEB9A3AD; Sat, 16 Jun 2018 15:38:59 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5GFcx3Y028849; Sat, 16 Jun 2018 15:38:59 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5GFcx5h028848; Sat, 16 Jun 2018 15:38:59 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201806161538.w5GFcx5h028848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sat, 16 Jun 2018 15:38:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335256 - head/tests/sys/audit X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/audit X-SVN-Commit-Revision: 335256 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2018 15:39:00 -0000 Author: asomers Date: Sat Jun 16 15:38:59 2018 New Revision: 335256 URL: https://svnweb.freebsd.org/changeset/base/335256 Log: audit(4): add tests for chown(2) and friends Includes chown, fchown, lchown, and fchownat Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15825 Modified: head/tests/sys/audit/file-attribute-modify.c Modified: head/tests/sys/audit/file-attribute-modify.c ============================================================================== --- head/tests/sys/audit/file-attribute-modify.c Sat Jun 16 15:25:08 2018 (r335255) +++ head/tests/sys/audit/file-attribute-modify.c Sat Jun 16 15:38:59 2018 (r335256) @@ -35,6 +35,8 @@ #include "utils.h" static pid_t pid; +static uid_t uid = -1; +static gid_t gid = -1; static int filedesc; static struct pollfd fds[1]; static mode_t mode = 0777; @@ -369,6 +371,185 @@ ATF_TC_CLEANUP(fchmodat_failure, tc) } +ATF_TC_WITH_CLEANUP(chown_success); +ATF_TC_HEAD(chown_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "chown(2) call"); +} + +ATF_TC_BODY(chown_success, tc) +{ + /* File needs to exist to call chown(2) */ + ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, chown(path, uid, gid)); + check_audit(fds, successreg, pipefd); + close(filedesc); +} + +ATF_TC_CLEANUP(chown_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(chown_failure); +ATF_TC_HEAD(chown_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "chown(2) call"); +} + +ATF_TC_BODY(chown_failure, tc) +{ + FILE *pipefd = setup(fds, auclass); + /* Failure reason: file does not exist */ + ATF_REQUIRE_EQ(-1, chown(errpath, uid, gid)); + check_audit(fds, failurereg, pipefd); +} + +ATF_TC_CLEANUP(chown_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(fchown_success); +ATF_TC_HEAD(fchown_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "fchown(2) call"); +} + +ATF_TC_BODY(fchown_success, tc) +{ + pid = getpid(); + snprintf(extregex, sizeof(extregex), "fchown.*%d.*return,success", pid); + + /* File needs to exist to call fchown(2) */ + ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, fchown(filedesc, uid, gid)); + check_audit(fds, extregex, pipefd); + close(filedesc); +} + +ATF_TC_CLEANUP(fchown_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(fchown_failure); +ATF_TC_HEAD(fchown_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "fchown(2) call"); +} + +ATF_TC_BODY(fchown_failure, tc) +{ + const char *regex = "fchown.*return,failure : Bad file descriptor"; + FILE *pipefd = setup(fds, auclass); + /* Failure reason: Invalid file descriptor */ + ATF_REQUIRE_EQ(-1, fchown(-1, uid, gid)); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(fchown_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(lchown_success); +ATF_TC_HEAD(lchown_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "lchown(2) call"); +} + +ATF_TC_BODY(lchown_success, tc) +{ + /* Symbolic link needs to exist to call lchown(2) */ + ATF_REQUIRE_EQ(0, symlink("symlink", path)); + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, lchown(path, uid, gid)); + check_audit(fds, successreg, pipefd); +} + +ATF_TC_CLEANUP(lchown_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(lchown_failure); +ATF_TC_HEAD(lchown_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "lchown(2) call"); +} + +ATF_TC_BODY(lchown_failure, tc) +{ + FILE *pipefd = setup(fds, auclass); + /* Failure reason: Symbolic link does not exist */ + ATF_REQUIRE_EQ(-1, lchown(errpath, uid, gid)); + check_audit(fds, failurereg, pipefd); +} + +ATF_TC_CLEANUP(lchown_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(fchownat_success); +ATF_TC_HEAD(fchownat_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "fchownat(2) call"); +} + +ATF_TC_BODY(fchownat_success, tc) +{ + /* File needs to exist to call fchownat(2) */ + ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, fchownat(AT_FDCWD, path, uid, gid, 0)); + check_audit(fds, successreg, pipefd); + close(filedesc); +} + +ATF_TC_CLEANUP(fchownat_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(fchownat_failure); +ATF_TC_HEAD(fchownat_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "fchownat(2) call"); +} + +ATF_TC_BODY(fchownat_failure, tc) +{ + FILE *pipefd = setup(fds, auclass); + /* Failure reason: file does not exist */ + ATF_REQUIRE_EQ(-1, fchownat(AT_FDCWD, errpath, uid, gid, 0)); + check_audit(fds, failurereg, pipefd); +} + +ATF_TC_CLEANUP(fchownat_failure, tc) +{ + cleanup(); +} + + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, flock_success); @@ -386,6 +567,15 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, lchmod_failure); ATF_TP_ADD_TC(tp, fchmodat_success); ATF_TP_ADD_TC(tp, fchmodat_failure); + + ATF_TP_ADD_TC(tp, chown_success); + ATF_TP_ADD_TC(tp, chown_failure); + ATF_TP_ADD_TC(tp, fchown_success); + ATF_TP_ADD_TC(tp, fchown_failure); + ATF_TP_ADD_TC(tp, lchown_success); + ATF_TP_ADD_TC(tp, lchown_failure); + ATF_TP_ADD_TC(tp, fchownat_success); + ATF_TP_ADD_TC(tp, fchownat_failure); return (atf_no_error()); } From owner-svn-src-head@freebsd.org Sat Jun 16 16:16:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93264101AD01; Sat, 16 Jun 2018 16:16:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 470BF86C60; Sat, 16 Jun 2018 16:16:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 27C2DA49; Sat, 16 Jun 2018 16:16:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5GGGPLG050397; Sat, 16 Jun 2018 16:16:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5GGGP5w050396; Sat, 16 Jun 2018 16:16:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201806161616.w5GGGP5w050396@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 16 Jun 2018 16:16:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335257 - in head: lib/libthr/arch/common sys/dev/cm sys/dev/pdq sys/modules/arcnet sys/modules/cm sys/modules/libmbpool sys/modules/vxge sys/ofed/drivers/infiniband/debug X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: lib/libthr/arch/common sys/dev/cm sys/dev/pdq sys/modules/arcnet sys/modules/cm sys/modules/libmbpool sys/modules/vxge sys/ofed/drivers/infiniband/debug X-SVN-Commit-Revision: 335257 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2018 16:16:25 -0000 Author: kib Date: Sat Jun 16 16:16:24 2018 New Revision: 335257 URL: https://svnweb.freebsd.org/changeset/base/335257 Log: Remove some empty directories Deleted: head/lib/libthr/arch/common/ head/sys/dev/cm/ head/sys/dev/pdq/ head/sys/modules/arcnet/ head/sys/modules/cm/ head/sys/modules/libmbpool/ head/sys/modules/vxge/ head/sys/ofed/drivers/infiniband/debug/ From owner-svn-src-head@freebsd.org Sat Jun 16 17:11:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A477101C6E5; Sat, 16 Jun 2018 17:11:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2CBF468466; Sat, 16 Jun 2018 17:11:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E91AE12A8; Sat, 16 Jun 2018 17:11:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5GHBNcm079409; Sat, 16 Jun 2018 17:11:23 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5GHBNYH079408; Sat, 16 Jun 2018 17:11:23 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201806161711.w5GHBNYH079408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 16 Jun 2018 17:11:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335258 - head/lib/libthr/support X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/lib/libthr/support X-SVN-Commit-Revision: 335258 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2018 17:11:24 -0000 Author: kib Date: Sat Jun 16 17:11:23 2018 New Revision: 335258 URL: https://svnweb.freebsd.org/changeset/base/335258 Log: Remove unused file. The thr_new(2) syscall is called through libc stub. r154212 stopped generating it for libthr but did not cleaned the unused remnants. Sponsored by: The FreeBSD Foundation MFC after: 1 week Deleted: head/lib/libthr/support/ From owner-svn-src-head@freebsd.org Sat Jun 16 17:45:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77491101D57F; Sat, 16 Jun 2018 17:45:45 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2B00E6978A; Sat, 16 Jun 2018 17:45:45 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C44018CA; Sat, 16 Jun 2018 17:45:45 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5GHjig9096353; Sat, 16 Jun 2018 17:45:44 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5GHjiX0096352; Sat, 16 Jun 2018 17:45:44 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201806161745.w5GHjiX0096352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sat, 16 Jun 2018 17:45:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335259 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 335259 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2018 17:45:45 -0000 Author: allanjude Date: Sat Jun 16 17:45:44 2018 New Revision: 335259 URL: https://svnweb.freebsd.org/changeset/base/335259 Log: rootgen.sh: Don't copy various bits of the bootcode from the running system We want to use the versions of the bootcode we just built, rather than ones from whatever happens to be in /boot on the test machine These were incorrectly added by me in r334888 Modified: head/tools/boot/rootgen.sh Modified: head/tools/boot/rootgen.sh ============================================================================== --- head/tools/boot/rootgen.sh Sat Jun 16 17:11:23 2018 (r335258) +++ head/tools/boot/rootgen.sh Sat Jun 16 17:45:44 2018 (r335259) @@ -389,16 +389,8 @@ 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 # XXX From owner-svn-src-head@freebsd.org Sat Jun 16 18:22:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96128101E66D; Sat, 16 Jun 2018 18:22:36 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 480F86A8CD; Sat, 16 Jun 2018 18:22:36 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 28A361F6E; Sat, 16 Jun 2018 18:22:36 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5GIMaS7016639; Sat, 16 Jun 2018 18:22:36 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5GIMZ9q016637; Sat, 16 Jun 2018 18:22:35 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201806161822.w5GIMZ9q016637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sat, 16 Jun 2018 18:22:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335260 - head/tests/sys/audit X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/audit X-SVN-Commit-Revision: 335260 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2018 18:22:36 -0000 Author: asomers Date: Sat Jun 16 18:22:35 2018 New Revision: 335260 URL: https://svnweb.freebsd.org/changeset/base/335260 Log: audit(4): add tests for POSIX message queues Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15848 Added: head/tests/sys/audit/inter-process.c (contents, props changed) Modified: head/tests/sys/audit/Makefile Modified: head/tests/sys/audit/Makefile ============================================================================== --- head/tests/sys/audit/Makefile Sat Jun 16 17:45:44 2018 (r335259) +++ head/tests/sys/audit/Makefile Sat Jun 16 18:22:35 2018 (r335260) @@ -11,6 +11,7 @@ ATF_TESTS_C+= file-write ATF_TESTS_C+= file-read ATF_TESTS_C+= open ATF_TESTS_C+= network +ATF_TESTS_C+= inter-process SRCS.file-attribute-access+= file-attribute-access.c SRCS.file-attribute-access+= utils.c @@ -30,6 +31,8 @@ SRCS.open+= open.c SRCS.open+= utils.c SRCS.network+= network.c SRCS.network+= utils.c +SRCS.inter-process+= inter-process.c +SRCS.inter-process+= utils.c TEST_METADATA+= timeout="30" TEST_METADATA+= required_user="root" Added: head/tests/sys/audit/inter-process.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/audit/inter-process.c Sat Jun 16 18:22:35 2018 (r335260) @@ -0,0 +1,413 @@ +/*- + * Copyright (c) 2018 Aniket Pandey + * + * 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 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * 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 + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "utils.h" +#define BUFFSIZE 80 + +struct msgstr { + long int mtype; + char mtext[BUFFSIZE]; +}; +typedef struct msgstr msgstr_t; + +static int msqid; +static struct pollfd fds[1]; +static struct msqid_ds msgbuff; +static char ipcregex[BUFFSIZE]; +static const char *auclass = "ip"; + + +ATF_TC_WITH_CLEANUP(msgget_success); +ATF_TC_HEAD(msgget_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "msgget(2) call"); +} + +ATF_TC_BODY(msgget_success, tc) +{ + FILE *pipefd = setup(fds, auclass); + /* Create a message queue and obtain the corresponding identifier */ + ATF_REQUIRE((msqid = msgget(IPC_PRIVATE, IPC_CREAT | S_IRUSR)) != -1); + /* Check the presence of message queue ID in audit record */ + snprintf(ipcregex, sizeof(ipcregex), + "msgget.*return,success,%d", msqid); + check_audit(fds, ipcregex, pipefd); + + /* Destroy the message queue with ID = msqid */ + ATF_REQUIRE_EQ(0, msgctl(msqid, IPC_RMID, NULL)); +} + +ATF_TC_CLEANUP(msgget_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(msgget_failure); +ATF_TC_HEAD(msgget_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "msgget(2) call"); +} + +ATF_TC_BODY(msgget_failure, tc) +{ + const char *regex = "msgget.*return,failure.*No such file or directory"; + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(-1, msgget((key_t)(-1), 0)); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(msgget_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(msgsnd_success); +ATF_TC_HEAD(msgsnd_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "msgsnd(2) call"); +} + +ATF_TC_BODY(msgsnd_success, tc) +{ + /* Create a message queue and obtain the corresponding identifier */ + ATF_REQUIRE((msqid = msgget(IPC_PRIVATE, IPC_CREAT | S_IRUSR)) != -1); + + /* Initialize a msgstr_t structure to store message */ + msgstr_t msg; + msg.mtype = 1; + memset(msg.mtext, 0, BUFFSIZE); + + /* Check the presence of message queue ID in audit record */ + snprintf(ipcregex, sizeof(ipcregex), + "msgsnd.*Message IPC.*%d.*return,success", msqid); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, msgsnd(msqid, &msg, BUFFSIZE, IPC_NOWAIT)); + check_audit(fds, ipcregex, pipefd); + + /* Destroy the message queue with ID = msqid */ + ATF_REQUIRE_EQ(0, msgctl(msqid, IPC_RMID, NULL)); +} + +ATF_TC_CLEANUP(msgsnd_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(msgsnd_failure); +ATF_TC_HEAD(msgsnd_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "msgsnd(2) call"); +} + +ATF_TC_BODY(msgsnd_failure, tc) +{ + const char *regex = "msgsnd.*Message IPC.*return,failure : Bad address"; + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(-1, msgsnd(-1, NULL, 0, IPC_NOWAIT)); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(msgsnd_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(msgrcv_success); +ATF_TC_HEAD(msgrcv_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "msgrcv(2) call"); +} + +ATF_TC_BODY(msgrcv_success, tc) +{ + ssize_t recv_bytes; + /* Create a message queue and obtain the corresponding identifier */ + ATF_REQUIRE((msqid = msgget(IPC_PRIVATE, IPC_CREAT | S_IRUSR)) != -1); + + /* Initialize two msgstr_t structures to store respective messages */ + msgstr_t msg1, msg2; + msg1.mtype = 1; + memset(msg1.mtext, 0, BUFFSIZE); + + /* Send a message to the queue with ID = msqid */ + ATF_REQUIRE_EQ(0, msgsnd(msqid, &msg1, BUFFSIZE, IPC_NOWAIT)); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE((recv_bytes = msgrcv(msqid, &msg2, + BUFFSIZE, 0, MSG_NOERROR | IPC_NOWAIT)) != -1); + /* Check the presence of queue ID and returned bytes in audit record */ + snprintf(ipcregex, sizeof(ipcregex), + "msgrcv.*Message IPC,*%d.*return,success,%zd", msqid, recv_bytes); + check_audit(fds, ipcregex, pipefd); + + /* Destroy the message queue with ID = msqid */ + ATF_REQUIRE_EQ(0, msgctl(msqid, IPC_RMID, NULL)); +} + +ATF_TC_CLEANUP(msgrcv_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(msgrcv_failure); +ATF_TC_HEAD(msgrcv_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "msgrcv(2) call"); +} + +ATF_TC_BODY(msgrcv_failure, tc) +{ + const char *regex = "msgrcv.*return,failure : Invalid argument"; + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(-1, msgrcv(-1, NULL, 0, 0, MSG_NOERROR | IPC_NOWAIT)); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(msgrcv_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(msgctl_rmid_success); +ATF_TC_HEAD(msgctl_rmid_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "msgctl(2) call for IPC_RMID command"); +} + +ATF_TC_BODY(msgctl_rmid_success, tc) +{ + /* Create a message queue and obtain the corresponding identifier */ + ATF_REQUIRE((msqid = msgget(IPC_PRIVATE, IPC_CREAT | S_IRUSR)) != -1); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, msgctl(msqid, IPC_RMID, NULL)); + /* Check the presence of queue ID and IPC_RMID in audit record */ + snprintf(ipcregex, sizeof(ipcregex), + "msgctl.*IPC_RMID.*%d.*return,success", msqid); + check_audit(fds, ipcregex, pipefd); +} + +ATF_TC_CLEANUP(msgctl_rmid_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(msgctl_rmid_failure); +ATF_TC_HEAD(msgctl_rmid_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "msgctl(2) call for IPC_RMID command"); +} + +ATF_TC_BODY(msgctl_rmid_failure, tc) +{ + const char *regex = "msgctl.*IPC_RMID.*return,failur.*Invalid argument"; + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(-1, msgctl(-1, IPC_RMID, NULL)); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(msgctl_rmid_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(msgctl_stat_success); +ATF_TC_HEAD(msgctl_stat_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "msgctl(2) call for IPC_STAT command"); +} + +ATF_TC_BODY(msgctl_stat_success, tc) +{ + /* Create a message queue and obtain the corresponding identifier */ + ATF_REQUIRE((msqid = msgget(IPC_PRIVATE, IPC_CREAT | S_IRUSR)) != -1); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, msgctl(msqid, IPC_STAT, &msgbuff)); + /* Check the presence of queue ID and IPC_STAT in audit record */ + snprintf(ipcregex, sizeof(ipcregex), + "msgctl.*IPC_STAT.*%d.*return,success", msqid); + check_audit(fds, ipcregex, pipefd); + + /* Destroy the message queue with ID = msqid */ + ATF_REQUIRE_EQ(0, msgctl(msqid, IPC_RMID, NULL)); +} + +ATF_TC_CLEANUP(msgctl_stat_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(msgctl_stat_failure); +ATF_TC_HEAD(msgctl_stat_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "msgctl(2) call for IPC_STAT command"); +} + +ATF_TC_BODY(msgctl_stat_failure, tc) +{ + const char *regex = "msgctl.*IPC_STAT.*return,failur.*Invalid argument"; + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(-1, msgctl(-1, IPC_STAT, &msgbuff)); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(msgctl_stat_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(msgctl_set_success); +ATF_TC_HEAD(msgctl_set_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "msgctl(2) call for IPC_SET command"); +} + +ATF_TC_BODY(msgctl_set_success, tc) +{ + /* Create a message queue and obtain the corresponding identifier */ + ATF_REQUIRE((msqid = msgget(IPC_PRIVATE, IPC_CREAT | S_IRUSR)) != -1); + /* Fill up the msgbuff structure to be used with IPC_SET */ + ATF_REQUIRE_EQ(0, msgctl(msqid, IPC_STAT, &msgbuff)); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, msgctl(msqid, IPC_SET, &msgbuff)); + /* Check the presence of message queue ID in audit record */ + snprintf(ipcregex, sizeof(ipcregex), + "msgctl.*IPC_SET.*%d.*return,success", msqid); + check_audit(fds, ipcregex, pipefd); + + /* Destroy the message queue with ID = msqid */ + ATF_REQUIRE_EQ(0, msgctl(msqid, IPC_RMID, NULL)); +} + +ATF_TC_CLEANUP(msgctl_set_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(msgctl_set_failure); +ATF_TC_HEAD(msgctl_set_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "msgctl(2) call for IPC_SET command"); +} + +ATF_TC_BODY(msgctl_set_failure, tc) +{ + const char *regex = "msgctl.*IPC_SET.*return,failure.*Invalid argument"; + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(-1, msgctl(-1, IPC_SET, &msgbuff)); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(msgctl_set_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(msgctl_illegal_command); +ATF_TC_HEAD(msgctl_illegal_command, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "msgctl(2) call for illegal cmd value"); +} + +ATF_TC_BODY(msgctl_illegal_command, tc) +{ + /* Create a message queue and obtain the corresponding identifier */ + ATF_REQUIRE((msqid = msgget(IPC_PRIVATE, IPC_CREAT | S_IRUSR)) != -1); + + const char *regex = "msgctl.*illegal command.*failur.*Invalid argument"; + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(-1, msgctl(msqid, -1, &msgbuff)); + check_audit(fds, regex, pipefd); + + /* Destroy the message queue with ID = msqid */ + ATF_REQUIRE_EQ(0, msgctl(msqid, IPC_RMID, NULL)); +} + +ATF_TC_CLEANUP(msgctl_illegal_command, tc) +{ + cleanup(); +} + + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, msgget_success); + ATF_TP_ADD_TC(tp, msgget_failure); + ATF_TP_ADD_TC(tp, msgsnd_success); + ATF_TP_ADD_TC(tp, msgsnd_failure); + ATF_TP_ADD_TC(tp, msgrcv_success); + ATF_TP_ADD_TC(tp, msgrcv_failure); + + ATF_TP_ADD_TC(tp, msgctl_rmid_success); + ATF_TP_ADD_TC(tp, msgctl_rmid_failure); + ATF_TP_ADD_TC(tp, msgctl_stat_success); + ATF_TP_ADD_TC(tp, msgctl_stat_failure); + ATF_TP_ADD_TC(tp, msgctl_set_success); + ATF_TP_ADD_TC(tp, msgctl_set_failure); + ATF_TP_ADD_TC(tp, msgctl_illegal_command); + + return (atf_no_error()); +} From owner-svn-src-head@freebsd.org Sat Jun 16 18:29:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE1C3101E89A; Sat, 16 Jun 2018 18:29:24 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A22A86AB1E; Sat, 16 Jun 2018 18:29:24 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 833E81F7B; Sat, 16 Jun 2018 18:29:24 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5GITO59016964; Sat, 16 Jun 2018 18:29:24 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5GITOT3016963; Sat, 16 Jun 2018 18:29:24 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201806161829.w5GITOT3016963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sat, 16 Jun 2018 18:29:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335261 - head/tests/sys/audit X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/audit X-SVN-Commit-Revision: 335261 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2018 18:29:25 -0000 Author: asomers Date: Sat Jun 16 18:29:24 2018 New Revision: 335261 URL: https://svnweb.freebsd.org/changeset/base/335261 Log: audit(4): add tests for pathconf(2) and friends pathconf, lpathconf, and fpathconf are included Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15842 Modified: head/tests/sys/audit/file-attribute-access.c Modified: head/tests/sys/audit/file-attribute-access.c ============================================================================== --- head/tests/sys/audit/file-attribute-access.c Sat Jun 16 18:22:35 2018 (r335260) +++ head/tests/sys/audit/file-attribute-access.c Sat Jun 16 18:29:24 2018 (r335261) @@ -661,6 +661,144 @@ ATF_TC_CLEANUP(faccessat_failure, tc) } +ATF_TC_WITH_CLEANUP(pathconf_success); +ATF_TC_HEAD(pathconf_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "pathconf(2) call"); +} + +ATF_TC_BODY(pathconf_success, tc) +{ + /* File needs to exist to call pathconf(2) */ + ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + FILE *pipefd = setup(fds, auclass); + /* Get the maximum number of bytes of filename */ + ATF_REQUIRE(pathconf(path, _PC_NAME_MAX) != -1); + check_audit(fds, successreg, pipefd); + close(filedesc); +} + +ATF_TC_CLEANUP(pathconf_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(pathconf_failure); +ATF_TC_HEAD(pathconf_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "pathconf(2) call"); +} + +ATF_TC_BODY(pathconf_failure, tc) +{ + FILE *pipefd = setup(fds, auclass); + /* Failure reason: file does not exist */ + ATF_REQUIRE_EQ(-1, pathconf(errpath, _PC_NAME_MAX)); + check_audit(fds, failurereg, pipefd); +} + +ATF_TC_CLEANUP(pathconf_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(lpathconf_success); +ATF_TC_HEAD(lpathconf_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "lpathconf(2) call"); +} + +ATF_TC_BODY(lpathconf_success, tc) +{ + /* Symbolic link needs to exist to call lpathconf(2) */ + ATF_REQUIRE_EQ(0, symlink("symlink", path)); + FILE *pipefd = setup(fds, auclass); + /* Get the maximum number of bytes of symlink's name */ + ATF_REQUIRE(lpathconf(path, _PC_SYMLINK_MAX) != -1); + check_audit(fds, successreg, pipefd); +} + +ATF_TC_CLEANUP(lpathconf_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(lpathconf_failure); +ATF_TC_HEAD(lpathconf_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "lpathconf(2) call"); +} + +ATF_TC_BODY(lpathconf_failure, tc) +{ + FILE *pipefd = setup(fds, auclass); + /* Failure reason: symbolic link does not exist */ + ATF_REQUIRE_EQ(-1, lpathconf(errpath, _PC_SYMLINK_MAX)); + check_audit(fds, failurereg, pipefd); +} + +ATF_TC_CLEANUP(lpathconf_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(fpathconf_success); +ATF_TC_HEAD(fpathconf_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "fpathconf(2) call"); +} + +ATF_TC_BODY(fpathconf_success, tc) +{ + pid = getpid(); + snprintf(extregex, sizeof(extregex), "fpathconf.*%d.*success", pid); + + /* File needs to exist to call fpathconf(2) */ + ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + FILE *pipefd = setup(fds, auclass); + /* Get the maximum number of bytes of filename */ + ATF_REQUIRE(fpathconf(filedesc, _PC_NAME_MAX) != -1); + check_audit(fds, extregex, pipefd); + close(filedesc); +} + +ATF_TC_CLEANUP(fpathconf_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(fpathconf_failure); +ATF_TC_HEAD(fpathconf_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "fpathconf(2) call"); +} + +ATF_TC_BODY(fpathconf_failure, tc) +{ + FILE *pipefd = setup(fds, auclass); + const char *regex = "fpathconf.*return,failure : Bad file descriptor"; + /* Failure reason: Bad file descriptor */ + ATF_REQUIRE_EQ(-1, fpathconf(-1, _PC_NAME_MAX)); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(fpathconf_failure, tc) +{ + cleanup(); +} + + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, stat_success); @@ -693,6 +831,13 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, eaccess_failure); ATF_TP_ADD_TC(tp, faccessat_success); ATF_TP_ADD_TC(tp, faccessat_failure); + + ATF_TP_ADD_TC(tp, pathconf_success); + ATF_TP_ADD_TC(tp, pathconf_failure); + ATF_TP_ADD_TC(tp, lpathconf_success); + ATF_TP_ADD_TC(tp, lpathconf_failure); + ATF_TP_ADD_TC(tp, fpathconf_success); + ATF_TP_ADD_TC(tp, fpathconf_failure); return (atf_no_error()); } From owner-svn-src-head@freebsd.org Sat Jun 16 19:21:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9119B101FBB9; Sat, 16 Jun 2018 19:21:10 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46F8C6C3BD; Sat, 16 Jun 2018 19:21:10 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2834827EE; Sat, 16 Jun 2018 19:21:10 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5GJLAfl045384; Sat, 16 Jun 2018 19:21:10 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5GJLA88045383; Sat, 16 Jun 2018 19:21:10 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201806161921.w5GJLA88045383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sat, 16 Jun 2018 19:21:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335262 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 335262 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2018 19:21:10 -0000 Author: ae Date: Sat Jun 16 19:21:09 2018 New Revision: 335262 URL: https://svnweb.freebsd.org/changeset/base/335262 Log: Fix typo. Reported by: rpokala Modified: head/sys/net/radix.h Modified: head/sys/net/radix.h ============================================================================== --- head/sys/net/radix.h Sat Jun 16 18:29:24 2018 (r335261) +++ head/sys/net/radix.h Sat Jun 16 19:21:09 2018 (r335262) @@ -159,15 +159,15 @@ void rn_inithead_internal(struct radix_head *rh, struc #define R_Zalloc(p, t, n) (p = (t) malloc((unsigned long)(n), M_RTABLE, M_NOWAIT | M_ZERO)) #define R_Free(p) free((caddr_t)p, M_RTABLE); -#define RADIX_NODE_HEAD_RLOCK_TRACKER struct rm_priotracker _rhn_tracker +#define RADIX_NODE_HEAD_RLOCK_TRACKER struct rm_priotracker _rnh_tracker #define RADIX_NODE_HEAD_LOCK_INIT(rnh) \ rm_init(&(rnh)->rnh_lock, "radix node head") #define RADIX_NODE_HEAD_LOCK(rnh) rm_wlock(&(rnh)->rnh_lock) #define RADIX_NODE_HEAD_UNLOCK(rnh) rm_wunlock(&(rnh)->rnh_lock) #define RADIX_NODE_HEAD_RLOCK(rnh) rm_rlock(&(rnh)->rnh_lock,\ - &_rhn_tracker) + &_rnh_tracker) #define RADIX_NODE_HEAD_RUNLOCK(rnh) rm_runlock(&(rnh)->rnh_lock,\ - &_rhn_tracker) + &_rnh_tracker) #define RADIX_NODE_HEAD_DESTROY(rnh) rm_destroy(&(rnh)->rnh_lock) #define RADIX_NODE_HEAD_LOCK_ASSERT(rnh) rm_assert(&(rnh)->rnh_lock, RA_LOCKED) #define RADIX_NODE_HEAD_WLOCK_ASSERT(rnh) rm_assert(&(rnh)->rnh_lock, RA_WLOCKED) From owner-svn-src-head@freebsd.org Sat Jun 16 19:21:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C91ED101FC17; Sat, 16 Jun 2018 19:21:47 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f50.google.com (mail-it0-f50.google.com [209.85.214.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D2916C690; Sat, 16 Jun 2018 19:21:47 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f50.google.com with SMTP id 16-v6so7031003itl.5; Sat, 16 Jun 2018 12:21:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=Xclq+WcddKhvAiDjEWCqJj5JZ+/rPx+3sIzxIUmFbfQ=; b=DaiPJMAO4w/TyFKCfAFaMsuCX+upd3x4MzmVdyD4414CuGNP/cyWmcGC5G+jn7UyF5 JAM/0661YBupu9VF+IVusGv1W6xOxbqUr9NqnhNjML7/1+DDdyjJ66L2bvE9yO9ib0Od QFsYD7gykB+xNvOgQkfS+B3TXSQrkHNRrS9YhLobpAfyufb9sAAMzEfkiqdb4Zt8734O SILZ/7ZpNDTKsZu5RBnNqzu6I0aVz2Pm6UwbrADN1JaiBJTY1RxIpQ8G14sTOKDyExt3 o9eiEO1a50fkHutt/ua1fAjh1eJn36YAx397wuzPLpitziSR1xr/Bk5P+evQdqUYf4Pj iDEw== X-Gm-Message-State: APt69E0SgLf1CFwmfimJjdUq7f+Cswb7CZfXZ0gLXHGwlbUSiD5A3/8y zYfk8SJK6XKDsjT8zhFq8zrSUeiR X-Google-Smtp-Source: ADUXVKIYSzIkTXwxP3wZA+r1OPnc97WfsDFWs1FrEENsHG7KWevX971+fUKmu+xb/hZT0O22ow+org== X-Received: by 2002:a24:1a10:: with SMTP id 16-v6mr5566498iti.66.1529175230705; Sat, 16 Jun 2018 11:53:50 -0700 (PDT) Received: from mail-it0-f43.google.com (mail-it0-f43.google.com. [209.85.214.43]) by smtp.gmail.com with ESMTPSA id g17-v6sm2113431iti.1.2018.06.16.11.53.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Jun 2018 11:53:50 -0700 (PDT) Received: by mail-it0-f43.google.com with SMTP id u4-v6so7006681itg.0; Sat, 16 Jun 2018 11:53:49 -0700 (PDT) X-Received: by 2002:a24:100f:: with SMTP id 15-v6mr5252260ity.61.1529175229868; Sat, 16 Jun 2018 11:53:49 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:5995:0:0:0:0:0 with HTTP; Sat, 16 Jun 2018 11:53:49 -0700 (PDT) In-Reply-To: References: <201806110842.w5B8g4we013345@repo.freebsd.org> From: Conrad Meyer Date: Sat, 16 Jun 2018 11:53:49 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334947 - head/sys/modules To: Kurt Lidl Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2018 19:21:48 -0000 r255185 added _mm_aesenc(), etc, but not _mm_sha*(). That's probably where the report comes from. (If you feel it is worth your while adding sha intrinsics to a decade-old GCC, go ahead, but I think gcc 4.2 on x86 is pretty dead.) Best, Conrad On Sat, Jun 16, 2018 at 7:57 AM, Kurt Lidl wrote: > On 6/11/18 4:42 AM, Dimitry Andric wrote: >> >> Author: dim >> Date: Mon Jun 11 08:42:03 2018 >> New Revision: 334947 >> URL: https://svnweb.freebsd.org/changeset/base/334947 >> >> Log: >> Disable building aesni with base gcc >> Because base gcc does not support the required intrinsics, do not >> attempt to compile the aesni module with it. >> Noticed by: Dan Allen >> MFC after: 3 days >> >> Modified: >> head/sys/modules/Makefile >> >> Modified: head/sys/modules/Makefile >> >> ============================================================================== >> --- head/sys/modules/Makefile Mon Jun 11 08:11:35 2018 (r334946) >> +++ head/sys/modules/Makefile Mon Jun 11 08:42:03 2018 (r334947) >> @@ -627,7 +627,9 @@ _aac= aac >> _aacraid= aacraid >> _acpi= acpi >> .if ${MK_CRYPT} != "no" || defined(ALL_MODULES) >> +.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} > 40201 >> _aesni= aesni >> +.endif >> .endif >> _amd_ecc_inject=amd_ecc_inject >> _amdsbwd= amdsbwd >> > > I thought that FreeBSD's base gcc (but not a stock 4.2.1 gcc) had support > for this. As documented in UPDATING: > > 20130903: > AES-NI intrinsic support has been added to gcc. The AES-NI module > has been updated to use this support. A new gcc is required to build > the aesni module on both i386 and amd64. > > -Kurt > From owner-svn-src-head@freebsd.org Sat Jun 16 19:45:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48B571020AB0; Sat, 16 Jun 2018 19:45:07 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F323F6D25F; Sat, 16 Jun 2018 19:45:06 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BAE202CC2; Sat, 16 Jun 2018 19:45:06 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5GJj60o058167; Sat, 16 Jun 2018 19:45:06 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5GJj6V4058166; Sat, 16 Jun 2018 19:45:06 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201806161945.w5GJj6V4058166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 16 Jun 2018 19:45:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335263 - head/sys/fs/nfs X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfs X-SVN-Commit-Revision: 335263 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2018 19:45:07 -0000 Author: rmacklem Date: Sat Jun 16 19:45:06 2018 New Revision: 335263 URL: https://svnweb.freebsd.org/changeset/base/335263 Log: Fix NFSv4.1 client side handling of "soft,retrans=2" mounts. Normally "soft,retrans=2" cannot be safely used on NFSv4 mounts, since the RPC can fail and leave the open/lock state in an undefined state. Doing I/O on a pNFS DS is an exception to this, since no open/lock state is maintained on the DS server. It is useful to do "soft,retrans=2" connections to a DS when it is mirrored, so that the client can detect failure of the DS. As such, mounts from the MDS to the DSs should use these mount options when mirroring is enabled. However, the NFSv4.1 client still leaves the session in an undefined state when this happens. This patch fixes the problem by setting the session defunct, so it will no longer be used. The patch also sets "retries=2" on the connections done by the client to a DS, which is the internal equivalent of "soft,retrans=2". The client does not know if the server implements mirroring at connection time, but always doing this should be safe, since it will fall back on doing I/O via the MDS as a proxy when there is a failure doing an I/O RPC to the DS. This patch should not affect non-pNFS client mounts. MFC after: 2 weeks Modified: head/sys/fs/nfs/nfs_commonkrpc.c Modified: head/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- head/sys/fs/nfs/nfs_commonkrpc.c Sat Jun 16 19:21:09 2018 (r335262) +++ head/sys/fs/nfs/nfs_commonkrpc.c Sat Jun 16 19:45:06 2018 (r335263) @@ -157,6 +157,9 @@ static int nfsv2_procid[NFS_V3NPROCS] = { /* * Initialize sockets and congestion for a new NFS connection. * We do not free the sockaddr if error. + * Which arguments are set to NULL indicate what kind of call it is. + * cred == NULL --> a call to connect to a pNFS DS + * nmp == NULL --> indicates an upcall to userland or a NFSv4 callback */ int newnfs_connect(struct nfsmount *nmp, struct nfssockreq *nrp, @@ -293,24 +296,38 @@ newnfs_connect(struct nfsmount *nmp, struct nfssockreq retries = nmp->nm_retry; } else retries = INT_MAX; - /* cred == NULL for DS connects. */ - if (NFSHASNFSV4N(nmp) && cred != NULL) { - /* - * Make sure the nfscbd_pool doesn't get destroyed - * while doing this. - */ - NFSD_LOCK(); - if (nfs_numnfscbd > 0) { - nfs_numnfscbd++; - NFSD_UNLOCK(); - xprt = svc_vc_create_backchannel(nfscbd_pool); - CLNT_CONTROL(client, CLSET_BACKCHANNEL, xprt); + if (NFSHASNFSV4N(nmp)) { + if (cred != NULL) { + /* + * Make sure the nfscbd_pool doesn't get + * destroyed while doing this. + */ NFSD_LOCK(); - nfs_numnfscbd--; - if (nfs_numnfscbd == 0) - wakeup(&nfs_numnfscbd); + if (nfs_numnfscbd > 0) { + nfs_numnfscbd++; + NFSD_UNLOCK(); + xprt = svc_vc_create_backchannel( + nfscbd_pool); + CLNT_CONTROL(client, CLSET_BACKCHANNEL, + xprt); + NFSD_LOCK(); + nfs_numnfscbd--; + if (nfs_numnfscbd == 0) + wakeup(&nfs_numnfscbd); + } + NFSD_UNLOCK(); + } else { + /* + * cred == NULL for a DS connect. + * For connects to a DS, set a retry limit + * so that failed DSs will be detected. + * This is ok for NFSv4.1, since a DS does + * not maintain open/lock state and is the + * only case where using a "soft" mount is + * recommended for NFSv4. + */ + retries = 2; } - NFSD_UNLOCK(); } } else { /* @@ -762,6 +779,7 @@ tryagain: else stat = CLNT_CALL_MBUF(nrp->nr_client, &ext, procnum, nd->nd_mreq, &nd->nd_mrep, timo); + NFSCL_DEBUG(2, "clnt call=%d\n", stat); if (rep != NULL) { /* @@ -789,6 +807,60 @@ tryagain: error = EPROTONOSUPPORT; } else if (stat == RPC_INTR) { error = EINTR; + } else if (stat == RPC_CANTSEND || stat == RPC_CANTRECV || + stat == RPC_SYSTEMERROR) { + if ((nd->nd_flag & ND_NFSV41) != 0 && nmp != NULL && + nd->nd_procnum != NFSPROC_NULL) { + /* + * The nfsess_defunct field is protected by + * the NFSLOCKMNT()/nm_mtx lock and not the + * nfsess_mtx lock to simplify its handling, + * for the MDS session. This lock is also + * sufficient for nfsess_sessionid, since it + * never changes in the structure. + */ + NFSLOCKCLSTATE(); + NFSLOCKMNT(nmp); + /* The session must be marked defunct. */ + if (dssep == NULL) { + /* + * This is either an MDS proxy operation or + * a client mount with "soft,retrans=N" options. + * Mark the MDS session defunct and initiate + * recovery, as required. + */ + NFSCL_DEBUG(1, "Failed soft proxy RPC\n"); + sep = NFSMNT_MDSSESSION(nmp); + if (bcmp(sep->nfsess_sessionid, nd->nd_sequence, + NFSX_V4SESSIONID) == 0) { + /* Initiate recovery. */ + sep->nfsess_defunct = 1; + NFSCL_DEBUG(1, "Marked defunct\n"); + if (nmp->nm_clp != NULL) { + nmp->nm_clp->nfsc_flags |= + NFSCLFLAGS_RECOVER; + wakeup(nmp->nm_clp); + } + } + } else { + /* + * This is a client side DS RPC. Just mark + * the session defunct. A subsequent LayoutGet + * should get a new session. + */ + NFSCL_DEBUG(1, "Failed client DS RPC\n"); + if (bcmp(dssep->nfsess_sessionid, + nd->nd_sequence, NFSX_V4SESSIONID) == 0) { + /* Mark it defunct. */ + dssep->nfsess_defunct = 1; + NFSCL_DEBUG(1, "Marked defunct\n"); + } + } + NFSUNLOCKMNT(nmp); + NFSUNLOCKCLSTATE(); + } + NFSINCRGLOBAL(nfsstatsv1.rpcinvalid); + error = ENXIO; } else { NFSINCRGLOBAL(nfsstatsv1.rpcinvalid); error = EACCES; From owner-svn-src-head@freebsd.org Sat Jun 16 20:00:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CB6C10210E7; Sat, 16 Jun 2018 20:00:42 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 435016D80D; Sat, 16 Jun 2018 20:00:42 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 24A1F2E7C; Sat, 16 Jun 2018 20:00:42 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5GK0grx063490; Sat, 16 Jun 2018 20:00:42 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5GK0g88063489; Sat, 16 Jun 2018 20:00:42 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201806162000.w5GK0g88063489@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sat, 16 Jun 2018 20:00:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335264 - head/lib/libdpv X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/lib/libdpv X-SVN-Commit-Revision: 335264 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2018 20:00:42 -0000 Author: dteske Date: Sat Jun 16 20:00:41 2018 New Revision: 335264 URL: https://svnweb.freebsd.org/changeset/base/335264 Log: Fix comparison between pointer and char literal PR: misc/204252 Reported by: David Binderman MFC after: 3 days X-MFC-to: stable/11, stable/10 Modified: head/lib/libdpv/dprompt.c Modified: head/lib/libdpv/dprompt.c ============================================================================== --- head/lib/libdpv/dprompt.c Sat Jun 16 19:45:06 2018 (r335263) +++ head/lib/libdpv/dprompt.c Sat Jun 16 20:00:41 2018 (r335264) @@ -89,7 +89,7 @@ spin_char(void) { char ch; - if (spin_cp == '\0') + if (*spin_cp == '\0') spin_cp = spin; ch = *spin_cp; From owner-svn-src-head@freebsd.org Sat Jun 16 20:02:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F07610211F1; Sat, 16 Jun 2018 20:02:23 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id AEF656DC26; Sat, 16 Jun 2018 20:02:22 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 6CB821A19E5; Sun, 17 Jun 2018 06:02:19 +1000 (AEST) Date: Sun, 17 Jun 2018 06:02:17 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Kurt Lidl cc: Dimitry Andric , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334947 - head/sys/modules In-Reply-To: Message-ID: <20180617044603.I5366@besplex.bde.org> References: <201806110842.w5B8g4we013345@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=cIaQihWN c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=z4136HUofsvlIop_37sA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2018 20:02:23 -0000 On Sat, 16 Jun 2018, Kurt Lidl wrote: > On 6/11/18 4:42 AM, Dimitry Andric wrote: >> /// >> Log: >> Disable building aesni with base gcc >> Because base gcc does not support the required intrinsics, do not >> attempt to compile the aesni module with it. >> ... >> Modified: head/sys/modules/Makefile >> ============================================================================== >> --- head/sys/modules/Makefile Mon Jun 11 08:11:35 2018 (r334946) >> +++ head/sys/modules/Makefile Mon Jun 11 08:42:03 2018 (r334947) >> @@ -627,7 +627,9 @@ _aac= aac >> _aacraid= aacraid >> _acpi= acpi >> .if ${MK_CRYPT} != "no" || defined(ALL_MODULES) >> +.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} > 40201 >> _aesni= aesni >> +.endif >> .endif >> _amd_ecc_inject=amd_ecc_inject >> _amdsbwd= amdsbwd LINT is still broken. LINT would be even more broken if aesni were removed from it, since its purpose is to detect uncompilable code. > I thought that FreeBSD's base gcc (but not a stock 4.2.1 gcc) had support for > this. As documented in UPDATING: > > 20130903: > AES-NI intrinsic support has been added to gcc. The AES-NI module > has been updated to use this support. A new gcc is required to build > the aesni module on both i386 and amd64. -maes is accepted by the version of gcc-4.2.1 that I used (buuilt under -current a year or 2 ago), aesni also hard-codes -msse4 and -mpclmul and -msha in CFLAGS. gcc-4.2.1 has no chance of supporting the large changes needed for at least SSE4 (it does accept -msse3). aesni wasn't broken to use -msse4 until 2014/12/12. Not much else is broken in LINT except this: on i386: - LINT doesn't even config cleanly, since it duplicates (or tries to vary) options in DEFAULTS. It even duplicates one of its own options by placing it in the undocumented section as well as in a documented section. Bitrot in the undocumented section has filled it with many documented options. These errors is not fatal. - the UKBD_DFLT_KEYMAP option is broken by referencing a file outside of the sys tree where it doesn't always exist - handling of the previous bug is broken. An empty header file is created so the creation error is not detected again. Compiling ukbd.c fails because the empty header doesn't contain the declarations needed. - a few more files have conversions between pointers and integers of different sizes. On amd64: - fpu.c fails to compile in all kernels, not just LINT, since it uses ifuncs - efirt.c fails to compile since it dereferences a pointer to an incomplete type. It is "optional efirt", so this doesn't break most kernels. It is not configured by GENERIC either. - tcp_hpts.c fails to compile because uses a line with a syntax error in sys/kern/prefetch.h (an colon to start a clobber list in an asm statement, and then no clobber list)). The same line has about 10 style bugs. - no files fail to compile due to conversions between pointers and integers of different sizes. Building of modules is completely broken, but I usually turn them off. I use makeoptious to set CC to gcc-4.2.1, and COMPILER_TYPE to gcc, and also to put gcc-specific flags in CONF_CFLAGS. CC is not inherited in subdirs, but CONF_CFLAGS is, so when the wrong cc is used for modules it always fails if it uses CFLAGS. Bruce From owner-svn-src-head@freebsd.org Sat Jun 16 21:07:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3AE781022C17; Sat, 16 Jun 2018 21:07:47 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA9FD6F785; Sat, 16 Jun 2018 21:07:46 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB96A3DBB; Sat, 16 Jun 2018 21:07:46 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5GL7k8r098647; Sat, 16 Jun 2018 21:07:46 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5GL7kHG098646; Sat, 16 Jun 2018 21:07:46 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806162107.w5GL7kHG098646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 16 Jun 2018 21:07:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335265 - head/usr.bin/units X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/units X-SVN-Commit-Revision: 335265 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2018 21:07:47 -0000 Author: eadler Date: Sat Jun 16 21:07:46 2018 New Revision: 335265 URL: https://svnweb.freebsd.org/changeset/base/335265 Log: units: fix some nits - prefer braces to abusing the `,` operator - mark dead function as dead - remove dead break Modified: head/usr.bin/units/units.c Modified: head/usr.bin/units/units.c ============================================================================== --- head/usr.bin/units/units.c Sat Jun 16 20:00:41 2018 (r335264) +++ head/usr.bin/units/units.c Sat Jun 16 21:07:46 2018 (r335265) @@ -625,8 +625,10 @@ compareproducts(char **one, char **two) two++; else if (strcmp(*one, *two)) return 1; - else - one++, two++; + else { + one++; + two++; + } } return 0; } @@ -726,7 +728,7 @@ showanswer(struct unittype * have, struct unittype * w } -static void +static void __dead2 usage(void) { fprintf(stderr, @@ -805,7 +807,6 @@ main(int argc, char **argv) else printf("Units data file not found"); exit(0); - break; case 'h': /* FALLTHROUGH */ From owner-svn-src-head@freebsd.org Sat Jun 16 21:51:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFEAB1023E97; Sat, 16 Jun 2018 21:51:13 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3820671014; Sat, 16 Jun 2018 21:51:13 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from coleburn.home.andric.com (coleburn.home.andric.com [192.168.0.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 4DBD54C708; Sat, 16 Jun 2018 23:51:03 +0200 (CEST) From: Dimitry Andric Message-Id: <77FB2EB5-5C81-42DE-BA57-72B2926DD2FA@FreeBSD.org> Content-Type: multipart/signed; boundary="Apple-Mail=_8FF65CD6-F726-42B7-832B-41C3F2EA168B"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Subject: Re: svn commit: r334947 - head/sys/modules Date: Sat, 16 Jun 2018 23:50:52 +0200 In-Reply-To: Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Kurt Lidl References: <201806110842.w5B8g4we013345@repo.freebsd.org> X-Mailer: Apple Mail (2.3445.8.2) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2018 21:51:14 -0000 --Apple-Mail=_8FF65CD6-F726-42B7-832B-41C3F2EA168B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 16 Jun 2018, at 16:57, Kurt Lidl wrote: >=20 > On 6/11/18 4:42 AM, Dimitry Andric wrote: >> Author: dim >> Date: Mon Jun 11 08:42:03 2018 >> New Revision: 334947 >> URL: https://svnweb.freebsd.org/changeset/base/334947 >> Log: >> Disable building aesni with base gcc >> Because base gcc does not support the required intrinsics, do = not >> attempt to compile the aesni module with it. >> Noticed by: Dan Allen >> MFC after: 3 days >> Modified: >> head/sys/modules/Makefile >> Modified: head/sys/modules/Makefile >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/modules/Makefile Mon Jun 11 08:11:35 2018 = (r334946) >> +++ head/sys/modules/Makefile Mon Jun 11 08:42:03 2018 = (r334947) >> @@ -627,7 +627,9 @@ _aac=3D aac >> _aacraid=3D aacraid >> _acpi=3D acpi >> .if ${MK_CRYPT} !=3D "no" || defined(ALL_MODULES) >> +.if ${COMPILER_TYPE} !=3D "gcc" || ${COMPILER_VERSION} > 40201 >> _aesni=3D aesni >> +.endif >> .endif >> _amd_ecc_inject=3Damd_ecc_inject >> _amdsbwd=3D amdsbwd >=20 > I thought that FreeBSD's base gcc (but not a stock 4.2.1 gcc) had = support for this. As documented in UPDATING: >=20 > 20130903: > AES-NI intrinsic support has been added to gcc. The AES-NI module > has been updated to use this support. A new gcc is required to build > the aesni module on both i386 and amd64. It didn't work for the original reporter on freebsd-stable@ here: https://lists.freebsd.org/pipermail/freebsd-stable/2018-May/089026.html and for me it still gives: $ make -C /usr/src/sys/modules/aesni gcc -c -O3 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -I. = -I/usr/src/sys -fno-common -mno-mmx -mno-sse -msoft-float -ffreestanding = -fwrapv -fstack-protector -Wall -Wredundant-decls -Wnested-externs = -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline = -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions = -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas = -Wno-uninitialized -finline-limit=3D8000 -fms-extensions --param = inline-unit-growth=3D100 --param large-function-growth=3D1000 = -mno-align-long-strings -mpreferred-stack-boundary=3D2 -std=3Diso9899:1999= -Werror -mmmx -msse -msse4 -maes -mpclmul = /usr/src/sys/crypto/aesni/aesni_ghash.c cc1: error: unrecognized command line option "-msse4" cc1: error: unrecognized command line option "-mpclmul" *** Error code 1 Those unrecognized flags were added more than 3 years ago, in r275732, so I assume this has been broken since that time. Maybe nobody built any kernels with gcc for 3 years? :) -Dimitry --Apple-Mail=_8FF65CD6-F726-42B7-832B-41C3F2EA168B Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCWyWGPAAKCRCwXqMKLiCW o/ZsAJ9Pdf1yQY7e9RnL5qgKrNQmNHlZyACg0hrsS7+Aqa5CVdhFJIravXsIeXo= =GhqP -----END PGP SIGNATURE----- --Apple-Mail=_8FF65CD6-F726-42B7-832B-41C3F2EA168B-- From owner-svn-src-head@freebsd.org Sat Jun 16 23:44:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C228100243D; Sat, 16 Jun 2018 23:44:19 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F99073F17; Sat, 16 Jun 2018 23:44:19 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 30BD757BB; Sat, 16 Jun 2018 23:44:19 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5GNiJA3081278; Sat, 16 Jun 2018 23:44:19 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5GNiIOw081276; Sat, 16 Jun 2018 23:44:18 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806162344.w5GNiIOw081276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 16 Jun 2018 23:44:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335266 - head/sbin/ddb X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/sbin/ddb X-SVN-Commit-Revision: 335266 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2018 23:44:19 -0000 Author: eadler Date: Sat Jun 16 23:44:18 2018 New Revision: 335266 URL: https://svnweb.freebsd.org/changeset/base/335266 Log: ddb: build with WARNS=6 Tested with amd64, arm64, i386, mips Modified: head/sbin/ddb/Makefile head/sbin/ddb/ddb_script.c Modified: head/sbin/ddb/Makefile ============================================================================== --- head/sbin/ddb/Makefile Sat Jun 16 21:07:46 2018 (r335265) +++ head/sbin/ddb/Makefile Sat Jun 16 23:44:18 2018 (r335266) @@ -4,7 +4,6 @@ PACKAGE=runtime PROG= ddb SRCS= ddb.c ddb_capture.c ddb_script.c MAN= ddb.8 -WARNS?= 3 LIBADD= kvm Modified: head/sbin/ddb/ddb_script.c ============================================================================== --- head/sbin/ddb/ddb_script.c Sat Jun 16 21:07:46 2018 (r335265) +++ head/sbin/ddb/ddb_script.c Sat Jun 16 23:44:18 2018 (r335266) @@ -135,7 +135,7 @@ ddb_script(int argc, char *argv[]) } void -ddb_scripts(int argc, char *argv[]) +ddb_scripts(int argc, char *argv[] __unused) { if (argc != 1) From owner-svn-src-head@freebsd.org Sat Jun 16 23:46:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8093110024F4; Sat, 16 Jun 2018 23:46:00 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 32727740AA; Sat, 16 Jun 2018 23:46:00 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E9B2D57BC; Sat, 16 Jun 2018 23:45:59 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5GNjxWV081388; Sat, 16 Jun 2018 23:45:59 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5GNjxsi081386; Sat, 16 Jun 2018 23:45:59 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806162345.w5GNjxsi081386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 16 Jun 2018 23:45:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335267 - head/sbin/gvinum X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/sbin/gvinum X-SVN-Commit-Revision: 335267 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2018 23:46:00 -0000 Author: eadler Date: Sat Jun 16 23:45:59 2018 New Revision: 335267 URL: https://svnweb.freebsd.org/changeset/base/335267 Log: gvinum: build with WARNS=6 This also removes an unused and uninitialized variable. Tested with amd64, arm64, i386, mips Modified: head/sbin/gvinum/Makefile head/sbin/gvinum/gvinum.c Modified: head/sbin/gvinum/Makefile ============================================================================== --- head/sbin/gvinum/Makefile Sat Jun 16 23:44:18 2018 (r335266) +++ head/sbin/gvinum/Makefile Sat Jun 16 23:45:59 2018 (r335267) @@ -5,7 +5,6 @@ PROG= gvinum SRCS= gvinum.c gvinum.h geom_vinum_share.c MAN= gvinum.8 -WARNS?= 2 CFLAGS+= -I${SRCTOP}/sys -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/edit LIBADD= edit geom Modified: head/sbin/gvinum/gvinum.c ============================================================================== --- head/sbin/gvinum/gvinum.c Sat Jun 16 23:44:18 2018 (r335266) +++ head/sbin/gvinum/gvinum.c Sat Jun 16 23:45:59 2018 (r335267) @@ -94,7 +94,7 @@ static void copy_device(struct gv_drive *, const char int main(int argc, char **argv) { - int line, tokens; + int tokens; char buffer[BUFSIZ], *inputline, *token[GV_MAXARGS]; /* Load the module if necessary. */ @@ -124,7 +124,6 @@ main(int argc, char **argv) add_history(inputline); strcpy(buffer, inputline); free(inputline); - line++; /* count the lines */ tokens = gv_tokenize(buffer, token, GV_MAXARGS); if (tokens) parseline(tokens, token); @@ -184,7 +183,8 @@ gvinum_create(int argc, char * const *argv) int drives, errors, fd, flags, i, line, plexes, plex_in_volume; int sd_in_plex, status, subdisks, tokens, undeffd, volumes; const char *errstr; - char buf[BUFSIZ], buf1[BUFSIZ], commandline[BUFSIZ], *ed, *sdname; + char buf[BUFSIZ], buf1[BUFSIZ], commandline[BUFSIZ], *sdname; + const char *ed; char original[BUFSIZ], tmpfile[20], *token[GV_MAXARGS]; char plex[GV_MAXPLEXNAME], volume[GV_MAXVOLNAME]; @@ -806,7 +806,8 @@ gvinum_list(int argc, char * const *argv) struct gctl_req *req; int flags, i, j; const char *errstr; - char buf[20], *cmd, config[GV_CFG_LEN + 1]; + char buf[20], config[GV_CFG_LEN + 1]; + const char *cmd; flags = 0; cmd = "list"; @@ -931,7 +932,7 @@ gvinum_move(int argc, char * const *argv) } static void -gvinum_printconfig(int argc, char * const *argv) +gvinum_printconfig(int argc __unused, char * const *argv __unused) { printconfig(stdout, ""); @@ -943,7 +944,7 @@ gvinum_parityop(int argc, char * const *argv, int rebu struct gctl_req *req; int flags, i; const char *errstr; - char *op; + const char *op; if (rebuild) { op = "rebuildparity"; @@ -1214,7 +1215,7 @@ gvinum_start(int argc, char * const *argv) } static void -gvinum_stop(int argc, char * const *argv) +gvinum_stop(int argc __unused, char * const *argv __unused) { int err, fileid; From owner-svn-src-head@freebsd.org Sat Jun 16 23:48:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FB0C1002672; Sat, 16 Jun 2018 23:48:00 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 409BF74312; Sat, 16 Jun 2018 23:48:00 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 050B557BD; Sat, 16 Jun 2018 23:48:00 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5GNlxcT081507; Sat, 16 Jun 2018 23:47:59 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5GNlxkC081505; Sat, 16 Jun 2018 23:47:59 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806162347.w5GNlxkC081505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 16 Jun 2018 23:47:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335268 - head/sbin/quotacheck X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/sbin/quotacheck X-SVN-Commit-Revision: 335268 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2018 23:48:00 -0000 Author: eadler Date: Sat Jun 16 23:47:59 2018 New Revision: 335268 URL: https://svnweb.freebsd.org/changeset/base/335268 Log: quotacheck: build with WARNS=3 WARNS++ Tested with amd64, arm64, i386, mips Modified: head/sbin/quotacheck/Makefile head/sbin/quotacheck/quotacheck.c Modified: head/sbin/quotacheck/Makefile ============================================================================== --- head/sbin/quotacheck/Makefile Sat Jun 16 23:45:59 2018 (r335267) +++ head/sbin/quotacheck/Makefile Sat Jun 16 23:47:59 2018 (r335268) @@ -4,7 +4,7 @@ PACKAGE=quotacheck PROG= quotacheck SRCS= quotacheck.c preen.c fsutil.c utilities.c -WARNS?= 2 +WARNS?= 3 MAN= quotacheck.8 LIBADD= util ufs Modified: head/sbin/quotacheck/quotacheck.c ============================================================================== --- head/sbin/quotacheck/quotacheck.c Sat Jun 16 23:45:59 2018 (r335267) +++ head/sbin/quotacheck/quotacheck.c Sat Jun 16 23:47:59 2018 (r335268) @@ -74,9 +74,9 @@ __FBSDID("$FreeBSD$"); #include "quotacheck.h" -char *qfname = QUOTAFILENAME; -char *qfextension[] = INITQFNAMES; -char *quotagroup = QUOTAGROUP; +const char *qfname = QUOTAFILENAME; +const char *qfextension[] = INITQFNAMES; +const char *quotagroup = QUOTAGROUP; union { struct fs sblk; @@ -253,8 +253,9 @@ chkquota(char *specname, struct quotafile *qfu, struct struct fileusage *fup; union dinode *dp; struct fs *fs; - int cg, i, ret, mode, errs = 0; - ino_t ino, inosused, userino = 0, groupino = 0; + int i, ret, mode, errs = 0; + u_int32_t cg; + ino_t curino, ino, inosused, userino = 0, groupino = 0; dev_t dev, userdev = 0, groupdev = 0; struct stat sb; const char *mntpt; @@ -367,7 +368,7 @@ chkquota(char *specname, struct quotafile *qfu, struct if (inosused <= 0) continue; } - for (i = 0; i < inosused; i++, ino++) { + for (curino = 0; curino < inosused; curino++, ino++) { if ((dp = getnextinode(ino)) == NULL || ino < UFS_ROOTINO || (mode = DIP(dp, di_mode) & IFMT) == 0) @@ -403,7 +404,7 @@ chkquota(char *specname, struct quotafile *qfu, struct continue; if (qfg) { fup = addid((u_long)DIP(dp, di_gid), GRPQUOTA, - (char *)0, mntpt); + NULL, mntpt); fup->fu_curinodes++; if (mode == IFREG || mode == IFDIR || mode == IFLNK) @@ -411,7 +412,7 @@ chkquota(char *specname, struct quotafile *qfu, struct } if (qfu) { fup = addid((u_long)DIP(dp, di_uid), USRQUOTA, - (char *)0, mntpt); + NULL, mntpt); fup->fu_curinodes++; if (mode == IFREG || mode == IFDIR || mode == IFLNK) @@ -498,7 +499,7 @@ update(const char *fsname, struct quotafile *qf, int t */ if (highid < lastid && stat(quota_qfname(qf), &sb) == 0 && - sb.st_size > (((off_t)highid + 2) * sizeof(struct dqblk))) + sb.st_size > (off_t)((highid + 2) * sizeof(struct dqblk))) truncate(quota_qfname(qf), (((off_t)highid + 2) * sizeof(struct dqblk))); return (0); From owner-svn-src-head@freebsd.org Sat Jun 16 23:49:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB21710027C0; Sat, 16 Jun 2018 23:49:23 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9B91A74501; Sat, 16 Jun 2018 23:49:23 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B69057BE; Sat, 16 Jun 2018 23:49:23 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5GNnNBU081610; Sat, 16 Jun 2018 23:49:23 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5GNnNOJ081609; Sat, 16 Jun 2018 23:49:23 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806162349.w5GNnNOJ081609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 16 Jun 2018 23:49:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335269 - head/tools/tools/netrate/http X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/tools/tools/netrate/http X-SVN-Commit-Revision: 335269 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2018 23:49:24 -0000 Author: eadler Date: Sat Jun 16 23:49:22 2018 New Revision: 335269 URL: https://svnweb.freebsd.org/changeset/base/335269 Log: netrate: build with WARNS=6 Tested with amd64, i386 Modified: head/tools/tools/netrate/http/Makefile head/tools/tools/netrate/http/http.c Modified: head/tools/tools/netrate/http/Makefile ============================================================================== --- head/tools/tools/netrate/http/Makefile Sat Jun 16 23:47:59 2018 (r335268) +++ head/tools/tools/netrate/http/Makefile Sat Jun 16 23:49:22 2018 (r335269) @@ -2,7 +2,6 @@ PROG= http MAN= -WARNS?= 3 LIBADD= pthread .include Modified: head/tools/tools/netrate/http/http.c ============================================================================== --- head/tools/tools/netrate/http/http.c Sat Jun 16 23:47:59 2018 (r335268) +++ head/tools/tools/netrate/http/http.c Sat Jun 16 23:49:22 2018 (r335269) @@ -160,7 +160,7 @@ killall(void) } static void -signal_handler(int signum) +signal_handler(int signum __unused) { statep->hwd[curthread].hwd_start_signal_barrier = 1; @@ -232,7 +232,7 @@ usage(void) } static void -main_sighup(int signum) +main_sighup(int signum __unused) { killall(); @@ -242,7 +242,7 @@ int main(int argc, char *argv[]) { int ch, error, i; - char *pagebuffer; + struct state *pagebuffer; uintmax_t total; size_t len; pid_t pid; @@ -283,7 +283,7 @@ main(int argc, char *argv[]) err(-1, "mmap"); if (minherit(pagebuffer, len, INHERIT_SHARE) < 0) err(-1, "minherit"); - statep = (struct state *)pagebuffer; + statep = pagebuffer; bzero(&statep->sin, sizeof(statep->sin)); statep->sin.sin_len = sizeof(statep->sin); From owner-svn-src-head@freebsd.org Sat Jun 16 23:50:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3168510029B6; Sat, 16 Jun 2018 23:50:36 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D65E174678; Sat, 16 Jun 2018 23:50:35 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7EB657C6; Sat, 16 Jun 2018 23:50:35 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5GNoZCj081729; Sat, 16 Jun 2018 23:50:35 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5GNoZld081724; Sat, 16 Jun 2018 23:50:35 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806162350.w5GNoZld081724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 16 Jun 2018 23:50:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335270 - head/lib/liby X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/lib/liby X-SVN-Commit-Revision: 335270 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2018 23:50:36 -0000 Author: eadler Date: Sat Jun 16 23:50:34 2018 New Revision: 335270 URL: https://svnweb.freebsd.org/changeset/base/335270 Log: liby: build with WARNS=6 Tested with amd64, arm64, i386, mips Added: head/lib/liby/yyerror.h (contents, props changed) Modified: head/lib/liby/Makefile head/lib/liby/main.c head/lib/liby/yyerror.c Modified: head/lib/liby/Makefile ============================================================================== --- head/lib/liby/Makefile Sat Jun 16 23:49:22 2018 (r335269) +++ head/lib/liby/Makefile Sat Jun 16 23:50:34 2018 (r335270) @@ -5,6 +5,4 @@ LIB= y SRCS= main.c yyerror.c NO_PIC= -WARNS?= 1 - .include Modified: head/lib/liby/main.c ============================================================================== --- head/lib/liby/main.c Sat Jun 16 23:49:22 2018 (r335269) +++ head/lib/liby/main.c Sat Jun 16 23:50:34 2018 (r335270) @@ -32,16 +32,17 @@ #include __FBSDID("$FreeBSD$"); -#ifndef lint +#if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/4/93"; -#endif /* not lint */ +#endif /* LIBC_SCCS and not lint */ #include -int yyparse(void); +#include "yyerror.h" int main(void) { + exit(yyparse()); } Modified: head/lib/liby/yyerror.c ============================================================================== --- head/lib/liby/yyerror.c Sat Jun 16 23:49:22 2018 (r335269) +++ head/lib/liby/yyerror.c Sat Jun 16 23:50:34 2018 (r335270) @@ -32,16 +32,18 @@ #include __FBSDID("$FreeBSD$"); -#ifndef lint +#if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)yyerror.c 8.1 (Berkeley) 6/4/93"; -#endif /* not lint */ +#endif /* LIBC_SCCS and not lint */ #include +#include "yyerror.h" + int -yyerror(msg) -char *msg; +yyerror(const char *msg) { - (void)fprintf(stderr, "%s\n", msg); + + fprintf(stderr, "%s\n", msg); return(0); } Added: head/lib/liby/yyerror.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/liby/yyerror.h Sat Jun 16 23:50:34 2018 (r335270) @@ -0,0 +1,36 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +int yyparse(void); +int yyerror(const char *msg);