From owner-svn-src-head@freebsd.org Sun Feb 11 00:10: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 E2F8BF09965; Sun, 11 Feb 2018 00:10:33 +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 96D6A7A2E9; Sun, 11 Feb 2018 00:10:33 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id F3EC310A7DB; Sat, 10 Feb 2018 19:10:31 -0500 (EST) From: John Baldwin To: Alexey Dokuchaev Cc: Warner Losh , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh Subject: Re: svn commit: r329064 - head/share/zoneinfo Date: Sat, 10 Feb 2018 16:02:48 -0800 Message-ID: <9220095.UvqZmaNGKz@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <20180209190450.GA85711@FreeBSD.org> References: <201802091550.w19FoXEb018181@repo.freebsd.org> <20180209190450.GA85711@FreeBSD.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Sat, 10 Feb 2018 19:10:32 -0500 (EST) 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.25 Precedence: list List-Id: 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, 11 Feb 2018 00:10:34 -0000 On Friday, February 09, 2018 07:04:50 PM Alexey Dokuchaev wrote: > On Fri, Feb 09, 2018 at 11:50:35AM -0700, Warner Losh wrote: > > On Fri, Feb 9, 2018 at 10:49 AM, John Baldwin wrote: > > > On Friday, February 09, 2018 03:50:33 PM Warner Losh wrote: > > > > New Revision: 329064 > > > > URL: https://svnweb.freebsd.org/changeset/base/329064 > > > > > > > > Log: > > > > We don't actually need env here, so drop it. All shells allow setting > > > > of shell variables for the next command like this. > > > > > > Eh: > > > > > > % LC_ALL=C env > > > LC_ALL=C: Command not found. > > > > > > csh and tcsh don't let you set environment variables as a prefix. > > > > > > That said, if you try to use csh as the SHELL for make I bet many things > > > would break. > > > > Right, all shells supported as SHELL for make. csh isn't on the list of > > supported shells. Your bet is right: a lot of things do break. > > I don't really understand why we're discussing it: (t)csh, fish, whatever > are for interactive use *only*. Scripts (and makefiles) should only be > written for standard plain POSIX shell. I think the trigger is that "All shells" is a bit ambiguous. "All shells supported by make" or some such would have been clearer. -- John Baldwin From owner-svn-src-head@freebsd.org Sun Feb 11 03:02: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 7872AF12E6F; Sun, 11 Feb 2018 03:02:30 +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 2A422803B6; Sun, 11 Feb 2018 03:02:30 +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 252F31D1BA; Sun, 11 Feb 2018 03:02:30 +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 w1B32UgM010640; Sun, 11 Feb 2018 03:02:30 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1B32U5i010639; Sun, 11 Feb 2018 03:02:30 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201802110302.w1B32U5i010639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sun, 11 Feb 2018 03:02:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329115 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 329115 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 11 Feb 2018 03:02:30 -0000 Author: dteske Date: Sun Feb 11 03:02:29 2018 New Revision: 329115 URL: https://svnweb.freebsd.org/changeset/base/329115 Log: Fix typo in dtrace_tcp(4) Using args[2]->tcps_state as-documented results in error: operator -> cannot be applied to pointer to type "void" This error is accurate as the synopsis for tcp:::state-change is: tcp:::state-change(void *, csinfo_t *, void *, tcpsinfo_t *, void *, tcplsinfo_t *); args[2] refers to the third argument which is always NULL (as- documented). The to-state for the TCP connection state transition is actually in the fourth argument, args[3]->tcps_state. Modified: head/share/man/man4/dtrace_tcp.4 Modified: head/share/man/man4/dtrace_tcp.4 ============================================================================== --- head/share/man/man4/dtrace_tcp.4 Sun Feb 11 02:27:50 2018 (r329114) +++ head/share/man/man4/dtrace_tcp.4 Sun Feb 11 03:02:29 2018 (r329115) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 15, 2016 +.Dd February 10, 2018 .Dt DTRACE_TCP 4 .Os .Sh NAME @@ -135,7 +135,7 @@ Its first, third and fifth arguments are currently alw .Dv NULL . Its last argument describes the from-state in the transition, and the to-state can be obtained from -.Dv args[2]->tcps_state . +.Dv args[3]->tcps_state . .Sh ARGUMENTS The .Vt pktinfo_t From owner-svn-src-head@freebsd.org Sun Feb 11 06:57: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 9FE04F1BF36; Sun, 11 Feb 2018 06:57:21 +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 501A187A29; Sun, 11 Feb 2018 06:57:21 +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 4AFA21F74A; Sun, 11 Feb 2018 06:57:21 +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 w1B6vLJs024577; Sun, 11 Feb 2018 06:57:21 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1B6vKvT024572; Sun, 11 Feb 2018 06:57:20 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802110657.w1B6vKvT024572@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sun, 11 Feb 2018 06:57:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329119 - in head: sbin/geom/class/part sys/geom/part sys/sys/disk X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: sbin/geom/class/part sys/geom/part sys/sys/disk X-SVN-Commit-Revision: 329119 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 11 Feb 2018 06:57:21 -0000 Author: cem Date: Sun Feb 11 06:57:20 2018 New Revision: 329119 URL: https://svnweb.freebsd.org/changeset/base/329119 Log: Add GUID and alias for Apple APFS partition PR: 225813 Submitted by: James Wright Modified: head/sbin/geom/class/part/gpart.8 head/sys/geom/part/g_part.c head/sys/geom/part/g_part.h head/sys/geom/part/g_part_gpt.c head/sys/sys/disk/gpt.h Modified: head/sbin/geom/class/part/gpart.8 ============================================================================== --- head/sbin/geom/class/part/gpart.8 Sun Feb 11 03:21:06 2018 (r329118) +++ head/sbin/geom/class/part/gpart.8 Sun Feb 11 06:57:20 2018 (r329119) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 19, 2017 +.Dd February 10, 2018 .Dt GPART 8 .Os .Sh NAME @@ -654,6 +654,8 @@ Another symbolic names that can be used with .Cm gpart utility are: .Bl -tag -width ".Cm dragonfly-disklabel64" +.It Cm apple-apfs +An Apple macOS partition used for the Apple file system, APFS. .It Cm apple-core-storage An Apple Mac OS X partition used by logical volume manager known as Core Storage. Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Sun Feb 11 03:21:06 2018 (r329118) +++ head/sys/geom/part/g_part.c Sun Feb 11 06:57:20 2018 (r329119) @@ -71,6 +71,7 @@ struct g_part_alias_list { const char *lexeme; enum g_part_alias alias; } g_part_alias_list[G_PART_ALIAS_COUNT] = { + { "apple-apfs", G_PART_ALIAS_APPLE_APFS }, { "apple-boot", G_PART_ALIAS_APPLE_BOOT }, { "apple-core-storage", G_PART_ALIAS_APPLE_CORE_STORAGE }, { "apple-hfs", G_PART_ALIAS_APPLE_HFS }, Modified: head/sys/geom/part/g_part.h ============================================================================== --- head/sys/geom/part/g_part.h Sun Feb 11 03:21:06 2018 (r329118) +++ head/sys/geom/part/g_part.h Sun Feb 11 06:57:20 2018 (r329119) @@ -38,6 +38,7 @@ #define G_PART_PROBE_PRI_HIGH 0 enum g_part_alias { + G_PART_ALIAS_APPLE_APFS, /* An Apple APFS partition. */ G_PART_ALIAS_APPLE_BOOT, /* An Apple boot partition entry. */ G_PART_ALIAS_APPLE_CORE_STORAGE,/* An Apple Core Storage partition. */ G_PART_ALIAS_APPLE_HFS, /* An HFS+ file system entry. */ Modified: head/sys/geom/part/g_part_gpt.c ============================================================================== --- head/sys/geom/part/g_part_gpt.c Sun Feb 11 03:21:06 2018 (r329118) +++ head/sys/geom/part/g_part_gpt.c Sun Feb 11 06:57:20 2018 (r329119) @@ -147,6 +147,7 @@ static struct g_part_scheme g_part_gpt_scheme = { }; G_PART_SCHEME_DECLARE(g_part_gpt); +static struct uuid gpt_uuid_apple_apfs = GPT_ENT_TYPE_APPLE_APFS; static struct uuid gpt_uuid_apple_boot = GPT_ENT_TYPE_APPLE_BOOT; static struct uuid gpt_uuid_apple_core_storage = GPT_ENT_TYPE_APPLE_CORE_STORAGE; @@ -208,6 +209,7 @@ static struct g_part_uuid_alias { int alias; int mbrtype; } gpt_uuid_alias_match[] = { + { &gpt_uuid_apple_apfs, G_PART_ALIAS_APPLE_APFS, 0 }, { &gpt_uuid_apple_boot, G_PART_ALIAS_APPLE_BOOT, 0xab }, { &gpt_uuid_apple_core_storage, G_PART_ALIAS_APPLE_CORE_STORAGE, 0 }, { &gpt_uuid_apple_hfs, G_PART_ALIAS_APPLE_HFS, 0xaf }, Modified: head/sys/sys/disk/gpt.h ============================================================================== --- head/sys/sys/disk/gpt.h Sun Feb 11 03:21:06 2018 (r329118) +++ head/sys/sys/disk/gpt.h Sun Feb 11 06:57:20 2018 (r329119) @@ -183,6 +183,8 @@ CTASSERT(sizeof(struct gpt_ent) == 128); {0x5265636f,0x7665,0x11AA,0xaa,0x11,{0x00,0x30,0x65,0x43,0xec,0xac}} #define GPT_ENT_TYPE_APPLE_CORE_STORAGE \ {0x53746f72,0x6167,0x11AA,0xaa,0x11,{0x00,0x30,0x65,0x43,0xec,0xac}} +#define GPT_ENT_TYPE_APPLE_APFS \ + {0x7c3457ef,0x0000,0x11aa,0xaa,0x11,{0x00,0x30,0x65,0x43,0xec,0xac}} #define GPT_ENT_TYPE_NETBSD_FFS \ {0x49f48d5a,0xb10e,0x11dc,0xb9,0x9b,{0x00,0x19,0xd1,0x87,0x96,0x48}} From owner-svn-src-head@freebsd.org Sun Feb 11 13:35: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 6BF8EF18CA8; Sun, 11 Feb 2018 13:35:32 +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 1A1BB787E8; Sun, 11 Feb 2018 13:35:32 +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 0BA6023915; Sun, 11 Feb 2018 13:35:32 +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 w1BDZVjE026045; Sun, 11 Feb 2018 13:35:31 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1BDZVIL026043; Sun, 11 Feb 2018 13:35:31 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201802111335.w1BDZVIL026043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 11 Feb 2018 13:35:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329123 - head/usr.bin/lock X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/usr.bin/lock X-SVN-Commit-Revision: 329123 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 11 Feb 2018 13:35:32 -0000 Author: trasz Date: Sun Feb 11 13:35:31 2018 New Revision: 329123 URL: https://svnweb.freebsd.org/changeset/base/329123 Log: Make lock(1) use PAM. This makes the -p option work again. (Well, kind of, because the whole idea of this utility is rather broken.) This originally come from NetBSD, and was later reworked a bit. Reviewed by: des@ (earlier version) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D4981 Modified: head/usr.bin/lock/Makefile head/usr.bin/lock/lock.c Modified: head/usr.bin/lock/Makefile ============================================================================== --- head/usr.bin/lock/Makefile Sun Feb 11 10:23:32 2018 (r329122) +++ head/usr.bin/lock/Makefile Sun Feb 11 13:35:31 2018 (r329123) @@ -5,6 +5,6 @@ PROG= lock BINOWN= root BINMODE=4555 -LIBADD= crypt +LIBADD= pam .include Modified: head/usr.bin/lock/lock.c ============================================================================== --- head/usr.bin/lock/lock.c Sun Feb 11 10:23:32 2018 (r329122) +++ head/usr.bin/lock/lock.c Sun Feb 11 13:35:31 2018 (r329123) @@ -73,6 +73,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include /* for openpam_ttyconv() */ + #define TIMEOUT 15 static void quit(int); @@ -91,19 +94,23 @@ static int vtyunlock; /* Unlock flag and code. */ int main(int argc, char **argv) { + static const struct pam_conv pamc = { &openpam_ttyconv, NULL }; + pam_handle_t *pamh; struct passwd *pw; struct itimerval ntimer, otimer; struct tm *timp; time_t timval; - int ch, failures, sectimeout, usemine, vtylock; - char *ap, *cryptpw, *mypw, *ttynam, *tzn; + int ch, failures, pam_err, sectimeout, usemine, vtylock; + char *ap, *ttynam, *tzn; char hostname[MAXHOSTNAMELEN], s[BUFSIZ], s1[BUFSIZ]; openlog("lock", 0, LOG_AUTH); + pam_err = PAM_SYSTEM_ERR; /* pacify GCC */ + sectimeout = TIMEOUT; + pamh = NULL; pw = NULL; - mypw = NULL; usemine = 0; no_timeout = 0; vtylock = 0; @@ -117,7 +124,6 @@ main(int argc, char **argv) usemine = 1; if (!(pw = getpwuid(getuid()))) errx(1, "unknown uid %d", getuid()); - mypw = strdup(pw->pw_passwd); break; case 'n': no_timeout = 1; @@ -131,9 +137,11 @@ main(int argc, char **argv) } timeout.tv_sec = sectimeout * 60; - /* discard privs */ - if (setuid(getuid()) != 0) - errx(1, "setuid failed"); + if (!usemine) { /* -p with PAM or S/key needs privs */ + /* discard privs */ + if (setuid(getuid()) != 0) + errx(1, "setuid failed"); + } if (tcgetattr(0, &tty)) /* get information for header */ exit(1); @@ -153,7 +161,11 @@ main(int argc, char **argv) ntty = tty; ntty.c_lflag &= ~ECHO; (void)tcsetattr(0, TCSADRAIN|TCSASOFT, &ntty); - if (!mypw) { + if (usemine) { + pam_err = pam_start("lock", pw->pw_name, &pamc, &pamh); + if (pam_err != PAM_SUCCESS) + err(1, "pam_start: %s", pam_strerror(NULL, pam_err)); + } else { /* get key and check again */ (void)printf("Key: "); if (!fgets(s, sizeof(s), stdin) || *s == '\n') @@ -171,7 +183,6 @@ main(int argc, char **argv) exit(1); } s[0] = '\0'; - mypw = s1; } /* set signal handlers */ @@ -216,19 +227,27 @@ main(int argc, char **argv) failures = 0; for (;;) { + if (usemine) { + pam_err = pam_authenticate(pamh, 0); + if (pam_err == PAM_SUCCESS) + break; + + if (pam_err != PAM_AUTH_ERR && + pam_err != PAM_USER_UNKNOWN && + pam_err != PAM_MAXTRIES) { + syslog(LOG_ERR, "pam_authenticate: %s", + pam_strerror(pamh, pam_err)); + } + + goto tryagain; + } (void)printf("Key: "); if (!fgets(s, sizeof(s), stdin)) { clearerr(stdin); hi(0); goto tryagain; } - if (usemine) { - s[strlen(s) - 1] = '\0'; - cryptpw = crypt(s, mypw); - if (cryptpw != NULL && !strcmp(mypw, cryptpw)) - break; - } - else if (!strcmp(s, s1)) + if (!strcmp(s, s1)) break; (void)printf("\07\n"); failures++; @@ -243,6 +262,8 @@ tryagain: if (getuid() == 0) syslog(LOG_NOTICE, "ROOT UNLOCK ON hostname %s port %s", hostname, ttynam); + if (usemine) + (void)pam_end(pamh, pam_err); quit(0); return(0); /* not reached */ } From owner-svn-src-head@freebsd.org Sun Feb 11 16:12: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 8BCA7F0185A; Sun, 11 Feb 2018 16:12:56 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 35D397E683; Sun, 11 Feb 2018 16:12:56 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F377252FB; Sun, 11 Feb 2018 16:12:56 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1BGCt1p005370; Sun, 11 Feb 2018 16:12:55 GMT (envelope-from feld@FreeBSD.org) Received: (from feld@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1BGCthD005369; Sun, 11 Feb 2018 16:12:55 GMT (envelope-from feld@FreeBSD.org) Message-Id: <201802111612.w1BGCthD005369@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: feld set sender to feld@FreeBSD.org using -f From: Mark Felder Date: Sun, 11 Feb 2018 16:12:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329124 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: feld X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 329124 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 11 Feb 2018 16:12:56 -0000 Author: feld (ports committer) Date: Sun Feb 11 16:12:55 2018 New Revision: 329124 URL: https://svnweb.freebsd.org/changeset/base/329124 Log: Add Thomas Zander to ports-secteam Modified: head/share/misc/organization.dot Modified: head/share/misc/organization.dot ============================================================================== --- head/share/misc/organization.dot Sun Feb 11 13:35:31 2018 (r329123) +++ head/share/misc/organization.dot Sun Feb 11 16:12:55 2018 (r329124) @@ -34,7 +34,7 @@ portmgr [label="Port Management Team\nportmgr@FreeBSD. portmgrsecretary [label="Port Management Team Secretary\nportmgr-secretary@FreeBSD.org\nrene"] re [label="Primary Release Engineering Team\nre@FreeBSD.org\ngjb, kib,\nbdrewery, blackend,\nrgrimes, delphij,\nhrs, glebius,\nmarius, rwatson"] secteam [label="Security Team\nsecteam@FreeBSD.org\ndelphij,\ndes, gavin, gjb,\nglebius, remko"] -portssecteam [label="Ports Security Team\nports-secteam@FreeBSD.org\ndelphij, amdmi3, eadler, feld, jgh, rea, sbz, simon, swills, zi"] +portssecteam [label="Ports Security Team\nports-secteam@FreeBSD.org\ndelphij, amdmi3, eadler, feld, jgh, rea, riggs, sbz, simon, swills, zi"] secteamsecretary [label="Security Team Secretary\nsecteam-secretary@FreeBSD.org\nremko"] securityofficer [label="Security Officer Team\nsecurity-officer@FreeBSD.org\ndelphij, des,\ngavin, gjb,\nglebius, remko"] srccommitters [label="Src Committers\nsrc-committers@FreeBSD.org"] From owner-svn-src-head@freebsd.org Sun Feb 11 16: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 80B7FF033E4; Sun, 11 Feb 2018 16:35:24 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2EC3F7F412; Sun, 11 Feb 2018 16:35:24 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 25AD72562E; Sun, 11 Feb 2018 16:35:24 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1BGZNwD015272; Sun, 11 Feb 2018 16:35:23 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1BGZN2x015270; Sun, 11 Feb 2018 16:35:23 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201802111635.w1BGZN2x015270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 11 Feb 2018 16:35:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329125 - in head/sys/dev/usb: . serial X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys/dev/usb: . serial X-SVN-Commit-Revision: 329125 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 11 Feb 2018 16:35:24 -0000 Author: ian Date: Sun Feb 11 16:35:23 2018 New Revision: 329125 URL: https://svnweb.freebsd.org/changeset/base/329125 Log: Add a device ID to uftdi for TIAO USB Multi Protocol Adapter (TUMPA). PR: 225810 Modified: head/sys/dev/usb/serial/uftdi.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/uftdi.c ============================================================================== --- head/sys/dev/usb/serial/uftdi.c Sun Feb 11 16:12:55 2018 (r329124) +++ head/sys/dev/usb/serial/uftdi.c Sun Feb 11 16:35:23 2018 (r329125) @@ -522,6 +522,7 @@ static const STRUCT_USB_HOST_ID uftdi_devs[] = { UFTDI_DEV(FTDI, TERATRONIK_D2XX, 0), UFTDI_DEV(FTDI, TERATRONIK_VCP, 0), UFTDI_DEV(FTDI, THORLABS, 0), + UFTDI_DEV(FTDI, TIAO, 0), UFTDI_DEV(FTDI, TNC_X, 0), UFTDI_DEV(FTDI, TTUSB, 0), UFTDI_DEV(FTDI, TURTELIZER2, UFTDI_JTAG_IFACE(0)), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Sun Feb 11 16:12:55 2018 (r329124) +++ head/sys/dev/usb/usbdevs Sun Feb 11 16:35:23 2018 (r329125) @@ -2157,6 +2157,7 @@ product FTDI TAVIR_STK500 0xfa33 FTDI compatible adapt product FTDI TERATRONIK_D2XX 0xec89 FTDI compatible adapter product FTDI TERATRONIK_VCP 0xec88 FTDI compatible adapter product FTDI THORLABS 0xfaf0 FTDI compatible adapter +product FTDI TIAO 0x8a98 FTDI compatible adapter product FTDI TNC_X 0xebe0 FTDI compatible adapter product FTDI TTUSB 0xff20 FTDI compatible adapter product FTDI USBX_707 0xf857 FTDI compatible adapter From owner-svn-src-head@freebsd.org Sun Feb 11 16:35: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 EC7BAF034C9; Sun, 11 Feb 2018 16:35:56 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E9C27F55A; Sun, 11 Feb 2018 16:35:56 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9919725630; Sun, 11 Feb 2018 16:35:56 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1BGZuOK015342; Sun, 11 Feb 2018 16:35:56 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1BGZutu015341; Sun, 11 Feb 2018 16:35:56 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201802111635.w1BGZutu015341@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 11 Feb 2018 16:35:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329126 - head/etc/devd X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/etc/devd X-SVN-Commit-Revision: 329126 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 11 Feb 2018 16:35:57 -0000 Author: ian Date: Sun Feb 11 16:35:56 2018 New Revision: 329126 URL: https://svnweb.freebsd.org/changeset/base/329126 Log: Regenerate devd/usb.conf after the recent addition of several new device IDs. Modified: head/etc/devd/usb.conf Modified: head/etc/devd/usb.conf ============================================================================== --- head/etc/devd/usb.conf Sun Feb 11 16:35:23 2018 (r329125) +++ head/etc/devd/usb.conf Sun Feb 11 16:35:56 2018 (r329126) @@ -145,7 +145,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0403"; - match "product" "(0x5259|0x6001|0x6004|0x6006|0x6006|0x6010|0x6011|0x6014|0x6015|0x8372|0x9378|0x9379|0x937a|0x937c|0x9868|0x9e90|0x9f80|0xa6d0|0xa6d1|0xabb8|0xb810|0xb811|0xb812|0xbaf8|0xbbe2|0xbca0|0xbca1|0xbca2|0xbca4|0xbcd8|0xbcd9|0xbcda|0xbdc8|0xbfd8|0xbfd9|0xbfda|0xbfdb|0xbfdc|0xc7d0|0xc850|0xc991|0xcaa0|0xcc48|0xcc49|0xcc4a|0xd010|0xd011|0xd012|0xd013|0xd014|0xd015|0xd016|0xd017|0xd070|0xd071|0xd388|0xd389|0xd38a|0xd38b|0xd38c|0xd38d|0xd38e|0xd38f|0xd578|0xd678|0xd738|0xd780|0xdaf8|0xdaf9|0xdafa|0xdafb|0xdafc|0xdafd|0xdafe|0xdaff|0xdc00|0xdc01|0xdd20|0xdf28|0xdf30|0xdf31|0xdf32|0xdf33|0xdf35|0xe000|0xe001|0xe002|0xe004|0xe006|0xe008|0xe009|0xe00a|0xe050|0xe0e8|0xe0e9|0xe0ea|0xe0eb|0xe0ec|0xe0ed|0xe0ee|0xe0ef|0xe0f0|0xe0f1|0xe0f2|0xe0f3|0xe0f4|0xe0f5|0xe0f6|0xe0f7|0xe40b|0xe520|0xe548|0xe6c8|0xe700|0xe729|0xe808|0xe809|0xe80a|0xe80b|0xe80c|0xe80d|0xe80e|0xe80f|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xe88d|0xe88e|0xe88f|0xea90|0xebe0|0xec88|0xec89|0xed22|0xed71|0xed72|0xed73|0xed7 4|0xee18|0xeee8|0xeee9|0xeeea|0xeeeb|0xeeec|0xeeed|0xeeee|0xeeef|0xef50|0xef51|0xf068|0xf069|0xf06a|0xf06b|0xf06c|0xf06d|0xf06e|0xf06f|0xf070|0xf0c0|0xf0c8|0xf208|0xf2d0|0xf3c0|0xf3c1|0xf3c2|0xf448|0xf449|0xf44a|0xf44b|0xf44c|0xf460|0xf608|0xf60b|0xf680|0xf850|0xf857|0xf9d0|0xf9d1|0xf9d2|0xf9d3|0xf9d4|0xf9d5|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfa05|0xfa06|0xfa10|0xfa33|0xfa88|0xfad0|0xfaf0|0xfb58|0xfb59|0xfb5a|0xfb5b|0xfb5c|0xfb5d|0xfb5e|0xfb5f|0xfb80|0xfb99|0xfbfa|0xfc08|0xfc09|0xfc0a|0xfc0b|0xfc0c|0xfc0d|0xfc0e|0xfc0f|0xfc60|0xfc70|0xfc71|0xfc72|0xfc73|0xfc82|0xfd60|0xfe38|0xff00|0xff18|0xff1c|0xff1d|0xff20|0xff38|0xff39|0xff3a|0xff3b|0xff3c|0xff3d|0xff3e|0xff3f|0xffa8)"; + match "product" "(0x5259|0x6001|0x6004|0x6006|0x6006|0x6010|0x6011|0x6014|0x6015|0x8372|0x8a98|0x9378|0x9379|0x937a|0x937c|0x9868|0x9e90|0x9f80|0xa6d0|0xa6d1|0xabb8|0xb810|0xb811|0xb812|0xbaf8|0xbbe2|0xbca0|0xbca1|0xbca2|0xbca4|0xbcd8|0xbcd9|0xbcda|0xbdc8|0xbfd8|0xbfd9|0xbfda|0xbfdb|0xbfdc|0xc7d0|0xc850|0xc991|0xcaa0|0xcc48|0xcc49|0xcc4a|0xd010|0xd011|0xd012|0xd013|0xd014|0xd015|0xd016|0xd017|0xd070|0xd071|0xd388|0xd389|0xd38a|0xd38b|0xd38c|0xd38d|0xd38e|0xd38f|0xd578|0xd678|0xd738|0xd780|0xdaf8|0xdaf9|0xdafa|0xdafb|0xdafc|0xdafd|0xdafe|0xdaff|0xdc00|0xdc01|0xdd20|0xdf28|0xdf30|0xdf31|0xdf32|0xdf33|0xdf35|0xe000|0xe001|0xe002|0xe004|0xe006|0xe008|0xe009|0xe00a|0xe050|0xe0e8|0xe0e9|0xe0ea|0xe0eb|0xe0ec|0xe0ed|0xe0ee|0xe0ef|0xe0f0|0xe0f1|0xe0f2|0xe0f3|0xe0f4|0xe0f5|0xe0f6|0xe0f7|0xe40b|0xe520|0xe548|0xe6c8|0xe700|0xe729|0xe808|0xe809|0xe80a|0xe80b|0xe80c|0xe80d|0xe80e|0xe80f|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xe88d|0xe88e|0xe88f|0xea90|0xebe0|0xec88|0xec89|0xed22|0xed71|0xed72|0xed7 3|0xed74|0xee18|0xeee8|0xeee9|0xeeea|0xeeeb|0xeeec|0xeeed|0xeeee|0xeeef|0xef50|0xef51|0xf068|0xf069|0xf06a|0xf06b|0xf06c|0xf06d|0xf06e|0xf06f|0xf070|0xf0c0|0xf0c8|0xf208|0xf2d0|0xf3c0|0xf3c1|0xf3c2|0xf448|0xf449|0xf44a|0xf44b|0xf44c|0xf460|0xf608|0xf60b|0xf680|0xf850|0xf857|0xf9d0|0xf9d1|0xf9d2|0xf9d3|0xf9d4|0xf9d5|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfa05|0xfa06|0xfa10|0xfa33|0xfa88|0xfad0|0xfaf0|0xfb58|0xfb59|0xfb5a|0xfb5b|0xfb5c|0xfb5d|0xfb5e|0xfb5f|0xfb80|0xfb99|0xfbfa|0xfc08|0xfc09|0xfc0a|0xfc0b|0xfc0c|0xfc0d|0xfc0e|0xfc0f|0xfc60|0xfc70|0xfc71|0xfc72|0xfc73|0xfc82|0xfd60|0xfe38|0xff00|0xff18|0xff1c|0xff1d|0xff20|0xff38|0xff39|0xff3a|0xff3b|0xff3c|0xff3d|0xff3e|0xff3f|0xffa8)"; action "kldload -n uftdi"; }; @@ -2793,7 +2793,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0bda"; - match "product" "0x8754"; + match "product" "(0x8754|0x8812)"; action "kldload -n if_rtwn_usb"; }; @@ -3681,7 +3681,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x10c4"; - match "product" "(0x8066|0x806f|0x807a|0x80c4|0x80ca|0x80dd|0x80ed|0x80f6|0x8115|0x813d|0x813f|0x814a|0x814a|0x814b|0x8156|0x815e|0x815f|0x818b|0x819f|0x81a6|0x81a9|0x81ac|0x81ad|0x81c8|0x81e2|0x81e7|0x81e8|0x81f2|0x8218|0x822b|0x826b|0x8293|0x82f9|0x8341|0x8382|0x83a8|0x83d8|0x8411|0x8418|0x846e|0x8477|0x85ea|0x85eb|0x85f8|0x8664|0x8665|0x88a4|0x88a5|0xea60|0xea61|0xea70|0xea71|0xea80|0xf001|0xf002|0xf003|0xf004)"; + match "product" "(0x8066|0x806f|0x807a|0x80c4|0x80ca|0x80dd|0x80ed|0x80f6|0x8115|0x813d|0x813f|0x814a|0x814a|0x814b|0x8156|0x815e|0x815f|0x818b|0x819f|0x81a6|0x81a9|0x81ac|0x81ad|0x81c8|0x81e2|0x81e7|0x81e8|0x81f2|0x8218|0x822b|0x826b|0x8293|0x82f9|0x8341|0x8382|0x83a8|0x83d8|0x8411|0x8418|0x846e|0x8477|0x85ea|0x85eb|0x85f8|0x8664|0x8665|0x88a4|0x88a5|0x8a2a|0xea60|0xea61|0xea70|0xea71|0xea80|0xf001|0xf002|0xf003|0xf004)"; action "kldload -n uslcom"; }; @@ -3921,7 +3921,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x12d1"; - match "product" "(0x1573|0x15c1|0x1803|0x1c05|0x1c0b)"; + match "product" "(0x155b|0x1573|0x15c1|0x1803|0x1c05|0x1c0b|0x1c1e)"; action "kldload -n u3g"; }; @@ -4432,6 +4432,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x15eb"; + match "product" "0x7d0e"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x1614"; match "product" "(0x0800|0x0802|0x7002)"; action "kldload -n u3g"; @@ -5328,6 +5336,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x2357"; + match "product" "0x0601"; + action "kldload -n if_ure"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x2405"; match "product" "0x0003"; action "kldload -n uslcom"; @@ -5352,6 +5368,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x2c7c"; + match "product" "0x0125"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x3195"; match "product" "(0xf190|0xf280|0xf281)"; action "kldload -n uslcom"; @@ -5727,6 +5751,46 @@ nomatch 32 { match "vendor" "0x12d1"; match "intclass" "0xff"; match "intsubclass" "0x02"; + match "intprotocol" "0x01"; + action "kldload -n umodem"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x12d1"; + match "intclass" "0xff"; + match "intsubclass" "0x02"; + match "intprotocol" "0x02"; + action "kldload -n umodem"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x12d1"; + match "intclass" "0xff"; + match "intsubclass" "0x02"; + match "intprotocol" "0x10"; + action "kldload -n umodem"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x12d1"; + match "intclass" "0xff"; + match "intsubclass" "0x02"; + match "intprotocol" "0x12"; + action "kldload -n umodem"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x12d1"; + match "intclass" "0xff"; + match "intsubclass" "0x02"; match "intprotocol" "0x16"; action "kldload -n if_cdce"; }; @@ -5747,12 +5811,42 @@ nomatch 32 { match "vendor" "0x12d1"; match "intclass" "0xff"; match "intsubclass" "0x02"; + match "intprotocol" "0x61"; + action "kldload -n umodem"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x12d1"; + match "intclass" "0xff"; + match "intsubclass" "0x02"; + match "intprotocol" "0x62"; + action "kldload -n umodem"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x12d1"; + match "intclass" "0xff"; + match "intsubclass" "0x02"; match "intprotocol" "0x76"; action "kldload -n if_cdce"; }; nomatch 32 { match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x12d1"; + match "intclass" "0xff"; + match "intsubclass" "0x03"; + match "intprotocol" "0x16"; + action "kldload -n if_cdce"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; match "mode" "(host|device)"; match "intclass" "0x02"; match "intsubclass" "0x02"; @@ -5921,5 +6015,5 @@ nomatch 32 { action "kldload -n umass"; }; -# 2760 USB entries processed +# 2775 USB entries processed From owner-svn-src-head@freebsd.org Sun Feb 11 17:45: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 72BD5F08CBD; Sun, 11 Feb 2018 17:45:39 +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 21D0682623; Sun, 11 Feb 2018 17:45:39 +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 1CD05261DB; Sun, 11 Feb 2018 17:45:39 +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 w1BHjcwW050693; Sun, 11 Feb 2018 17:45:38 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1BHjcWA050692; Sun, 11 Feb 2018 17:45:38 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802111745.w1BHjcWA050692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 11 Feb 2018 17:45:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329127 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 329127 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 11 Feb 2018 17:45:39 -0000 Author: imp Date: Sun Feb 11 17:45:38 2018 New Revision: 329127 URL: https://svnweb.freebsd.org/changeset/base/329127 Log: Consistent macro indentation is the hobgoblin of small minds Line up the macro definitions and names here like the machine/stdarg.h files that this replaced. This is easier to read and also makes it easier to match up with other includes. Also two space indent va_end to match the rest of the surrounding if block. Modified: head/sys/sys/_stdarg.h Modified: head/sys/sys/_stdarg.h ============================================================================== --- head/sys/sys/_stdarg.h Sun Feb 11 16:35:56 2018 (r329126) +++ head/sys/sys/_stdarg.h Sun Feb 11 17:45:38 2018 (r329127) @@ -43,13 +43,13 @@ #endif #ifdef __GNUCLIKE_BUILTIN_STDARG - #define va_start(ap, last) __builtin_va_start((ap), (last)) - #define va_arg(ap, type) __builtin_va_arg((ap), type) - #define __va_copy(dest, src) __builtin_va_copy((dest), (src)) + #define va_start(ap, last) __builtin_va_start((ap), (last)) + #define va_arg(ap, type) __builtin_va_arg((ap), type) + #define __va_copy(dest, src) __builtin_va_copy((dest), (src)) #if __ISO_C_VISIBLE >= 1999 - #define va_copy(dest, src) __va_copy(dest, src) + #define va_copy(dest, src) __va_copy(dest, src) #endif -#define va_end(ap) __builtin_va_end(ap) + #define va_end(ap) __builtin_va_end(ap) #endif #if defined(lint) && !defined(va_start) From owner-svn-src-head@freebsd.org Sun Feb 11 18:27: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 E279EF0BB8F; Sun, 11 Feb 2018 18:27:11 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f52.google.com (mail-it0-f52.google.com [209.85.214.52]) (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 7A3A783CE8; Sun, 11 Feb 2018 18:27:11 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f52.google.com with SMTP id b66so4194628itd.5; Sun, 11 Feb 2018 10:27:11 -0800 (PST) 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=ofmFeaXbQlXFfnhpd0v81PgGZ79b5OM4b7FjKs75wMg=; b=Kg4iIpZCO5t6qwF8Oh1PdMgKONow9KWcKXRZYRIM5MBhgaDl3ng4r4EyPn4OLZPk8C TFubXk9PbpsCyCETv9osrjcZ8EMhl6K2IQvqLpONUz2viFV4d3wCJ5qztVoVAMd3Pho4 qiJzUWY/AMlxv2Zo4/R7MW7ZD05ODPCtebiDPXjaW3lTq5U52cqvZQFWaN6GQ3Va+Wp3 uaM/6qWysVGQwIH+SfTnSlHGELfXEKcl/bOml2VO14Gj1sH9hx94gmbBFSbuW+y6BuHq pfWeITpbjH0uuVd6CY1WChYs3KHmK+j5ABSYYiQd0IC9AhpjXTRj2EctwyMGejxMZIFB sWIA== X-Gm-Message-State: APf1xPBsboMPS1IgKp7GYeKSmzsNo4V7Em/SnQZvckycFIPgNQxMnwI1 pbwVy8r7Pgom4HklfoRJW6Qtim+r X-Google-Smtp-Source: AH8x224uCmK+vP56F1+dXWSYbaag2h1/3mkxOhl/L3sxVHq1vX1F26LTV1N6ddj2QkRf0PQnt5hiKg== X-Received: by 10.36.2.213 with SMTP id 204mr2480956itu.121.1518373220098; Sun, 11 Feb 2018 10:20:20 -0800 (PST) Received: from mail-io0-f169.google.com (mail-io0-f169.google.com. [209.85.223.169]) by smtp.gmail.com with ESMTPSA id b185sm4747568itb.20.2018.02.11.10.20.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Feb 2018 10:20:19 -0800 (PST) Received: by mail-io0-f169.google.com with SMTP id l17so15027196ioc.3; Sun, 11 Feb 2018 10:20:19 -0800 (PST) X-Received: by 10.107.175.151 with SMTP id p23mr1495265ioo.215.1518373219181; Sun, 11 Feb 2018 10:20:19 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.30.149 with HTTP; Sun, 11 Feb 2018 10:20:18 -0800 (PST) In-Reply-To: <201802111635.w1BGZutu015341@repo.freebsd.org> References: <201802111635.w1BGZutu015341@repo.freebsd.org> From: Conrad Meyer Date: Sun, 11 Feb 2018 10:20:18 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r329126 - head/etc/devd To: Ian Lepore 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.25 Precedence: list List-Id: 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, 11 Feb 2018 18:27:12 -0000 On Sun, Feb 11, 2018 at 8:35 AM, Ian Lepore wrote: > Author: ian > Date: Sun Feb 11 16:35:56 2018 > New Revision: 329126 > URL: https://svnweb.freebsd.org/changeset/base/329126 > > Log: > Regenerate devd/usb.conf after the recent addition of several new device IDs. > > Modified: > head/etc/devd/usb.conf If this file is machine generated and not an administrator configuration file, shouldn't it live in /usr/share instead of /etc, per hier(7)? Best, Conrad From owner-svn-src-head@freebsd.org Sun Feb 11 18:33: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 6304BF0C292; Sun, 11 Feb 2018 18:33:23 +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 0C59484295; Sun, 11 Feb 2018 18:33:22 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 90BD75A9F12; Sun, 11 Feb 2018 18:33:16 +0000 (UTC) Date: Sun, 11 Feb 2018 18:33:16 +0000 From: Brooks Davis To: Conrad Meyer Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329109 - head/share/man/man9 Message-ID: <20180211183316.GB91264@spindle.one-eyed-alien.net> References: <201802102034.w1AKY9IP015134@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XsQoSWH+UP9D9v3l" Content-Disposition: inline In-Reply-To: <201802102034.w1AKY9IP015134@repo.freebsd.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 11 Feb 2018 18:33:23 -0000 --XsQoSWH+UP9D9v3l Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Feb 10, 2018 at 08:34:09PM +0000, Conrad Meyer wrote: > Author: cem > Date: Sat Feb 10 20:34:09 2018 > New Revision: 329109 > URL: https://svnweb.freebsd.org/changeset/base/329109 >=20 > Log: > Document syscall_helper_register(9), syscall_helper_unregister(9) Thanks! We should probably also document the syscall32_helper_register and the associated macros (which confusingly use an entirely different meaning for _COMPAT (use the sys_ version)). -- Brooks --XsQoSWH+UP9D9v3l Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJagIxrAAoJEKzQXbSebgfAFF0H/3bnHPpnvlW3tYzvu8mmJWQ4 D0xzWbD1pnfNSFa6iraFf0JrRFdhbJif/LREMXJ5qPe2Bdj3eJdmqNHb1t255OSK J62MdMAZ1xP4N8Tb67iuE+xJCbF4+DiuIRp2vTZuwstgXlGFc00XShBklgvAKz3i jUhmSYM+2x9cJQFsYBBF6+3+R9AgLqC8RF7Wzj6BlPo/0lRVbjI6B89EiVxLU/+c pPUeVERlSChflSGy8PfCJ1c86mQJpu2DxLSVuhPCJ41kLvsEqjXOmZmMr3PkogW1 E2hS2nfG6QEl5HlWpu0S7GHJWiF8DoPuFDMqziiKNVg8qy+bM9wGyoFTA3guN1E= =NFN+ -----END PGP SIGNATURE----- --XsQoSWH+UP9D9v3l-- From owner-svn-src-head@freebsd.org Sun Feb 11 18:37: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 2DB12F0C714; Sun, 11 Feb 2018 18:37:09 +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 D5611845DF; Sun, 11 Feb 2018 18:37:08 +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 B213F26A24; Sun, 11 Feb 2018 18:37:08 +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 w1BIb8bo075574; Sun, 11 Feb 2018 18:37:08 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1BIb8Oo075573; Sun, 11 Feb 2018 18:37:08 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201802111837.w1BIb8Oo075573@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sun, 11 Feb 2018 18:37:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329128 - head/sys/kgssapi X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/kgssapi X-SVN-Commit-Revision: 329128 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 11 Feb 2018 18:37:09 -0000 Author: brooks Date: Sun Feb 11 18:37:08 2018 New Revision: 329128 URL: https://svnweb.freebsd.org/changeset/base/329128 Log: Use syscall_helper_register(9) rather than syscall_register(). The usage is simpler, documented, and more common. Reviewed by: cem Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14227 Modified: head/sys/kgssapi/gss_impl.c Modified: head/sys/kgssapi/gss_impl.c ============================================================================== --- head/sys/kgssapi/gss_impl.c Sun Feb 11 17:45:38 2018 (r329127) +++ head/sys/kgssapi/gss_impl.c Sun Feb 11 18:37:08 2018 (r329128) @@ -56,39 +56,33 @@ MALLOC_DEFINE(M_GSSAPI, "GSS-API", "GSS-API"); /* * Syscall hooks */ -static int gssd_syscall_offset = SYS_gssd_syscall; -static struct sysent gssd_syscall_prev_sysent; -MAKE_SYSENT(gssd_syscall); -static bool_t gssd_syscall_registered = FALSE; +static struct syscall_helper_data gssd_syscalls[] = { + SYSCALL_INIT_HELPER(gssd_syscall), + SYSCALL_INIT_LAST +}; struct kgss_mech_list kgss_mechs; CLIENT *kgss_gssd_handle; struct mtx kgss_gssd_lock; -static void -kgss_init(void *dummy) +static int +kgss_load(void) { int error; LIST_INIT(&kgss_mechs); - error = syscall_register(&gssd_syscall_offset, &gssd_syscall_sysent, - &gssd_syscall_prev_sysent, SY_THR_STATIC_KLD); - if (error) - printf("Can't register GSSD syscall\n"); - else - gssd_syscall_registered = TRUE; + error = syscall_helper_register(gssd_syscalls, SY_THR_STATIC_KLD); + if (error != 0) + return (error); + return (0); } -SYSINIT(kgss_init, SI_SUB_LOCK, SI_ORDER_FIRST, kgss_init, NULL); static void -kgss_uninit(void *dummy) +kgss_unload(void) { - if (gssd_syscall_registered) - syscall_deregister(&gssd_syscall_offset, - &gssd_syscall_prev_sysent); + syscall_helper_unregister(gssd_syscalls); } -SYSUNINIT(kgss_uninit, SI_SUB_LOCK, SI_ORDER_FIRST, kgss_uninit, NULL); int sys_gssd_syscall(struct thread *td, struct gssd_syscall_args *uap) @@ -293,6 +287,8 @@ kgssapi_modevent(module_t mod, int type, void *data) switch (type) { case MOD_LOAD: + if (error != 0) + return (error); rpc_gss_entries.rpc_gss_refresh_auth = rpc_gss_refresh_auth; rpc_gss_entries.rpc_gss_secfind = rpc_gss_secfind; rpc_gss_entries.rpc_gss_secpurge = rpc_gss_secpurge; @@ -317,8 +313,11 @@ kgssapi_modevent(module_t mod, int type, void *data) rpc_gss_entries.rpc_gss_svc_max_data_length = rpc_gss_svc_max_data_length; mtx_init(&kgss_gssd_lock, "kgss_gssd_lock", NULL, MTX_DEF); + error = kgss_load(); break; case MOD_UNLOAD: + kgss_unload(); + mtx_destroy(&kgss_gssd_lock); /* * Unloading of the kgssapi module is not currently supported. * If somebody wants this, we would need to keep track of From owner-svn-src-head@freebsd.org Sun Feb 11 18:42: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 696C0F0CE13 for ; Sun, 11 Feb 2018 18:42:38 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (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 E9EEB84B1E for ; Sun, 11 Feb 2018 18:42:37 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 49701746-0f5b-11e8-bb8e-b35b57339d60 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 outbound1.ore.mailhop.org (Halon) with ESMTPSA id 49701746-0f5b-11e8-bb8e-b35b57339d60; Sun, 11 Feb 2018 18:42:18 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w1BIgTEC032446; Sun, 11 Feb 2018 11:42:29 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1518374549.32585.238.camel@freebsd.org> Subject: Re: svn commit: r329126 - head/etc/devd From: Ian Lepore To: cem@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sun, 11 Feb 2018 11:42:29 -0700 In-Reply-To: References: <201802111635.w1BGZutu015341@repo.freebsd.org> 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.25 Precedence: list List-Id: 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, 11 Feb 2018 18:42:38 -0000 On Sun, 2018-02-11 at 10:20 -0800, Conrad Meyer wrote: > On Sun, Feb 11, 2018 at 8:35 AM, Ian Lepore wrote: > > > > Author: ian > > Date: Sun Feb 11 16:35:56 2018 > > New Revision: 329126 > > URL: https://svnweb.freebsd.org/changeset/base/329126 > > > > Log: > >   Regenerate devd/usb.conf after the recent addition of several new > > device IDs. > > > > Modified: > >   head/etc/devd/usb.conf > > If this file is machine generated and not an administrator > configuration file, shouldn't it live in /usr/share instead of /etc, > per hier(7)? > > Best, > Conrad > I wonder if that question would apply to all five files we put in /etc/devd?  It looks like they could be moved to /usr/share with minimal fuss by adding that directory to the search list in /etc/devd.conf. I'm agnostic about the value of moving them.  Users can configure local rules by modifying the existing devd.conf and files in devd/ and dealing with mergemaster on updates, or by adding their own new files in devd/. -- Ian From owner-svn-src-head@freebsd.org Sun Feb 11 19:08: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 2B4A8F0EE58 for ; Sun, 11 Feb 2018 19:08:28 +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 B28C585B16 for ; Sun, 11 Feb 2018 19:08:27 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22f.google.com with SMTP id d13so15082300iog.5 for ; Sun, 11 Feb 2018 11:08:27 -0800 (PST) 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=3aXLx4diqSDU+1sh60awgiDIPzxSPgBDLU0MSb8pK7o=; b=dZX3ILydaHANsiLY6Sd/1xmM8DQvBMUUy0Q4IE69cyac+5b1mGugcQr/jHIYS4RFVQ N3u9IU+5LOamj+IBZJMyHtXp3FMIZTFfQZD2lKlWhb3fSBPOwND2aWOx0nOpLMkUXhEx 64gozbQbT7Jz0OfFlyNgW2k6g/iVNi9ABFp3j0OYooey5aJzs2IJGCKPR1UzxTIxiO59 lram3yjhkxAP1AqILiN/+17JgzlgRpoO2OavGzipyOQ6wz2uHqMrIwUn1WvHJ1FzshvS R8enNLtDGowEML8oxRUbuGMOx6T7h3zvh1Ri4jrGTMqax9PEx5K+V4FPny+yierCRh47 u0ng== 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=3aXLx4diqSDU+1sh60awgiDIPzxSPgBDLU0MSb8pK7o=; b=f86aZ45APZ571L0dIrNxOqUNWzCXBzYgvwC7qVENLuD8vHqAYDubi7FM2fHxBjGl5i 6Hxi6BCs7ZK4mff/n3JukNfuG3Rk9omZDkw27TarA+KvCCtsBnjNfKS9NgcouOypnSrV UG7ur/W1Xlgfnrev1CbLiWyU54dAHoplHLFaaIOluQIRe0noXG7HtFqWfi+BKZSuNdTw 0lEWm5CvxPLJ825ypx9T5BbfaWaJ7sAxPlfV9Qm8UP91eEaei7JlfB7lnLFYWXofptjL cMajk80lowl8TnnogY4QVL7dJoLIWguj1iGeSK4TTOmsc7/zCDWwe59iYZjy1PTyNVgZ 31YA== X-Gm-Message-State: APf1xPBH9jnYVEWLm4wrwn6RBWSA61JLOjvPzrDHiAUMVdunlN9S+U9e Nt7lQwgjYjfKt7a/apxH3ep6JnQdQeB19ElFYtoO3A== X-Google-Smtp-Source: AH8x225PSdUof6ihn3k81cw6wy85d02a5bAjpuOqWzNWhs1/832w0ljQ00MoCDQnYRFg0BLfi77HWCogCnI4ltIgMN8= X-Received: by 10.107.88.12 with SMTP id m12mr9752028iob.136.1518376106980; Sun, 11 Feb 2018 11:08:26 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Sun, 11 Feb 2018 11:08:26 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:18a2:a4f7:170:8dd9] In-Reply-To: <1518374549.32585.238.camel@freebsd.org> References: <201802111635.w1BGZutu015341@repo.freebsd.org> <1518374549.32585.238.camel@freebsd.org> From: Warner Losh Date: Sun, 11 Feb 2018 12:08:26 -0700 X-Google-Sender-Auth: eY3dVMqY7Zbc4PNhmj0OQjzAIDI Message-ID: Subject: Re: svn commit: r329126 - head/etc/devd To: Ian Lepore Cc: "Conrad E. Meyer" , 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.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 11 Feb 2018 19:08:28 -0000 On Sun, Feb 11, 2018 at 11:42 AM, Ian Lepore wrote: > On Sun, 2018-02-11 at 10:20 -0800, Conrad Meyer wrote: > > On Sun, Feb 11, 2018 at 8:35 AM, Ian Lepore wrote: > > > > > > Author: ian > > > Date: Sun Feb 11 16:35:56 2018 > > > New Revision: 329126 > > > URL: https://svnweb.freebsd.org/changeset/base/329126 > > > > > > Log: > > > Regenerate devd/usb.conf after the recent addition of several new > > > device IDs. > > > > > > Modified: > > > head/etc/devd/usb.conf > > > > If this file is machine generated and not an administrator > > configuration file, shouldn't it live in /usr/share instead of /etc, > > per hier(7)? > > > > Best, > > Conrad > > > > I wonder if that question would apply to all five files we put in > /etc/devd? It looks like they could be moved to /usr/share with > minimal fuss by adding that directory to the search list in > /etc/devd.conf. > > I'm agnostic about the value of moving them. Users can configure local > rules by modifying the existing devd.conf and files in devd/ and > dealing with mergemaster on updates, or by adding their own new files > in devd/. > It doesn't matter. We're better off throwing the generated stuff away entirely and migrating this to devmatch. Warner From owner-svn-src-head@freebsd.org Sun Feb 11 20:15: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 4CC4EF144A2; Sun, 11 Feb 2018 20:15:48 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EBC03691B0; Sun, 11 Feb 2018 20:15:47 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E216727A80; Sun, 11 Feb 2018 20:15:47 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1BKFlK9026587; Sun, 11 Feb 2018 20:15:47 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1BKFlkh026585; Sun, 11 Feb 2018 20:15:47 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201802112015.w1BKFlkh026585@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Sun, 11 Feb 2018 20:15:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329137 - in head/sys/dev: mpr mps X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: in head/sys/dev: mpr mps X-SVN-Commit-Revision: 329137 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 11 Feb 2018 20:15:48 -0000 Author: scottl Date: Sun Feb 11 20:15:47 2018 New Revision: 329137 URL: https://svnweb.freebsd.org/changeset/base/329137 Log: Print out the shared memory queues during initialization Sponsored by: Netflix Modified: head/sys/dev/mpr/mpr.c head/sys/dev/mps/mps.c Modified: head/sys/dev/mpr/mpr.c ============================================================================== --- head/sys/dev/mpr/mpr.c Sun Feb 11 20:06:36 2018 (r329136) +++ head/sys/dev/mpr/mpr.c Sun Feb 11 20:15:47 2018 (r329137) @@ -1356,6 +1356,10 @@ mpr_alloc_hw_queues(struct mpr_softc *sc) sc->free_busaddr = queues_busaddr; sc->post_queue = (MPI2_REPLY_DESCRIPTORS_UNION *)(queues + fqsize); sc->post_busaddr = queues_busaddr + fqsize; + mpr_dprint(sc, MPR_INIT, "free queue busaddr= %#016lx size= %d\n", + sc->free_busaddr, fqsize); + mpr_dprint(sc, MPR_INIT, "reply queue busaddr= %#016lx size= %d\n", + sc->post_busaddr, pqsize); return (0); } @@ -1398,6 +1402,8 @@ mpr_alloc_replies(struct mpr_softc *sc) bzero(sc->reply_frames, rsize); bus_dmamap_load(sc->reply_dmat, sc->reply_map, sc->reply_frames, rsize, mpr_memaddr_cb, &sc->reply_busaddr, 0); + mpr_dprint(sc, MPR_INIT, "reply frames busaddr= %#016lx size= %d\n", + sc->reply_busaddr, rsize); return (0); } @@ -1432,6 +1438,8 @@ mpr_alloc_requests(struct mpr_softc *sc) bzero(sc->req_frames, rsize); bus_dmamap_load(sc->req_dmat, sc->req_map, sc->req_frames, rsize, mpr_memaddr_cb, &sc->req_busaddr, 0); + mpr_dprint(sc, MPR_INIT, "request frames busaddr= %#016lx size= %d\n", + sc->req_busaddr, rsize); rsize = sc->chain_frame_size * sc->num_chains; if (bus_dma_tag_create( sc->mpr_parent_dmat, /* parent */ @@ -1456,6 +1464,8 @@ mpr_alloc_requests(struct mpr_softc *sc) bzero(sc->chain_frames, rsize); bus_dmamap_load(sc->chain_dmat, sc->chain_map, sc->chain_frames, rsize, mpr_memaddr_cb, &sc->chain_busaddr, 0); + mpr_dprint(sc, MPR_INIT, "chain frames busaddr= %#016lx size= %d\n", + sc->chain_busaddr, rsize); rsize = MPR_SENSE_LEN * sc->num_reqs; if (bus_dma_tag_create( sc->mpr_parent_dmat, /* parent */ @@ -1480,6 +1490,8 @@ mpr_alloc_requests(struct mpr_softc *sc) bzero(sc->sense_frames, rsize); bus_dmamap_load(sc->sense_dmat, sc->sense_map, sc->sense_frames, rsize, mpr_memaddr_cb, &sc->sense_busaddr, 0); + mpr_dprint(sc, MPR_INIT, "sense frames busaddr= %#016lx size= %d\n", + sc->sense_busaddr, rsize); sc->chains = malloc(sizeof(struct mpr_chain) * sc->num_chains, M_MPR, M_WAITOK | M_ZERO); Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Sun Feb 11 20:06:36 2018 (r329136) +++ head/sys/dev/mps/mps.c Sun Feb 11 20:15:47 2018 (r329137) @@ -1313,6 +1313,10 @@ mps_alloc_hw_queues(struct mps_softc *sc) sc->free_busaddr = queues_busaddr; sc->post_queue = (MPI2_REPLY_DESCRIPTORS_UNION *)(queues + fqsize); sc->post_busaddr = queues_busaddr + fqsize; + mps_dprint(sc, MPS_INIT, "free queue busaddr= %#016lx size= %d\n", + sc->free_busaddr, fqsize); + mps_dprint(sc, MPS_INIT, "reply queue busaddr= %#016lx size= %d\n", + sc->post_busaddr, pqsize); return (0); } @@ -1356,6 +1360,9 @@ mps_alloc_replies(struct mps_softc *sc) bus_dmamap_load(sc->reply_dmat, sc->reply_map, sc->reply_frames, rsize, mps_memaddr_cb, &sc->reply_busaddr, 0); + mps_dprint(sc, MPS_INIT, "reply frames busaddr= %#016lx size= %d\n", + sc->reply_busaddr, rsize); + return (0); } @@ -1389,6 +1396,8 @@ mps_alloc_requests(struct mps_softc *sc) bzero(sc->req_frames, rsize); bus_dmamap_load(sc->req_dmat, sc->req_map, sc->req_frames, rsize, mps_memaddr_cb, &sc->req_busaddr, 0); + mps_dprint(sc, MPS_INIT, "request frames busaddr= %#016lx size= %d\n", + sc->req_busaddr, rsize); rsize = sc->reqframesz * sc->num_chains; if (bus_dma_tag_create( sc->mps_parent_dmat, /* parent */ @@ -1413,6 +1422,8 @@ mps_alloc_requests(struct mps_softc *sc) bzero(sc->chain_frames, rsize); bus_dmamap_load(sc->chain_dmat, sc->chain_map, sc->chain_frames, rsize, mps_memaddr_cb, &sc->chain_busaddr, 0); + mps_dprint(sc, MPS_INIT, "chain frames busaddr= %#016lx size= %d\n", + sc->chain_busaddr, rsize); rsize = MPS_SENSE_LEN * sc->num_reqs; if (bus_dma_tag_create( sc->mps_parent_dmat, /* parent */ @@ -1437,6 +1448,8 @@ mps_alloc_requests(struct mps_softc *sc) bzero(sc->sense_frames, rsize); bus_dmamap_load(sc->sense_dmat, sc->sense_map, sc->sense_frames, rsize, mps_memaddr_cb, &sc->sense_busaddr, 0); + mps_dprint(sc, MPS_INIT, "sense frames busaddr= %#016lx size= %d\n", + sc->sense_busaddr, rsize); sc->chains = malloc(sizeof(struct mps_chain) * sc->num_chains, M_MPT2, M_WAITOK | M_ZERO); From owner-svn-src-head@freebsd.org Sun Feb 11 22:09: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 99DADF1D179; Sun, 11 Feb 2018 22:09:09 +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 CB0E96DF99; Sun, 11 Feb 2018 22:09:08 +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 068BBCF5; Sun, 11 Feb 2018 22:09:08 +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 w1BM97df081914; Sun, 11 Feb 2018 22:09:07 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1BM97WQ081913; Sun, 11 Feb 2018 22:09:07 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802112209.w1BM97WQ081913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sun, 11 Feb 2018 22:09:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329142 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 329142 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 11 Feb 2018 22:09:09 -0000 Author: cem Date: Sun Feb 11 22:09:07 2018 New Revision: 329142 URL: https://svnweb.freebsd.org/changeset/base/329142 Log: device_add_child.9: reference logical opposite, device_delete_child(9) Modified: head/share/man/man9/device_add_child.9 Modified: head/share/man/man9/device_add_child.9 ============================================================================== --- head/share/man/man9/device_add_child.9 Sun Feb 11 21:09:00 2018 (r329141) +++ head/share/man/man9/device_add_child.9 Sun Feb 11 22:09:07 2018 (r329142) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 15, 2017 +.Dd February 11, 2018 .Dt DEVICE_ADD_CHILD 9 .Os .Sh NAME @@ -126,6 +126,7 @@ The new device if successful, NULL otherwise. .Sh SEE ALSO .Xr BUS_ADD_CHILD 9 , .Xr device 9 , +.Xr device_delete_child 9 , .Xr device_find_child 9 , .Xr DEVICE_IDENTIFY 9 .Sh AUTHORS From owner-svn-src-head@freebsd.org Sun Feb 11 23:46: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 26AE3F0155C; Sun, 11 Feb 2018 23:46:37 +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 9CDA57241D; Sun, 11 Feb 2018 23:46:35 +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 w1BNkQpc041511; Sun, 11 Feb 2018 15:46:26 -0800 (PST) (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 w1BNkPXc041510; Sun, 11 Feb 2018 15:46:25 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201802112346.w1BNkPXc041510@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r329126 - head/etc/devd In-Reply-To: <1518374549.32585.238.camel@freebsd.org> To: Ian Lepore Date: Sun, 11 Feb 2018 15:46:24 -0800 (PST) CC: cem@freebsd.org, 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.25 Precedence: list List-Id: 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, 11 Feb 2018 23:46:37 -0000 [ Charset ISO-8859-1 unsupported, converting... ] > On Sun, 2018-02-11 at 10:20 -0800, Conrad Meyer wrote: > > On Sun, Feb 11, 2018 at 8:35 AM, Ian Lepore wrote: > > > > > > Author: ian > > > Date: Sun Feb 11 16:35:56 2018 > > > New Revision: 329126 > > > URL: https://svnweb.freebsd.org/changeset/base/329126 > > > > > > Log: > > > ? Regenerate devd/usb.conf after the recent addition of several new > > > device IDs. > > > > > > Modified: > > > ? head/etc/devd/usb.conf > > > > If this file is machine generated and not an administrator > > configuration file, shouldn't it live in /usr/share instead of /etc, > > per hier(7)? > > > > Best, > > Conrad > > > > I wonder if that question would apply to all five files we put in > /etc/devd? ?It looks like they could be moved to /usr/share with > minimal fuss by adding that directory to the search list in > /etc/devd.conf. Moving this to /usr creates a cyclic issue in that you then need /usr to be mounted before devd can start and devd's /etc/rc.d file says: # PROVIDE: devd # REQUIRE: NETWORKING # BEFORE: mountcritremote # KEYWORD: nojail In the diskless and nfs shared /usr worlds devd wants to start before /usr is mounted. > I'm agnostic about the value of moving them. ?Users can configure local > rules by modifying the existing devd.conf and files in devd/ and > dealing with mergemaster on updates, or by adding their own new files > in devd/. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Feb 12 00:07: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 AFE21F030A8 for ; Mon, 12 Feb 2018 00:07:30 +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 4207673309 for ; Mon, 12 Feb 2018 00:07:30 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: a5c25af7-0f88-11e8-b951-f99fef315fd9 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 a5c25af7-0f88-11e8-b951-f99fef315fd9; Mon, 12 Feb 2018 00:07:01 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w1C07L9O033052; Sun, 11 Feb 2018 17:07:21 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1518394041.32585.240.camel@freebsd.org> Subject: Re: svn commit: r329137 - in head/sys/dev: mpr mps From: Ian Lepore To: Scott Long , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sun, 11 Feb 2018 17:07:21 -0700 In-Reply-To: <201802112015.w1BKFlkh026585@repo.freebsd.org> References: <201802112015.w1BKFlkh026585@repo.freebsd.org> 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.25 Precedence: list List-Id: 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, 12 Feb 2018 00:07:30 -0000 On Sun, 2018-02-11 at 20:15 +0000, Scott Long wrote: > Author: scottl > Date: Sun Feb 11 20:15:47 2018 > New Revision: 329137 > URL: https://svnweb.freebsd.org/changeset/base/329137 > > Log: >   Print out the shared memory queues during initialization >    >   Sponsored by: Netflix > > Modified: >   head/sys/dev/mpr/mpr.c >   head/sys/dev/mps/mps.c > FYI, I'm getting several errors like this building for i386... /b/staging/freebsd/head/src/sys/dev/mps/mps.c:1317:6: error: format specifies type 'unsigned long' but the argument has type 'bus_addr_t' (aka 'unsigned int') [-Werror,-Wformat]             sc->free_busaddr, fqsize);             ^~~~~~~~~~~~~~~~ /b/staging/freebsd/head/src/sys/dev/mps/mpsvar.h:664:39: note: expanded from macro 'mps_dprint'                 device_printf((sc)->mps_dev, msg, ##args);      \                                                     ^~~~ -- Ian From owner-svn-src-head@freebsd.org Mon Feb 12 01:13: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 A72F3F07E49; Mon, 12 Feb 2018 01:13:11 +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 EFE0275D86; Mon, 12 Feb 2018 01:13:10 +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 C02E63C44A3; Mon, 12 Feb 2018 11:55:21 +1100 (AEDT) Date: Mon, 12 Feb 2018 11:55:21 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329127 - head/sys/sys In-Reply-To: <201802111745.w1BHjcWA050692@repo.freebsd.org> Message-ID: <20180212111457.R873@besplex.bde.org> References: <201802111745.w1BHjcWA050692@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=0lazxUdnjwkT5nhfHf8A:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 01:13:11 -0000 On Sun, 11 Feb 2018, Warner Losh wrote: > Log: > Consistent macro indentation is the hobgoblin of small minds > > Line up the macro definitions and names here like the machine/stdarg.h > files that this replaced. This is easier to read and also makes it > easier to match up with other includes. Also two space indent va_end > to match the rest of the surrounding if block. Any chance of using KNF style? The 2-column indent for cpp things is easier to read than the KNF 0-column indent for cpp things, but is inconsistent with the KNF 8-column indent for C things, and is harder to write and maintain. > Modified: head/sys/sys/_stdarg.h > ============================================================================== > --- head/sys/sys/_stdarg.h Sun Feb 11 16:35:56 2018 (r329126) > +++ head/sys/sys/_stdarg.h Sun Feb 11 17:45:38 2018 (r329127) > @@ -43,13 +43,13 @@ > #endif > > #ifdef __GNUCLIKE_BUILTIN_STDARG > - #define va_start(ap, last) __builtin_va_start((ap), (last)) > - #define va_arg(ap, type) __builtin_va_arg((ap), type) > - #define __va_copy(dest, src) __builtin_va_copy((dest), (src)) > + #define va_start(ap, last) __builtin_va_start((ap), (last)) > + #define va_arg(ap, type) __builtin_va_arg((ap), type) > + #define __va_copy(dest, src) __builtin_va_copy((dest), (src)) In KNF, '#define' is not indented, and the tab after '#define' puts the name in column 8. Here, '#define is indented by 2 columns, and the space after #define used to put the name in column 2+7+1 = 10; now it puts the name in column 16 which is too far to the right. > #if __ISO_C_VISIBLE >= 1999 > - #define va_copy(dest, src) __va_copy(dest, src) > + #define va_copy(dest, src) __va_copy(dest, src) Deeper nesting causes further problems. Now the '#define's are indented by 2+2 columns. The names used to be indented to match, but they are now indented uniformly to 16 (except for unconverted ones), so their indentation no longer reflects the nesting. For 5 levels of nesting, the #define's would be in column 10 and the tab would indent the names to column 24. > #endif > -#define va_end(ap) __builtin_va_end(ap) > + #define va_end(ap) __builtin_va_end(ap) This like was actually in KNF style. > #endif > > #if defined(lint) && !defined(va_start) There are many unchanged misformattings before and after the ones modified in the patch. These are now more inconsistent than before: before: - space instead of tab after #define for idempotency ifdef - space instead of tab after #define for _VA_LIST_DECLARED after: - no tabs in the lint section (4 #define's). One of these is long and would blow out to 92 columns with tabs instead of spaces. After fixing the indentation of #define, it still takes 83 columns. Other style bugs in this file: - _VA_LIST_DECLARED is declared before va_list is actually declared. This is illogical, and its bad style is not used for older #define's of this type - space after ! in comment on #endif for idempotency ifdef - garbage newline before EOF. This file scores 67% on knfom(1) after this commit, down from 68% before. Most of the errors detected are for the 2-column indentation of almost everything. After fixing this, the score is 95%. IIRC, indent(1) never reformats cpp directives. knfom(1) uses indent(1) so it doesn't notice bugs in cpp expressions. The score is only 95% because of bugs in indent(1). indent(1) fixes the cpp indentation and the garbage before EOF, but adds the following bugs: - change the tab in tyhe typedef to a space - indent the comment on the #endif for the idempotency ifdef. Bruce From owner-svn-src-head@freebsd.org Mon Feb 12 01:29: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 8A522F09259 for ; Mon, 12 Feb 2018 01:29:12 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x230.google.com (mail-it0-x230.google.com [IPv6:2607:f8b0:4001:c0b::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 B00A5767E5 for ; Mon, 12 Feb 2018 01:29:11 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x230.google.com with SMTP id k131so4886005ith.4 for ; Sun, 11 Feb 2018 17:29:11 -0800 (PST) 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=or9RWhlIgYwKlQItjAwo/cq2yRqIj1i3fhnqUM31jNA=; b=RPJaivfVDFx9C55FnrKTUQi2Zqzrz7MMR8qkrTtQhG9oAvgXvOypREx6lkKJbA4xzc dd4uUXaT7duzpRF4O9XPNdbdS5nsxwu+VZ2ZFoLeprabJMOIcOEqTVfDDfmKXno1zM74 DQdbeuZlqAaIim93t0/dpyyurQFr8H25yS2TkrHThwCXjWTBfgsERShLfX4FvUKDeTzz 5HUHQkwsI/9sFswK/xUtg8EZ6w6rcSxb+hZn+OfIw7S7i/U/qkJDRenCNnMb/RoXX07a QnZ3s5CvhQ/AsyCjcAaJGXFo8HJYfWsY9XuDaR78PGqQ7aDQ7FuLC5NVUbtRKK3D0/uL HGnA== 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=or9RWhlIgYwKlQItjAwo/cq2yRqIj1i3fhnqUM31jNA=; b=RT4hvAygfiATimDwYK6THED+DzpATuOQuvP2jE5FD+legc8Iyr7ci5Seg4VFHS7Mzx VT2qWtkPuyfJO4ESofE0gt1L7BPZmvqLH9FS2WO3XalUqWEf54dM3MhwTVynBoDI+Bct gOXsS/BworxiWpUxE/MaKpoVT6gHyw+Oc6SDDHNbIXsjBXnRZvRxjyCD7cVFoYVQZZQa /Sd3QRY2j0M7gng6rnXfR1qRNL2xF7ZcGLY3fL+VBsidBzzkwAngCgnmMGgPkkR1sz+j UzjPKk8DGlAh9Zc3AkRe8bTzcJs/yIQ3HKBOPCANwRqMmGR6B2fDSEVXRqvSLXX/o42f 16ZQ== X-Gm-Message-State: APf1xPB9CsUo9N7XTiu+CGCVv2Cc9LCAVoECp5kKCKgWMAGXg/iQloVa jaWENEapf2utzVEJjYn6XtmF9aClWZZoOpttkBEoxA== X-Google-Smtp-Source: AH8x227yKRKnME/2MCi1XyzYH7NI6KA25kBvkJmCP0QLUwqBWAbe8A2ON3HH+TPBdiN1bwCyYETfYlV9zZtQnxI5CR0= X-Received: by 10.36.250.193 with SMTP id v184mr3279279ith.64.1518398950786; Sun, 11 Feb 2018 17:29:10 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Sun, 11 Feb 2018 17:29:10 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: <20180212111457.R873@besplex.bde.org> References: <201802111745.w1BHjcWA050692@repo.freebsd.org> <20180212111457.R873@besplex.bde.org> From: Warner Losh Date: Sun, 11 Feb 2018 18:29:10 -0700 X-Google-Sender-Auth: tC8kjCb8k_kNg51CLJBPaDBoqxM Message-ID: Subject: Re: svn commit: r329127 - head/sys/sys To: Bruce Evans 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.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 01:29:12 -0000 On Sun, Feb 11, 2018 at 5:55 PM, Bruce Evans wrote: > On Sun, 11 Feb 2018, Warner Losh wrote: > > Log: >> Consistent macro indentation is the hobgoblin of small minds >> >> Line up the macro definitions and names here like the machine/stdarg.h >> files that this replaced. This is easier to read and also makes it >> easier to match up with other includes. Also two space indent va_end >> to match the rest of the surrounding if block. >> > > Any chance of using KNF style? > > The 2-column indent for cpp things is easier to read than the KNF 0-column > indent for cpp things, but is inconsistent with the KNF 8-column indent for > C things, and is harder to write and maintain. > > Modified: head/sys/sys/_stdarg.h >> ============================================================ >> ================== >> --- head/sys/sys/_stdarg.h Sun Feb 11 16:35:56 2018 (r329126) >> +++ head/sys/sys/_stdarg.h Sun Feb 11 17:45:38 2018 (r329127) >> @@ -43,13 +43,13 @@ >> #endif >> >> #ifdef __GNUCLIKE_BUILTIN_STDARG >> - #define va_start(ap, last) __builtin_va_start((ap), (last)) >> - #define va_arg(ap, type) __builtin_va_arg((ap), type) >> - #define __va_copy(dest, src) __builtin_va_copy((dest), (src)) >> + #define va_start(ap, last) __builtin_va_start((ap), (last)) >> + #define va_arg(ap, type) __builtin_va_arg((ap), type) >> + #define __va_copy(dest, src) __builtin_va_copy((dest), (src)) >> > > In KNF, '#define' is not indented, and the tab after '#define' puts the > name in column 8. Here, '#define is indented by 2 columns, and the space > after #define used to put the name in column 2+7+1 = 10; now it puts the > name in column 16 which is too far to the right. > > #if __ISO_C_VISIBLE >= 1999 >> - #define va_copy(dest, src) __va_copy(dest, src) >> + #define va_copy(dest, src) __va_copy(dest, src) >> > > Deeper nesting causes further problems. Now the '#define's are indented > by 2+2 columns. The names used to be indented to match, but they are > now indented uniformly to 16 (except for unconverted ones), so their > indentation no longer reflects the nesting. For 5 levels of nesting, > the #define's would be in column 10 and the tab would indent the names > to column 24. > > #endif >> -#define va_end(ap) __builtin_va_end(ap) >> + #define va_end(ap) __builtin_va_end(ap) >> > > This like was actually in KNF style. Right, but it didn't match the rest of the file :) > > #endif >> >> #if defined(lint) && !defined(va_start) >> > > There are many unchanged misformattings before and after the ones modified > in the patch. These are now more inconsistent than before: > before: > - space instead of tab after #define for idempotency ifdef > - space instead of tab after #define for _VA_LIST_DECLARED > after: > - no tabs in the lint section (4 #define's). One of these is long and > would blow out to 92 columns with tabs instead of spaces. After fixing > the indentation of #define, it still takes 83 columns. > > Other style bugs in this file: > - _VA_LIST_DECLARED is declared before va_list is actually declared. This > is illogical, and its bad style is not used for older #define's of this > type > - space after ! in comment on #endif for idempotency ifdef > - garbage newline before EOF. > > This file scores 67% on knfom(1) after this commit, down from 68% before. > Most of the errors detected are for the 2-column indentation of almost > everything. After fixing this, the score is 95%. IIRC, indent(1) never > reformats cpp directives. knfom(1) uses indent(1) so it doesn't notice > bugs in cpp expressions. The score is only 95% because of bugs in > indent(1). indent(1) fixes the cpp indentation and the garbage before EOF, > but adds the following bugs: > - change the tab in tyhe typedef to a space > - indent the comment on the #endif for the idempotency ifdef. what's knfom? Google gives me garbage when I search for that. Warner From owner-svn-src-head@freebsd.org Mon Feb 12 02:04: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 49478F0B936; Mon, 12 Feb 2018 02:04: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 D9B6577C25; Mon, 12 Feb 2018 02:04:51 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f169.google.com with SMTP id 72so15691678iom.10; Sun, 11 Feb 2018 18:04:51 -0800 (PST) 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=EScMYWvzkvWMaJ8vzrsD3n8MZJMqBetvVBrv+GVLFic=; b=OGnUZQIGnGXkR52tM/h3zdlk4FIKGOpmk6pSKPuP+AK7NrHaQxtW267Zr5bo2axyvL RB76ILMC0SBE5jT/V2xJxU1ul0gMclAfyjtKqY6+SUuBF4WEfl38efZCfc9fPS08MiXq SorpyrEUpU7z0R9aKIWYB0hwdoyn+D//nluEQ2oGT3ELAnjsX8EGvhAUdYjNwW6iXbHF fOqH6XsbtxdOtHbjMrMvB71HkLAEz640yvGFCjcvo2ZL0B16zUeio3VeezECxbmj6q2Q ZdP15LPxd5E7MOE4KF/kpsQwOlot6U394Dy8JL9a5/T7zxOMKIuxEYXu06+m/3qXwQ6X Rtvg== X-Gm-Message-State: APf1xPBDCb8oOIpv12ro1cuI6a5VKGzCS2cOdJIxLtvGxiz3VylPrWf/ VufajdOlDn5UKO6YO+Nn54uL4SFX X-Google-Smtp-Source: AH8x225TqhFThNeiwtjnWB0uEhTdxa+TNXw9j+V3NXj21P/DRI1+QO6OoxqtNg2LOf1PPEfFwCfLDg== X-Received: by 10.107.70.25 with SMTP id t25mr11157181ioa.126.1518395727935; Sun, 11 Feb 2018 16:35:27 -0800 (PST) Received: from mail-io0-f182.google.com (mail-io0-f182.google.com. [209.85.223.182]) by smtp.gmail.com with ESMTPSA id i63sm4996391itb.31.2018.02.11.16.35.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Feb 2018 16:35:27 -0800 (PST) Received: by mail-io0-f182.google.com with SMTP id g14so9354673iob.9; Sun, 11 Feb 2018 16:35:27 -0800 (PST) X-Received: by 10.107.2.6 with SMTP id 6mr2684060ioc.117.1518395726998; Sun, 11 Feb 2018 16:35:26 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.30.149 with HTTP; Sun, 11 Feb 2018 16:35:26 -0800 (PST) In-Reply-To: <201802112346.w1BNkPXc041510@pdx.rh.CN85.dnsmgr.net> References: <1518374549.32585.238.camel@freebsd.org> <201802112346.w1BNkPXc041510@pdx.rh.CN85.dnsmgr.net> From: Conrad Meyer Date: Sun, 11 Feb 2018 16:35:26 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r329126 - head/etc/devd To: "Rodney W. Grimes" 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.25 Precedence: list List-Id: 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, 12 Feb 2018 02:04:52 -0000 On Sun, Feb 11, 2018 at 3:46 PM, Rodney W. Grimes wrote: > Moving this to /usr creates a cyclic issue in that you then need > /usr to be mounted before devd can start and devd's /etc/rc.d file > says: > # PROVIDE: devd > # REQUIRE: NETWORKING > # BEFORE: mountcritremote > # KEYWORD: nojail > > In the diskless and nfs shared /usr worlds devd wants to start > before /usr is mounted. If devd is needed to mount /usr (???), it seems like just another demonstration of why separate /usr is a poor idea. From owner-svn-src-head@freebsd.org Mon Feb 12 02:58: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 AAB81F0F020 for ; Mon, 12 Feb 2018 02:58:04 +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 2F021795E8 for ; Mon, 12 Feb 2018 02:58:04 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22c.google.com with SMTP id f4so15781515ioh.8 for ; Sun, 11 Feb 2018 18:58:04 -0800 (PST) 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=wwYk+xIZ4cxkRVEaGBElNlnyNuRwD9dWSbDtXn2Ww3g=; b=zzsGxkRcLkLDCxtxM3Q3yryTI2xB1fpiMPKT3YKNOGHqG+FSpenoVCiYleBn4JA0dn JXO2gAgvPSRdgTbtdKkXLCfQ1XGTmU8ikDAXOxCK2Y3SIY2taSXuxDgtnMtQRcDyUf51 r4AHpeLSCZBnFUhFFEhtg0XfQR0NCRPyc7p/1GRb1MhuNbmOy6P1GnQcuX0VO2titgSI qO8oJbx4pIl4XMFViZKK0tEFe1N5QZx2t2XReZ/I8mlz8bJ6IUo/aLq+oQjDBNgBqm1p PgoSoBsCGeKkTyRhFCYWR90Rz9dDz5SHYqYeOhQ9TwWo1SYJ2sbeXTyR/IU7xl3jdEk/ ormg== 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=wwYk+xIZ4cxkRVEaGBElNlnyNuRwD9dWSbDtXn2Ww3g=; b=YcP320ALqZZ12p+tUdz24mkWtuSsSvff2chjInrsPV3QX9YI6vfxw25Xm2VKzyMYkK dxO9AcsIlQKhP0zGcFRy/8LjPF4Nxos30JPf1erTAApnt3S7tnp+8UA9wU6/+y3rsu+J Gq8wYd3r3GIqrd3wHapJkl8SO7d2DCxp1NxENL/66R3XeAHcZwfYJwi4Y5YvGiMta7Ye l+S5tuX8C34V/EhgMbpMeGKrRbKulJYFfqILkmQa+VC2U9CNamA3xX0kxiRgNu0vvk58 v9axf020avWtaMWDPL1TikTLDGv7zMuz5mBdspoQvDrltDNDvL7b68qQDHkWkSo2FW5S VGOA== X-Gm-Message-State: APf1xPCdjonqACEQ3TOhst0y+axkDd1Q9DlpnRP5Cds1MCsaoENcYaHF b6PIM+y+tfdC7qyryFulGKMIpH09rG92XKO84wIvcg== X-Google-Smtp-Source: AH8x227G7fWH1TfLLzsG2wi717FgmS/xScFg7vuCYJlTNyXTkRx7xU6ncf2wz1m//NUfwZHhHApr5DAYBncZotiTFas= X-Received: by 10.107.172.130 with SMTP id v124mr7300305ioe.301.1518404283321; Sun, 11 Feb 2018 18:58:03 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Sun, 11 Feb 2018 18:58:02 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:b0a7:f4b6:69f8:4eba] Received: by 10.79.201.67 with HTTP; Sun, 11 Feb 2018 18:58:02 -0800 (PST) In-Reply-To: References: <1518374549.32585.238.camel@freebsd.org> <201802112346.w1BNkPXc041510@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Sun, 11 Feb 2018 19:58:02 -0700 X-Google-Sender-Auth: dwoExcNZkqq8GgYspU07rZUEAxs Message-ID: Subject: Re: svn commit: r329126 - head/etc/devd To: "Conrad E. Meyer" Cc: "Rodney W. Grimes" , 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.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 02:58:04 -0000 On Feb 11, 2018 7:05 PM, "Conrad Meyer" wrote: On Sun, Feb 11, 2018 at 3:46 PM, Rodney W. Grimes wrote: > Moving this to /usr creates a cyclic issue in that you then need > /usr to be mounted before devd can start and devd's /etc/rc.d file > says: > # PROVIDE: devd > # REQUIRE: NETWORKING > # BEFORE: mountcritremote > # KEYWORD: nojail > > In the diskless and nfs shared /usr worlds devd wants to start > before /usr is mounted. If devd is needed to mount /usr (???), it seems like just another demonstration of why separate /usr is a poor idea. No, it's another reason why generated devd files are wrong in the face of devmatch. Warner From owner-svn-src-head@freebsd.org Mon Feb 12 03:54: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 EC1FDF12E7A; Mon, 12 Feb 2018 03:54:18 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f182.google.com (mail-io0-f182.google.com [209.85.223.182]) (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 844717B9FE; Mon, 12 Feb 2018 03:54:18 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f182.google.com with SMTP id e7so1633074ioj.1; Sun, 11 Feb 2018 19:54:18 -0800 (PST) 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=VEQQfofDdLot5A6N6ginA5eA3vFPgV0KyLjoxSuBn6s=; b=ZyLULkDe1gmeqmxZo/F8eZhnicJefIhIvZalmmQfmGpvw0l5mxNdtmWV2joEIirsx7 fXyWpouw2o4d+V0UXkxqUtYR2ZChKm6bqwLE5fIk3+utHA2yb0/Q/ZFt/r7nwZHa7SVC 8S2ObYimeqIzFXSY/QGcJ8+AlLqTOY4u5i9jaziF7X+CZ2YqQ7bNnZyB2A6bMeqAUX24 +ZnQCeUEDAcCC3r9aBnUFlcFT44pPZAiDybiW9KlhRpAhftJXnf5j8CmcowlQyIvSevn rINhDWMpiF4XeNXXQlnZ1jNwUH1snce1ER7xgchXCrKbyg7vJsztdSLUTrU5MtgQdquc HMrw== X-Gm-Message-State: APf1xPDAQKIDwqsSiH9b7uj7+/EdJbugaCcFXbkvR7OPyyGjKap+MMiE 7+YEnXy8ditvyG3VbqspUziZMBfG X-Google-Smtp-Source: AH8x226EMKz2hw3+SiAPiVJ2P79MBay1ZCruAhVM76jvodeGNrqCoamLlHWQIwrQXz/LVTJ3C1JpFA== X-Received: by 10.107.13.143 with SMTP id 137mr11474006ion.265.1518407652255; Sun, 11 Feb 2018 19:54:12 -0800 (PST) Received: from mail-it0-f43.google.com (mail-it0-f43.google.com. [209.85.214.43]) by smtp.gmail.com with ESMTPSA id b41sm9313059iod.30.2018.02.11.19.54.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Feb 2018 19:54:11 -0800 (PST) Received: by mail-it0-f43.google.com with SMTP id i144so5123648ita.3; Sun, 11 Feb 2018 19:54:11 -0800 (PST) X-Received: by 10.36.21.131 with SMTP id 125mr438813itq.71.1518407651237; Sun, 11 Feb 2018 19:54:11 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.30.149 with HTTP; Sun, 11 Feb 2018 19:54:10 -0800 (PST) In-Reply-To: References: <1518374549.32585.238.camel@freebsd.org> <201802112346.w1BNkPXc041510@pdx.rh.CN85.dnsmgr.net> From: Conrad Meyer Date: Sun, 11 Feb 2018 19:54:10 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r329126 - head/etc/devd To: Warner Losh 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.25 Precedence: list List-Id: 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, 12 Feb 2018 03:54:19 -0000 On Sun, Feb 11, 2018 at 6:58 PM, Warner Losh wrote: > No, it's another reason why generated devd files are wrong in the face of > devmatch. Devmatch is both vaporware and orthogonal to the placement of pre-devmatch static system databases. I'm on board with the glorious devmatch-autoloads-usb-devices future. But someone has to actually write the logic that incorporates it with devd and remove these databases before it matters. From owner-svn-src-head@freebsd.org Mon Feb 12 04:27: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 73727F151BD for ; Mon, 12 Feb 2018 04:27:26 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x235.google.com (mail-it0-x235.google.com [IPv6:2607:f8b0:4001:c0b::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 096C77CAB3 for ; Mon, 12 Feb 2018 04:27:26 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x235.google.com with SMTP id 193so2315981iti.1 for ; Sun, 11 Feb 2018 20:27:26 -0800 (PST) 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=QxzWy9hJOztUpT92sTWVLDr43ADS9gPRyS847OeWSZY=; b=QBHeKgnPEsRdH6EibIVmlmGD3vE5iKq+eGroUQ1osDfjUleNzoK3ptnHxJCLNDcZbg NxIHj5P1navxt6L6U0Tc91xHM7MjhntnhY+MnFLMKyj6b2RrfSvxMwqMyGQNr89Sk983 yoFaUDmHdWSx86SoFG/lKs/JpCsTDNikQitXUinQxpTEGaKseKbZYRBZ2kBpbDyoe6I0 AjJmN+6bSyj2hef91h4mWvbeB7KHu1xX9cqjxK8nh8ZZr0m6IKfAmdcaY2PZiObzx2O7 /Hm1cQUXXmVUWKJLbTBGdILF4dgNtgpdyY5Kb5U9EBfy4npeihUmuWamCdsQ5q93KDyK iHBA== 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=QxzWy9hJOztUpT92sTWVLDr43ADS9gPRyS847OeWSZY=; b=rgGln8U1Wlw+H0RTOyJWydelYJ1fmpIeofztAiE1hGdVm1xEJn7ugkyJ58044RS3Dz 5FtHJHJfKBdNJjzhb6eQKsVHGVxeU2y0g7oQhZwVupFKWjCDEX4ztpFEKp0uIlaK76zw 6m2cmrbpp7J7TXFvBZCRn/WBXAUR0aQhAIhwVHnpCbi427aPIPurm43/laoQoZt5Nv0q z5dpOTqHIUNcZ9oVvRHJyqyZB65/LlEcyi2GRi3f5i0hErMyrv2DbYE/kb2po6zpc26g k/rXSL9jBlRWtmFlBG0Npmv6hD6iv22rYkgB+8XzoTPbs3QGoNlSW6hwcpaCLkNO6Gzu TA/g== X-Gm-Message-State: APf1xPAocRc+eQwS1WVtixOk1Z6w/wL+BdCgfnFp8Y1JdDAx/19Xys0g QHqk/P7K0+tl16hHZVT+kvcYtMAsC1YmY8znBOKfaA== X-Google-Smtp-Source: AH8x2256fsiM4j7ZGijFINGAph8Cc/tbC8xn2o5cDwFVIh9vYe08rHi3ck4rZde+jV+58oYjJsKGbiiTNfJNUniUAmU= X-Received: by 10.36.145.139 with SMTP id i133mr4162104ite.69.1518409645314; Sun, 11 Feb 2018 20:27:25 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Sun, 11 Feb 2018 20:27:24 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: References: <1518374549.32585.238.camel@freebsd.org> <201802112346.w1BNkPXc041510@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Sun, 11 Feb 2018 21:27:24 -0700 X-Google-Sender-Auth: 7Gjqn514VHZs4BJcCco-gLemE6E Message-ID: Subject: Re: svn commit: r329126 - head/etc/devd To: "Conrad E. Meyer" 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.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 04:27:26 -0000 On Sun, Feb 11, 2018 at 8:54 PM, Conrad Meyer wrote: > On Sun, Feb 11, 2018 at 6:58 PM, Warner Losh wrote: > > No, it's another reason why generated devd files are wrong in the face of > > devmatch. > > Devmatch is both vaporware and orthogonal to the placement of > pre-devmatch static system databases. > kldload $(devmatch | uniq) would do the trick. I take exception to the vaporware comment. At worst it's incompletely integrated. The point is that these generated things are at worst a transient thing that aren't worth moving or even arguing about where they should have gone were they not set for deletion soon. Warner From owner-svn-src-head@freebsd.org Mon Feb 12 04: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 57A61F16458; Mon, 12 Feb 2018 04:45:18 +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 0DE407D49B; Mon, 12 Feb 2018 04:45: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 E2EF653C9; Mon, 12 Feb 2018 04:45:17 +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 w1C4jHS6081830; Mon, 12 Feb 2018 04:45:17 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1C4jH1c081827; Mon, 12 Feb 2018 04:45:17 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802120445.w1C4jH1c081827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Feb 2018 04:45:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329147 - in head/etc: defaults rc.d X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/etc: defaults rc.d X-SVN-Commit-Revision: 329147 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 04:45:18 -0000 Author: imp Date: Mon Feb 12 04:45:17 2018 New Revision: 329147 URL: https://svnweb.freebsd.org/changeset/base/329147 Log: Add devmatch rc.d integration Create simple script to load modules on demand based on the device identifying information. Sponsored by: Netflix Added: head/etc/rc.d/devmatch (contents, props changed) Modified: head/etc/defaults/rc.conf Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Mon Feb 12 01:17:06 2018 (r329146) +++ head/etc/defaults/rc.conf Mon Feb 12 04:45:17 2018 (r329147) @@ -41,6 +41,7 @@ ddb_enable="NO" # Set to YES to load ddb scripts at b ddb_config="/etc/ddb.conf" # ddb(8) config file. devd_enable="YES" # Run devd, to trigger programs on device tree changes. devd_flags="" # Additional flags for devd(8). +devmatch_enable="NO" # Demand load kernel modules based on device ids. #kld_list="" # Kernel modules to load after local disks are mounted kldxref_enable="NO" # Build linker.hints files with kldxref(8). kldxref_clobber="NO" # Overwrite old linker.hints at boot. Added: head/etc/rc.d/devmatch ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/rc.d/devmatch Mon Feb 12 04:45:17 2018 (r329147) @@ -0,0 +1,54 @@ +#!/bin/sh + +# Copyright (c) 2018 Warner Losh +# 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. +# +# $FreeBSD$ +# +# PROVIDE: devmatch +# REQUIRE: kldxref +# KEYWORD: nojail + +. /etc/rc.subr + +name="devmatch" +desc="Use devmatch(8) to load kernel modules + +start_cmd="${name}_start" +stop_cmd=':' + +devmatch_start() +{ + local x + + x=$(devmatch | sort -u) + + [ -n "$x" ] || return + + echo "Autoloading modules" + kldload ${x} +} + +load_rc_config $name +run_rc_command "$1" From owner-svn-src-head@freebsd.org Mon Feb 12 04:45: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 6E1B2F1648D; Mon, 12 Feb 2018 04:45: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 1F6647D586; Mon, 12 Feb 2018 04:45: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 1A6F653CA; Mon, 12 Feb 2018 04:45: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 w1C4jQR1081886; Mon, 12 Feb 2018 04:45:26 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1C4jQBL081885; Mon, 12 Feb 2018 04:45:26 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802120445.w1C4jQBL081885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Feb 2018 04:45:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329148 - head/etc/devd X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/etc/devd X-SVN-Commit-Revision: 329148 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 04:45:27 -0000 Author: imp Date: Mon Feb 12 04:45:26 2018 New Revision: 329148 URL: https://svnweb.freebsd.org/changeset/base/329148 Log: Switch to using devmatch to autoload drivers. Remove usb.conf as obsolete because devmatch gets its information from the same place as the genration scripts. Added: head/etc/devd/devmatch.conf (contents, props changed) Deleted: head/etc/devd/usb.conf Added: head/etc/devd/devmatch.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/devd/devmatch.conf Mon Feb 12 04:45:26 2018 (r329148) @@ -0,0 +1,13 @@ +# +# $FreeBSD$ +# + +# +# Example devd configuration file for automatically +# loading what modules we can based on nomatch +# events. +# +# Generic NOMATCH event +nomatch 100 { + action "service devmatch onestart" +}; From owner-svn-src-head@freebsd.org Mon Feb 12 04: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 F40C5F164EF for ; Mon, 12 Feb 2018 04:45:40 +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 8495B7D6A6 for ; Mon, 12 Feb 2018 04:45:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x236.google.com with SMTP id b66so5214897itd.5 for ; Sun, 11 Feb 2018 20:45:40 -0800 (PST) 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=f/BJ1Pyb3RHFyNXbvF4QncMsmo/e1RfMmT0jGfcZkt8=; b=a/jm+Qhn1J/LEV1Pm9mlQPkH448IlHeX7kkNdtGI8e0TlYsVLeyd8gCctC+JZ/UVo0 yDeiZ+/9jTmcxmz6luN+ADIThnFnrBb4vUpuO2FlHQkgJMsIEf/c1hDoqWgf50Je2tz7 DrGjsUUAES841Xe7ZvRNB6LMkQzeOJ6WiL/m3YWvqCbyJKW6LOnKvi/J7hMgvSB8ax0U GC4hHbYfQKJMMrgMYRK6wv7ZWzB5TL4ZkQQ1a0YNQNOAqDwuVkyxdFCNO+JXsu/6tNnB +3HH9Fx7C3voWZkvWnLvy1ZsnzOeJWtL41ViFIkfg0DICq+zHTiBek/EMr+WgpefTix3 rMEQ== 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=f/BJ1Pyb3RHFyNXbvF4QncMsmo/e1RfMmT0jGfcZkt8=; b=Jbzy5EYnL8oQdNo0blPjkFh4Mt4BtpsLhsemxFKO1JMd4LyKWWABUn3xD2mIi/ZAMz Frz77joiMNeNryHdRS7ddyL50H4iHJcVlQagpizAqrla2aRsdfW0auLAMA1ujLITrcWX Ia6WLfg2SSX1VRExBPON6wDk6grhVUq9C2xu06wtUvDXItZMbXGPz9St/HOTQdtzwSR5 WobJWFKtr/0Ub0rSEFQDcKEu/xPdMuZU0uk5i8A87w9GgyuR73uM+Xc/NcRd1fH19+kN QfISj5iLfDNxmMm2QXaFN/bVQJjsrT/wLl32GuupL2SJrNgSoggwE2x5EtJ2EHdvZQ67 cU4w== X-Gm-Message-State: APf1xPCnP7piOCfKfi4aydLwDIpiAnZqkRS3i6vuK6recvGYVDfOO0O6 Fv0arMOoQ0IvbhyYWBKd6bWdjqEN+Ve/RRV8nl563Q== X-Google-Smtp-Source: AH8x227W4Drqfwj6yv+OGVQfFtHabWWjhK+P3MybINhlz5sHxVtk9Jnfc3CGIX33y5Y3Rgjsx3AQjj4y2sxggDq5w0w= X-Received: by 10.36.145.139 with SMTP id i133mr4199353ite.69.1518410739752; Sun, 11 Feb 2018 20:45:39 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Sun, 11 Feb 2018 20:45:38 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: References: <1518374549.32585.238.camel@freebsd.org> <201802112346.w1BNkPXc041510@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Sun, 11 Feb 2018 21:45:38 -0700 X-Google-Sender-Auth: 5IVKZZVDqZRBKdk6YH9EPzXqPGU Message-ID: Subject: Re: svn commit: r329126 - head/etc/devd To: "Conrad E. Meyer" 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.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 04:45:41 -0000 Sigh. r329147, r329148. Trivial. Warner On Sun, Feb 11, 2018 at 9:41 PM, Conrad Meyer wrote: > As usual, I'll believe it when I see it. If it's so easy, seems like > you could just commit it today. And if it's not so easy, maybe the > integration isn't so trivial. > > On Sun, Feb 11, 2018 at 8:27 PM, Warner Losh wrote: > > > > > > On Sun, Feb 11, 2018 at 8:54 PM, Conrad Meyer wrote: > >> > >> On Sun, Feb 11, 2018 at 6:58 PM, Warner Losh wrote: > >> > No, it's another reason why generated devd files are wrong in the face > >> > of > >> > devmatch. > >> > >> Devmatch is both vaporware and orthogonal to the placement of > >> pre-devmatch static system databases. > > > > > > kldload $(devmatch | uniq) would do the trick. > > > > I take exception to the vaporware comment. At worst it's incompletely > > integrated. The point is that these generated things are at worst a > > transient thing that aren't worth moving or even arguing about where they > > should have gone were they not set for deletion soon. > > > > Warner > From owner-svn-src-head@freebsd.org Mon Feb 12 04:52: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 B9136F16E75; Mon, 12 Feb 2018 04:52:25 +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 6C7BF7DD6C; Mon, 12 Feb 2018 04:52:25 +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 67551555D; Mon, 12 Feb 2018 04:52:25 +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 w1C4qPAe086602; Mon, 12 Feb 2018 04:52:25 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1C4qPQh086600; Mon, 12 Feb 2018 04:52:25 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802120452.w1C4qPQh086600@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Feb 2018 04:52:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329149 - head/etc/rc.d X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/etc/rc.d X-SVN-Commit-Revision: 329149 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 04:52:25 -0000 Author: imp Date: Mon Feb 12 04:52:25 2018 New Revision: 329149 URL: https://svnweb.freebsd.org/changeset/base/329149 Log: Install devmatch int /etc/rc.d and echo modules being installed. Modified: head/etc/rc.d/Makefile head/etc/rc.d/devmatch Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Mon Feb 12 04:45:26 2018 (r329148) +++ head/etc/rc.d/Makefile Mon Feb 12 04:52:25 2018 (r329149) @@ -29,6 +29,7 @@ FILES= DAEMON \ defaultroute \ devd \ devfs \ + devmatch \ dhclient \ dmesg \ dumpon \ Modified: head/etc/rc.d/devmatch ============================================================================== --- head/etc/rc.d/devmatch Mon Feb 12 04:45:26 2018 (r329148) +++ head/etc/rc.d/devmatch Mon Feb 12 04:52:25 2018 (r329149) @@ -33,7 +33,7 @@ . /etc/rc.subr name="devmatch" -desc="Use devmatch(8) to load kernel modules +desc="Use devmatch(8) to load kernel modules" start_cmd="${name}_start" stop_cmd=':' @@ -46,7 +46,7 @@ devmatch_start() [ -n "$x" ] || return - echo "Autoloading modules" + echo "Autoloading modules: ${x}" kldload ${x} } From owner-svn-src-head@freebsd.org Mon Feb 12 04:54: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 BE793F17279; Mon, 12 Feb 2018 04:54: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 71CD57E175; Mon, 12 Feb 2018 04:54:51 +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 6C9275568; Mon, 12 Feb 2018 04:54:51 +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 w1C4sptW086857; Mon, 12 Feb 2018 04:54:51 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1C4sp4o086856; Mon, 12 Feb 2018 04:54:51 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802120454.w1C4sp4o086856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Feb 2018 04:54:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329150 - head/etc/devd X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/etc/devd X-SVN-Commit-Revision: 329150 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 04:54:51 -0000 Author: imp Date: Mon Feb 12 04:54:51 2018 New Revision: 329150 URL: https://svnweb.freebsd.org/changeset/base/329150 Log: Install devmatch.conf, don't install usb.conf Modified: head/etc/devd/Makefile Modified: head/etc/devd/Makefile ============================================================================== --- head/etc/devd/Makefile Mon Feb 12 04:52:25 2018 (r329149) +++ head/etc/devd/Makefile Mon Feb 12 04:54:51 2018 (r329150) @@ -12,13 +12,14 @@ FILES+= apple.conf .if ${MK_ACPI} != "no" FILES+= asus.conf .endif +FILES+=devmatch.conf .if ${MK_HYPERV} != "no" FILES+= hyperv.conf .endif .endif .if ${MK_USB} != "no" -FILES+= uath.conf ulpt.conf usb.conf +FILES+= uath.conf ulpt.conf .endif .if ${MK_ZFS} != "no" From owner-svn-src-head@freebsd.org Mon Feb 12 05:01: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 08CBFF17A86; Mon, 12 Feb 2018 05:01:25 +0000 (UTC) (envelope-from cse.cem@gmail.com) 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)) by mx1.freebsd.org (Postfix) with ESMTPS id 9C6B87E66E; Mon, 12 Feb 2018 05:01:24 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f48.google.com with SMTP id e1so5121607ita.0; Sun, 11 Feb 2018 21:01:24 -0800 (PST) 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=RExAIDMbONLN8FmSEYCCg2u39hxGmd1WUZmtlE0Ql5M=; b=D6RQlvHnJi7TyKi2GcaKfEcAPHEPhDgnolSkY/NxW8AlBCMUIeSNbf1ha78k5xirEe wutXtydIUOtr5mr3qM+EHaLap6lJeW9KJ/BbPwq92cZULoQGL3Kom6u3fFXRpfK377a4 DDPvTIZHnsEbjODrJd9tB3sL+arHTRAA6iSGXt5FJj2+9abhVIUyi59VceDHMlQ4krWZ 4BOIrBkwGZQdxIZkf7x7xUA25ryfB9S8EHA6/vyCXDH/QPA3OGW1GiQUmvksTL8wPmxV 71uDJ1RXNRmippBXUnUs9XRnBrZfMVdhgtCqac+BbGRdtb9TVEhxXAW5FmyPxW+UmgNB 3sig== X-Gm-Message-State: APf1xPDbYGI4Go6Z5IAI7f0BrXj95t1kD5ke2UDUDz/XuD3MtWpKRWMb Q65G6h3vNkkRcKfjliWyXop6gsDD X-Google-Smtp-Source: AH8x227J0D7iaxqKHCkXpNMeSXejGimbOI9g7PwCx7F/rIkM+S1NhiTu4AqhgjSBvEeg7gFY687m7Q== X-Received: by 10.36.89.73 with SMTP id p70mr4334676itb.117.1518411678483; Sun, 11 Feb 2018 21:01:18 -0800 (PST) Received: from mail-it0-f44.google.com (mail-it0-f44.google.com. [209.85.214.44]) by smtp.gmail.com with ESMTPSA id f16sm8711621iob.75.2018.02.11.21.01.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Feb 2018 21:01:18 -0800 (PST) Received: by mail-it0-f44.google.com with SMTP id b66so5246423itd.5; Sun, 11 Feb 2018 21:01:18 -0800 (PST) X-Received: by 10.36.204.139 with SMTP id x133mr4082091itf.75.1518411678091; Sun, 11 Feb 2018 21:01:18 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.30.149 with HTTP; Sun, 11 Feb 2018 21:01:17 -0800 (PST) In-Reply-To: References: <1518374549.32585.238.camel@freebsd.org> <201802112346.w1BNkPXc041510@pdx.rh.CN85.dnsmgr.net> From: Conrad Meyer Date: Sun, 11 Feb 2018 21:01:17 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r329126 - head/etc/devd To: Warner Losh 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.25 Precedence: list List-Id: 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, 12 Feb 2018 05:01:25 -0000 I am happy with this outcome, thanks. On Sun, Feb 11, 2018 at 8:45 PM, Warner Losh wrote: > Sigh. r329147, r329148. > > Trivial. > > Warner > > > On Sun, Feb 11, 2018 at 9:41 PM, Conrad Meyer wrote: >> >> As usual, I'll believe it when I see it. If it's so easy, seems like >> you could just commit it today. And if it's not so easy, maybe the >> integration isn't so trivial. >> >> On Sun, Feb 11, 2018 at 8:27 PM, Warner Losh wrote: >> > >> > >> > On Sun, Feb 11, 2018 at 8:54 PM, Conrad Meyer wrote: >> >> >> >> On Sun, Feb 11, 2018 at 6:58 PM, Warner Losh wrote: >> >> > No, it's another reason why generated devd files are wrong in the >> >> > face >> >> > of >> >> > devmatch. >> >> >> >> Devmatch is both vaporware and orthogonal to the placement of >> >> pre-devmatch static system databases. >> > >> > >> > kldload $(devmatch | uniq) would do the trick. >> > >> > I take exception to the vaporware comment. At worst it's incompletely >> > integrated. The point is that these generated things are at worst a >> > transient thing that aren't worth moving or even arguing about where >> > they >> > should have gone were they not set for deletion soon. >> > >> > Warner > > From owner-svn-src-head@freebsd.org Mon Feb 12 05:01: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 A7C1CF17C2B for ; Mon, 12 Feb 2018 05:01:43 +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 36DAF7E7D5 for ; Mon, 12 Feb 2018 05:01:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22f.google.com with SMTP id d13so15996067iog.5 for ; Sun, 11 Feb 2018 21:01:43 -0800 (PST) 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=lHXC62wI/ejUbwip37G78dkcIuGyDzOV47nJB3oh0y4=; b=afUh1ZCGiaOWIdLZP1hgXembM0uYT2JviV6rrxcQe97C69sYzVNnTL+EZXI0Jlcnq6 Wu+1vrgQ/IKW7ZAnFgnPyAwZAWx7zBg2oEBd51zoJiOLm+rwa5mlITryVKoYRv0wnOLz cIHBTImFBvTGjzRCxhdgDtkFHH855CVNJYSOEwuOa/QRijj08a0zNvSe2vq98HjV8ogj /Q419xhTVEGqVFAG+/46Jy9VdSKXYNnqTVwe7kuXd3hObJDeC6wXSnkyvYNPhSkj6+8T sGVKBJsjS4M2hESUg/cItj/bmwVu7ae8U7mQgSCjpvYaIcyvvVMzFmh3r0tBdoHF0QZA oFDw== 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=lHXC62wI/ejUbwip37G78dkcIuGyDzOV47nJB3oh0y4=; b=nY8ulYAEvPqqWlrAOvk1ObKxLBHcFXR2Qj3LCy8x7TnfG/t208UB6rbi9QKxZmN302 QFNW8PfbJ/Gh0UT6J18j8yJJ+8DPeVM3A5z7HWEdD6m7e+WgWv5Wz3JztSDbbx2G4DN8 bIExHsycDkVMo7sYeW6MECrdiziAfB2efEWgv6zaIm2XYiQSrM4XudmULGEjSB2qyO1S sqaOxs+Xka3NGRX6qR34Q6YPSquhFQsxTh33jwGLOExysxnTTLslk2KgUMAG/rPjVFF2 bu6obCFjIlbpBbgyN3xfEECLumYlQvC+8xyfoJNav1Vxg7wAQjHrZL/f+UrD0kPsi1Jl pDnw== X-Gm-Message-State: APf1xPCdNTWYamoyFcy8kEVZwPJdOAeP63o1T++miSZdF+9MigmJkdWE xTmVim/QZV6/y4373bKz0Oms90JLT3XzJ2jEF8yKKQ== X-Google-Smtp-Source: AH8x224TSxgFIpzBmbXC+zXC+2JlniZRd7J9PCqX7DxH71/XXtLU+wceQWjINmSoaa2eNVcO67xxT4XjRq9P1G4Lp4c= X-Received: by 10.107.30.146 with SMTP id e140mr11663461ioe.291.1518411702521; Sun, 11 Feb 2018 21:01:42 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Sun, 11 Feb 2018 21:01:41 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: References: <1518374549.32585.238.camel@freebsd.org> <201802112346.w1BNkPXc041510@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Sun, 11 Feb 2018 22:01:41 -0700 X-Google-Sender-Auth: LyFCZzAc81BNAOkEDJ0_sjlURsA Message-ID: Subject: Re: svn commit: r329126 - head/etc/devd To: "Conrad E. Meyer" 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.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 05:01:44 -0000 OK. I guess I shouldn't push when angry to try to prove a point. That never works out well... So, I needed r329149 and 329150 as well to tweak a couple of things. Warner On Sun, Feb 11, 2018 at 9:45 PM, Warner Losh wrote: > Sigh. r329147, r329148. > > Trivial. > > Warner > > > On Sun, Feb 11, 2018 at 9:41 PM, Conrad Meyer wrote: > >> As usual, I'll believe it when I see it. If it's so easy, seems like >> you could just commit it today. And if it's not so easy, maybe the >> integration isn't so trivial. >> >> On Sun, Feb 11, 2018 at 8:27 PM, Warner Losh wrote: >> > >> > >> > On Sun, Feb 11, 2018 at 8:54 PM, Conrad Meyer wrote: >> >> >> >> On Sun, Feb 11, 2018 at 6:58 PM, Warner Losh wrote: >> >> > No, it's another reason why generated devd files are wrong in the >> face >> >> > of >> >> > devmatch. >> >> >> >> Devmatch is both vaporware and orthogonal to the placement of >> >> pre-devmatch static system databases. >> > >> > >> > kldload $(devmatch | uniq) would do the trick. >> > >> > I take exception to the vaporware comment. At worst it's incompletely >> > integrated. The point is that these generated things are at worst a >> > transient thing that aren't worth moving or even arguing about where >> they >> > should have gone were they not set for deletion soon. >> > >> > Warner >> > > From owner-svn-src-head@freebsd.org Mon Feb 12 05:04: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 E66EEF18090; Mon, 12 Feb 2018 05:04:32 +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 725AB7EB7C; Mon, 12 Feb 2018 05:04:32 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f50.google.com with SMTP id n206so5119381itg.1; Sun, 11 Feb 2018 21:04:32 -0800 (PST) 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=Pp6yUQBruIdI+IFEgbt+p2hRcNg355tuE2xjAhM8tT4=; b=iG53Dcg3VBNfu0+R14u96euT3ISHHrwxPiztV+JusUfRo5VbShMbuIPAMfow159Wdi 57ZqMkY55jdQ+GYKkG44iVYR2Gvvw0tIbZpV1HJpclwkzHfIOC5tnkwGdpCf5lSP5jJo RT4hmcvhbWJaHwrd9b+tWEIOL80PmccdhSw8bBWxrDAxwsngvha6Rq5KGj90aFeQhnpy An6c6TbV1pysBc625ypLqt8p3Zuh9C83eL78gG0IW6xJ0xf9GOKxWXgRxy3MBhPIe31J x9c5kJbsEp1ieZu2x/Da5gYNlyvxD4K7qNMEg5QNGQrohbx3shUsAfQcUv8JFZXdWH5e E9nQ== X-Gm-Message-State: APf1xPBmevV39x36IelkN5zvmCJnUd1iXDLchAafoyHpa1BYcTMQwgkR 5o+PRgXobuoJxiuKWHMmbngmw7rR X-Google-Smtp-Source: AH8x225LquiQOrC0PyPVtzKWqZHfuEzBoFH1Iukvwk4KDE4ibQmIwUo3f24OHejGjo38HqBKx9ew1A== X-Received: by 10.36.25.77 with SMTP id b74mr3544004itb.99.1518410510444; Sun, 11 Feb 2018 20:41:50 -0800 (PST) Received: from mail-io0-f172.google.com (mail-io0-f172.google.com. [209.85.223.172]) by smtp.gmail.com with ESMTPSA id w142sm5331965ita.25.2018.02.11.20.41.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Feb 2018 20:41:50 -0800 (PST) Received: by mail-io0-f172.google.com with SMTP id e7so1718442ioj.1; Sun, 11 Feb 2018 20:41:50 -0800 (PST) X-Received: by 10.107.2.6 with SMTP id 6mr3130807ioc.117.1518410509899; Sun, 11 Feb 2018 20:41:49 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.30.149 with HTTP; Sun, 11 Feb 2018 20:41:49 -0800 (PST) In-Reply-To: References: <1518374549.32585.238.camel@freebsd.org> <201802112346.w1BNkPXc041510@pdx.rh.CN85.dnsmgr.net> From: Conrad Meyer Date: Sun, 11 Feb 2018 20:41:49 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r329126 - head/etc/devd To: Warner Losh 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.25 Precedence: list List-Id: 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, 12 Feb 2018 05:04:33 -0000 As usual, I'll believe it when I see it. If it's so easy, seems like you could just commit it today. And if it's not so easy, maybe the integration isn't so trivial. On Sun, Feb 11, 2018 at 8:27 PM, Warner Losh wrote: > > > On Sun, Feb 11, 2018 at 8:54 PM, Conrad Meyer wrote: >> >> On Sun, Feb 11, 2018 at 6:58 PM, Warner Losh wrote: >> > No, it's another reason why generated devd files are wrong in the face >> > of >> > devmatch. >> >> Devmatch is both vaporware and orthogonal to the placement of >> pre-devmatch static system databases. > > > kldload $(devmatch | uniq) would do the trick. > > I take exception to the vaporware comment. At worst it's incompletely > integrated. The point is that these generated things are at worst a > transient thing that aren't worth moving or even arguing about where they > should have gone were they not set for deletion soon. > > Warner From owner-svn-src-head@freebsd.org Mon Feb 12 05:08: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 32311F185FC; Mon, 12 Feb 2018 05:08: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 A4A937EE88; Mon, 12 Feb 2018 05:08: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 w1C58NaK042384; Sun, 11 Feb 2018 21:08:23 -0800 (PST) (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 w1C58Nj1042383; Sun, 11 Feb 2018 21:08:23 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201802120508.w1C58Nj1042383@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r329148 - head/etc/devd In-Reply-To: <201802120445.w1C4jQBL081885@repo.freebsd.org> To: Warner Losh Date: Sun, 11 Feb 2018 21:08:23 -0800 (PST) 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.25 Precedence: list List-Id: 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, 12 Feb 2018 05:08:28 -0000 > Author: imp > Date: Mon Feb 12 04:45:26 2018 > New Revision: 329148 > URL: https://svnweb.freebsd.org/changeset/base/329148 > > Log: > Switch to using devmatch to autoload drivers. Remove usb.conf > as obsolete because devmatch gets its information from the same > place as the genration scripts. > > Added: > head/etc/devd/devmatch.conf (contents, props changed) > Deleted: > head/etc/devd/usb.conf I know you did this in a hurry and as you said while angry, perhaps take a day and step back? I think this was rather hap hazzard, and now devmatch is stucking files in devd that is to be obsoleted, is this really how we want this nice clean solution to start its new life? > Added: head/etc/devd/devmatch.conf Shouldnt this gone to head/etc/devmatch? > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/etc/devd/devmatch.conf Mon Feb 12 04:45:26 2018 (r329148) > @@ -0,0 +1,13 @@ > +# > +# $FreeBSD$ > +# > + > +# > +# Example devd configuration file for automatically > +# loading what modules we can based on nomatch > +# events. > +# > +# Generic NOMATCH event > +nomatch 100 { > + action "service devmatch onestart" > +}; > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Feb 12 05:10: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 C4D6FF18889; Mon, 12 Feb 2018 05:10:32 +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 434957F0A7; Mon, 12 Feb 2018 05:10: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 w1C5AUvg042401; Sun, 11 Feb 2018 21:10:30 -0800 (PST) (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 w1C5AUFY042400; Sun, 11 Feb 2018 21:10:30 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201802120510.w1C5AUFY042400@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r329150 - head/etc/devd In-Reply-To: <201802120454.w1C4sp4o086856@repo.freebsd.org> To: Warner Losh Date: Sun, 11 Feb 2018 21:10:30 -0800 (PST) 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.25 Precedence: list List-Id: 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, 12 Feb 2018 05:10:32 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: imp > Date: Mon Feb 12 04:54:51 2018 > New Revision: 329150 > URL: https://svnweb.freebsd.org/changeset/base/329150 > > Log: > Install devmatch.conf, don't install usb.conf Doesnt this break devd and anyone depending on it? Does usb.conf need to go in OBSOLETEFILES now? Relnotes y? > Modified: > head/etc/devd/Makefile > > Modified: head/etc/devd/Makefile > ============================================================================== > --- head/etc/devd/Makefile Mon Feb 12 04:52:25 2018 (r329149) > +++ head/etc/devd/Makefile Mon Feb 12 04:54:51 2018 (r329150) > @@ -12,13 +12,14 @@ FILES+= apple.conf > .if ${MK_ACPI} != "no" > FILES+= asus.conf > .endif > +FILES+=devmatch.conf ^ missing tab > .if ${MK_HYPERV} != "no" > FILES+= hyperv.conf > .endif > .endif > > .if ${MK_USB} != "no" > -FILES+= uath.conf ulpt.conf usb.conf > +FILES+= uath.conf ulpt.conf > .endif > > .if ${MK_ZFS} != "no" -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Feb 12 05:11: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 BD091F189C7 for ; Mon, 12 Feb 2018 05:11:33 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22a.google.com (mail-io0-x22a.google.com [IPv6:2607:f8b0:4001:c06::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 4EE0E7F2F4 for ; Mon, 12 Feb 2018 05:11:33 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22a.google.com with SMTP id 72so16004808iom.10 for ; Sun, 11 Feb 2018 21:11:33 -0800 (PST) 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=flxb0kInjQ4DN7Ve9Bfb61Hxcri1iKkZrDhyhpQlXvE=; b=VkJdCYbb0Zxoi8LVJ0tlvYdCMOvQre5WFG8AalGexoBoM2ExOi+duXZy1j6xigKvwh HFVMXt3k66v4ECtC17R5L4IKzok37YLaRI2e+v4NfRtaVb/JiNYJrqukDtM5r7/QAjgJ aAAKIb6nvZ0cBs43VQU1/5U/kHN1BO7+KgXjZVsR2rlaMWKlyYPkUh0AEIqaEQFpcxzt c5q6MvEcTo4ANvQRvHqYgGGS/4eLq3MPejgcGbSFar4E8CG7AIQeWAczYWwex0KPOkjq D9zBYsHF33Pt1jM2XCD0M30FUZX+aFONKQ0x7lyxzWtddjvdyY6TBWk/ddksLdjoK2r3 ozIA== 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=flxb0kInjQ4DN7Ve9Bfb61Hxcri1iKkZrDhyhpQlXvE=; b=qjMf9oxrS3pq8RGm310ePIQtZXanFp2c8+8+mLhMramERniYWF42HvjR3Ad9MgmE9+ 7dr77MDUmsJJkfrZ6cwJBylcLS2919nMMLA0rdJXePxwE7QgQxH6VAkpQ/3EErcppyic sNj5UTerdE1NQ/cBiWMMKhvuBcF/01z7jM1mqZqH4N/YCpP+FimSC8+QeyzPcx4qSOCP c/HpOguzJoddlhqnYsrWBA0xKr9Hjy5krfOBr0fPHqDzJCyZ6ogVjm6fa1fetLK1o2/6 tW3jhQZWFdJUMPhxvL0JjdU9Jdd+d91+xTqmQy0ucIAh6am4Fn3F6ozakdFO+3qAcD+b r5PQ== X-Gm-Message-State: APf1xPDJ2isnVr0dL8e5vl1L0qdlUd40SCn2KQdhiQ1uGVFrC01llO9G KdIt8xOn7LivUt1DgC9oy2jnHm0aHSHvC23E9cw9rw== X-Google-Smtp-Source: AH8x22769huMIzFA/i+jk0rnX2hFGHfal2j+O/DI5G4CDp9WzsohXiqy0rUgJ5hzsuVEPStW6uEaroChU5PlDRomewA= X-Received: by 10.107.172.130 with SMTP id v124mr7551949ioe.301.1518412292703; Sun, 11 Feb 2018 21:11:32 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Sun, 11 Feb 2018 21:11:31 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:b0a7:f4b6:69f8:4eba] Received: by 10.79.201.67 with HTTP; Sun, 11 Feb 2018 21:11:31 -0800 (PST) In-Reply-To: <201802120508.w1C58Nj1042383@pdx.rh.CN85.dnsmgr.net> References: <201802120445.w1C4jQBL081885@repo.freebsd.org> <201802120508.w1C58Nj1042383@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Sun, 11 Feb 2018 22:11:31 -0700 X-Google-Sender-Auth: K1A4zxyVU8iPNkV-viQ121YRAaQ Message-ID: Subject: Re: svn commit: r329148 - head/etc/devd 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.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 05:11:34 -0000 On Feb 11, 2018 10:08 PM, "Rodney W. Grimes" wrote: > Author: imp > Date: Mon Feb 12 04:45:26 2018 > New Revision: 329148 > URL: https://svnweb.freebsd.org/changeset/base/329148 > > Log: > Switch to using devmatch to autoload drivers. Remove usb.conf > as obsolete because devmatch gets its information from the same > place as the genration scripts. > > Added: > head/etc/devd/devmatch.conf (contents, props changed) > Deleted: > head/etc/devd/usb.conf I know you did this in a hurry and as you said while angry, perhaps take a day and step back? I think this was rather hap hazzard, and now devmatch is stucking files in devd that is to be obsoleted, is this really how we want this nice clean solution to start its new life? No time like the present. > Added: head/etc/devd/devmatch.conf Shouldnt this gone to head/etc/devmatch? No. Warner > ============================================================ ================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/etc/devd/devmatch.conf Mon Feb 12 04:45:26 2018 (r329148) > @@ -0,0 +1,13 @@ > +# > +# $FreeBSD$ > +# > + > +# > +# Example devd configuration file for automatically > +# loading what modules we can based on nomatch > +# events. > +# > +# Generic NOMATCH event > +nomatch 100 { > + action "service devmatch onestart" > +}; > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Feb 12 05: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 C1367F19E43 for ; Mon, 12 Feb 2018 05:28:21 +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 4AB357FF85 for ; Mon, 12 Feb 2018 05:28:21 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22c.google.com with SMTP id f89so16031776ioj.4 for ; Sun, 11 Feb 2018 21:28:21 -0800 (PST) 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=dDyDaknlbJURQwCkaL+TzqaGbR0PKKfz8nc2qfJzdiM=; b=kxC0Gk0mRk4fYpMCUzIbNMMfzpxEAetdaX1OCQ+/PSIC6v0rCgLRRvTc+I41SmBNQH nrOT6VmQ5UeLB8d/XYiTbzSWSlpWxKZHSA0XwiWJhmvfh+TOMEWWUP/sNMabLeZ5OD17 +QhAM+lZqd9/ElNabLSrEL3eG46qKPKbMFTjYT0/q7+u0zqeZ9jLdVpyELDo7lrUjEhI eAN9da4J06ws4KhsJ+0EFD3YdnZUkP7UF/CnHpHunn5M/n5nafRSiU1tb3/EzdUltMa8 O+U8ZaahAzFwzU5U/DfAUpahmPKLU0aWxElCn82Wa7uFU2UNbRs8mFFe0oIeiyfChGVm ZOJw== 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=dDyDaknlbJURQwCkaL+TzqaGbR0PKKfz8nc2qfJzdiM=; b=FoDqaO9UAFNmvTkxKaEVf1JVNoGZPrnAbUmmFyIAml52pYtINe/EcGNFnPpsA4Z/Dj L4QjGmWzaxfPq0AzTurKqEmLiIji8q3Lih5tAboGvBFV0ta1HmFiliwmaMOZVyC+6LA8 QO0ddxKtr+aLgzUBQd0+T+egQdRRC2fVSBQjDUO9A+280nMXOXP0kauoBKMdxpAv5a2v s6UdiLrKO1yko6zkfmDJhYN3PeKmq1oAS7/otK8rbhHojIYDrEE4VVlMRMMFyPVm9bea WOpbS5xl0mckJKE21tAX9NVC3DaNFTebLPuYIILz3OGnG6IBPHOVRMrjyZjTmbRFUlTn eVCQ== X-Gm-Message-State: APf1xPDT/RY/aNbEr1pRwTPwBr3BS/P7Jeb+7jiMciRjvPaEmSasx5aE K32RU8E1BdfMZgQWAvE+DWKad1VS/+W7LWPOe5JTZg== X-Google-Smtp-Source: AH8x225YmStoircAjnOMmwrPbBCUetzXmDX1hw56gqrSe4cMMr+AqKYeXx4BsEuGEMO2lypQNTvwstOLv5Jv4Jx8Pw0= X-Received: by 10.107.30.146 with SMTP id e140mr11727392ioe.291.1518413300656; Sun, 11 Feb 2018 21:28:20 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Sun, 11 Feb 2018 21:28:19 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:18a2:a4f7:170:8dd9] In-Reply-To: <201802120510.w1C5AUFY042400@pdx.rh.CN85.dnsmgr.net> References: <201802120454.w1C4sp4o086856@repo.freebsd.org> <201802120510.w1C5AUFY042400@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Sun, 11 Feb 2018 22:28:19 -0700 X-Google-Sender-Auth: QRw0-BiqPeQqMC7CET6iI-uXdLg Message-ID: Subject: Re: svn commit: r329150 - head/etc/devd 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.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 05:28:22 -0000 On Sun, Feb 11, 2018 at 10:10 PM, Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > [ Charset UTF-8 unsupported, converting... ] > > Author: imp > > Date: Mon Feb 12 04:54:51 2018 > > New Revision: 329150 > > URL: https://svnweb.freebsd.org/changeset/base/329150 > > > > Log: > > Install devmatch.conf, don't install usb.conf > > Doesnt this break devd and anyone depending on it? > I'm having problems understanding how it would break it? > Does usb.conf need to go in OBSOLETEFILES now? > Yes. It should... > Relnotes y? Yes. It's hard to know where in the sequence of on-boarding a new function where to put it. Warner > > > Modified: > > head/etc/devd/Makefile > > > > Modified: head/etc/devd/Makefile > > ============================================================ > ================== > > --- head/etc/devd/Makefile Mon Feb 12 04:52:25 2018 (r329149) > > +++ head/etc/devd/Makefile Mon Feb 12 04:54:51 2018 (r329150) > > @@ -12,13 +12,14 @@ FILES+= apple.conf > > .if ${MK_ACPI} != "no" > > FILES+= asus.conf > > .endif > > +FILES+=devmatch.conf > ^ missing tab > > > .if ${MK_HYPERV} != "no" > > FILES+= hyperv.conf > > .endif > > .endif > > > > .if ${MK_USB} != "no" > > -FILES+= uath.conf ulpt.conf usb.conf > > +FILES+= uath.conf ulpt.conf > > .endif > > > > .if ${MK_ZFS} != "no" > > -- > Rod Grimes > rgrimes@freebsd.org > From owner-svn-src-head@freebsd.org Mon Feb 12 06:05: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 1B5C9F1BEF1; Mon, 12 Feb 2018 06:05:46 +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 B12D4815C1; Mon, 12 Feb 2018 06:05:45 +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 DD31514386; Mon, 12 Feb 2018 06:05:38 +0000 (UTC) Subject: Re: svn commit: r329126 - head/etc/devd To: rgrimes@freebsd.org, Ian Lepore Cc: cem@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201802112346.w1BNkPXc041510@pdx.rh.CN85.dnsmgr.net> From: Allan Jude Message-ID: <2ca53192-e55f-cbb3-6490-f111d23be408@freebsd.org> Date: Mon, 12 Feb 2018 01:05:36 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <201802112346.w1BNkPXc041510@pdx.rh.CN85.dnsmgr.net> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zB3zvhv0oS4KbfRx4mJPpdMTJ8iKUjMcn" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 06:05:46 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --zB3zvhv0oS4KbfRx4mJPpdMTJ8iKUjMcn Content-Type: multipart/mixed; boundary="M6cxDh6BA09cfIrlwR2FZ1iykKcXfMtzk"; protected-headers="v1" From: Allan Jude To: rgrimes@freebsd.org, Ian Lepore Cc: cem@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <2ca53192-e55f-cbb3-6490-f111d23be408@freebsd.org> Subject: Re: svn commit: r329126 - head/etc/devd References: <201802112346.w1BNkPXc041510@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201802112346.w1BNkPXc041510@pdx.rh.CN85.dnsmgr.net> --M6cxDh6BA09cfIrlwR2FZ1iykKcXfMtzk Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 2018-02-11 18:46, Rodney W. Grimes wrote: > [ Charset ISO-8859-1 unsupported, converting... ] >> On Sun, 2018-02-11 at 10:20 -0800, Conrad Meyer wrote: >>> On Sun, Feb 11, 2018 at 8:35 AM, Ian Lepore wrote: >>>> >>>> Author: ian >>>> Date: Sun Feb 11 16:35:56 2018 >>>> New Revision: 329126 >>>> URL: https://svnweb.freebsd.org/changeset/base/329126 >>>> >>>> Log: >>>> ? Regenerate devd/usb.conf after the recent addition of several new >>>> device IDs. >>>> >>>> Modified: >>>> ? head/etc/devd/usb.conf >>> >>> If this file is machine generated and not an administrator >>> configuration file, shouldn't it live in /usr/share instead of /etc, >>> per hier(7)? >>> >>> Best, >>> Conrad >>> >> >> I wonder if that question would apply to all five files we put in >> /etc/devd? ?It looks like they could be moved to /usr/share with >> minimal fuss by adding that directory to the search list in >> /etc/devd.conf. >=20 > Moving this to /usr creates a cyclic issue in that you then need > /usr to be mounted before devd can start and devd's /etc/rc.d file > says: > # PROVIDE: devd > # REQUIRE: NETWORKING > # BEFORE: mountcritremote > # KEYWORD: nojail >=20 > In the diskless and nfs shared /usr worlds devd wants to start > before /usr is mounted. >=20 >> I'm agnostic about the value of moving them. ?Users can configure loca= l >> rules by modifying the existing devd.conf and files in devd/ and >> dealing with mergemaster on updates, or by adding their own new files >> in devd/. >=20 Maybe the correct place is /etc/defaults/devd/ then? --=20 Allan Jude --M6cxDh6BA09cfIrlwR2FZ1iykKcXfMtzk-- --zB3zvhv0oS4KbfRx4mJPpdMTJ8iKUjMcn 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) iQIcBAEBAgAGBQJagS6zAAoJEBmVNT4SmAt+XUQP/3kg4PloHzAUJKba0T6fLMNT oQbhulH74ndPAEKuJ9LwWiew390RxAyQe6HfReiPJndM49WYWajhyIAiESdBcpNB 7ZUzerXYguZ8pEnJo1JuHWbOBOKhNY+oYYLcBHuhlfyKAhMZrsgVVWQxJXbBllFd 86W8udd6f/jKZY1eFo0WmWgh40MX57FodDaOU4QTTCaxQc54596WRkbQ4wtxi7Z2 P9yeKB7mez8M7gtpDH5nPSope3qx5YwiPjObPL+U1kHSMg5pNDuHB7uTEPBk/Tnx tv6+7kNpOok4usr+p/PER7voTihLsvet2BUz2/odyTl4MsJlYEQZCKkwy8UGYd1v mxBNtzKJ7HDP6FPCbffhOvXZUqtSchv5/TOKVTjAmGGE+59iu4PmxDDe4IInVNmB DURf6WsuVsfAvbEr4BmQfoWdjJ45m0tA3NXvgOuW0mLMg3S7GSFD11avIECsPWXW jCIP6TNUkV12qa8UK1PfNnatFTk08Vqezsa96yIcE/tNzjDwk69J0BY64xt2TsP0 S1qlnJOAqNYDbI0JOmlgyXt+olTLjvg6pixwMtQ4kkiss/VLttKs772w6uQ6fuIo N4h7tZnjA0s3Z58XAWjH/PrKygt5GHEyGwLZAkg7s4Ph3iAMQExkZIGsitLk8DV9 fJvEAKfoRqy0gMO7eQ6X =YJGP -----END PGP SIGNATURE----- --zB3zvhv0oS4KbfRx4mJPpdMTJ8iKUjMcn-- From owner-svn-src-head@freebsd.org Mon Feb 12 06:08: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 1AD27F1C0AA; Mon, 12 Feb 2018 06:08:12 +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 A0CAE81771; Mon, 12 Feb 2018 06:08:11 +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 DD7E71438D; Mon, 12 Feb 2018 06:08:10 +0000 (UTC) Subject: Re: svn commit: r329150 - head/etc/devd To: Warner Losh , "Rodney W. Grimes" Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201802120454.w1C4sp4o086856@repo.freebsd.org> <201802120510.w1C5AUFY042400@pdx.rh.CN85.dnsmgr.net> From: Allan Jude Message-ID: <3cd5ec93-caaa-8789-4caf-549296cd07dc@freebsd.org> Date: Mon, 12 Feb 2018 01:08:11 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zLBSGnQz9j6cL0IayiTIFlnDv8CAR2fUo" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 06:08:12 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --zLBSGnQz9j6cL0IayiTIFlnDv8CAR2fUo Content-Type: multipart/mixed; boundary="EMF8l9UxPWgMFkXxBf9zctthxNCGElOib"; protected-headers="v1" From: Allan Jude To: Warner Losh , "Rodney W. Grimes" Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <3cd5ec93-caaa-8789-4caf-549296cd07dc@freebsd.org> Subject: Re: svn commit: r329150 - head/etc/devd References: <201802120454.w1C4sp4o086856@repo.freebsd.org> <201802120510.w1C5AUFY042400@pdx.rh.CN85.dnsmgr.net> In-Reply-To: --EMF8l9UxPWgMFkXxBf9zctthxNCGElOib Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 2018-02-12 00:28, Warner Losh wrote: >=20 >=20 > On Sun, Feb 11, 2018 at 10:10 PM, Rodney W. Grimes > = > > wrote: >=20 > [ Charset UTF-8 unsupported, converting... ] > > Author: imp > > Date: Mon Feb 12 04:54:51 2018 > > New Revision: 329150 > > URL: https://svnweb.freebsd.org/changeset/base/329150 > > > > > Log: > >=C2=A0 =C2=A0Install devmatch.conf, don't install usb.conf >=20 > Doesnt this break devd and anyone depending on it? >=20 >=20 > I'm having problems understanding how it would break it? > =C2=A0 >=20 > Does usb.conf need to go in OBSOLETEFILES now? >=20 >=20 > Yes. It should... > =C2=A0 >=20 > Relnotes y? >=20 >=20 > Yes. It's hard to know where in the sequence of on-boarding a new > function where to put it. >=20 Previously Release Engineering has said they'd rather you mark a few too many things as Relnotes: Yes, than too few. In cases like this, it might make sense to flag the entire series of commits, so a year from now re@ stands a better chance of writing a coherent paragraph about what the change actually is, and how it impacts the user. > Warner > =C2=A0 >=20 >=20 > > Modified: > >=C2=A0 =C2=A0head/etc/devd/Makefile > > > > Modified: head/etc/devd/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/etc/devd/Makefile=C2=A0 =C2=A0 Mon Feb 12 04:52:25 2018=C2= =A0 =C2=A0 =C2=A0 =C2=A0 (r329149) > > +++ head/etc/devd/Makefile=C2=A0 =C2=A0 Mon Feb 12 04:54:51 2018=C2= =A0 =C2=A0 =C2=A0 =C2=A0 (r329150) > > @@ -12,13 +12,14 @@ FILES+=3D=C2=A0 =C2=A0apple.conf > >=C2=A0 .if ${MK_ACPI} !=3D "no" > >=C2=A0 FILES+=3D=C2=A0 =C2=A0 =C2=A0 asus.conf > >=C2=A0 .endif > > +FILES+=3Ddevmatch.conf > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^ missing tab >=20 > >=C2=A0 .if ${MK_HYPERV} !=3D "no" > >=C2=A0 FILES+=3D=C2=A0 =C2=A0 =C2=A0 hyperv.conf > >=C2=A0 .endif > >=C2=A0 .endif > > > >=C2=A0 .if ${MK_USB} !=3D "no" > > -FILES+=3D=C2=A0 =C2=A0 =C2=A0 uath.conf ulpt.conf usb.conf > > +FILES+=3D=C2=A0 =C2=A0 =C2=A0 uath.conf ulpt.conf > >=C2=A0 .endif > > > >=C2=A0 .if ${MK_ZFS} !=3D "no" >=20 > -- > Rod Grimes=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 > =C2=A0rgrimes@freebsd.org >=20 >=20 --=20 Allan Jude --EMF8l9UxPWgMFkXxBf9zctthxNCGElOib-- --zLBSGnQz9j6cL0IayiTIFlnDv8CAR2fUo 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) iQIcBAEBAgAGBQJagS9LAAoJEBmVNT4SmAt+w4IQAMn+KKrU+Qkr5q4JI0ikZdWb bgDQpHibHRYQrT1LtsmRkjPe8fzM8YB6G+RlB3eZziEG+9feu7s3ppNnXAf7xLmU r9+N0/CenK8kw/GpIkkK7PKZco8GhK9GaBTKOf3Cl8puog2Lrcuc1QCWdSbQ7ubJ Yz6upo1DgwLw30sTnuGrsVjb5BdOYKUMrRp5CxG3AQVpZXpNPr5T3IiXcFhAlAKM wLydi1SB5gWEsHXkjXnfZelyymT0tb4N9XmBwYn/FJJnL6g1nUuriGbajwL/Xv+r HYKTtZugI0OYeLX7eNAjjz674DK6B3AgPyaib4woXn17RTF6cimek3CIob5TYVat 5Gml53wfR6cBJ6vZ7Gf5FRGaQ4rDWSJbyKSvtSe9eLsYXivD8cEoeDsaEANOmMjw hserRS0cZvZyslj2N1DfgW284Lw9PiPpzJE86TtlDfODPhBO6KUwRtxAAMQlNz4B 5DXCbmOSMlEiqDdhliCG0q6sn8XHOIVKesWKKPQkYmb01LfHUpp82rkeGpppnOYV kp1heNdC4vflZVU7UU8P7IERWPRAlbC+JhDXazDGRp8nsTXIB8/FCDU6/poNuLeR o14ZK4IOtz7yTU3Kx0JPq3bUzyBNURRpjwba7RKaVvNPxxQrSDVxlz++myND04vP n5oBjXOnxq4RDzT1SWGw =dZx+ -----END PGP SIGNATURE----- --zLBSGnQz9j6cL0IayiTIFlnDv8CAR2fUo-- From owner-svn-src-head@freebsd.org Mon Feb 12 06:42: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 20EF1F1D90D; Mon, 12 Feb 2018 06:42:39 +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 C80F482A90; Mon, 12 Feb 2018 06:42: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 C30DB673D; Mon, 12 Feb 2018 06:42:38 +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 w1C6gcAq041708; Mon, 12 Feb 2018 06:42:38 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1C6gcKe041705; Mon, 12 Feb 2018 06:42:38 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802120642.w1C6gcKe041705@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Feb 2018 06:42:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329153 - 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: 329153 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 06:42:39 -0000 Author: imp Date: Mon Feb 12 06:42:38 2018 New Revision: 329153 URL: https://svnweb.freebsd.org/changeset/base/329153 Log: Add usb.conf to ObsoleteFiles. Add a note to UPDATING. Fix a missing tab. Relnotes: Yes Modified: head/ObsoleteFiles.inc head/UPDATING head/etc/devd/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Feb 12 05:55:44 2018 (r329152) +++ head/ObsoleteFiles.inc Mon Feb 12 06:42:38 2018 (r329153) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20180211: remove usb.conf +OLD_FILES+=etc/devd/usb.conf # 20180208: remove c_rehash(1) OLD_FILES+=usr/share/openssl/man/man1/c_rehash.1.gz # 20180206: remove gdbtui Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Feb 12 05:55:44 2018 (r329152) +++ head/UPDATING Mon Feb 12 06:42:38 2018 (r329153) @@ -51,6 +51,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: ****************************** SPECIAL WARNING: ****************************** +20180211: + devmatch functionality has been turned on in devd. It will automatically + load drivers for unattached devices. This may cause unexpected drivers to + be loaded. Please report any problems to current@ and imp@freebsd.org. + 20180114: Clang, llvm, lld, lldb, compiler-rt and libc++ have been upgraded to 6.0.0. Please see the 20141231 entry below for information about Modified: head/etc/devd/Makefile ============================================================================== --- head/etc/devd/Makefile Mon Feb 12 05:55:44 2018 (r329152) +++ head/etc/devd/Makefile Mon Feb 12 06:42:38 2018 (r329153) @@ -12,7 +12,7 @@ FILES+= apple.conf .if ${MK_ACPI} != "no" FILES+= asus.conf .endif -FILES+=devmatch.conf +FILES+= devmatch.conf .if ${MK_HYPERV} != "no" FILES+= hyperv.conf .endif From owner-svn-src-head@freebsd.org Mon Feb 12 06:51: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 C9CB9F1DE05; Mon, 12 Feb 2018 06:51:20 +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 7CE6B82F49; Mon, 12 Feb 2018 06:51:20 +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 77E676781; Mon, 12 Feb 2018 06:51:20 +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 w1C6pKOo042320; Mon, 12 Feb 2018 06:51:20 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1C6pKqF042318; Mon, 12 Feb 2018 06:51:20 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802120651.w1C6pKqF042318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Feb 2018 06:51:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329154 - in head/etc: defaults devd X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/etc: defaults devd X-SVN-Commit-Revision: 329154 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 06:51:21 -0000 Author: imp Date: Mon Feb 12 06:51:20 2018 New Revision: 329154 URL: https://svnweb.freebsd.org/changeset/base/329154 Log: Turn devmatch on by default. Turn devmatch on by default. However, use 'start' instead of 'onestart' in the devmatch.conf file so the setting of 'devmatch_enable' is honored. Give an example of what to put in devd.conf if you want to disable just the run-time part of devmatch. Relnotes: yes Modified: head/etc/defaults/rc.conf head/etc/devd/devmatch.conf Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Mon Feb 12 06:42:38 2018 (r329153) +++ head/etc/defaults/rc.conf Mon Feb 12 06:51:20 2018 (r329154) @@ -41,7 +41,7 @@ ddb_enable="NO" # Set to YES to load ddb scripts at b ddb_config="/etc/ddb.conf" # ddb(8) config file. devd_enable="YES" # Run devd, to trigger programs on device tree changes. devd_flags="" # Additional flags for devd(8). -devmatch_enable="NO" # Demand load kernel modules based on device ids. +devmatch_enable="YES" # Demand load kernel modules based on device ids. #kld_list="" # Kernel modules to load after local disks are mounted kldxref_enable="NO" # Build linker.hints files with kldxref(8). kldxref_clobber="NO" # Overwrite old linker.hints at boot. Modified: head/etc/devd/devmatch.conf ============================================================================== --- head/etc/devd/devmatch.conf Mon Feb 12 06:42:38 2018 (r329153) +++ head/etc/devd/devmatch.conf Mon Feb 12 06:51:20 2018 (r329154) @@ -9,5 +9,12 @@ # # Generic NOMATCH event nomatch 100 { - action "service devmatch onestart" + action "service devmatch start" }; + +# Add the following to devd.conf to preent this from running: +# nomatch 1000 { +# action "true" +# }; +# it replaces the generic event with one of higher priority that +# does nothing. You can also set 'devmatch_enable=NO' in /etc/rc.conf From owner-svn-src-head@freebsd.org Mon Feb 12 06:52: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 441EFF1E0A0; Mon, 12 Feb 2018 06:52: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 E4C51831A6; Mon, 12 Feb 2018 06:52: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 DC26968D3; Mon, 12 Feb 2018 06:52: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 w1C6qn58046954; Mon, 12 Feb 2018 06:52:49 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1C6qnHP046953; Mon, 12 Feb 2018 06:52:49 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802120652.w1C6qnHP046953@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Feb 2018 06:52:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329155 - head/etc/devd X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/etc/devd X-SVN-Commit-Revision: 329155 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 06:52:50 -0000 Author: imp Date: Mon Feb 12 06:52:49 2018 New Revision: 329155 URL: https://svnweb.freebsd.org/changeset/base/329155 Log: Fix typo Modified: head/etc/devd/devmatch.conf Modified: head/etc/devd/devmatch.conf ============================================================================== --- head/etc/devd/devmatch.conf Mon Feb 12 06:51:20 2018 (r329154) +++ head/etc/devd/devmatch.conf Mon Feb 12 06:52:49 2018 (r329155) @@ -12,7 +12,7 @@ nomatch 100 { action "service devmatch start" }; -# Add the following to devd.conf to preent this from running: +# Add the following to devd.conf to prevent this from running: # nomatch 1000 { # action "true" # }; From owner-svn-src-head@freebsd.org Mon Feb 12 06:56: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 CEC54F1E2B4; Mon, 12 Feb 2018 06:55:59 +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 34D2383361; Mon, 12 Feb 2018 06:55:58 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with ESMTPA id l81lens2Z7Gjal81neDf3A; Sun, 11 Feb 2018 23:55:51 -0700 X-Authority-Analysis: v=2.3 cv=I59Luuog c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=Op4juWPpsa0A:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=1t0oBGq3kUfe7izZYdYA: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 59D78B76; Sun, 11 Feb 2018 22:55:49 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w1C6tmZk080472; Sun, 11 Feb 2018 22:55:48 -0800 (PST) (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 w1C6tmCO080469; Sun, 11 Feb 2018 22:55:48 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201802120655.w1C6tmCO080469@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 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Warner Losh cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329154 - in head/etc: defaults devd In-Reply-To: Message from Warner Losh of "Mon, 12 Feb 2018 06:51:20 +0000." <201802120651.w1C6pKqF042318@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 11 Feb 2018 22:55:48 -0800 X-CMAE-Envelope: MS4wfGeD/HtDbDvd2YoxFwGKUTO56VvKBcViUSgwak63zCoJCuFjyWOGGhp1oSIX1MtlWmYalYvbVJJbJRAeNKsnnOfNqTxwBLRbx6mc3frimLTV0avOW0lU D5O1V0oZ7ZUcS/IJLOQYKcvo0TghoPnw09apge2ZZTcIE4T35HyDibZdajXCcVP7sMG9H/X2sFSlggyUf32HqYMLdapHFSDF3lVdzvHWJhhwxsY4Cpk32Vue HAf8lCU938+F9IyUODvA0zhG+yFm+ca3kjniFgSJxiAWd5tO2/t+Q9lbNkT/jOh8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 06:56:00 -0000 In message <201802120651.w1C6pKqF042318@repo.freebsd.org>, Warner Losh writes: > Author: imp > Date: Mon Feb 12 06:51:20 2018 > New Revision: 329154 > URL: https://svnweb.freebsd.org/changeset/base/329154 > > Log: > Turn devmatch on by default. > > Turn devmatch on by default. However, use 'start' instead of > 'onestart' in the devmatch.conf file so the setting of > 'devmatch_enable' is honored. Give an example of what to put in > devd.conf if you want to disable just the run-time part of devmatch. > > Relnotes: yes > > Modified: > head/etc/defaults/rc.conf > head/etc/devd/devmatch.conf > > Modified: head/etc/defaults/rc.conf > ============================================================================= > = > --- head/etc/defaults/rc.conf Mon Feb 12 06:42:38 2018 (r329153) > +++ head/etc/defaults/rc.conf Mon Feb 12 06:51:20 2018 (r329154) > @@ -41,7 +41,7 @@ ddb_enable="NO" # Set to YES to load ddb script > s at b > ddb_config="/etc/ddb.conf" # ddb(8) config file. > devd_enable="YES" # Run devd, to trigger programs on device tree changes. > devd_flags="" # Additional flags for devd(8). > -devmatch_enable="NO" # Demand load kernel modules based on device ids. > +devmatch_enable="YES" # Demand load kernel modules based on device id > s. This assumes that everyone has /usr in /. We might want to consider moving devmatch to /sbin or document that /usr and / be merged. -- 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 Mon Feb 12 06:59: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 E25CBF1E4F0 for ; Mon, 12 Feb 2018 06:59:26 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x234.google.com (mail-io0-x234.google.com [IPv6:2607:f8b0:4001:c06::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 710B58353F for ; Mon, 12 Feb 2018 06:59:26 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x234.google.com with SMTP id b198so16233453iof.6 for ; Sun, 11 Feb 2018 22:59:26 -0800 (PST) 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=Fqzad2wBSZzt4x85xxeOw21AHiao04YA8megSzB/vsU=; b=PNOJE0j1M6Od9ce3/kehopr+ikbruqokuX8kVMBCPJcJdBbt7ptdv/JboxW9IhxzIo gEauL0uprUx10YI0LrKziGOFeLbC7nSZjbRWn79Wi91ey5RHkwer611OLmE4fvXH9WPE P2csJGz0l8+tKQDPQ806QHbcTr4Ngg25mnruE/Gz4B8jQhwrxwUvXeFQ/bw3olCTffiJ 1Hg0vwp96SLyjHXjSG29DS2wrtp3p8eFAj5kiBntLqFGZG48bmUnp3YG1+y9j++s015V w6n/EJUGztTmOOgNCzpN+A/Uu4z7/fY2qmNVQItR0ahml9j5Q54fmKaBAbgmSwvrIK4l pJ5g== 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=Fqzad2wBSZzt4x85xxeOw21AHiao04YA8megSzB/vsU=; b=k6/2t9uhpPhWTybPEsSzxkWWWMnQs9fuqFc0f1ra4PCe22BPLnKHThGbchSGKHAd24 4ox1OB2Q+/3zSS8igyUhpc/swiMM6vspcce7YvHnlJdT3k/JplSZvlgUOsBIOC+kaJ5s YhNtYpnoHg/hvgVpIQzPFGE5al3JRu7aoHj+35yxUsh+uKUJUH/gy4NLyk8kCX6vmJ1a 8lT9mON3kK7fndibEWoHfXYARJ5pX+OgWHb/k+SOW6I1PW9BZArwry9WImIZM/IBLgAG tTvBFhJyQOABjUGy/4P9r3V61c0fGqwni6kmweVzaSc8AF3pYTn7yRCbEtyflm+SC6cR tlXg== X-Gm-Message-State: APf1xPDzlDleqDqyByljtloy3jDRaAS/VwuQoJF7MEeqiXFSIGc4O405 Fz0KMwuW3F1jqywvToCq9ujvUTt/W+E0AiTEVT6KlA== X-Google-Smtp-Source: AH8x225dbsqLW+qioV85ohJU6kEaeliHn95HPEkKyshCsDMmef8S5tBqzkI8/aLwFjz5ctZYmUsMyMfWENR392+F3tI= X-Received: by 10.107.172.130 with SMTP id v124mr7791687ioe.301.1518418765786; Sun, 11 Feb 2018 22:59:25 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Sun, 11 Feb 2018 22:59:25 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:18a2:a4f7:170:8dd9] In-Reply-To: <201802120655.w1C6tmCO080469@slippy.cwsent.com> References: <201802120651.w1C6pKqF042318@repo.freebsd.org> <201802120655.w1C6tmCO080469@slippy.cwsent.com> From: Warner Losh Date: Sun, 11 Feb 2018 23:59:25 -0700 X-Google-Sender-Auth: w3EZcRm-2g82Bw-37Ib8jUeMEhc Message-ID: Subject: Re: svn commit: r329154 - in head/etc: defaults devd To: Cy Schubert 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.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 06:59:27 -0000 On Sun, Feb 11, 2018 at 11:55 PM, Cy Schubert wrote: > In message <201802120651.w1C6pKqF042318@repo.freebsd.org>, Warner Losh > writes: > > Author: imp > > Date: Mon Feb 12 06:51:20 2018 > > New Revision: 329154 > > URL: https://svnweb.freebsd.org/changeset/base/329154 > > > > Log: > > Turn devmatch on by default. > > > > Turn devmatch on by default. However, use 'start' instead of > > 'onestart' in the devmatch.conf file so the setting of > > 'devmatch_enable' is honored. Give an example of what to put in > > devd.conf if you want to disable just the run-time part of devmatch. > > > > Relnotes: yes > > > > Modified: > > head/etc/defaults/rc.conf > > head/etc/devd/devmatch.conf > > > > Modified: head/etc/defaults/rc.conf > > ============================================================ > ================= > > = > > --- head/etc/defaults/rc.conf Mon Feb 12 06:42:38 2018 (r329153) > > +++ head/etc/defaults/rc.conf Mon Feb 12 06:51:20 2018 (r329154) > > @@ -41,7 +41,7 @@ ddb_enable="NO" # Set to YES to load ddb > script > > s at b > > ddb_config="/etc/ddb.conf" # ddb(8) config file. > > devd_enable="YES" # Run devd, to trigger programs on device tree > changes. > > devd_flags="" # Additional flags for devd(8). > > -devmatch_enable="NO" # Demand load kernel modules based on device ids. > > +devmatch_enable="YES" # Demand load kernel modules based on > device id > > s. > > This assumes that everyone has /usr in /. We might want to consider > moving devmatch to /sbin or document that /usr and / be merged. > That's a good point. I think /etc/rc.d is fine, but devd runs before /usr is mounted, so I think you are right. I'll make the change tomorrow. Warner From owner-svn-src-head@freebsd.org Mon Feb 12 07:01: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 BDB3CF1E7D3; Mon, 12 Feb 2018 07:01:56 +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 73642838F1; Mon, 12 Feb 2018 07:01:56 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 6BCD01BAA3; Mon, 12 Feb 2018 07:01:56 +0000 (UTC) Date: Mon, 12 Feb 2018 07:01:56 +0000 From: Alexey Dokuchaev To: Cy Schubert Cc: Warner Losh , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r329154 - in head/etc: defaults devd Message-ID: <20180212070156.GA49948@FreeBSD.org> References: <201802120651.w1C6pKqF042318@repo.freebsd.org> <201802120655.w1C6tmCO080469@slippy.cwsent.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201802120655.w1C6tmCO080469@slippy.cwsent.com> User-Agent: Mutt/1.9.2 (2017-12-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 07:01:56 -0000 On Sun, Feb 11, 2018 at 10:55:48PM -0800, Cy Schubert wrote: > In message <201802120651.w1C6pKqF042318@repo.freebsd.org>, Warner Losh > writes: > > New Revision: 329154 > > URL: https://svnweb.freebsd.org/changeset/base/329154 > > > > Log: > > Turn devmatch on by default. > > > > Turn devmatch on by default. However, use 'start' instead of > > 'onestart' in the devmatch.conf file so the setting of > > 'devmatch_enable' is honored. Give an example of what to put in > > devd.conf if you want to disable just the run-time part of devmatch. > > > > ... > > @@ -41,7 +41,7 @@ ddb_enable="NO" # Set to YES to load ddb script > > s at b > > ddb_config="/etc/ddb.conf" # ddb(8) config file. > > devd_enable="YES" # Run devd, to trigger programs on device tree changes. > > devd_flags="" # Additional flags for devd(8). > > -devmatch_enable="NO" # Demand load kernel modules based on device ids. > > +devmatch_enable="YES" # Demand load kernel modules based on device id > > s. > > This assumes that everyone has /usr in /. We might want to consider > moving devmatch to /sbin, or document that I was actually surprised to find out it's installed as /usr/sbin/devmatch; /sbin indeed looks more appropriate. > /usr and / be merged. Please don't. ./danfe From owner-svn-src-head@freebsd.org Mon Feb 12 07:14: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 E2C26F1F261; Mon, 12 Feb 2018 07:14:25 +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 4AB2A83F31; Mon, 12 Feb 2018 07:14: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 mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 551993C5010; Mon, 12 Feb 2018 18:14:20 +1100 (AEDT) Date: Mon, 12 Feb 2018 18:14:14 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh cc: "Conrad E. Meyer" , "Rodney W. Grimes" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329126 - head/etc/devd In-Reply-To: Message-ID: <20180212181001.I1004@besplex.bde.org> References: <1518374549.32585.238.camel@freebsd.org> <201802112346.w1BNkPXc041510@pdx.rh.CN85.dnsmgr.net> 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=DIX/22Fb c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=iKhvJSA4AAAA:8 a=pw8i2ox7dyFYx6z0qzYA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=odh9cflL3HIXMm4fY7Wr:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 07:14:26 -0000 On Sun, 11 Feb 2018, Warner Losh wrote: > On Feb 11, 2018 7:05 PM, "Conrad Meyer" wrote: > > On Sun, Feb 11, 2018 at 3:46 PM, Rodney W. Grimes > wrote: >> Moving this to /usr creates a cyclic issue in that you then need >> /usr to be mounted before devd can start and devd's /etc/rc.d file >> says: >> # PROVIDE: devd >> # REQUIRE: NETWORKING >> # BEFORE: mountcritremote >> # KEYWORD: nojail >> >> In the diskless and nfs shared /usr worlds devd wants to start >> before /usr is mounted. > > If devd is needed to mount /usr (???), it seems like just another > demonstration of why separate /usr is a poor idea. No, it is just another defense against people breaking separate /usr. > No, it's another reason why generated devd files are wrong in the face of > devmatch. Bruce From owner-svn-src-head@freebsd.org Mon Feb 12 08:35: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 0CED0F028DD for ; Mon, 12 Feb 2018 08:35:46 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c: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 7E27386BB7 for ; Mon, 12 Feb 2018 08:35:45 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x242.google.com with SMTP id t74so8044039wme.3 for ; Mon, 12 Feb 2018 00:35:45 -0800 (PST) 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=+RiDWmFqPN/qMfR78aI7cWq3pkf039D34EBSKTqs47s=; b=USxyRDu+SHOOdUCPa39cMegRCMDRs15dl8QRFCJB15o39xbZRaaEJILZOIxSel2/x2 5UzGq3VODLiwmQlYH7mdej8xIYS4nF55CuUMhMFzy5Ao2Mh93RA3BETxdX8m7q/knGG/ GKSiAaqq6yANholpIhr5WIU9+LviObfO7IxG0V7UF0SrYheqeqnBMmrtWl/b88Anivu7 DdkAM0+D4P9Rh/jtvXmutGoDZ8y5w/fYG5idHuvsv7hWBFlkuBJ0J7CQllS6AreLDeoB rcWD19bUrEbD48f7bBdSbpdlZ+1sEXCDq2e0RWzWIDrvMQ86QWtteigP5spvxPTvyNEc TgDQ== 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=+RiDWmFqPN/qMfR78aI7cWq3pkf039D34EBSKTqs47s=; b=Wh54txaC+0kO0F2cI3YzOQsvAocVw7lndIFHtPNWvQsnHfBIT+9URDLPTzWqOqDSSX jdI76FdZFLUnrtWVjuyN64zYkqSuIKN6weR02yjl2YwhGmJPdrLt+Kv+yNtUFmUXARwN MnKIyBPD0BwVCUcU1OAxMf6qMO+8bvpmcdg6nBwr1eVSh1TG/bBAWo0wqF+bus6S6XML MdHzATviZss868WMefynSbIsjPzGfr/Dvg6NQPp5FFqE0JqkY/Aj/znlf5yjyxzKz0No dvAFOd/7x/AjX8LxSRDPPJmoYDU3Zndlp31GOdxzkQeitDfsSQDk+DmIWFu3/TThsN2r yl4A== X-Gm-Message-State: APf1xPCC8Kw4D+tiZjIT8uRJg+oyypxypAnTmXLLdHBMIqT8F8omqvzO 3/SLbhSdwbBVdgWDpZZj7TJVDijWHMLvEhi5J7fsyw== X-Google-Smtp-Source: AH8x2245meyKo+z4AtVRBHTFIJ3viY3KGLwmhcUTZ4eq6xIxNsoosmjKIFAt3Ax9gDp9EIDmWHvlooI7w/p+f96NzQM= X-Received: by 10.80.191.71 with SMTP id g7mr14998633edk.246.1518424544535; Mon, 12 Feb 2018 00:35:44 -0800 (PST) MIME-Version: 1.0 Received: by 10.80.148.90 with HTTP; Mon, 12 Feb 2018 00:35:44 -0800 (PST) In-Reply-To: <20180212070156.GA49948@FreeBSD.org> References: <201802120651.w1C6pKqF042318@repo.freebsd.org> <201802120655.w1C6tmCO080469@slippy.cwsent.com> <20180212070156.GA49948@FreeBSD.org> From: Oliver Pinter Date: Mon, 12 Feb 2018 09:35:44 +0100 Message-ID: Subject: Re: svn commit: r329154 - in head/etc: defaults devd To: Alexey Dokuchaev Cc: Cy Schubert , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Warner Losh Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 08:35:46 -0000 On Monday, February 12, 2018, Alexey Dokuchaev wrote: > On Sun, Feb 11, 2018 at 10:55:48PM -0800, Cy Schubert wrote: > > In message <201802120651.w1C6pKqF042318@repo.freebsd.org>, Warner Losh > > writes: > > > New Revision: 329154 > > > URL: https://svnweb.freebsd.org/changeset/base/329154 > > > > > > Log: > > > Turn devmatch on by default. > > > > > > Turn devmatch on by default. However, use 'start' instead of > > > 'onestart' in the devmatch.conf file so the setting of > > > 'devmatch_enable' is honored. Give an example of what to put in > > > devd.conf if you want to disable just the run-time part of devmatch. > > > > > > ... > > > @@ -41,7 +41,7 @@ ddb_enable="NO" # Set to YES to load ddb > script > > > s at b > > > ddb_config="/etc/ddb.conf" # ddb(8) config file. > > > devd_enable="YES" # Run devd, to trigger programs on device tree > changes. > > > devd_flags="" # Additional flags for devd(8). > > > -devmatch_enable="NO" # Demand load kernel modules based on > device ids. > > > +devmatch_enable="YES" # Demand load kernel modules based on > device id > > > s. > > > > This assumes that everyone has /usr in /. We might want to consider > > moving devmatch to /sbin, or document that > > I was actually surprised to find out it's installed as /usr/sbin/devmatch; > /sbin indeed looks more appropriate. > > > /usr and / be merged. > > Please don't. There are already lot of separated / and /usr installations, so +1. > > ./danfe > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Mon Feb 12 08:53: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 09AB0F03EC0; Mon, 12 Feb 2018 08:53:08 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf0-f49.google.com (mail-lf0-f49.google.com [209.85.215.49]) (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 758B387A06; Mon, 12 Feb 2018 08:53:07 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf0-f49.google.com with SMTP id q194so19360216lfe.13; Mon, 12 Feb 2018 00:53:07 -0800 (PST) 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 :content-transfer-encoding; bh=abcLIsWYYHKhlKlANcZ3FcpVTzkk635redeGm39Q7wc=; b=qX1UQs0xa70IKoIXmcQgY1jW7XflAB8htcOmnoyz0bmKRh2yV9ol/7MQBPkAK6FVbj LWU+icmiotw7gJRBRxXps5clva54qz0tb4r6iz5qilcDGTxFixrxGr5s0PRNNf+K7zvv Ahw8cMd1gTRIq2Z0dBnq4WbNEfigOHeSY8nvKB4fzmLtdBMSkO99k+8z7xocFAgn5eFK 88EVevYGNtmVBbisuhJoWiYG2s3AoIlZGVgIq0/Hj3v2bjVgdxnksewsNr7G+RRp8xc0 icjH+rCqOTlL8JDnyKDRfgdrHrjC/R6SzYeoAou2NJhgxsqMF9iaRDAm7GPxghiVI4lK JhDQ== X-Gm-Message-State: APf1xPBMe8+VZFDDTn87h0V+5Ig/WDMOx9ILzuxiyB4yam2QewCjgY/m MX3Xq5ELj52Ftgo+s1WJ0ONigpMf5vY= X-Google-Smtp-Source: AH8x22699qIMPJYJd1oPxrdsYEWvqWPEPL0SPIi6TY8WPtiwzXlnP1M/oqtCLadJ/kkEdQ629ig8SA== X-Received: by 10.25.68.10 with SMTP id r10mr6631153lfa.124.1518425579773; Mon, 12 Feb 2018 00:52:59 -0800 (PST) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id l136sm1580604lfb.59.2018.02.12.00.52.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Feb 2018 00:52:59 -0800 (PST) Subject: Re: svn commit: r329126 - head/etc/devd To: Bruce Evans , Warner Losh Cc: "Conrad E. Meyer" , "Rodney W. Grimes" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <1518374549.32585.238.camel@freebsd.org> <201802112346.w1BNkPXc041510@pdx.rh.CN85.dnsmgr.net> <20180212181001.I1004@besplex.bde.org> From: Andriy Gapon Message-ID: <6873c493-e5bc-7068-d4f3-62206a95c968@FreeBSD.org> Date: Mon, 12 Feb 2018 10:52:57 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180212181001.I1004@besplex.bde.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.25 Precedence: list List-Id: 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, 12 Feb 2018 08:53:08 -0000 On 12/02/2018 09:14, Bruce Evans wrote: > No, it is just another defense against people breaking separate /usr. /usr is too diverse. Separate (from root and from each other) /usr/local, /usr/obj, /usr/ports, /usr/src, /usr/home are a good idea. Separate /usr/bin and /usr/sbin ... many potential problems for zero benefit. Legacy storage allocation schemes are very limiting, of course. -- Andriy Gapon From owner-svn-src-head@freebsd.org Mon Feb 12 09:25: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 40405F0688D; Mon, 12 Feb 2018 09:25:40 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (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 9690869249; Mon, 12 Feb 2018 09:25:39 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mail-wm0-x22d.google.com with SMTP id f3so8541237wmc.1; Mon, 12 Feb 2018 01:25:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=vRzsV/JPBeM0U68tvsiE2A8Sw/hKHd21Ki9gDfGJ49E=; b=dXgUABSRnPU70OIzoUh32ijMLa7CaanQjST/NoIUQ+Gpjde1OCvDKI8lRg7qBUgnHC ADJS1uELa1q+XXbMGeZ46y3U+D+qATukH7kQjOYRQLYBr4R+SKVxdwfknvlopZP9wgiK +km8ovOjuRrnvxQLXajtlLENHx42yvJQDDtUUCJwrTrh7t+WmeBhQg7zOaNMPCEYh4zg 1DUUlHVs3nlQCqn2nFR/p9So79MQbtFrUDhOo+MzZAz7HJ9REt3Leq/shevyi+e87qSg NRAuXaJJoBYx5z8AAtPvUrrQrWjZUkavUNI1Mww6wtO/Rrmu+Wi0OB7VoYZBRDMVi2kX MQzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=vRzsV/JPBeM0U68tvsiE2A8Sw/hKHd21Ki9gDfGJ49E=; b=dIjg3kN46arueW/qkVkCiJ2/WBZpQIptufLVIkKHnyih+YEbc8dg6JjhB6/7wUG+47 hD1TywNIiYcmmThIg3V9fGhD7NaFAsn3//cti00iUaduvFOAYrHQyWlO6VjpAUKiI2um PDW6AQ2F6QasCFU3IV5ygGbxLZ3lYhtMciQkdtUy8a2QJW1FDTtnL+JulsIxHk5os4Bp Px41SzZiPse/fdinT3tElCEQZEFkPFk4Epzwhkxln/6b3u0vFBxDwfe3CtKUTifBCzAZ wMLxpgaP10SWT4vAgw+CKgREddFG5gFfn7WrKjj1MhmC2uHLU0ua8yXUCIZS+WsG00sY DmGA== X-Gm-Message-State: APf1xPC9fnRfyUqdufMhRm5j8g9W0Kq3YZ/BHc93J4y3ittL8xSwY3pi ZQLKFM5Vpz3zqEs3/as8H1r0VA== X-Google-Smtp-Source: AH8x226LMocJykLZT5E0CKOcsaDY1UCVtoBL8K1DAuITXeXGaPjaT0wUGw4Df3fLMj+s88Hl89H8HA== X-Received: by 10.28.29.81 with SMTP id d78mr3204179wmd.65.1518427538397; Mon, 12 Feb 2018 01:25:38 -0800 (PST) Received: from ernst.home (p5B0233C8.dip0.t-ipconnect.de. [91.2.51.200]) by smtp.gmail.com with ESMTPSA id j132sm8524487wmd.38.2018.02.12.01.25.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Feb 2018 01:25:37 -0800 (PST) Date: Mon, 12 Feb 2018 10:25:36 +0100 From: Gary Jennejohn To: Alexey Dokuchaev Cc: Cy Schubert , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh Subject: Re: svn commit: r329154 - in head/etc: defaults devd Message-ID: <20180212102536.76603ed6@ernst.home> In-Reply-To: <20180212070156.GA49948@FreeBSD.org> References: <201802120651.w1C6pKqF042318@repo.freebsd.org> <201802120655.w1C6tmCO080469@slippy.cwsent.com> <20180212070156.GA49948@FreeBSD.org> Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.31; 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.25 Precedence: list List-Id: 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, 12 Feb 2018 09:25:40 -0000 On Mon, 12 Feb 2018 07:01:56 +0000 Alexey Dokuchaev wrote: > On Sun, Feb 11, 2018 at 10:55:48PM -0800, Cy Schubert wrote: > > In message <201802120651.w1C6pKqF042318@repo.freebsd.org>, Warner Losh > > writes: > > > New Revision: 329154 > > > URL: https://svnweb.freebsd.org/changeset/base/329154 > > > > > > Log: > > > Turn devmatch on by default. > > > > > > Turn devmatch on by default. However, use 'start' instead of > > > 'onestart' in the devmatch.conf file so the setting of > > > 'devmatch_enable' is honored. Give an example of what to put in > > > devd.conf if you want to disable just the run-time part of devmatch. > > > > > > ... > > > @@ -41,7 +41,7 @@ ddb_enable="NO" # Set to YES to load ddb script > > > s at b > > > ddb_config="/etc/ddb.conf" # ddb(8) config file. > > > devd_enable="YES" # Run devd, to trigger programs on device tree changes. > > > devd_flags="" # Additional flags for devd(8). > > > -devmatch_enable="NO" # Demand load kernel modules based on device ids. > > > +devmatch_enable="YES" # Demand load kernel modules based on device id > > > s. > > > > This assumes that everyone has /usr in /. We might want to consider > > moving devmatch to /sbin, or document that > > I was actually surprised to find out it's installed as /usr/sbin/devmatch; > /sbin indeed looks more appropriate. > > > /usr and / be merged. > > Please don't. > +1 -- Gary Jennejohn From owner-svn-src-head@freebsd.org Mon Feb 12 10:58: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 93901F0E64E; Mon, 12 Feb 2018 10:58:46 +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 C9A4F6DB33; Mon, 12 Feb 2018 10:58:45 +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 078a8f5d; Mon, 12 Feb 2018 11:52:03 +0100 (CET) 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=ahNPyDHzukbxob12cmDqWvNak/8=; b=k5dXb3WoAHP+cNnH/biRYloK9eCK iSby3ba8ifAal6A2RbvFUw9gzSGkN7R6Auek4xj0i5QaY7+Ze4DDfCaJDAWHwOYX tdibU6KVLcT5yDXP/Nyli9tSzS2LUFZByBQTPHsS0IYd43I8t6OdUriZQ4HbjPmY FPBr1s73l1/67lI= 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=cQ5AbBYvTM1xxWTDqsyAW8xrxGlXcJy37M9eKzGgMV3JCMV4kTf7h55T 7inY1SEPfZMyi1LZ8U0PdLlcHHLw8AS2d6+EHLSVvplsUbMb+dSgIRulI+PeNbn8 scZYlgv0WuSIS7KjUz+c7zYi0k9YlC6TCAdFUCkPhRamk/NFXXk= Received: from arcadia (evadot.gandi.net [217.70.181.36]) by mail.blih.net (OpenSMTPD) with ESMTPSA id a7cff899 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Mon, 12 Feb 2018 11:52:03 +0100 (CET) Date: Mon, 12 Feb 2018 11:52:02 +0100 From: Emmanuel Vadot To: Brad Davis Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328136 - in head/etc: defaults rc.d Message-Id: <20180212115202.414ce229077525da98716595@bidouilliste.com> In-Reply-To: <201801182045.w0IKjf44088801@repo.freebsd.org> References: <201801182045.w0IKjf44088801@repo.freebsd.org> X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; 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.25 Precedence: list List-Id: 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, 12 Feb 2018 10:58:46 -0000 On Thu, 18 Jan 2018 20:45:41 +0000 (UTC) Brad Davis wrote: > Author: brd (doc,ports committer) > Date: Thu Jan 18 20:45:41 2018 > New Revision: 328136 > URL: https://svnweb.freebsd.org/changeset/base/328136 > > Log: > Teach the resolv startup script to respect its enable flag. > > Reviewed by: will, imp > Approved by: imp > > Modified: > head/etc/defaults/rc.conf > head/etc/rc.d/resolv > > Modified: head/etc/defaults/rc.conf > ============================================================================== > --- head/etc/defaults/rc.conf Thu Jan 18 20:12:12 2018 (r328135) > +++ head/etc/defaults/rc.conf Thu Jan 18 20:45:41 2018 (r328136) > @@ -96,6 +96,7 @@ fsck_y_enable="NO" # Set to YES to do fsck -y if the i > fsck_y_flags="-T ffs:-R -T ufs:-R" # Additional flags for fsck -y > background_fsck="YES" # Attempt to run fsck in the background where possible. > background_fsck_delay="60" # Time to wait (seconds) before starting the fsck. > +growfs_enable="NO" # Set to YES to attempt to grow the root filesystem on boot > netfs_types="nfs:NFS smbfs:SMB" # Net filesystems. > extra_netfs_types="NO" # List of network extra filesystem types for delayed > # mount at startup (or NO). > @@ -276,6 +277,7 @@ ctld_enable="NO" # CAM Target Layer / iSCSI target da > local_unbound_enable="NO" # local caching resolver > blacklistd_enable="NO" # Run blacklistd daemon (YES/NO). > blacklistd_flags="" # Optional flags for blacklistd(8). > +resolv_enable="YES" # Enable resolv / resolvconf > > # > # kerberos. Do not run the admin daemons on slave servers > > Modified: head/etc/rc.d/resolv > ============================================================================== > --- head/etc/rc.d/resolv Thu Jan 18 20:12:12 2018 (r328135) > +++ head/etc/rc.d/resolv Thu Jan 18 20:45:41 2018 (r328136) > @@ -35,6 +35,7 @@ > > name="resolv" > desc="Create /etc/resolv.conf from kenv" > +start_cmd="${name}_start" > stop_cmd=':' > > load_rc_config $name > @@ -42,17 +43,20 @@ load_rc_config $name > # if the info is available via dhcp/kenv > # build the resolv.conf > # > -if [ -n "`/bin/kenv dhcp.domain-name-servers 2> /dev/null`" ]; then > - interface="`/bin/kenv boot.netif.name`" > - ( > - if [ -n "`/bin/kenv dhcp.domain-name 2> /dev/null`" ]; then > - echo domain `/bin/kenv dhcp.domain-name` > +resolv_start() > +{ > + if [ -n "`/bin/kenv dhcp.domain-name-servers 2> /dev/null`" ]; then > + interface="`/bin/kenv boot.netif.name`" > + ( > + if [ -n "`/bin/kenv dhcp.domain-name 2> /dev/null`" ]; then > + echo domain `/bin/kenv dhcp.domain-name` > + fi > + > + set -- `/bin/kenv dhcp.domain-name-servers` > + for ns in `IFS=','; echo $*`; do > + echo nameserver $ns > + done > + ) | /sbin/resolvconf -a ${interface}:dhcp4 > fi > - > - set -- `/bin/kenv dhcp.domain-name-servers` > - for ns in `IFS=','; echo $*`; do > - echo nameserver $ns > - done > - ) | /sbin/resolvconf -a ${interface}:dhcp4 > -fi > +} > I don't understand how it can work without. run_rc_command "$1" -- Emmanuel Vadot From owner-svn-src-head@freebsd.org Mon Feb 12 11:19: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 D8DDEF1025D; Mon, 12 Feb 2018 11:19:05 +0000 (UTC) (envelope-from zeising+freebsd@daemonic.se) Received: from mail.daemonic.se (mail.daemonic.se [IPv6:2607:f740:d:20::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 6FBE76E9F9; Mon, 12 Feb 2018 11:19:05 +0000 (UTC) (envelope-from zeising+freebsd@daemonic.se) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 3zg38J4JcyzDhCl; Mon, 12 Feb 2018 11:18:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=daemonic.se; h= content-transfer-encoding:content-language:content-type :content-type:in-reply-to:mime-version:user-agent:date:date :message-id:from:from:references:subject:subject:received :received; s=20151023; t=1518434336; bh=d+fs8L4lQOk/mSapml8CwVwe boDoi1xZtXULC6Xa/sc=; b=hRphZsDYMMua0+x6GQ5lI7ZA6A+k9aOYKvKZPmgP emJ+XWTVPX6WEy8g8jksBWsEecf3REaBf27KVJ3P4xYX+WYlGeaVUldK4ngPelY5 PC6lCEkneaVM3C2Dh+VNuYT8HaapGwHbGaVKw3wvGut+9aPGS9q8g5xbamby5lv5 3Mo= X-Virus-Scanned: amavisd-new at daemonic.se Received: from mail.daemonic.se ([IPv6:::1]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256) by cid.daemonic.se (mailscanner.daemonic.se [IPv6:::1]) (amavisd-new, port 10587) with ESMTPS id ciECqL-jy8kS; Mon, 12 Feb 2018 11:18:56 +0000 (UTC) Received: from garnet.daemonic.se (host-95-195-216-36.mobileonline.telia.com [95.195.216.36]) by mail.daemonic.se (Postfix) with ESMTPSA id 3zg38H5qpvzDhDr; Mon, 12 Feb 2018 11:18:55 +0000 (UTC) Subject: Re: svn commit: r329154 - in head/etc: defaults devd To: gljennjohn@gmail.com, Alexey Dokuchaev Cc: svn-src-head@freebsd.org, Cy Schubert , svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh References: <201802120651.w1C6pKqF042318@repo.freebsd.org> <201802120655.w1C6tmCO080469@slippy.cwsent.com> <20180212070156.GA49948@FreeBSD.org> <20180212102536.76603ed6@ernst.home> From: Niclas Zeising Message-ID: <4dce5988-44a5-a4d3-123f-b2a19c2c32ea@daemonic.se> Date: Mon, 12 Feb 2018 12:18:47 +0100 User-Agent: Mutt/1.5.21 MIME-Version: 1.0 In-Reply-To: <20180212102536.76603ed6@ernst.home> 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.25 Precedence: list List-Id: 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, 12 Feb 2018 11:19:06 -0000 On 02/12/18 10:25, Gary Jennejohn wrote: > On Mon, 12 Feb 2018 07:01:56 +0000 > Alexey Dokuchaev wrote: > >> On Sun, Feb 11, 2018 at 10:55:48PM -0800, Cy Schubert wrote: >>> In message <201802120651.w1C6pKqF042318@repo.freebsd.org>, Warner Losh >>> writes: >>>> New Revision: 329154 >>>> URL: https://svnweb.freebsd.org/changeset/base/329154 >>>> >>>> Log: >>>> Turn devmatch on by default. >>>> >>>> Turn devmatch on by default. However, use 'start' instead of >>>> 'onestart' in the devmatch.conf file so the setting of >>>> 'devmatch_enable' is honored. Give an example of what to put in >>>> devd.conf if you want to disable just the run-time part of devmatch. >>>> >>>> ... >>>> @@ -41,7 +41,7 @@ ddb_enable="NO" # Set to YES to load ddb script >>>> s at b >>>> ddb_config="/etc/ddb.conf" # ddb(8) config file. >>>> devd_enable="YES" # Run devd, to trigger programs on device tree changes. >>>> devd_flags="" # Additional flags for devd(8). >>>> -devmatch_enable="NO" # Demand load kernel modules based on device ids. >>>> +devmatch_enable="YES" # Demand load kernel modules based on device id >>>> s. >>> >>> This assumes that everyone has /usr in /. We might want to consider >>> moving devmatch to /sbin, or document that >> >> I was actually surprised to find out it's installed as /usr/sbin/devmatch; >> /sbin indeed looks more appropriate. >> >>> /usr and / be merged. >> >> Please don't. >> > > +1 > Any chance of moving /usr/bin/limits to /bin/limits at the same time? It's preventing some scripts (ddb) from running at boot. See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206291 for info. Regards! -- Niclas From owner-svn-src-head@freebsd.org Mon Feb 12 14:44: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 13491F202A3; Mon, 12 Feb 2018 14:44: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 B8542774BA; Mon, 12 Feb 2018 14:44:22 +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 98472134B0; Mon, 12 Feb 2018 14:44:22 +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 w1CEiMNK082218; Mon, 12 Feb 2018 14:44:22 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CEiLTx082212; Mon, 12 Feb 2018 14:44:21 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802121444.w1CEiLTx082212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Feb 2018 14:44:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329161 - in head: . sbin sbin/devmatch usr.sbin usr.sbin/devmatch X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: . sbin sbin/devmatch usr.sbin usr.sbin/devmatch X-SVN-Commit-Revision: 329161 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 14:44:23 -0000 Author: imp Date: Mon Feb 12 14:44:21 2018 New Revision: 329161 URL: https://svnweb.freebsd.org/changeset/base/329161 Log: Move devmatch to sbin from usr/sbin. Since we want to use devmatch in context before a split /,/usr system has mounted /usr, move devmatch to /sbin. Sponsored by: Netflix Added: head/sbin/devmatch/ head/sbin/devmatch/Makefile (contents, props changed) - copied, changed from r329155, head/usr.sbin/devmatch/Makefile head/sbin/devmatch/devmatch.8 (contents, props changed) - copied, changed from r329155, head/usr.sbin/devmatch/devmatch.8 head/sbin/devmatch/devmatch.c (contents, props changed) - copied, changed from r329155, head/usr.sbin/devmatch/devmatch.c Deleted: head/usr.sbin/devmatch/Makefile head/usr.sbin/devmatch/devmatch.8 head/usr.sbin/devmatch/devmatch.c Modified: head/ObsoleteFiles.inc head/sbin/Makefile head/usr.sbin/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Feb 12 13:59:04 2018 (r329160) +++ head/ObsoleteFiles.inc Mon Feb 12 14:44:21 2018 (r329161) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20180212: move devmatch +OLD_FILES+=usr/sbin/devmatch # 20180211: remove usb.conf OLD_FILES+=etc/devd/usb.conf # 20180208: remove c_rehash(1) Modified: head/sbin/Makefile ============================================================================== --- head/sbin/Makefile Mon Feb 12 13:59:04 2018 (r329160) +++ head/sbin/Makefile Mon Feb 12 14:44:21 2018 (r329161) @@ -12,6 +12,7 @@ SUBDIR=adjkerntz \ conscontrol \ ddb \ devfs \ + devmatch \ dhclient \ dmesg \ dump \ Copied and modified: head/sbin/devmatch/Makefile (from r329155, head/usr.sbin/devmatch/Makefile) ============================================================================== Copied and modified: head/sbin/devmatch/devmatch.8 (from r329155, head/usr.sbin/devmatch/devmatch.8) ============================================================================== Copied and modified: head/sbin/devmatch/devmatch.c (from r329155, head/usr.sbin/devmatch/devmatch.c) ============================================================================== Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Mon Feb 12 13:59:04 2018 (r329160) +++ head/usr.sbin/Makefile Mon Feb 12 14:44:21 2018 (r329161) @@ -21,7 +21,6 @@ SUBDIR= adduser \ dconschat \ devctl \ devinfo \ - devmatch \ diskinfo \ dumpcis \ etcupdate \ From owner-svn-src-head@freebsd.org Mon Feb 12 14: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 647EFF204E7; Mon, 12 Feb 2018 14:45:28 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F27907771A; Mon, 12 Feb 2018 14:45:27 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED7E2134B4; Mon, 12 Feb 2018 14:45:27 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1CEjR5K082520; Mon, 12 Feb 2018 14:45:27 GMT (envelope-from tychon@FreeBSD.org) Received: (from tychon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CEjR3n082516; Mon, 12 Feb 2018 14:45:27 GMT (envelope-from tychon@FreeBSD.org) Message-Id: <201802121445.w1CEjR3n082516@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tychon set sender to tychon@FreeBSD.org using -f From: Tycho Nightingale Date: Mon, 12 Feb 2018 14:45:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329162 - in head/sys/amd64/vmm: amd intel X-SVN-Group: head X-SVN-Commit-Author: tychon X-SVN-Commit-Paths: in head/sys/amd64/vmm: amd intel X-SVN-Commit-Revision: 329162 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 14:45:29 -0000 Author: tychon Date: Mon Feb 12 14:45:27 2018 New Revision: 329162 URL: https://svnweb.freebsd.org/changeset/base/329162 Log: Provide further mitigation against CVE-2017-5715 by flushing the return stack buffer (RSB) upon returning from the guest. This was inspired by this linux commit: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/x86/kvm?id=117cc7a908c83697b0b737d15ae1eb5943afe35b Reviewed by: grehan Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D14272 Modified: head/sys/amd64/vmm/amd/svm_support.S head/sys/amd64/vmm/intel/vmcs.c head/sys/amd64/vmm/intel/vmx.h head/sys/amd64/vmm/intel/vmx_support.S Modified: head/sys/amd64/vmm/amd/svm_support.S ============================================================================== --- head/sys/amd64/vmm/amd/svm_support.S Mon Feb 12 14:44:21 2018 (r329161) +++ head/sys/amd64/vmm/amd/svm_support.S Mon Feb 12 14:45:27 2018 (r329162) @@ -113,6 +113,23 @@ ENTRY(svm_launch) movq %rdi, SCTX_RDI(%rax) movq %rsi, SCTX_RSI(%rax) + /* + * To prevent malicious branch target predictions from + * affecting the host, overwrite all entries in the RSB upon + * exiting a guest. + */ + mov $16, %ecx /* 16 iterations, two calls per loop */ + mov %rsp, %rax +0: call 2f /* create an RSB entry. */ +1: pause + call 1b /* capture rogue speculation. */ +2: call 2f /* create an RSB entry. */ +1: pause + call 1b /* capture rogue speculation. */ +2: sub $1, %ecx + jnz 0b + mov %rax, %rsp + /* Restore host state */ pop %r15 pop %r14 Modified: head/sys/amd64/vmm/intel/vmcs.c ============================================================================== --- head/sys/amd64/vmm/intel/vmcs.c Mon Feb 12 14:44:21 2018 (r329161) +++ head/sys/amd64/vmm/intel/vmcs.c Mon Feb 12 14:45:27 2018 (r329162) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -52,6 +53,12 @@ __FBSDID("$FreeBSD$"); #include #endif +SYSCTL_DECL(_hw_vmm_vmx); + +static int no_flush_rsb; +SYSCTL_INT(_hw_vmm_vmx, OID_AUTO, no_flush_rsb, CTLFLAG_RW, + &no_flush_rsb, 0, "Do not flush RSB upon vmexit"); + static uint64_t vmcs_fix_regval(uint32_t encoding, uint64_t val) { @@ -403,8 +410,15 @@ vmcs_init(struct vmcs *vmcs) goto done; /* instruction pointer */ - if ((error = vmwrite(VMCS_HOST_RIP, (u_long)vmx_exit_guest)) != 0) - goto done; + if (no_flush_rsb) { + if ((error = vmwrite(VMCS_HOST_RIP, + (u_long)vmx_exit_guest)) != 0) + goto done; + } else { + if ((error = vmwrite(VMCS_HOST_RIP, + (u_long)vmx_exit_guest_flush_rsb)) != 0) + goto done; + } /* link pointer */ if ((error = vmwrite(VMCS_LINK_POINTER, ~0)) != 0) Modified: head/sys/amd64/vmm/intel/vmx.h ============================================================================== --- head/sys/amd64/vmm/intel/vmx.h Mon Feb 12 14:44:21 2018 (r329161) +++ head/sys/amd64/vmm/intel/vmx.h Mon Feb 12 14:45:27 2018 (r329162) @@ -150,5 +150,6 @@ u_long vmx_fix_cr4(u_long cr4); int vmx_set_tsc_offset(struct vmx *vmx, int vcpu, uint64_t offset); extern char vmx_exit_guest[]; +extern char vmx_exit_guest_flush_rsb[]; #endif Modified: head/sys/amd64/vmm/intel/vmx_support.S ============================================================================== --- head/sys/amd64/vmm/intel/vmx_support.S Mon Feb 12 14:44:21 2018 (r329161) +++ head/sys/amd64/vmm/intel/vmx_support.S Mon Feb 12 14:45:27 2018 (r329162) @@ -42,6 +42,29 @@ #define VLEAVE pop %rbp /* + * Save the guest context. + */ +#define VMX_GUEST_SAVE \ + movq %rdi,VMXCTX_GUEST_RDI(%rsp); \ + movq %rsi,VMXCTX_GUEST_RSI(%rsp); \ + movq %rdx,VMXCTX_GUEST_RDX(%rsp); \ + movq %rcx,VMXCTX_GUEST_RCX(%rsp); \ + movq %r8,VMXCTX_GUEST_R8(%rsp); \ + movq %r9,VMXCTX_GUEST_R9(%rsp); \ + movq %rax,VMXCTX_GUEST_RAX(%rsp); \ + movq %rbx,VMXCTX_GUEST_RBX(%rsp); \ + movq %rbp,VMXCTX_GUEST_RBP(%rsp); \ + movq %r10,VMXCTX_GUEST_R10(%rsp); \ + movq %r11,VMXCTX_GUEST_R11(%rsp); \ + movq %r12,VMXCTX_GUEST_R12(%rsp); \ + movq %r13,VMXCTX_GUEST_R13(%rsp); \ + movq %r14,VMXCTX_GUEST_R14(%rsp); \ + movq %r15,VMXCTX_GUEST_R15(%rsp); \ + movq %cr2,%rdi; \ + movq %rdi,VMXCTX_GUEST_CR2(%rsp); \ + movq %rsp,%rdi; + +/* * Assumes that %rdi holds a pointer to the 'vmxctx'. * * On "return" all registers are updated to reflect guest state. The two @@ -211,31 +234,55 @@ inst_error: * The VMCS-restored %rsp points to the struct vmxctx */ ALIGN_TEXT - .globl vmx_exit_guest -vmx_exit_guest: + .globl vmx_exit_guest_flush_rsb +vmx_exit_guest_flush_rsb: /* * Save guest state that is not automatically saved in the vmcs. */ - movq %rdi,VMXCTX_GUEST_RDI(%rsp) - movq %rsi,VMXCTX_GUEST_RSI(%rsp) - movq %rdx,VMXCTX_GUEST_RDX(%rsp) - movq %rcx,VMXCTX_GUEST_RCX(%rsp) - movq %r8,VMXCTX_GUEST_R8(%rsp) - movq %r9,VMXCTX_GUEST_R9(%rsp) - movq %rax,VMXCTX_GUEST_RAX(%rsp) - movq %rbx,VMXCTX_GUEST_RBX(%rsp) - movq %rbp,VMXCTX_GUEST_RBP(%rsp) - movq %r10,VMXCTX_GUEST_R10(%rsp) - movq %r11,VMXCTX_GUEST_R11(%rsp) - movq %r12,VMXCTX_GUEST_R12(%rsp) - movq %r13,VMXCTX_GUEST_R13(%rsp) - movq %r14,VMXCTX_GUEST_R14(%rsp) - movq %r15,VMXCTX_GUEST_R15(%rsp) + VMX_GUEST_SAVE - movq %cr2,%rdi - movq %rdi,VMXCTX_GUEST_CR2(%rsp) + /* + * Deactivate guest pmap from this cpu. + */ + movq VMXCTX_PMAP(%rdi), %r11 + movl PCPU(CPUID), %r10d + LK btrl %r10d, PM_ACTIVE(%r11) - movq %rsp,%rdi + VMX_HOST_RESTORE + + VMX_GUEST_CLOBBER + + /* + * To prevent malicious branch target predictions from + * affecting the host, overwrite all entries in the RSB upon + * exiting a guest. + */ + mov $16, %ecx /* 16 iterations, two calls per loop */ + mov %rsp, %rax +0: call 2f /* create an RSB entry. */ +1: pause + call 1b /* capture rogue speculation. */ +2: call 2f /* create an RSB entry. */ +1: pause + call 1b /* capture rogue speculation. */ +2: sub $1, %ecx + jnz 0b + mov %rax, %rsp + + /* + * This will return to the caller of 'vmx_enter_guest()' with a return + * value of VMX_GUEST_VMEXIT. + */ + movl $VMX_GUEST_VMEXIT, %eax + VLEAVE + ret + + .globl vmx_exit_guest +vmx_exit_guest: + /* + * Save guest state that is not automatically saved in the vmcs. + */ + VMX_GUEST_SAVE /* * Deactivate guest pmap from this cpu. From owner-svn-src-head@freebsd.org Mon Feb 12 14:47: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 A8BB5F206D3; Mon, 12 Feb 2018 14:47:14 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-lf0-f50.google.com (mail-lf0-f50.google.com [209.85.215.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 079B777909; Mon, 12 Feb 2018 14:47:13 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-lf0-f50.google.com with SMTP id c188so4864702lfc.11; Mon, 12 Feb 2018 06:47:13 -0800 (PST) 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=ucVJSM6UGyd9QQ4tiq2aYv33Vt0pf/utJtsQzKXFWfU=; b=s+4KP3n/tQzBHgVBRwJsYnOeuKfa+8GTZ03JoUXHhrCWy/a1iuicyozllxRT19BDW7 /5WOwmZv5ux8nmhf1Qf/yoApeg5caBC29kCD478SimKrkTAl32aXggXTA4/oxKV2ErGU VGucrHl+82Zzv09HhAgD97lzGup2+MOuw/zixiIlYozp/pH7EpH037t+960JJEVD5cdV DIligSGdJvjZfsWYzQNB42j/nvVM9H0m2C6mAVUidUPEMeMXbVRbnUGsMA3LgBesWmDT zUToQqP4yjiX4qOHxB10YMaG1nYWYIi3Erg8pi7EASvdqyoylohFqQJGhWWr17kSqkQc A+qw== X-Gm-Message-State: APf1xPBLdKBwVJC7FkoGKXaRB2htHh6yhHtSL0bVWCqVG/7ue2HioKpz f20bGQ7XxMs5w78XlSXgojzOE20B X-Google-Smtp-Source: AH8x22642EBYBvRDQoO2VUJoHgxgmMMdpkafvqFrn9RY9XomLkfkCx2eoSopdT4nuLKfgAscOdyLZw== X-Received: by 10.46.101.208 with SMTP id e77mr5074715ljf.66.1518446825562; Mon, 12 Feb 2018 06:47:05 -0800 (PST) Received: from mail-lf0-f51.google.com (mail-lf0-f51.google.com. [209.85.215.51]) by smtp.gmail.com with ESMTPSA id p189sm1724557lfe.64.2018.02.12.06.47.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Feb 2018 06:47:05 -0800 (PST) Received: by mail-lf0-f51.google.com with SMTP id t79so20779399lfe.3; Mon, 12 Feb 2018 06:47:04 -0800 (PST) X-Received: by 10.25.157.141 with SMTP id g135mr7124091lfe.142.1518446824160; Mon, 12 Feb 2018 06:47:04 -0800 (PST) MIME-Version: 1.0 Received: by 10.46.106.8 with HTTP; Mon, 12 Feb 2018 06:46:43 -0800 (PST) In-Reply-To: <201712211221.vBLCLZ5p017820@repo.freebsd.org> References: <201712211221.vBLCLZ5p017820@repo.freebsd.org> From: Kyle Evans Date: Mon, 12 Feb 2018 08:46:43 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r327058 - head/stand/efi/boot1 To: Michael Zhilin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, tsoome@freebsd.org, Allan Jude Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 14:47:14 -0000 On Thu, Dec 21, 2017 at 6:21 AM, Michael Zhilin wrote: > Author: mizhka > Date: Thu Dec 21 12:21:35 2017 > New Revision: 327058 > URL: https://svnweb.freebsd.org/changeset/base/327058 > > Log: > [boot/efi] scan all display modes rather than sequential try-fail way > > This patch allows to scan all display modes in boot1 as loader does. > > Before system tried to select optimal display mode by sequential scan of > modes and if error then stop scanning. This way is not good, because > if mode N is not present, mode N+1 may exist. > > In loader we use conout->Mode->MaxMode to identify maximum number of modes. > This commit is to use same way in boot1 as in loader. > > Reported by: Andrey Pustovetov > Reviewed by: tsoome > Differential Revision: https://reviews.freebsd.org/D13541 > HI, Just FYI- we've had several reports of this doing the wrong thing for many people, most recently by Allan yesterday (IIRC). I'm going to avoid MFC'ing it, I think we should either back this out or figure out where it's going wrong sooner rather than later. =( Thanks, Kyle Evans From owner-svn-src-head@freebsd.org Mon Feb 12 14:48: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 55629F20829; Mon, 12 Feb 2018 14:48: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 F149C77B01; Mon, 12 Feb 2018 14:48: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 E7D56134BF; Mon, 12 Feb 2018 14:48: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 w1CEm55M082646; Mon, 12 Feb 2018 14:48:05 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CEm50c082642; Mon, 12 Feb 2018 14:48:05 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802121448.w1CEm50c082642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Feb 2018 14:48:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329163 - in head/sys: mips/include powerpc/include riscv/include sparc64/include X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: mips/include powerpc/include riscv/include sparc64/include X-SVN-Commit-Revision: 329163 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 14:48:06 -0000 Author: imp Date: Mon Feb 12 14:48:05 2018 New Revision: 329163 URL: https://svnweb.freebsd.org/changeset/base/329163 Log: Use standard pattern for stdargs.h We don't support older compilers. Most of the code in these files is for pre-3.0 gcc, which is at least 15 years obsolete. Move to using phk's sys/_stdargs.h for all these platforms. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D14323 Modified: head/sys/mips/include/stdarg.h head/sys/powerpc/include/stdarg.h head/sys/riscv/include/stdarg.h head/sys/sparc64/include/stdarg.h Modified: head/sys/mips/include/stdarg.h ============================================================================== --- head/sys/mips/include/stdarg.h Mon Feb 12 14:45:27 2018 (r329162) +++ head/sys/mips/include/stdarg.h Mon Feb 12 14:48:05 2018 (r329163) @@ -1,144 +1,39 @@ -/* - * JNPR: stdarg.h,v 1.3 2006/09/15 12:52:34 katta +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2017 Poul-Henning Kamp. 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. + * * $FreeBSD$ */ #ifndef _MACHINE_STDARG_H_ #define _MACHINE_STDARG_H_ -#include -#include +#include -#if __GNUC__ >= 3 - -#ifndef _VA_LIST_DECLARED -#define _VA_LIST_DECLARED -typedef __va_list va_list; +#ifndef va_start + #error this file needs to be ported to your compiler #endif -#define va_start(v,l) __builtin_va_start((v),l) -#define va_end __builtin_va_end -#define va_arg __builtin_va_arg -#define va_copy __builtin_va_copy -#else /* __GNUC__ */ - - -/* ---------------------------------------- */ -/* VARARGS for MIPS/GNU CC */ -/* ---------------------------------------- */ - -#include - -/* These macros implement varargs for GNU C--either traditional or ANSI. */ - -/* Define __gnuc_va_list. */ - -#ifndef __GNUC_VA_LIST -#define __GNUC_VA_LIST - -typedef char * __gnuc_va_list; -typedef __gnuc_va_list va_list; - -#endif /* ! __GNUC_VA_LIST */ - -/* If this is for internal libc use, don't define anything but - __gnuc_va_list. */ - -#ifndef _VA_MIPS_H_ENUM -#define _VA_MIPS_H_ENUM -enum { - __no_type_class = -1, - __void_type_class, - __integer_type_class, - __char_type_class, - __enumeral_type_class, - __boolean_type_class, - __pointer_type_class, - __reference_type_class, - __offset_type_class, - __real_type_class, - __complex_type_class, - __function_type_class, - __method_type_class, - __record_type_class, - __union_type_class, - __array_type_class, - __string_type_class, - __set_type_class, - __file_type_class, - __lang_type_class -}; -#endif - -/* In GCC version 2, we want an ellipsis at the end of the declaration - of the argument list. GCC version 1 can't parse it. */ - -#if __GNUC__ > 1 -#define __va_ellipsis ... -#else -#define __va_ellipsis -#endif - - -#define va_start(__AP, __LASTARG) \ - (__AP = (__gnuc_va_list) __builtin_next_arg (__LASTARG)) - -#define va_end(__AP) ((void)0) - - -/* We cast to void * and then to TYPE * because this avoids - a warning about increasing the alignment requirement. */ -/* The __mips64 cases are reversed from the 32 bit cases, because the standard - 32 bit calling convention left-aligns all parameters smaller than a word, - whereas the __mips64 calling convention does not (and hence they are - right aligned). */ - -#ifdef __mips64 - -#define __va_rounded_size(__TYPE) (((sizeof (__TYPE) + 8 - 1) / 8) * 8) - -#define __va_reg_size 8 - -#if defined(__MIPSEB__) || (BYTE_ORDER == BIG_ENDIAN) -#define va_arg(__AP, __type) \ - ((__type *) (void *) (__AP = (char *) \ - ((((__PTRDIFF_TYPE__)__AP + 8 - 1) & -8) \ - + __va_rounded_size (__type))))[-1] -#else /* ! __MIPSEB__ && !BYTE_ORDER == BIG_ENDIAN */ -#define va_arg(__AP, __type) \ - ((__AP = (char *) ((((__PTRDIFF_TYPE__)__AP + 8 - 1) & -8) \ - + __va_rounded_size (__type))), \ - *(__type *) (void *) (__AP - __va_rounded_size (__type))) -#endif /* ! __MIPSEB__ && !BYTE_ORDER == BIG_ENDIAN */ - -#else /* ! __mips64 */ - -#define __va_rounded_size(__TYPE) \ - (((sizeof (__TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) - -#define __va_reg_size 4 - -#if defined(__MIPSEB__) || (BYTE_ORDER == BIG_ENDIAN) -/* For big-endian machines. */ -#define va_arg(__AP, __type) \ - ((__AP = (char *) ((__alignof__ (__type) > 4 \ - ? ((__PTRDIFF_TYPE__)__AP + 8 - 1) & -8 \ - : ((__PTRDIFF_TYPE__)__AP + 4 - 1) & -4) \ - + __va_rounded_size (__type))), \ - *(__type *) (void *) (__AP - __va_rounded_size (__type))) -#else /* ! __MIPSEB__ && !BYTE_ORDER == BIG_ENDIAN */ -/* For little-endian machines. */ -#define va_arg(__AP, __type) \ - ((__type *) (void *) (__AP = (char *) ((__alignof__(__type) > 4 \ - ? ((__PTRDIFF_TYPE__)__AP + 8 - 1) & -8 \ - : ((__PTRDIFF_TYPE__)__AP + 4 - 1) & -4) \ - + __va_rounded_size(__type))))[-1] -#endif /* ! __MIPSEB__ && !BYTE_ORDER == BIG_ENDIAN */ -#endif /* ! __mips64 */ - -/* Copy __gnuc_va_list into another variable of this type. */ -#define __va_copy(dest, src) (dest) = (src) -#define va_copy(dest, src) (dest) = (src) - -#endif /* __GNUC__ */ -#endif /* _MACHINE_STDARG_H_ */ +#endif /* !_MACHINE_STDARG_H_ */ Modified: head/sys/powerpc/include/stdarg.h ============================================================================== --- head/sys/powerpc/include/stdarg.h Mon Feb 12 14:45:27 2018 (r329162) +++ head/sys/powerpc/include/stdarg.h Mon Feb 12 14:48:05 2018 (r329163) @@ -1,8 +1,7 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2002 David E. O'Brien. All rights reserved. - * Copyright (c) 2000 Tsubai Masanari. All rights reserved. + * Copyright (c) 2017 Poul-Henning Kamp. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -12,141 +11,29 @@ * 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. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. * - * 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. + * 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. * - * $NetBSD: stdarg.h,v 1.5 2000/02/27 17:50:21 tsubai Exp $ * $FreeBSD$ */ #ifndef _MACHINE_STDARG_H_ #define _MACHINE_STDARG_H_ -#include -#include +#include -#ifndef _VA_LIST_DECLARED -#define _VA_LIST_DECLARED -typedef __va_list va_list; +#ifndef va_start + #error this file needs to be ported to your compiler #endif -#if defined(__GNUCLIKE_BUILTIN_STDARG) - -#define va_start(ap, last) \ - __builtin_va_start((ap), (last)) - -#define va_arg(ap, type) \ - __builtin_va_arg((ap), type) - -#if __ISO_C_VISIBLE >= 1999 -#define va_copy(dest, src) \ - __builtin_va_copy((dest), (src)) - -#define __va_copy(dest, src) \ - va_copy((dest), (src)) -#endif - -#define va_end(ap) \ - __builtin_va_end(ap) - -#else /* !__GNUCLIKE_BUILTIN_STDARG */ - -#ifdef __lint__ - -#define va_start(ap, last) ((ap) = *(va_list *)0) -#define va_arg(ap, type) (*(type *)(void *)&(ap)) - -#else - -#if defined(__GNUC_VA_LIST_COMPATIBILITY) -#define va_start(ap, last) \ - (__builtin_next_arg(last), \ - __builtin_memcpy((void *)&(ap), __builtin_saveregs (), \ - sizeof(__gnuc_va_list))) -#else -#define va_start(ap, last) \ - (__builtin_next_arg(last), \ - (ap).__stack = __va_stack_args, \ - (ap).__base = __va_reg_args, \ - (ap).__gpr = __va_first_gpr, \ - (ap).__fpr = __va_first_fpr) -#endif - -#define __va_first_gpr (__builtin_args_info(0)) -#define __va_first_fpr (__builtin_args_info(1) - 32 - 1) -#define __va_stack_args \ - ((char *)__builtin_saveregs() + \ - (__va_first_gpr >= 8 ? __va_first_gpr - 8 : 0) * sizeof(int)) -#define __va_reg_args \ - ((char *)__builtin_frame_address(0) + __builtin_args_info(4)) - -#define __INTEGER_TYPE_CLASS 1 -#define __REAL_TYPE_CLASS 8 -#define __RECORD_TYPE_CLASS 12 - -#define __va_longlong(type) \ - (__builtin_classify_type(*(type *)0) == __INTEGER_TYPE_CLASS && \ - sizeof(type) == 8) - -#define __va_double(type) \ - (__builtin_classify_type(*(type *)0) == __REAL_TYPE_CLASS) - -#define __va_struct(type) \ - (__builtin_classify_type(*(type *)0) >= __RECORD_TYPE_CLASS) - -#define __va_size(type) \ - ((sizeof(type) + sizeof(int) - 1) / sizeof(int) * sizeof(int)) - -#define __va_savedgpr(ap, type) \ - ((ap).__base + (ap).__gpr * sizeof(int) - sizeof(type)) - -#define __va_savedfpr(ap, type) \ - ((ap).__base + 8 * sizeof(int) + (ap).__fpr * sizeof(double) - \ - sizeof(type)) - -#define __va_stack(ap, type) \ - ((ap).__stack += __va_size(type) + \ - (__va_longlong(type) ? (int)(ap).__stack & 4 : 0), \ - (ap).__stack - sizeof(type)) - -#define __va_gpr(ap, type) \ - ((ap).__gpr += __va_size(type) / sizeof(int) + \ - (__va_longlong(type) ? (ap).__gpr & 1 : 0), \ - (ap).__gpr <= 8 ? __va_savedgpr(ap, type) : __va_stack(ap, type)) - -#define __va_fpr(ap, type) \ - ((ap).__fpr++, \ - (ap).__fpr <= 8 ? __va_savedfpr(ap, type) : __va_stack(ap, type)) - -#define va_arg(ap, type) \ - (*(type *)(__va_struct(type) ? (*(void **)__va_gpr(ap, void *)) : \ - __va_double(type) ? __va_fpr(ap, type) : \ - __va_gpr(ap, type))) - -#endif /* __lint__ */ - -#define va_end(ap) - -#if __ISO_C_VISIBLE >= 1999 -#if !defined(_ANSI_SOURCE) && \ - (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE) || \ - defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0) >= 199901L) -#define va_copy(dest, src) \ - ((dest) = (src)) -#endif -#endif - -#endif /* __GNUCLIKE_BUILTIN_STDARG */ - -#endif /* _MACHINE_STDARG_H_ */ +#endif /* !_MACHINE_STDARG_H_ */ Modified: head/sys/riscv/include/stdarg.h ============================================================================== --- head/sys/riscv/include/stdarg.h Mon Feb 12 14:45:27 2018 (r329162) +++ head/sys/riscv/include/stdarg.h Mon Feb 12 14:48:05 2018 (r329163) @@ -1,8 +1,8 @@ /*- - * Copyright (c) 2002 David E. O'Brien. All rights reserved. - * Copyright (c) 1991, 1993 - * The Regents of the University of California. All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause * + * Copyright (c) 2017 Poul-Henning Kamp. All rights reserved. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -11,14 +11,11 @@ * 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 + * 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 REGENTS OR CONTRIBUTORS BE LIABLE + * 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) @@ -27,53 +24,16 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)stdarg.h 8.1 (Berkeley) 6/10/93 * $FreeBSD$ */ #ifndef _MACHINE_STDARG_H_ #define _MACHINE_STDARG_H_ -#include -#include +#include -#ifndef _VA_LIST_DECLARED -#define _VA_LIST_DECLARED -typedef __va_list va_list; +#ifndef va_start + #error this file needs to be ported to your compiler #endif - -#ifdef __GNUCLIKE_BUILTIN_STDARG - -#define va_start(ap, last) \ - __builtin_va_start((ap), (last)) - -#define va_arg(ap, type) \ - __builtin_va_arg((ap), type) - -#if __ISO_C_VISIBLE >= 1999 -#define va_copy(dest, src) \ - __builtin_va_copy((dest), (src)) -#endif - -#define va_end(ap) \ - __builtin_va_end(ap) - -#elif defined(lint) -/* Provide a fake implementation for lint's benefit */ -#define __va_size(type) \ - (((sizeof(type) + sizeof(long) - 1) / sizeof(long)) * sizeof(long)) -#define va_start(ap, last) \ - ((ap) = (va_list)&(last) + __va_size(last)) -#define va_copy(dst, src) \ - ((dst) = (src)) -#define va_arg(ap, type) \ - (*(type *)((ap) += __va_size(type), (ap) - __va_size(type))) -#define va_end(ap) - -#else /* !__GNUCLIKE_BUILTIN_STDARG */ - -#error no support for your compiler - -#endif /* __GNUCLIKE_BUILTIN_STDARG */ #endif /* !_MACHINE_STDARG_H_ */ Modified: head/sys/sparc64/include/stdarg.h ============================================================================== --- head/sys/sparc64/include/stdarg.h Mon Feb 12 14:45:27 2018 (r329162) +++ head/sys/sparc64/include/stdarg.h Mon Feb 12 14:48:05 2018 (r329163) @@ -1,19 +1,8 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2002 David E. O'Brien. All rights reserved. - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. + * Copyright (c) 2017 Poul-Henning Kamp. All rights reserved. * - * This software was developed by the Computer Systems Engineering group - * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and - * contributed to Berkeley. - * - * All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Lawrence Berkeley Laboratory. - * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -23,10 +12,10 @@ * 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 REGENTS AND CONTRIBUTORS ``AS IS'' AND + * 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 REGENTS OR CONTRIBUTORS BE LIABLE + * 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) @@ -35,69 +24,16 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)stdarg.h 8.2 (Berkeley) 9/27/93 - * $NetBSD: stdarg.h,v 1.11 2000/07/23 21:36:56 mycroft Exp $ * $FreeBSD$ */ #ifndef _MACHINE_STDARG_H_ #define _MACHINE_STDARG_H_ -#include -#include +#include -#ifndef _VA_LIST_DECLARED -#define _VA_LIST_DECLARED -typedef __va_list va_list; +#ifndef va_start + #error this file needs to be ported to your compiler #endif - -#ifdef __GNUCLIKE_BUILTIN_STDARG - -#define va_start(ap, last) \ - __builtin_va_start((ap), (last)) - -#define va_arg(ap, type) \ - __builtin_va_arg((ap), type) - -#if __ISO_C_VISIBLE >= 1999 -#define va_copy(dest, src) \ - __builtin_va_copy((dest), (src)) -#endif - -#define va_end(ap) \ - __builtin_va_end(ap) - -#else /* ! __GNUCLIKE_BUILTIN_STDARG */ - -#if !defined(__GNUCLIKE_BUILTIN_NEXT_ARG) && !defined(lint) -#error no support for your compiler -#endif - -#define va_start(ap, last) \ - (__builtin_next_arg(last), (ap) = (va_list)__builtin_saveregs()) - -#define va_end(ap) - -#define __va_arg8(ap, type) \ - (*(type *)(void *)((ap) += 8, (ap) - 8)) -#define __va_arg16(ap, type) \ - (*(type *)(void *)((ap) = (va_list)(((unsigned long)(ap) + 31) & -16),\ - (ap) - 16)) -#define __va_int(ap, type) \ - (*(type *)(void *)((ap) += 8, (ap) - sizeof(type))) - -#define __REAL_TYPE_CLASS 8 -#define __RECORD_TYPE_CLASS 12 -#define va_arg(ap, type) \ - (__builtin_classify_type(*(type *)0) == __REAL_TYPE_CLASS ? \ - (__alignof__(type) == 16 ? __va_arg16(ap, type) : \ - __va_arg8(ap, type)) : \ - (__builtin_classify_type(*(type *)0) < __RECORD_TYPE_CLASS ? \ - __va_int(ap, type) : \ - (sizeof(type) <= 8 ? __va_arg8(ap, type) : \ - (sizeof(type) <= 16 ? __va_arg16(ap, type) : \ - *__va_arg8(ap, type *))))) - -#endif /* __GNUCLIKE_BUILTIN_STDARG */ #endif /* !_MACHINE_STDARG_H_ */ From owner-svn-src-head@freebsd.org Mon Feb 12 14:48: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 4C5B5F2088A; Mon, 12 Feb 2018 14:48: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 E6AC877BE5; Mon, 12 Feb 2018 14:48: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 E1169134C0; Mon, 12 Feb 2018 14:48: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 w1CEmErM082702; Mon, 12 Feb 2018 14:48:14 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CEmEUX082701; Mon, 12 Feb 2018 14:48:14 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802121448.w1CEmEUX082701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Feb 2018 14:48:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329164 - in head: include sys/amd64/include sys/i386/include sys/mips/include sys/powerpc/include sys/sparc64/include X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: include sys/amd64/include sys/i386/include sys/mips/include sys/powerpc/include sys/sparc64/include X-SVN-Commit-Revision: 329164 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 14:48:15 -0000 Author: imp Date: Mon Feb 12 14:48:14 2018 New Revision: 329164 URL: https://svnweb.freebsd.org/changeset/base/329164 Log: We don't support gcc < 4.2.1, so varargs.h now is just #error always. Unifdef for versions prior to 4.2.1 and remove now-unused header files. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D14323 Deleted: head/sys/amd64/include/varargs.h head/sys/i386/include/varargs.h head/sys/mips/include/varargs.h head/sys/powerpc/include/varargs.h head/sys/sparc64/include/varargs.h Modified: head/include/varargs.h Modified: head/include/varargs.h ============================================================================== --- head/include/varargs.h Mon Feb 12 14:48:05 2018 (r329163) +++ head/include/varargs.h Mon Feb 12 14:48:14 2018 (r329164) @@ -31,15 +31,7 @@ #ifndef _VARARGS_H_ #define _VARARGS_H_ -#if defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ > 2 || __GNUC__ >= 4) - -#error " is obsolete with this version of GCC." +#error " is obsolete." #error "Change your code to use instead." - -#else /* ! __GNUC__ post GCC 3.3 */ - -#include - -#endif /* __GNUC__ post GCC 3.3 */ #endif /* !_VARARGS_H_ */ From owner-svn-src-head@freebsd.org Mon Feb 12 14:48: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 15412F208D6; Mon, 12 Feb 2018 14:48:22 +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 97D6777C06; Mon, 12 Feb 2018 14:48: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 90898134C1; Mon, 12 Feb 2018 14:48: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 w1CEmLPD082765; Mon, 12 Feb 2018 14:48:21 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CEmKuj082757; Mon, 12 Feb 2018 14:48:20 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802121448.w1CEmKuj082757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Feb 2018 14:48:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329165 - in head/sys: arm/include arm64/include mips/include powerpc/include riscv/include sparc64/include sys x86/include X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: arm/include arm64/include mips/include powerpc/include riscv/include sparc64/include sys x86/include X-SVN-Commit-Revision: 329165 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 14:48:22 -0000 Author: imp Date: Mon Feb 12 14:48:20 2018 New Revision: 329165 URL: https://svnweb.freebsd.org/changeset/base/329165 Log: Move __va_list and related defines to sys/sys/_types.h __va_list and related defines are identical in all the ARCH/include/_types.h files. Move them to sys/sys/_types.h Sponsored by: Netflix Modified: head/sys/arm/include/_types.h head/sys/arm64/include/_types.h head/sys/mips/include/_types.h head/sys/powerpc/include/_types.h head/sys/riscv/include/_types.h head/sys/sparc64/include/_types.h head/sys/sys/_types.h head/sys/x86/include/_types.h Modified: head/sys/arm/include/_types.h ============================================================================== --- head/sys/arm/include/_types.h Mon Feb 12 14:48:14 2018 (r329164) +++ head/sys/arm/include/_types.h Mon Feb 12 14:48:20 2018 (r329165) @@ -109,18 +109,4 @@ typedef unsigned int ___wchar_t; #define __WCHAR_MIN 0 /* min value for a wchar_t */ #define __WCHAR_MAX __UINT_MAX /* max value for a wchar_t */ -/* - * Unusual type definitions. - */ -#ifdef __GNUCLIKE_BUILTIN_VARARGS -typedef __builtin_va_list __va_list; /* internally known to gcc */ -#else -typedef char * __va_list; -#endif /* __GNUCLIKE_BUILTIN_VARARGS */ -#if defined(__GNUCLIKE_BUILTIN_VAALIST) && !defined(__GNUC_VA_LIST) \ - && !defined(__NO_GNUC_VA_LIST) -#define __GNUC_VA_LIST -typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/ -#endif - #endif /* !_MACHINE__TYPES_H_ */ Modified: head/sys/arm64/include/_types.h ============================================================================== --- head/sys/arm64/include/_types.h Mon Feb 12 14:48:14 2018 (r329164) +++ head/sys/arm64/include/_types.h Mon Feb 12 14:48:20 2018 (r329165) @@ -95,18 +95,4 @@ typedef unsigned int ___wchar_t; #define __WCHAR_MIN 0 /* min value for a wchar_t */ #define __WCHAR_MAX __UINT_MAX /* max value for a wchar_t */ -/* - * Unusual type definitions. - */ -#ifdef __GNUCLIKE_BUILTIN_VARARGS -typedef __builtin_va_list __va_list; /* internally known to gcc */ -#else -typedef char * __va_list; -#endif /* __GNUCLIKE_BUILTIN_VARARGS */ -#if defined(__GNUCLIKE_BUILTIN_VAALIST) && !defined(__GNUC_VA_LIST) \ - && !defined(__NO_GNUC_VA_LIST) -#define __GNUC_VA_LIST -typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/ -#endif - #endif /* !_MACHINE__TYPES_H_ */ Modified: head/sys/mips/include/_types.h ============================================================================== --- head/sys/mips/include/_types.h Mon Feb 12 14:48:14 2018 (r329164) +++ head/sys/mips/include/_types.h Mon Feb 12 14:48:20 2018 (r329165) @@ -150,18 +150,4 @@ typedef int ___wchar_t; #define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ #define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */ -/* - * Unusual type definitions. - */ -#ifdef __GNUCLIKE_BUILTIN_VARARGS -typedef __builtin_va_list __va_list; /* internally known to gcc */ -#else -typedef char * __va_list; -#endif /* __GNUCLIKE_BUILTIN_VARARGS */ -#if defined(__GNUC_VA_LIST_COMPATIBILITY) && !defined(__GNUC_VA_LIST) \ - && !defined(__NO_GNUC_VA_LIST) -#define __GNUC_VA_LIST -typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/ -#endif - #endif /* !_MACHINE__TYPES_H_ */ Modified: head/sys/powerpc/include/_types.h ============================================================================== --- head/sys/powerpc/include/_types.h Mon Feb 12 14:48:14 2018 (r329164) +++ head/sys/powerpc/include/_types.h Mon Feb 12 14:48:20 2018 (r329165) @@ -144,24 +144,4 @@ typedef int ___wchar_t; #define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ #define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */ -/* - * Unusual type definitions. - */ -#if defined(__GNUCLIKE_BUILTIN_VARARGS) -typedef __builtin_va_list __va_list; /* internally known to gcc */ -#else -typedef struct { - char __gpr; - char __fpr; - char __pad[2]; - char *__stack; - char *__base; -} __va_list; -#endif /* post GCC 2.95 */ -#if defined(__GNUC_VA_LIST_COMPATIBILITY) && !defined(__GNUC_VA_LIST) \ - && !defined(__NO_GNUC_VA_LIST) -#define __GNUC_VA_LIST -typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/ -#endif - #endif /* !_MACHINE__TYPES_H_ */ Modified: head/sys/riscv/include/_types.h ============================================================================== --- head/sys/riscv/include/_types.h Mon Feb 12 14:48:14 2018 (r329164) +++ head/sys/riscv/include/_types.h Mon Feb 12 14:48:20 2018 (r329165) @@ -95,18 +95,4 @@ typedef int ___wchar_t; #define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ #define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */ -/* - * Unusual type definitions. - */ -#ifdef __GNUCLIKE_BUILTIN_VARARGS -typedef __builtin_va_list __va_list; /* internally known to gcc */ -#else -typedef char * __va_list; -#endif /* __GNUCLIKE_BUILTIN_VARARGS */ -#if defined(__GNUCLIKE_BUILTIN_VAALIST) && !defined(__GNUC_VA_LIST) \ - && !defined(__NO_GNUC_VA_LIST) -#define __GNUC_VA_LIST -typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/ -#endif - #endif /* !_MACHINE__TYPES_H_ */ Modified: head/sys/sparc64/include/_types.h ============================================================================== --- head/sys/sparc64/include/_types.h Mon Feb 12 14:48:14 2018 (r329164) +++ head/sys/sparc64/include/_types.h Mon Feb 12 14:48:20 2018 (r329165) @@ -97,18 +97,4 @@ typedef int ___wchar_t; #define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ #define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */ -/* - * Unusual type definitions. - */ -#ifdef __GNUCLIKE_BUILTIN_VARARGS -typedef __builtin_va_list __va_list; /* internally known to gcc */ -#else -typedef char * __va_list; -#endif /* __GNUCLIKE_BUILTIN_VARARGS */ -#if defined(__GNUCLIKE_BUILTIN_VAALIST) && !defined(__GNUC_VA_LIST) \ - && !defined(__NO_GNUC_VA_LIST) -#define __GNUC_VA_LIST -typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/ -#endif - #endif /* !_MACHINE__TYPES_H_ */ Modified: head/sys/sys/_types.h ============================================================================== --- head/sys/sys/_types.h Mon Feb 12 14:48:14 2018 (r329164) +++ head/sys/sys/_types.h Mon Feb 12 14:48:20 2018 (r329165) @@ -123,6 +123,21 @@ typedef union { typedef __uintmax_t __rman_res_t; /* + * Types for varargs. These are all provided by builtin types these + * days, so centralize their definition. + */ +#ifdef __GNUCLIKE_BUILTIN_VARARGS +typedef __builtin_va_list __va_list; /* internally known to gcc */ +#else +#error "No support for your compiler for stdargs" +#endif +#if defined(__GNUC_VA_LIST_COMPATIBILITY) && !defined(__GNUC_VA_LIST) \ + && !defined(__NO_GNUC_VA_LIST) +#define __GNUC_VA_LIST +typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/ +#endif + +/* * When the following macro is defined, the system uses 64-bit inode numbers. * Programs can use this to avoid including , with its associated * namespace pollution. Modified: head/sys/x86/include/_types.h ============================================================================== --- head/sys/x86/include/_types.h Mon Feb 12 14:48:14 2018 (r329164) +++ head/sys/x86/include/_types.h Mon Feb 12 14:48:20 2018 (r329165) @@ -143,26 +143,4 @@ typedef int ___wchar_t; #define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ #define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */ -/* - * Unusual type definitions. - */ -#ifdef __GNUCLIKE_BUILTIN_VARARGS -typedef __builtin_va_list __va_list; /* internally known to gcc */ -#else -#ifdef __LP64__ -struct __s_va_list { - __uint32_t _pad1[2]; /* gp_offset, fp_offset */ - __uint64_t _pad2[2]; /* overflow_arg_area, reg_save_area */ -}; -typedef struct __s_va_list __va_list; -#else -typedef char * __va_list; -#endif -#endif -#if defined(__GNUC_VA_LIST_COMPATIBILITY) && !defined(__GNUC_VA_LIST) \ - && !defined(__NO_GNUC_VA_LIST) -#define __GNUC_VA_LIST -typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/ -#endif - #endif /* !_MACHINE__TYPES_H_ */ From owner-svn-src-head@freebsd.org Mon Feb 12 15: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 F0E1CF00A59; Mon, 12 Feb 2018 15:27:42 +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 39900798DC; Mon, 12 Feb 2018 15:27:42 +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 w1CFRe53044501; Mon, 12 Feb 2018 07:27:40 -0800 (PST) (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 w1CFRe3K044500; Mon, 12 Feb 2018 07:27:40 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201802121527.w1CFRe3K044500@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r329162 - in head/sys/amd64/vmm: amd intel In-Reply-To: <201802121445.w1CEjR3n082516@repo.freebsd.org> To: Tycho Nightingale Date: Mon, 12 Feb 2018 07:27:40 -0800 (PST) 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.25 Precedence: list List-Id: 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, 12 Feb 2018 15:27:43 -0000 > Author: tychon > Date: Mon Feb 12 14:45:27 2018 > New Revision: 329162 > URL: https://svnweb.freebsd.org/changeset/base/329162 > > Log: > Provide further mitigation against CVE-2017-5715 by flushing the > return stack buffer (RSB) upon returning from the guest. > > This was inspired by this linux commit: > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/x86/kvm?id=117cc7a908c83697b0b737d15ae1eb5943afe35b > > Reviewed by: grehan > Sponsored by: Dell EMC Isilon > Differential Revision: https://reviews.freebsd.org/D14272 Plans to MFC this? It would be good to have as many meltdown/spectre patches as possible in the upcomming 11.2 release. > Modified: > head/sys/amd64/vmm/amd/svm_support.S > head/sys/amd64/vmm/intel/vmcs.c > head/sys/amd64/vmm/intel/vmx.h > head/sys/amd64/vmm/intel/vmx_support.S > > Modified: head/sys/amd64/vmm/amd/svm_support.S > ============================================================================== > --- head/sys/amd64/vmm/amd/svm_support.S Mon Feb 12 14:44:21 2018 (r329161) > +++ head/sys/amd64/vmm/amd/svm_support.S Mon Feb 12 14:45:27 2018 (r329162) > @@ -113,6 +113,23 @@ ENTRY(svm_launch) > movq %rdi, SCTX_RDI(%rax) > movq %rsi, SCTX_RSI(%rax) > > + /* > + * To prevent malicious branch target predictions from > + * affecting the host, overwrite all entries in the RSB upon > + * exiting a guest. > + */ > + mov $16, %ecx /* 16 iterations, two calls per loop */ > + mov %rsp, %rax > +0: call 2f /* create an RSB entry. */ > +1: pause > + call 1b /* capture rogue speculation. */ > +2: call 2f /* create an RSB entry. */ > +1: pause > + call 1b /* capture rogue speculation. */ > +2: sub $1, %ecx > + jnz 0b > + mov %rax, %rsp > + > /* Restore host state */ > pop %r15 > pop %r14 > > Modified: head/sys/amd64/vmm/intel/vmcs.c > ============================================================================== > --- head/sys/amd64/vmm/intel/vmcs.c Mon Feb 12 14:44:21 2018 (r329161) > +++ head/sys/amd64/vmm/intel/vmcs.c Mon Feb 12 14:45:27 2018 (r329162) > @@ -34,6 +34,7 @@ > __FBSDID("$FreeBSD$"); > > #include > +#include > #include > #include > > @@ -52,6 +53,12 @@ __FBSDID("$FreeBSD$"); > #include > #endif > > +SYSCTL_DECL(_hw_vmm_vmx); > + > +static int no_flush_rsb; > +SYSCTL_INT(_hw_vmm_vmx, OID_AUTO, no_flush_rsb, CTLFLAG_RW, > + &no_flush_rsb, 0, "Do not flush RSB upon vmexit"); > + > static uint64_t > vmcs_fix_regval(uint32_t encoding, uint64_t val) > { > @@ -403,8 +410,15 @@ vmcs_init(struct vmcs *vmcs) > goto done; > > /* instruction pointer */ > - if ((error = vmwrite(VMCS_HOST_RIP, (u_long)vmx_exit_guest)) != 0) > - goto done; > + if (no_flush_rsb) { > + if ((error = vmwrite(VMCS_HOST_RIP, > + (u_long)vmx_exit_guest)) != 0) > + goto done; > + } else { > + if ((error = vmwrite(VMCS_HOST_RIP, > + (u_long)vmx_exit_guest_flush_rsb)) != 0) > + goto done; > + } > > /* link pointer */ > if ((error = vmwrite(VMCS_LINK_POINTER, ~0)) != 0) > > Modified: head/sys/amd64/vmm/intel/vmx.h > ============================================================================== > --- head/sys/amd64/vmm/intel/vmx.h Mon Feb 12 14:44:21 2018 (r329161) > +++ head/sys/amd64/vmm/intel/vmx.h Mon Feb 12 14:45:27 2018 (r329162) > @@ -150,5 +150,6 @@ u_long vmx_fix_cr4(u_long cr4); > int vmx_set_tsc_offset(struct vmx *vmx, int vcpu, uint64_t offset); > > extern char vmx_exit_guest[]; > +extern char vmx_exit_guest_flush_rsb[]; > > #endif > > Modified: head/sys/amd64/vmm/intel/vmx_support.S > ============================================================================== > --- head/sys/amd64/vmm/intel/vmx_support.S Mon Feb 12 14:44:21 2018 (r329161) > +++ head/sys/amd64/vmm/intel/vmx_support.S Mon Feb 12 14:45:27 2018 (r329162) > @@ -42,6 +42,29 @@ > #define VLEAVE pop %rbp > > /* > + * Save the guest context. > + */ > +#define VMX_GUEST_SAVE \ > + movq %rdi,VMXCTX_GUEST_RDI(%rsp); \ > + movq %rsi,VMXCTX_GUEST_RSI(%rsp); \ > + movq %rdx,VMXCTX_GUEST_RDX(%rsp); \ > + movq %rcx,VMXCTX_GUEST_RCX(%rsp); \ > + movq %r8,VMXCTX_GUEST_R8(%rsp); \ > + movq %r9,VMXCTX_GUEST_R9(%rsp); \ > + movq %rax,VMXCTX_GUEST_RAX(%rsp); \ > + movq %rbx,VMXCTX_GUEST_RBX(%rsp); \ > + movq %rbp,VMXCTX_GUEST_RBP(%rsp); \ > + movq %r10,VMXCTX_GUEST_R10(%rsp); \ > + movq %r11,VMXCTX_GUEST_R11(%rsp); \ > + movq %r12,VMXCTX_GUEST_R12(%rsp); \ > + movq %r13,VMXCTX_GUEST_R13(%rsp); \ > + movq %r14,VMXCTX_GUEST_R14(%rsp); \ > + movq %r15,VMXCTX_GUEST_R15(%rsp); \ > + movq %cr2,%rdi; \ > + movq %rdi,VMXCTX_GUEST_CR2(%rsp); \ > + movq %rsp,%rdi; > + > +/* > * Assumes that %rdi holds a pointer to the 'vmxctx'. > * > * On "return" all registers are updated to reflect guest state. The two > @@ -211,31 +234,55 @@ inst_error: > * The VMCS-restored %rsp points to the struct vmxctx > */ > ALIGN_TEXT > - .globl vmx_exit_guest > -vmx_exit_guest: > + .globl vmx_exit_guest_flush_rsb > +vmx_exit_guest_flush_rsb: > /* > * Save guest state that is not automatically saved in the vmcs. > */ > - movq %rdi,VMXCTX_GUEST_RDI(%rsp) > - movq %rsi,VMXCTX_GUEST_RSI(%rsp) > - movq %rdx,VMXCTX_GUEST_RDX(%rsp) > - movq %rcx,VMXCTX_GUEST_RCX(%rsp) > - movq %r8,VMXCTX_GUEST_R8(%rsp) > - movq %r9,VMXCTX_GUEST_R9(%rsp) > - movq %rax,VMXCTX_GUEST_RAX(%rsp) > - movq %rbx,VMXCTX_GUEST_RBX(%rsp) > - movq %rbp,VMXCTX_GUEST_RBP(%rsp) > - movq %r10,VMXCTX_GUEST_R10(%rsp) > - movq %r11,VMXCTX_GUEST_R11(%rsp) > - movq %r12,VMXCTX_GUEST_R12(%rsp) > - movq %r13,VMXCTX_GUEST_R13(%rsp) > - movq %r14,VMXCTX_GUEST_R14(%rsp) > - movq %r15,VMXCTX_GUEST_R15(%rsp) > + VMX_GUEST_SAVE > > - movq %cr2,%rdi > - movq %rdi,VMXCTX_GUEST_CR2(%rsp) > + /* > + * Deactivate guest pmap from this cpu. > + */ > + movq VMXCTX_PMAP(%rdi), %r11 > + movl PCPU(CPUID), %r10d > + LK btrl %r10d, PM_ACTIVE(%r11) > > - movq %rsp,%rdi > + VMX_HOST_RESTORE > + > + VMX_GUEST_CLOBBER > + > + /* > + * To prevent malicious branch target predictions from > + * affecting the host, overwrite all entries in the RSB upon > + * exiting a guest. > + */ > + mov $16, %ecx /* 16 iterations, two calls per loop */ > + mov %rsp, %rax > +0: call 2f /* create an RSB entry. */ > +1: pause > + call 1b /* capture rogue speculation. */ > +2: call 2f /* create an RSB entry. */ > +1: pause > + call 1b /* capture rogue speculation. */ > +2: sub $1, %ecx > + jnz 0b > + mov %rax, %rsp > + > + /* > + * This will return to the caller of 'vmx_enter_guest()' with a return > + * value of VMX_GUEST_VMEXIT. > + */ > + movl $VMX_GUEST_VMEXIT, %eax > + VLEAVE > + ret > + > + .globl vmx_exit_guest > +vmx_exit_guest: > + /* > + * Save guest state that is not automatically saved in the vmcs. > + */ > + VMX_GUEST_SAVE > > /* > * Deactivate guest pmap from this cpu. > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Feb 12 15:31: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 3988CF00FA9; Mon, 12 Feb 2018 15:31:55 +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 DEB1079E71; Mon, 12 Feb 2018 15:31:54 +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 D94F513CA5; Mon, 12 Feb 2018 15:31:54 +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 w1CFVsIR007421; Mon, 12 Feb 2018 15:31:54 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CFVrGi007406; Mon, 12 Feb 2018 15:31:53 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802121531.w1CFVrGi007406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Feb 2018 15:31:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329166 - in head: . share/mk stand stand/common stand/liblua stand/liblua32 sys/sys tools/build/options X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: . share/mk stand stand/common stand/liblua stand/liblua32 sys/sys tools/build/options X-SVN-Commit-Revision: 329166 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 15:31:55 -0000 Author: imp Date: Mon Feb 12 15:31:53 2018 New Revision: 329166 URL: https://svnweb.freebsd.org/changeset/base/329166 Log: Add Lua as a scripting langauge to /boot/loader liblua glues the lua run time into the boot loader. It implements all the runtime routines that lua expects. In addition, it has a few standard 'C' headers that nueter various aspects of the LUA build that are too specific to lua to be in libsa. Many refinements from the original code to improve implementation and the number of included lua libraries. Use int64_t for lua_Number. Have "/boot/lua" be the default module path. Numerous cleanups from the original GSoC project, including hacking libsa to allow lua to be built with only one change outside luaconf.h. Add the final bit of lua glue to bring in liblua and plug into the multiple interpreter framework, previously committed. Add LOADER_LUA option, currently off by default. Presently, this is an experimental option. One must opt-in to using this by defining WITH_LOADER_LUA and WITHOUT_FORTH. It's been lightly tested, so keep a backup copy of your old loader handy. The menu code, coming in the next commit, hasn't been exhaustively tested. A LUA boot loader is 60k larger than a FORTH one, which is 80k larger than a no-interpreter one. Subtle changes in size may tip things past some subtle limit (the binary is ~430k now when built with LUA). A future version may offer coexistance. Bump FreeBSD version to 1200058 to mark the milestone. Pedro Souza's 2014 Summer of Code project. Rui Paulo, Pedro Arthur, Zakary Nafziger and Wojciech A. Koszek also contributed. Warner Losh reworked it extensively into its current form. Obtained from: https://wiki.freebsd.org/SummerOfCode2014/LuaLoader Sponsored by: Google Summer of Code Relnotes: Yes MFC After: 1 month Differential Review: https://reviews.freebsd.org/D14295 Added: head/stand/common/interp_lua.c (contents, props changed) head/stand/liblua/ head/stand/liblua/Makefile (contents, props changed) head/stand/liblua/float.h (contents, props changed) head/stand/liblua/locale.h (contents, props changed) head/stand/liblua/lstd.c (contents, props changed) head/stand/liblua/lstd.h (contents, props changed) head/stand/liblua/luaconf.h (contents, props changed) head/stand/liblua/lutils.c (contents, props changed) head/stand/liblua/lutils.h (contents, props changed) head/stand/liblua/math.h (contents, props changed) head/stand/liblua32/ head/stand/liblua32/Makefile (contents, props changed) head/stand/lua.mk (contents, props changed) head/tools/build/options/WITH_LOADER_LUA (contents, props changed) Modified: head/UPDATING head/share/mk/src.opts.mk head/stand/Makefile head/stand/Makefile.amd64 head/stand/defs.mk head/stand/loader.mk head/sys/sys/param.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Feb 12 14:48:20 2018 (r329165) +++ head/UPDATING Mon Feb 12 15:31:53 2018 (r329166) @@ -51,6 +51,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: ****************************** SPECIAL WARNING: ****************************** +20180212: + FreeBSD boot loader enhanced with Lua scripting. It's purely opt-in for + now by building WITH_LOADER_LUA and WITHOUT_FORTH in /etc/src.conf. + Co-existance for the transition period will come shortly. Booting is a + complex environment and test coverage for Lua-enabled loaders has been + thin, so it would be prudent to assume it might not work and make + provisions for backup boot methods. + 20180211: devmatch functionality has been turned on in devd. It will automatically load drivers for unattached devices. This may cause unexpected drivers to Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Mon Feb 12 14:48:20 2018 (r329165) +++ head/share/mk/src.opts.mk Mon Feb 12 15:31:53 2018 (r329166) @@ -184,6 +184,7 @@ __DEFAULT_NO_OPTIONS = \ LIBSOFT \ LOADER_FIREWIRE \ LOADER_FORCE_LE \ + LOADER_LUA \ NAND \ OFED \ OPENLDAP \ Modified: head/stand/Makefile ============================================================================== --- head/stand/Makefile Mon Feb 12 14:48:20 2018 (r329165) +++ head/stand/Makefile Mon Feb 12 15:31:53 2018 (r329166) @@ -8,6 +8,9 @@ SUBDIR+= libsa SUBDIR+= ficl SUBDIR+= forth .endif +.if ${MK_LOADER_LUA} != "no" +SUBDIR+= liblua +.endif SUBDIR+= man Modified: head/stand/Makefile.amd64 ============================================================================== --- head/stand/Makefile.amd64 Mon Feb 12 14:48:20 2018 (r329165) +++ head/stand/Makefile.amd64 Mon Feb 12 15:31:53 2018 (r329166) @@ -7,6 +7,9 @@ SUBDIR+= zfs zfs32 .if ${MK_FORTH} != "no" SUBDIR+= ficl32 .endif +.if ${MK_LOADER_LUA} != "no" +SUBDIR+= liblua32 +.endif SUBDIR+= efi SUBDIR+= userboot Added: head/stand/common/interp_lua.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/common/interp_lua.c Mon Feb 12 15:31:53 2018 (r329166) @@ -0,0 +1,164 @@ +/*- + * Copyright (c) 2011 Wojciech A. Koszek + * Copyright (c) 2014 Pedro Souza + * 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 "bootstrap.h" + +#define lua_c + +#include "lstd.h" + +#include +#include +#include +#include +#include + +struct interp_lua_softc { + lua_State *luap; +}; + +static struct interp_lua_softc lua_softc; + +#ifdef LUA_DEBUG +#define LDBG(...) do { \ + printf("%s(%d): ", __func__, __LINE__); \ + printf(__VA_ARGS__); \ + printf("\n"); \ +} while (0) +#else +#define LDBG(...) +#endif + + +static void * +interp_lua_realloc(void *ud __unused, void *ptr, size_t osize __unused, size_t nsize) +{ + + if (nsize == 0) { + free(ptr); + return NULL; + } + return realloc(ptr, nsize); +} + +/* + * The libraries commented out below either lack the proper + * support from libsa, or they are unlikely to be useful + * in the bootloader, so have been commented out. + */ +static const luaL_Reg loadedlibs[] = { + {"_G", luaopen_base}, + {LUA_LOADLIBNAME, luaopen_package}, +// {LUA_COLIBNAME, luaopen_coroutine}, +// {LUA_TABLIBNAME, luaopen_table}, + {LUA_STRLIBNAME, luaopen_string}, +// {LUA_IOLIBNAME, luaopen_io}, +// {LUA_OSLIBNAME, luaopen_os}, +// {LUA_MATHLIBNAME, luaopen_math}, +// {LUA_UTF8LIBNAME, luaopen_utf8}, +// {LUA_DBLIBNAME, luaopen_debug}, + {NULL, NULL} +}; + +void +interp_init(void) +{ + lua_State *luap; + struct interp_lua_softc *softc = &lua_softc; + const char *filename; + const luaL_Reg *lib; + + setenv("script.lang", "lua", 1); + LDBG("creating context"); + + luap = lua_newstate(interp_lua_realloc, NULL); + if (luap == NULL) { + printf("problem initializing the Lua interpreter\n"); + abort(); + } + softc->luap = luap; + register_utils(luap); + + /* "require" functions from 'loadedlibs' and set results to global table */ + for (lib = loadedlibs; lib->func; lib++) { + luaL_requiref(luap, lib->name, lib->func, 1); + lua_pop(luap, 1); /* remove lib */ + } + + filename = "/boot/lua/loader.lua"; + if (interp_include(filename) != 0) { + const char *errstr = lua_tostring(luap, -1); + errstr = errstr == NULL ? "unknown" : errstr; + printf("Startup errorr in %s:\nLUA ERROR: %s.\n", filename, errstr); + lua_pop(luap, 1); + } +} + +int +interp_run(const char *line) +{ + int argc; + char **argv; + lua_State *luap; + struct interp_lua_softc *softc = &lua_softc; + int status; + + luap = softc->luap; + LDBG("executing line..."); + if ((status = luaL_dostring(luap, line)) != 0) { + /* + * If we could not parse the line as Lua syntax, + * try parsing it as a loader command. + */ + lua_pop(luap, 1); + if (parse(&argc, &argv, line) == 0) { + status = interp_builtin_cmd(argc, argv); + if (status != CMD_OK) + printf("Command failed\n"); + free(argv); + } else { + printf("Failed to parse \'%s\'\n", line); + status = -1; + } + } + + return (status == 0 ? CMD_OK : CMD_ERROR); +} + +int +interp_include(const char *filename) +{ + struct interp_lua_softc *softc = &lua_softc; + + LDBG("loading file %s", filename); + + return (luaL_dofile(softc->luap, filename)); +} Modified: head/stand/defs.mk ============================================================================== --- head/stand/defs.mk Mon Feb 12 14:48:20 2018 (r329165) +++ head/stand/defs.mk Mon Feb 12 15:31:53 2018 (r329166) @@ -23,6 +23,8 @@ EFIINCMD= ${EFIINC}/${MACHINE} FDTSRC= ${BOOTSRC}/fdt FICLSRC= ${BOOTSRC}/ficl LDRSRC= ${BOOTSRC}/common +LIBLUASRC= ${BOOTSRC}/liblua +LUASRC= ${SRCTOP}/contrib/lua/src SASRC= ${BOOTSRC}/libsa SYSDIR= ${SRCTOP}/sys UBOOTSRC= ${BOOTSRC}/uboot Added: head/stand/liblua/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/liblua/Makefile Mon Feb 12 15:31:53 2018 (r329166) @@ -0,0 +1,38 @@ +# $FreeBSD$ + +.include + +.PATH: ${LUASRC} +.PATH: ${LIBLUASRC} + +LIB= lua +INTERNALLIB= + +# Core Lua. +SRCS= lapi.c lcode.c lctype.c ldebug.c ldo.c ldump.c lfunc.c lgc.c llex.c \ + lmem.c lobject.c lopcodes.c lparser.c lstate.c lstring.c ltable.c \ + ltm.c lundump.c lvm.c lzio.c +SRCS+= lauxlib.c lbaselib.c lstrlib.c loadlib.c + +# These aren't yet included, but link now, omitting them saves 15k +#SRCS+= lcorolib.c ldblib.c lutf8lib.c + +# These aren't yet compatible with the boot environment, and some may never be +#SRCS+= lbitlib.c liolib.c lmathlib.c loslib.c ltablib.c + +# Our utilities. +SRCS+= lstd.c lutils.c + +WARNS= 3 + +CFLAGS+= -DLUA_FLOAT_TYPE=LUA_FLOAT_INT64 +CFLAGS+= -DLUA_PATH_DEFAULT=\"/boot/lua/\?.lua\" +CFLAGS+= -ffreestanding -nostdlib -DBOOT_LUA -DLUA_USE_POSIX +CFLAGS+= -fno-stack-protector -D__BSD_VISIBLE +CFLAGS+= -I${BOOTSRC}/include -I${LIBLUASRC} -I${LUASRC} -I${LDRSRC} + +.if ${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 0 +CFLAGS+= -fPIC +.endif + +.include Added: head/stand/liblua/float.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/liblua/float.h Mon Feb 12 15:31:53 2018 (r329166) @@ -0,0 +1,32 @@ +/*- + * Copyright (c) 2018 M Warner Losh + * 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. + * + * $FreeBSD$ + */ + +/* + * Empty file to keep lua build happy. Lua expects to have to include float.h + * but the int64_t number implementation doesn't need it. + */ Added: head/stand/liblua/locale.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/liblua/locale.h Mon Feb 12 15:31:53 2018 (r329166) @@ -0,0 +1,27 @@ +/*- + * Copyright (c) 2018 M Warner Losh + * 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. + * + * $FreeBSD$ + */ Added: head/stand/liblua/lstd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/liblua/lstd.c Mon Feb 12 15:31:53 2018 (r329166) @@ -0,0 +1,182 @@ +/*- + * Copyright (c) 2014 Pedro Souza + * 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 "lstd.h" +#include "math.h" + +FILE * +fopen(const char *filename, const char *mode) +{ + struct stat st; + int fd; + FILE *f; + + if (mode == NULL || mode[0] != 'r') + return NULL; + + fd = open(filename, O_RDONLY); + if (fd < 0) + return NULL; + + f = malloc(sizeof(FILE)); + if (f == NULL) { + close(fd); + return NULL; + } + + if (fstat(fd, &st) != 0) { + free(f); + close(fd); + return (NULL); + } + + f->fd = fd; + f->offset = 0; + f->size = st.st_size; + + return (f); +} + + +FILE * +freopen(const char *filename, const char *mode, FILE *stream) +{ + fclose(stream); + return (fopen(filename, mode)); +} + +size_t +fread(void *ptr, size_t size, size_t count, FILE *stream) +{ + size_t r; + + if (stream == NULL) + return 0; + r = (size_t)read(stream->fd, ptr, size * count); + stream->offset += r; + + return (r); +} + +int +fclose(FILE *stream) +{ + if (stream == NULL) + return EOF; + close(stream->fd); + free(stream); + + return (0); +} + +int +ferror(FILE *stream) +{ + + return (stream == NULL || stream->fd < 0); +} + +int +feof(FILE *stream) +{ + + if (stream == NULL) + return 1; + + return (stream->offset >= stream->size); +} + +int +getc(FILE *stream) +{ + char ch; + size_t r; + + if (stream == NULL) + return EOF; + r = read(stream->fd, &ch, 1); + if (r == 1) + return ch; + return EOF; +} + +void +luai_writestring(const char *s, int i) +{ + + while (i-- > 0) + putchar(*s++); +} + +/* + * These routines from here on down are to implement the lua math + * library, but that's not presently included by default. They are + * little more than placeholders to allow compilation due to linkage + * issues with upstream Lua. + */ + +int64_t +lstd_pow(int64_t x, int64_t y) +{ + int64_t rv = 1; + + if (y < 0) + return 0; + rv = x; + while (--y) + rv *= x; + + return rv; +} + +int64_t +lstd_floor(int64_t x) +{ + + return (x); +} + +int64_t +lstd_fmod(int64_t a, int64_t b) +{ + + return (a % b); +} + +/* + * This can't be implemented, so maybe it should just abort. + */ +int64_t +lstd_frexp(int64_t a, int *y) +{ + *y = 0; + + return 0; +} Added: head/stand/liblua/lstd.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/liblua/lstd.h Mon Feb 12 15:31:53 2018 (r329166) @@ -0,0 +1,74 @@ +/*- + * Copyright (c) 2014 Pedro Souza + * 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. + * + * $FreeBSD$ + */ + +#ifndef LSTD_H +#define LSTD_H + +#include +#include +#include +#include +#include +#include + +typedef struct FILE +{ + int fd; + size_t offset; + size_t size; +} FILE; + +FILE *fopen(const char *filename, const char *mode); +FILE *freopen( const char *filename, const char *mode, FILE *stream); +size_t fread(void *ptr, size_t size, size_t count, FILE *stream); +int fclose(FILE *stream); +int ferror(FILE *stream); +int feof(FILE *stream); +int getc(FILE * stream); + +#ifndef EOF +#define EOF (-1) +#endif + +#define stdin ((FILE*)NULL) +#define stdout 1 + +#ifndef BUFSIZ +#define BUFSIZ 512 +#endif + +#define lua_writestringerror(s, p) do { printf((s), (p)); } while (0) + +void luai_writestring(const char *, int); + +#define lua_writestring(s,l) luai_writestring(s,l) + +#define fflush /* */ +#define fgets(b, l, s) fgetstr((b), (l), 0) + +#endif /* LSTD_H */ Added: head/stand/liblua/luaconf.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/liblua/luaconf.h Mon Feb 12 15:31:53 2018 (r329166) @@ -0,0 +1,811 @@ +/* $FreeBSD$ */ +/* +** $Id: luaconf.h,v 1.259 2016/12/22 13:08:50 roberto Exp $ +** Configuration file for Lua +** See Copyright Notice in lua.h +*/ + + +#ifndef luaconf_h +#define luaconf_h + +#include +#include + + +/* +** =================================================================== +** Search for "@@" to find all configurable definitions. +** =================================================================== +*/ + + +/* +** {==================================================================== +** System Configuration: macros to adapt (if needed) Lua to some +** particular platform, for instance compiling it with 32-bit numbers or +** restricting it to C89. +** ===================================================================== +*/ + +/* +@@ LUA_32BITS enables Lua with 32-bit integers and 32-bit floats. You +** can also define LUA_32BITS in the make file, but changing here you +** ensure that all software connected to Lua will be compiled with the +** same configuration. +*/ +/* #define LUA_32BITS */ + + +/* +@@ LUA_USE_C89 controls the use of non-ISO-C89 features. +** Define it if you want Lua to avoid the use of a few C99 features +** or Windows-specific features on Windows. +*/ +/* #define LUA_USE_C89 */ + + +/* +** By default, Lua on Windows use (some) specific Windows features +*/ +#if !defined(LUA_USE_C89) && defined(_WIN32) && !defined(_WIN32_WCE) +#define LUA_USE_WINDOWS /* enable goodies for regular Windows */ +#endif + + +#if defined(LUA_USE_WINDOWS) +#define LUA_DL_DLL /* enable support for DLL */ +#define LUA_USE_C89 /* broadly, Windows is C89 */ +#endif + + +#if defined(LUA_USE_LINUX) +#define LUA_USE_POSIX +#define LUA_USE_DLOPEN /* needs an extra library: -ldl */ +#define LUA_USE_READLINE /* needs some extra libraries */ +#endif + + +#if defined(LUA_USE_MACOSX) +#define LUA_USE_POSIX +#define LUA_USE_DLOPEN /* MacOS does not need -ldl */ +#define LUA_USE_READLINE /* needs an extra library: -lreadline */ +#endif + + +/* +@@ LUA_C89_NUMBERS ensures that Lua uses the largest types available for +** C89 ('long' and 'double'); Windows always has '__int64', so it does +** not need to use this case. +*/ +#if defined(LUA_USE_C89) && !defined(LUA_USE_WINDOWS) +#define LUA_C89_NUMBERS +#endif + + + +/* +@@ LUAI_BITSINT defines the (minimum) number of bits in an 'int'. +*/ +/* avoid undefined shifts */ +#if ((INT_MAX >> 15) >> 15) >= 1 +#define LUAI_BITSINT 32 +#else +/* 'int' always must have at least 16 bits */ +#define LUAI_BITSINT 16 +#endif + + +/* +@@ LUA_INT_TYPE defines the type for Lua integers. +@@ LUA_FLOAT_TYPE defines the type for Lua floats. +** Lua should work fine with any mix of these options (if supported +** by your C compiler). The usual configurations are 64-bit integers +** and 'double' (the default), 32-bit integers and 'float' (for +** restricted platforms), and 'long'/'double' (for C compilers not +** compliant with C99, which may not have support for 'long long'). +*/ + +/* predefined options for LUA_INT_TYPE */ +#define LUA_INT_INT 1 +#define LUA_INT_LONG 2 +#define LUA_INT_LONGLONG 3 + +/* predefined options for LUA_FLOAT_TYPE */ +#define LUA_FLOAT_FLOAT 1 +#define LUA_FLOAT_DOUBLE 2 +#define LUA_FLOAT_LONGDOUBLE 3 +#define LUA_FLOAT_INT64 4 + +#if defined(LUA_32BITS) /* { */ +/* +** 32-bit integers and 'float' +*/ +#if LUAI_BITSINT >= 32 /* use 'int' if big enough */ +#define LUA_INT_TYPE LUA_INT_INT +#else /* otherwise use 'long' */ +#define LUA_INT_TYPE LUA_INT_LONG +#endif +#define LUA_FLOAT_TYPE LUA_FLOAT_FLOAT + +#elif defined(LUA_C89_NUMBERS) /* }{ */ +/* +** largest types available for C89 ('long' and 'double') +*/ +#define LUA_INT_TYPE LUA_INT_LONG +#define LUA_FLOAT_TYPE LUA_FLOAT_DOUBLE + +#endif /* } */ + + +/* +** default configuration for 64-bit Lua ('long long' and 'double') +*/ +#if !defined(LUA_INT_TYPE) +#define LUA_INT_TYPE LUA_INT_LONGLONG +#endif + +#if !defined(LUA_FLOAT_TYPE) +#define LUA_FLOAT_TYPE LUA_FLOAT_DOUBLE +#endif + +/* }================================================================== */ + + + + +/* +** {================================================================== +** Configuration for Paths. +** =================================================================== +*/ + +/* +** LUA_PATH_SEP is the character that separates templates in a path. +** LUA_PATH_MARK is the string that marks the substitution points in a +** template. +** LUA_EXEC_DIR in a Windows path is replaced by the executable's +** directory. +*/ +#define LUA_PATH_SEP ";" +#define LUA_PATH_MARK "?" +#define LUA_EXEC_DIR "!" + + +/* +@@ LUA_PATH_DEFAULT is the default path that Lua uses to look for +** Lua libraries. +@@ LUA_CPATH_DEFAULT is the default path that Lua uses to look for +** C libraries. +** CHANGE them if your machine has a non-conventional directory +** hierarchy or if you want to install your libraries in +** non-conventional directories. +*/ +#define LUA_VDIR LUA_VERSION_MAJOR "." LUA_VERSION_MINOR +#if defined(_WIN32) /* { */ +/* +** In Windows, any exclamation mark ('!') in the path is replaced by the +** path of the directory of the executable file of the current process. +*/ +#define LUA_LDIR "!\\lua\\" +#define LUA_CDIR "!\\" +#define LUA_SHRDIR "!\\..\\share\\lua\\" LUA_VDIR "\\" +#define LUA_PATH_DEFAULT \ + LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;" \ + LUA_CDIR"?.lua;" LUA_CDIR"?\\init.lua;" \ + LUA_SHRDIR"?.lua;" LUA_SHRDIR"?\\init.lua;" \ + ".\\?.lua;" ".\\?\\init.lua" +#define LUA_CPATH_DEFAULT \ + LUA_CDIR"?.dll;" \ + LUA_CDIR"..\\lib\\lua\\" LUA_VDIR "\\?.dll;" \ + LUA_CDIR"loadall.dll;" ".\\?.dll" + +#else /* }{ */ + +#define LUA_ROOT "/usr/local/" +#define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR "/" +#define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR "/" +#ifndef LUA_PATH_DEFAULT +#define LUA_PATH_DEFAULT \ + LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \ + LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua;" \ + "./?.lua;" "./?/init.lua" +#endif +#define LUA_CPATH_DEFAULT \ + LUA_CDIR"?.so;" LUA_CDIR"loadall.so;" "./?.so" +#endif /* } */ + + +/* +@@ LUA_DIRSEP is the directory separator (for submodules). +** CHANGE it if your machine does not use "/" as the directory separator +** and is not Windows. (On Windows Lua automatically uses "\".) +*/ +#if defined(_WIN32) +#define LUA_DIRSEP "\\" +#else +#define LUA_DIRSEP "/" +#endif + +/* }================================================================== */ + + +/* +** {================================================================== +** Marks for exported symbols in the C code +** =================================================================== +*/ + +/* +@@ LUA_API is a mark for all core API functions. +@@ LUALIB_API is a mark for all auxiliary library functions. +@@ LUAMOD_API is a mark for all standard library opening functions. +** CHANGE them if you need to define those functions in some special way. +** For instance, if you want to create one Windows DLL with the core and +** the libraries, you may want to use the following definition (define +** LUA_BUILD_AS_DLL to get it). +*/ +#if defined(LUA_BUILD_AS_DLL) /* { */ + +#if defined(LUA_CORE) || defined(LUA_LIB) /* { */ +#define LUA_API __declspec(dllexport) +#else /* }{ */ +#define LUA_API __declspec(dllimport) +#endif /* } */ + +#else /* }{ */ + +#define LUA_API extern + +#endif /* } */ + + +/* more often than not the libs go together with the core */ +#define LUALIB_API LUA_API +#define LUAMOD_API LUALIB_API + + +/* +@@ LUAI_FUNC is a mark for all extern functions that are not to be +** exported to outside modules. +@@ LUAI_DDEF and LUAI_DDEC are marks for all extern (const) variables +** that are not to be exported to outside modules (LUAI_DDEF for +** definitions and LUAI_DDEC for declarations). +** CHANGE them if you need to mark them in some special way. Elf/gcc +** (versions 3.2 and later) mark them as "hidden" to optimize access +** when Lua is compiled as a shared library. Not all elf targets support +** this attribute. Unfortunately, gcc does not offer a way to check +** whether the target offers that support, and those without support +** give a warning about it. To avoid these warnings, change to the +** default definition. +*/ +#if defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \ + defined(__ELF__) /* { */ +#define LUAI_FUNC __attribute__((visibility("hidden"))) extern +#else /* }{ */ +#define LUAI_FUNC extern +#endif /* } */ + +#define LUAI_DDEC LUAI_FUNC +#define LUAI_DDEF /* empty */ + +/* }================================================================== */ + + +/* +** {================================================================== +** Compatibility with previous versions +** =================================================================== +*/ + +/* +@@ LUA_COMPAT_5_2 controls other macros for compatibility with Lua 5.2. +@@ LUA_COMPAT_5_1 controls other macros for compatibility with Lua 5.1. +** You can define it to get all options, or change specific options +** to fit your specific needs. +*/ +#if defined(LUA_COMPAT_5_2) /* { */ + +/* +@@ LUA_COMPAT_MATHLIB controls the presence of several deprecated +** functions in the mathematical library. +*/ +#define LUA_COMPAT_MATHLIB + +/* +@@ LUA_COMPAT_BITLIB controls the presence of library 'bit32'. +*/ +#define LUA_COMPAT_BITLIB + +/* +@@ LUA_COMPAT_IPAIRS controls the effectiveness of the __ipairs metamethod. +*/ +#define LUA_COMPAT_IPAIRS + +/* +@@ LUA_COMPAT_APIINTCASTS controls the presence of macros for +** manipulating other integer types (lua_pushunsigned, lua_tounsigned, +** luaL_checkint, luaL_checklong, etc.) +*/ +#define LUA_COMPAT_APIINTCASTS + +#endif /* } */ + + +#if defined(LUA_COMPAT_5_1) /* { */ + +/* Incompatibilities from 5.2 -> 5.3 */ +#define LUA_COMPAT_MATHLIB +#define LUA_COMPAT_APIINTCASTS + +/* +@@ LUA_COMPAT_UNPACK controls the presence of global 'unpack'. +** You can replace it with 'table.unpack'. +*/ +#define LUA_COMPAT_UNPACK + +/* +@@ LUA_COMPAT_LOADERS controls the presence of table 'package.loaders'. +** You can replace it with 'package.searchers'. +*/ +#define LUA_COMPAT_LOADERS + +/* +@@ macro 'lua_cpcall' emulates deprecated function lua_cpcall. +** You can call your C function directly (with light C functions). +*/ +#define lua_cpcall(L,f,u) \ + (lua_pushcfunction(L, (f)), \ + lua_pushlightuserdata(L,(u)), \ + lua_pcall(L,1,0,0)) + + +/* +@@ LUA_COMPAT_LOG10 defines the function 'log10' in the math library. +** You can rewrite 'log10(x)' as 'log(x, 10)'. +*/ +#define LUA_COMPAT_LOG10 + +/* +@@ LUA_COMPAT_LOADSTRING defines the function 'loadstring' in the base +** library. You can rewrite 'loadstring(s)' as 'load(s)'. +*/ +#define LUA_COMPAT_LOADSTRING + +/* +@@ LUA_COMPAT_MAXN defines the function 'maxn' in the table library. +*/ +#define LUA_COMPAT_MAXN + +/* +@@ The following macros supply trivial compatibility for some +** changes in the API. The macros themselves document how to +** change your code to avoid using them. +*/ +#define lua_strlen(L,i) lua_rawlen(L, (i)) + +#define lua_objlen(L,i) lua_rawlen(L, (i)) + +#define lua_equal(L,idx1,idx2) lua_compare(L,(idx1),(idx2),LUA_OPEQ) +#define lua_lessthan(L,idx1,idx2) lua_compare(L,(idx1),(idx2),LUA_OPLT) + +/* +@@ LUA_COMPAT_MODULE controls compatibility with previous +** module functions 'module' (Lua) and 'luaL_register' (C). +*/ +#define LUA_COMPAT_MODULE + +#endif /* } */ + + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Feb 12 15:32: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 B5B54F0100B; Mon, 12 Feb 2018 15:32:03 +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 3DD6E79F76; Mon, 12 Feb 2018 15:32:03 +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 2E73013CB0; Mon, 12 Feb 2018 15:32: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 w1CFW1Sd007484; Mon, 12 Feb 2018 15:32:01 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CFW0U2007475; Mon, 12 Feb 2018 15:32:00 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802121532.w1CFW0U2007475@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Feb 2018 15:32:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329167 - in head/stand: . lua X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/stand: . lua X-SVN-Commit-Revision: 329167 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 15:32:04 -0000 Author: imp Date: Mon Feb 12 15:32:00 2018 New Revision: 329167 URL: https://svnweb.freebsd.org/changeset/base/329167 Log: Add the lua scripts from the lua-bootloader SoC These are the .lua files from from Pedro Souza's 2014 Summer of Code project. Rui Paulo, Pedro Arthur and Wojciech A. Koszek also contributed. Obtained from: https://wiki.freebsd.org/SummerOfCode2014/LuaLoader Sponsored by: Google Summer of Code Improve the SoC lua menu code to bring it in line with forth menu functionality Submitted by: Zakary Nafziger Sponsored by: FreeBSD Foundation Use loader.setenv and loader.unsetenv instead of loader.perform Convert from include("/boot/foo.lua") to foo = require("foo"); to bring in line with latest lua module conventions. Enforce a uniform style for the new .lua files: o hard tab indenation for 8 spaces o don't have if foo then bar; else bas; end on one line MFC After: 1 month Relnotes: yes Differential Review: https://reviews.freebsd.org/D14295 Added: head/stand/lua/ head/stand/lua/Makefile (contents, props changed) head/stand/lua/color.lua (contents, props changed) head/stand/lua/config.lua (contents, props changed) head/stand/lua/core.lua (contents, props changed) head/stand/lua/drawer.lua (contents, props changed) head/stand/lua/loader.lua (contents, props changed) head/stand/lua/menu.lua (contents, props changed) head/stand/lua/password.lua (contents, props changed) head/stand/lua/screen.lua (contents, props changed) Modified: head/stand/Makefile Modified: head/stand/Makefile ============================================================================== --- head/stand/Makefile Mon Feb 12 15:31:53 2018 (r329166) +++ head/stand/Makefile Mon Feb 12 15:32:00 2018 (r329167) @@ -10,6 +10,7 @@ SUBDIR+= forth .endif .if ${MK_LOADER_LUA} != "no" SUBDIR+= liblua +SUBDIR+= lua .endif SUBDIR+= man Added: head/stand/lua/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/lua/Makefile Mon Feb 12 15:32:00 2018 (r329167) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +.include + +BINDIR= /boot/lua +FILES= color.lua \ + config.lua \ + core.lua \ + drawer.lua \ + loader.lua \ + menu.lua \ + password.lua \ + screen.lua + +.include Added: head/stand/lua/color.lua ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/lua/color.lua Mon Feb 12 15:32:00 2018 (r329167) @@ -0,0 +1,99 @@ +-- +-- Copyright (c) 2015 Pedro Souza +-- 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. +-- +-- $FreeBSD$ +-- + +local color = {}; + +local core = require("core"); + +color.BLACK = 0; +color.RED = 1; +color.GREEN = 2; +color.YELLOW = 3; +color.BLUE = 4; +color.MAGENTA = 5; +color.CYAN = 6; +color.WHITE = 7; + +color.DEFAULT = 0; +color.BRIGHT = 1; +color.DIM = 2; + +function color.isEnabled() + local c = loader.getenv("loader_color"); + if c ~= nil then + if c:lower() == "no" or c == "0" then + return false; + end + end + return not core.bootserial(); +end + +color.disabled = not color.isEnabled(); + + +function color.escapef(c) + if color.disabled then + return c; + end + return "\027[3"..c.."m"; +end + +function color.escapeb(c) + if color.disabled then + return c; + end + return "\027[4"..c.."m"; +end + +function color.escape(fg, bg, att) + if color.disabled then + return ""; + end + if not att then + att = "" + else + att = att..";"; + end + return "\027["..att.."3"..fg..";4"..bg.."m"; +end + +function color.default() + if color.disabled then + return ""; + end + return "\027[0;37;40m"; +end + +function color.highlight(str) + if color.disabled then + return str; + end + return "\027[1m"..str.."\027[0m"; +end + +return color Added: head/stand/lua/config.lua ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/lua/config.lua Mon Feb 12 15:32:00 2018 (r329167) @@ -0,0 +1,371 @@ +-- +-- Copyright (c) 2015 Pedro Souza +-- 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. +-- +-- $FreeBSD$ +-- + +local config = {}; + +local modules = {}; + +function config.setKey(k, n, v) + if modules[k] == nil then + modules[k] = {}; + end + modules[k][n] = v; +end + +local pattern_table = { + [1] = { + str = "^%s*(#.*)", + process = function(k, v) end + }, + -- module_load="value" + [2] = { + str = "^%s*([%w_]+)_load%s*=%s*\"([%w%s%p]-)\"%s*(.*)", + process = function(k, v) + if modules[k] == nil then + modules[k] = {}; + end + modules[k].load = string.upper(v); + end + }, + -- module_name="value" + [3] = { + str = "^%s*([%w_]+)_name%s*=%s*\"([%w%s%p]-)\"%s*(.*)", + process = function(k, v) + config.setKey(k, "name", v); + end + }, + -- module_type="value" + [4] = { + str = "^%s*([%w_]+)_type%s*=%s*\"([%w%s%p]-)\"%s*(.*)", + process = function(k, v) + config.setKey(k, "type", v); + end + }, + -- module_flags="value" + [5] = { + str = "^%s*([%w_]+)_flags%s*=%s*\"([%w%s%p]-)\"%s*(.*)", + process = function(k, v) + config.setKey(k, "flags", v); + end + }, + -- module_before="value" + [6] = { + str = "^%s*([%w_]+)_before%s*=%s*\"([%w%s%p]-)\"%s*(.*)", + process = function(k, v) + config.setKey(k, "before", v); + end + }, + -- module_after="value" + [7] = { + str = "^%s*([%w_]+)_after%s*=%s*\"([%w%s%p]-)\"%s*(.*)", + process = function(k, v) + config.setKey(k, "after", v); + end + }, + -- module_error="value" + [8] = { + str = "^%s*([%w_]+)_error%s*=%s*\"([%w%s%p]-)\"%s*(.*)", + process = function(k, v) + config.setKey(k, "error", v); + end + }, + -- exec="command" + [9] = { + str = "^%s*exec%s*=%s*\"([%w%s%p]-)\"%s*(.*)", + process = function(k, v) + if loader.perform(k) ~= 0 then + print("Failed to exec '"..k.."'"); + end + end + }, + -- env_var="value" + [10] = { + str = "^%s*([%w%p]+)%s*=%s*\"([%w%s%p]-)\"%s*(.*)", + process = function(k, v) + if loader.setenv(k, v) ~= 0 then + print("Failed to set '"..k.."' with value: "..v..""); + end + end + }, + -- env_var=num + [11] = { + str = "^%s*([%w%p]+)%s*=%s*(%d+)%s*(.*)", + process = function(k, v) + if loader.setenv(k, v) ~= 0 then + print("Failed to set '"..k.."' with value: "..v..""); + end + end + } +}; + +function config.isValidComment(c) + if c ~= nil then + local s = string.match(c, "^%s*#.*"); + if s == nil then + s = string.match(c, "^%s*$"); + end + if s == nil then + return false; + end + end + return true; +end + +function config.loadmod(mod, silent) + local status = true; + for k, v in pairs(mod) do + if v.load == "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 + if v.name ~= nil then + str = str .. v.name; + else + str = str .. k; + end + + if v.before ~= nil then + if loader.perform(v.before) ~= 0 then + if not silent then + print("Failed to execute '"..v.before.."' before loading '"..k.."'"); + end + status = false; + end + end + + if loader.perform(str) ~= 0 then + if not silent then + print("Failed to execute '" .. str .. "'"); + end + if v.error ~= nil then + loader.perform(v.error); + end + status = false; + end + + if v.after ~= nil then + if loader.perform(v.after) ~= 0 then + if not silent then + print("Failed to execute '"..v.after.."' after loading '"..k.."'"); + end + status = false; + end + end + + else + --if not silent then print("Skiping module '".. k .. "'"); end + end + end + + return status; +end + +function config.parse(name, silent) + local f = io.open(name); + if f == nil then + if not silent then + print("Failed to open config: '" .. name.."'"); + end + return false; + end + + local text; + local r; + + text, r = io.read(f); + + if text == nil then + if not silent then + print("Failed to read config: '" .. name.."'"); + end + return false; + end + + local n = 1; + local status = true; + + for line in string.gmatch(text, "([^\n]+)") do + + if string.match(line, "^%s*$") == nil then + local found = false; + + for i, val in ipairs(pattern_table) do + local k, v, c = string.match(line, val.str); + if k ~= nil then + found = true; + + if config.isValidComment(c) then + val.process(k, v); + else + print("Malformed line ("..n.."):\n\t'"..line.."'"); + status = false; + end + + break; + end + end + + if found == false then + print("Malformed line ("..n.."):\n\t'"..line.."'"); + status = false; + end + end + n = n + 1; + end + + return status; +end + +function config.loadkernel() + local flags = loader.getenv("kernel_options") or ""; + local kernel = loader.getenv("kernel"); + + local try_load = function (names) + for name in names:gmatch("([^;]+)%s*;?") do + r = loader.perform("load "..flags.." "..name); + if r == 0 then + return name; + end + end + return nil; + end; + + local load_bootfile = function() + local bootfile = loader.getenv("bootfile"); + + -- append default kernel name + if not bootfile then + bootfile = "kernel"; + else + bootfile = bootfile..";kernel"; + end + + return try_load(bootfile); + end; + + -- kernel not set, try load from default module_path + if kernel == nil then + local res = load_bootfile(); + + if res ~= nil then + return true; + else + print("Failed to load kernel '"..res.."'"); + return false; + end + else + local module_path = loader.getenv("module_path"); + local res = nil; + + -- first try load kernel with module_path = /boot/${kernel} + -- then try load with module_path=${kernel} + local paths = {"/boot/"..kernel, kernel}; + + for k,v in pairs(paths) do + + loader.setenv("module_path", v); + res = load_bootfile(); + + -- succeeded add path to module_path + if res ~= nil then + loader.setenv("module_path", v..";"..module_path); + return true; + end + end + + -- failed to load with ${kernel} as a directory + -- try as a file + res = try_load(kernel); + if res ~= nil then + return true; + else + print("Failed to load kernel '"..res.."'"); + return false; + end + end +end + + +function config.load(file) + + if not file then + file = "/boot/defaults/loader.conf"; + end + + if not config.parse(file) then +-- print("Failed to parse configuration: '"..file.."'"); + end + + local f = loader.getenv("loader_conf_files"); + if f ~= nil then + for name in string.gmatch(f, "([%w%p]+)%s*") do + if not config.parse(name) then +-- print("Failed to parse configuration: '"..name.."'"); + end + end + end + + print("Loading kernel..."); + config.loadkernel(); + + print("Loading configurations..."); + if not config.loadmod(modules) then + print("Could not load configurations!"); + end +end + +function config.reload(kernel) + local res = 1; + + -- unload all modules + print("Unloading modules..."); + loader.perform("unload"); + + if kernel ~= nil then + res = loader.perform("load "..kernel); + if res == 0 then + print("Kernel '"..kernel.."' loaded!"); + end + end + + -- failed to load kernel or it is nil + -- then load default + if res == 1 then + print("Loading default kernel..."); + config.loadkernel(); + end + + -- load modules + config.loadmod(modules); +end + +return config Added: head/stand/lua/core.lua ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/lua/core.lua Mon Feb 12 15:32:00 2018 (r329167) @@ -0,0 +1,154 @@ +-- +-- Copyright (c) 2015 Pedro Souza +-- 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. +-- +-- $FreeBSD$ +-- + +local core = {}; + +function core.setVerbose(b) + if (b == nil) then + b = not core.verbose; + end + + if (b == true) then + loader.setenv("boot_verbose", "YES"); + else + loader.unsetenv("boot_verbose"); + end + core.verbose = b; +end + +function core.setSingleUser(b) + if (b == nil) then + b = not core.su; + end + + if (b == true) then + loader.setenv("boot_single", "YES"); + else + loader.unsetenv("boot_single"); + end + core.su = b; +end + +function core.setACPI(b) + if (b == nil) then + b = not core.acpi; + end + + if (b == true) then + loader.setenv("acpi_load", "YES"); + loader.setenv("hint.acpi.0.disabled", "0"); + loader.unsetenv("loader.acpi_disabled_by_user"); + else + loader.unsetenv("acpi_load"); + loader.setenv("hint.acpi.0.disabled", "1"); + loader.setenv("loader.acpi_disabled_by_user", "1"); + end + core.acpi = b; +end + +function core.setSafeMode(b) + if (b == nil) then + b = not core.sm; + end + if (b == true) then + loader.setenv("kern.smp.disabled", "1"); + loader.setenv("hw.ata.ata_dma", "0"); + loader.setenv("hw.ata.atapi_dma", "0"); + loader.setenv("hw.ata.wc", "0"); + loader.setenv("hw.eisa_slots", "0"); + loader.setenv("kern.eventtimer.periodic", "1"); + loader.setenv("kern.geom.part.check_integrity", "0"); + else + loader.unsetenv("kern.smp.disabled"); + loader.unsetenv("hw.ata.ata_dma"); + loader.unsetenv("hw.ata.atapi_dma"); + loader.unsetenv("hw.ata.wc"); + loader.unsetenv("hw.eisa_slots"); + loader.unsetenv("kern.eventtimer.periodic"); + loader.unsetenv("kern.geom.part.check_integrity"); + end + core.sm = b; +end + +function core.kernelList() + local k = loader.getenv("kernel"); + local v = loader.getenv("kernels") or ""; + + local kernels = {}; + local i = 0; + if k ~= nil then + i = i + 1; + kernels[i] = k; + end + + for n in v:gmatch("([^; ]+)[; ]?") do + if n ~= k then + i = i + 1; + kernels[i] = n; + end + end + return kernels; +end + +function core.setDefaults() + core.setACPI(true); + core.setSafeMode(false); + core.setSingleUser(false); + core.setVerbose(false); +end + +function core.autoboot() + loader.perform("autoboot"); +end + +function core.boot() + loader.perform("boot"); +end + +function core.bootserial() + local c = loader.getenv("console"); + + if c ~= nil then + if c:find("comconsole") ~= nil then + return true; + end + end + + local s = loader.getenv("boot_serial"); + if s ~= nil then + return true; + end + + local m = loader.getenv("boot_multicons"); + if m ~= nil then + return true; + end + return false; +end + +return core Added: head/stand/lua/drawer.lua ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/lua/drawer.lua Mon Feb 12 15:32:00 2018 (r329167) @@ -0,0 +1,309 @@ +-- +-- Copyright (c) 2015 Pedro Souza +-- 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. +-- +-- $FreeBSD$ +-- + +local drawer = {}; + +local color = require("color"); +local screen = require("screen"); + +drawer.brand_position = {x = 2, y = 1}; +drawer.fbsd_logo = { + " ______ ____ _____ _____ ", + " | ____| | _ \\ / ____| __ \\ ", + " | |___ _ __ ___ ___ | |_) | (___ | | | |", + " | ___| '__/ _ \\/ _ \\| _ < \\___ \\| | | |", + " | | | | | __/ __/| |_) |____) | |__| |", + " | | | | | | || | | |", + " |_| |_| \\___|\\___||____/|_____/|_____/ " +}; + +drawer.logo_position = {x = 46, y = 1}; +drawer.beastie_color = { + " \027[31m, ,", + " /( )`", + " \\ \\___ / |", + " /- \027[37m_\027[31m `-/ '", + " (\027[37m/\\/ \\\027[31m \\ /\\", + " \027[37m/ / |\027[31m ` \\", + " \027[34mO O \027[37m) \027[31m/ |", + " \027[37m`-^--'\027[31m`< '", + " (_.) _ ) /", + " `.___/` /", + " `-----' /", + " \027[33m<----.\027[31m __ / __ \\", + " \027[33m<----|====\027[31mO)))\027[33m==\027[31m) \\) /\027[33m====|", + " \027[33m<----'\027[31m `--' `.__,' \\", + " | |", + " \\ / /\\", + " \027[36m______\027[31m( (_ / \\______/", + " \027[36m,' ,-----' |", + " `--{__________)\027[37m" +}; + +drawer.beastie = { + " , ,", + " /( )`", + " \\ \\___ / |", + " /- _ `-/ '", + " (/\\/ \\ \\ /\\", + " / / | ` \\", + " O O ) / |", + " `-^--'`< '", + " (_.) _ ) /", + " `.___/` /", + " `-----' /", + " <----. __ / __ \\", + " <----|====O)))==) \\) /====|", + " <----' `--' `.__,' \\", + " | |", + " \\ / /\\", + " ______( (_ / \\______/", + " ,' ,-----' |", + " `--{__________)" +}; + +drawer.fbsd_logo_shift = {x = 5, y = 4}; +drawer.fbsd_logo_v = { + " ______", + " | ____| __ ___ ___ ", + " | |__ | '__/ _ \\/ _ \\", + " | __|| | | __/ __/", + " | | | | | | |", + " |_| |_| \\___|\\___|", + " ____ _____ _____", + " | _ \\ / ____| __ \\", + " | |_) | (___ | | | |", + " | _ < \\___ \\| | | |", + " | |_) |____) | |__| |", + " | | | |", + " |____/|_____/|_____/" +}; + +drawer.orb_shift = {x = 2, y = 4}; +drawer.orb_color = { + " \027[31m``` \027[31;1m`\027[31m", + " s` `.....---...\027[31;1m....--.``` -/\027[31m", + " +o .--` \027[31;1m/y:` +.\027[31m", + " yo`:. \027[31;1m:o `+-\027[31m", + " y/ \027[31;1m-/` -o/\027[31m", + " .- \027[31;1m::/sy+:.\027[31m", + " / \027[31;1m`-- /\027[31m", + " `: \027[31;1m:`\027[31m", + " `: \027[31;1m:`\027[31m", + " / \027[31;1m/\027[31m", + " .- \027[31;1m-.\027[31m", + " -- \027[31;1m-.\027[31m", + " `:` \027[31;1m`:`", + " \027[31;1m.-- `--.", + " .---.....----.\027[37m" +}; + +drawer.orb = { + " ``` `", + " s` `.....---.......--.``` -/", + " +o .--` /y:` +.", + " yo`:. :o `+-", + " y/ -/` -o/", + " .- ::/sy+:.", + " / `-- /", + " `: :`", + " `: :`", + " / /", + " .- -.", + " -- -.", + " `:` `:`", + " .-- `--.", + " .---.....----." +}; + +drawer.none = {""}; + +drawer.none_shift = {x = 17, y = 0}; + +drawer.menu_position = {x = 6, y = 11}; + +drawer.box_pos_dim = {x = 3, y = 10, w = 41, h = 11}; + +function drawer.drawscreen(menu_opts) + -- drawlogo() must go first. + -- it determines the positions of other elements + drawer.drawlogo(); + drawer.drawbrand(); + drawer.drawbox(); + return drawer.drawmenu(menu_opts); +end + +function drawer.drawmenu(m) + x = drawer.menu_position.x; + y = drawer.menu_position.y; + + -- print the menu and build the alias table + local alias_table = {}; + local entry_num = 0; + for line_num, e in ipairs(m) do + if (e.entry_type ~= "separator") then + entry_num = entry_num + 1; + screen.setcursor(x, y + line_num); + print(entry_num .. ". "..e.name()); + + -- fill the alias table + alias_table[tostring(entry_num)] = e; + for n, a in ipairs(e.alias) do + alias_table[a] = e; + end + else + screen.setcursor(x, y + line_num); + print(e.name()); + end + end + return alias_table; +end + + +function drawer.drawbox() + x = drawer.box_pos_dim.x; + y = drawer.box_pos_dim.y; + w = drawer.box_pos_dim.w; + h = drawer.box_pos_dim.h; + + local hl = string.char(0xCD); + local vl = string.char(0xBA); + + local tl = string.char(0xC9); + local bl = string.char(0xC8); + local tr = string.char(0xBB); + local br = string.char(0xBC); + + screen.setcursor(x, y); print(tl); + screen.setcursor(x, y+h); print(bl); + screen.setcursor(x+w, y); print(tr); + screen.setcursor(x+w, y+h); print(br); + + for i = 1, w-1 do + screen.setcursor(x+i, y); + print(hl); + screen.setcursor(x+i, y+h); + print(hl); + end + + for i = 1, h-1 do + screen.setcursor(x, y+i); + print(vl); + screen.setcursor(x+w, y+i); + print(vl); + end + + screen.setcursor(x+(w/2)-9, y); + print("Welcome to FreeBSD"); +end + +function drawer.draw(x, y, logo) + for i = 1, #logo do + screen.setcursor(x, y + i); + print(logo[i]); + end +end + +function drawer.drawbrand() + local x = tonumber(loader.getenv("loader_brand_x")); + local y = tonumber(loader.getenv("loader_brand_y")); + + if not x then + x = drawer.brand_position.x; + end + if not y then + y = drawer.brand_position.y; + end + + local logo = load("return " .. tostring(loader.getenv("loader_brand")))(); + if not logo then + logo = drawer.fbsd_logo; + end + drawer.draw(x, y, logo); +end + +function drawer.drawlogo() + local x = tonumber(loader.getenv("loader_logo_x")); + local y = tonumber(loader.getenv("loader_logo_y")); + + if not x then + x = drawer.logo_position.x; + end + if not y then + y = drawer.logo_position.y; + end + + local logo = loader.getenv("loader_logo"); + local s = {x = 0, y = 0}; + local colored = color.isEnabled(); + + if logo == "beastie" then + if colored then + logo = drawer.beastie_color; + end + elseif logo == "beastiebw" then + logo = drawer.beastie; + elseif logo == "fbsdbw" then + logo = drawer.fbsd_logo_v; + s = drawer.fbsd_logo_shift; + elseif logo == "orb" then + if colored then + logo = drawer.orb_color; + end + s = drawer.orb_shift; + elseif logo == "orbbw" then + logo = drawer.orb; + s = drawer.orb_shift; + elseif logo == "tribute" then + logo = drawer.fbsd_logo; + elseif logo == "tributebw" then + logo = drawer.fbsd_logo; + elseif logo == "none" then + --centre brand and text if no logo + drawer.brand_position.x = drawer.brand_position.x + drawer.none_shift.x; + drawer.brand_position.y = drawer.brand_position.y + drawer.none_shift.y; + drawer.menu_position.x = drawer.menu_position.x + drawer.none_shift.x; + drawer.menu_position.y = drawer.menu_position.y + drawer.none_shift.y; + drawer.box_pos_dim.x = drawer.box_pos_dim.x + drawer.none_shift.x; + drawer.box_pos_dim.y = drawer.box_pos_dim.y + drawer.none_shift.y; + --prevent redraws from moving menu further + drawer.none_shift.x = 0; + drawer.none_shift.y = 0; + logo = drawer.none; + end + if not logo then + if colored then + logo = drawer.orb_color; + else + logo = drawer.orb; + end + end + drawer.draw(x + s.x, y + s.y, logo); +end + +return drawer Added: head/stand/lua/loader.lua ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/lua/loader.lua Mon Feb 12 15:32:00 2018 (r329167) @@ -0,0 +1,35 @@ +-- +-- Copyright (c) 2015 Pedro Souza +-- 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. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Feb 12 15: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 9A834F0101F; Mon, 12 Feb 2018 15:32: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 71FF379F96; Mon, 12 Feb 2018 15:32: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 6BCF813CB4; Mon, 12 Feb 2018 15:32: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 w1CFW5sh007537; Mon, 12 Feb 2018 15:32:05 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CFW5Rf007536; Mon, 12 Feb 2018 15:32:05 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802121532.w1CFW5Rf007536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Feb 2018 15:32:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329168 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 329168 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 15:32:05 -0000 Author: imp Date: Mon Feb 12 15:32:05 2018 New Revision: 329168 URL: https://svnweb.freebsd.org/changeset/base/329168 Log: Add lua to build script Modified: head/tools/boot/universe.sh Modified: head/tools/boot/universe.sh ============================================================================== --- head/tools/boot/universe.sh Mon Feb 12 15:32:00 2018 (r329167) +++ head/tools/boot/universe.sh Mon Feb 12 15:32:05 2018 (r329168) @@ -76,6 +76,20 @@ for i in \ dobuild $ta _.boot.${ta}.log "" done +# Default build for a goodly selection of architectures with Lua +for i in \ + amd64/amd64 \ + arm/arm arm/armeb arm/armv7 \ + arm64/aarch64 \ + i386/i386 \ + mips/mips mips/mips64 \ + powerpc/powerpc powerpc/powerpc64 \ + sparc64/sparc64 \ + ; do + ta=${i##*/} + dobuild $ta _.boot.${ta}.lua.log "MK_LOADEDER_LUA=yes MK_FORTH=no" +done + # Build w/o ZFS for i in \ amd64/amd64 \ From owner-svn-src-head@freebsd.org Mon Feb 12 15:37: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 28E82F017B0 for ; Mon, 12 Feb 2018 15:37:12 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::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 72B177A58A for ; Mon, 12 Feb 2018 15:37:11 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-wm0-x22b.google.com with SMTP id i186so10333899wmi.4 for ; Mon, 12 Feb 2018 07:37:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=wd3r5yjhPx7nNpdZHEJjQBZZ11Rq9+5K+fr/BDZzKao=; b=q3YvpXnmzE4eg+XEbp9BYdkO+rBzSuFQ5Pa9Yy9VZGGCw5Yb8FIrqSFd+IQOQV0Gy6 r8petWIGSZmrqK0NJ2c3BEbR95tvBX0Iuhwk36vNm4JgSUoJYPeSMJ0TONauWeXv+HHt BfoDLgWE1ESubGq+HB/Qw9kBUe6aTm+wUOpKuSyoMnS/fgqSoQg4CI3ssSMr96cry/qo ctZZ4wJKN8TTgWHU5/JYEiz4dKRsEshkUxloQCL+xa1f08f6D68zwGbujIF+QkeaF69j NqwbqxPycGrDsw59kqlYVq1k4NgGvkKIpCcfdZGTUmjawNuvIPvnZTdSyBbBsckfnjQM WYwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=wd3r5yjhPx7nNpdZHEJjQBZZ11Rq9+5K+fr/BDZzKao=; b=eagJo3s7Ydgpzv9/N44iz3/+tpi+W3gSsbv5mdstLwdR7yzmC4uRfg67uUP4d6hpSQ hPQ13nMiH8rKwsdNH5mghoMaQmL/n9BY1VE9OIQWCeDj+ZA8qogwqt42ms4SJd8KPYk+ piGfRgIzAQhpvp6dqAY9WhG5X/n9oRlTVXbQO8e9WMPtz1NoYhVZw+tp9xqwkrb8YHFF xTm0d1OhT3TfJoJwrrCxoMnKdIP+UfpsG3o/5c29Q1PEWEc88gCfOEIvJil3N4SdB6qC X49MnZT7zEJdgBNMOIektL8We8uBftBnuhVmYpN9GrBLuxFky6ESfJRz81ejn7dBaIvt h0hw== X-Gm-Message-State: APf1xPCFg+j5EyzzaVbiXSo/TER8LooNOk4kl0jg7WPHZAxzvUQWmuse lW05VIUP69KPHeCw2RPlyuZL6A== X-Google-Smtp-Source: AH8x224NPMQZzvcFd/Y4+NDKFeiEr2SsRAMza7aJGZYb52UJsEOMNlfnVe2PDPwQukZ+vY5GL1xdUA== X-Received: by 10.28.171.10 with SMTP id u10mr3761896wme.108.1518449830128; Mon, 12 Feb 2018 07:37:10 -0800 (PST) Received: from mutt-hbsd ([51.15.53.83]) by smtp.gmail.com with ESMTPSA id h32sm8434833wrf.65.2018.02.12.07.37.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Feb 2018 07:37:09 -0800 (PST) Date: Mon, 12 Feb 2018 10:37:00 -0500 From: Shawn Webb To: Tycho Nightingale Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329162 - in head/sys/amd64/vmm: amd intel Message-ID: <20180212153700.xbmbctnjtawum76h@mutt-hbsd> References: <201802121445.w1CEjR3n082516@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="pknvq5xyabqlqd5w" Content-Disposition: inline In-Reply-To: <201802121445.w1CEjR3n082516@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hbsd 12.0-CURRENT FreeBSD 12.0-CURRENT X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20171215 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 15:37:12 -0000 --pknvq5xyabqlqd5w Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 12, 2018 at 02:45:27PM +0000, Tycho Nightingale wrote: > Author: tychon > Date: Mon Feb 12 14:45:27 2018 > New Revision: 329162 > URL: https://svnweb.freebsd.org/changeset/base/329162 >=20 > Log: > Provide further mitigation against CVE-2017-5715 by flushing the > return stack buffer (RSB) upon returning from the guest. > =20 > This was inspired by this linux commit: > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/comm= it/arch/x86/kvm?id=3D117cc7a908c83697b0b737d15ae1eb5943afe35b > =20 > Reviewed by: grehan > Sponsored by: Dell EMC Isilon > Differential Revision: https://reviews.freebsd.org/D14272 >=20 > Modified: > head/sys/amd64/vmm/amd/svm_support.S > head/sys/amd64/vmm/intel/vmcs.c > head/sys/amd64/vmm/intel/vmx.h > head/sys/amd64/vmm/intel/vmx_support.S >=20 > Modified: head/sys/amd64/vmm/amd/svm_support.S > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/vmm/amd/svm_support.S Mon Feb 12 14:44:21 2018 (r32916= 1) > +++ head/sys/amd64/vmm/amd/svm_support.S Mon Feb 12 14:45:27 2018 (r32916= 2) > @@ -113,6 +113,23 @@ ENTRY(svm_launch) > movq %rdi, SCTX_RDI(%rax) > movq %rsi, SCTX_RSI(%rax) > =20 > + /* > + * To prevent malicious branch target predictions from > + * affecting the host, overwrite all entries in the RSB upon > + * exiting a guest. > + */ > + mov $16, %ecx /* 16 iterations, two calls per loop */ > + mov %rsp, %rax > +0: call 2f /* create an RSB entry. */ > +1: pause > + call 1b /* capture rogue speculation. */ > +2: call 2f /* create an RSB entry. */ > +1: pause > + call 1b /* capture rogue speculation. */ > +2: sub $1, %ecx > + jnz 0b > + mov %rax, %rsp > + > /* Restore host state */ > pop %r15 > pop %r14 >=20 For amd systems, isn't use of lfence required for performance reasons[1]? Or am I conflating two things? 1: https://reviews.llvm.org/D41723 Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --pknvq5xyabqlqd5w Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlqBtJgACgkQaoRlj1JF bu7tYA/+NG5TaLVeH6SHXEJCy3BfCEym7Wa0RfYR87Brgnc/ETKSn/TsQUDeD4Qp qXHb18YnfoFbP7VPxPyL+flUDAndzAGPDZarHymcK9N1sOHH36vGnee0zRa5RAaR 3YOJGWmVqTos1Mvp0eBc5B/xMtxF1l8eO5wzdXIL38/yifhtec7hvGCm7aHx4jmo U3UMsMMd+1MYEx0xb7rj/4XT38dSCgySKiTPrrohD7TYsdUH61yVLb5lpOCAU/Z8 X/qE02RtjajGBKPeC1iJOBCOv1OrpPv7951sKEs0MCiLbCmvhKZep9fj87IpF+br W2E0Y7NIXywVAeyWBbG6S6ucP9YRHszLwc1+MhKvagEfB3dEQiHl9izH4fPavMh8 lk7AHuBrgADfAEWcnkjh4xhdv9PeISJ7kBhmSKumjYm88LtoPjMPzsRsEoKM4bza eiEAQjQjDj5MDaF26bJ0jxwmo7bLDuq5N6Qh+lr1xbqV3wWvwPgebXcv0WytZw3O tKqpOMRHWUFCAplcLrciFk3PAAjmUwKLq/7VuQYUMJz/nJW4hSgFUglFfl2/Mong CbA+LfFLg8IRQkpR8z9cCQ5x1GFwJkcH20T2JjN5SonXw9EESySNgzaj/yFlL2lS o0y9dZLMyGuJ/qfAnfBDxSW4qMedc/JmJ20RiwOlSMgJ53iXHn4= =gOIE -----END PGP SIGNATURE----- --pknvq5xyabqlqd5w-- From owner-svn-src-head@freebsd.org Mon Feb 12 15: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 60038F03501; Mon, 12 Feb 2018 15:58:57 +0000 (UTC) (envelope-from joerg@bec.de) Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [IPv6:2001:4b98:c:538::196]) (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 F2A1C7BDB9; Mon, 12 Feb 2018 15:58:56 +0000 (UTC) (envelope-from joerg@bec.de) Received: from britannica.bec.de (p200300D2ABCCC4104639C4FFFE599710.dip0.t-ipconnect.de [IPv6:2003:d2:abcc:c410:4639:c4ff:fe59:9710]) (Authenticated sender: joerg@bec.de) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 0A3AF172677; Mon, 12 Feb 2018 16:58:46 +0100 (CET) Date: Mon, 12 Feb 2018 16:57:49 +0100 From: Joerg Sonnenberger To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329164 - in head: include sys/amd64/include sys/i386/include sys/mips/include sys/powerpc/include sys/sparc64/include Message-ID: <20180212155749.GA27160@britannica.bec.de> References: <201802121448.w1CEmEUX082701@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201802121448.w1CEmEUX082701@repo.freebsd.org> User-Agent: Mutt/1.9.0 (2017-09-02) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 15:58:57 -0000 On Mon, Feb 12, 2018 at 02:48:14PM +0000, Warner Losh wrote: > Author: imp > Date: Mon Feb 12 14:48:14 2018 > New Revision: 329164 > URL: https://svnweb.freebsd.org/changeset/base/329164 > > Log: > We don't support gcc < 4.2.1, so varargs.h now is just #error > always. Unifdef for versions prior to 4.2.1 and remove now-unused > header files. In my experience it is better to really drop it. Keeping the header with an #error is just creating *more* pain than having no header at all. Joerg From owner-svn-src-head@freebsd.org Mon Feb 12 16: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 18EB5F03F54 for ; Mon, 12 Feb 2018 16:07:35 +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 8E6E97C5F9 for ; Mon, 12 Feb 2018 16:07:34 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x242.google.com with SMTP id c80so7076846itb.4 for ; Mon, 12 Feb 2018 08:07:34 -0800 (PST) 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=BTrrIY/dCtCcuG4IBfeWAjogpXCm6CGFAnP3niGoTts=; b=Ldwr1ql0CtA+41RbiUo97oy/YuZOoyhytkhygwe0ywwwlAE3z9E4QfqBc6hQ3TWZKi EBRdFbXTrgI90p+20rQpALn7Cnf3CK6N3EFaVLVH+mo7kXAvzl6p33wkCGXESDHlQ3cA QLYEssWTH0NNKA6MujcMqcDtwtZUIPHXlzgfEoqidhuIFDrukZiXF3fc6YJQ8kjMySu8 NebpPMSQb5iw9kxhtfIZlA0xZ7LPFfevVj65sGLM8sGxNcyYG1V9gY5jSV9hLhzDGtkj n8sp/sVYxh+e5HHZ/VX75HDY2Epplk04r5QScc6JbJm385sjjwKFWaFu1S+M6aO7UDfh 1uNA== 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=BTrrIY/dCtCcuG4IBfeWAjogpXCm6CGFAnP3niGoTts=; b=gZALmBuiGF39JO6BQFdONvkZmTyVfb2Nja54/4nGgihJbAVnEpFEbfeKeEeGHveMEL oIVbt/ivlVt4oE1IOvOTAvkPJn/sZ12r0Q+vP8f3nCnOqmOpooi0GugbEP59RuZx0DZP vb9WQvwyjkSBRco/nH5l4WWYy1NTBci3vgnhsiELfx+g95CF/Wc2sliZnPjC5UzQp3yv O6HetTFJV8bmWMUYbm+uWIohhQOtLFt2HEVYFhMNIgOolnOICARVOQ8KnZxlsyyllq7X TVEZzLEyIdQeVh/0vZbNvqW+E5kZmpHb06H/5Z3UST2GeVNwahF8cNaSaqH6VdVN1q4s mIpg== X-Gm-Message-State: APf1xPCRFh6Wo/T/rW+Ck3e5mdd3jxwQT5TdyyUi1f67DUQSmv+MaWRv Ugo781Cb2ab2t2bO/clWLr0+VbkpxHI/q3gjOzWW/A== X-Google-Smtp-Source: AH8x225kTV2bR8lvQKPp+N0LullcDdmyhC7CRXP5oM0XHYIxzuykzqpig2BhqvlOPtSRKfdhyvakjck38TTIBngoXfA= X-Received: by 10.36.54.66 with SMTP id l63mr6078740itl.50.1518451653713; Mon, 12 Feb 2018 08:07:33 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Mon, 12 Feb 2018 08:07:32 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: <20180212155749.GA27160@britannica.bec.de> References: <201802121448.w1CEmEUX082701@repo.freebsd.org> <20180212155749.GA27160@britannica.bec.de> From: Warner Losh Date: Mon, 12 Feb 2018 09:07:32 -0700 X-Google-Sender-Auth: NtApJwrOUejAnqZxKCpiFBuQ_a8 Message-ID: Subject: Re: svn commit: r329164 - in head: include sys/amd64/include sys/i386/include sys/mips/include sys/powerpc/include sys/sparc64/include To: Joerg Sonnenberger 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.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 16:07:35 -0000 On Mon, Feb 12, 2018 at 8:57 AM, Joerg Sonnenberger wrote: > On Mon, Feb 12, 2018 at 02:48:14PM +0000, Warner Losh wrote: > > Author: imp > > Date: Mon Feb 12 14:48:14 2018 > > New Revision: 329164 > > URL: https://svnweb.freebsd.org/changeset/base/329164 > > > > Log: > > We don't support gcc < 4.2.1, so varargs.h now is just #error > > always. Unifdef for versions prior to 4.2.1 and remove now-unused > > header files. > > In my experience it is better to really drop it. Keeping the header with > an #error is just creating *more* pain than having no header at all. > My change didn't change anything here. It already was a #error. I just changed it from #if #error #endif to #error. I'll leave it to the compliance folks to jump in and remove it. It's a posix header, it seems. But nobody is using it and it can't be causing widespread problems today or it would be on people's radar... It's not. Warner From owner-svn-src-head@freebsd.org Mon Feb 12 16:25: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 9ADCCF057B7; Mon, 12 Feb 2018 16:25:57 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CB457D42A; Mon, 12 Feb 2018 16:25:57 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 432611451F; Mon, 12 Feb 2018 16:25:57 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1CGPv5l034019; Mon, 12 Feb 2018 16:25:57 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CGPu81034017; Mon, 12 Feb 2018 16:25:56 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201802121625.w1CGPu81034017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 12 Feb 2018 16:25:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329170 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 329170 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 16:25:57 -0000 Author: ian Date: Mon Feb 12 16:25:56 2018 New Revision: 329170 URL: https://svnweb.freebsd.org/changeset/base/329170 Log: Replace the existing print_ct() private debugging function with a set of three public functions to format and print the three major data structures used by realtime clock drivers (clocktime, bcd_clocktime, and timespec). Modified: head/sys/kern/subr_clock.c head/sys/sys/clock.h Modified: head/sys/kern/subr_clock.c ============================================================================== --- head/sys/kern/subr_clock.c Mon Feb 12 15:48:12 2018 (r329169) +++ head/sys/kern/subr_clock.c Mon Feb 12 16:25:56 2018 (r329170) @@ -108,6 +108,14 @@ static const int recent_base_year = 2017; static const int recent_base_days = 17167; /* + * Table to 'calculate' pow(10, 9 - nsdigits) via lookup of nsdigits. + * Before doing the lookup, the code asserts 0 <= nsdigits <= 9. + */ +static u_int nsdivisors[] = { + 1000000000, 100000000, 10000000, 1000000, 100000, 10000, 1000, 100, 10, 1 +}; + +/* * This inline avoids some unnecessary modulo operations * as compared with the usual macro: * ( ((year % 4) == 0 && @@ -131,23 +139,15 @@ leapyear(int year) return (rv); } -static void -print_ct(const struct clocktime *ct) -{ - printf("[%04d-%02d-%02d %02d:%02d:%02d]", - ct->year, ct->mon, ct->day, - ct->hour, ct->min, ct->sec); -} - int clock_ct_to_ts(const struct clocktime *ct, struct timespec *ts) { int i, year, days; if (ct_debug) { - printf("ct_to_ts("); - print_ct(ct); - printf(")"); + printf("ct_to_ts(["); + clock_print_ct(ct, 9); + printf("])"); } /* @@ -288,10 +288,10 @@ clock_ts_to_ct(const struct timespec *ts, struct clock ct->sec = rsec; ct->nsec = ts->tv_nsec; if (ct_debug) { - printf("ts_to_ct(%jd.%09ld) = ", + printf("ts_to_ct(%jd.%09ld) = [", (intmax_t)ts->tv_sec, ts->tv_nsec); - print_ct(ct); - printf("\n"); + clock_print_ct(ct, 9); + printf("]\n"); } KASSERT(ct->year >= 0 && ct->year < 10000, @@ -335,6 +335,51 @@ clock_ts_to_bcd(const struct timespec *ts, struct bcd_ bct->sec = TOBCD(ct.sec); bct->dow = ct.dow; bct->nsec = ct.nsec; +} + +void +clock_print_bcd(const struct bcd_clocktime *bct, int nsdigits) +{ + + KASSERT(nsdigits >= 0 && nsdigits <= 9, ("bad nsdigits %d", nsdigits)); + + if (nsdigits > 0) { + printf("%4.4x-%2.2x-%2.2x %2.2x:%2.2x:%2.2x.%*.*ld", + bct->year, bct->mon, bct->day, + bct->hour, bct->min, bct->sec, + nsdigits, nsdigits, bct->nsec / nsdivisors[nsdigits]); + } else { + printf("%4.4x-%2.2x-%2.2x %2.2x:%2.2x:%2.2x", + bct->year, bct->mon, bct->day, + bct->hour, bct->min, bct->sec); + } +} + +void +clock_print_ct(const struct clocktime *ct, int nsdigits) +{ + + KASSERT(nsdigits >= 0 && nsdigits <= 9, ("bad nsdigits %d", nsdigits)); + + if (nsdigits > 0) { + printf("%04d-%02d-%02d %02d:%02d:%02d.%*.*ld", + ct->year, ct->mon, ct->day, + ct->hour, ct->min, ct->sec, + nsdigits, nsdigits, ct->nsec / nsdivisors[nsdigits]); + } else { + printf("%04d-%02d-%02d %02d:%02d:%02d", + ct->year, ct->mon, ct->day, + ct->hour, ct->min, ct->sec); + } +} + +void +clock_print_ts(const struct timespec *ts, int nsdigits) +{ + struct clocktime ct; + + clock_ts_to_ct(ts, &ct); + clock_print_ct(&ct, nsdigits); } int Modified: head/sys/sys/clock.h ============================================================================== --- head/sys/sys/clock.h Mon Feb 12 15:48:12 2018 (r329169) +++ head/sys/sys/clock.h Mon Feb 12 16:25:56 2018 (r329170) @@ -182,6 +182,15 @@ void timespec2fattime(const struct timespec *tsp, int void fattime2timespec(unsigned dd, unsigned dt, unsigned dh, int utc, struct timespec *tsp); +/* + * Print a [bcd_]clocktime or timespec, optionally with fractional seconds. The + * nsdig argument can range from 0-9, and specifies how many decimal digits to + * display for fractional seconds. + */ +void clock_print_bcd(const struct bcd_clocktime *bct, int nsdig); +void clock_print_ct(const struct clocktime *ct, int nsdig); +void clock_print_ts(const struct timespec *ts, int nsdig); + #endif /* _KERNEL */ #endif /* !_SYS_CLOCK_H_ */ From owner-svn-src-head@freebsd.org Mon Feb 12 16:39: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 15237F0698F; Mon, 12 Feb 2018 16:39:18 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f52.google.com (mail-it0-f52.google.com [209.85.214.52]) (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 A6A097DEA9; Mon, 12 Feb 2018 16:39:17 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f52.google.com with SMTP id d10so1285206itj.2; Mon, 12 Feb 2018 08:39:17 -0800 (PST) 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=9LuoQ/EAiVpG2uwB/uTY3xAkNnIo4wiBv3WGZchhiAk=; b=GgQS+LCdfkF/6huGbEeAnGyY20EhIb/koya4F8Ps6zrErH6i8iOF1lrW3fbCcP/oM0 ysuPfToP9zlu7YUJw196EJ7/BKia7ThzmQE7g52XrhiX2eXwWtl6tjjf85749CjdVWFU FfvQNGKxNH73UkLd25cdcHb6B3HzlHXmObD917VMc1D+ovhdV/rEeeCmMulW5EulKC8V kVAav1YzXOCvCtBmOKYEx0vByAyS9ywc4JUXfV9GHBmIh+y8p319lil6k9aXgXxnlRHA SMSp3C5+hQ8UXLu1e2sktTe0ZU/4KrAtwFQL5q/D07yUAEDW6B2weA3KmfV5CxOkpo9t KaJQ== X-Gm-Message-State: APf1xPCcvNTpBBeOsj/X9XJ4LsyXVHX/Rah3LJgmQ56NLkHs2dqn9TZ5 0bW6K1kml0gbYgnvdbZOnCjSoXaI X-Google-Smtp-Source: AH8x224FH6yp0K2sFvF0keA5XoDZC3W84qOTwb9cz3sBP6ilsaQotjn/4tZCXts6UcBYLlhICS7nRg== X-Received: by 10.36.105.138 with SMTP id e132mr6131898itc.137.1518453556514; Mon, 12 Feb 2018 08:39:16 -0800 (PST) Received: from mail-it0-f45.google.com (mail-it0-f45.google.com. [209.85.214.45]) by smtp.gmail.com with ESMTPSA id s8sm7712170itb.39.2018.02.12.08.39.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Feb 2018 08:39:16 -0800 (PST) Received: by mail-it0-f45.google.com with SMTP id k6so7209448ita.3; Mon, 12 Feb 2018 08:39:16 -0800 (PST) X-Received: by 10.36.192.131 with SMTP id u125mr6134567itf.119.1518453556052; Mon, 12 Feb 2018 08:39:16 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.30.149 with HTTP; Mon, 12 Feb 2018 08:39:15 -0800 (PST) In-Reply-To: <201802120655.w1C6tmCO080469@slippy.cwsent.com> References: <201802120651.w1C6pKqF042318@repo.freebsd.org> <201802120655.w1C6tmCO080469@slippy.cwsent.com> From: Conrad Meyer Date: Mon, 12 Feb 2018 08:39:15 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r329154 - in head/etc: defaults devd To: Cy Schubert 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.25 Precedence: list List-Id: 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, 12 Feb 2018 16:39:18 -0000 On Sun, Feb 11, 2018 at 10:55 PM, Cy Schubert wrote: > We might want to consider > moving devmatch to /sbin or document that /usr and / be merged. +1. Installing base to a single filesystem image is not a hardship and makes many things simpler. Base is not so large that this is as costly as it was in the 1970s. It doesn't have to apply retroactively, of course, but maybe support can be follow the usual deprecation process. Administrators can still keep separate /usr/local, /usr/src, /usr/obj, /var/log, etc, as Andriy suggests. None of these impact the functioning of the early base system nearly so badly as /usr/*bin, /usr/share, and /usr/lib. The other option is just putting all the base libraries and binaries in /lib and /*bin (unfortunately, I don't think /share exists). The current sorting of items into /usr or not /usr is haphazard. Best, Conrad From owner-svn-src-head@freebsd.org Mon Feb 12 17:27: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 9C189F0A9F3; Mon, 12 Feb 2018 17:27:50 +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 52820803BE; Mon, 12 Feb 2018 17:27:50 +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 4D8AB14EE6; Mon, 12 Feb 2018 17:27:50 +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 w1CHRoR6063773; Mon, 12 Feb 2018 17:27:50 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CHRo1I063772; Mon, 12 Feb 2018 17:27:50 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201802121727.w1CHRo1I063772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Mon, 12 Feb 2018 17:27:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329171 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 329171 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 17:27:50 -0000 Author: jtl Date: Mon Feb 12 17:27:50 2018 New Revision: 329171 URL: https://svnweb.freebsd.org/changeset/base/329171 Log: Mark the pages used for the initial page-table entries as wired. This makes them consistent with the way other page-table pages are allocated. It also provides the rest of the VM system a good clue that these pages are used. Reviewed by: alc, kib, markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D14269 Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Mon Feb 12 16:25:56 2018 (r329170) +++ head/sys/amd64/amd64/pmap.c Mon Feb 12 17:27:50 2018 (r329171) @@ -1244,7 +1244,9 @@ pmap_init(void) ("pmap_init: page table page is out of range")); mpte->pindex = pmap_pde_pindex(KERNBASE) + i; mpte->phys_addr = KPTphys + (i << PAGE_SHIFT); + mpte->wire_count = 1; } + atomic_add_int(&vm_cnt.v_wire_count, nkpt); /* * If the kernel is running on a virtual machine, then it must assume From owner-svn-src-head@freebsd.org Mon Feb 12 17:29: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 BCB9BF0ABC5; Mon, 12 Feb 2018 17:29:09 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: from mail-wr0-x234.google.com (mail-wr0-x234.google.com [IPv6:2a00:1450:400c:c0c::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 3A3E3805A0; Mon, 12 Feb 2018 17:29:09 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: by mail-wr0-x234.google.com with SMTP id k9so2235952wre.9; Mon, 12 Feb 2018 09:29:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=KJyPgrLSJv2MRVwEjilf5JZVdbWfzsAZvYejWwgD/7o=; b=mX6egFpu25eZXXYPQstSvUWJJxjCW1YiV0HBXHomeNR4ooDf/YgWB5kXlG5xnBIqWg RFmiKOpu8s1QSRgThQe1fEQxRtCGZ4suJyuqvFw2s+bMUM4Uy21s2YHPC3xVYEbHkVO1 itIudwtFSDissXeFFJGkBrWHvO3LjdIYWOZRfoCZebEAgu/oskLI2JMvI1p5zdYL+3KE 8zRGBD0HaVTsp0QlNMr1sj5+JRWM+cbzubahQLRg0kCwtjqEYOGnAXV40glJVx61A1uD lhBuRqYpLCMy3InlaM/qxQXVDmwIYQg8FZH2d8ntM41ooMCNluHXIf5uu2iounHFNkmC y4NA== 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; bh=KJyPgrLSJv2MRVwEjilf5JZVdbWfzsAZvYejWwgD/7o=; b=oMXzI5X6P+vqSM53dV8B40ZJHEGKa9amy3ZlDU3I2r8Hln/0PRS0Gwhz93e/bVy/z2 z/T5RwBiBMTLWZGz89xwtxVYDQUyI428oJWFPZuwWPKdnjgNt5xVbfBF4Z+l3Nk2DpL5 HEZhcCqChmROx9meSXy5rj1zmUci9brTuOEnCPYJgf2x1jcNVYZBHkyktTImD6sJFZKD c5hzrXIs2nhRY3TiJXI4zZT4RAehqaaIE8H6mwyXIMfbYxMpws0f9FzbA24C0c7yRpX3 wib59dmBrmH5PqOUA6ZH2tBzfktsBTYyBMYdXFy1/3NFp0OXf9zL+dtLDfvqhC9uZuH8 8kmw== X-Gm-Message-State: APf1xPAw5dV8K2V5ilLijn2opkWCi6Qbbv9iSO95bdU276FJp/qHSj2F k4acvFnDurefVI/z45sMZhCpl67e7PPaQGP478BQAw== X-Google-Smtp-Source: AH8x225HXufrU+xAxFuNdFOAZ13bH8noQW8ePj9nuEGBFc71wGQgrErrXggB30Ky8usO66hX3va8LTLiYSSftx8xfdw= X-Received: by 10.223.132.166 with SMTP id 35mr10404664wrg.183.1518456547997; Mon, 12 Feb 2018 09:29:07 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.192.76 with HTTP; Mon, 12 Feb 2018 09:29:07 -0800 (PST) In-Reply-To: <201802121727.w1CHRo1I063772@repo.freebsd.org> References: <201802121727.w1CHRo1I063772@repo.freebsd.org> From: Jonathan Looney Date: Mon, 12 Feb 2018 12:29:07 -0500 Message-ID: Subject: Re: svn commit: r329171 - head/sys/amd64/amd64 To: 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.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 17:29:10 -0000 On Mon, Feb 12, 2018 at 12:27 PM, Jonathan T. Looney wrote: > Author: jtl > Date: Mon Feb 12 17:27:50 2018 > New Revision: 329171 > URL: https://svnweb.freebsd.org/changeset/base/329171 > > Log: > Mark the pages used for the initial page-table entries as wired. This > makes them consistent with the way other page-table pages are allocated. > It also provides the rest of the VM system a good clue that these pages > are used. > > Reviewed by: alc, kib, markj > Sponsored by: Netflix > Differential Revision: https://reviews.freebsd.org/D14269 Should have also said... MFC after: 2 weeks From owner-svn-src-head@freebsd.org Mon Feb 12 17:33: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 CF50DF0B298; Mon, 12 Feb 2018 17:33:15 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7083680BE7; Mon, 12 Feb 2018 17:33:15 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4BA5615083; Mon, 12 Feb 2018 17:33:15 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1CHXF1W068959; Mon, 12 Feb 2018 17:33:15 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CHXF9N068957; Mon, 12 Feb 2018 17:33:15 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201802121733.w1CHXF9N068957@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 12 Feb 2018 17:33:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329172 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 329172 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 17:33:16 -0000 Author: ian Date: Mon Feb 12 17:33:14 2018 New Revision: 329172 URL: https://svnweb.freebsd.org/changeset/base/329172 Log: Add a set of convenience routines for RTC drivers to use for debug output, and a debug.clock_show_io sysctl to control debugging output. Modified: head/sys/kern/subr_rtc.c head/sys/sys/clock.h Modified: head/sys/kern/subr_rtc.c ============================================================================== --- head/sys/kern/subr_rtc.c Mon Feb 12 17:27:50 2018 (r329171) +++ head/sys/kern/subr_rtc.c Mon Feb 12 17:33:14 2018 (r329172) @@ -76,6 +76,10 @@ __FBSDID("$FreeBSD$"); #include "clock_if.h" +static int show_io; +SYSCTL_INT(_debug, OID_AUTO, clock_show_io, CTLFLAG_RWTUN, &show_io, 0, + "Enable debug printing of RTC clock I/O; 1=reads, 2=writes, 3=both."); + /* XXX: should be kern. now, it's no longer machdep. */ static int disable_rtc_set; SYSCTL_INT(_machdep, OID_AUTO, disable_rtc_set, CTLFLAG_RW, &disable_rtc_set, @@ -142,6 +146,60 @@ settime_task_func(void *arg, int pending) ts.tv_nsec = 0; } CLOCK_SETTIME(rtc->clockdev, &ts); +} + +static void +clock_dbgprint_hdr(device_t dev, int rw) +{ + struct timespec now; + + getnanotime(&now); + device_printf(dev, "%s at ", (rw & CLOCK_DBG_READ) ? "read " : "write"); + clock_print_ts(&now, 9); + printf(": "); +} + +void +clock_dbgprint_bcd(device_t dev, int rw, const struct bcd_clocktime *bct) +{ + + if (show_io & rw) { + clock_dbgprint_hdr(dev, rw); + clock_print_bcd(bct, 9); + printf("\n"); + } +} + +void +clock_dbgprint_ct(device_t dev, int rw, const struct clocktime *ct) +{ + + if (show_io & rw) { + clock_dbgprint_hdr(dev, rw); + clock_print_ct(ct, 9); + printf("\n"); + } +} + +void +clock_dbgprint_err(device_t dev, int rw, int err) +{ + + if (show_io & rw) { + clock_dbgprint_hdr(dev, rw); + printf("error = %d\n", err); + } +} + +void +clock_dbgprint_ts(device_t dev, int rw, const struct timespec *ts) +{ + + if (show_io & rw) { + clock_dbgprint_hdr(dev, rw); + clock_print_ts(ts, 9); + printf("\n"); + } } void Modified: head/sys/sys/clock.h ============================================================================== --- head/sys/sys/clock.h Mon Feb 12 17:27:50 2018 (r329171) +++ head/sys/sys/clock.h Mon Feb 12 17:33:14 2018 (r329172) @@ -191,6 +191,18 @@ void clock_print_bcd(const struct bcd_clocktime *bct, void clock_print_ct(const struct clocktime *ct, int nsdig); void clock_print_ts(const struct timespec *ts, int nsdig); +/* + * Debugging helpers for RTC clock drivers. Print a [bcd_]clocktime or + * timespec, only if rtc clock debugging has been enabled. The rw argument is + * one of CLOCK_DBG_READ or CLOCK_DBG_WRITE. + */ +#define CLOCK_DBG_READ 0x01 +#define CLOCK_DBG_WRITE 0x02 +void clock_dbgprint_bcd(device_t dev, int rw, const struct bcd_clocktime *bct); +void clock_dbgprint_ct(device_t dev, int rw, const struct clocktime *ct); +void clock_dbgprint_err(device_t dev, int rw, int err); +void clock_dbgprint_ts(device_t dev, int rw, const struct timespec *ts); + #endif /* _KERNEL */ #endif /* !_SYS_CLOCK_H_ */ From owner-svn-src-head@freebsd.org Mon Feb 12 17:41: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 0A63EF0BD27; Mon, 12 Feb 2018 17:41:12 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B4A94810E2; Mon, 12 Feb 2018 17:41:11 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF93F150BD; Mon, 12 Feb 2018 17:41:11 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1CHfBlP069972; Mon, 12 Feb 2018 17:41:11 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CHfBWa069971; Mon, 12 Feb 2018 17:41:11 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201802121741.w1CHfBWa069971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 12 Feb 2018 17:41:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329173 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 329173 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 17:41:12 -0000 Author: ian Date: Mon Feb 12 17:41:11 2018 New Revision: 329173 URL: https://svnweb.freebsd.org/changeset/base/329173 Log: Add a new sysctl, debug.clock_do_io, to allow manully triggering a one-shot read or write of all registered realtime clocks. In the read case, the values read are simply discarded. For writes, there's no alternative but to actually write the current system time to the device. Modified: head/sys/kern/subr_rtc.c Modified: head/sys/kern/subr_rtc.c ============================================================================== --- head/sys/kern/subr_rtc.c Mon Feb 12 17:33:14 2018 (r329172) +++ head/sys/kern/subr_rtc.c Mon Feb 12 17:41:11 2018 (r329173) @@ -80,6 +80,11 @@ static int show_io; SYSCTL_INT(_debug, OID_AUTO, clock_show_io, CTLFLAG_RWTUN, &show_io, 0, "Enable debug printing of RTC clock I/O; 1=reads, 2=writes, 3=both."); +static int sysctl_clock_do_io(SYSCTL_HANDLER_ARGS); +SYSCTL_PROC(_debug, OID_AUTO, clock_do_io, CTLTYPE_INT | CTLFLAG_RW, + 0, 0, sysctl_clock_do_io, "I", + "Trigger one-time IO on RTC clocks; 1=read (and discard), 2=write"); + /* XXX: should be kern. now, it's no longer machdep. */ static int disable_rtc_set; SYSCTL_INT(_machdep, OID_AUTO, disable_rtc_set, CTLFLAG_RW, &disable_rtc_set, @@ -280,6 +285,36 @@ clock_schedule(device_t clockdev, u_int offsetns) sx_xunlock(&rtc_list_lock); } +static int +read_clocks(struct timespec *ts, bool debug_read) +{ + struct rtc_instance *rtc; + int error; + + error = ENXIO; + sx_xlock(&rtc_list_lock); + LIST_FOREACH(rtc, &rtc_list, rtc_entries) { + if ((error = CLOCK_GETTIME(rtc->clockdev, ts)) != 0) + continue; + if (ts->tv_sec < 0 || ts->tv_nsec < 0) { + error = EINVAL; + continue; + } + if (!(rtc->flags & CLOCKF_GETTIME_NO_ADJ)) { + timespecadd(ts, &rtc->resadj); + ts->tv_sec += utc_offset(); + } + if (!debug_read) { + if (bootverbose) + device_printf(rtc->clockdev, + "providing initial system time\n"); + break; + } + } + sx_xunlock(&rtc_list_lock); + return (error); +} + /* * Initialize the system time. Must be called from a context which does not * restrict any locking or sleeping that clock drivers may need to do. @@ -296,28 +331,9 @@ void inittodr(time_t base) { struct timespec ts; - struct rtc_instance *rtc; int error; - error = ENXIO; - sx_xlock(&rtc_list_lock); - LIST_FOREACH(rtc, &rtc_list, rtc_entries) { - if ((error = CLOCK_GETTIME(rtc->clockdev, &ts)) != 0) - continue; - if (ts.tv_sec < 0 || ts.tv_nsec < 0) { - error = EINVAL; - continue; - } - if (!(rtc->flags & CLOCKF_GETTIME_NO_ADJ)) { - timespecadd(&ts, &rtc->resadj); - ts.tv_sec += utc_offset(); - } - if (bootverbose) - device_printf(rtc->clockdev, - "providing initial system time\n"); - break; - } - sx_xunlock(&rtc_list_lock); + error = read_clocks(&ts, false); /* * Do not report errors from each clock; it is expected that some clocks @@ -379,4 +395,30 @@ resettodr(void) &rtc->stask, -sbt, 0, C_PREL(31)); } sx_xunlock(&rtc_list_lock); +} + +static int +sysctl_clock_do_io(SYSCTL_HANDLER_ARGS) +{ + struct timespec ts_discard; + int error, value; + + value = 0; + error = sysctl_handle_int(oidp, &value, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + + switch (value) { + case CLOCK_DBG_READ: + if (read_clocks(&ts_discard, true) == ENXIO) + printf("No registered RTC clocks\n"); + break; + case CLOCK_DBG_WRITE: + resettodr(); + break; + default: + return (EINVAL); + } + + return (0); } From owner-svn-src-head@freebsd.org Mon Feb 12 17: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 0F6BAF0BF3F; Mon, 12 Feb 2018 17:42: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 B618481378; Mon, 12 Feb 2018 17:42:28 +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 B10A315212; Mon, 12 Feb 2018 17:42:28 +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 w1CHgSmp072923; Mon, 12 Feb 2018 17:42:28 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CHgSTd072922; Mon, 12 Feb 2018 17:42:28 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201802121742.w1CHgSTd072922@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 12 Feb 2018 17:42:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329174 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 329174 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 17:42:29 -0000 Author: asomers Date: Mon Feb 12 17:42:28 2018 New Revision: 329174 URL: https://svnweb.freebsd.org/changeset/base/329174 Log: Fix a comment. No functional change. MFC after: 3 weeks Sponsored by: Spectra Logic Corp Modified: head/sys/sys/aio.h Modified: head/sys/sys/aio.h ============================================================================== --- head/sys/sys/aio.h Mon Feb 12 17:41:11 2018 (r329173) +++ head/sys/sys/aio.h Mon Feb 12 17:42:28 2018 (r329174) @@ -54,7 +54,7 @@ #define LIO_WAIT 0x1 /* - * Maximum number of allowed LIO operations + * Maximum number of operations in a single lio_listio call */ #define AIO_LISTIO_MAX 16 From owner-svn-src-head@freebsd.org Mon Feb 12 18:31: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 E5595F0FCE9; Mon, 12 Feb 2018 18:31:11 +0000 (UTC) (envelope-from tychon@freebsd.org) Received: from pb-smtp1.pobox.com (pb-smtp1.pobox.com [64.147.108.70]) (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 8C99A83C99; Mon, 12 Feb 2018 18:31:11 +0000 (UTC) (envelope-from tychon@freebsd.org) Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id C24DDCBA7B; Mon, 12 Feb 2018 13:31:05 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=content-type :mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=sasl; bh= Dt9xzJCkQvs4+fRd2LIkPp/nWo0=; b=ADpYwdnej58Cg5hfZMvifreOI1GUMHMp 3y8jEq498W1jYEX9EI573Kf4kaGVBvQKKhHDrGa7zqgOxPg4k3QdKLorY9QxhfU6 R5SxabIT95Ukadq34e5Ku1rZe3MX8gLpMQEm0bDRNB5WccwGvEuAwNR8xWtC/pbo DXgg7ISiiw0= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id AF280CBA7A; Mon, 12 Feb 2018 13:31:05 -0500 (EST) Received: from [10.0.1.4] (unknown [146.115.75.63]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id 67E81CBA79; Mon, 12 Feb 2018 13:31:04 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Subject: Re: svn commit: r329162 - in head/sys/amd64/vmm: amd intel From: Tycho Nightingale In-Reply-To: <20180212153700.xbmbctnjtawum76h@mutt-hbsd> Date: Mon, 12 Feb 2018 13:31:02 -0500 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201802121445.w1CEjR3n082516@repo.freebsd.org> <20180212153700.xbmbctnjtawum76h@mutt-hbsd> To: Shawn Webb X-Mailer: Apple Mail (2.3445.5.20) X-Pobox-Relay-ID: E23EF608-1022-11E8-97B5-692D1A68708C-09779102!pb-smtp1.pobox.com X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 18:31:12 -0000 Hi, > On Feb 12, 2018, at 10:37 AM, Shawn Webb = wrote: >=20 > On Mon, Feb 12, 2018 at 02:45:27PM +0000, Tycho Nightingale wrote: >> Author: tychon >> Date: Mon Feb 12 14:45:27 2018 >> New Revision: 329162 >> URL: https://svnweb.freebsd.org/changeset/base/329162 >>=20 >> Log: >> Provide further mitigation against CVE-2017-5715 by flushing the >> return stack buffer (RSB) upon returning from the guest. >>=20 >> This was inspired by this linux commit: >> = https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/= arch/x86/kvm?id=3D117cc7a908c83697b0b737d15ae1eb5943afe35b >>=20 >> Reviewed by: grehan >> Sponsored by: Dell EMC Isilon >> Differential Revision: https://reviews.freebsd.org/D14272 >>=20 >> Modified: >> head/sys/amd64/vmm/amd/svm_support.S >> head/sys/amd64/vmm/intel/vmcs.c >> head/sys/amd64/vmm/intel/vmx.h >> head/sys/amd64/vmm/intel/vmx_support.S >>=20 >> Modified: head/sys/amd64/vmm/amd/svm_support.S >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/vmm/amd/svm_support.S Mon Feb 12 14:44:21 2018 = (r329161) >> +++ head/sys/amd64/vmm/amd/svm_support.S Mon Feb 12 14:45:27 2018 = (r329162) >> @@ -113,6 +113,23 @@ ENTRY(svm_launch) >> movq %rdi, SCTX_RDI(%rax) >> movq %rsi, SCTX_RSI(%rax) >>=20 >> + /* >> + * To prevent malicious branch target predictions from >> + * affecting the host, overwrite all entries in the RSB upon >> + * exiting a guest. >> + */ >> + mov $16, %ecx /* 16 iterations, two calls per loop */ >> + mov %rsp, %rax >> +0: call 2f /* create an RSB entry. */ >> +1: pause >> + call 1b /* capture rogue speculation. */ >> +2: call 2f /* create an RSB entry. */ >> +1: pause >> + call 1b /* capture rogue speculation. */ >> +2: sub $1, %ecx >> + jnz 0b >> + mov %rax, %rsp >> + >> /* Restore host state */ >> pop %r15 >> pop %r14 >>=20 >=20 > For amd systems, isn't use of lfence required for performance > reasons[1]? Or am I conflating two things? >=20 > 1: https://reviews.llvm.org/D41723 For what AMD calls V2 (the window of a speculative execution between = indirect branch predictions and resolution of the correct target) there = are a few mitigations cited in their white paper: = https://developer.amd.com/wp-content/resources/Managing-Speculation-on-AMD= -Processors.pdf depending on the specific code you are trying to =E2=80=9Cfix=E2=80=9D. = In my interpretation lfence is a component of several of the possible = mitigations when one wants to =E2=80=9Cfix=E2=80=9D a specific indirect = branch but does not ensure that subsequent branches will not be = speculated around. In this case we are trying to guard against the more = generic case of "entering more privileged code=E2=80=9D i.e. returning = from the guest to hypervisor aka host and protect all subsequent = indirect branches without needing to apply an lfence to them = individually. To do that, I=E2=80=99ve implemented mitigation V2-3 = where the return address predictor is filled with benign entries. Does that help? Tycho= From owner-svn-src-head@freebsd.org Mon Feb 12 18:47: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 C0D38F114BB; Mon, 12 Feb 2018 18:47:20 +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 6DDE384F5F; Mon, 12 Feb 2018 18:47:20 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id B567C10A7DB; Mon, 12 Feb 2018 13:47:13 -0500 (EST) From: John Baldwin To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329148 - head/etc/devd Date: Mon, 12 Feb 2018 10:43:53 -0800 Message-ID: <1851723.CDKeKmhBc8@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201802120445.w1C4jQBL081885@repo.freebsd.org> References: <201802120445.w1C4jQBL081885@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 12 Feb 2018 13:47:13 -0500 (EST) 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.25 Precedence: list List-Id: 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, 12 Feb 2018 18:47:20 -0000 On Monday, February 12, 2018 04:45:26 AM Warner Losh wrote: > Author: imp > Date: Mon Feb 12 04:45:26 2018 > New Revision: 329148 > URL: https://svnweb.freebsd.org/changeset/base/329148 > > Log: > Switch to using devmatch to autoload drivers. Remove usb.conf > as obsolete because devmatch gets its information from the same > place as the genration scripts. > > Added: > head/etc/devd/devmatch.conf (contents, props changed) > Deleted: > head/etc/devd/usb.conf This is a bigger hammer. The old approach only loaded the specific driver for the device plugged in. This might load other drivers as well which users might find surprising. -- John Baldwin From owner-svn-src-head@freebsd.org Mon Feb 12 18:55: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 77969F122DF for ; Mon, 12 Feb 2018 18:55:56 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (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 04DF285DEF for ; Mon, 12 Feb 2018 18:55:55 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 522c08cc-1026-11e8-bb8e-b35b57339d60 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 outbound1.ore.mailhop.org (Halon) with ESMTPSA id 522c08cc-1026-11e8-bb8e-b35b57339d60; Mon, 12 Feb 2018 18:55:41 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w1CItrpS035306; Mon, 12 Feb 2018 11:55:53 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1518461752.94819.42.camel@freebsd.org> Subject: Re: svn commit: r329173 - head/sys/kern From: Ian Lepore To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 12 Feb 2018 11:55:52 -0700 In-Reply-To: <201802121741.w1CHfBWa069971@repo.freebsd.org> References: <201802121741.w1CHfBWa069971@repo.freebsd.org> 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.25 Precedence: list List-Id: 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, 12 Feb 2018 18:55:56 -0000 On Mon, 2018-02-12 at 17:41 +0000, Ian Lepore wrote: > Author: ian > Date: Mon Feb 12 17:41:11 2018 > New Revision: 329173 > URL: https://svnweb.freebsd.org/changeset/base/329173 > > Log: >   Add a new sysctl, debug.clock_do_io, to allow manully triggering a one-shot >   read or write of all registered realtime clocks.  In the read case, the >   values read are simply discarded.  For writes, there's no alternative but >   to actually write the current system time to the device. > > Modified: >   head/sys/kern/subr_rtc.c I've received several questions about this series of commits, which I think means I probably should have put it up for review first.  I didn't do so only because every other RTC-related change I've put on phab has just languished without comments for a couple weeks before I gave up waiting and committed it anyway. As to what this series of rtc debugging changes was about in general... I'm tired of hacking read-now/write-now sysctls into (and then back out of before committing) every RTC driver I've ever worked on.  It's nice to be able to debug them without actually changing the time on the system continuously and/or rebooting.  If you can trigger the IO on demand you can use kldload/unload while testing.  Otherwise the only way to make a read happen after you've made a code change is to reboot.   Another motivation: I want to eliminate atrtc's ddb "show rtc" command that only works in that one of the dozen+ rtc drivers we have, and it brings complications to the atrtc code that I want to clean up.   As to why I made clock_do_io a "write to read" thing... I find myself always doing "sysctl -a | grep something" where something is some fragment of an oid name I vaguely remember.  I'm probably not alone in doing things like that, and I didn't want sysctl -a to start triggering expensive hardware accesses like i2c bus transactions; that's why I made it "write-to-read" (which requires that you go look for the debugging output on the console or in dmesg, which is klunky, but hey... this is debugging stuff, not some fancy new kernel abi for reading time). -- Ian From owner-svn-src-head@freebsd.org Mon Feb 12 19: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 927AEF13E14; Mon, 12 Feb 2018 19:13:07 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: from mail-qt0-x230.google.com (mail-qt0-x230.google.com [IPv6:2607:f8b0:400d:c0d::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 294FE68321; Mon, 12 Feb 2018 19:13:07 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: by mail-qt0-x230.google.com with SMTP id f18so827413qth.11; Mon, 12 Feb 2018 11:13:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=Az+XFPQpcVk/nZ3WuhWxfNgH79FPVsy0K+zC/SJVwsI=; b=p+joBmF8agjOOzP2/AgKrC8JFGnDiL5xjYTCQ83gjJezH/kQmu+W4kx0tMI08LLTbh KTamGWy8Y0xlMcv9W/YMourWuw9WuB1h4DVeLSbuEHnJjXC317lF/WOEnYjbphG4hXa5 KMrqLoZQbGXY4vdDRN1yX9zzwT1E2o3KneMUpYMMxTznt/i+Uh4jzoJ0SxSA26kfJWuT he1Rx/BeCUCcUDDYIM43Tf14Q1W0ygL8v7qTD8LxtD9moGauYDpcuejc34XL2AghU1J6 7Q18nWc/esgC+eyBa6+g2/pgRRJZVgNTk/OsvCX1nS/RkWuO2wVJueBrqkCxbmEprojS XxkA== 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 :content-transfer-encoding; bh=Az+XFPQpcVk/nZ3WuhWxfNgH79FPVsy0K+zC/SJVwsI=; b=OKRUSZZnH4fncY0HhiQOf70BBnTVPBoTE87onfVjY39832ilDBhcFeKkh4Lhhlk+FU P0q5pVkL5JdfCEEaSZh8gh90yfDab3QPU834ZsJnTPxXzAjBwv8WciytOIq/lGFqnD9y lToNJFtWsjlsGk9RMK4+uddTbLI6fzK1KP4+VW1r2tEoIXZrrIUn5AwfpzIQOrxxPYOc jLXUhyrFNHQgeEdaqT/9FBioooP8r8ok7hfm/FaBdndDNnagaORHL3c3GT8innT24NaS D+RRyX9nMt02cVtWGkpZNejy9LZCCEvXllH7SSqAPcNPlIjxeQHH/Gmd0yt1mCEibAue cumg== X-Gm-Message-State: APf1xPAVEAoeq6oOAl4YnfXWyC341n3GaVHIaT7RmRmCKvukvRPy1xig ZQPkckWIxkCorncJ8SIaD0QX8CvQ X-Google-Smtp-Source: AH8x22618dB9rfauYHOWSic1GcFyKOjnYFgRGI0n4QJ272Ees9hy7vTutlTo3YgJGL+Klk8HSJAf5g== X-Received: by 10.200.80.67 with SMTP id h3mr727091qtm.211.1518462786496; Mon, 12 Feb 2018 11:13:06 -0800 (PST) Received: from mbp.home ([177.53.86.172]) by smtp.gmail.com with ESMTPSA id e46sm6865757qte.9.2018.02.12.11.13.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Feb 2018 11:13:05 -0800 (PST) Subject: Re: svn commit: r329148 - head/etc/devd To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201802120445.w1C4jQBL081885@repo.freebsd.org> From: Renato Botelho Message-ID: <1f2b78cb-c27b-6b3b-0ee7-130de756bbb7@gmail.com> Date: Mon, 12 Feb 2018 17:13:01 -0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <201802120445.w1C4jQBL081885@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.25 Precedence: list List-Id: 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, 12 Feb 2018 19:13:07 -0000 On 12/02/18 02:45, Warner Losh wrote: > Author: imp > Date: Mon Feb 12 04:45:26 2018 > New Revision: 329148 > URL: https://svnweb.freebsd.org/changeset/base/329148 > > Log: > Switch to using devmatch to autoload drivers. Remove usb.conf > as obsolete because devmatch gets its information from the same > place as the genration scripts. > > Added: > head/etc/devd/devmatch.conf (contents, props changed) > Deleted: > head/etc/devd/usb.conf > > Added: head/etc/devd/devmatch.conf > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/etc/devd/devmatch.conf Mon Feb 12 04:45:26 2018 (r329148) > @@ -0,0 +1,13 @@ > +# > +# $FreeBSD$ > +# > + > +# > +# Example devd configuration file for automatically > +# loading what modules we can based on nomatch > +# events. > +# > +# Generic NOMATCH event > +nomatch 100 { > + action "service devmatch onestart" Config syntax is broken. It's missing ; in the end of above line -- Renato Botelho From owner-svn-src-head@freebsd.org Mon Feb 12 19:36: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 E3284F15B48; Mon, 12 Feb 2018 19:36:27 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 912BD69406; Mon, 12 Feb 2018 19:36:27 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8BC6C16488; Mon, 12 Feb 2018 19:36:27 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1CJaRRp033046; Mon, 12 Feb 2018 19:36:27 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CJaRlq033041; Mon, 12 Feb 2018 19:36:27 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201802121936.w1CJaRlq033041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Mon, 12 Feb 2018 19:36:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329180 - head/sys/dev/bhnd/siba X-SVN-Group: head X-SVN-Commit-Author: landonf X-SVN-Commit-Paths: head/sys/dev/bhnd/siba X-SVN-Commit-Revision: 329180 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 19:36:28 -0000 Author: landonf Date: Mon Feb 12 19:36:26 2018 New Revision: 329180 URL: https://svnweb.freebsd.org/changeset/base/329180 Log: siba(4): Ignore disabled per-core address match entries. Previously, the address regions described by disabled admatch entries would be treated as being mapped to the given core; while incorrect, this was essentially harmless given that the entries describe unused address space on the few affected devices. We now perform parsing of per-core admatch registers and interrupt flags in siba_erom, correctly skip any disabled admatch entries, and use the siba_erom API in siba_add_children() to perform enumeration of attached cores. Added: head/sys/dev/bhnd/siba/siba_eromvar.h (contents, props changed) Modified: head/sys/dev/bhnd/siba/siba.c head/sys/dev/bhnd/siba/siba_erom.c head/sys/dev/bhnd/siba/siba_subr.c head/sys/dev/bhnd/siba/sibavar.h Modified: head/sys/dev/bhnd/siba/siba.c ============================================================================== --- head/sys/dev/bhnd/siba/siba.c Mon Feb 12 19:08:17 2018 (r329179) +++ head/sys/dev/bhnd/siba/siba.c Mon Feb 12 19:36:26 2018 (r329180) @@ -47,9 +47,14 @@ __FBSDID("$FreeBSD$"); #include #include +#include "siba_eromvar.h" + #include "sibareg.h" #include "sibavar.h" +/* RID used when allocating EROM resources */ +#define SIBA_EROM_RID 0 + static bhnd_erom_class_t * siba_get_erom_class(driver_t *driver) { @@ -1057,7 +1062,7 @@ siba_decode_port_rid(device_t dev, device_t child, int return (EINVAL); /* Look for a matching addrspace entry */ - for (u_int i = 0; i < dinfo->core_id.num_addrspace; i++) { + for (u_int i = 0; i < dinfo->core_id.num_admatch; i++) { if (dinfo->addrspace[i].sa_rid != rid) continue; @@ -1131,7 +1136,7 @@ siba_get_intr_count(device_t dev, device_t child) return (BHND_BUS_GET_INTR_COUNT(device_get_parent(dev), child)); dinfo = device_get_ivars(child); - if (!dinfo->intr_en) { + if (!dinfo->core_id.intr_en) { /* No interrupts */ return (0); } else { @@ -1161,121 +1166,14 @@ siba_get_intr_ivec(device_t dev, device_t child, u_int dinfo = device_get_ivars(child); - KASSERT(dinfo->intr_en, ("core does not have an interrupt assigned")); - *ivec = dinfo->intr.flag; - return (0); -} + KASSERT(dinfo->core_id.intr_en, + ("core does not have an interrupt assigned")); -/** - * Register all address space mappings for @p di. - * - * @param dev The siba bus device. - * @param di The device info instance on which to register all address - * space entries. - * @param r A resource mapping the enumeration table block for @p di. - */ -static int -siba_register_addrspaces(device_t dev, struct siba_devinfo *di, - struct bhnd_resource *r) -{ - struct siba_core_id *cid; - uint32_t addr; - uint32_t size; - int error; - - cid = &di->core_id; - - - /* Register the device address space entries */ - for (uint8_t i = 0; i < di->core_id.num_addrspace; i++) { - uint32_t adm; - u_int adm_offset; - uint32_t bus_reserved; - - /* Determine the register offset */ - adm_offset = siba_admatch_offset(i); - if (adm_offset == 0) { - device_printf(dev, "addrspace %hhu is unsupported", i); - return (ENODEV); - } - - /* Fetch the address match register value */ - adm = bhnd_bus_read_4(r, adm_offset); - - /* Parse the value */ - if ((error = siba_parse_admatch(adm, &addr, &size))) { - device_printf(dev, "failed to decode address " - " match register value 0x%x\n", adm); - return (error); - } - - /* If this is the device's core/enumeration addrespace, - * reserve the Sonics configuration register blocks for the - * use of our bus. */ - bus_reserved = 0; - if (i == SIBA_CORE_ADDRSPACE) - bus_reserved = cid->num_cfg_blocks * SIBA_CFG_SIZE; - - /* Append the region info */ - error = siba_append_dinfo_region(di, i, addr, size, - bus_reserved); - if (error) - return (error); - } - + *ivec = dinfo->core_id.intr_flag; return (0); } - /** - * Register all interrupt descriptors for @p dinfo. Must be called after - * configuration blocks have been mapped. - * - * @param dev The siba bus device. - * @param child The siba child device. - * @param dinfo The device info instance on which to register all interrupt - * descriptor entries. - * @param r A resource mapping the enumeration table block for @p di. - */ -static int -siba_register_interrupts(device_t dev, device_t child, - struct siba_devinfo *dinfo, struct bhnd_resource *r) -{ - uint32_t tpsflag; - int error; - - /* Is backplane interrupt distribution enabled for this core? */ - tpsflag = bhnd_bus_read_4(r, SB0_REG_ABS(SIBA_CFG0_TPSFLAG)); - if ((tpsflag & SIBA_TPS_F0EN0) == 0) { - dinfo->intr_en = false; - return (0); - } - - /* Have one interrupt */ - dinfo->intr_en = true; - dinfo->intr.flag = SIBA_REG_GET(tpsflag, TPS_NUM0); - dinfo->intr.mapped = false; - dinfo->intr.irq = 0; - dinfo->intr.rid = -1; - - /* Map the interrupt */ - error = BHND_BUS_MAP_INTR(dev, child, 0 /* single intr is always 0 */, - &dinfo->intr.irq); - if (error) { - device_printf(dev, "failed mapping interrupt line for core %u: " - "%d\n", dinfo->core_id.core_info.core_idx, error); - return (error); - } - dinfo->intr.mapped = true; - - /* Update the resource list */ - dinfo->intr.rid = resource_list_add_next(&dinfo->resources, SYS_RES_IRQ, - dinfo->intr.irq, dinfo->intr.irq, 1); - - return (0); -} - -/** * Map per-core configuration blocks for @p dinfo. * * @param dev The siba bus device. @@ -1386,21 +1284,27 @@ siba_child_deleted(device_t dev, device_t child) int siba_add_children(device_t dev) { - const struct bhnd_chipid *chipid; + bhnd_erom_t *erom; + struct siba_erom *siba_erom; + struct bhnd_erom_io *eio; + const struct bhnd_chipid *cid; struct siba_core_id *cores; - struct bhnd_resource *r; device_t *children; - int rid; int error; - cores = NULL; - r = NULL; + cid = BHND_BUS_GET_CHIPID(dev, dev); - chipid = BHND_BUS_GET_CHIPID(dev, dev); + /* Allocate our EROM parser */ + eio = bhnd_erom_iores_new(dev, SIBA_EROM_RID); + erom = bhnd_erom_alloc(&siba_erom_parser, cid, eio); + if (erom == NULL) { + bhnd_erom_io_fini(eio); + return (ENODEV); + } /* Allocate our temporary core and device table */ - cores = malloc(sizeof(*cores) * chipid->ncores, M_BHND, M_WAITOK); - children = malloc(sizeof(*children) * chipid->ncores, M_BHND, + cores = malloc(sizeof(*cores) * cid->ncores, M_BHND, M_WAITOK); + children = malloc(sizeof(*children) * cid->ncores, M_BHND, M_WAITOK | M_ZERO); /* @@ -1411,40 +1315,14 @@ siba_add_children(device_t dev) * defer mapping of the per-core siba(4) config blocks until all cores * have been enumerated and otherwise configured. */ - for (u_int i = 0; i < chipid->ncores; i++) { + siba_erom = (struct siba_erom *)erom; + for (u_int i = 0; i < cid->ncores; i++) { struct siba_devinfo *dinfo; device_t child; - uint32_t idhigh, idlow; - rman_res_t r_count, r_end, r_start; - /* Map the core's register block */ - rid = 0; - r_start = SIBA_CORE_ADDR(i); - r_count = SIBA_CORE_SIZE; - r_end = r_start + SIBA_CORE_SIZE - 1; - r = bhnd_alloc_resource(dev, SYS_RES_MEMORY, &rid, r_start, - r_end, r_count, RF_ACTIVE); - if (r == NULL) { - error = ENXIO; + if ((error = siba_erom_get_core_id(siba_erom, i, &cores[i]))) goto failed; - } - /* Read the core info */ - idhigh = bhnd_bus_read_4(r, SB0_REG_ABS(SIBA_CFG0_IDHIGH)); - idlow = bhnd_bus_read_4(r, SB0_REG_ABS(SIBA_CFG0_IDLOW)); - - cores[i] = siba_parse_core_id(idhigh, idlow, i, 0); - - /* Determine and set unit number */ - for (u_int j = 0; j < i; j++) { - struct bhnd_core_info *cur = &cores[i].core_info; - struct bhnd_core_info *prev = &cores[j].core_info; - - if (prev->vendor == cur->vendor && - prev->device == cur->device) - cur->unit++; - } - /* Add the child device */ child = BUS_ADD_CHILD(dev, 0, NULL, -1); if (child == NULL) { @@ -1460,30 +1338,22 @@ siba_add_children(device_t dev) goto failed; } - if ((error = siba_init_dinfo(dev, dinfo, &cores[i]))) + if ((error = siba_init_dinfo(dev, child, dinfo, &cores[i]))) goto failed; - /* Register the core's address space(s). */ - if ((error = siba_register_addrspaces(dev, dinfo, r))) - goto failed; - - /* Register the core's interrupts */ - if ((error = siba_register_interrupts(dev, child, dinfo, r))) - goto failed; - - /* Unmap the core's register block */ - bhnd_release_resource(dev, SYS_RES_MEMORY, rid, r); - r = NULL; - /* If pins are floating or the hardware is otherwise * unpopulated, the device shouldn't be used. */ if (bhnd_is_hw_disabled(child)) device_disable(child); } + /* Free EROM (and any bridge register windows it might hold) */ + bhnd_erom_free(erom); + erom = NULL; + /* Map all valid core's config register blocks and perform interrupt * assignment */ - for (u_int i = 0; i < chipid->ncores; i++) { + for (u_int i = 0; i < cid->ncores; i++) { struct siba_devinfo *dinfo; device_t child; @@ -1509,7 +1379,7 @@ siba_add_children(device_t dev) return (0); failed: - for (u_int i = 0; i < chipid->ncores; i++) { + for (u_int i = 0; i < cid->ncores; i++) { if (children[i] == NULL) continue; @@ -1518,9 +1388,8 @@ failed: free(cores, M_BHND); free(children, M_BHND); - - if (r != NULL) - bhnd_release_resource(dev, SYS_RES_MEMORY, rid, r); + if (erom != NULL) + bhnd_erom_free(erom); return (error); } Modified: head/sys/dev/bhnd/siba/siba_erom.c ============================================================================== --- head/sys/dev/bhnd/siba/siba_erom.c Mon Feb 12 19:08:17 2018 (r329179) +++ head/sys/dev/bhnd/siba/siba_erom.c Mon Feb 12 19:36:26 2018 (r329180) @@ -49,6 +49,8 @@ __FBSDID("$FreeBSD$"); #include "sibareg.h" #include "sibavar.h" +#include "siba_eromvar.h" + struct siba_erom; struct siba_erom_io; @@ -59,8 +61,9 @@ static int siba_eio_init(struct siba_erom_io *io, static uint32_t siba_eio_read_4(struct siba_erom_io *io, u_int core_idx, bus_size_t offset); -static struct siba_core_id siba_eio_read_core_id(struct siba_erom_io *io, - u_int core_idx, int unit); +static int siba_eio_read_core_id(struct siba_erom_io *io, + u_int core_idx, int unit, + struct siba_core_id *sid); static int siba_eio_read_chipid(struct siba_erom_io *io, bus_addr_t enum_addr, @@ -118,7 +121,8 @@ siba_erom_probe(bhnd_erom_class_t *cls, struct bhnd_er * BCM4710, it's a SDRAM core (0x803). */ - sid = siba_eio_read_core_id(&io, 0, 0); + if ((error = siba_eio_read_core_id(&io, 0, 0, &sid))) + return (error); if (sid.core_info.vendor != BHND_MFGID_BCM) return (ENXIO); @@ -227,19 +231,154 @@ siba_eio_read_4(struct siba_erom_io *io, u_int core_id * @param core_idx The core index. * @param unit The caller-specified unit number to be included in the return * value. + * @param[out] sid On success, the parsed siba core id. + * + * @retval 0 success + * @retval non-zero if reading or parsing the identification registers + * otherwise fails, a regular unix error code will be + * returned. */ -static struct siba_core_id -siba_eio_read_core_id(struct siba_erom_io *io, u_int core_idx, int unit) +static int +siba_eio_read_core_id(struct siba_erom_io *io, u_int core_idx, int unit, + struct siba_core_id *sid) { - uint32_t idhigh, idlow; + struct siba_admatch admatch[SIBA_MAX_ADDRSPACE]; + uint32_t idhigh, idlow; + uint32_t tpsflag; + uint16_t ocp_vendor; + uint8_t sonics_rev; + uint8_t num_admatch; + uint8_t num_admatch_en; + uint8_t num_cfg; + bool intr_en; + u_int intr_flag; + int error; idhigh = siba_eio_read_4(io, core_idx, SB0_REG_ABS(SIBA_CFG0_IDHIGH)); idlow = siba_eio_read_4(io, core_idx, SB0_REG_ABS(SIBA_CFG0_IDLOW)); + tpsflag = siba_eio_read_4(io, core_idx, SB0_REG_ABS(SIBA_CFG0_TPSFLAG)); - return (siba_parse_core_id(idhigh, idlow, core_idx, unit)); + ocp_vendor = SIBA_REG_GET(idhigh, IDH_VENDOR); + sonics_rev = SIBA_REG_GET(idlow, IDL_SBREV); + num_admatch = SIBA_REG_GET(idlow, IDL_NRADDR) + 1 /* + enum block */; + if (num_admatch > nitems(admatch)) { + printf("core%u: invalid admatch count %hhu\n", core_idx, + num_admatch); + return (EINVAL); + } + + /* Determine backplane interrupt distribution configuration */ + intr_en = ((tpsflag & SIBA_TPS_F0EN0) != 0); + intr_flag = SIBA_REG_GET(tpsflag, TPS_NUM0); + + /* Determine the number of sonics config register blocks */ + num_cfg = SIBA_CFG_NUM_2_2; + if (sonics_rev >= SIBA_IDL_SBREV_2_3) + num_cfg = SIBA_CFG_NUM_2_3; + + /* Parse all admatch descriptors */ + num_admatch_en = 0; + for (uint8_t i = 0; i < num_admatch; i++) { + uint32_t am_value; + u_int am_offset; + + KASSERT(i < nitems(admatch), ("invalid admatch index")); + + /* Determine the register offset */ + am_offset = siba_admatch_offset(i); + if (am_offset == 0) { + printf("core%u: addrspace %hhu is unsupported", + core_idx, i); + return (ENODEV); + } + + /* Read and parse the address match register */ + am_value = siba_eio_read_4(io, core_idx, am_offset); + error = siba_parse_admatch(am_value, &admatch[num_admatch_en]); + if (error) { + printf("core%u: failed to decode admatch[%hhu] " + "register value 0x%x\n", core_idx, i, am_value); + return (error); + } + + /* Skip disabled entries */ + if (!admatch[num_admatch_en].am_enabled) + continue; + + /* Reject unsupported negative matches. These are not used on + * any known devices */ + if (admatch[num_admatch_en].am_negative) { + printf("core%u: unsupported negative admatch[%hhu] " + "value 0x%x\n", core_idx, i, am_value); + return (ENXIO); + } + + num_admatch_en++; + } + + /* Populate the result */ + *sid = (struct siba_core_id) { + .core_info = { + .vendor = siba_get_bhnd_mfgid(ocp_vendor), + .device = SIBA_REG_GET(idhigh, IDH_DEVICE), + .hwrev = SIBA_IDH_CORE_REV(idhigh), + .core_idx = core_idx, + .unit = unit + }, + .sonics_vendor = ocp_vendor, + .sonics_rev = sonics_rev, + .intr_en = intr_en, + .intr_flag = intr_flag, + .num_admatch = num_admatch_en, + .num_cfg_blocks = num_cfg + }; + memcpy(sid->admatch, admatch, num_admatch_en * sizeof(admatch[0])); + + return (0); } /** + * Read and parse the SSB identification registers for the given @p core_index, + * returning the siba(4) core identification in @p sid. + * + * @param sc A siba EROM instance. + * @param core_idx The index of the core to be identified. + * @param[out] result On success, the parsed siba core id. + * + * @retval 0 success + * @retval non-zero if reading or parsing the identification registers + * otherwise fails, a regular unix error code will be + * returned. + */ +int +siba_erom_get_core_id(struct siba_erom *sc, u_int core_idx, + struct siba_core_id *result) +{ + struct siba_core_id sid; + int error; + + /* Fetch the core info, assuming a unit number of 0 */ + if ((error = siba_eio_read_core_id(&sc->io, core_idx, 0, &sid))) + return (error); + + /* Scan preceding cores to determine the real unit number. */ + for (u_int i = 0; i < core_idx; i++) { + struct siba_core_id prev; + + if ((error = siba_eio_read_core_id(&sc->io, i, 0, &prev))) + return (error); + + /* Bump the unit number? */ + if (sid.core_info.vendor == prev.core_info.vendor && + sid.core_info.device == prev.core_info.device) + sid.core_info.unit++; + } + + *result = sid; + return (0); +} + +/** * Read and parse the chip identification register from the ChipCommon core. * * @param io EROM I/O context. @@ -252,9 +391,12 @@ siba_eio_read_chipid(struct siba_erom_io *io, bus_addr { struct siba_core_id ccid; uint32_t idreg; + int error; /* Identify the chipcommon core */ - ccid = siba_eio_read_core_id(io, 0, 0); + if ((error = siba_eio_read_core_id(io, 0, 0, &ccid))) + return (error); + if (ccid.core_info.vendor != BHND_MFGID_BCM || ccid.core_info.device != BHND_COREID_CC) { @@ -281,6 +423,7 @@ siba_erom_lookup_core(bhnd_erom_t *erom, const struct { struct siba_erom *sc; struct bhnd_core_match imatch; + int error; sc = (struct siba_erom *)erom; @@ -294,7 +437,9 @@ siba_erom_lookup_core(bhnd_erom_t *erom, const struct struct bhnd_core_info ci; /* Read the core info */ - sid = siba_eio_read_core_id(&sc->io, i, 0); + if ((error = siba_eio_read_core_id(&sc->io, i, 0, &sid))) + return (error); + ci = sid.core_info; /* Check for initial match */ @@ -303,7 +448,9 @@ siba_erom_lookup_core(bhnd_erom_t *erom, const struct /* Re-scan preceding cores to determine the unit number. */ for (u_int j = 0; j < i; j++) { - sid = siba_eio_read_core_id(&sc->io, j, 0); + error = siba_eio_read_core_id(&sc->io, j, 0, &sid); + if (error) + return (error); /* Bump the unit number? */ if (sid.core_info.vendor == ci.vendor && @@ -332,7 +479,8 @@ siba_erom_lookup_core_addr(bhnd_erom_t *erom, const st struct siba_erom *sc; struct bhnd_core_info core; struct siba_core_id sid; - uint32_t am, am_addr, am_size; + struct siba_admatch admatch; + uint32_t am; u_int am_offset; u_int addrspace, cfg; @@ -345,7 +493,9 @@ siba_erom_lookup_core_addr(bhnd_erom_t *erom, const st return (error); /* Fetch full siba core ident */ - sid = siba_eio_read_core_id(&sc->io, core.core_idx, core.unit); + error = siba_eio_read_core_id(&sc->io, core.core_idx, core.unit, &sid); + if (error) + return (error); /* Is port valid? */ if (!siba_is_port_valid(&sid, type, port)) @@ -419,7 +569,7 @@ siba_erom_lookup_core_addr(bhnd_erom_t *erom, const st /* Read and parse the address match register */ am = siba_eio_read_4(&sc->io, core.core_idx, am_offset); - if ((error = siba_parse_admatch(am, &am_addr, &am_size))) { + if ((error = siba_parse_admatch(am, &admatch))) { printf("failed to decode address match register value 0x%x\n", am); return (error); @@ -428,8 +578,8 @@ siba_erom_lookup_core_addr(bhnd_erom_t *erom, const st if (info != NULL) *info = core; - *addr = am_addr; - *size = am_size; + *addr = admatch.am_base; + *size = admatch.am_size; return (0); } @@ -441,6 +591,7 @@ siba_erom_get_core_table(bhnd_erom_t *erom, struct bhn { struct siba_erom *sc; struct bhnd_core_info *out; + int error; sc = (struct siba_erom *)erom; @@ -457,7 +608,9 @@ siba_erom_get_core_table(bhnd_erom_t *erom, struct bhn struct siba_core_id sid; /* Read the core info */ - sid = siba_eio_read_core_id(&sc->io, i, 0); + if ((error = siba_eio_read_core_id(&sc->io, i, 0, &sid))) + return (error); + out[i] = sid.core_info; /* Determine unit number */ @@ -508,8 +661,9 @@ siba_erom_dump(bhnd_erom_t *erom) printf("\tnraddr\t0x%04x\n", nraddr); for (size_t addrspace = 0; addrspace < nraddr; addrspace++) { - uint32_t am, am_addr, am_size; - u_int am_offset; + struct siba_admatch admatch; + uint32_t am; + u_int am_offset; /* Determine the register offset */ am_offset = siba_admatch_offset(addrspace); @@ -521,16 +675,15 @@ siba_erom_dump(bhnd_erom_t *erom) /* Read and parse the address match register */ am = siba_eio_read_4(&sc->io, i, am_offset); - error = siba_parse_admatch(am, &am_addr, &am_size); - if (error) { + if ((error = siba_parse_admatch(am, &admatch))) { printf("failed to decode address match " "register value 0x%x\n", am); continue; } printf("\taddrspace %zu\n", addrspace); - printf("\t\taddr: 0x%08x\n", am_addr); - printf("\t\tsize: 0x%08x\n", am_size); + printf("\t\taddr: 0x%08x\n", admatch.am_base); + printf("\t\tsize: 0x%08x\n", admatch.am_size); } } Added: head/sys/dev/bhnd/siba/siba_eromvar.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/bhnd/siba/siba_eromvar.h Mon Feb 12 19:36:26 2018 (r329180) @@ -0,0 +1,46 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Landon Fuller + * 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. + * + * $FreeBSD$ + */ + +#ifndef _SIBA_SIBA_EROMVAR_H_ +#define _SIBA_SIBA_EROMVAR_H_ + +#include +#include + +#include "sibavar.h" + +struct siba_erom; + +#define SIBA_EROM_ + +int siba_erom_get_core_id(struct siba_erom *sc, u_int core_idx, + struct siba_core_id *result); + +#endif /* _SIBA_SIBA_EROMVAR_H_ */ Modified: head/sys/dev/bhnd/siba/siba_subr.c ============================================================================== --- head/sys/dev/bhnd/siba/siba_subr.c Mon Feb 12 19:08:17 2018 (r329179) +++ head/sys/dev/bhnd/siba/siba_subr.c Mon Feb 12 19:36:26 2018 (r329180) @@ -48,6 +48,12 @@ __FBSDID("$FreeBSD$"); #include "sibareg.h" #include "sibavar.h" +static int siba_register_interrupts(device_t dev, device_t child, + struct siba_devinfo *dinfo); +static int siba_append_dinfo_region(struct siba_devinfo *dinfo, + uint8_t addridx, uint32_t base, uint32_t size, + uint32_t bus_reserved); + /** * Map a siba(4) OCP vendor code to its corresponding JEDEC JEP-106 vendor * code. @@ -68,48 +74,6 @@ siba_get_bhnd_mfgid(uint16_t ocp_vendor) } /** - * Parse the SIBA_IDH_* fields from the per-core identification - * registers, returning a siba_core_id representation. - * - * @param idhigh The SIBA_R0_IDHIGH register. - * @param idlow The SIBA_R0_IDLOW register. - * @param core_id The core id (index) to include in the result. - * @param unit The unit number to include in the result. - */ -struct siba_core_id -siba_parse_core_id(uint32_t idhigh, uint32_t idlow, u_int core_idx, int unit) -{ - - uint16_t ocp_vendor; - uint8_t sonics_rev; - uint8_t num_addrspace; - uint8_t num_cfg; - - ocp_vendor = SIBA_REG_GET(idhigh, IDH_VENDOR); - sonics_rev = SIBA_REG_GET(idlow, IDL_SBREV); - num_addrspace = SIBA_REG_GET(idlow, IDL_NRADDR) + 1 /* + enum block */; - - /* Determine the number of sonics config register blocks */ - num_cfg = SIBA_CFG_NUM_2_2; - if (sonics_rev >= SIBA_IDL_SBREV_2_3) - num_cfg = SIBA_CFG_NUM_2_3; - - return (struct siba_core_id) { - .core_info = { - .vendor = siba_get_bhnd_mfgid(ocp_vendor), - .device = SIBA_REG_GET(idhigh, IDH_DEVICE), - .hwrev = SIBA_IDH_CORE_REV(idhigh), - .core_idx = core_idx, - .unit = unit - }, - .sonics_vendor = ocp_vendor, - .sonics_rev = sonics_rev, - .num_addrspace = num_addrspace, - .num_cfg_blocks = num_cfg - }; -} - -/** * Allocate and return a new empty device info structure. * * @param bus The requesting bus device. @@ -138,8 +102,12 @@ siba_alloc_dinfo(device_t bus) resource_list_init(&dinfo->resources); dinfo->pmu_state = SIBA_PMU_NONE; - dinfo->intr_en = false; + dinfo->intr = (struct siba_intr) { + .mapped = false, + .rid = -1 + }; + return dinfo; } @@ -148,6 +116,7 @@ siba_alloc_dinfo(device_t bus) * siba_alloc_dinfo, copying the provided core id. * * @param dev The requesting bus device. + * @param child The siba child device. * @param dinfo The device info instance. * @param core Device core info. * @@ -155,14 +124,81 @@ siba_alloc_dinfo(device_t bus) * @retval non-zero initialization failed. */ int -siba_init_dinfo(device_t dev, struct siba_devinfo *dinfo, +siba_init_dinfo(device_t dev, device_t child, struct siba_devinfo *dinfo, const struct siba_core_id *core_id) { + int error; + dinfo->core_id = *core_id; + + /* Register all address space mappings */ + for (uint8_t i = 0; i < core_id->num_admatch; i++) { + uint32_t bus_reserved; + + /* If this is the device's core/enumeration addrespace, + * reserve the Sonics configuration register blocks for the + * use of our bus. */ + bus_reserved = 0; + if (i == SIBA_CORE_ADDRSPACE) + bus_reserved = core_id->num_cfg_blocks * SIBA_CFG_SIZE; + + /* Append the region info */ + error = siba_append_dinfo_region(dinfo, i, + core_id->admatch[i].am_base, core_id->admatch[i].am_size, + bus_reserved); + if (error) + return (error); + } + + /* Register all interrupt(s) */ + if ((error = siba_register_interrupts(dev, child, dinfo))) + return (error); + return (0); } + /** + * Register and map all interrupts for @p dinfo. + * + * @param dev The siba bus device. + * @param child The siba child device. + * @param dinfo The device info instance on which to register all interrupt + * entries. + */ +static int +siba_register_interrupts(device_t dev, device_t child, + struct siba_devinfo *dinfo) +{ + int error; + + /* Is backplane interrupt distribution enabled for this core? */ + if (!dinfo->core_id.intr_en) + return (0); + + /* Have one interrupt */ + dinfo->intr.mapped = false; + dinfo->intr.irq = 0; + dinfo->intr.rid = -1; + + /* Map the interrupt */ + error = BHND_BUS_MAP_INTR(dev, child, 0 /* single intr is always 0 */, + &dinfo->intr.irq); + if (error) { + device_printf(dev, "failed mapping interrupt line for core %u: " + "%d\n", dinfo->core_id.core_info.core_idx, error); + return (error); + } + dinfo->intr.mapped = true; + + /* Update the resource list */ + dinfo->intr.rid = resource_list_add_next(&dinfo->resources, SYS_RES_IRQ, + dinfo->intr.irq, dinfo->intr.irq, 1); + + return (0); +} + +/** * Map an addrspace index to its corresponding bhnd(4) BHND_PORT_DEVICE port * number. * @@ -238,7 +274,7 @@ siba_port_count(struct siba_core_id *core_id, bhnd_por switch (port_type) { case BHND_PORT_DEVICE: /* 0, 1, or 2 ports */ - return (min(core_id->num_addrspace, 2)); + return (min(core_id->num_admatch, 2)); case BHND_PORT_AGENT: /* One agent port maps all configuration blocks */ @@ -292,11 +328,11 @@ siba_port_region_count(struct siba_core_id *core_id, b case BHND_PORT_DEVICE: /* The first address space, if any, is mapped to device0.0 */ if (port == 0) - return (min(core_id->num_addrspace, 1)); + return (min(core_id->num_admatch, 1)); /* All remaining address spaces are mapped to device0.(n - 1) */ - if (port == 1 && core_id->num_addrspace >= 2) - return (core_id->num_addrspace - 1); + if (port == 1 && core_id->num_admatch >= 2) + return (core_id->num_admatch - 1); break; @@ -327,7 +363,6 @@ siba_port_region_count(struct siba_core_id *core_id, b * agent0.0 0 * agent0.1 1 * - * @param num_addrspace The number of available siba address spaces. * @param port_type The bhnd(4) port type. * @param port The bhnd(4) port number. * @param region The bhnd(4) port region. @@ -394,7 +429,7 @@ siba_find_cfg_block(struct siba_devinfo *dinfo, bhnd_p * For compatibility with bcma(4), we map address spaces to port/region * identifiers as follows: * - * [port] [addrspace] + * [port.region] [admatch index] * device0.0 0 * device1.0 1 * device1.1 2 @@ -431,7 +466,7 @@ siba_addrspace_index(struct siba_core_id *core_id, bhn else return (ENOENT); - if (idx >= core_id->num_addrspace) + if (idx >= core_id->num_admatch) return (ENOENT); /* Found */ @@ -484,7 +519,7 @@ siba_find_addrspace(struct siba_devinfo *dinfo, bhnd_p * @retval 0 success * @retval non-zero An error occurred appending the entry. */ -int +static int siba_append_dinfo_region(struct siba_devinfo *dinfo, uint8_t addridx, uint32_t base, uint32_t size, uint32_t bus_reserved) { @@ -546,7 +581,7 @@ siba_free_dinfo(device_t dev, device_t child, struct s } /* Unmap the core's interrupt */ - if (dinfo->intr_en && dinfo->intr.mapped) { + if (dinfo->core_id.intr_en && dinfo->intr.mapped) { BHND_BUS_UNMAP_INTR(dev, child, dinfo->intr.irq); dinfo->intr.mapped = false; } @@ -585,36 +620,38 @@ siba_admatch_offset(uint8_t addrspace) * * @param addrspace The address space index. * @param am The address match register value to be parsed. - * @param[out] addr The parsed address. - * @param[out] size The parsed size. + * @param[out] admatch The parsed address match descriptor * * @retval 0 success * @retval non-zero a parse error occurred. */ int -siba_parse_admatch(uint32_t am, uint32_t *addr, uint32_t *size) +siba_parse_admatch(uint32_t am, struct siba_admatch *admatch) { - u_int am_type; + u_int am_type; - /* Negative encoding is not supported. This is not used on any - * currently known devices*/ - if (am & SIBA_AM_ADNEG) - return (EINVAL); - /* Extract the base address and size */ am_type = SIBA_REG_GET(am, AM_TYPE); switch (am_type) { case 0: - *addr = am & SIBA_AM_BASE0_MASK; - *size = 1 << (SIBA_REG_GET(am, AM_ADINT0) + 1); + /* Type 0 entries are always enabled, and do not support + * negative matching */ + admatch->am_base = am & SIBA_AM_BASE0_MASK; + admatch->am_size = 1 << (SIBA_REG_GET(am, AM_ADINT0) + 1); + admatch->am_enabled = true; + admatch->am_negative = false; break; case 1: - *addr = am & SIBA_AM_BASE1_MASK; - *size = 1 << (SIBA_REG_GET(am, AM_ADINT1) + 1); + admatch->am_base = am & SIBA_AM_BASE1_MASK; + admatch->am_size = 1 << (SIBA_REG_GET(am, AM_ADINT1) + 1); + admatch->am_enabled = ((am & SIBA_AM_ADEN) != 0); + admatch->am_negative = ((am & SIBA_AM_ADNEG) != 0); break; case 2: - *addr = am & SIBA_AM_BASE2_MASK; - *size = 1 << (SIBA_REG_GET(am, AM_ADINT2) + 1); + admatch->am_base = am & SIBA_AM_BASE2_MASK; + admatch->am_size = 1 << (SIBA_REG_GET(am, AM_ADINT2) + 1); + admatch->am_enabled = ((am & SIBA_AM_ADEN) != 0); + admatch->am_negative = ((am & SIBA_AM_ADNEG) != 0); break; default: return (EINVAL); Modified: head/sys/dev/bhnd/siba/sibavar.h ============================================================================== --- head/sys/dev/bhnd/siba/sibavar.h Mon Feb 12 19:08:17 2018 (r329179) +++ head/sys/dev/bhnd/siba/sibavar.h Mon Feb 12 19:36:26 2018 (r329180) @@ -37,6 +37,7 @@ #define _SIBA_SIBAVAR_H_ #include +#include #include #include #include @@ -52,6 +53,7 @@ */ struct siba_addrspace; +struct siba_admatch; struct siba_cfg_block; struct siba_devinfo; struct siba_core_id; @@ -68,13 +70,10 @@ int siba_get_intr_ivec(device_t dev, device_t child uint16_t siba_get_bhnd_mfgid(uint16_t ocp_vendor); -struct siba_core_id siba_parse_core_id(uint32_t idhigh, uint32_t idlow, - u_int core_idx, int unit); - int siba_add_children(device_t bus); struct siba_devinfo *siba_alloc_dinfo(device_t dev); -int siba_init_dinfo(device_t dev, +int siba_init_dinfo(device_t dev, device_t child, struct siba_devinfo *dinfo, const struct siba_core_id *core_id); void siba_free_dinfo(device_t dev, device_t child, @@ -109,13 +108,9 @@ struct siba_addrspace *siba_find_addrspace(struct siba *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Feb 12 19:49: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 97466F16B34; Mon, 12 Feb 2018 19:49:21 +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 45F0769E47; Mon, 12 Feb 2018 19:49:21 +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 40C0216648; Mon, 12 Feb 2018 19:49:21 +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 w1CJnLnG038517; Mon, 12 Feb 2018 19:49:21 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CJnLl4038516; Mon, 12 Feb 2018 19:49:21 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201802121949.w1CJnLl4038516@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Mon, 12 Feb 2018 19:49:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329181 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 329181 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 19:49:21 -0000 Author: vangyzen Date: Mon Feb 12 19:49:20 2018 New Revision: 329181 URL: https://svnweb.freebsd.org/changeset/base/329181 Log: Update the MTU in affected routes when IPv6 RA changes the MTU ip6_calcmtu() only looks at the interface MTU if neither the TCP hostcache nor the route provides an MTU. Update the routes so they do not provide stale MTUs. This fixes UNH IPv6 conformance test cases v6LC_4_1_08 and v6LC_4_1_09, which use a RA to reduce the link MTU from 1500 to 1280. Reported and tested by: Farrell Woods Reviewed by: dab, melifaro Discussed with: ae MFC after: 1 week Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D14257 Modified: head/sys/netinet6/nd6_rtr.c Modified: head/sys/netinet6/nd6_rtr.c ============================================================================== --- head/sys/netinet6/nd6_rtr.c Mon Feb 12 19:36:26 2018 (r329180) +++ head/sys/netinet6/nd6_rtr.c Mon Feb 12 19:49:20 2018 (r329181) @@ -408,8 +408,11 @@ nd6_ra_input(struct mbuf *m, int off, int icmp6len) int change = (ndi->linkmtu != mtu); ndi->linkmtu = mtu; - if (change) /* in6_maxmtu may change */ + if (change) { + /* in6_maxmtu may change */ in6_setmaxmtu(); + rt_updatemtu(ifp); + } } else { nd6log((LOG_INFO, "nd6_ra_input: bogus mtu " "mtu=%lu sent from %s; " From owner-svn-src-head@freebsd.org Mon Feb 12 22:21: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 7147CF22B4B; Mon, 12 Feb 2018 22:21:12 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C19871937; Mon, 12 Feb 2018 22:21:12 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F12B41802E; Mon, 12 Feb 2018 22:21:11 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1CMLBr5017707; Mon, 12 Feb 2018 22:21:11 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CMLBqp017704; Mon, 12 Feb 2018 22:21:11 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201802122221.w1CMLBqp017704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Mon, 12 Feb 2018 22:21:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329184 - in head/sys: conf dev/bwn modules/bwn X-SVN-Group: head X-SVN-Commit-Author: landonf X-SVN-Commit-Paths: in head/sys: conf dev/bwn modules/bwn X-SVN-Commit-Revision: 329184 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 22:21:12 -0000 Author: landonf Date: Mon Feb 12 22:21:11 2018 New Revision: 329184 URL: https://svnweb.freebsd.org/changeset/base/329184 Log: bwn(4): Fix outstanding bug in PHY-G tssi2dbm table generation caught by -Wconstant-conversion, and remove now unnecessary warning suppression flags. Modified: head/sys/conf/files head/sys/dev/bwn/if_bwn_phy_g.c head/sys/modules/bwn/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Feb 12 20:51:28 2018 (r329183) +++ head/sys/conf/files Mon Feb 12 22:21:11 2018 (r329184) @@ -1326,15 +1326,11 @@ dev/bwi/bwiphy.c optional bwi dev/bwi/bwirf.c optional bwi dev/bwi/if_bwi.c optional bwi dev/bwi/if_bwi_pci.c optional bwi pci -# XXX Work around clang warnings, until maintainer approves fix. -dev/bwn/if_bwn.c optional bwn bhnd \ - compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED}" +dev/bwn/if_bwn.c optional bwn bhnd dev/bwn/if_bwn_pci.c optional bwn pci bhnd bhndb bhndb_pci dev/bwn/if_bwn_phy_common.c optional bwn bhnd -dev/bwn/if_bwn_phy_g.c optional bwn bhnd \ - compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED} ${NO_WCONSTANT_CONVERSION}" -dev/bwn/if_bwn_phy_lp.c optional bwn bhnd \ - compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED}" +dev/bwn/if_bwn_phy_g.c optional bwn bhnd +dev/bwn/if_bwn_phy_lp.c optional bwn bhnd dev/bwn/if_bwn_phy_n.c optional bwn bhnd dev/bwn/if_bwn_util.c optional bwn bhnd dev/cardbus/cardbus.c optional cardbus Modified: head/sys/dev/bwn/if_bwn_phy_g.c ============================================================================== --- head/sys/dev/bwn/if_bwn_phy_g.c Mon Feb 12 20:51:28 2018 (r329183) +++ head/sys/dev/bwn/if_bwn_phy_g.c Mon Feb 12 22:21:11 2018 (r329184) @@ -216,7 +216,7 @@ do { \ } while (delta >= 2); pg->pg_tssi2dbm[i] = MIN(MAX(BWN_TSSI2DBM(m1 * f, 8192), -127), - 128); + 127); } pg->pg_flags |= BWN_PHY_G_FLAG_TSSITABLE_ALLOC; Modified: head/sys/modules/bwn/Makefile ============================================================================== --- head/sys/modules/bwn/Makefile Mon Feb 12 20:51:28 2018 (r329183) +++ head/sys/modules/bwn/Makefile Mon Feb 12 22:21:11 2018 (r329184) @@ -38,8 +38,3 @@ SRCS.BWN_GPL_PHY+= if_bwn_phy_n_ppr.c SRCS.BWN_GPL_PHY+= if_bwn_phy_n_core.c .include - -# XXX Work around clang warnings, until maintainer approves fix. -CWARNFLAGS.if_bwn.c= ${NO_WSOMETIMES_UNINITIALIZED} -CWARNFLAGS.if_bwn_phy_g.c= ${NO_WSOMETIMES_UNINITIALIZED} ${NO_WCONSTANT_CONVERSION} -CWARNFLAGS.if_bwn_phy_lp.c= ${NO_WSOMETIMES_UNINITIALIZED} From owner-svn-src-head@freebsd.org Mon Feb 12 22:42: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 0F92BF00079; Mon, 12 Feb 2018 22:42:08 +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 7E5CC72B7D; Mon, 12 Feb 2018 22:42:07 +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 794CF183C6; Mon, 12 Feb 2018 22:42:07 +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 w1CMg7JM030833; Mon, 12 Feb 2018 22:42:07 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CMg7lo030828; Mon, 12 Feb 2018 22:42:07 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802122242.w1CMg7lo030828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 12 Feb 2018 22:42:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329185 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 329185 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 22:42:08 -0000 Author: cem Date: Mon Feb 12 22:42:06 2018 New Revision: 329185 URL: https://svnweb.freebsd.org/changeset/base/329185 Log: Take a first stab at documenting use of MODULE_PNP_INFO Sponsored by: Dell EMC Isilon Added: head/share/man/man9/MODULE_PNP_INFO.9 (contents, props changed) Modified: head/share/man/man9/DRIVER_MODULE.9 head/share/man/man9/Makefile head/share/man/man9/module.9 Modified: head/share/man/man9/DRIVER_MODULE.9 ============================================================================== --- head/share/man/man9/DRIVER_MODULE.9 Mon Feb 12 22:21:11 2018 (r329184) +++ head/share/man/man9/DRIVER_MODULE.9 Mon Feb 12 22:42:06 2018 (r329185) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 15, 2017 +.Dd February 12, 2018 .Dt DRIVER_MODULE 9 .Os .Sh NAME @@ -144,6 +144,7 @@ for a specific pass level. .Xr device 9 , .Xr driver 9 , .Xr module 9 , +.Xr MODULE_PNP_INFO 9 , .Xr SYSINIT 9 .Sh AUTHORS This manual page was written by Added: head/share/man/man9/MODULE_PNP_INFO.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/MODULE_PNP_INFO.9 Mon Feb 12 22:42:06 2018 (r329185) @@ -0,0 +1,179 @@ +.\" Copyright (c) 2018 Conrad Meyer +.\" 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. +.\" +.\" $FreeBSD$ +.\" +.Dd February 12, 2018 +.Dt MODULE_PNP_INFO 9 +.Os +.Sh NAME +.Nm MODULE_PNP_INFO +.Nd register plug and play information for device matching +.\" +.Sh SYNOPSIS +.In sys/module.h +.Fo MODULE_PNP_INFO +.Fa "const char *descriptor_string" +.Fa "bus" +.Fa "module" +.Fa "void *table" +.Fa "size_t entry_len" +.Fa "size_t num_entries" +.Fc +.\" +.Sh DESCRIPTION +The +.Fn MODULE_PNP_INFO +macro registers a +.Fa table +of device-identifying data for use by +.Xr devmatch 8 . +.Pp +The macro takes a +.Fa descriptor_string +that describes the memory layout of table entries. +The string is a series of members separated by semi-colons. +Members are identified by a type and a name. +They are encoded in the descriptor string by concatenating the type with a +colon, followed by the name. +(The special type +.Vt W32 +represents two members. +The first name is encoded like any other type. +The second name is encoded by appending a forward slash and the second +name after the first.) +.Pp +Types are one of the following: +.Bl -tag -width U16 +.It Dq Vt U8 +.Vt uint8_t +element. +.It Dq Vt V8 +Same as +.Vt U8 , +except that the sentinel value 0xFF matches any. +.It Dq Vt G16 +.Vt uint16_t +element; any value greater than or equal matches. +.It Dq Vt L16 +.Vt uint16_t +element; any value less than or equal matches. +.It Dq Vt M16 +.Vt uint16_t +element; mask of which of the following fields to use. +.It Dq Vt U16 +.Vt uint16_t +element. +.It Dq Vt V16 +Same as +.Vt U16 , +except that the sentinel value 0xFFFF matches any. +.It Dq Vt U32 +.Vt uint32_t +element. +.It Dq Vt V32 +Same as +.Vt U32 , +except that the sentinel value 0xFFFFFFFF matches any. +.It Dq Vt W32 +Two +.Vt uint16_t +values; the first named member is in the least significant word and the second +named member is in the most significant word. +.It Dq Vt Z +A pointer to a string to match exactly. +.It Dq Vt D +A pointer to a human readable description for the device. +.It Dq Vt P +A pointer that should be ignored. +.It Dq Vt E +EISA PNP Identifier. +.El +.Pp +The pseudo-name +.Dq # +is reserved for fields that should be ignored. +Any member that does not match the parent device's pnpinfo output must be +ignored. +.Pp +The +.Fa bus +parameter is an unquoted word naming the parent bus of the driver. +For example, +.Dq pci . +.Pp +The +.Fa module +parameter is also an unquoted word. +It must be unique to the driver. +Usually the driver's name is used. +.Pp +The +.Fa table +parameter points to the device matching data with entries matching the +.Fa descriptor_string . +.Pp +The +.Fa entry_len +parameter is the size of each table entry, i.e., +.Ql sizeof(table[0]) . +.Pp +The +.Fa num_entries +parameter is the number of entries in the table, i.e., +.Ql nitems(table) . +Note that only valid entries should be included. +If the table contains trailing zero or bogus values, they should not be +included in +.Fa num_entries . +.\" +.Sh EXAMPLES +.Bd -literal -offset indent -compact +#include +#include +static struct my_pciids { + uint32_t devid; + const char *desc; +} my_ids[] = { + { 0x12345678, "Foo bar" }, + { 0x9abcdef0, "Baz fizz" }, +}; +MODULE_PNP_INFO("W32:vendor/device", pci, my_driver, my_ids, sizeof(my_ids[0]), + nitems(my_ids)); +.Ed +.\" +.Sh SEE ALSO +.Xr module 9 , +.Xr DRIVER_MODULE 9 , +.Xr devmatch 8 +.Sh HISTORY +The macro +.Nm +appeared in +.Fx 12.0 . +.Sh AUTHORS +The PNP framework and +.Xr devmatch 8 +utility were written by +.An Warner Losh Aq Mt imp@FreeBSD.org . Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Mon Feb 12 22:21:11 2018 (r329184) +++ head/share/man/man9/Makefile Mon Feb 12 22:42:06 2018 (r329185) @@ -199,6 +199,7 @@ MAN= accept_filter.9 \ mod_cc.9 \ module.9 \ MODULE_DEPEND.9 \ + MODULE_PNP_INFO.9 \ MODULE_VERSION.9 \ mtx_pool.9 \ mutex.9 \ Modified: head/share/man/man9/module.9 ============================================================================== --- head/share/man/man9/module.9 Mon Feb 12 22:21:11 2018 (r329184) +++ head/share/man/man9/module.9 Mon Feb 12 22:42:06 2018 (r329185) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 19, 2007 +.Dd February 12, 2018 .Dt MODULE 9 .Os .Sh NAME @@ -112,6 +112,7 @@ DECLARE_MODULE(foo, mod_data, SI_SUB_EXEC, SI_ORDER_AN .Xr DEV_MODULE 9 , .Xr DRIVER_MODULE 9 , .Xr MODULE_DEPEND 9 , +.Xr MODULE_PNP_INFO 9 , .Xr MODULE_VERSION 9 , .Xr SYSCALL_MODULE 9 .Pp From owner-svn-src-head@freebsd.org Mon Feb 12 22: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 5184EF003FC; Mon, 12 Feb 2018 22:43:48 +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 089E072E58; Mon, 12 Feb 2018 22:43:48 +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 0379C183E7; Mon, 12 Feb 2018 22:43:48 +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 w1CMhlmU031044; Mon, 12 Feb 2018 22:43:47 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CMhlsK031043; Mon, 12 Feb 2018 22:43:47 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802122243.w1CMhlsK031043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 12 Feb 2018 22:43:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329186 - head/sbin/devmatch X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sbin/devmatch X-SVN-Commit-Revision: 329186 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 22:43:48 -0000 Author: cem Date: Mon Feb 12 22:43:47 2018 New Revision: 329186 URL: https://svnweb.freebsd.org/changeset/base/329186 Log: devmatch.8: Link to MODULE_PNP_INFO(9) Sponsored by: Dell EMC Isilon Modified: head/sbin/devmatch/devmatch.8 Modified: head/sbin/devmatch/devmatch.8 ============================================================================== --- head/sbin/devmatch/devmatch.8 Mon Feb 12 22:42:06 2018 (r329185) +++ head/sbin/devmatch/devmatch.8 Mon Feb 12 22:43:47 2018 (r329186) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 25, 2017 +.Dd February 12, 2018 .Dt DEVMATCH 8 .Os .Sh NAME @@ -57,7 +57,8 @@ tables with that PNP info can't be found. Produce more verbose output. .El .Sh SEE ALSO -.Xr devinfo 8 +.Xr devinfo 8 , +.Xr MODULE_PNP_INFO 9 .Sh BUGS The kernel has hints in it, but we exclude it from the list of modules to suggest for unmatched devices. From owner-svn-src-head@freebsd.org Mon Feb 12 22:53: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 939A4F00E49; Mon, 12 Feb 2018 22:53:03 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 408C273499; Mon, 12 Feb 2018 22:53:03 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B25E1857B; Mon, 12 Feb 2018 22:53:03 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1CMr3Kc036340; Mon, 12 Feb 2018 22:53:03 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CMr12w036317; Mon, 12 Feb 2018 22:53:01 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201802122253.w1CMr12w036317@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Mon, 12 Feb 2018 22:53:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329187 - in head/sys: amd64/amd64 arm/arm arm64/arm64 compat/linprocfs compat/linux i386/i386 kern mips/mips powerpc/booke riscv/riscv sparc64/sparc64 sys vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: in head/sys: amd64/amd64 arm/arm arm64/arm64 compat/linprocfs compat/linux i386/i386 kern mips/mips powerpc/booke riscv/riscv sparc64/sparc64 sys vm X-SVN-Commit-Revision: 329187 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 22:53:03 -0000 Author: jeff Date: Mon Feb 12 22:53:00 2018 New Revision: 329187 URL: https://svnweb.freebsd.org/changeset/base/329187 Log: Make v_wire_count a per-cpu counter(9) counter. This eliminates a significant source of cache line contention from vm_page_alloc(). Use accessors and vm_page_unwire_noq() so that the mechanism can be easily changed in the future. Reviewed by: markj Discussed with: kib, glebius Tested by: pho (earlier version) Sponsored by: Netflix, Dell/EMC Isilon Differential Revision: https://reviews.freebsd.org/D14273 Modified: head/sys/amd64/amd64/efirt_machdep.c head/sys/amd64/amd64/pmap.c head/sys/arm/arm/pmap-v6.c head/sys/arm64/arm64/efirt_machdep.c head/sys/arm64/arm64/pmap.c head/sys/compat/linprocfs/linprocfs.c head/sys/compat/linux/linux_misc.c head/sys/i386/i386/pmap.c head/sys/kern/kern_mib.c head/sys/kern/subr_pcpu.c head/sys/kern/vfs_bio.c head/sys/mips/mips/pmap.c head/sys/powerpc/booke/pmap.c head/sys/riscv/riscv/pmap.c head/sys/sparc64/sparc64/pmap.c head/sys/sys/vmmeter.h head/sys/vm/swap_pager.c head/sys/vm/vm_glue.c head/sys/vm/vm_meter.c head/sys/vm/vm_mmap.c head/sys/vm/vm_page.c Modified: head/sys/amd64/amd64/efirt_machdep.c ============================================================================== --- head/sys/amd64/amd64/efirt_machdep.c Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/amd64/amd64/efirt_machdep.c Mon Feb 12 22:53:00 2018 (r329187) @@ -74,8 +74,7 @@ efi_destroy_1t1_map(void) VM_OBJECT_RLOCK(obj_1t1_pt); TAILQ_FOREACH(m, &obj_1t1_pt->memq, listq) m->wire_count = 0; - atomic_subtract_int(&vm_cnt.v_wire_count, - obj_1t1_pt->resident_page_count); + vm_wire_sub(obj_1t1_pt->resident_page_count); VM_OBJECT_RUNLOCK(obj_1t1_pt); vm_object_deallocate(obj_1t1_pt); } Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/amd64/amd64/pmap.c Mon Feb 12 22:53:00 2018 (r329187) @@ -1246,7 +1246,7 @@ pmap_init(void) mpte->phys_addr = KPTphys + (i << PAGE_SHIFT); mpte->wire_count = 1; } - atomic_add_int(&vm_cnt.v_wire_count, nkpt); + vm_wire_add(nkpt); /* * If the kernel is running on a virtual machine, then it must assume @@ -2381,7 +2381,7 @@ pmap_free_zero_pages(struct spglist *free) /* Preserve the page's PG_ZERO setting. */ vm_page_free_toq(m); } - atomic_subtract_int(&vm_cnt.v_wire_count, count); + vm_wire_sub(count); } /* Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/arm/arm/pmap-v6.c Mon Feb 12 22:53:00 2018 (r329187) @@ -2634,11 +2634,12 @@ pmap_unwire_pt2pg(pmap_t pmap, vm_offset_t va, vm_page pmap->pm_stats.resident_count--; /* - * This is a release store so that the ordinary store unmapping + * This barrier is so that the ordinary store unmapping * the L2 page table page is globally performed before TLB shoot- * down is begun. */ - atomic_subtract_rel_int(&vm_cnt.v_wire_count, 1); + wmb(); + vm_wire_sub(1); } /* @@ -2945,7 +2946,7 @@ out: SLIST_REMOVE_HEAD(&free, plinks.s.ss); /* Recycle a freed page table page. */ m_pc->wire_count = 1; - atomic_add_int(&vm_cnt.v_wire_count, 1); + vm_wire_add(1); } pmap_free_zero_pages(&free); return (m_pc); Modified: head/sys/arm64/arm64/efirt_machdep.c ============================================================================== --- head/sys/arm64/arm64/efirt_machdep.c Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/arm64/arm64/efirt_machdep.c Mon Feb 12 22:53:00 2018 (r329187) @@ -75,8 +75,7 @@ efi_destroy_1t1_map(void) VM_OBJECT_RLOCK(obj_1t1_pt); TAILQ_FOREACH(m, &obj_1t1_pt->memq, listq) m->wire_count = 0; - atomic_subtract_int(&vm_cnt.v_wire_count, - obj_1t1_pt->resident_page_count); + vm_wire_sub(obj_1t1_pt->resident_page_count); VM_OBJECT_RUNLOCK(obj_1t1_pt); vm_object_deallocate(obj_1t1_pt); } Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/arm64/arm64/pmap.c Mon Feb 12 22:53:00 2018 (r329187) @@ -1362,7 +1362,7 @@ _pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t } pmap_invalidate_page(pmap, va); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_wire_sub(1); /* * Put page on a list so that it is released after @@ -1907,7 +1907,7 @@ reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **l SLIST_REMOVE_HEAD(&free, plinks.s.ss); /* Recycle a freed page table page. */ m_pc->wire_count = 1; - atomic_add_int(&vm_cnt.v_wire_count, 1); + vm_wire_add(1); } pmap_free_zero_pages(&free); return (m_pc); @@ -1958,7 +1958,7 @@ free_pv_chunk(struct pv_chunk *pc) /* entire chunk is free, return it */ m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pc)); dump_drop_page(m->phys_addr); - vm_page_unwire(m, PQ_NONE); + vm_page_unwire_noq(m); vm_page_free(m); } @@ -2264,9 +2264,9 @@ pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_ pmap_resident_count_dec(pmap, 1); KASSERT(ml3->wire_count == NL3PG, ("pmap_remove_pages: l3 page wire count error")); - ml3->wire_count = 0; + ml3->wire_count = 1; + vm_page_unwire_noq(ml3); pmap_add_delayed_free_list(ml3, free, FALSE); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); } return (pmap_unuse_pt(pmap, sva, l1e, free)); } @@ -3711,11 +3711,10 @@ pmap_remove_pages(pmap_t pmap) pmap_resident_count_dec(pmap,1); KASSERT(ml3->wire_count == NL3PG, ("pmap_remove_pages: l3 page wire count error")); - ml3->wire_count = 0; + ml3->wire_count = 1; + vm_page_unwire_noq(ml3); pmap_add_delayed_free_list(ml3, &free, FALSE); - atomic_subtract_int( - &vm_cnt.v_wire_count, 1); } break; case 2: Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/compat/linprocfs/linprocfs.c Mon Feb 12 22:53:00 2018 (r329187) @@ -163,7 +163,7 @@ linprocfs_domeminfo(PFS_FILL_ARGS) * is very little memory left, so we cheat and tell them that * all memory that isn't wired down is free. */ - memused = vm_cnt.v_wire_count * PAGE_SIZE; + memused = vm_wire_count() * PAGE_SIZE; memfree = memtotal - memused; swap_pager_status(&i, &j); swaptotal = (unsigned long long)i * PAGE_SIZE; Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/compat/linux/linux_misc.c Mon Feb 12 22:53:00 2018 (r329187) @@ -165,7 +165,7 @@ linux_sysinfo(struct thread *td, struct linux_sysinfo_ LINUX_SYSINFO_LOADS_SCALE / averunnable.fscale; sysinfo.totalram = physmem * PAGE_SIZE; - sysinfo.freeram = sysinfo.totalram - vm_cnt.v_wire_count * PAGE_SIZE; + sysinfo.freeram = sysinfo.totalram - vm_wire_count() * PAGE_SIZE; sysinfo.sharedram = 0; mtx_lock(&vm_object_list_mtx); Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/i386/i386/pmap.c Mon Feb 12 22:53:00 2018 (r329187) @@ -1718,7 +1718,7 @@ pmap_free_zero_pages(struct spglist *free) /* Preserve the page's PG_ZERO setting. */ vm_page_free_toq(m); } - atomic_subtract_int(&vm_cnt.v_wire_count, count); + vm_wire_sub(count); } /* Modified: head/sys/kern/kern_mib.c ============================================================================== --- head/sys/kern/kern_mib.c Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/kern/kern_mib.c Mon Feb 12 22:53:00 2018 (r329187) @@ -206,7 +206,7 @@ sysctl_hw_usermem(SYSCTL_HANDLER_ARGS) { u_long val; - val = ctob(physmem - vm_cnt.v_wire_count); + val = ctob(physmem - vm_wire_count()); return (sysctl_handle_long(oidp, &val, 0, req)); } Modified: head/sys/kern/subr_pcpu.c ============================================================================== --- head/sys/kern/subr_pcpu.c Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/kern/subr_pcpu.c Mon Feb 12 22:53:00 2018 (r329187) @@ -151,7 +151,7 @@ pcpu_zones_startup(void) pcpu_zone_ptr = uma_zcreate("ptr pcpu", sizeof(void *), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_PCPU); } -SYSINIT(pcpu_zones, SI_SUB_KMEM, SI_ORDER_ANY, pcpu_zones_startup, NULL); +SYSINIT(pcpu_zones, SI_SUB_VM, SI_ORDER_ANY, pcpu_zones_startup, NULL); /* * First-fit extent based allocator for allocating space in the per-cpu Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/kern/vfs_bio.c Mon Feb 12 22:53:00 2018 (r329187) @@ -4552,7 +4552,7 @@ vm_hold_free_pages(struct buf *bp, int newbsize) p->wire_count--; vm_page_free(p); } - atomic_subtract_int(&vm_cnt.v_wire_count, bp->b_npages - newnpages); + vm_wire_sub(bp->b_npages - newnpages); bp->b_npages = newnpages; } Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/mips/mips/pmap.c Mon Feb 12 22:53:00 2018 (r329187) @@ -1009,7 +1009,7 @@ _pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_ * If the page is finally unwired, simply free it. */ vm_page_free_zero(m); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_wire_sub(1); } /* Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/powerpc/booke/pmap.c Mon Feb 12 22:53:00 2018 (r329187) @@ -681,7 +681,7 @@ pdir_free(mmu_t mmu, pmap_t pmap, unsigned int pp2d_id pa = pte_vatopa(mmu, kernel_pmap, va); m = PHYS_TO_VM_PAGE(pa); vm_page_free_zero(m); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_wire_sub(1); pmap_kremove(va); } @@ -786,7 +786,7 @@ ptbl_alloc(mmu_t mmu, pmap_t pmap, pte_t ** pdir, unsi ptbl_free_pmap_ptbl(pmap, ptbl); for (j = 0; j < i; j++) vm_page_free(mtbl[j]); - atomic_subtract_int(&vm_cnt.v_wire_count, i); + vm_wire_sub(i); return (NULL); } VM_WAIT; @@ -828,7 +828,7 @@ ptbl_free(mmu_t mmu, pmap_t pmap, pte_t ** pdir, unsig pa = pte_vatopa(mmu, kernel_pmap, va); m = PHYS_TO_VM_PAGE(pa); vm_page_free_zero(m); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_wire_sub(1); pmap_kremove(va); } @@ -1030,7 +1030,7 @@ ptbl_alloc(mmu_t mmu, pmap_t pmap, unsigned int pdir_i ptbl_free_pmap_ptbl(pmap, ptbl); for (j = 0; j < i; j++) vm_page_free(mtbl[j]); - atomic_subtract_int(&vm_cnt.v_wire_count, i); + vm_wire_sub(i); return (NULL); } VM_WAIT; @@ -1091,7 +1091,7 @@ ptbl_free(mmu_t mmu, pmap_t pmap, unsigned int pdir_id pa = pte_vatopa(mmu, kernel_pmap, va); m = PHYS_TO_VM_PAGE(pa); vm_page_free_zero(m); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_wire_sub(1); mmu_booke_kremove(mmu, va); } Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/riscv/riscv/pmap.c Mon Feb 12 22:53:00 2018 (r329187) @@ -1153,7 +1153,7 @@ _pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t } pmap_invalidate_page(pmap, va); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_wire_sub(1); /* * Put page on a list so that it is released after Modified: head/sys/sparc64/sparc64/pmap.c ============================================================================== --- head/sys/sparc64/sparc64/pmap.c Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/sparc64/sparc64/pmap.c Mon Feb 12 22:53:00 2018 (r329187) @@ -1308,8 +1308,7 @@ pmap_release(pmap_t pm) while (!TAILQ_EMPTY(&obj->memq)) { m = TAILQ_FIRST(&obj->memq); m->md.pmap = NULL; - m->wire_count--; - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_page_unwire_noq(m); vm_page_free_zero(m); } VM_OBJECT_WUNLOCK(obj); Modified: head/sys/sys/vmmeter.h ============================================================================== --- head/sys/sys/vmmeter.h Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/sys/vmmeter.h Mon Feb 12 22:53:00 2018 (r329187) @@ -125,6 +125,7 @@ struct vmmeter { counter_u64_t v_vforkpages; /* (p) pages affected by vfork() */ counter_u64_t v_rforkpages; /* (p) pages affected by rfork() */ counter_u64_t v_kthreadpages; /* (p) ... and by kernel fork() */ + counter_u64_t v_wire_count; /* (p) pages wired down */ #define VM_METER_NCOUNTERS \ (offsetof(struct vmmeter, v_page_size) / sizeof(counter_u64_t)) /* @@ -139,7 +140,6 @@ struct vmmeter { u_int v_pageout_free_min; /* (c) min pages reserved for kernel */ u_int v_interrupt_free_min; /* (c) reserved pages for int code */ u_int v_free_severe; /* (c) severe page depletion point */ - u_int v_wire_count VMMETER_ALIGNED; /* (a) pages wired down */ }; #endif /* _KERNEL || _WANT_VMMETER */ @@ -155,7 +155,27 @@ extern domainset_t vm_severe_domains; #define VM_CNT_INC(var) VM_CNT_ADD(var, 1) #define VM_CNT_FETCH(var) counter_u64_fetch(vm_cnt.var) +static inline void +vm_wire_add(int cnt) +{ + + VM_CNT_ADD(v_wire_count, cnt); +} + +static inline void +vm_wire_sub(int cnt) +{ + + VM_CNT_ADD(v_wire_count, -cnt); +} + u_int vm_free_count(void); +static inline u_int +vm_wire_count(void) +{ + + return (VM_CNT_FETCH(v_wire_count)); +} /* * Return TRUE if we are under our severe low-free-pages threshold Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/vm/swap_pager.c Mon Feb 12 22:53:00 2018 (r329187) @@ -209,7 +209,8 @@ swap_reserve_by_cred(vm_ooffset_t incr, struct ucred * mtx_lock(&sw_dev_mtx); r = swap_reserved + incr; if (overcommit & SWAP_RESERVE_ALLOW_NONWIRED) { - s = vm_cnt.v_page_count - vm_cnt.v_free_reserved - vm_cnt.v_wire_count; + s = vm_cnt.v_page_count - vm_cnt.v_free_reserved - + vm_wire_count(); s *= PAGE_SIZE; } else s = 0; Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/vm/vm_glue.c Mon Feb 12 22:53:00 2018 (r329187) @@ -191,7 +191,7 @@ vslock(void *addr, size_t len) * Also, the sysctl code, which is the only present user * of vslock(), does a hard loop on EAGAIN. */ - if (npages + vm_cnt.v_wire_count > vm_page_max_wired) + if (npages + vm_wire_count() > vm_page_max_wired) return (EAGAIN); #endif error = vm_map_wire(&curproc->p_vmspace->vm_map, start, end, Modified: head/sys/vm/vm_meter.c ============================================================================== --- head/sys/vm/vm_meter.c Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/vm/vm_meter.c Mon Feb 12 22:53:00 2018 (r329187) @@ -96,6 +96,7 @@ struct vmmeter __exclusive_cache_line vm_cnt = { .v_vforkpages = EARLY_COUNTER, .v_rforkpages = EARLY_COUNTER, .v_kthreadpages = EARLY_COUNTER, + .v_wire_count = EARLY_COUNTER, }; static void @@ -105,7 +106,7 @@ vmcounter_startup(void) COUNTER_ARRAY_ALLOC(cnt, VM_METER_NCOUNTERS, M_WAITOK); } -SYSINIT(counter, SI_SUB_CPU, SI_ORDER_FOURTH + 1, vmcounter_startup, NULL); +SYSINIT(counter, SI_SUB_KMEM, SI_ORDER_FIRST, vmcounter_startup, NULL); SYSCTL_UINT(_vm, VM_V_FREE_MIN, v_free_min, CTLFLAG_RW, &vm_cnt.v_free_min, 0, "Minimum low-free-pages threshold"); @@ -403,7 +404,7 @@ VM_STATS_UINT(v_free_reserved, "Pages reserved for dea VM_STATS_UINT(v_free_target, "Pages desired free"); VM_STATS_UINT(v_free_min, "Minimum low-free-pages threshold"); VM_STATS_PROC(v_free_count, "Free pages", vm_free_count); -VM_STATS_UINT(v_wire_count, "Wired pages"); +VM_STATS_PROC(v_wire_count, "Wired pages", vm_wire_count); VM_STATS_PROC(v_active_count, "Active pages", vm_active_count); VM_STATS_UINT(v_inactive_target, "Desired inactive pages"); VM_STATS_PROC(v_inactive_count, "Inactive pages", vm_inactive_count); Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/vm/vm_mmap.c Mon Feb 12 22:53:00 2018 (r329187) @@ -1002,7 +1002,7 @@ kern_mlock(struct proc *proc, struct ucred *cred, uint return (ENOMEM); } PROC_UNLOCK(proc); - if (npages + vm_cnt.v_wire_count > vm_page_max_wired) + if (npages + vm_wire_count() > vm_page_max_wired) return (EAGAIN); #ifdef RACCT if (racct_enable) { Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Mon Feb 12 22:43:47 2018 (r329186) +++ head/sys/vm/vm_page.c Mon Feb 12 22:53:00 2018 (r329187) @@ -1796,7 +1796,7 @@ found: * The page lock is not required for wiring a page until that * page is inserted into the object. */ - atomic_add_int(&vm_cnt.v_wire_count, 1); + vm_wire_add(1); m->wire_count = 1; } m->act_count = 0; @@ -1805,7 +1805,7 @@ found: if (vm_page_insert_after(m, object, pindex, mpred)) { pagedaemon_wakeup(domain); if (req & VM_ALLOC_WIRED) { - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_wire_sub(1); m->wire_count = 0; } KASSERT(m->object == NULL, ("page %p has object", m)); @@ -1989,7 +1989,7 @@ found: if ((req & VM_ALLOC_SBUSY) != 0) busy_lock = VPB_SHARERS_WORD(1); if ((req & VM_ALLOC_WIRED) != 0) - atomic_add_int(&vm_cnt.v_wire_count, npages); + vm_wire_add(npages); if (object != NULL) { if (object->memattr != VM_MEMATTR_DEFAULT && memattr == VM_MEMATTR_DEFAULT) @@ -2007,8 +2007,7 @@ found: if (vm_page_insert_after(m, object, pindex, mpred)) { pagedaemon_wakeup(domain); if ((req & VM_ALLOC_WIRED) != 0) - atomic_subtract_int( - &vm_cnt.v_wire_count, npages); + vm_wire_sub(npages); KASSERT(m->object == NULL, ("page %p has object", m)); mpred = m; @@ -2133,7 +2132,7 @@ again: * The page lock is not required for wiring a page that does * not belong to an object. */ - atomic_add_int(&vm_cnt.v_wire_count, 1); + vm_wire_add(1); m->wire_count = 1; } /* Unmanaged pages don't use "act_count". */ @@ -3256,7 +3255,7 @@ vm_page_wire(vm_page_t m) KASSERT((m->oflags & VPO_UNMANAGED) == 0 || m->queue == PQ_NONE, ("vm_page_wire: unmanaged page %p is queued", m)); - atomic_add_int(&vm_cnt.v_wire_count, 1); + vm_wire_add(1); } m->wire_count++; KASSERT(m->wire_count != 0, ("vm_page_wire: wire_count overflow m=%p", m)); @@ -3331,7 +3330,7 @@ vm_page_unwire_noq(vm_page_t m) panic("vm_page_unwire: page %p's wire count is zero", m); m->wire_count--; if (m->wire_count == 0) { - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_wire_sub(1); return (true); } else return (false); @@ -4157,7 +4156,7 @@ DB_SHOW_COMMAND(page, vm_page_print_page_info) db_printf("vm_cnt.v_inactive_count: %d\n", vm_inactive_count()); db_printf("vm_cnt.v_active_count: %d\n", vm_active_count()); db_printf("vm_cnt.v_laundry_count: %d\n", vm_laundry_count()); - db_printf("vm_cnt.v_wire_count: %d\n", vm_cnt.v_wire_count); + db_printf("vm_cnt.v_wire_count: %d\n", vm_wire_count()); db_printf("vm_cnt.v_free_reserved: %d\n", vm_cnt.v_free_reserved); db_printf("vm_cnt.v_free_min: %d\n", vm_cnt.v_free_min); db_printf("vm_cnt.v_free_target: %d\n", vm_cnt.v_free_target); From owner-svn-src-head@freebsd.org Mon Feb 12 23: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 4555BF04F47; Mon, 12 Feb 2018 23:53:40 +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 E4FA17575C; Mon, 12 Feb 2018 23:53:39 +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 C57D218F5D; Mon, 12 Feb 2018 23:53:39 +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 w1CNrdk2065952; Mon, 12 Feb 2018 23:53:39 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1CNrdtc065944; Mon, 12 Feb 2018 23:53:39 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201802122353.w1CNrdtc065944@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Mon, 12 Feb 2018 23:53:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329188 - head/cddl/lib/libdtrace X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/cddl/lib/libdtrace X-SVN-Commit-Revision: 329188 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 12 Feb 2018 23:53:40 -0000 Author: dteske Date: Mon Feb 12 23:53:38 2018 New Revision: 329188 URL: https://svnweb.freebsd.org/changeset/base/329188 Log: Use tabs in io.d, fix alignment issues, remove extraneous newlines Modified: head/cddl/lib/libdtrace/io.d head/cddl/lib/libdtrace/ip.d head/cddl/lib/libdtrace/libproc_compat.h head/cddl/lib/libdtrace/psinfo.d head/cddl/lib/libdtrace/regs_x86.d head/cddl/lib/libdtrace/sched.d head/cddl/lib/libdtrace/tcp.d head/cddl/lib/libdtrace/udp.d Modified: head/cddl/lib/libdtrace/io.d ============================================================================== --- head/cddl/lib/libdtrace/io.d Mon Feb 12 22:53:00 2018 (r329187) +++ head/cddl/lib/libdtrace/io.d Mon Feb 12 23:53:38 2018 (r329188) @@ -29,47 +29,47 @@ #pragma D depends_on provider io typedef struct devinfo { - int dev_major; /* major number */ - int dev_minor; /* minor number */ - int dev_instance; /* instance number */ - string dev_name; /* name of device */ - string dev_statname; /* name of device + instance/minor */ - string dev_pathname; /* pathname of device */ + int dev_major; /* major number */ + int dev_minor; /* minor number */ + int dev_instance; /* instance number */ + string dev_name; /* name of device */ + string dev_statname; /* name of device + instance/minor */ + string dev_pathname; /* pathname of device */ } devinfo_t; #pragma D binding "1.0" translator translator devinfo_t < struct devstat *D > { - dev_major = D->device_number; - dev_minor = D->unit_number; - dev_instance = 0; - dev_name = stringof(D->device_name); - dev_statname = stringof(D->device_name); - dev_pathname = stringof(D->device_name); + dev_major = D->device_number; + dev_minor = D->unit_number; + dev_instance = 0; + dev_name = stringof(D->device_name); + dev_statname = stringof(D->device_name); + dev_pathname = stringof(D->device_name); }; typedef struct bufinfo { - int b_flags; /* flags */ - long b_bcount; /* number of bytes */ - caddr_t b_addr; /* buffer address */ - uint64_t b_blkno; /* expanded block # on device */ - uint64_t b_lblkno; /* block # on device */ - size_t b_resid; /* # of bytes not transferred */ - size_t b_bufsize; /* size of allocated buffer */ -/* caddr_t b_iodone; I/O completion routine */ - int b_error; /* expanded error field */ -/* dev_t b_edev; extended device */ + int b_flags; /* flags */ + long b_bcount; /* number of bytes */ + caddr_t b_addr; /* buffer address */ + uint64_t b_blkno; /* expanded block # on device */ + uint64_t b_lblkno; /* block # on device */ + size_t b_resid; /* # of bytes not transferred */ + size_t b_bufsize; /* size of allocated buffer */ +/* caddr_t b_iodone; I/O completion routine */ + int b_error; /* expanded error field */ +/* dev_t b_edev; extended device */ } bufinfo_t; #pragma D binding "1.0" translator translator bufinfo_t < struct bio *B > { - b_flags = B->bio_flags; - b_bcount = B->bio_bcount; - b_addr = B->bio_data; - b_blkno = 0; - b_lblkno = 0; - b_resid = B->bio_resid; - b_bufsize = 0; /* XXX gnn */ - b_error = B->bio_error; + b_flags = B->bio_flags; + b_bcount = B->bio_bcount; + b_addr = B->bio_data; + b_blkno = 0; + b_lblkno = 0; + b_resid = B->bio_resid; + b_bufsize = 0; /* XXX gnn */ + b_error = B->bio_error; }; /* @@ -105,5 +105,3 @@ inline int O_SYNC = 0x0080; #pragma D binding "1.1" O_SYNC inline int O_TRUNC = 0x0400; #pragma D binding "1.1" O_TRUNC - - Modified: head/cddl/lib/libdtrace/ip.d ============================================================================== --- head/cddl/lib/libdtrace/ip.d Mon Feb 12 22:53:00 2018 (r329187) +++ head/cddl/lib/libdtrace/ip.d Mon Feb 12 23:53:38 2018 (r329188) @@ -215,10 +215,10 @@ translator csinfo_t < void *p > { #pragma D binding "1.6.3" translator translator csinfo_t < struct inpcb *p > { - cs_addr = NULL; - cs_cid = (uint64_t)p; - cs_pid = 0; /* XXX */ - cs_zoneid = 0; + cs_addr = NULL; + cs_cid = (uint64_t)p; + cs_pid = 0; /* XXX */ + cs_zoneid = 0; }; #pragma D binding "1.5" translator Modified: head/cddl/lib/libdtrace/libproc_compat.h ============================================================================== --- head/cddl/lib/libdtrace/libproc_compat.h Mon Feb 12 22:53:00 2018 (r329187) +++ head/cddl/lib/libdtrace/libproc_compat.h Mon Feb 12 23:53:38 2018 (r329188) @@ -4,7 +4,7 @@ * * This software was developed by Rui Paulo under sponsorship from the * FreeBSD Foundation. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: Modified: head/cddl/lib/libdtrace/psinfo.d ============================================================================== --- head/cddl/lib/libdtrace/psinfo.d Mon Feb 12 22:53:00 2018 (r329187) +++ head/cddl/lib/libdtrace/psinfo.d Mon Feb 12 23:53:38 2018 (r329188) @@ -97,4 +97,3 @@ inline psinfo_t *curpsinfo = xlate (curth inline lwpsinfo_t *curlwpsinfo = xlate (curthread); #pragma D attributes Stable/Stable/Common curlwpsinfo #pragma D binding "1.0" curlwpsinfo - Modified: head/cddl/lib/libdtrace/regs_x86.d ============================================================================== --- head/cddl/lib/libdtrace/regs_x86.d Mon Feb 12 22:53:00 2018 (r329187) +++ head/cddl/lib/libdtrace/regs_x86.d Mon Feb 12 23:53:38 2018 (r329188) @@ -1,4 +1,4 @@ -/* +/* * CDDL HEADER START * * The contents of this file are subject to the terms of the @@ -116,4 +116,3 @@ inline int R_R14 = 18 + 1 + 1; #pragma D binding "1.0" R_R14 inline int R_R15 = 18 + 1 + 0; #pragma D binding "1.0" R_R15 - Modified: head/cddl/lib/libdtrace/sched.d ============================================================================== --- head/cddl/lib/libdtrace/sched.d Mon Feb 12 22:53:00 2018 (r329187) +++ head/cddl/lib/libdtrace/sched.d Mon Feb 12 23:53:38 2018 (r329188) @@ -81,4 +81,3 @@ inline chipid_t chip = curcpu->cpu_chip; inline lgrp_id_t lgrp = curcpu->cpu_lgrp; #pragma D attributes Stable/Stable/Common lgrp #pragma D binding "1.0" lgrp - Modified: head/cddl/lib/libdtrace/tcp.d ============================================================================== --- head/cddl/lib/libdtrace/tcp.d Mon Feb 12 22:53:00 2018 (r329187) +++ head/cddl/lib/libdtrace/tcp.d Mon Feb 12 23:53:38 2018 (r329188) @@ -118,18 +118,18 @@ typedef struct tcpsinfo { int32_t tcps_rcv_ws; /* receive window scaling */ u_long tcps_cwnd; /* congestion window */ u_long tcps_cwnd_ssthresh; /* threshold for congestion avoidance */ - uint32_t tcps_srecover; /* for use in NewReno Fast Recovery */ + uint32_t tcps_srecover; /* for use in NewReno Fast Recovery */ uint32_t tcps_sack_fack; /* SACK sequence # we have acked */ uint32_t tcps_sack_snxt; /* next SACK seq # for retransmission */ uint32_t tcps_rto; /* round-trip timeout, msec */ uint32_t tcps_mss; /* max segment size */ int tcps_retransmit; /* retransmit send event, boolean */ int tcps_srtt; /* smoothed RTT in units of (TCP_RTT_SCALE*hz) */ - int tcps_debug; /* socket has SO_DEBUG set */ - int tcps_cookie; /* expose the socket's SO_USER_COOKIE */ - int32_t tcps_dupacks; /* consecutive dup acks received */ - uint32_t tcps_rtttime; /* RTT measurement start time */ - uint32_t tcps_rtseq; /* sequence # being timed */ + int tcps_debug; /* socket has SO_DEBUG set */ + int tcps_cookie; /* expose the socket's SO_USER_COOKIE */ + int32_t tcps_dupacks; /* consecutive dup acks received */ + uint32_t tcps_rtttime; /* RTT measurement start time */ + uint32_t tcps_rtseq; /* sequence # being timed */ uint32_t tcps_ts_recent; /* timestamp echo data */ } tcpsinfo_t; @@ -206,31 +206,31 @@ translator tcpsinfo_t < struct tcpcb *p > { tcps_snxt = p == NULL ? 0 : p->snd_nxt; tcps_rack = p == NULL ? 0 : p->last_ack_sent; tcps_rnxt = p == NULL ? 0 : p->rcv_nxt; - tcps_swnd = p == NULL ? -1 : p->snd_wnd; - tcps_snd_ws = p == NULL ? -1 : p->snd_scale; - tcps_swl1 = p == NULL ? -1 : p->snd_wl1; - tcps_swl2 = p == NULL ? -1 : p->snd_wl2; - tcps_radv = p == NULL ? -1 : p->rcv_adv; - tcps_rwnd = p == NULL ? -1 : p->rcv_wnd; - tcps_rup = p == NULL ? -1 : p->rcv_up; - tcps_rcv_ws = p == NULL ? -1 : p->rcv_scale; - tcps_cwnd = p == NULL ? -1 : p->snd_cwnd; - tcps_cwnd_ssthresh = p == NULL ? -1 : p->snd_ssthresh; - tcps_srecover = p == NULL ? -1 : p->snd_recover; + tcps_swnd = p == NULL ? -1 : p->snd_wnd; + tcps_snd_ws = p == NULL ? -1 : p->snd_scale; + tcps_swl1 = p == NULL ? -1 : p->snd_wl1; + tcps_swl2 = p == NULL ? -1 : p->snd_wl2; + tcps_radv = p == NULL ? -1 : p->rcv_adv; + tcps_rwnd = p == NULL ? -1 : p->rcv_wnd; + tcps_rup = p == NULL ? -1 : p->rcv_up; + tcps_rcv_ws = p == NULL ? -1 : p->rcv_scale; + tcps_cwnd = p == NULL ? -1 : p->snd_cwnd; + tcps_cwnd_ssthresh = p == NULL ? -1 : p->snd_ssthresh; + tcps_srecover = p == NULL ? -1 : p->snd_recover; tcps_sack_fack = p == NULL ? 0 : p->snd_fack; tcps_sack_snxt = p == NULL ? 0 : p->sack_newdata; tcps_rto = p == NULL ? -1 : (p->t_rxtcur * 1000) / `hz; - tcps_mss = p == NULL ? -1 : p->t_maxseg; + tcps_mss = p == NULL ? -1 : p->t_maxseg; tcps_retransmit = p == NULL ? -1 : p->t_rxtshift > 0 ? 1 : 0; - tcps_srtt = p == NULL ? -1 : p->t_srtt; /* smoothed RTT in units of (TCP_RTT_SCALE*hz) */ + tcps_srtt = p == NULL ? -1 : p->t_srtt; /* smoothed RTT in units of (TCP_RTT_SCALE*hz) */ tcps_debug = p == NULL ? 0 : p->t_inpcb->inp_socket->so_options & 1; tcps_cookie = p == NULL ? -1 : p->t_inpcb->inp_socket->so_user_cookie; - tcps_dupacks = p == NULL ? -1 : p->t_dupacks; - tcps_rtttime = p == NULL ? -1 : p->t_rtttime; - tcps_rtseq = p == NULL ? -1 : p->t_rtseq; - tcps_ts_recent = p == NULL ? -1 : p->ts_recent; + tcps_dupacks = p == NULL ? -1 : p->t_dupacks; + tcps_rtttime = p == NULL ? -1 : p->t_rtttime; + tcps_rtseq = p == NULL ? -1 : p->t_rtseq; + tcps_ts_recent = p == NULL ? -1 : p->ts_recent; }; #pragma D binding "1.6.3" translator @@ -319,74 +319,74 @@ inline int PRU_LISTEN = 3; #pragma D binding "1.12.1" PRU_CONNECT inline int PRU_CONNECT = 4; #pragma D binding "1.12.1" PRU_ACCEPT -inline int PRU_ACCEPT = 5 ; +inline int PRU_ACCEPT = 5 ; #pragma D binding "1.12.1" PRU_DISCONNECT -inline int PRU_DISCONNECT= 6; +inline int PRU_DISCONNECT = 6; #pragma D binding "1.12.1" PRU_SHUTDOWN -inline int PRU_SHUTDOWN = 7; +inline int PRU_SHUTDOWN = 7; #pragma D binding "1.12.1" PRU_RCVD -inline int PRU_RCVD = 8; +inline int PRU_RCVD = 8; #pragma D binding "1.12.1" PRU_SEND -inline int PRU_SEND = 9; +inline int PRU_SEND = 9; #pragma D binding "1.12.1" PRU_ABORT -inline int PRU_ABORT = 10; +inline int PRU_ABORT = 10; #pragma D binding "1.12.1" PRU_CONTROL -inline int PRU_CONTROL = 11; +inline int PRU_CONTROL = 11; #pragma D binding "1.12.1" PRU_SENSE -inline int PRU_SENSE = 12; +inline int PRU_SENSE = 12; #pragma D binding "1.12.1" PRU_RCVOOB -inline int PRU_RCVOOB = 13; +inline int PRU_RCVOOB = 13; #pragma D binding "1.12.1" PRU_SENDOOB -inline int PRU_SENDOOB = 14; +inline int PRU_SENDOOB = 14; #pragma D binding "1.12.1" PRU_SOCKADDR -inline int PRU_SOCKADDR = 15; +inline int PRU_SOCKADDR = 15; #pragma D binding "1.12.1" PRU_PEERADDR -inline int PRU_PEERADDR = 16; +inline int PRU_PEERADDR = 16; #pragma D binding "1.12.1" PRU_CONNECT2 -inline int PRU_CONNECT2 = 17; +inline int PRU_CONNECT2 = 17; #pragma D binding "1.12.1" PRU_FASTTIMO -inline int PRU_FASTTIMO = 18; +inline int PRU_FASTTIMO = 18; #pragma D binding "1.12.1" PRU_SLOWTIMO -inline int PRU_SLOWTIMO = 19; +inline int PRU_SLOWTIMO = 19; #pragma D binding "1.12.1" PRU_PROTORCV -inline int PRU_PROTORCV = 20; +inline int PRU_PROTORCV = 20; #pragma D binding "1.12.1" PRU_PROTOSEND -inline int PRU_PROTOSEND = 21; +inline int PRU_PROTOSEND = 21; #pragma D binding "1.12.1" PRU_SEND_EOF -inline int PRU_SEND_EOF = 22; +inline int PRU_SEND_EOF = 22; #pragma D binding "1.12.1" PRU_SOSETLABEL -inline int PRU_SOSETLABEL = 23; +inline int PRU_SOSETLABEL = 23; #pragma D binding "1.12.1" PRU_CLOSE -inline int PRU_CLOSE = 24; +inline int PRU_CLOSE = 24; #pragma D binding "1.12.1" PRU_FLUSH -inline int PRU_FLUSH = 25; +inline int PRU_FLUSH = 25; #pragma D binding "1.12.1" prureq_string inline string prureq_string[uint8_t req] = - req == PRU_ATTACH ? "ATTACH" : - req == PRU_DETACH ? "DETACH" : - req == PRU_BIND ? "BIND" : - req == PRU_LISTEN ? "LISTEN" : - req == PRU_CONNECT ? "CONNECT" : - req == PRU_ACCEPT ? "ACCEPT" : - req == PRU_DISCONNECT ? "DISCONNECT" : - req == PRU_SHUTDOWN ? "SHUTDOWN" : - req == PRU_RCVD ? "RCVD" : - req == PRU_SEND ? "SEND" : - req == PRU_ABORT ? "ABORT" : - req == PRU_CONTROL ? "CONTROL" : - req == PRU_SENSE ? "SENSE" : - req == PRU_RCVOOB ? "RCVOOB" : - req == PRU_SENDOOB ? "SENDOOB" : - req == PRU_SOCKADDR ? "SOCKADDR" : - req == PRU_PEERADDR ? "PEERADDR" : - req == PRU_CONNECT2 ? "CONNECT2" : - req == PRU_FASTTIMO ? "FASTTIMO" : - req == PRU_SLOWTIMO ? "SLOWTIMO" : - req == PRU_PROTORCV ? "PROTORCV" : - req == PRU_PROTOSEND ? "PROTOSEND" : - req == PRU_SEND ? "SEND_EOF" : - req == PRU_SOSETLABEL ? "SOSETLABEL" : - req == PRU_CLOSE ? "CLOSE" : - req == PRU_FLUSH ? "FLUSE" : + req == PRU_ATTACH ? "ATTACH" : + req == PRU_DETACH ? "DETACH" : + req == PRU_BIND ? "BIND" : + req == PRU_LISTEN ? "LISTEN" : + req == PRU_CONNECT ? "CONNECT" : + req == PRU_ACCEPT ? "ACCEPT" : + req == PRU_DISCONNECT ? "DISCONNECT" : + req == PRU_SHUTDOWN ? "SHUTDOWN" : + req == PRU_RCVD ? "RCVD" : + req == PRU_SEND ? "SEND" : + req == PRU_ABORT ? "ABORT" : + req == PRU_CONTROL ? "CONTROL" : + req == PRU_SENSE ? "SENSE" : + req == PRU_RCVOOB ? "RCVOOB" : + req == PRU_SENDOOB ? "SENDOOB" : + req == PRU_SOCKADDR ? "SOCKADDR" : + req == PRU_PEERADDR ? "PEERADDR" : + req == PRU_CONNECT2 ? "CONNECT2" : + req == PRU_FASTTIMO ? "FASTTIMO" : + req == PRU_SLOWTIMO ? "SLOWTIMO" : + req == PRU_PROTORCV ? "PROTORCV" : + req == PRU_PROTOSEND ? "PROTOSEND" : + req == PRU_SEND ? "SEND_EOF" : + req == PRU_SOSETLABEL ? "SOSETLABEL" : + req == PRU_CLOSE ? "CLOSE" : + req == PRU_FLUSH ? "FLUSE" : "unknown" ; Modified: head/cddl/lib/libdtrace/udp.d ============================================================================== --- head/cddl/lib/libdtrace/udp.d Mon Feb 12 22:53:00 2018 (r329187) +++ head/cddl/lib/libdtrace/udp.d Mon Feb 12 23:53:38 2018 (r329188) @@ -47,7 +47,7 @@ typedef struct udpinfo { uint16_t udp_sport; /* source port */ uint16_t udp_dport; /* destination port */ uint16_t udp_length; /* total length */ - uint16_t udp_checksum; /* headers + data checksum */ + uint16_t udp_checksum; /* headers + data checksum */ struct udphdr *udp_hdr; /* raw UDP header */ } udpinfo_t; From owner-svn-src-head@freebsd.org Tue Feb 13 03:44: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 92AC1F1AF18; Tue, 13 Feb 2018 03:44:52 +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 3C5A780FC1; Tue, 13 Feb 2018 03:44:52 +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 1CC311B794; Tue, 13 Feb 2018 03:44: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 w1D3ipfV081439; Tue, 13 Feb 2018 03:44:51 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1D3ioVT081427; Tue, 13 Feb 2018 03:44:50 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201802130344.w1D3ioVT081427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 13 Feb 2018 03:44:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329190 - in head/stand: . common mips/beri/loader powerpc/kboot powerpc/ofw sparc64/loader uboot/common uboot/lib X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/stand: . common mips/beri/loader powerpc/kboot powerpc/ofw sparc64/loader uboot/common uboot/lib X-SVN-Commit-Revision: 329190 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 13 Feb 2018 03:44:52 -0000 Author: jhibbits Date: Tue Feb 13 03:44:50 2018 New Revision: 329190 URL: https://svnweb.freebsd.org/changeset/base/329190 Log: Unify metadata load files for arm, mips, powerpc, sparc64 Summary: All metadata.c files are very similar, with only trivial changes. Unify them into a single common file, with minor special-casing where needed. Reviewed By: imp Differential Revision: https://reviews.freebsd.org/D13978 Added: head/stand/common/metadata.c - copied, changed from r329189, head/stand/powerpc/ofw/metadata.c Deleted: head/stand/mips/beri/loader/metadata.c head/stand/powerpc/kboot/metadata.c head/stand/powerpc/ofw/metadata.c head/stand/sparc64/loader/metadata.c head/stand/uboot/common/metadata.c Modified: head/stand/loader.mk head/stand/mips/beri/loader/Makefile head/stand/mips/beri/loader/exec.c head/stand/mips/beri/loader/loader.h head/stand/powerpc/kboot/Makefile head/stand/powerpc/kboot/main.c head/stand/powerpc/ofw/Makefile head/stand/sparc64/loader/Makefile head/stand/uboot.mk head/stand/uboot/lib/elf_freebsd.c Copied and modified: head/stand/common/metadata.c (from r329189, head/stand/powerpc/ofw/metadata.c) ============================================================================== --- head/stand/powerpc/ofw/metadata.c Tue Feb 13 02:11:39 2018 (r329189, copy source) +++ head/stand/common/metadata.c Tue Feb 13 03:44:50 2018 (r329190) @@ -34,12 +34,63 @@ __FBSDID("$FreeBSD$"); #include #include #include +#if defined(LOADER_FDT_SUPPORT) #include +#endif #include #include "bootstrap.h" +#if defined(__sparc64__) +#include + +extern struct tlb_entry *dtlb_store; +extern struct tlb_entry *itlb_store; + +extern int dtlb_slot; +extern int itlb_slot; + +static int +md_bootserial(void) +{ + char buf[64]; + ihandle_t inst; + phandle_t input; + phandle_t node; + phandle_t output; + + if ((node = OF_finddevice("/options")) == -1) + return(-1); + if (OF_getprop(node, "input-device", buf, sizeof(buf)) == -1) + return(-1); + input = OF_finddevice(buf); + if (OF_getprop(node, "output-device", buf, sizeof(buf)) == -1) + return(-1); + output = OF_finddevice(buf); + if (input == -1 || output == -1 || + OF_getproplen(input, "keyboard") >= 0) { + if ((node = OF_finddevice("/chosen")) == -1) + return(-1); + if (OF_getprop(node, "stdin", &inst, sizeof(inst)) == -1) + return(-1); + if ((input = OF_instance_to_package(inst)) == -1) + return(-1); + if (OF_getprop(node, "stdout", &inst, sizeof(inst)) == -1) + return(-1); + if ((output = OF_instance_to_package(inst)) == -1) + return(-1); + } + if (input != output) + return(-1); + if (OF_getprop(input, "device_type", buf, sizeof(buf)) == -1) + return(-1); + if (strcmp(buf, "serial") != 0) + return(-1); + return(0); +} +#endif + int md_getboothowto(char *kargs) { @@ -47,7 +98,7 @@ md_getboothowto(char *kargs) int howto; int active; int i; - + /* Parse kargs */ howto = 0; if (kargs != NULL) { @@ -98,14 +149,20 @@ md_getboothowto(char *kargs) cp++; } } + /* get equivalents from the environment */ for (i = 0; howto_names[i].ev != NULL; i++) if (getenv(howto_names[i].ev) != NULL) howto |= howto_names[i].mask; +#if defined(__sparc64__) + if (md_bootserial() != -1) + howto |= RB_SERIAL; +#else if (!strcmp(getenv("console"), "comconsole")) howto |= RB_SERIAL; if (!strcmp(getenv("console"), "nullconsole")) howto |= RB_MUTE; +#endif return(howto); } @@ -114,11 +171,11 @@ md_getboothowto(char *kargs) * Each variable is formatted as =, with a single nul * separating each variable, and a double nul terminating the environment. */ -vm_offset_t +static vm_offset_t md_copyenv(vm_offset_t addr) { struct env_var *ep; - + /* traverse the environment */ for (ep = environ; ep != NULL; ep = ep->ev_next) { archsw.arch_copyin(ep->ev_name, addr, strlen(ep->ev_name)); @@ -199,7 +256,7 @@ static int align; COPY32(0, a, c); \ } -vm_offset_t +static vm_offset_t md_copymodules(vm_offset_t addr, int kern64) { struct preloaded_file *fp; @@ -235,7 +292,7 @@ md_copymodules(vm_offset_t addr, int kern64) } /* - * Load the information expected by a powerpc kernel. + * Load the information expected by a kernel. * * - The 'boothowto' argument is constructed * - The 'bootdev' argument is constructed @@ -251,7 +308,9 @@ md_load_dual(char *args, vm_offset_t *modulep, vm_offs vm_offset_t kernend; vm_offset_t addr; vm_offset_t envp; +#if defined(LOADER_FDT_SUPPORT) vm_offset_t fdtp; +#endif vm_offset_t size; uint64_t scratch64; char *rootdevname; @@ -260,40 +319,45 @@ md_load_dual(char *args, vm_offset_t *modulep, vm_offs align = kern64 ? 8 : 4; howto = md_getboothowto(args); - /* - * Allow the environment variable 'rootdev' to override the supplied device - * This should perhaps go to MI code and/or have $rootdev tested/set by - * MI code before launching the kernel. + /* + * Allow the environment variable 'rootdev' to override the supplied + * device. This should perhaps go to MI code and/or have $rootdev + * tested/set by MI code before launching the kernel. */ rootdevname = getenv("rootdev"); if (rootdevname == NULL) - rootdevname = getenv("currdev"); + rootdevname = getenv("currdev"); /* Try reading the /etc/fstab file to select the root device */ getrootmount(rootdevname); - /* find the last module in the chain */ + /* Find the last module in the chain */ addr = 0; for (xp = file_findfile(NULL, NULL); xp != NULL; xp = xp->f_next) { if (addr < (xp->f_addr + xp->f_size)) addr = xp->f_addr + xp->f_size; } - /* pad to a page boundary */ + /* Pad to a page boundary */ addr = roundup(addr, PAGE_SIZE); - /* copy our environment */ + /* Copy our environment */ envp = addr; addr = md_copyenv(addr); - /* pad to a page boundary */ + /* Pad to a page boundary */ addr = roundup(addr, PAGE_SIZE); +#if defined(LOADER_FDT_SUPPORT) /* Copy out FDT */ - *dtb = fdtp = 0; - if (getenv("usefdt") != NULL) { - size = fdt_copy(addr); - *dtb = fdtp = addr; - addr = roundup(addr + size, PAGE_SIZE); + fdtp = 0; +#if defined(__powerpc__) + if (getenv("usefdt") != NULL) +#endif + { + size = fdt_copy(addr); + fdtp = addr; + addr = roundup(addr + size, PAGE_SIZE); } +#endif kernend = 0; kfp = file_findfile(NULL, kern64 ? "elf64 kernel" : "elf32 kernel"); @@ -305,19 +369,35 @@ md_load_dual(char *args, vm_offset_t *modulep, vm_offs if (kern64) { scratch64 = envp; file_addmetadata(kfp, MODINFOMD_ENVP, sizeof scratch64, &scratch64); - if (fdtp != 0) { +#if defined(LOADER_FDT_SUPPORT) + if (fdtp != 0) { scratch64 = fdtp; file_addmetadata(kfp, MODINFOMD_DTBP, sizeof scratch64, &scratch64); - } + } +#endif scratch64 = kernend; - file_addmetadata(kfp, MODINFOMD_KERNEND, sizeof scratch64, &scratch64); + file_addmetadata(kfp, MODINFOMD_KERNEND, + sizeof scratch64, &scratch64); } else { file_addmetadata(kfp, MODINFOMD_ENVP, sizeof envp, &envp); - if (fdtp != 0) +#if defined(LOADER_FDT_SUPPORT) + if (fdtp != 0) file_addmetadata(kfp, MODINFOMD_DTBP, sizeof fdtp, &fdtp); +#endif file_addmetadata(kfp, MODINFOMD_KERNEND, sizeof kernend, &kernend); } +#if defined(__sparc64__) + file_addmetadata(kfp, MODINFOMD_DTLB_SLOTS, + sizeof dtlb_slot, &dtlb_slot); + file_addmetadata(kfp, MODINFOMD_ITLB_SLOTS, + sizeof itlb_slot, &itlb_slot); + file_addmetadata(kfp, MODINFOMD_DTLB, + dtlb_slot * sizeof(*dtlb_store), dtlb_store); + file_addmetadata(kfp, MODINFOMD_ITLB, + itlb_slot * sizeof(*itlb_store), itlb_store); +#endif + *modulep = addr; size = md_copymodules(0, kern64); kernend = roundup(addr + size, PAGE_SIZE); @@ -329,8 +409,12 @@ md_load_dual(char *args, vm_offset_t *modulep, vm_offs } else { bcopy(&kernend, md->md_data, sizeof kernend); } - + (void)md_copymodules(addr, kern64); +#if defined(LOADER_FDT_SUPPORT) + if (dtb != NULL) + *dtb = fdtp; +#endif return(0); } @@ -341,9 +425,10 @@ md_load(char *args, vm_offset_t *modulep, vm_offset_t return (md_load_dual(args, modulep, dtb, 0)); } +#if defined(__mips__) || defined(__powerpc__) int md_load64(char *args, vm_offset_t *modulep, vm_offset_t *dtb) { return (md_load_dual(args, modulep, dtb, 1)); } - +#endif Modified: head/stand/loader.mk ============================================================================== --- head/stand/loader.mk Tue Feb 13 02:11:39 2018 (r329189) +++ head/stand/loader.mk Tue Feb 13 03:44:50 2018 (r329190) @@ -20,12 +20,16 @@ SRCS+= load_elf32.c reloc_elf32.c .elif ${MACHINE_CPUARCH} == "powerpc" SRCS+= load_elf32.c reloc_elf32.c SRCS+= load_elf64.c reloc_elf64.c +SRCS+= metadata.c .elif ${MACHINE_CPUARCH} == "sparc64" SRCS+= load_elf64.c reloc_elf64.c +SRCS+= metadata.c .elif ${MACHINE_ARCH:Mmips64*} != "" SRCS+= load_elf64.c reloc_elf64.c +SRCS+= metadata.c .elif ${MACHINE} == "mips" SRCS+= load_elf32.c reloc_elf32.c +SRCS+= metadata.c .endif .if ${LOADER_DISK_SUPPORT:Uyes} == "yes" Modified: head/stand/mips/beri/loader/Makefile ============================================================================== --- head/stand/mips/beri/loader/Makefile Tue Feb 13 02:11:39 2018 (r329189) +++ head/stand/mips/beri/loader/Makefile Tue Feb 13 03:44:50 2018 (r329190) @@ -47,7 +47,6 @@ SRCS= start.S \ main.c \ devicename.c \ exec.c \ - metadata.c \ vers.c \ arch.c Modified: head/stand/mips/beri/loader/exec.c ============================================================================== --- head/stand/mips/beri/loader/exec.c Tue Feb 13 02:11:39 2018 (r329189) +++ head/stand/mips/beri/loader/exec.c Tue Feb 13 03:44:50 2018 (r329190) @@ -85,7 +85,7 @@ beri_elf64_exec(struct preloaded_file *fp) } ehdr = (Elf_Ehdr *)md->md_data; - error = md_load64(fp->f_args, &mdp); + error = md_load64(fp->f_args, &mdp, NULL); if (error) { printf("%s: md_load64 failed\n", fp->f_name); return (error); Modified: head/stand/mips/beri/loader/loader.h ============================================================================== --- head/stand/mips/beri/loader/loader.h Tue Feb 13 02:11:39 2018 (r329189) +++ head/stand/mips/beri/loader/loader.h Tue Feb 13 03:44:50 2018 (r329190) @@ -56,7 +56,7 @@ extern char **boot2_envv; extern struct bootinfo boot2_bootinfo; /* metadata.c */ -int md_load64(char *args, vm_offset_t *modulep); +int md_load64(char *args, vm_offset_t *modulep, vm_offset_t *dtbp); /* vers.c */ extern char bootprog_info[]; Modified: head/stand/powerpc/kboot/Makefile ============================================================================== --- head/stand/powerpc/kboot/Makefile Tue Feb 13 02:11:39 2018 (r329189) +++ head/stand/powerpc/kboot/Makefile Tue Feb 13 03:44:50 2018 (r329190) @@ -17,7 +17,7 @@ NEWVERSWHAT= "kboot loader" ${MACHINE_ARCH} INSTALLFLAGS= -b # Architecture-specific loader code -SRCS= conf.c metadata.c vers.c main.c ppc64_elf_freebsd.c +SRCS= conf.c vers.c main.c ppc64_elf_freebsd.c SRCS+= host_syscall.S hostcons.c hostdisk.c kerneltramp.S kbootfdt.c SRCS+= ucmpdi2.c Modified: head/stand/powerpc/kboot/main.c ============================================================================== --- head/stand/powerpc/kboot/main.c Tue Feb 13 02:11:39 2018 (r329189) +++ head/stand/powerpc/kboot/main.c Tue Feb 13 03:44:50 2018 (r329190) @@ -291,6 +291,7 @@ main(int argc, const char **argv) setenv("currdev", bootdev, 1); setenv("loaddev", bootdev, 1); setenv("LINES", "24", 1); + setenv("usefdt", "1", 1); interact(); /* doesn't return */ Modified: head/stand/powerpc/ofw/Makefile ============================================================================== --- head/stand/powerpc/ofw/Makefile Tue Feb 13 02:11:39 2018 (r329189) +++ head/stand/powerpc/ofw/Makefile Tue Feb 13 03:44:50 2018 (r329190) @@ -17,7 +17,7 @@ NEWVERSWHAT= "Open Firmware loader" ${MACHINE_ARCH} INSTALLFLAGS= -b # Architecture-specific loader code -SRCS= conf.c metadata.c vers.c start.c +SRCS= conf.c vers.c start.c SRCS+= ucmpdi2.c .include "${BOOTSRC}/fdt.mk" Modified: head/stand/sparc64/loader/Makefile ============================================================================== --- head/stand/sparc64/loader/Makefile Tue Feb 13 02:11:39 2018 (r329189) +++ head/stand/sparc64/loader/Makefile Tue Feb 13 03:44:50 2018 (r329190) @@ -21,7 +21,7 @@ INSTALLFLAGS= -b # Architecture-specific loader code .PATH: ${BOOTSRC}/sparc64/loader -SRCS= locore.S main.c metadata.c vers.c +SRCS= locore.S main.c vers.c .if ${LOADER_DEBUG} == "yes" CFLAGS+= -DLOADER_DEBUG Modified: head/stand/uboot.mk ============================================================================== --- head/stand/uboot.mk Tue Feb 13 02:11:39 2018 (r329189) +++ head/stand/uboot.mk Tue Feb 13 03:44:50 2018 (r329190) @@ -1,6 +1,6 @@ # $FreeBSD$ -SRCS+= main.c metadata.c +SRCS+= main.c .PATH: ${UBOOTSRC}/common @@ -10,6 +10,9 @@ CFLAGS+= -I${UBOOTSRC}/common LIBUBOOT= ${BOOTOBJ}/uboot/lib/libuboot.a CFLAGS+= -I${UBOOTSRC}/lib CFLAGS+= -I${BOOTOBJ}/uboot/lib +.if ${MACHINE_CPUARCH} == "arm" +SRCS+= metadata.c +.endif .include "${BOOTSRC}/fdt.mk" Modified: head/stand/uboot/lib/elf_freebsd.c ============================================================================== --- head/stand/uboot/lib/elf_freebsd.c Tue Feb 13 02:11:39 2018 (r329189) +++ head/stand/uboot/lib/elf_freebsd.c Tue Feb 13 03:44:50 2018 (r329190) @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" #include "libuboot.h" -extern vm_offset_t md_load(char *, vm_offset_t *); +extern vm_offset_t md_load(char *, vm_offset_t *, vm_offset_t *); int __elfN(uboot_load)(char *filename, u_int64_t dest, @@ -81,7 +81,7 @@ __elfN(uboot_exec)(struct preloaded_file *fp) e = (Elf_Ehdr *)&fmp->md_data; - if ((error = md_load(fp->f_args, &mdp)) != 0) + if ((error = md_load(fp->f_args, &mdp, NULL)) != 0) return (error); entry = (void *)e->e_entry; From owner-svn-src-head@freebsd.org Tue Feb 13 06:36: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 6375EF027A5; Tue, 13 Feb 2018 06:36:28 +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 0EA8D87079; Tue, 13 Feb 2018 06:36:28 +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 05EAC1D31E; Tue, 13 Feb 2018 06:36:28 +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 w1D6aR1p065798; Tue, 13 Feb 2018 06:36:27 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1D6aRZO065797; Tue, 13 Feb 2018 06:36:27 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201802130636.w1D6aRZO065797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 13 Feb 2018 06:36:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329193 - head X-SVN-Group: head X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 329193 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 13 Feb 2018 06:36:28 -0000 Author: araujo Date: Tue Feb 13 06:36:27 2018 New Revision: 329193 URL: https://svnweb.freebsd.org/changeset/base/329193 Log: - I'm not using nis(8) and ypldap(8) anymore, so I'm removing myself from MAINTAINERS list. Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Tue Feb 13 04:28:13 2018 (r329192) +++ head/MAINTAINERS Tue Feb 13 06:36:27 2018 (r329193) @@ -65,7 +65,6 @@ lpr gad Pre-commit review requested, particularly for nanobsd imp Pre-commit phabricator review requested. net80211 adrian Pre-commit review requested, send to freebsd-wireless@freebsd.org nfs freebsd-fs@FreeBSD.org, rmacklem is best for reviews. -nis(8), yp(8) araujo Pre-commit review requested. nvd(4) jimharris Pre-commit review requested. nvme(4) jimharris Pre-commit review requested. nvmecontrol(8) jimharris Pre-commit review requested. From owner-svn-src-head@freebsd.org Tue Feb 13 08: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 AAA5BF081A5; Tue, 13 Feb 2018 08:10:17 +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 60E096A384; Tue, 13 Feb 2018 08:10:17 +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 5BD341E1A9; Tue, 13 Feb 2018 08:10:17 +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 w1D8AHPA010074; Tue, 13 Feb 2018 08:10:17 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1D8AHqW010073; Tue, 13 Feb 2018 08:10:17 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802130810.w1D8AHqW010073@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 13 Feb 2018 08:10:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329194 - head/etc/devd X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/etc/devd X-SVN-Commit-Revision: 329194 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 13 Feb 2018 08:10:17 -0000 Author: hselasky Date: Tue Feb 13 08:10:17 2018 New Revision: 329194 URL: https://svnweb.freebsd.org/changeset/base/329194 Log: Add missing semicolon to not break devd during system startup. Modified: head/etc/devd/devmatch.conf Modified: head/etc/devd/devmatch.conf ============================================================================== --- head/etc/devd/devmatch.conf Tue Feb 13 06:36:27 2018 (r329193) +++ head/etc/devd/devmatch.conf Tue Feb 13 08:10:17 2018 (r329194) @@ -9,12 +9,12 @@ # # Generic NOMATCH event nomatch 100 { - action "service devmatch start" + action "service devmatch start"; }; # Add the following to devd.conf to prevent this from running: # nomatch 1000 { -# action "true" +# action "true"; # }; # it replaces the generic event with one of higher priority that # does nothing. You can also set 'devmatch_enable=NO' in /etc/rc.conf From owner-svn-src-head@freebsd.org Tue Feb 13 08:13: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 54C5DF08838; Tue, 13 Feb 2018 08:13:21 +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 069356AA31; Tue, 13 Feb 2018 08:13:21 +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 018271E343; Tue, 13 Feb 2018 08:13:21 +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 w1D8DKKm015010; Tue, 13 Feb 2018 08:13:20 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1D8DKMB015007; Tue, 13 Feb 2018 08:13:20 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802130813.w1D8DKMB015007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 13 Feb 2018 08:13:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329195 - in head/sys/dev/usb: . quirk X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/usb: . quirk X-SVN-Commit-Revision: 329195 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 13 Feb 2018 08:13:21 -0000 Author: hselasky Date: Tue Feb 13 08:13:20 2018 New Revision: 329195 URL: https://svnweb.freebsd.org/changeset/base/329195 Log: Add new USB quirk. PR: 225844 MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Tue Feb 13 08:10:17 2018 (r329194) +++ head/sys/dev/usb/quirk/usb_quirk.c Tue Feb 13 08:13:20 2018 (r329195) @@ -137,6 +137,8 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK USB_QUIRK(CORSAIR, K60, 0x0000, 0xffff, UQ_KBD_BOOTPROTO), /* Quirk for Corsair Vengeance K70 keyboard */ USB_QUIRK(CORSAIR, K70, 0x0000, 0xffff, UQ_KBD_BOOTPROTO), + /* Quirk for Corsair K70 RGB keyboard */ + USB_QUIRK(CORSAIR, K70_RGB, 0x0000, 0xffff, UQ_KBD_BOOTPROTO), /* Quirk for Corsair STRAFE Gaming keyboard */ USB_QUIRK(CORSAIR, STRAFE, 0x0000, 0xffff, UQ_KBD_BOOTPROTO), /* umodem(4) device quirks */ Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue Feb 13 08:10:17 2018 (r329194) +++ head/sys/dev/usb/usbdevs Tue Feb 13 08:13:20 2018 (r329195) @@ -1532,6 +1532,7 @@ product COREGA FETHER_USB_TXC 0x9601 FEther USB-TXC /* Corsair products */ product CORSAIR K60 0x0a60 Corsair Vengeance K60 keyboard product CORSAIR K70 0x1b09 Corsair Vengeance K70 keyboard +product CORSAIR K70_RGB 0x1b13 Corsair K70 RGB Keyboard product CORSAIR STRAFE 0x1b15 Cossair STRAFE Gaming keyboard /* Creative products */ From owner-svn-src-head@freebsd.org Tue Feb 13 08: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 0C4B1F09031; Tue, 13 Feb 2018 08:17:20 +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 B24C36AE4C; Tue, 13 Feb 2018 08:17:19 +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 933461E34B; Tue, 13 Feb 2018 08:17:19 +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 w1D8HJqE015195; Tue, 13 Feb 2018 08:17:19 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1D8HJ45015194; Tue, 13 Feb 2018 08:17:19 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802130817.w1D8HJ45015194@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 13 Feb 2018 08:17:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329196 - head/usr.sbin/devmatch X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/usr.sbin/devmatch X-SVN-Commit-Revision: 329196 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 13 Feb 2018 08:17:20 -0000 Author: hselasky Date: Tue Feb 13 08:17:19 2018 New Revision: 329196 URL: https://svnweb.freebsd.org/changeset/base/329196 Log: Remove leftover empty directory. Deleted: head/usr.sbin/devmatch/ From owner-svn-src-head@freebsd.org Tue Feb 13 09:07: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 0B95CF0CD34; Tue, 13 Feb 2018 09:07:24 +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 A1B786CC61; Tue, 13 Feb 2018 09:07:23 +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 0349F2600EC; Tue, 13 Feb 2018 10:07:15 +0100 (CET) Subject: Re: svn commit: r329148 - head/etc/devd To: Renato Botelho , Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201802120445.w1C4jQBL081885@repo.freebsd.org> <1f2b78cb-c27b-6b3b-0ee7-130de756bbb7@gmail.com> From: Hans Petter Selasky Message-ID: Date: Tue, 13 Feb 2018 10:04:21 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <1f2b78cb-c27b-6b3b-0ee7-130de756bbb7@gmail.com> 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.25 Precedence: list List-Id: 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, 13 Feb 2018 09:07:24 -0000 On 02/12/18 20:13, Renato Botelho wrote: > On 12/02/18 02:45, Warner Losh wrote: >> Author: imp >> Date: Mon Feb 12 04:45:26 2018 >> New Revision: 329148 >> URL: https://svnweb.freebsd.org/changeset/base/329148 >> >> Log: >> Switch to using devmatch to autoload drivers. Remove usb.conf >> as obsolete because devmatch gets its information from the same >> place as the genration scripts. >> >> Added: >> head/etc/devd/devmatch.conf (contents, props changed) >> Deleted: >> head/etc/devd/usb.conf >> >> Added: head/etc/devd/devmatch.conf >> ============================================================================== >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >> +++ head/etc/devd/devmatch.conf Mon Feb 12 04:45:26 2018 (r329148) >> @@ -0,0 +1,13 @@ >> +# >> +# $FreeBSD$ >> +# >> + >> +# >> +# Example devd configuration file for automatically >> +# loading what modules we can based on nomatch >> +# events. >> +# >> +# Generic NOMATCH event >> +nomatch 100 { >> + action "service devmatch onestart" > > Config syntax is broken. It's missing ; in the end of above line > I've just fixed this in r329194. BTW: I see another annoying issue. Devmatch, when it receives a NOMATCH event, should limit the searching to the current system. I.E. when you plug a USB device, devmatch should not search PCI drivers aswell. Warner, can you add this support? --HPS From owner-svn-src-head@freebsd.org Tue Feb 13 10:11: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 E7FA4F12255; Tue, 13 Feb 2018 10:11:39 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9DD6E6FF17; Tue, 13 Feb 2018 10:11:39 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9877D1F69C; Tue, 13 Feb 2018 10:11:39 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1DABdKp071402; Tue, 13 Feb 2018 10:11:39 GMT (envelope-from n_hibma@FreeBSD.org) Received: (from n_hibma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DABd1S071401; Tue, 13 Feb 2018 10:11:39 GMT (envelope-from n_hibma@FreeBSD.org) Message-Id: <201802131011.w1DABd1S071401@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: n_hibma set sender to n_hibma@FreeBSD.org using -f From: Nick Hibma Date: Tue, 13 Feb 2018 10:11:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329197 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: n_hibma X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 329197 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 13 Feb 2018 10:11:40 -0000 Author: n_hibma Date: Tue Feb 13 10:11:39 2018 New Revision: 329197 URL: https://svnweb.freebsd.org/changeset/base/329197 Log: DSCP values passed to setdscp need to be lowercase. See definition of f_ipdscp values. They are compared against using bcmp which is case sensitive. MFC after: 1 week Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Tue Feb 13 08:17:19 2018 (r329196) +++ head/sbin/ipfw/ipfw.8 Tue Feb 13 10:11:39 2018 (r329197) @@ -1070,49 +1070,49 @@ Set specified DiffServ codepoint for an IPv4/IPv6 pack Processing continues at the next rule. Supported values are: .Pp -.Cm CS0 +.Cm cs0 .Pq Dv 000000 , -.Cm CS1 +.Cm cs1 .Pq Dv 001000 , -.Cm CS2 +.Cm cs2 .Pq Dv 010000 , -.Cm CS3 +.Cm cs3 .Pq Dv 011000 , -.Cm CS4 +.Cm cs4 .Pq Dv 100000 , -.Cm CS5 +.Cm cs5 .Pq Dv 101000 , -.Cm CS6 +.Cm cs6 .Pq Dv 110000 , -.Cm CS7 +.Cm cs7 .Pq Dv 111000 , -.Cm AF11 +.Cm af11 .Pq Dv 001010 , -.Cm AF12 +.Cm af12 .Pq Dv 001100 , -.Cm AF13 +.Cm af13 .Pq Dv 001110 , -.Cm AF21 +.Cm af21 .Pq Dv 010010 , -.Cm AF22 +.Cm af22 .Pq Dv 010100 , -.Cm AF23 +.Cm af23 .Pq Dv 010110 , -.Cm AF31 +.Cm af31 .Pq Dv 011010 , -.Cm AF32 +.Cm af32 .Pq Dv 011100 , -.Cm AF33 +.Cm af33 .Pq Dv 011110 , -.Cm AF41 +.Cm af41 .Pq Dv 100010 , -.Cm AF42 +.Cm af42 .Pq Dv 100100 , -.Cm AF43 +.Cm af43 .Pq Dv 100110 , -.Cm EF +.Cm ef .Pq Dv 101110 , -.Cm BE +.Cm be .Pq Dv 000000 . Additionally, DSCP value can be specified by number (0..64). It is also possible to use the From owner-svn-src-head@freebsd.org Tue Feb 13 11:43: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 7A95EF1985E; Tue, 13 Feb 2018 11:43:58 +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 2DB8673610; Tue, 13 Feb 2018 11:43:58 +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 2853F2055E; Tue, 13 Feb 2018 11:43:58 +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 w1DBhwrM019112; Tue, 13 Feb 2018 11:43:58 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DBhwXt019111; Tue, 13 Feb 2018 11:43:58 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802131143.w1DBhwXt019111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 13 Feb 2018 11:43:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329198 - head/sys/dev/usb X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/usb X-SVN-Commit-Revision: 329198 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 13 Feb 2018 11:43:58 -0000 Author: hselasky Date: Tue Feb 13 11:43:57 2018 New Revision: 329198 URL: https://svnweb.freebsd.org/changeset/base/329198 Log: Fix for incorrect PnP information used by devmatch(8). MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/usbdi.h Modified: head/sys/dev/usb/usbdi.h ============================================================================== --- head/sys/dev/usb/usbdi.h Tue Feb 13 10:11:39 2018 (r329197) +++ head/sys/dev/usb/usbdi.h Tue Feb 13 11:43:57 2018 (r329198) @@ -336,7 +336,7 @@ struct usb_device_id { unsigned long driver_info; } __aligned(32); -#define USB_STD_PNP_INFO "M16:mask;U16:vendor;U16:product;L16:product;G16:product;" \ +#define USB_STD_PNP_INFO "M16:mask;U16:vendor;U16:product;L16:release;G16:release;" \ "U8:devclass;U8:devsubclass;U8:devprotocol;" \ "U8:intclass;U8:intsubclass;U8:intprotocol;" #define USB_STD_PNP_HOST_INFO USB_STD_PNP_INFO "T:mode=host;" From owner-svn-src-head@freebsd.org Tue Feb 13 14: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 B42B7F0564F for ; Tue, 13 Feb 2018 14:40:23 +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 41D827B789 for ; Tue, 13 Feb 2018 14:40:23 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22f.google.com with SMTP id m11so21473236iob.2 for ; Tue, 13 Feb 2018 06:40:23 -0800 (PST) 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=rMC/aiHsaMLJjJ9Qc8GibtHeSv1rVFHpoHjueouFTZI=; b=WCEHuP20pKV64TnzgKhluHjDCzLDZCNYjgFepl23SMSfGBD7JnMiTemDcVAqy/GoTJ zwbZfw2/GIUA686p/HTZXa4vD7EcOijMHnAhzY56Fdj48eHukOF+SqrTrqF7HntsHH5V kKQT1oVFEckkN/WbNoEwYdJV5IN2pZYGOco5gFQSUXufYbpMGkoA2Yyaxl/IkypdsTZ5 dF8ayVd9TvX0fOYCWJpuVfctygx0X8TQiO3v/8yryUquotBGZ0rmjdZlXuiZ9K94IKw0 ifDMwtLAEEHr6LV0P4k7Xs2bR3TMYOJwysuJIspmpO2vp5DUFlll24MRvlNfLOd+TNJb kdAA== 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=rMC/aiHsaMLJjJ9Qc8GibtHeSv1rVFHpoHjueouFTZI=; b=pzfnoMPDaihGF2c1Lr1oQosMWzyDEqDr5+dQFVfIEIYJWKvt5oeUZESO93S049SkHB 1ibV4uG51bSjC77j89/ut6LwnUyTU9c8K9pbdG+32YFDMxAxDm1IR2WqWubgzIeyWr0y LLqrTr1gnmQtHNNby3uLN/hSqxzNiFsAMT1R5ts5PlF7+GwPCzDj5fBA0zS3fDuRvTV6 V9/gkBUteB5M50soa7O1lYMcc/STrEmPaHpEo9BVeItx/vQZS76S4vQE1oYBlECkzakd acsBZP1TFLInVYyMFghfMuwmOkYmPgpCzU5bSW0SBAJPG3y6s6Z39bwMvMC7GzOV4FKK ESYg== X-Gm-Message-State: APf1xPCp97GPEOxTYH+FnnY9z1g6ftGmNYg6gQqRxDjJkeS9nyDRBqdt cYgLxrh0DrAFKxfW0VGWNNWCybYtc+8PBCxPxXZVMw== X-Google-Smtp-Source: AH8x224tuZWOcgap5qhb9PhIBbCDcW+csmjaEjq4OihQZITL+Q8mblpJTBUaT1+2lY5W7QmyMdTvD8ijBM1WIwPCdu4= X-Received: by 10.107.51.78 with SMTP id z75mr882323ioz.291.1518532822439; Tue, 13 Feb 2018 06:40:22 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Tue, 13 Feb 2018 06:40:21 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:18a2:a4f7:170:8dd9] In-Reply-To: References: <201802120445.w1C4jQBL081885@repo.freebsd.org> <1f2b78cb-c27b-6b3b-0ee7-130de756bbb7@gmail.com> From: Warner Losh Date: Tue, 13 Feb 2018 07:40:21 -0700 X-Google-Sender-Auth: nIMYAYibfwF0oq7m-_0el4nBG3U Message-ID: Subject: Re: svn commit: r329148 - head/etc/devd To: Hans Petter Selasky Cc: Renato Botelho , 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.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 13 Feb 2018 14:40:23 -0000 On Tue, Feb 13, 2018 at 2:04 AM, Hans Petter Selasky wrote: > On 02/12/18 20:13, Renato Botelho wrote: > >> On 12/02/18 02:45, Warner Losh wrote: >> >>> Author: imp >>> Date: Mon Feb 12 04:45:26 2018 >>> New Revision: 329148 >>> URL: https://svnweb.freebsd.org/changeset/base/329148 >>> >>> Log: >>> Switch to using devmatch to autoload drivers. Remove usb.conf >>> as obsolete because devmatch gets its information from the same >>> place as the genration scripts. >>> >>> Added: >>> head/etc/devd/devmatch.conf (contents, props changed) >>> Deleted: >>> head/etc/devd/usb.conf >>> >>> Added: head/etc/devd/devmatch.conf >>> ============================================================ >>> ================== >>> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >>> +++ head/etc/devd/devmatch.conf Mon Feb 12 04:45:26 2018 (r329148) >>> @@ -0,0 +1,13 @@ >>> +# >>> +# $FreeBSD$ >>> +# >>> + >>> +# >>> +# Example devd configuration file for automatically >>> +# loading what modules we can based on nomatch >>> +# events. >>> +# >>> +# Generic NOMATCH event >>> +nomatch 100 { >>> + action "service devmatch onestart" >>> >> >> Config syntax is broken. It's missing ; in the end of above line >> >> > I've just fixed this in r329194. > > BTW: I see another annoying issue. Devmatch, when it receives a NOMATCH > event, should limit the searching to the current system. I.E. when you plug > a USB device, devmatch should not search PCI drivers aswell. > > Warner, can you add this support? Yes, but on boot, it's still going to match everything because all the NOMATCH events are in the queue. Warner From owner-svn-src-head@freebsd.org Tue Feb 13 15:13: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 11698F083C0; Tue, 13 Feb 2018 15:13:44 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B761D7DA58; Tue, 13 Feb 2018 15:13:43 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B25C922741; Tue, 13 Feb 2018 15:13:43 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1DFDhGd024580; Tue, 13 Feb 2018 15:13:43 GMT (envelope-from remko@FreeBSD.org) Received: (from remko@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DFDhce024578; Tue, 13 Feb 2018 15:13:43 GMT (envelope-from remko@FreeBSD.org) Message-Id: <201802131513.w1DFDhce024578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: remko set sender to remko@FreeBSD.org using -f From: Remko Lodder Date: Tue, 13 Feb 2018 15:13:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329210 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: remko X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 329210 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 13 Feb 2018 15:13:44 -0000 Author: remko Date: Tue Feb 13 15:13:43 2018 New Revision: 329210 URL: https://svnweb.freebsd.org/changeset/base/329210 Log: Update the secteam/security officer list to match reality. Modified: head/share/misc/organization.dot Modified: head/share/misc/organization.dot ============================================================================== --- head/share/misc/organization.dot Tue Feb 13 15:13:15 2018 (r329209) +++ head/share/misc/organization.dot Tue Feb 13 15:13:43 2018 (r329210) @@ -33,10 +33,10 @@ portscommitters [label="Ports Committers\nports-commit portmgr [label="Port Management Team\nportmgr@FreeBSD.org\nadamw, antoine, bapt, bdrewery\nfeld, mat, rene, swills"] portmgrsecretary [label="Port Management Team Secretary\nportmgr-secretary@FreeBSD.org\nrene"] re [label="Primary Release Engineering Team\nre@FreeBSD.org\ngjb, kib,\nbdrewery, blackend,\nrgrimes, delphij,\nhrs, glebius,\nmarius, rwatson"] -secteam [label="Security Team\nsecteam@FreeBSD.org\ndelphij,\ndes, gavin, gjb,\nglebius, remko"] +secteam [label="Security Team\nsecteam@FreeBSD.org\nbenno, delphij,\ndes, emaste,\ngjb, gordon,\nremko"] portssecteam [label="Ports Security Team\nports-secteam@FreeBSD.org\ndelphij, amdmi3, eadler, feld, jgh, rea, riggs, sbz, simon, swills, zi"] secteamsecretary [label="Security Team Secretary\nsecteam-secretary@FreeBSD.org\nremko"] -securityofficer [label="Security Officer Team\nsecurity-officer@FreeBSD.org\ndelphij, des,\ngavin, gjb,\nglebius, remko"] +securityofficer [label="Security Officer Team\nsecurity-officer@FreeBSD.org\nbenno, delphij,\ndes, emaste,\ngjb, gordon,\nremko"] srccommitters [label="Src Committers\nsrc-committers@FreeBSD.org"] # Admin teams go here alphabetically sorted From owner-svn-src-head@freebsd.org Tue Feb 13 15:30: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 216C6F09A5B; Tue, 13 Feb 2018 15:30:32 +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 C76717E6E5; Tue, 13 Feb 2018 15:30:31 +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 C23EF228E4; Tue, 13 Feb 2018 15:30:31 +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 w1DFUVUv029952; Tue, 13 Feb 2018 15:30:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DFUVJ3029950; Tue, 13 Feb 2018 15:30:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201802131530.w1DFUVJ3029950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 13 Feb 2018 15:30:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329214 - in head/sys/x86: include x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/x86: include x86 X-SVN-Commit-Revision: 329214 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 13 Feb 2018 15:30:32 -0000 Author: kib Date: Tue Feb 13 15:30:31 2018 New Revision: 329214 URL: https://svnweb.freebsd.org/changeset/base/329214 Log: Fix build with gas. Do not use C constant suffixes. Bit values are small enough to not require typing, despite they are used for 64bit MSR writes. The added cast in hw_ibrs_recalculate() is redundand but I prefer to add it for clarity. Reported by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/x86/include/specialreg.h head/sys/x86/x86/cpu_machdep.c Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Tue Feb 13 15:18:11 2018 (r329213) +++ head/sys/x86/include/specialreg.h Tue Feb 13 15:30:31 2018 (r329214) @@ -702,8 +702,8 @@ * document 336996-001 Speculative Execution Side Channel Mitigations. */ /* MSR IA32_SPEC_CTRL */ -#define IA32_SPEC_CTRL_IBRS 0x0000000000000001ULL -#define IA32_SPEC_CTRL_STIBP 0x0000000000000002ULL +#define IA32_SPEC_CTRL_IBRS 0x00000001 +#define IA32_SPEC_CTRL_STIBP 0x00000002 /* MSR IA32_PRED_CMD */ #define IA32_PRED_CMD_IBPB_BARRIER 0x0000000000000001ULL Modified: head/sys/x86/x86/cpu_machdep.c ============================================================================== --- head/sys/x86/x86/cpu_machdep.c Tue Feb 13 15:18:11 2018 (r329213) +++ head/sys/x86/x86/cpu_machdep.c Tue Feb 13 15:30:31 2018 (r329214) @@ -592,7 +592,7 @@ hw_ibrs_recalculate(void) if ((cpu_ia32_arch_caps & IA32_ARCH_CAP_IBRS_ALL) != 0) { if (hw_ibrs_disable) { v= rdmsr(MSR_IA32_SPEC_CTRL); - v &= ~IA32_SPEC_CTRL_IBRS; + v &= ~(uint64_t)IA32_SPEC_CTRL_IBRS; wrmsr(MSR_IA32_SPEC_CTRL, v); } else { v= rdmsr(MSR_IA32_SPEC_CTRL); From owner-svn-src-head@freebsd.org Tue Feb 13 15:36: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 08DE5F0A311; Tue, 13 Feb 2018 15:36:29 +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 AF7E77EC95; Tue, 13 Feb 2018 15:36:28 +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 AA49622A8E; Tue, 13 Feb 2018 15:36:28 +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 w1DFaSj0035082; Tue, 13 Feb 2018 15:36:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DFaSbn035081; Tue, 13 Feb 2018 15:36:28 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201802131536.w1DFaSbn035081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 13 Feb 2018 15:36:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329215 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 329215 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 13 Feb 2018 15:36:29 -0000 Author: kib Date: Tue Feb 13 15:36:28 2018 New Revision: 329215 URL: https://svnweb.freebsd.org/changeset/base/329215 Log: Do not leak rv->psind in some specific situations. Suppose that we have an object with a mapped superpage, and that all pages in the superpages are held (by some driver). Additionally, suppose that the object is terminated, e.g. because the only process mapping it is exiting. Then the reservation is broken, but the pages cannot be freed until later, when they are unheld. In this situation, the reservation code cannot clean psind, since no pages are freed, and the page is freed and then reused with invalid psind. Clean psind on vm_reserv_break() to avoid the situation. Reported and tested by: Slava Shwartsman Reviewed by: markj Sponsored by: Mellanox Technologies MFC after: 1 week Differential revision: https://reviews.freebsd.org/D14335 Modified: head/sys/vm/vm_reserv.c Modified: head/sys/vm/vm_reserv.c ============================================================================== --- head/sys/vm/vm_reserv.c Tue Feb 13 15:30:31 2018 (r329214) +++ head/sys/vm/vm_reserv.c Tue Feb 13 15:36:28 2018 (r329215) @@ -949,6 +949,7 @@ vm_reserv_break(vm_reserv_t rv, vm_page_t m) vm_domain_free_assert_locked(VM_DOMAIN(rv->domain)); vm_reserv_remove(rv); + rv->pages->psind = 0; if (m != NULL) { /* * Since the reservation is being broken, there is no harm in From owner-svn-src-head@freebsd.org Tue Feb 13 15:44: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 993E0F0ACD1; Tue, 13 Feb 2018 15:44:36 +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 4B3957F3BA; Tue, 13 Feb 2018 15:44:36 +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 460FD22C2F; Tue, 13 Feb 2018 15:44:36 +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 w1DFia9f039913; Tue, 13 Feb 2018 15:44:36 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DFiaJ7039912; Tue, 13 Feb 2018 15:44:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201802131544.w1DFiaJ7039912@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 13 Feb 2018 15:44:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329216 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 329216 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 13 Feb 2018 15:44:36 -0000 Author: kib Date: Tue Feb 13 15:44:35 2018 New Revision: 329216 URL: https://svnweb.freebsd.org/changeset/base/329216 Log: linuxkpi: Do not leak pages on put. When the owner of the wire reference releases the last reference, it might be that the page was already attempted to be freed (but free cannot be performed at that time due to wire). Check that the page was removed from the object as the indicator of the free attempt and finish the free operation if so. Reported and tested by: Slava Shwartsman Reviewed by: hselasky Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/compat/linuxkpi/common/include/linux/mm.h Modified: head/sys/compat/linuxkpi/common/include/linux/mm.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/mm.h Tue Feb 13 15:36:28 2018 (r329215) +++ head/sys/compat/linuxkpi/common/include/linux/mm.h Tue Feb 13 15:44:35 2018 (r329216) @@ -243,7 +243,8 @@ static inline void put_page(struct vm_page *page) { vm_page_lock(page); - vm_page_unwire(page, PQ_ACTIVE); + if (vm_page_unwire(page, PQ_ACTIVE) && page->object == NULL) + vm_page_free(page); vm_page_unlock(page); } From owner-svn-src-head@freebsd.org Tue Feb 13 16: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 484CBF0CA92; Tue, 13 Feb 2018 16:07:40 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E9CE0802E2; Tue, 13 Feb 2018 16:07:39 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E48C322F7A; Tue, 13 Feb 2018 16:07:39 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1DG7dtB050208; Tue, 13 Feb 2018 16:07:39 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DG7dta050207; Tue, 13 Feb 2018 16:07:39 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201802131607.w1DG7dta050207@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Tue, 13 Feb 2018 16:07:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329218 - head/etc/rc.d X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: head/etc/rc.d X-SVN-Commit-Revision: 329218 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 13 Feb 2018 16:07:40 -0000 Author: brd (doc,ports committer) Date: Tue Feb 13 16:07:39 2018 New Revision: 329218 URL: https://svnweb.freebsd.org/changeset/base/329218 Log: Fix resolv to run when it should and not when it should not.. Approved by: manu Reported by: manu Pointy hat to: brd Modified: head/etc/rc.d/resolv Modified: head/etc/rc.d/resolv ============================================================================== --- head/etc/rc.d/resolv Tue Feb 13 15:55:31 2018 (r329217) +++ head/etc/rc.d/resolv Tue Feb 13 16:07:39 2018 (r329218) @@ -34,12 +34,11 @@ . /etc/rc.subr name="resolv" +rcvar="resolv_enable" desc="Create /etc/resolv.conf from kenv" start_cmd="${name}_start" stop_cmd=':' -load_rc_config $name - # if the info is available via dhcp/kenv # build the resolv.conf # @@ -60,3 +59,5 @@ resolv_start() fi } +load_rc_config $name +run_rc_command "$1" From owner-svn-src-head@freebsd.org Tue Feb 13 16:25: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 2A3F2F0E2CE; Tue, 13 Feb 2018 16:25:44 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CC9B1810A4; Tue, 13 Feb 2018 16:25:43 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C7932232C1; Tue, 13 Feb 2018 16:25:43 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1DGPhgf059731; Tue, 13 Feb 2018 16:25:43 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DGPhDf059730; Tue, 13 Feb 2018 16:25:43 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201802131625.w1DGPhDf059730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Tue, 13 Feb 2018 16:25:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329219 - head X-SVN-Group: head X-SVN-Commit-Author: royger X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 329219 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 13 Feb 2018 16:25:44 -0000 Author: royger Date: Tue Feb 13 16:25:43 2018 New Revision: 329219 URL: https://svnweb.freebsd.org/changeset/base/329219 Log: list myself in the MAINTAINERS file for Xen bits Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Tue Feb 13 16:07:39 2018 (r329218) +++ head/MAINTAINERS Tue Feb 13 16:25:43 2018 (r329219) @@ -92,8 +92,11 @@ sys/dev/ixgbe erj Pre-commit phabricator review reques sys/dev/ixl erj Pre-commit phabricator review requested. sys/dev/sound/usb hselasky If in doubt, ask. sys/dev/usb hselasky If in doubt, ask. +sys/dev/xen royger Pre-commit review recommended. sys/netinet/ip_carp.c glebius Pre-commit review recommended. sys/netpfil/pf kp,glebius Pre-commit review recommended. +sys/x86/xen royger Pre-commit review recommended. +sys/xen royger Pre-commit review recommended. tests freebsd-testing,ngie Pre-commit review requested. usr.sbin/bsdconfig dteske Pre-commit phabricator review requested. usr.sbin/dpv dteske Pre-commit review requested. Keep in sync with libdpv. From owner-svn-src-head@freebsd.org Tue Feb 13 16:26: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 5A7A2F0E362; Tue, 13 Feb 2018 16:26:07 +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 08280811DB; Tue, 13 Feb 2018 16:26:07 +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 032E6232C2; Tue, 13 Feb 2018 16:26:07 +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 w1DGQ6OY059794; Tue, 13 Feb 2018 16:26:06 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DGQ6W0059792; Tue, 13 Feb 2018 16:26:06 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201802131626.w1DGQ6W0059792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 13 Feb 2018 16:26:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329220 - in head/sys/dev: mpr mps X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: in head/sys/dev: mpr mps X-SVN-Commit-Revision: 329220 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 13 Feb 2018 16:26:07 -0000 Author: lwhsu (ports committer) Date: Tue Feb 13 16:26:06 2018 New Revision: 329220 URL: https://svnweb.freebsd.org/changeset/base/329220 Log: Fix non-64-bit platform build by printing bus_addr_t values using %#jx Reviewed by: slm Differential Revision: https://reviews.freebsd.org/D14344 Modified: head/sys/dev/mpr/mpr.c head/sys/dev/mps/mps.c Modified: head/sys/dev/mpr/mpr.c ============================================================================== --- head/sys/dev/mpr/mpr.c Tue Feb 13 16:25:43 2018 (r329219) +++ head/sys/dev/mpr/mpr.c Tue Feb 13 16:26:06 2018 (r329220) @@ -1356,10 +1356,10 @@ mpr_alloc_hw_queues(struct mpr_softc *sc) sc->free_busaddr = queues_busaddr; sc->post_queue = (MPI2_REPLY_DESCRIPTORS_UNION *)(queues + fqsize); sc->post_busaddr = queues_busaddr + fqsize; - mpr_dprint(sc, MPR_INIT, "free queue busaddr= %#016lx size= %d\n", - sc->free_busaddr, fqsize); - mpr_dprint(sc, MPR_INIT, "reply queue busaddr= %#016lx size= %d\n", - sc->post_busaddr, pqsize); + mpr_dprint(sc, MPR_INIT, "free queue busaddr= %#016jx size= %d\n", + (uintmax_t)sc->free_busaddr, fqsize); + mpr_dprint(sc, MPR_INIT, "reply queue busaddr= %#016jx size= %d\n", + (uintmax_t)sc->post_busaddr, pqsize); return (0); } @@ -1402,8 +1402,8 @@ mpr_alloc_replies(struct mpr_softc *sc) bzero(sc->reply_frames, rsize); bus_dmamap_load(sc->reply_dmat, sc->reply_map, sc->reply_frames, rsize, mpr_memaddr_cb, &sc->reply_busaddr, 0); - mpr_dprint(sc, MPR_INIT, "reply frames busaddr= %#016lx size= %d\n", - sc->reply_busaddr, rsize); + mpr_dprint(sc, MPR_INIT, "reply frames busaddr= %#016jx size= %d\n", + (uintmax_t)sc->reply_busaddr, rsize); return (0); } @@ -1438,8 +1438,8 @@ mpr_alloc_requests(struct mpr_softc *sc) bzero(sc->req_frames, rsize); bus_dmamap_load(sc->req_dmat, sc->req_map, sc->req_frames, rsize, mpr_memaddr_cb, &sc->req_busaddr, 0); - mpr_dprint(sc, MPR_INIT, "request frames busaddr= %#016lx size= %d\n", - sc->req_busaddr, rsize); + mpr_dprint(sc, MPR_INIT, "request frames busaddr= %#016jx size= %d\n", + (uintmax_t)sc->req_busaddr, rsize); rsize = sc->chain_frame_size * sc->num_chains; if (bus_dma_tag_create( sc->mpr_parent_dmat, /* parent */ @@ -1464,8 +1464,8 @@ mpr_alloc_requests(struct mpr_softc *sc) bzero(sc->chain_frames, rsize); bus_dmamap_load(sc->chain_dmat, sc->chain_map, sc->chain_frames, rsize, mpr_memaddr_cb, &sc->chain_busaddr, 0); - mpr_dprint(sc, MPR_INIT, "chain frames busaddr= %#016lx size= %d\n", - sc->chain_busaddr, rsize); + mpr_dprint(sc, MPR_INIT, "chain frames busaddr= %#016jx size= %d\n", + (uintmax_t)sc->chain_busaddr, rsize); rsize = MPR_SENSE_LEN * sc->num_reqs; if (bus_dma_tag_create( sc->mpr_parent_dmat, /* parent */ @@ -1490,8 +1490,8 @@ mpr_alloc_requests(struct mpr_softc *sc) bzero(sc->sense_frames, rsize); bus_dmamap_load(sc->sense_dmat, sc->sense_map, sc->sense_frames, rsize, mpr_memaddr_cb, &sc->sense_busaddr, 0); - mpr_dprint(sc, MPR_INIT, "sense frames busaddr= %#016lx size= %d\n", - sc->sense_busaddr, rsize); + mpr_dprint(sc, MPR_INIT, "sense frames busaddr= %#016jx size= %d\n", + (uintmax_t)sc->sense_busaddr, rsize); sc->chains = malloc(sizeof(struct mpr_chain) * sc->num_chains, M_MPR, M_WAITOK | M_ZERO); Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Tue Feb 13 16:25:43 2018 (r329219) +++ head/sys/dev/mps/mps.c Tue Feb 13 16:26:06 2018 (r329220) @@ -1313,10 +1313,10 @@ mps_alloc_hw_queues(struct mps_softc *sc) sc->free_busaddr = queues_busaddr; sc->post_queue = (MPI2_REPLY_DESCRIPTORS_UNION *)(queues + fqsize); sc->post_busaddr = queues_busaddr + fqsize; - mps_dprint(sc, MPS_INIT, "free queue busaddr= %#016lx size= %d\n", - sc->free_busaddr, fqsize); - mps_dprint(sc, MPS_INIT, "reply queue busaddr= %#016lx size= %d\n", - sc->post_busaddr, pqsize); + mps_dprint(sc, MPS_INIT, "free queue busaddr= %#016jx size= %d\n", + (uintmax_t)sc->free_busaddr, fqsize); + mps_dprint(sc, MPS_INIT, "reply queue busaddr= %#016jx size= %d\n", + (uintmax_t)sc->post_busaddr, pqsize); return (0); } @@ -1360,8 +1360,8 @@ mps_alloc_replies(struct mps_softc *sc) bus_dmamap_load(sc->reply_dmat, sc->reply_map, sc->reply_frames, rsize, mps_memaddr_cb, &sc->reply_busaddr, 0); - mps_dprint(sc, MPS_INIT, "reply frames busaddr= %#016lx size= %d\n", - sc->reply_busaddr, rsize); + mps_dprint(sc, MPS_INIT, "reply frames busaddr= %#016jx size= %d\n", + (uintmax_t)sc->reply_busaddr, rsize); return (0); } @@ -1396,8 +1396,8 @@ mps_alloc_requests(struct mps_softc *sc) bzero(sc->req_frames, rsize); bus_dmamap_load(sc->req_dmat, sc->req_map, sc->req_frames, rsize, mps_memaddr_cb, &sc->req_busaddr, 0); - mps_dprint(sc, MPS_INIT, "request frames busaddr= %#016lx size= %d\n", - sc->req_busaddr, rsize); + mps_dprint(sc, MPS_INIT, "request frames busaddr= %#016jx size= %d\n", + (uintmax_t)sc->req_busaddr, rsize); rsize = sc->reqframesz * sc->num_chains; if (bus_dma_tag_create( sc->mps_parent_dmat, /* parent */ @@ -1422,8 +1422,8 @@ mps_alloc_requests(struct mps_softc *sc) bzero(sc->chain_frames, rsize); bus_dmamap_load(sc->chain_dmat, sc->chain_map, sc->chain_frames, rsize, mps_memaddr_cb, &sc->chain_busaddr, 0); - mps_dprint(sc, MPS_INIT, "chain frames busaddr= %#016lx size= %d\n", - sc->chain_busaddr, rsize); + mps_dprint(sc, MPS_INIT, "chain frames busaddr= %#016jx size= %d\n", + (uintmax_t)sc->chain_busaddr, rsize); rsize = MPS_SENSE_LEN * sc->num_reqs; if (bus_dma_tag_create( sc->mps_parent_dmat, /* parent */ @@ -1448,8 +1448,8 @@ mps_alloc_requests(struct mps_softc *sc) bzero(sc->sense_frames, rsize); bus_dmamap_load(sc->sense_dmat, sc->sense_map, sc->sense_frames, rsize, mps_memaddr_cb, &sc->sense_busaddr, 0); - mps_dprint(sc, MPS_INIT, "sense frames busaddr= %#016lx size= %d\n", - sc->sense_busaddr, rsize); + mps_dprint(sc, MPS_INIT, "sense frames busaddr= %#016jx size= %d\n", + (uintmax_t)sc->sense_busaddr, rsize); sc->chains = malloc(sizeof(struct mps_chain) * sc->num_chains, M_MPT2, M_WAITOK | M_ZERO); From owner-svn-src-head@freebsd.org Tue Feb 13 16:48: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 656DAF0FF0F; Tue, 13 Feb 2018 16:48: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 1A936823FC; Tue, 13 Feb 2018 16:48:58 +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 1253E23681; Tue, 13 Feb 2018 16:48:58 +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 w1DGmvUn070373; Tue, 13 Feb 2018 16:48:57 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DGmvAr070372; Tue, 13 Feb 2018 16:48:57 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201802131648.w1DGmvAr070372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 13 Feb 2018 16:48:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329221 - head/bin/sh X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/bin/sh X-SVN-Commit-Revision: 329221 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 13 Feb 2018 16:48:58 -0000 Author: bdrewery Date: Tue Feb 13 16:48:57 2018 New Revision: 329221 URL: https://svnweb.freebsd.org/changeset/base/329221 Log: Allow overriding VTABSIZE at compile-time. Reviewed by: jilles Differential Revision: https://reviews.freebsd.org/D14339 Modified: head/bin/sh/var.c Modified: head/bin/sh/var.c ============================================================================== --- head/bin/sh/var.c Tue Feb 13 16:26:06 2018 (r329220) +++ head/bin/sh/var.c Tue Feb 13 16:48:57 2018 (r329221) @@ -71,7 +71,9 @@ __FBSDID("$FreeBSD$"); #endif +#ifndef VTABSIZE #define VTABSIZE 39 +#endif struct varinit { From owner-svn-src-head@freebsd.org Tue Feb 13 17:04: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 09912F11621; Tue, 13 Feb 2018 17:04:35 +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 9C6E683F9D; Tue, 13 Feb 2018 17:04:35 +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 7D0C6239C1; Tue, 13 Feb 2018 17:04:35 +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 w1DH4ZjA082090; Tue, 13 Feb 2018 17:04:35 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DH4YZN082083; Tue, 13 Feb 2018 17:04:34 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802131704.w1DH4YZN082083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 13 Feb 2018 17:04:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329222 - in head/sys: amd64/conf conf dev/mthca i386/conf modules modules/mthca ofed/include/uapi/rdma X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys: amd64/conf conf dev/mthca i386/conf modules modules/mthca ofed/include/uapi/rdma X-SVN-Commit-Revision: 329222 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 13 Feb 2018 17:04:36 -0000 Author: hselasky Date: Tue Feb 13 17:04:34 2018 New Revision: 329222 URL: https://svnweb.freebsd.org/changeset/base/329222 Log: Import the mthca kernel side infiniband driver from Linux 4.9 and fix compilation under FreeBSD. The mthca driver was temporarily removed as part of the Linux 4.9 RoCE/infinband upgrade. Top commit in Linux source tree: 69973b830859bc6529a7a0468ba0d80ee5117826 Sponsored by: Mellanox Technologies Added: head/sys/dev/mthca/ head/sys/dev/mthca/mthca_allocator.c (contents, props changed) head/sys/dev/mthca/mthca_av.c (contents, props changed) head/sys/dev/mthca/mthca_catas.c (contents, props changed) head/sys/dev/mthca/mthca_cmd.c (contents, props changed) head/sys/dev/mthca/mthca_cmd.h (contents, props changed) head/sys/dev/mthca/mthca_config_reg.h (contents, props changed) head/sys/dev/mthca/mthca_cq.c (contents, props changed) head/sys/dev/mthca/mthca_dev.h (contents, props changed) head/sys/dev/mthca/mthca_doorbell.h (contents, props changed) head/sys/dev/mthca/mthca_eq.c (contents, props changed) head/sys/dev/mthca/mthca_mad.c (contents, props changed) head/sys/dev/mthca/mthca_main.c (contents, props changed) head/sys/dev/mthca/mthca_mcg.c (contents, props changed) head/sys/dev/mthca/mthca_memfree.c (contents, props changed) head/sys/dev/mthca/mthca_memfree.h (contents, props changed) head/sys/dev/mthca/mthca_mr.c (contents, props changed) head/sys/dev/mthca/mthca_pd.c (contents, props changed) head/sys/dev/mthca/mthca_profile.c (contents, props changed) head/sys/dev/mthca/mthca_profile.h (contents, props changed) head/sys/dev/mthca/mthca_provider.c (contents, props changed) head/sys/dev/mthca/mthca_provider.h (contents, props changed) head/sys/dev/mthca/mthca_qp.c (contents, props changed) head/sys/dev/mthca/mthca_reset.c (contents, props changed) head/sys/dev/mthca/mthca_srq.c (contents, props changed) head/sys/dev/mthca/mthca_uar.c (contents, props changed) head/sys/dev/mthca/mthca_user.h (contents, props changed) head/sys/dev/mthca/mthca_wqe.h (contents, props changed) head/sys/modules/mthca/ head/sys/modules/mthca/Makefile (contents, props changed) head/sys/ofed/include/uapi/rdma/mthca-abi.h (contents, props changed) Modified: head/sys/amd64/conf/NOTES head/sys/conf/files head/sys/i386/conf/NOTES head/sys/modules/Makefile Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Tue Feb 13 16:48:57 2018 (r329221) +++ head/sys/amd64/conf/NOTES Tue Feb 13 17:04:34 2018 (r329222) @@ -315,6 +315,7 @@ options DRM_DEBUG # Include debug printfs (slow) # Requires the iwn firmware module # ixl: Intel XL710 40Gbe PCIE Ethernet # ixlv: Intel XL710 40Gbe VF PCIE Ethernet +# mthca: Mellanox HCA InfiniBand # mlx4ib: Mellanox ConnectX HCA InfiniBand # mlx4en: Mellanox ConnectX HCA Ethernet # nfe: nVidia nForce MCP on-board Ethernet Networking (BSD open source) @@ -334,6 +335,7 @@ device iwn # Intel 4965/1000/5000/6000 wireless NICs device ixl # Intel XL710 40Gbe PCIE Ethernet options IXL_IW # Enable iWARP Client Interface in ixl(4) device ixlv # Intel XL710 40Gbe VF PCIE Ethernet +device mthca # Mellanox HCA InfiniBand device mlx4 # Shared code module between IB and Ethernet device mlx4ib # Mellanox ConnectX HCA InfiniBand device mlx4en # Mellanox ConnectX HCA Ethernet Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Feb 13 16:48:57 2018 (r329221) +++ head/sys/conf/files Tue Feb 13 17:04:34 2018 (r329222) @@ -4551,6 +4551,43 @@ ofed/drivers/infiniband/ulp/sdp/sdp_cma.c optional sdp ofed/drivers/infiniband/ulp/sdp/sdp_tx.c optional sdp inet \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/sdp/" +dev/mthca/mthca_allocator.c optional mthca pci ofed \ + compile-with "${OFED_C}" +dev/mthca/mthca_av.c optional mthca pci ofed \ + compile-with "${OFED_C}" +dev/mthca/mthca_catas.c optional mthca pci ofed \ + compile-with "${OFED_C}" +dev/mthca/mthca_cmd.c optional mthca pci ofed \ + compile-with "${OFED_C}" +dev/mthca/mthca_cq.c optional mthca pci ofed \ + compile-with "${OFED_C}" +dev/mthca/mthca_eq.c optional mthca pci ofed \ + compile-with "${OFED_C}" +dev/mthca/mthca_mad.c optional mthca pci ofed \ + compile-with "${OFED_C}" +dev/mthca/mthca_main.c optional mthca pci ofed \ + compile-with "${OFED_C}" +dev/mthca/mthca_mcg.c optional mthca pci ofed \ + compile-with "${OFED_C}" +dev/mthca/mthca_memfree.c optional mthca pci ofed \ + compile-with "${OFED_C}" +dev/mthca/mthca_mr.c optional mthca pci ofed \ + compile-with "${OFED_C}" +dev/mthca/mthca_pd.c optional mthca pci ofed \ + compile-with "${OFED_C}" +dev/mthca/mthca_profile.c optional mthca pci ofed \ + compile-with "${OFED_C}" +dev/mthca/mthca_provider.c optional mthca pci ofed \ + compile-with "${OFED_C}" +dev/mthca/mthca_qp.c optional mthca pci ofed \ + compile-with "${OFED_C}" +dev/mthca/mthca_reset.c optional mthca pci ofed \ + compile-with "${OFED_C}" +dev/mthca/mthca_srq.c optional mthca pci ofed \ + compile-with "${OFED_C}" +dev/mthca/mthca_uar.c optional mthca pci ofed \ + compile-with "${OFED_C}" + dev/mlx4/mlx4_ib/mlx4_ib_alias_GUID.c optional mlx4ib pci ofed \ compile-with "${OFED_C}" dev/mlx4/mlx4_ib/mlx4_ib_mcg.c optional mlx4ib pci ofed \ Added: head/sys/dev/mthca/mthca_allocator.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mthca/mthca_allocator.c Tue Feb 13 17:04:34 2018 (r329222) @@ -0,0 +1,301 @@ +/* + * Copyright (c) 2004 Topspin Communications. All rights reserved. + * + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenIB.org BSD license below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - 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. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include +#include +#include + +#include "mthca_dev.h" + +/* Trivial bitmap-based allocator */ +u32 mthca_alloc(struct mthca_alloc *alloc) +{ + unsigned long flags; + u32 obj; + + spin_lock_irqsave(&alloc->lock, flags); + + obj = find_next_zero_bit(alloc->table, alloc->max, alloc->last); + if (obj >= alloc->max) { + alloc->top = (alloc->top + alloc->max) & alloc->mask; + obj = find_first_zero_bit(alloc->table, alloc->max); + } + + if (obj < alloc->max) { + set_bit(obj, alloc->table); + obj |= alloc->top; + } else + obj = -1; + + spin_unlock_irqrestore(&alloc->lock, flags); + + return obj; +} + +void mthca_free(struct mthca_alloc *alloc, u32 obj) +{ + unsigned long flags; + + obj &= alloc->max - 1; + + spin_lock_irqsave(&alloc->lock, flags); + + clear_bit(obj, alloc->table); + alloc->last = min(alloc->last, obj); + alloc->top = (alloc->top + alloc->max) & alloc->mask; + + spin_unlock_irqrestore(&alloc->lock, flags); +} + +int mthca_alloc_init(struct mthca_alloc *alloc, u32 num, u32 mask, + u32 reserved) +{ + int i; + + /* num must be a power of 2 */ + if (num != 1 << (ffs(num) - 1)) + return -EINVAL; + + alloc->last = 0; + alloc->top = 0; + alloc->max = num; + alloc->mask = mask; + spin_lock_init(&alloc->lock); + alloc->table = kmalloc(BITS_TO_LONGS(num) * sizeof (long), + GFP_KERNEL); + if (!alloc->table) + return -ENOMEM; + + bitmap_zero(alloc->table, num); + for (i = 0; i < reserved; ++i) + set_bit(i, alloc->table); + + return 0; +} + +void mthca_alloc_cleanup(struct mthca_alloc *alloc) +{ + kfree(alloc->table); +} + +/* + * Array of pointers with lazy allocation of leaf pages. Callers of + * _get, _set and _clear methods must use a lock or otherwise + * serialize access to the array. + */ + +#define MTHCA_ARRAY_MASK (PAGE_SIZE / sizeof (void *) - 1) + +void *mthca_array_get(struct mthca_array *array, int index) +{ + int p = (index * sizeof (void *)) >> PAGE_SHIFT; + + if (array->page_list[p].page) + return array->page_list[p].page[index & MTHCA_ARRAY_MASK]; + else + return NULL; +} + +int mthca_array_set(struct mthca_array *array, int index, void *value) +{ + int p = (index * sizeof (void *)) >> PAGE_SHIFT; + + /* Allocate with GFP_ATOMIC because we'll be called with locks held. */ + if (!array->page_list[p].page) + array->page_list[p].page = (void **) get_zeroed_page(GFP_ATOMIC); + + if (!array->page_list[p].page) + return -ENOMEM; + + array->page_list[p].page[index & MTHCA_ARRAY_MASK] = value; + ++array->page_list[p].used; + + return 0; +} + +void mthca_array_clear(struct mthca_array *array, int index) +{ + int p = (index * sizeof (void *)) >> PAGE_SHIFT; + + if (--array->page_list[p].used == 0) { + free_page((unsigned long) array->page_list[p].page); + array->page_list[p].page = NULL; + } else + array->page_list[p].page[index & MTHCA_ARRAY_MASK] = NULL; + + if (array->page_list[p].used < 0) + pr_debug("Array %p index %d page %d with ref count %d < 0\n", + array, index, p, array->page_list[p].used); +} + +int mthca_array_init(struct mthca_array *array, int nent) +{ + int npage = (nent * sizeof (void *) + PAGE_SIZE - 1) / PAGE_SIZE; + int i; + + array->page_list = kmalloc(npage * sizeof *array->page_list, GFP_KERNEL); + if (!array->page_list) + return -ENOMEM; + + for (i = 0; i < npage; ++i) { + array->page_list[i].page = NULL; + array->page_list[i].used = 0; + } + + return 0; +} + +void mthca_array_cleanup(struct mthca_array *array, int nent) +{ + int i; + + for (i = 0; i < (nent * sizeof (void *) + PAGE_SIZE - 1) / PAGE_SIZE; ++i) + free_page((unsigned long) array->page_list[i].page); + + kfree(array->page_list); +} + +/* + * Handling for queue buffers -- we allocate a bunch of memory and + * register it in a memory region at HCA virtual address 0. If the + * requested size is > max_direct, we split the allocation into + * multiple pages, so we don't require too much contiguous memory. + */ + +int mthca_buf_alloc(struct mthca_dev *dev, int size, int max_direct, + union mthca_buf *buf, int *is_direct, struct mthca_pd *pd, + int hca_write, struct mthca_mr *mr) +{ + int err = -ENOMEM; + int npages, shift; + u64 *dma_list = NULL; + dma_addr_t t; + int i; + + if (size <= max_direct) { + *is_direct = 1; + npages = 1; + shift = get_order(size) + PAGE_SHIFT; + + buf->direct.buf = dma_alloc_coherent(&dev->pdev->dev, + size, &t, GFP_KERNEL); + if (!buf->direct.buf) + return -ENOMEM; + + dma_unmap_addr_set(&buf->direct, mapping, t); + + memset(buf->direct.buf, 0, size); + + while (t & ((1 << shift) - 1)) { + --shift; + npages *= 2; + } + + dma_list = kmalloc(npages * sizeof *dma_list, GFP_KERNEL); + if (!dma_list) + goto err_free; + + for (i = 0; i < npages; ++i) + dma_list[i] = t + i * (1 << shift); + } else { + *is_direct = 0; + npages = (size + PAGE_SIZE - 1) / PAGE_SIZE; + shift = PAGE_SHIFT; + + dma_list = kmalloc(npages * sizeof *dma_list, GFP_KERNEL); + if (!dma_list) + return -ENOMEM; + + buf->page_list = kmalloc(npages * sizeof *buf->page_list, + GFP_KERNEL); + if (!buf->page_list) + goto err_out; + + for (i = 0; i < npages; ++i) + buf->page_list[i].buf = NULL; + + for (i = 0; i < npages; ++i) { + buf->page_list[i].buf = + dma_alloc_coherent(&dev->pdev->dev, PAGE_SIZE, + &t, GFP_KERNEL); + if (!buf->page_list[i].buf) + goto err_free; + + dma_list[i] = t; + dma_unmap_addr_set(&buf->page_list[i], mapping, t); + + clear_page(buf->page_list[i].buf); + } + } + + err = mthca_mr_alloc_phys(dev, pd->pd_num, + dma_list, shift, npages, + 0, size, + MTHCA_MPT_FLAG_LOCAL_READ | + (hca_write ? MTHCA_MPT_FLAG_LOCAL_WRITE : 0), + mr); + if (err) + goto err_free; + + kfree(dma_list); + + return 0; + +err_free: + mthca_buf_free(dev, size, buf, *is_direct, NULL); + +err_out: + kfree(dma_list); + + return err; +} + +void mthca_buf_free(struct mthca_dev *dev, int size, union mthca_buf *buf, + int is_direct, struct mthca_mr *mr) +{ + int i; + + if (mr) + mthca_free_mr(dev, mr); + + if (is_direct) + dma_free_coherent(&dev->pdev->dev, size, buf->direct.buf, + dma_unmap_addr(&buf->direct, mapping)); + else { + for (i = 0; i < (size + PAGE_SIZE - 1) / PAGE_SIZE; ++i) + dma_free_coherent(&dev->pdev->dev, PAGE_SIZE, + buf->page_list[i].buf, + dma_unmap_addr(&buf->page_list[i], + mapping)); + kfree(buf->page_list); + } +} Added: head/sys/dev/mthca/mthca_av.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mthca/mthca_av.c Tue Feb 13 17:04:34 2018 (r329222) @@ -0,0 +1,374 @@ +/* + * Copyright (c) 2004 Topspin Communications. All rights reserved. + * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved. + * + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenIB.org BSD license below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - 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. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include +#include + +#include +#include + +#include "mthca_dev.h" + +enum { + MTHCA_RATE_TAVOR_FULL = 0, + MTHCA_RATE_TAVOR_1X = 1, + MTHCA_RATE_TAVOR_4X = 2, + MTHCA_RATE_TAVOR_1X_DDR = 3 +}; + +enum { + MTHCA_RATE_MEMFREE_FULL = 0, + MTHCA_RATE_MEMFREE_QUARTER = 1, + MTHCA_RATE_MEMFREE_EIGHTH = 2, + MTHCA_RATE_MEMFREE_HALF = 3 +}; + +struct mthca_av { + __be32 port_pd; + u8 reserved1; + u8 g_slid; + __be16 dlid; + u8 reserved2; + u8 gid_index; + u8 msg_sr; + u8 hop_limit; + __be32 sl_tclass_flowlabel; + __be32 dgid[4]; +}; + +static enum ib_rate memfree_rate_to_ib(u8 mthca_rate, u8 port_rate) +{ + switch (mthca_rate) { + case MTHCA_RATE_MEMFREE_EIGHTH: + return mult_to_ib_rate(port_rate >> 3); + case MTHCA_RATE_MEMFREE_QUARTER: + return mult_to_ib_rate(port_rate >> 2); + case MTHCA_RATE_MEMFREE_HALF: + return mult_to_ib_rate(port_rate >> 1); + case MTHCA_RATE_MEMFREE_FULL: + default: + return mult_to_ib_rate(port_rate); + } +} + +static enum ib_rate tavor_rate_to_ib(u8 mthca_rate, u8 port_rate) +{ + switch (mthca_rate) { + case MTHCA_RATE_TAVOR_1X: return IB_RATE_2_5_GBPS; + case MTHCA_RATE_TAVOR_1X_DDR: return IB_RATE_5_GBPS; + case MTHCA_RATE_TAVOR_4X: return IB_RATE_10_GBPS; + default: return mult_to_ib_rate(port_rate); + } +} + +enum ib_rate mthca_rate_to_ib(struct mthca_dev *dev, u8 mthca_rate, u8 port) +{ + if (mthca_is_memfree(dev)) { + /* Handle old Arbel FW */ + if (dev->limits.stat_rate_support == 0x3 && mthca_rate) + return IB_RATE_2_5_GBPS; + + return memfree_rate_to_ib(mthca_rate, dev->rate[port - 1]); + } else + return tavor_rate_to_ib(mthca_rate, dev->rate[port - 1]); +} + +static u8 ib_rate_to_memfree(u8 req_rate, u8 cur_rate) +{ + if (cur_rate <= req_rate) + return 0; + + /* + * Inter-packet delay (IPD) to get from rate X down to a rate + * no more than Y is (X - 1) / Y. + */ + switch ((cur_rate - 1) / req_rate) { + case 0: return MTHCA_RATE_MEMFREE_FULL; + case 1: return MTHCA_RATE_MEMFREE_HALF; + case 2: /* fall through */ + case 3: return MTHCA_RATE_MEMFREE_QUARTER; + default: return MTHCA_RATE_MEMFREE_EIGHTH; + } +} + +static u8 ib_rate_to_tavor(u8 static_rate) +{ + switch (static_rate) { + case IB_RATE_2_5_GBPS: return MTHCA_RATE_TAVOR_1X; + case IB_RATE_5_GBPS: return MTHCA_RATE_TAVOR_1X_DDR; + case IB_RATE_10_GBPS: return MTHCA_RATE_TAVOR_4X; + default: return MTHCA_RATE_TAVOR_FULL; + } +} + +u8 mthca_get_rate(struct mthca_dev *dev, int static_rate, u8 port) +{ + u8 rate; + + if (!static_rate || ib_rate_to_mult(static_rate) >= dev->rate[port - 1]) + return 0; + + if (mthca_is_memfree(dev)) + rate = ib_rate_to_memfree(ib_rate_to_mult(static_rate), + dev->rate[port - 1]); + else + rate = ib_rate_to_tavor(static_rate); + + if (!(dev->limits.stat_rate_support & (1 << rate))) + rate = 1; + + return rate; +} + +int mthca_create_ah(struct mthca_dev *dev, + struct mthca_pd *pd, + struct ib_ah_attr *ah_attr, + struct mthca_ah *ah) +{ + u32 index = -1; + struct mthca_av *av = NULL; + + ah->type = MTHCA_AH_PCI_POOL; + + if (mthca_is_memfree(dev)) { + ah->av = kmalloc(sizeof *ah->av, GFP_ATOMIC); + if (!ah->av) + return -ENOMEM; + + ah->type = MTHCA_AH_KMALLOC; + av = ah->av; + } else if (!atomic_read(&pd->sqp_count) && + !(dev->mthca_flags & MTHCA_FLAG_DDR_HIDDEN)) { + index = mthca_alloc(&dev->av_table.alloc); + + /* fall back to allocate in host memory */ + if (index == -1) + goto on_hca_fail; + + av = kmalloc(sizeof *av, GFP_ATOMIC); + if (!av) + goto on_hca_fail; + + ah->type = MTHCA_AH_ON_HCA; + ah->avdma = dev->av_table.ddr_av_base + + index * MTHCA_AV_SIZE; + } + +on_hca_fail: + if (ah->type == MTHCA_AH_PCI_POOL) { + ah->av = pci_pool_alloc(dev->av_table.pool, + GFP_ATOMIC, &ah->avdma); + if (!ah->av) + return -ENOMEM; + + av = ah->av; + } + + ah->key = pd->ntmr.ibmr.lkey; + + memset(av, 0, MTHCA_AV_SIZE); + + av->port_pd = cpu_to_be32(pd->pd_num | (ah_attr->port_num << 24)); + av->g_slid = ah_attr->src_path_bits; + av->dlid = cpu_to_be16(ah_attr->dlid); + av->msg_sr = (3 << 4) | /* 2K message */ + mthca_get_rate(dev, ah_attr->static_rate, ah_attr->port_num); + av->sl_tclass_flowlabel = cpu_to_be32(ah_attr->sl << 28); + if (ah_attr->ah_flags & IB_AH_GRH) { + av->g_slid |= 0x80; + av->gid_index = (ah_attr->port_num - 1) * dev->limits.gid_table_len + + ah_attr->grh.sgid_index; + av->hop_limit = ah_attr->grh.hop_limit; + av->sl_tclass_flowlabel |= + cpu_to_be32((ah_attr->grh.traffic_class << 20) | + ah_attr->grh.flow_label); + memcpy(av->dgid, ah_attr->grh.dgid.raw, 16); + } else { + /* Arbel workaround -- low byte of GID must be 2 */ + av->dgid[3] = cpu_to_be32(2); + } + + if (0) { + int j; + + mthca_dbg(dev, "Created UDAV at %p/%08lx:\n", + av, (unsigned long) ah->avdma); + for (j = 0; j < 8; ++j) + printk(KERN_DEBUG " [%2x] %08x\n", + j * 4, be32_to_cpu(((__be32 *) av)[j])); + } + + if (ah->type == MTHCA_AH_ON_HCA) { + memcpy_toio(dev->av_table.av_map + index * MTHCA_AV_SIZE, + av, MTHCA_AV_SIZE); + kfree(av); + } + + return 0; +} + +int mthca_destroy_ah(struct mthca_dev *dev, struct mthca_ah *ah) +{ + switch (ah->type) { + case MTHCA_AH_ON_HCA: + mthca_free(&dev->av_table.alloc, + (ah->avdma - dev->av_table.ddr_av_base) / + MTHCA_AV_SIZE); + break; + + case MTHCA_AH_PCI_POOL: + pci_pool_free(dev->av_table.pool, ah->av, ah->avdma); + break; + + case MTHCA_AH_KMALLOC: + kfree(ah->av); + break; + } + + return 0; +} + +int mthca_ah_grh_present(struct mthca_ah *ah) +{ + return !!(ah->av->g_slid & 0x80); +} + +int mthca_read_ah(struct mthca_dev *dev, struct mthca_ah *ah, + struct ib_ud_header *header) +{ + if (ah->type == MTHCA_AH_ON_HCA) + return -EINVAL; + + header->lrh.service_level = be32_to_cpu(ah->av->sl_tclass_flowlabel) >> 28; + header->lrh.destination_lid = ah->av->dlid; + header->lrh.source_lid = cpu_to_be16(ah->av->g_slid & 0x7f); + if (mthca_ah_grh_present(ah)) { + header->grh.traffic_class = + (be32_to_cpu(ah->av->sl_tclass_flowlabel) >> 20) & 0xff; + header->grh.flow_label = + ah->av->sl_tclass_flowlabel & cpu_to_be32(0xfffff); + header->grh.hop_limit = ah->av->hop_limit; + ib_get_cached_gid(&dev->ib_dev, + be32_to_cpu(ah->av->port_pd) >> 24, + ah->av->gid_index % dev->limits.gid_table_len, + &header->grh.source_gid, NULL); + memcpy(header->grh.destination_gid.raw, + ah->av->dgid, 16); + } + + return 0; +} + +int mthca_ah_query(struct ib_ah *ibah, struct ib_ah_attr *attr) +{ + struct mthca_ah *ah = to_mah(ibah); + struct mthca_dev *dev = to_mdev(ibah->device); + + /* Only implement for MAD and memfree ah for now. */ + if (ah->type == MTHCA_AH_ON_HCA) + return -ENOSYS; + + memset(attr, 0, sizeof *attr); + attr->dlid = be16_to_cpu(ah->av->dlid); + attr->sl = be32_to_cpu(ah->av->sl_tclass_flowlabel) >> 28; + attr->port_num = be32_to_cpu(ah->av->port_pd) >> 24; + attr->static_rate = mthca_rate_to_ib(dev, ah->av->msg_sr & 0x7, + attr->port_num); + attr->src_path_bits = ah->av->g_slid & 0x7F; + attr->ah_flags = mthca_ah_grh_present(ah) ? IB_AH_GRH : 0; + + if (attr->ah_flags) { + attr->grh.traffic_class = + be32_to_cpu(ah->av->sl_tclass_flowlabel) >> 20; + attr->grh.flow_label = + be32_to_cpu(ah->av->sl_tclass_flowlabel) & 0xfffff; + attr->grh.hop_limit = ah->av->hop_limit; + attr->grh.sgid_index = ah->av->gid_index & + (dev->limits.gid_table_len - 1); + memcpy(attr->grh.dgid.raw, ah->av->dgid, 16); + } + + return 0; +} + +int mthca_init_av_table(struct mthca_dev *dev) +{ + int err; + + if (mthca_is_memfree(dev)) + return 0; + + err = mthca_alloc_init(&dev->av_table.alloc, + dev->av_table.num_ddr_avs, + dev->av_table.num_ddr_avs - 1, + 0); + if (err) + return err; + + dev->av_table.pool = pci_pool_create("mthca_av", dev->pdev, + MTHCA_AV_SIZE, + MTHCA_AV_SIZE, 0); + if (!dev->av_table.pool) + goto out_free_alloc; + + if (!(dev->mthca_flags & MTHCA_FLAG_DDR_HIDDEN)) { + dev->av_table.av_map = ioremap(pci_resource_start(dev->pdev, 4) + + dev->av_table.ddr_av_base - + dev->ddr_start, + dev->av_table.num_ddr_avs * + MTHCA_AV_SIZE); + if (!dev->av_table.av_map) + goto out_free_pool; + } else + dev->av_table.av_map = NULL; + + return 0; + + out_free_pool: + pci_pool_destroy(dev->av_table.pool); + + out_free_alloc: + mthca_alloc_cleanup(&dev->av_table.alloc); + return -ENOMEM; +} + +void mthca_cleanup_av_table(struct mthca_dev *dev) +{ + if (mthca_is_memfree(dev)) + return; + + if (dev->av_table.av_map) + iounmap(dev->av_table.av_map); + pci_pool_destroy(dev->av_table.pool); + mthca_alloc_cleanup(&dev->av_table.alloc); +} Added: head/sys/dev/mthca/mthca_catas.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mthca/mthca_catas.c Tue Feb 13 17:04:34 2018 (r329222) @@ -0,0 +1,202 @@ +/* + * Copyright (c) 2005 Cisco Systems. All rights reserved. + * + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenIB.org BSD license below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - 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. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#define LINUXKPI_PARAM_PREFIX mthca_ + +#include +#include +#include +#include + +#include "mthca_dev.h" + +#define MTHCA_CATAS_POLL_INTERVAL (5 * HZ) + +enum { + MTHCA_CATAS_TYPE_INTERNAL = 0, + MTHCA_CATAS_TYPE_UPLINK = 3, + MTHCA_CATAS_TYPE_DDR = 4, + MTHCA_CATAS_TYPE_PARITY = 5, +}; + +static DEFINE_SPINLOCK(catas_lock); + +static LIST_HEAD(catas_list); +static struct workqueue_struct *catas_wq; +static struct work_struct catas_work; + +static int catas_reset_disable; +module_param_named(catas_reset_disable, catas_reset_disable, int, 0644); +MODULE_PARM_DESC(catas_reset_disable, "disable reset on catastrophic event if nonzero"); + +static void catas_reset(struct work_struct *work) +{ + struct mthca_dev *dev, *tmpdev; + LIST_HEAD(tlist); + int ret; + + mutex_lock(&mthca_device_mutex); + + spin_lock_irq(&catas_lock); + list_splice_init(&catas_list, &tlist); + spin_unlock_irq(&catas_lock); + + list_for_each_entry_safe(dev, tmpdev, &tlist, catas_err.list) { + struct pci_dev *pdev = dev->pdev; + ret = __mthca_restart_one(dev->pdev); + /* 'dev' now is not valid */ + if (ret) + printk(KERN_ERR "mthca %s: Reset failed (%d)\n", + pci_name(pdev), ret); + else { + struct mthca_dev *d = pci_get_drvdata(pdev); + mthca_dbg(d, "Reset succeeded\n"); + } + } + + mutex_unlock(&mthca_device_mutex); +} + +static void handle_catas(struct mthca_dev *dev) +{ + struct ib_event event; + unsigned long flags; + const char *type; + int i; + + event.device = &dev->ib_dev; + event.event = IB_EVENT_DEVICE_FATAL; + event.element.port_num = 0; + dev->active = false; + + ib_dispatch_event(&event); + + switch (swab32(readl(dev->catas_err.map)) >> 24) { + case MTHCA_CATAS_TYPE_INTERNAL: + type = "internal error"; + break; + case MTHCA_CATAS_TYPE_UPLINK: + type = "uplink bus error"; + break; + case MTHCA_CATAS_TYPE_DDR: + type = "DDR data error"; + break; + case MTHCA_CATAS_TYPE_PARITY: + type = "internal parity error"; + break; + default: + type = "unknown error"; + break; + } + + mthca_err(dev, "Catastrophic error detected: %s\n", type); + for (i = 0; i < dev->catas_err.size; ++i) + mthca_err(dev, " buf[%02x]: %08x\n", + i, swab32(readl(dev->catas_err.map + i))); + + if (catas_reset_disable) + return; + + spin_lock_irqsave(&catas_lock, flags); + list_add(&dev->catas_err.list, &catas_list); + queue_work(catas_wq, &catas_work); + spin_unlock_irqrestore(&catas_lock, flags); +} + +static void poll_catas(unsigned long dev_ptr) +{ + struct mthca_dev *dev = (struct mthca_dev *) dev_ptr; + int i; + + for (i = 0; i < dev->catas_err.size; ++i) + if (readl(dev->catas_err.map + i)) { + handle_catas(dev); + return; + } + + mod_timer(&dev->catas_err.timer, + round_jiffies(jiffies + MTHCA_CATAS_POLL_INTERVAL)); +} + +void mthca_start_catas_poll(struct mthca_dev *dev) +{ + phys_addr_t addr; + + init_timer(&dev->catas_err.timer); + dev->catas_err.map = NULL; + + addr = pci_resource_start(dev->pdev, 0) + + ((pci_resource_len(dev->pdev, 0) - 1) & + dev->catas_err.addr); + + dev->catas_err.map = ioremap(addr, dev->catas_err.size * 4); + if (!dev->catas_err.map) { + mthca_warn(dev, "couldn't map catastrophic error region " + "at 0x%llx/0x%x\n", (unsigned long long) addr, + dev->catas_err.size * 4); + return; + } + + dev->catas_err.timer.data = (unsigned long) dev; + dev->catas_err.timer.function = poll_catas; + dev->catas_err.timer.expires = jiffies + MTHCA_CATAS_POLL_INTERVAL; + INIT_LIST_HEAD(&dev->catas_err.list); + add_timer(&dev->catas_err.timer); +} + +void mthca_stop_catas_poll(struct mthca_dev *dev) +{ + del_timer_sync(&dev->catas_err.timer); + + if (dev->catas_err.map) + iounmap(dev->catas_err.map); + + spin_lock_irq(&catas_lock); + list_del(&dev->catas_err.list); + spin_unlock_irq(&catas_lock); +} + +int __init mthca_catas_init(void) +{ + INIT_WORK(&catas_work, catas_reset); + + catas_wq = alloc_ordered_workqueue("mthca_catas", WQ_MEM_RECLAIM); + if (!catas_wq) + return -ENOMEM; + + return 0; +} + +void mthca_catas_cleanup(void) +{ + destroy_workqueue(catas_wq); +} Added: head/sys/dev/mthca/mthca_cmd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mthca/mthca_cmd.c Tue Feb 13 17:04:34 2018 (r329222) @@ -0,0 +1,1968 @@ +/* + * Copyright (c) 2004, 2005 Topspin Communications. All rights reserved. + * Copyright (c) 2005 Mellanox Technologies. All rights reserved. + * Copyright (c) 2005, 2006 Cisco Systems. All rights reserved. + * + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenIB.org BSD license below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - 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. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#define LINUXKPI_PARAM_PREFIX mthca_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "mthca_dev.h" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Feb 13 17:05: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 79472F117CF; Tue, 13 Feb 2018 17:05:51 +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 248A4841A5; Tue, 13 Feb 2018 17:05:51 +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 1F5A8239C2; Tue, 13 Feb 2018 17:05:51 +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 w1DH5pdH082179; Tue, 13 Feb 2018 17:05:51 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DH5o6J082178; Tue, 13 Feb 2018 17:05:50 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201802131705.w1DH5o6J082178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 13 Feb 2018 17:05:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329223 - head/contrib/llvm/tools/clang/lib/Sema X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/llvm/tools/clang/lib/Sema X-SVN-Commit-Revision: 329223 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 13 Feb 2018 17:05:51 -0000 Author: dim Date: Tue Feb 13 17:05:50 2018 New Revision: 329223 URL: https://svnweb.freebsd.org/changeset/base/329223 Log: Pull in r323998 from upstream clang trunk (by Richard Smith): PR36157: When injecting an implicit function declaration in C89, find the right DeclContext rather than injecting it wherever we happen to be. This avoids creating functions whose DeclContext is a struct or similar. This fixes assertion failures when parsing certain not-completely-valid struct declarations. Reported by: ae PR: 225862 MFC after: 3 months X-MFC-With: r327952 Modified: head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp Modified: head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp Tue Feb 13 17:04:34 2018 (r329222) +++ head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp Tue Feb 13 17:05:50 2018 (r329223) @@ -12507,9 +12507,19 @@ void Sema::ActOnFinishDelayedAttribute(Scope *S, Decl /// call, forming a call to an implicitly defined function (per C99 6.5.1p2). NamedDecl *Sema::ImplicitlyDefineFunction(SourceLocation Loc, IdentifierInfo &II, Scope *S) { + // Find the scope in which the identifier is injected and the corresponding + // DeclContext. + // FIXME: C89 does not say what happens if there is no enclosing block scope. + // In that case, we inject the declaration into the translation unit scope + // instead. Scope *BlockScope = S; while (!BlockScope->isCompoundStmtScope() && BlockScope->getParent()) BlockScope = BlockScope->getParent(); + + Scope *ContextScope = BlockScope; + while (!ContextScope->getEntity()) + ContextScope = ContextScope->getParent(); + ContextRAII SavedContext(*this, ContextScope->getEntity()); // Before we produce a declaration for an implicitly defined // function, see whether there was a locally-scoped declaration of From owner-svn-src-head@freebsd.org Tue Feb 13 17:38: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 9E002F140DA; Tue, 13 Feb 2018 17:38:09 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C42085B83; Tue, 13 Feb 2018 17:38:09 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4302C23EA4; Tue, 13 Feb 2018 17:38:09 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1DHc93v097230; Tue, 13 Feb 2018 17:38:09 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DHc9au097229; Tue, 13 Feb 2018 17:38:09 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201802131738.w1DHc9au097229@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 13 Feb 2018 17:38:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329224 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 329224 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 13 Feb 2018 17:38:09 -0000 Author: ian Date: Tue Feb 13 17:38:08 2018 New Revision: 329224 URL: https://svnweb.freebsd.org/changeset/base/329224 Log: Fix bad indentation. Whitespace only, no functional changes. Reported by: bde@ Modified: head/sys/kern/subr_rtc.c Modified: head/sys/kern/subr_rtc.c ============================================================================== --- head/sys/kern/subr_rtc.c Tue Feb 13 17:05:50 2018 (r329223) +++ head/sys/kern/subr_rtc.c Tue Feb 13 17:38:08 2018 (r329224) @@ -156,55 +156,55 @@ settime_task_func(void *arg, int pending) static void clock_dbgprint_hdr(device_t dev, int rw) { - struct timespec now; + struct timespec now; - getnanotime(&now); - device_printf(dev, "%s at ", (rw & CLOCK_DBG_READ) ? "read " : "write"); - clock_print_ts(&now, 9); - printf(": "); + getnanotime(&now); + device_printf(dev, "%s at ", (rw & CLOCK_DBG_READ) ? "read " : "write"); + clock_print_ts(&now, 9); + printf(": "); } void clock_dbgprint_bcd(device_t dev, int rw, const struct bcd_clocktime *bct) { - if (show_io & rw) { - clock_dbgprint_hdr(dev, rw); - clock_print_bcd(bct, 9); - printf("\n"); - } + if (show_io & rw) { + clock_dbgprint_hdr(dev, rw); + clock_print_bcd(bct, 9); + printf("\n"); + } } void clock_dbgprint_ct(device_t dev, int rw, const struct clocktime *ct) { - if (show_io & rw) { - clock_dbgprint_hdr(dev, rw); - clock_print_ct(ct, 9); - printf("\n"); - } + if (show_io & rw) { + clock_dbgprint_hdr(dev, rw); + clock_print_ct(ct, 9); + printf("\n"); + } } void clock_dbgprint_err(device_t dev, int rw, int err) { - if (show_io & rw) { - clock_dbgprint_hdr(dev, rw); - printf("error = %d\n", err); - } + if (show_io & rw) { + clock_dbgprint_hdr(dev, rw); + printf("error = %d\n", err); + } } void clock_dbgprint_ts(device_t dev, int rw, const struct timespec *ts) { - if (show_io & rw) { - clock_dbgprint_hdr(dev, rw); - clock_print_ts(ts, 9); - printf("\n"); - } + if (show_io & rw) { + clock_dbgprint_hdr(dev, rw); + clock_print_ts(ts, 9); + printf("\n"); + } } void @@ -266,7 +266,7 @@ clock_unregister(device_t clockdev) if (rtc != NULL) { taskqueue_cancel_timeout(taskqueue_thread, &rtc->stask, NULL); taskqueue_drain_timeout(taskqueue_thread, &rtc->stask); - free(rtc, M_DEVBUF); + free(rtc, M_DEVBUF); } } From owner-svn-src-head@freebsd.org Tue Feb 13 17:40: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 D4C99F142E8; Tue, 13 Feb 2018 17:40:09 +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 8850085D49; Tue, 13 Feb 2018 17:40:09 +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 832CC23EA9; Tue, 13 Feb 2018 17:40:09 +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 w1DHe9wN097369; Tue, 13 Feb 2018 17:40:09 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DHe9IN097368; Tue, 13 Feb 2018 17:40:09 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201802131740.w1DHe9IN097368@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 13 Feb 2018 17:40:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329225 - head/sys/geom/part X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/geom/part X-SVN-Commit-Revision: 329225 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 13 Feb 2018 17:40:10 -0000 Author: jhibbits Date: Tue Feb 13 17:40:09 2018 New Revision: 329225 URL: https://svnweb.freebsd.org/changeset/base/329225 Log: Narrow a race, and fix a leak, in g_part_wither A race in g_part_wither() can lead to I/O being performed with a freed GEOM when the device disappears. Close the race as best as we can for now, following the code patterns from g_part_ctl_destroy() and g_part_ctl_undo(). This also fixes a leak, as g_wither_geom() does not wither providers, it only orphans them, so the partition entries would never get destroyed in g_wither_washer(). Note, this is not a complete fix, it can still race with g_part_start(), the race has merely been narrowed. Reviewed by: markj Sponsored by: Dell EMC Isilon Modified: head/sys/geom/part/g_part.c Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Tue Feb 13 17:38:08 2018 (r329224) +++ head/sys/geom/part/g_part.c Tue Feb 13 17:40:09 2018 (r329225) @@ -1541,18 +1541,21 @@ g_part_wither(struct g_geom *gp, int error) { struct g_part_entry *entry; struct g_part_table *table; + struct g_provider *pp; table = gp->softc; if (table != NULL) { - G_PART_DESTROY(table, NULL); + gp->softc = NULL; while ((entry = LIST_FIRST(&table->gpt_entry)) != NULL) { LIST_REMOVE(entry, gpe_entry); + pp = entry->gpe_pp; + entry->gpe_pp->private = NULL; + entry->gpe_pp = NULL; + g_wither_provider(pp, error); g_free(entry); } - if (gp->softc != NULL) { - kobj_delete((kobj_t)gp->softc, M_GEOM); - gp->softc = NULL; - } + G_PART_DESTROY(table, NULL); + kobj_delete((kobj_t)table, M_GEOM); } g_wither_geom(gp, error); } From owner-svn-src-head@freebsd.org Tue Feb 13 17:42: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 C279BF14676; Tue, 13 Feb 2018 17:42: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 994428617F; Tue, 13 Feb 2018 17:42:10 +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 944EA2401B; Tue, 13 Feb 2018 17:42:10 +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 w1DHgAWF001946; Tue, 13 Feb 2018 17:42:10 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DHgA8C001945; Tue, 13 Feb 2018 17:42:10 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802131742.w1DHgA8C001945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 13 Feb 2018 17:42:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329226 - head/etc/mtree X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/etc/mtree X-SVN-Commit-Revision: 329226 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 13 Feb 2018 17:42:10 -0000 Author: imp Date: Tue Feb 13 17:42:10 2018 New Revision: 329226 URL: https://svnweb.freebsd.org/changeset/base/329226 Log: Add /boot/lua. Modified: head/etc/mtree/BSD.root.dist Modified: head/etc/mtree/BSD.root.dist ============================================================================== --- head/etc/mtree/BSD.root.dist Tue Feb 13 17:40:09 2018 (r329225) +++ head/etc/mtree/BSD.root.dist Tue Feb 13 17:42:10 2018 (r329226) @@ -14,6 +14,8 @@ .. firmware .. + lua + .. kernel .. modules From owner-svn-src-head@freebsd.org Tue Feb 13 17:43: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 B190DF14A37; Tue, 13 Feb 2018 17:43:54 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F41486476; Tue, 13 Feb 2018 17:43:54 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A33524039; Tue, 13 Feb 2018 17:43:54 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1DHhsq6002138; Tue, 13 Feb 2018 17:43:54 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DHhs3d002137; Tue, 13 Feb 2018 17:43:54 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201802131743.w1DHhs3d002137@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Tue, 13 Feb 2018 17:43:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329228 - head/sys/gnu/dev/bwn/phy_n X-SVN-Group: head X-SVN-Commit-Author: landonf X-SVN-Commit-Paths: head/sys/gnu/dev/bwn/phy_n X-SVN-Commit-Revision: 329228 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 13 Feb 2018 17:43:54 -0000 Author: landonf Date: Tue Feb 13 17:43:54 2018 New Revision: 329228 URL: https://svnweb.freebsd.org/changeset/base/329228 Log: bwn(4): txpid2g/txpid5g[lh] are not defined after sromrev 7; the default indices into the TX power gain table should be used instead. This enables use of bwn(4) with later BCM4321 revisions. Reported by: Trev Roydhouse Modified: head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c Modified: head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c ============================================================================== --- head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c Tue Feb 13 17:42:16 2018 (r329227) +++ head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c Tue Feb 13 17:43:54 2018 (r329228) @@ -3906,6 +3906,9 @@ static int bwn_nphy_tx_power_fix(struct bwn_mac *mac) } else if (sc->sc_board_info.board_srom_rev < 4) { txpi[0] = 72; txpi[1] = 72; + } else if (sc->sc_board_info.board_srom_rev > 7) { + txpi[0] = 0; + txpi[1] = 0; } else { #define BWN_NPHY_GET_TXPI(_name, _result) \ do { \ From owner-svn-src-head@freebsd.org Tue Feb 13 17:51: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 699AAF15493; Tue, 13 Feb 2018 17:51:17 +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 1AE5486CF8; Tue, 13 Feb 2018 17:51:17 +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 15EB624084; Tue, 13 Feb 2018 17:51:17 +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 w1DHpGVV003506; Tue, 13 Feb 2018 17:51:16 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DHpGL0003505; Tue, 13 Feb 2018 17:51:16 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201802131751.w1DHpGL0003505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 13 Feb 2018 17:51:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329232 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 329232 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 13 Feb 2018 17:51:17 -0000 Author: bdrewery Date: Tue Feb 13 17:51:16 2018 New Revision: 329232 URL: https://svnweb.freebsd.org/changeset/base/329232 Log: ports modules: Don't leak AUTO_OBJ changes into the port builds. This came about when r328489 made ports modules builds no longer use the in-tree share/mk files, but didn't cleanup MAKEOBJDIR from the environment. This fixes "Variable OBJTOP is recursive". Sponsored by: Dell EMC Modified: head/sys/conf/kern.post.mk Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Tue Feb 13 17:50:36 2018 (r329231) +++ head/sys/conf/kern.post.mk Tue Feb 13 17:51:16 2018 (r329232) @@ -70,6 +70,7 @@ PORTSMODULESENV=\ -u CXX \ -u CPP \ -u MAKESYSPATH \ + -u MAKEOBJDIR \ MAKEFLAGS="${MAKEFLAGS:M*:tW:S/^-m /-m_/g:S/ -m / -m_/g:tw:N-m_*}" \ SYSDIR=${SYSDIR} \ PATH=${PATH}:${LOCALBASE}/bin:${LOCALBASE}/sbin \ From owner-svn-src-head@freebsd.org Tue Feb 13 19:17: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 CE1B1F1C09F; Tue, 13 Feb 2018 19:17:33 +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 7EF0F6B1EA; Tue, 13 Feb 2018 19:17:33 +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 7883B24F04; Tue, 13 Feb 2018 19:17:33 +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 w1DJHXft047412; Tue, 13 Feb 2018 19:17:33 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DJHXfY047411; Tue, 13 Feb 2018 19:17:33 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201802131917.w1DJHXfY047411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 13 Feb 2018 19:17:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329236 - head/contrib/netbsd-tests/kernel X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/contrib/netbsd-tests/kernel X-SVN-Commit-Revision: 329236 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 13 Feb 2018 19:17:34 -0000 Author: asomers Date: Tue Feb 13 19:17:33 2018 New Revision: 329236 URL: https://svnweb.freebsd.org/changeset/base/329236 Log: Fix Coverity CIDs in the sys/kern/sysv_test tests CID 979810: strcpy => strlcpy CID 1193367: don't leak a file descriptor CID 1299856: Check the return value of read(2) Reported by: Coverity Coverity CID: 978910 1193367 1299856 MFC after: 3 weeks X-MFC-With: 328896 Sponsored by: Spectra Logic Corp Modified: head/contrib/netbsd-tests/kernel/t_sysv.c Modified: head/contrib/netbsd-tests/kernel/t_sysv.c ============================================================================== --- head/contrib/netbsd-tests/kernel/t_sysv.c Tue Feb 13 17:58:02 2018 (r329235) +++ head/contrib/netbsd-tests/kernel/t_sysv.c Tue Feb 13 19:17:33 2018 (r329236) @@ -129,7 +129,8 @@ read_int(const char *path) return -1; else { int value; - read(input, &value, sizeof(value)); + ATF_REQUIRE_EQ(read(input, &value, sizeof(value)), sizeof(value)); + close(input); return value; } } @@ -284,7 +285,7 @@ ATF_TC_BODY(msg, tc) * Send the first message to the receiver and wait for the ACK. */ m.mtype = MTYPE_1; - strcpy(m.mtext, m1_str); + strlcpy(m.mtext, m1_str, sizeof(m.mtext)); ATF_REQUIRE_MSG(msgsnd(sender_msqid, &m, MESSAGE_TEXT_LEN, 0) != -1, "sender: msgsnd 1: %d", errno); @@ -298,7 +299,7 @@ ATF_TC_BODY(msg, tc) * Send the second message to the receiver and wait for the ACK. */ m.mtype = MTYPE_2; - strcpy(m.mtext, m2_str); + strlcpy(m.mtext, m2_str, sizeof(m.mtext)); ATF_REQUIRE_MSG(msgsnd(sender_msqid, &m, MESSAGE_TEXT_LEN, 0) != -1, "sender: msgsnd 2: %d", errno); From owner-svn-src-head@freebsd.org Tue Feb 13 19:17: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 AB3DAF1C0EB; Tue, 13 Feb 2018 19:17:49 +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 61A206B2FE; Tue, 13 Feb 2018 19:17: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 43CEB24F05; Tue, 13 Feb 2018 19:17: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 w1DJHnRd047469; Tue, 13 Feb 2018 19:17:49 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DJHmso047463; Tue, 13 Feb 2018 19:17:48 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802131917.w1DJHmso047463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 13 Feb 2018 19:17:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329237 - head/sys/libkern X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/libkern X-SVN-Commit-Revision: 329237 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 13 Feb 2018 19:17:50 -0000 Author: emaste Date: Tue Feb 13 19:17:48 2018 New Revision: 329237 URL: https://svnweb.freebsd.org/changeset/base/329237 Log: libkern: use nul for terminating char rather than 0 Akin to the change made in r188080 for lib/libc/string/. Reported by: bde Sponsored by: The FreeBSD Foundation Modified: head/sys/libkern/strcmp.c head/sys/libkern/strncat.c head/sys/libkern/strncpy.c head/sys/libkern/strsep.c head/sys/libkern/strstr.c Modified: head/sys/libkern/strcmp.c ============================================================================== --- head/sys/libkern/strcmp.c Tue Feb 13 19:17:33 2018 (r329236) +++ head/sys/libkern/strcmp.c Tue Feb 13 19:17:48 2018 (r329237) @@ -44,7 +44,7 @@ int strcmp(const char *s1, const char *s2) { while (*s1 == *s2++) - if (*s1++ == 0) + if (*s1++ == '\0') return (0); return (*(const unsigned char *)s1 - *(const unsigned char *)(s2 - 1)); } Modified: head/sys/libkern/strncat.c ============================================================================== --- head/sys/libkern/strncat.c Tue Feb 13 19:17:33 2018 (r329236) +++ head/sys/libkern/strncat.c Tue Feb 13 19:17:48 2018 (r329237) @@ -53,11 +53,11 @@ strncat(char *dst, const char *src, size_t n) while (*d != 0) d++; do { - if ((*d = *s++) == 0) + if ((*d = *s++) == '\0') break; d++; } while (--n != 0); - *d = 0; + *d = '\0'; } return (dst); } Modified: head/sys/libkern/strncpy.c ============================================================================== --- head/sys/libkern/strncpy.c Tue Feb 13 19:17:33 2018 (r329236) +++ head/sys/libkern/strncpy.c Tue Feb 13 19:17:48 2018 (r329237) @@ -49,10 +49,10 @@ strncpy(char * __restrict dst, const char * __restrict const char *s = src; do { - if ((*d++ = *s++) == 0) { + if ((*d++ = *s++) == '\0') { /* NUL pad the remaining n-1 bytes */ while (--n != 0) - *d++ = 0; + *d++ = '\0'; break; } } while (--n != 0); Modified: head/sys/libkern/strsep.c ============================================================================== --- head/sys/libkern/strsep.c Tue Feb 13 19:17:33 2018 (r329236) +++ head/sys/libkern/strsep.c Tue Feb 13 19:17:48 2018 (r329237) @@ -64,14 +64,14 @@ strsep(char **stringp, const char *delim) spanp = delim; do { if ((sc = *spanp++) == c) { - if (c == 0) + if (c == '\0') s = NULL; else - s[-1] = 0; + s[-1] = '\0'; *stringp = s; return (tok); } - } while (sc != 0); + } while (sc != '\0'); } /* NOTREACHED */ } Modified: head/sys/libkern/strstr.c ============================================================================== --- head/sys/libkern/strstr.c Tue Feb 13 19:17:33 2018 (r329236) +++ head/sys/libkern/strstr.c Tue Feb 13 19:17:48 2018 (r329237) @@ -51,7 +51,7 @@ strstr(const char *s, const char *find) len = strlen(find); do { do { - if ((sc = *s++) == 0) + if ((sc = *s++) == '\0') return (NULL); } while (sc != c); } while (strncmp(s, find, len) != 0); From owner-svn-src-head@freebsd.org Tue Feb 13 19:18: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 2666FF1C162; Tue, 13 Feb 2018 19:18:01 +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 CFD706B3FB; Tue, 13 Feb 2018 19:18:00 +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 CAC3424F07; Tue, 13 Feb 2018 19:18:00 +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 w1DJI0Ad047526; Tue, 13 Feb 2018 19:18:00 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DJI0jD047524; Tue, 13 Feb 2018 19:18:00 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802131918.w1DJI0jD047524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 13 Feb 2018 19:18:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329238 - head/sys/contrib/zstd/lib/freebsd X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/contrib/zstd/lib/freebsd X-SVN-Commit-Revision: 329238 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 13 Feb 2018 19:18:01 -0000 Author: markj Date: Tue Feb 13 19:18:00 2018 New Revision: 329238 URL: https://svnweb.freebsd.org/changeset/base/329238 Log: Move zstd malloc()/free()/calloc() macros to stdlib.h. The definitions otherwise leak into anything that includes zstd.h, which is not desirable for native FreeBSD code. Reviewed by: allanjude, cem, imp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D14352 Modified: head/sys/contrib/zstd/lib/freebsd/stdlib.h head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h Modified: head/sys/contrib/zstd/lib/freebsd/stdlib.h ============================================================================== --- head/sys/contrib/zstd/lib/freebsd/stdlib.h Tue Feb 13 19:17:48 2018 (r329237) +++ head/sys/contrib/zstd/lib/freebsd/stdlib.h Tue Feb 13 19:18:00 2018 (r329238) @@ -1,3 +1,44 @@ -/* This file is in the public domain */ -/* $FreeBSD$ */ -#include "zstd_kfreebsd.h" +/*- + * Copyright (c) 2014-2015 Allan Jude + * 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. + * + * $FreeBSD$ + */ + +#ifndef _ZSTD_FREEBSD_STDLIB_H_ +#define _ZSTD_FREEBSD_STDLIB_H_ + +#ifdef _KERNEL + +#include + +MALLOC_DECLARE(M_ZSTD); + +#define malloc(x) (malloc)((x), M_ZSTD, M_WAITOK) +#define free(x) (free)((x), M_ZSTD) +#define calloc(a, b) (mallocarray)((a), (b), M_ZSTD, M_WAITOK | M_ZERO) + +#endif /* _KERNEL */ + +#endif /* _ZSTD_FREEBSD_STDLIB_H_ */ Modified: head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h ============================================================================== --- head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h Tue Feb 13 19:17:48 2018 (r329237) +++ head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h Tue Feb 13 19:18:00 2018 (r329238) @@ -39,14 +39,6 @@ extern "C" { #ifndef BUILDING_ZFS #include /* ptrdiff_t */ #endif -#include - -MALLOC_DECLARE(M_ZSTD); - -#define malloc(x) (malloc)((x), M_ZSTD, M_WAITOK) -#define free(x) (free)((x), M_ZSTD) -/* in zstd's use of calloc, a is always 1 */ -#define calloc(a,b) (mallocarray)((a), (b), M_ZSTD, M_WAITOK | M_ZERO) #endif #ifdef __cplusplus From owner-svn-src-head@freebsd.org Tue Feb 13 19:19: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 714EFF1C325; Tue, 13 Feb 2018 19:19:27 +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 239786B61E; Tue, 13 Feb 2018 19:19:27 +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 1E72D24F0D; Tue, 13 Feb 2018 19:19: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 w1DJJRT2047618; Tue, 13 Feb 2018 19:19:27 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DJJQC9047617; Tue, 13 Feb 2018 19:19:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802131919.w1DJJQC9047617@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 13 Feb 2018 19:19:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329239 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 329239 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 13 Feb 2018 19:19:27 -0000 Author: emaste Date: Tue Feb 13 19:19:26 2018 New Revision: 329239 URL: https://svnweb.freebsd.org/changeset/base/329239 Log: amd64/pmap: Move Foundation copyright to the 2-clause section Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Tue Feb 13 19:18:00 2018 (r329238) +++ head/sys/amd64/amd64/pmap.c Tue Feb 13 19:19:26 2018 (r329239) @@ -11,17 +11,11 @@ * All rights reserved. * Copyright (c) 2005-2010 Alan L. Cox * All rights reserved. - * Copyright (c) 2014-2018 The FreeBSD Foundation - * All rights reserved. * * This code is derived from software contributed to Berkeley by * the Systems Programming Group of the University of Utah Computer * Science Department and William Jolitz of UUNET Technologies Inc. * - * Portions of this software were developed by - * Konstantin Belousov under sponsorship from - * the FreeBSD Foundation. - * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -54,6 +48,7 @@ */ /*- * Copyright (c) 2003 Networks Associates Technology, Inc. + * Copyright (c) 2014-2018 The FreeBSD Foundation * All rights reserved. * * This software was developed for the FreeBSD Project by Jake Burkholder, @@ -61,6 +56,10 @@ * Security Research Division of Network Associates, Inc. under * DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the DARPA * CHATS research program. + * + * Portions of this software were developed by + * Konstantin Belousov under sponsorship from + * the FreeBSD Foundation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions From owner-svn-src-head@freebsd.org Tue Feb 13 19:28: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 8CC0CF1D028; Tue, 13 Feb 2018 19:28:04 +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 3D3B56BEAC; Tue, 13 Feb 2018 19:28:04 +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 1BA9F250AE; Tue, 13 Feb 2018 19:28:04 +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 w1DJS30T052545; Tue, 13 Feb 2018 19:28:03 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DJS203052532; Tue, 13 Feb 2018 19:28:02 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802131928.w1DJS203052532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 13 Feb 2018 19:28:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329240 - in head: sbin/dumpon sbin/savecore share/man/man5 sys/conf sys/kern sys/sys X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: sbin/dumpon sbin/savecore share/man/man5 sys/conf sys/kern sys/sys X-SVN-Commit-Revision: 329240 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 13 Feb 2018 19:28:04 -0000 Author: markj Date: Tue Feb 13 19:28:02 2018 New Revision: 329240 URL: https://svnweb.freebsd.org/changeset/base/329240 Log: Add support for zstd-compressed user and kernel core dumps. This works similarly to the existing gzip compression support, but zstd is typically faster and gives better compression ratios. Support for this functionality must be configured by adding ZSTDIO to one's kernel configuration file. dumpon(8)'s new -Z option is used to configure zstd compression for kernel dumps. savecore(8) now recognizes and saves zstd-compressed kernel dumps with a .zst extension. Submitted by: cem (original version) Relnotes: yes Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D13101, https://reviews.freebsd.org/D13633 Modified: head/sbin/dumpon/dumpon.8 head/sbin/dumpon/dumpon.c head/sbin/savecore/savecore.c head/share/man/man5/core.5 head/sys/conf/NOTES head/sys/conf/files head/sys/conf/options head/sys/kern/kern_shutdown.c head/sys/kern/kern_sig.c head/sys/kern/subr_compressor.c head/sys/sys/compressor.h head/sys/sys/kerneldump.h Modified: head/sbin/dumpon/dumpon.8 ============================================================================== --- head/sbin/dumpon/dumpon.8 Tue Feb 13 19:19:26 2018 (r329239) +++ head/sbin/dumpon/dumpon.8 Tue Feb 13 19:28:02 2018 (r329240) @@ -28,7 +28,7 @@ .\" From: @(#)swapon.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd October 24, 2017 +.Dd February 13, 2018 .Dt DUMPON 8 .Os .Sh NAME @@ -39,6 +39,7 @@ .Op Fl v .Op Fl k Ar public_key_file .Op Fl z +.Op Fl Z .Ar special_file .Nm .Op Fl v @@ -116,8 +117,10 @@ kernel option. .Pp The .Fl z -option configures the kernel to compress the dump in gzip format before writing -it to the dump device. +and +.Fl Z +options configure the kernel to compress the dump before writing it to +the dump device. This reduces the amount of space required for the dump and accelerates recovery with .Xr savecore 8 @@ -126,10 +129,22 @@ When compression is enabled, the .Nm utility will not verify that the dump device is sufficiently large for a full dump. -This flag requires a kernel compiled with the +The +.Fl z +and +.Fl Z +options cause the dump to be written in +.Xr gzip 1 +and +.Xr zstd 1 +format, respectively. +These flags require a kernel compiled with the .Dv GZIO -kernel option. +or +.Dv ZSTDIO +kernel options. .Pp +.Pp The .Fl l flag causes @@ -269,15 +284,17 @@ The core was decrypted properly if .Xr kgdb 1 does not print any errors. .Sh SEE ALSO +.Xr gzip 1 , .Xr kgdb 1 , +.Xr zstd 1 , .Xr ddb 4 , .Xr fstab 5 , .Xr rc.conf 5 , .Xr config 8 , +.Xr decryptcore 8 , .Xr init 8 , .Xr loader 8 , .Xr rc 8 , -.Xr decryptcore 8 , .Xr savecore 8 , .Xr swapon 8 , .Xr panic 9 Modified: head/sbin/dumpon/dumpon.c ============================================================================== --- head/sbin/dumpon/dumpon.c Tue Feb 13 19:19:26 2018 (r329239) +++ head/sbin/dumpon/dumpon.c Tue Feb 13 19:28:02 2018 (r329240) @@ -73,7 +73,7 @@ static void usage(void) { fprintf(stderr, "%s\n%s\n%s\n", - "usage: dumpon [-v] [-k public_key_file] [-z] special_file", + "usage: dumpon [-v] [-k public_key_file] [-Zz] special_file", " dumpon [-v] off", " dumpon [-v] -l"); exit(EX_USAGE); @@ -192,12 +192,12 @@ main(int argc, char *argv[]) int ch; int i, fd; int do_listdumpdev = 0; - bool enable, gzip; + bool enable, gzip, zstd; - gzip = false; + gzip = zstd = false; pubkeyfile = NULL; - while ((ch = getopt(argc, argv, "k:lvz")) != -1) + while ((ch = getopt(argc, argv, "k:lvZz")) != -1) switch((char)ch) { case 'k': pubkeyfile = optarg; @@ -208,6 +208,9 @@ main(int argc, char *argv[]) case 'v': verbose = 1; break; + case 'Z': + zstd = true; + break; case 'z': gzip = true; break; @@ -215,6 +218,9 @@ main(int argc, char *argv[]) usage(); } + if (gzip && zstd) + errx(EX_USAGE, "The -z and -Z options are mutually exclusive."); + argc -= optind; argv += optind; @@ -254,7 +260,7 @@ main(int argc, char *argv[]) if (fd < 0) err(EX_OSFILE, "%s", dumpdev); - if (!gzip) + if (!gzip && !zstd) check_size(fd, dumpdev); bzero(&kda, sizeof(kda)); @@ -268,8 +274,11 @@ main(int argc, char *argv[]) #endif kda.kda_enable = 1; - kda.kda_compression = gzip ? KERNELDUMP_COMP_GZIP : - KERNELDUMP_COMP_NONE; + kda.kda_compression = KERNELDUMP_COMP_NONE; + if (zstd) + kda.kda_compression = KERNELDUMP_COMP_ZSTD; + else if (gzip) + kda.kda_compression = KERNELDUMP_COMP_GZIP; i = ioctl(fd, DIOCSKERNELDUMP, &kda); explicit_bzero(kda.kda_encryptedkey, kda.kda_encryptedkeysize); free(kda.kda_encryptedkey); Modified: head/sbin/savecore/savecore.c ============================================================================== --- head/sbin/savecore/savecore.c Tue Feb 13 19:19:26 2018 (r329239) +++ head/sbin/savecore/savecore.c Tue Feb 13 19:28:02 2018 (r329240) @@ -109,6 +109,7 @@ printheader(xo_handle_t *xo, const struct kerneldumphe uint64_t dumplen; time_t t; const char *stat_str; + const char *comp_str; xo_flush_h(xo); xo_emit_h(xo, "{Lwc:Dump header from device}{:dump_device/%s}\n", @@ -123,10 +124,21 @@ printheader(xo_handle_t *xo, const struct kerneldumphe (long long)dumplen); xo_emit_h(xo, "{P: }{Lwc:Blocksize}{:blocksize/%d}\n", dtoh32(h->blocksize)); - xo_emit_h(xo, "{P: }{Lwc:Compression}{:compression/%s}\n", - h->compression == KERNELDUMP_COMP_GZIP ? - "gzip" : "none"); - + switch (h->compression) { + case KERNELDUMP_COMP_NONE: + comp_str = "none"; + break; + case KERNELDUMP_COMP_GZIP: + comp_str = "gzip"; + break; + case KERNELDUMP_COMP_ZSTD: + comp_str = "zstd"; + break; + default: + comp_str = "???"; + break; + } + xo_emit_h(xo, "{P: }{Lwc:Compression}{:compression/%s}\n", comp_str); t = dtoh64(h->dumptime); xo_emit_h(xo, "{P: }{Lwc:Dumptime}{:dumptime/%s}", ctime(&t)); xo_emit_h(xo, "{P: }{Lwc:Hostname}{:hostname/%s}\n", h->hostname); @@ -249,6 +261,8 @@ saved_dump_size(int bounds) dumpsize += file_size(path); (void)snprintf(path, sizeof(path), "vmcore.%d.gz", bounds); dumpsize += file_size(path); + (void)snprintf(path, sizeof(path), "vmcore.%d.zst", bounds); + dumpsize += file_size(path); (void)snprintf(path, sizeof(path), "textdump.tar.%d", bounds); dumpsize += file_size(path); (void)snprintf(path, sizeof(path), "textdump.tar.%d.gz", bounds); @@ -268,6 +282,8 @@ saved_dump_remove(int bounds) (void)unlink(path); (void)snprintf(path, sizeof(path), "vmcore.%d.gz", bounds); (void)unlink(path); + (void)snprintf(path, sizeof(path), "vmcore.%d.zst", bounds); + (void)unlink(path); (void)snprintf(path, sizeof(path), "textdump.tar.%d", bounds); (void)unlink(path); (void)snprintf(path, sizeof(path), "textdump.tar.%d.gz", bounds); @@ -282,6 +298,7 @@ symlinks_remove(void) (void)unlink("key.last"); (void)unlink("vmcore.last"); (void)unlink("vmcore.last.gz"); + (void)unlink("vmcore.last.zstd"); (void)unlink("vmcore_encrypted.last"); (void)unlink("vmcore_encrypted.last.gz"); (void)unlink("textdump.tar.last"); @@ -615,6 +632,7 @@ DoFile(const char *savedir, const char *device) case KERNELDUMP_COMP_NONE: break; case KERNELDUMP_COMP_GZIP: + case KERNELDUMP_COMP_ZSTD: if (compress && verbose) printf("dump is already compressed\n"); compress = false; @@ -743,7 +761,8 @@ DoFile(const char *savedir, const char *device) (isencrypted ? "vmcore_encrypted" : "vmcore"), bounds); fp = zopen(corename, "w"); } else if (iscompressed && !isencrypted) { - snprintf(corename, sizeof(corename), "vmcore.%d.gz", bounds); + snprintf(corename, sizeof(corename), "vmcore.%d.%s", bounds, + (kdhl.compression == KERNELDUMP_COMP_GZIP) ? "gz" : "zst"); fp = fopen(corename, "w"); } else { snprintf(corename, sizeof(corename), "%s.%d", @@ -845,9 +864,10 @@ DoFile(const char *savedir, const char *device) } } if (compress || iscompressed) { - snprintf(linkname, sizeof(linkname), "%s.last.gz", + snprintf(linkname, sizeof(linkname), "%s.last.%s", istextdump ? "textdump.tar" : - (isencrypted ? "vmcore_encrypted" : "vmcore")); + (isencrypted ? "vmcore_encrypted" : "vmcore"), + (kdhl.compression == KERNELDUMP_COMP_ZSTD) ? "zst" : "gz"); } else { snprintf(linkname, sizeof(linkname), "%s.last", istextdump ? "textdump.tar" : Modified: head/share/man/man5/core.5 ============================================================================== --- head/share/man/man5/core.5 Tue Feb 13 19:19:26 2018 (r329239) +++ head/share/man/man5/core.5 Tue Feb 13 19:28:02 2018 (r329240) @@ -28,7 +28,7 @@ .\" @(#)core.5 8.3 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd January 8, 2018 +.Dd February 13, 2018 .Dt CORE 5 .Os .Sh NAME @@ -112,10 +112,17 @@ The following sysctl control core file compression: .Bl -tag -width "kern.compress_user_cores_level" -compact -offset "12345" .It Em kern.compress_user_cores Enable compression of user cores. -A value of 1 configures gzip compression. -gzip-compressed core files will have a suffix of +A value of 1 configures +.Xr gzip 1 +compression, +and a value of 2 configures +.Xr zstd 1 +compression. +Compressed core files will have a suffix of .Ql .gz -appended to their filenames. +or +.Ql .zst +appended to their filenames depending on the selected format. .It Em kern.compress_user_cores_level Compression level. Defaults to 6. Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Tue Feb 13 19:19:26 2018 (r329239) +++ head/sys/conf/NOTES Tue Feb 13 19:28:02 2018 (r329240) @@ -3018,6 +3018,10 @@ options IMAGACT_BINMISC # This enables support for compressed core dumps. options GZIO +# zstd I/O stream support +# This enables support for Zstd compressed core dumps. +options ZSTDIO + # BHND(4) drivers options BHND_LOGLEVEL # Logging threshold level Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Feb 13 19:19:26 2018 (r329239) +++ head/sys/conf/files Tue Feb 13 19:28:02 2018 (r329240) @@ -3836,7 +3836,8 @@ kern/subr_bus_dma.c standard kern/subr_bufring.c standard kern/subr_capability.c standard kern/subr_clock.c standard -kern/subr_compressor.c standard +kern/subr_compressor.c standard \ + compile-with "${NORMAL_C} -I$S/contrib/zstd/lib/freebsd" kern/subr_counter.c standard kern/subr_devstat.c standard kern/subr_disk.c standard Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Tue Feb 13 19:19:26 2018 (r329239) +++ head/sys/conf/options Tue Feb 13 19:28:02 2018 (r329240) @@ -222,6 +222,7 @@ TURNSTILE_PROFILING UMTX_PROFILING UMTX_CHAINS opt_global.h VERBOSE_SYSINIT +ZSTDIO opt_zstdio.h # POSIX kernel options P1003_1B_MQUEUE opt_posix.h Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Tue Feb 13 19:19:26 2018 (r329239) +++ head/sys/kern/kern_shutdown.c Tue Feb 13 19:28:02 2018 (r329240) @@ -174,6 +174,7 @@ struct kerneldumpcrypto { #endif struct kerneldumpcomp { + uint8_t kdc_format; struct compressor *kdc_stream; uint8_t *kdc_buf; size_t kdc_resid; @@ -987,12 +988,23 @@ static struct kerneldumpcomp * kerneldumpcomp_create(struct dumperinfo *di, uint8_t compression) { struct kerneldumpcomp *kdcomp; + int format; - if (compression != KERNELDUMP_COMP_GZIP) + switch (compression) { + case KERNELDUMP_COMP_GZIP: + format = COMPRESS_GZIP; + break; + case KERNELDUMP_COMP_ZSTD: + format = COMPRESS_ZSTD; + break; + default: return (NULL); + } + kdcomp = malloc(sizeof(*kdcomp), M_DUMPER, M_WAITOK | M_ZERO); + kdcomp->kdc_format = compression; kdcomp->kdc_stream = compressor_init(kerneldumpcomp_write_cb, - COMPRESS_GZIP, di->maxiosize, kerneldump_gzlevel, di); + format, di->maxiosize, kerneldump_gzlevel, di); if (kdcomp->kdc_stream == NULL) { free(kdcomp, M_DUMPER); return (NULL); @@ -1293,7 +1305,7 @@ dump_start(struct dumperinfo *di, struct kerneldumphea * will occupy, so try to use the whole swap partition * (minus the first 64KB) in the hope that the * compressed dump will fit. If that doesn't turn out to - * be enouch, the bounds checking in dump_write() + * be enough, the bounds checking in dump_write() * will catch us and cause the dump to fail. */ dumpextent = di->mediasize - SIZEOF_METADATA - @@ -1463,7 +1475,7 @@ dump_init_header(const struct dumperinfo *di, struct k if (panicstr != NULL) strlcpy(kdh->panicstring, panicstr, sizeof(kdh->panicstring)); if (di->kdcomp != NULL) - kdh->compression = KERNELDUMP_COMP_GZIP; + kdh->compression = di->kdcomp->kdc_format; kdh->parity = kerneldump_parity(kdh); } Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Tue Feb 13 19:19:26 2018 (r329239) +++ head/sys/kern/kern_sig.c Tue Feb 13 19:28:02 2018 (r329240) @@ -3253,7 +3253,8 @@ sysctl_debug_num_cores_check (SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_debug, OID_AUTO, ncores, CTLTYPE_INT|CTLFLAG_RW, 0, sizeof(int), sysctl_debug_num_cores_check, "I", ""); -#define GZ_SUFFIX ".gz" +#define GZIP_SUFFIX ".gz" +#define ZSTD_SUFFIX ".zst" int compress_user_cores = 0; @@ -3273,7 +3274,9 @@ sysctl_compress_user_cores(SYSCTL_HANDLER_ARGS) } SYSCTL_PROC(_kern, OID_AUTO, compress_user_cores, CTLTYPE_INT | CTLFLAG_RWTUN, 0, sizeof(int), sysctl_compress_user_cores, "I", - "Enable compression of user corefiles (" __XSTRING(COMPRESS_GZIP) " = gzip)"); + "Enable compression of user corefiles (" + __XSTRING(COMPRESS_GZIP) " = gzip, " + __XSTRING(COMPRESS_ZSTD) " = zstd)"); int compress_user_cores_level = 6; SYSCTL_INT(_kern, OID_AUTO, compress_user_cores_level, CTLFLAG_RWTUN, @@ -3377,7 +3380,9 @@ corefile_open(const char *comm, uid_t uid, pid_t pid, sx_sunlock(&corefilename_lock); free(hostname, M_TEMP); if (compress == COMPRESS_GZIP) - sbuf_printf(&sb, GZ_SUFFIX); + sbuf_printf(&sb, GZIP_SUFFIX); + else if (compress == COMPRESS_ZSTD) + sbuf_printf(&sb, ZSTD_SUFFIX); if (sbuf_error(&sb) != 0) { log(LOG_ERR, "pid %ld (%s), uid (%lu): corename is too " "long\n", (long)pid, comm, (u_long)uid); Modified: head/sys/kern/subr_compressor.c ============================================================================== --- head/sys/kern/subr_compressor.c Tue Feb 13 19:19:26 2018 (r329239) +++ head/sys/kern/subr_compressor.c Tue Feb 13 19:28:02 2018 (r329240) @@ -2,6 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2014, 2017 Mark Johnston + * Copyright (c) 2017 Conrad Meyer * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -34,8 +35,10 @@ __FBSDID("$FreeBSD$"); #include "opt_gzio.h" +#include "opt_zstdio.h" #include +#include #include #include @@ -244,6 +247,232 @@ struct compressor_methods gzip_methods = { DATA_SET(compressors, gzip_methods); #endif /* GZIO */ + +#ifdef ZSTDIO + +#define ZSTD_STATIC_LINKING_ONLY +#include + +struct zstdio_stream { + ZSTD_CCtx *zst_stream; + ZSTD_inBuffer zst_inbuffer; + ZSTD_outBuffer zst_outbuffer; + uint8_t * zst_buffer; /* output buffer */ + size_t zst_maxiosz; /* Max output IO size */ + off_t zst_off; /* offset into the output stream */ + void * zst_static_wkspc; +}; + +static void *zstdio_init(size_t maxiosize, int level); +static void zstdio_reset(void *stream); +static int zstdio_write(void *stream, void *data, size_t len, + compressor_cb_t, void *); +static void zstdio_fini(void *stream); + +static void * +zstdio_init(size_t maxiosize, int level) +{ + ZSTD_CCtx *dump_compressor; + struct zstdio_stream *s; + void *wkspc, *owkspc, *buffer; + size_t wkspc_size, buf_size; + + wkspc_size = ZSTD_estimateCStreamSize(level); + owkspc = wkspc = malloc(wkspc_size + 8, M_COMPRESS, + M_WAITOK | M_NODUMP); + /* Zstd API requires 8-byte alignment. */ + if ((uintptr_t)wkspc % 8 != 0) + wkspc = (void *)roundup2((uintptr_t)wkspc, 8); + + dump_compressor = ZSTD_initStaticCCtx(wkspc, wkspc_size); + if (dump_compressor == NULL) { + free(owkspc, M_COMPRESS); + printf("%s: workspace too small.\n", __func__); + return (NULL); + } + + (void)ZSTD_CCtx_setParameter(dump_compressor, ZSTD_p_checksumFlag, 1); + + buf_size = ZSTD_CStreamOutSize() * 2; + buffer = malloc(buf_size, M_COMPRESS, M_WAITOK | M_NODUMP); + + s = malloc(sizeof(*s), M_COMPRESS, M_NODUMP | M_WAITOK); + s->zst_buffer = buffer; + s->zst_outbuffer.dst = buffer; + s->zst_outbuffer.size = buf_size; + s->zst_maxiosz = maxiosize; + s->zst_stream = dump_compressor; + s->zst_static_wkspc = owkspc; + + zstdio_reset(s); + + return (s); +} + +static void +zstdio_reset(void *stream) +{ + struct zstdio_stream *s; + size_t res; + + s = stream; + res = ZSTD_resetCStream(s->zst_stream, 0); + if (ZSTD_isError(res)) + panic("%s: could not reset stream %p: %s\n", __func__, s, + ZSTD_getErrorName(res)); + + s->zst_off = 0; + s->zst_inbuffer.src = NULL; + s->zst_inbuffer.size = 0; + s->zst_inbuffer.pos = 0; + s->zst_outbuffer.pos = 0; +} + +static int +zst_flush_intermediate(struct zstdio_stream *s, compressor_cb_t cb, void *arg) +{ + size_t bytes_to_dump; + int error; + + /* Flush as many full output blocks as possible. */ + /* XXX: 4096 is arbitrary safe HDD block size for kernel dumps */ + while (s->zst_outbuffer.pos >= 4096) { + bytes_to_dump = rounddown(s->zst_outbuffer.pos, 4096); + + if (bytes_to_dump > s->zst_maxiosz) + bytes_to_dump = s->zst_maxiosz; + + error = cb(s->zst_buffer, bytes_to_dump, s->zst_off, arg); + if (error != 0) + return (error); + + /* + * Shift any non-full blocks up to the front of the output + * buffer. + */ + s->zst_outbuffer.pos -= bytes_to_dump; + memmove(s->zst_outbuffer.dst, + (char *)s->zst_outbuffer.dst + bytes_to_dump, + s->zst_outbuffer.pos); + s->zst_off += bytes_to_dump; + } + return (0); +} + +static int +zstdio_flush(struct zstdio_stream *s, compressor_cb_t cb, void *arg) +{ + size_t rc, lastpos; + int error; + + /* + * Positive return indicates unflushed data remaining; need to call + * endStream again after clearing out room in output buffer. + */ + rc = 1; + lastpos = s->zst_outbuffer.pos; + while (rc > 0) { + rc = ZSTD_endStream(s->zst_stream, &s->zst_outbuffer); + if (ZSTD_isError(rc)) { + printf("%s: ZSTD_endStream failed (%s)\n", __func__, + ZSTD_getErrorName(rc)); + return (EIO); + } + if (lastpos == s->zst_outbuffer.pos) { + printf("%s: did not make forward progress endStream %zu\n", + __func__, lastpos); + return (EIO); + } + + error = zst_flush_intermediate(s, cb, arg); + if (error != 0) + return (error); + + lastpos = s->zst_outbuffer.pos; + } + + /* + * We've already done an intermediate flush, so all full blocks have + * been written. Only a partial block remains. Padding happens in a + * higher layer. + */ + if (s->zst_outbuffer.pos != 0) { + error = cb(s->zst_buffer, s->zst_outbuffer.pos, s->zst_off, + arg); + if (error != 0) + return (error); + } + + return (0); +} + +static int +zstdio_write(void *stream, void *data, size_t len, compressor_cb_t cb, + void *arg) +{ + struct zstdio_stream *s; + size_t lastpos, rc; + int error; + + s = stream; + if (data == NULL) + return (zstdio_flush(s, cb, arg)); + + s->zst_inbuffer.src = data; + s->zst_inbuffer.size = len; + s->zst_inbuffer.pos = 0; + lastpos = 0; + + while (s->zst_inbuffer.pos < s->zst_inbuffer.size) { + rc = ZSTD_compressStream(s->zst_stream, &s->zst_outbuffer, + &s->zst_inbuffer); + if (ZSTD_isError(rc)) { + printf("%s: Compress failed on %p! (%s)\n", + __func__, data, ZSTD_getErrorName(rc)); + return (EIO); + } + + if (lastpos == s->zst_inbuffer.pos) { + /* + * XXX: May need flushStream to make forward progress + */ + printf("ZSTD: did not make forward progress @pos %zu\n", + lastpos); + return (EIO); + } + lastpos = s->zst_inbuffer.pos; + + error = zst_flush_intermediate(s, cb, arg); + if (error != 0) + return (error); + } + return (0); +} + +static void +zstdio_fini(void *stream) +{ + struct zstdio_stream *s; + + s = stream; + if (s->zst_static_wkspc != NULL) + free(s->zst_static_wkspc, M_COMPRESS); + else + ZSTD_freeCCtx(s->zst_stream); + free(s->zst_buffer, M_COMPRESS); + free(s, M_COMPRESS); +} + +static struct compressor_methods zstd_methods = { + .format = COMPRESS_ZSTD, + .init = zstdio_init, + .reset = zstdio_reset, + .write = zstdio_write, + .fini = zstdio_fini, +}; +DATA_SET(compressors, zstd_methods); + +#endif /* ZSTDIO */ bool compressor_avail(int format) Modified: head/sys/sys/compressor.h ============================================================================== --- head/sys/sys/compressor.h Tue Feb 13 19:19:26 2018 (r329239) +++ head/sys/sys/compressor.h Tue Feb 13 19:28:02 2018 (r329240) @@ -35,6 +35,7 @@ /* Supported formats. */ #define COMPRESS_GZIP 1 +#define COMPRESS_ZSTD 2 typedef int (*compressor_cb_t)(void *, size_t, off_t, void *); Modified: head/sys/sys/kerneldump.h ============================================================================== --- head/sys/sys/kerneldump.h Tue Feb 13 19:19:26 2018 (r329239) +++ head/sys/sys/kerneldump.h Tue Feb 13 19:28:02 2018 (r329240) @@ -59,6 +59,7 @@ #define KERNELDUMP_COMP_NONE 0 #define KERNELDUMP_COMP_GZIP 1 +#define KERNELDUMP_COMP_ZSTD 2 #define KERNELDUMP_ENC_NONE 0 #define KERNELDUMP_ENC_AES_256_CBC 1 From owner-svn-src-head@freebsd.org Tue Feb 13 19:43: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 9C0FCF1E47F; Tue, 13 Feb 2018 19:43:26 +0000 (UTC) (envelope-from carpeddiem@gmail.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 2D5356CDDB; Tue, 13 Feb 2018 19:43:26 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x22c.google.com with SMTP id n206so12205826itg.1; Tue, 13 Feb 2018 11:43:26 -0800 (PST) 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=zJcUCHazPIKRq3ZzD5ceQNTIEiNbB8Mn0yib87yXeWg=; b=jwGhLRNO6tkMJol73fenCt1/4B5mdH16NXZrz6nGLVp7Dc3mxyKg0QBzYTWcomKOIv wc9gaANARiArdywh5uYDSPu96jw1zQslbubknWwau9aiUsbkZ9vez8V4wY8xfLmyvjro IBnWmCLK23iT7TjjUhadUzazfROfh/JdiiicWHFB/1ZJnlujA2qjh5YKLMKBQvHWnDcF UVWNXmUnHFFYWKBcrKgOzFyeCb7IwCbvfO7s+xevu3YyYmqJOb+U6o0Tr+3VNssIqxWU hE08JCtnJrE7Oc7vxskLCXDau2htqIseROY7kQeH1uGihuKh9bSjDXRdHEB2OPf7MLsI S+IQ== 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=zJcUCHazPIKRq3ZzD5ceQNTIEiNbB8Mn0yib87yXeWg=; b=ifhSgJQGo60OLwn2byWsiVhKYQvmM/6KfETZYuZ/B3jsbSe0j3iut7/DgVcnlhkkFz rjfLbj7CBXbfVIww24v0xuA4Qt1u+TzqVtJrCKZB9U/jTnZe6CuxTXfuxDWae6nmf4ot hoivX8+CjhAr6cF3l2S0rSohImZ1LpUFHrE7oU/c1V9tOzvGDt2eKP9JGse391OvhtNn 8n9RUtanojhqN1dSKj7HXIUBN1Cdtm2UZQJMI3nGIG0UFUa8fYnupYHPuCWDOWnjIp3N b4unREBWrBUphHBCHfBzqFoeoEeU4RJJ9aiyWJWYUoLHFZb8I1nKryKI2Jf5+OHFYYD4 FAqg== X-Gm-Message-State: APf1xPAHkf07JuQXT2H97ykw82xDoaND7sT/TSuU/R6PCpfW1OzcLyTk XT4UbK65XQSsV2ugKP+INPpTEkY/xiUACsrVp/eAog== X-Google-Smtp-Source: AH8x226eBt1I52wPe8okBLiBr3bcxbHtpKAElbJwaQU1JmL0vMwhSS2+3MXujOVbRwv3WF9WF02wQrQ7tFdUA0gp1gI= X-Received: by 10.36.208.4 with SMTP id m4mr1096323itg.69.1518551005370; Tue, 13 Feb 2018 11:43:25 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.147.9 with HTTP; Tue, 13 Feb 2018 11:43:04 -0800 (PST) In-Reply-To: <1518549829.85310.39.camel@freebsd.org> References: <201802131917.w1DJHmso047463@repo.freebsd.org> <1518549829.85310.39.camel@freebsd.org> From: Ed Maste Date: Tue, 13 Feb 2018 14:43:04 -0500 X-Google-Sender-Auth: pOipul-8t9zivbRfFb8Q2k77IvI Message-ID: Subject: Re: svn commit: r329237 - head/sys/libkern To: Ian Lepore 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.25 Precedence: list List-Id: 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, 13 Feb 2018 19:43:26 -0000 On 13 February 2018 at 14:23, Ian Lepore wrote: > On Tue, 2018-02-13 at 19:17 +0000, Ed Maste wrote: >> Author: emaste >> Date: Tue Feb 13 19:17:48 2018 >> New Revision: 329237 >> URL: https://svnweb.freebsd.org/changeset/base/329237 >> >> Log: >> libkern: use nul for terminating char rather than 0 >> >> Akin to the change made in r188080 for lib/libc/string/. >> >> Reported by: bde >> Sponsored by: The FreeBSD Foundation > > There are many ways to spell 0. Why are we using something other than > the simplest way? Is it a style rule thing, or is it portability- > correctness, or what? I made the change to improve consistency between lib/libc/string and sys/libkern, which is what Bruce commented on some time ago. I don't have a personal preference for 0 or '\0' but definitely believe that if we have multiple, similar copies of a function they ought to avoid gratuitous differences. (I'm happy to change both trees to 0 if that's preferred.) From owner-svn-src-head@freebsd.org Tue Feb 13 19: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 97943F1EF21; Tue, 13 Feb 2018 19:52:14 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [199.48.133.146]) by mx1.freebsd.org (Postfix) with ESMTP id 47C6E6D3D5; Tue, 13 Feb 2018 19:52:13 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from sweettea.beer.town (unknown [76.164.8.130]) by smtp.vangyzen.net (Postfix) with ESMTPSA id 0E1965646B; Tue, 13 Feb 2018 13:52:12 -0600 (CST) Subject: Re: svn commit: r329237 - head/sys/libkern To: Ed Maste , Ian Lepore Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201802131917.w1DJHmso047463@repo.freebsd.org> <1518549829.85310.39.camel@freebsd.org> From: Eric van Gyzen Message-ID: <1b3a489d-d62c-6f88-a269-a35ad9bf5ef5@vangyzen.net> Date: Tue, 13 Feb 2018 13:52:11 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.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.25 Precedence: list List-Id: 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, 13 Feb 2018 19:52:14 -0000 On 02/13/2018 13:43, Ed Maste wrote: > On 13 February 2018 at 14:23, Ian Lepore wrote: >> On Tue, 2018-02-13 at 19:17 +0000, Ed Maste wrote: >>> Author: emaste >>> Date: Tue Feb 13 19:17:48 2018 >>> New Revision: 329237 >>> URL: https://svnweb.freebsd.org/changeset/base/329237 >>> >>> Log: >>> libkern: use nul for terminating char rather than 0 >>> >>> Akin to the change made in r188080 for lib/libc/string/. >>> >>> Reported by: bde >>> Sponsored by: The FreeBSD Foundation >> >> There are many ways to spell 0. Why are we using something other than >> the simplest way? Is it a style rule thing, or is it portability- >> correctness, or what? > > I made the change to improve consistency between lib/libc/string and > sys/libkern, which is what Bruce commented on some time ago. I don't > have a personal preference for 0 or '\0' but definitely believe that > if we have multiple, similar copies of a function they ought to avoid > gratuitous differences. (I'm happy to change both trees to 0 if that's > preferred.) I prefer '\0' here because it tells the reader that it's a NUL character, as opposed to a NULL pointer or a zero integer. Yes, the reader should already know that, but the author can /help/ the reader by communicating more clearly and completely. Eric From owner-svn-src-head@freebsd.org Tue Feb 13 19:54: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 C2938F1F1DB for ; Tue, 13 Feb 2018 19:54:48 +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 46A236D78C for ; Tue, 13 Feb 2018 19:54:47 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: ac67eb81-10f7-11e8-b951-f99fef315fd9 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 ac67eb81-10f7-11e8-b951-f99fef315fd9; Tue, 13 Feb 2018 19:54:17 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w1DJsdSs038527; Tue, 13 Feb 2018 12:54:39 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1518551679.72050.4.camel@freebsd.org> Subject: Re: svn commit: r329237 - head/sys/libkern From: Ian Lepore To: Ed Maste Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 13 Feb 2018 12:54:39 -0700 In-Reply-To: References: <201802131917.w1DJHmso047463@repo.freebsd.org> <1518549829.85310.39.camel@freebsd.org> 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.25 Precedence: list List-Id: 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, 13 Feb 2018 19:54:48 -0000 On Tue, 2018-02-13 at 14:43 -0500, Ed Maste wrote: > On 13 February 2018 at 14:23, Ian Lepore wrote: > > > > On Tue, 2018-02-13 at 19:17 +0000, Ed Maste wrote: > > > > > > Author: emaste > > > Date: Tue Feb 13 19:17:48 2018 > > > New Revision: 329237 > > > URL: https://svnweb.freebsd.org/changeset/base/329237 > > > > > > Log: > > >   libkern: use nul for terminating char rather than 0 > > > > > >   Akin to the change made in r188080 for lib/libc/string/. > > > > > >   Reported by:        bde > > >   Sponsored by:       The FreeBSD Foundation > > There are many ways to spell 0.  Why are we using something other > > than > > the simplest way?  Is it a style rule thing, or is it portability- > > correctness, or what? > I made the change to improve consistency between lib/libc/string and > sys/libkern, which is what Bruce commented on some time ago. I don't > have a personal preference for 0 or '\0' but definitely believe that > if we have multiple, similar copies of a function they ought to avoid > gratuitous differences. (I'm happy to change both trees to 0 if > that's > preferred.) > Oh, I agree completely about consistancy being important.  I just wanted to know whether I should try to remember to always use \0 because it's a rule or has some benefit I didn't know about. 20+ years ago I used to slavishly ensure I always used \0 when a char type was involved, just as a personal style thing.  Then over time I came to the conclusion that "0 is 0 no matter how you spell it, so keep it simple" (except for pointers... even in c++ I've always used NULL). -- Ian From owner-svn-src-head@freebsd.org Tue Feb 13 20:07: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 1574BF1FF7F; Tue, 13 Feb 2018 20:07:41 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B88D56E1D3; Tue, 13 Feb 2018 20:07:40 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B242D2573A; Tue, 13 Feb 2018 20:07:40 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1DK7e6j073345; Tue, 13 Feb 2018 20:07:40 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DK7exX073343; Tue, 13 Feb 2018 20:07:40 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201802132007.w1DK7exX073343@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Tue, 13 Feb 2018 20:07:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329241 - head/sys/dev/bwn X-SVN-Group: head X-SVN-Commit-Author: landonf X-SVN-Commit-Paths: head/sys/dev/bwn X-SVN-Commit-Revision: 329241 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 13 Feb 2018 20:07:41 -0000 Author: landonf Date: Tue Feb 13 20:07:40 2018 New Revision: 329241 URL: https://svnweb.freebsd.org/changeset/base/329241 Log: bwn(4): Conditionalize "RX decryption attempted" message on a new BWN_DEBUG_HWCRYPTO debug flag. The MAC will attempt decryption (and set BWN_RX_MAC_DEC) even if a key has not been supplied to the hardware; this is expected behavior, and there's no need to spam users' console with this debugging printf. Modified: head/sys/dev/bwn/if_bwn.c head/sys/dev/bwn/if_bwn_debug.h Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Tue Feb 13 19:28:02 2018 (r329240) +++ head/sys/dev/bwn/if_bwn.c Tue Feb 13 20:07:40 2018 (r329241) @@ -5983,7 +5983,6 @@ bwn_rxeof(struct bwn_mac *mac, struct mbuf *m, const v int padding, rate, rssi = 0, noise = 0, type; uint16_t phytype, phystat0, phystat3, chanstat; unsigned char *mp = mtod(m, unsigned char *); - static int rx_mac_dec_rpt = 0; BWN_ASSERT_LOCKED(sc); @@ -6032,11 +6031,12 @@ bwn_rxeof(struct bwn_mac *mac, struct mbuf *m, const v } wh = mtod(m, struct ieee80211_frame_min *); - if (macstat & BWN_RX_MAC_DEC && rx_mac_dec_rpt++ < 50) - device_printf(sc->sc_dev, + if (macstat & BWN_RX_MAC_DEC) { + DPRINTF(sc, BWN_DEBUG_HWCRYPTO, "RX decryption attempted (old %d keyidx %#x)\n", BWN_ISOLDFMT(mac), (macstat & BWN_RX_MAC_KEYIDX) >> BWN_RX_MAC_KEYIDX_SHIFT); + } if (phystat0 & BWN_RX_PHYST0_OFDM) rate = bwn_plcp_get_ofdmrate(mac, plcp, Modified: head/sys/dev/bwn/if_bwn_debug.h ============================================================================== --- head/sys/dev/bwn/if_bwn_debug.h Tue Feb 13 19:28:02 2018 (r329240) +++ head/sys/dev/bwn/if_bwn_debug.h Tue Feb 13 20:07:40 2018 (r329241) @@ -53,6 +53,7 @@ enum { BWN_DEBUG_XMIT_POWER = 0x00020000, BWN_DEBUG_PHY = 0x00040000, BWN_DEBUG_EEPROM = 0x00080000, + BWN_DEBUG_HWCRYPTO = 0x00100000, /* HW crypto */ BWN_DEBUG_FATAL = 0x80000000, /* fatal errors */ BWN_DEBUG_ANY = 0xffffffff }; From owner-svn-src-head@freebsd.org Tue Feb 13 20:09: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 B7DDDF2029E; Tue, 13 Feb 2018 20:09:40 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f182.google.com (mail-io0-f182.google.com [209.85.223.182]) (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 576A66E48F; Tue, 13 Feb 2018 20:09:40 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f182.google.com with SMTP id n7so22662483iob.0; Tue, 13 Feb 2018 12:09:40 -0800 (PST) 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=ek02G6ADi+SIr2sj798SOrLWnjKwngPkqkgPgEHoJYc=; b=RimX0GD0hWMbve0QlY3EJ6BwLK3+zZbKxFI+QnCe0uZXFzOAzNjkWC43gRMvBGDx47 9qPwC4vgtbtuG/G1rMlWkI0XTfkw075sx+gt+CfQdsmvqxTwIUtJzzIlGYr953Du+nXW O6yLEUi2SVDCslhi4korqpdKdU1BjE5Yj06GdKQxooY3E7cHEot/s47tD3Y2wtjnqxBw onQbBzZone3F80JYqnQrSqhBwaypmVJmyYP9jWnv+4Af7fr+Z5wLoVQA0BMLO5ljGp2a koQ1R5rg4U3RqZXdgRl0Wrhmh963kk7Ld0ArzchDNJOm7KV7sJJvv38UiCTYpRXFd3XJ wsSg== X-Gm-Message-State: APf1xPCuOUlANzXmIZkDtaAjtRc5rIn6vLzKKR6bEiRk4mLSYjeAL+ZU 4cWp/n2VaRz9d8brn/VGbCsn1XpU X-Google-Smtp-Source: AH8x227MalFyqFSujXMUXVEG5UYCKkvmgwbSHdFj82CD0XX9YrMEzoPGhWuoEGk6E/kxRsckpdHCbw== X-Received: by 10.107.53.22 with SMTP id c22mr2798718ioa.189.1518552574486; Tue, 13 Feb 2018 12:09:34 -0800 (PST) Received: from mail-it0-f42.google.com (mail-it0-f42.google.com. [209.85.214.42]) by smtp.gmail.com with ESMTPSA id x2sm11870804ite.10.2018.02.13.12.09.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Feb 2018 12:09:34 -0800 (PST) Received: by mail-it0-f42.google.com with SMTP id 140so4195785iti.0; Tue, 13 Feb 2018 12:09:34 -0800 (PST) X-Received: by 10.36.192.131 with SMTP id u125mr3026460itf.119.1518552573900; Tue, 13 Feb 2018 12:09:33 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.30.149 with HTTP; Tue, 13 Feb 2018 12:09:33 -0800 (PST) In-Reply-To: <1b3a489d-d62c-6f88-a269-a35ad9bf5ef5@vangyzen.net> References: <201802131917.w1DJHmso047463@repo.freebsd.org> <1518549829.85310.39.camel@freebsd.org> <1b3a489d-d62c-6f88-a269-a35ad9bf5ef5@vangyzen.net> From: Conrad Meyer Date: Tue, 13 Feb 2018 12:09:33 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r329237 - head/sys/libkern To: Eric van Gyzen 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.25 Precedence: list List-Id: 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, 13 Feb 2018 20:09:40 -0000 On Tue, Feb 13, 2018 at 11:52 AM, Eric van Gyzen wrote: > On 02/13/2018 13:43, Ed Maste wrote: >> On 13 February 2018 at 14:23, Ian Lepore wrote: >>> There are many ways to spell 0. Why are we using something other than >>> the simplest way? Is it a style rule thing, or is it portability- >>> correctness, or what? >> >> I made the change to improve consistency between lib/libc/string and >> sys/libkern, >> ... > > I prefer '\0' here because it tells the reader that it's a NUL > character, as opposed to a NULL pointer or a zero integer. Yes, the > reader should already know that, but the author can /help/ the reader by > communicating more clearly and completely. And I prefer 0, because it's easier to type and conveys exactly the same meaning. A character NUL is simply a zero integer of char type. These are standard library string manipulation routines with char pointer types. It is already extremely clear to the reader that the zeros involved are end-of-string sentinels. Best, Conrad From owner-svn-src-head@freebsd.org Tue Feb 13 20:40: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 9A209F229F5; Tue, 13 Feb 2018 20:40:27 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp003.me.com (mr11p00im-asmtp003.me.com [17.110.69.254]) (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 329906FF09; Tue, 13 Feb 2018 20:40:27 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from process-dkim-sign-daemon.mr11p00im-asmtp003.me.com by mr11p00im-asmtp003.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) id <0P4300200U98RW00@mr11p00im-asmtp003.me.com>; Tue, 13 Feb 2018 20:40:12 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=04042017; t=1518554412; bh=pRNowctWcuY/WmgRKm+yv7Cfllf7C0I+waUKQZHzC1w=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=rtLQWkIqEeaeZOl0cufp6m9R7OD3DMn7a9BWTC2wiMiKQFk1mhABU+pdm1/6dK0sP bcNo6UeYKNhwyo5YoPjJnNyFGzD5lx1AU7RBZyK86NV3OwKDPO07CQpbK/qeMkn3fb iV6MdH1C1lh30/byJSUOEt4YRqSuzNlVn3GAN7yzvDmYWpPQqwzmkrg1lWDvSE2M/z vRr0GIW1wDnuVVyDQznTPZdB0fiKZEBd4QNibwM1N9JLIp7ssQHTV17bSMXPpAxybg UuWSkf4qtOEvG0oLnU5daZFwKQ2JoYPmBCLbIKBA8EgALWzXLKVDfdYW45g8NdzImF 34mn8fT9VSvag== Received: from icloud.com ([127.0.0.1]) by mr11p00im-asmtp003.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) with ESMTPSA id <0P4300GGWW2XD010@mr11p00im-asmtp003.me.com>; Tue, 13 Feb 2018 20:40:10 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-02-13_11:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1011 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1802130245 User-Agent: Microsoft-MacOutlook/10.9.0.180116 Date: Tue, 13 Feb 2018 12:40:08 -0800 Subject: Re: svn commit: r329237 - head/sys/libkern From: Ravi Pokala To: Eric van Gyzen , Ed Maste , Ian Lepore Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: Thread-topic: svn commit: r329237 - head/sys/libkern References: <201802131917.w1DJHmso047463@repo.freebsd.org> <1518549829.85310.39.camel@freebsd.org> <1b3a489d-d62c-6f88-a269-a35ad9bf5ef5@vangyzen.net> In-reply-to: <1b3a489d-d62c-6f88-a269-a35ad9bf5ef5@vangyzen.net> 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.25 Precedence: list List-Id: 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, 13 Feb 2018 20:40:27 -0000 -----Original Message----- From: on behalf of Eric van Gyzen Date: 2018-02-13, Tuesday at 11:52 To: Ed Maste , Ian Lepore Cc: src-committers , , Subject: Re: svn commit: r329237 - head/sys/libkern > ... > > I prefer '\0' here because it tells the reader that it's a NUL > character, as opposed to a NULL pointer or a zero integer. Yes, the > reader should already know that, but the author can /help/ the reader by > communicating more clearly and completely. > > Eric Out of morbid curiosity, does any standard (or any of our non-standard headers) define a "NUL" macro for use as a manual string terminator? -Ravi (rpokala@) From owner-svn-src-head@freebsd.org Tue Feb 13 20:55: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 87F36F239FE for ; Tue, 13 Feb 2018 20:55:49 +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 08ACF70DE0 for ; Tue, 13 Feb 2018 20:55:49 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22c.google.com with SMTP id g14so16581313iob.9 for ; Tue, 13 Feb 2018 12:55:49 -0800 (PST) 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=epFvpRX+my3GnN0uqKet373QIPyUv57PikhtsSXKr7Q=; b=Hb3BEtKz5Ptz1anLkW8R9qQ6hpo9I1uBobIR9pfi/de+r62/qhGe3zw9USweeMQGNt P8dtG8S0Dira5RLcIXdc4ShKagJPFfCTmAlYulpbR4ASt7GwNhVlsiy140TlGkFOeRxX AuMYNtM7m43Wa725NwXwERQ5ra///ektpTCF/XGgr2r2hPGpaEA2faPArL1N/gxcFoy2 wermtVQgGsY+hQY+DR9T3usWQpawJMbC+u+c9e+ga/LpT04TKQXNXx7Dq494dMGoBcvh W1SlvlAUnSiWfPVSUEKLjQb4anaIIHvEWIGvZbJlaSHWRDLL69b5phnuRgMSWtDvqHiK IIaQ== 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=epFvpRX+my3GnN0uqKet373QIPyUv57PikhtsSXKr7Q=; b=tSekbxBhWViDOlv+s6t98POfnpPmISDXlGhZFxIL/jEnZcvmbew6lnTfTxPH6/g/9G h+BYd03lg1/qYw02IlFphEMFbQtzFcoGhDRNQ6wGLCHVUbaYZ2fOZeJAEzQYHSjolkgB UJ0U+fIumh24fPENE9EStTMRaAtafu/7Ko49ib/8OGNxOyg3Eia6Ehq3ryDCc9jWCpfC ZqHMgpKkBkhZNQdceW+LvKL8SlHXUi01uMVVHwcqGfqjpQYwyC6YRi1yZvH8wL25yChK 4ClBrhFRVlwENI9xcA3RUnGdLzetd3VxQVHv1T6u4LKjwkuukCG5QiVQo0pOPbP4LkW/ Is3w== X-Gm-Message-State: APf1xPCo3iyQQhH0Plx8ZpYbZj4kpEuRK8ZFNm9ck9MvM/XVhpN0+5qz 48CgAGynw9KFcIop0/X3Dap0y2WhW6Oi+wsFf1AvQg== X-Google-Smtp-Source: AH8x2246Q+9D6hjKi6KzQR4NA/wLL4613CeYq/KyThmStt3QeqH7WygfUcNXz40ehhzkgUpX9p/GQgXhsW+S4N2DEdw= X-Received: by 10.107.88.12 with SMTP id m12mr2732026iob.136.1518555348338; Tue, 13 Feb 2018 12:55:48 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Tue, 13 Feb 2018 12:55:47 -0800 (PST) X-Originating-IP: [2607:fb10:7061:7fd::663] In-Reply-To: References: <201802131917.w1DJHmso047463@repo.freebsd.org> <1518549829.85310.39.camel@freebsd.org> <1b3a489d-d62c-6f88-a269-a35ad9bf5ef5@vangyzen.net> From: Warner Losh Date: Tue, 13 Feb 2018 13:55:47 -0700 X-Google-Sender-Auth: nrE71FpvrgDUGfzD18VVqG7_nlI Message-ID: Subject: Re: svn commit: r329237 - head/sys/libkern To: Ravi Pokala Cc: Eric van Gyzen , Ed Maste , Ian Lepore , 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.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 13 Feb 2018 20:55:49 -0000 On Tue, Feb 13, 2018 at 1:40 PM, Ravi Pokala wrote: > -----Original Message----- > From: on behalf of Eric van Gyzen < > eric@vangyzen.net> > Date: 2018-02-13, Tuesday at 11:52 > To: Ed Maste , Ian Lepore > Cc: src-committers , , > > Subject: Re: svn commit: r329237 - head/sys/libkern > > > ... > > > > I prefer '\0' here because it tells the reader that it's a NUL > > character, as opposed to a NULL pointer or a zero integer. Yes, the > > reader should already know that, but the author can /help/ the reader by > > communicating more clearly and completely. > > > > Eric > > Out of morbid curiosity, does any standard (or any of our non-standard > headers) define a "NUL" macro for use as a manual string terminator? > No. There's no standard define. Warner From owner-svn-src-head@freebsd.org Tue Feb 13 21:22: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 A9DD0F01B60; Tue, 13 Feb 2018 21:22:10 +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 27C8D72546; Tue, 13 Feb 2018 21:22:10 +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 22EB426492; Tue, 13 Feb 2018 21:22:10 +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 w1DLMAE8013245; Tue, 13 Feb 2018 21:22:10 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DLMAbq013244; Tue, 13 Feb 2018 21:22:10 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802132122.w1DLMAbq013244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 13 Feb 2018 21:22:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329244 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 329244 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 13 Feb 2018 21:22:10 -0000 Author: emaste Date: Tue Feb 13 21:22:09 2018 New Revision: 329244 URL: https://svnweb.freebsd.org/changeset/base/329244 Log: Document DECLARE_MODULE_TIED It was introduced in r213716. Reviewed by: kib Sponsored by: The FreeBSD Foundation Modified: head/share/man/man9/DECLARE_MODULE.9 Modified: head/share/man/man9/DECLARE_MODULE.9 ============================================================================== --- head/share/man/man9/DECLARE_MODULE.9 Tue Feb 13 21:14:27 2018 (r329243) +++ head/share/man/man9/DECLARE_MODULE.9 Tue Feb 13 21:22:09 2018 (r329244) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 6, 2005 +.Dd February 13, 2018 .Dt DECLARE_MODULE 9 .Os .Sh NAME @@ -39,6 +39,7 @@ .In sys/kernel.h .In sys/module.h .Fn DECLARE_MODULE "name" "moduledata_t data" "sub" "order" +.Fn DECLARE_MODULE_TIED "name" "moduledata_t data" "sub" "order" .Sh DESCRIPTION The .Fn DECLARE_MODULE @@ -55,7 +56,17 @@ and Of course, it can also be called directly, for example in order to implement dynamic sysctls. .Pp -The arguments it expects are: +A module declared with +.Fn DECLARE_MODULE_TIED +will load only if the running kernel version +(as specified by +.Dv __FreeBSD_version ) +is identical to that on which it was built. +This declaration should be used by modules which depend on interfaces beyond +the stable kernel KBI (such as ABI emulators or hypervisors that rely on +internal kernel structures). +.Pp +The arguments are: .Bl -tag -width indent .It Fa name The module name, which will be used in the From owner-svn-src-head@freebsd.org Tue Feb 13 21:33: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 6149CF0291E; Tue, 13 Feb 2018 21:33: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 14B1B72DCD; Tue, 13 Feb 2018 21:33: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 0F96A26645; Tue, 13 Feb 2018 21:33:41 +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 w1DLXexs019115; Tue, 13 Feb 2018 21:33:40 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DLXe7o019114; Tue, 13 Feb 2018 21:33:40 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802132133.w1DLXe7o019114@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 13 Feb 2018 21:33:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329245 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 329245 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 13 Feb 2018 21:33:41 -0000 Author: emaste Date: Tue Feb 13 21:33:40 2018 New Revision: 329245 URL: https://svnweb.freebsd.org/changeset/base/329245 Log: Add DECLARE_MODULE_TIED mlink missed in r329244 Reported by: imp Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Tue Feb 13 21:22:09 2018 (r329244) +++ head/share/man/man9/Makefile Tue Feb 13 21:33:40 2018 (r329245) @@ -858,6 +858,7 @@ MLINKS+=crypto.9 crypto_dispatch.9 \ crypto.9 crypto_unregister_all.9 MLINKS+=DB_COMMAND.9 DB_SHOW_ALL_COMMAND.9 \ DB_COMMAND.9 DB_SHOW_COMMAND.9 +MLINKS+=DECLARE_MODULE.9 DECLARE_MODULE_TIED.9 MLINKS+=dev_clone.9 drain_dev_clone_events.9 MLINKS+=devfs_set_cdevpriv.9 devfs_clear_cdevpriv.9 \ devfs_set_cdevpriv.9 devfs_get_cdevpriv.9 From owner-svn-src-head@freebsd.org Tue Feb 13 22:52: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 0D27FF08716 for ; Tue, 13 Feb 2018 22:52:00 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from cat.pear.relay.mailchannels.net (cat.pear.relay.mailchannels.net [23.83.216.31]) (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 A9EA676D4A for ; Tue, 13 Feb 2018 22:51:57 +0000 (UTC) (envelope-from ian@freebsd.org) X-Sender-Id: _forwarded-from|67.177.211.60 Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 69AEC561D66 for ; Tue, 13 Feb 2018 19:23:58 +0000 (UTC) Received: from outbound1a.eu.mailhop.org (unknown [100.96.14.37]) (Authenticated sender: duocircle) by relay.mailchannels.net (Postfix) with ESMTPA id D0134561E96 for ; Tue, 13 Feb 2018 19:23:57 +0000 (UTC) X-Sender-Id: _forwarded-from|67.177.211.60 Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [172.18.55.125]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.13.1); Tue, 13 Feb 2018 19:23:58 +0000 X-MC-Relay: Forwarding X-MailChannels-SenderId: _forwarded-from|67.177.211.60 X-MailChannels-Auth-Id: duocircle X-Industry-Abiding: 46e7a8a1126a375e_1518549838223_340674831 X-MC-Loop-Signature: 1518549838223:245235672 X-MC-Ingress-Time: 1518549838223 X-MHO-User: 6c4d0a7e-10f3-11e8-91c6-33ffc249f3e8 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 outbound1.eu.mailhop.org (Halon) with ESMTPSA id 6c4d0a7e-10f3-11e8-91c6-33ffc249f3e8; Tue, 13 Feb 2018 19:23:52 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w1DJNn2L038434; Tue, 13 Feb 2018 12:23:49 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1518549829.85310.39.camel@freebsd.org> Subject: Re: svn commit: r329237 - head/sys/libkern From: Ian Lepore To: Ed Maste , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 13 Feb 2018 12:23:49 -0700 In-Reply-To: <201802131917.w1DJHmso047463@repo.freebsd.org> References: <201802131917.w1DJHmso047463@repo.freebsd.org> 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.25 Precedence: list List-Id: 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, 13 Feb 2018 22:52:00 -0000 On Tue, 2018-02-13 at 19:17 +0000, Ed Maste wrote: > Author: emaste > Date: Tue Feb 13 19:17:48 2018 > New Revision: 329237 > URL: https://svnweb.freebsd.org/changeset/base/329237 > > Log: >   libkern: use nul for terminating char rather than 0 >    >   Akin to the change made in r188080 for lib/libc/string/. >    >   Reported by: bde >   Sponsored by: The FreeBSD Foundation There are many ways to spell 0.  Why are we using something other than the simplest way?  Is it a style rule thing, or is it portability- correctness, or what? -- Ian From owner-svn-src-head@freebsd.org Wed Feb 14 00:12: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 CDB35F0E543; Wed, 14 Feb 2018 00:12: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 7CBB679E90; Wed, 14 Feb 2018 00:12: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 77A8961; Wed, 14 Feb 2018 00:12:03 +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 w1E0C3MQ099338; Wed, 14 Feb 2018 00:12:03 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1E0C3ma099337; Wed, 14 Feb 2018 00:12:03 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802140012.w1E0C3ma099337@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 14 Feb 2018 00:12:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329251 - head/sys/kgssapi X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/kgssapi X-SVN-Commit-Revision: 329251 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 14 Feb 2018 00:12:04 -0000 Author: cem Date: Wed Feb 14 00:12:03 2018 New Revision: 329251 URL: https://svnweb.freebsd.org/changeset/base/329251 Log: kgssapi: Remove trivial deadcode CID: 1385956 Reported by: Coverity Sponsored by: Dell EMC Isilon Modified: head/sys/kgssapi/gss_impl.c Modified: head/sys/kgssapi/gss_impl.c ============================================================================== --- head/sys/kgssapi/gss_impl.c Tue Feb 13 22:46:06 2018 (r329250) +++ head/sys/kgssapi/gss_impl.c Wed Feb 14 00:12:03 2018 (r329251) @@ -287,8 +287,6 @@ kgssapi_modevent(module_t mod, int type, void *data) switch (type) { case MOD_LOAD: - if (error != 0) - return (error); rpc_gss_entries.rpc_gss_refresh_auth = rpc_gss_refresh_auth; rpc_gss_entries.rpc_gss_secfind = rpc_gss_secfind; rpc_gss_entries.rpc_gss_secpurge = rpc_gss_secpurge; From owner-svn-src-head@freebsd.org Wed Feb 14 00:25: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 E88E9F0F50A; Wed, 14 Feb 2018 00:25: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 9F09A7A5FD; Wed, 14 Feb 2018 00:25:18 +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 99F88268; Wed, 14 Feb 2018 00:25:18 +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 w1E0PIKv004314; Wed, 14 Feb 2018 00:25:18 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1E0PIvc004313; Wed, 14 Feb 2018 00:25:18 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201802140025.w1E0PIvc004313@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 14 Feb 2018 00:25:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329252 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 329252 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 14 Feb 2018 00:25:19 -0000 Author: kib Date: Wed Feb 14 00:25:18 2018 New Revision: 329252 URL: https://svnweb.freebsd.org/changeset/base/329252 Log: Do not call pmap_enter() with invalid protection mode. If the map entry elookup was performed due to the mapping changes, we need to ensure that there is still some access permission bit requested which is compatible with the current vm_map_entry mode. If not, restart the handler from scratch instead of trying to save the current progress. Also adjust fault_type to not include cleared permission bits. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D14347 Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Wed Feb 14 00:12:03 2018 (r329251) +++ head/sys/vm/vm_fault.c Wed Feb 14 00:25:18 2018 (r329252) @@ -1219,6 +1219,12 @@ readrest: * write-enabled after all. */ prot &= retry_prot; + fault_type &= retry_prot; + if (prot == 0) { + release_page(&fs); + unlock_and_deallocate(&fs); + goto RetryFault; + } } } From owner-svn-src-head@freebsd.org Wed Feb 14 00:31: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 8D784F0FE2A; Wed, 14 Feb 2018 00:31:46 +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 210727ACAE; Wed, 14 Feb 2018 00:31:46 +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 E277A2EE; Wed, 14 Feb 2018 00:31:45 +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 w1E0VjfR009350; Wed, 14 Feb 2018 00:31:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1E0Vj4w009349; Wed, 14 Feb 2018 00:31:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201802140031.w1E0Vj4w009349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 14 Feb 2018 00:31:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329254 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 329254 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 14 Feb 2018 00:31:46 -0000 Author: kib Date: Wed Feb 14 00:31:45 2018 New Revision: 329254 URL: https://svnweb.freebsd.org/changeset/base/329254 Log: Ensure memory consistency on COW. From the submitter description: The process is forked transitioning a map entry to COW Thread A writes to a page on the map entry, faults, updates the pmap to writable at a new phys addr, and starts TLB invalidations... Thread B acquires a lock, writes to a location on the new phys addr, and releases the lock Thread C acquires the lock, reads from the location on the old phys addr... Thread A ...continues the TLB invalidations which are completed Thread C ...reads from the location on the new phys addr, and releases the lock In this example Thread B and C [lock, use and unlock] properly and neither own the lock at the same time. Thread A was writing somewhere else on the page and so never had/needed the lock. Thread C sees a location that is only ever read|modified under a lock change beneath it while it is the lock owner. To fix this, perform the two-stage update of the copied PTE. First, the PTE is updated with the address of the new physical page with copied content, but in read-only mode. The pmap locking and the page busy state during PTE update and TLB invalidation IPIs ensure that any writer to the page cannot upgrade the PTE to the writable state until all CPUs updated their TLB to not cache old mapping. Then, after the busy state of the page is lifted, the faults for write can proceed and do not violate the consistency of the reads. The change is done in vm_fault because most architectures do need IPIs to invalidate remote TLBs. More, I think that hardware guarantees of atomicity of the remote TLB invalidation are not enough to prevent the inconsistent reads of non-atomic reads, like multi-word accesses protected by a lock. So instead of modifying each pmap invalidation code, I did it there. Discovered and analyzed by: Elliott.Rabe@dell.com Reviewed by: markj PR: 225584 (appeared to have the same cause) Tested by: Elliott.Rabe@dell.com, emaste, Mike Tancsa , truckman Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D14347 Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Wed Feb 14 00:31:37 2018 (r329253) +++ head/sys/vm/vm_fault.c Wed Feb 14 00:31:45 2018 (r329254) @@ -1135,6 +1135,10 @@ readrest: */ pmap_copy_page(fs.m, fs.first_m); fs.first_m->valid = VM_PAGE_BITS_ALL; + if ((fault_flags & VM_FAULT_WIRE) == 0) { + prot &= ~VM_PROT_WRITE; + fault_type &= ~VM_PROT_WRITE; + } if (wired && (fault_flags & VM_FAULT_WIRE) == 0) { vm_page_lock(fs.first_m); From owner-svn-src-head@freebsd.org Wed Feb 14 00:34: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 A8265F1035B; Wed, 14 Feb 2018 00:34:02 +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 7D9E17B243; Wed, 14 Feb 2018 00:34:02 +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 5F3BA42C; Wed, 14 Feb 2018 00:34:02 +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 w1E0Y2tf009579; Wed, 14 Feb 2018 00:34:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1E0Y2c3009578; Wed, 14 Feb 2018 00:34:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201802140034.w1E0Y2c3009578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 14 Feb 2018 00:34:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329256 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 329256 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 14 Feb 2018 00:34:02 -0000 Author: kib Date: Wed Feb 14 00:34:02 2018 New Revision: 329256 URL: https://svnweb.freebsd.org/changeset/base/329256 Log: Cleanup unused page argument for vm_reserv_break(). Reviewed by: markj MFC after: 1 week Differential revision: https://reviews.freebsd.org/D14364 Modified: head/sys/vm/vm_reserv.c Modified: head/sys/vm/vm_reserv.c ============================================================================== --- head/sys/vm/vm_reserv.c Wed Feb 14 00:32:19 2018 (r329255) +++ head/sys/vm/vm_reserv.c Wed Feb 14 00:34:02 2018 (r329256) @@ -259,7 +259,7 @@ struct mtx_padalign vm_reserv_object_mtx[VM_RESERV_OBJ #define vm_reserv_object_unlock(object) \ mtx_unlock(vm_reserv_object_lock_ptr((object))) -static void vm_reserv_break(vm_reserv_t rv, vm_page_t m); +static void vm_reserv_break(vm_reserv_t rv); static void vm_reserv_depopulate(vm_reserv_t rv, int index); static vm_reserv_t vm_reserv_from_page(vm_page_t m); static boolean_t vm_reserv_has_pindex(vm_reserv_t rv, @@ -934,34 +934,21 @@ vm_reserv_alloc_page(vm_object_t object, vm_pindex_t p } /* - * Breaks the given reservation. Except for the specified free page, all free - * pages in the reservation are returned to the physical memory allocator. - * The reservation's population count and map are reset to their initial - * state. + * Breaks the given reservation. All free pages in the reservation + * are returned to the physical memory allocator. The reservation's + * population count and map are reset to their initial state. * * The given reservation must not be in the partially populated reservation * queue. The free page queue lock must be held. */ static void -vm_reserv_break(vm_reserv_t rv, vm_page_t m) +vm_reserv_break(vm_reserv_t rv) { int begin_zeroes, hi, i, lo; vm_domain_free_assert_locked(VM_DOMAIN(rv->domain)); vm_reserv_remove(rv); rv->pages->psind = 0; - if (m != NULL) { - /* - * Since the reservation is being broken, there is no harm in - * abusing the population map to stop "m" from being returned - * to the physical memory allocator. - */ - i = m - rv->pages; - KASSERT(popmap_is_clear(rv->popmap, i), - ("vm_reserv_break: reserv %p's popmap is corrupted", rv)); - popmap_set(rv->popmap, i); - rv->popcnt++; - } i = hi = 0; do { /* Find the next 0 bit. Any previous 0 bits are < "hi". */ @@ -1039,7 +1026,7 @@ vm_reserv_break_all(vm_object_t object) TAILQ_REMOVE(&vm_rvq_partpop[rv->domain], rv, partpopq); rv->inpartpopq = FALSE; } - vm_reserv_break(rv, NULL); + vm_reserv_break(rv); } if (vmd != NULL) vm_domain_free_unlock(vmd); @@ -1156,7 +1143,7 @@ vm_reserv_reclaim(vm_reserv_t rv) rv, rv->domain)); TAILQ_REMOVE(&vm_rvq_partpop[rv->domain], rv, partpopq); rv->inpartpopq = FALSE; - vm_reserv_break(rv, NULL); + vm_reserv_break(rv); vm_reserv_reclaimed++; } From owner-svn-src-head@freebsd.org Wed Feb 14 02:48: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 C0FE2F1A6E6; Wed, 14 Feb 2018 02:48:27 +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 6C4C87F7E9; Wed, 14 Feb 2018 02:48:27 +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 6420A194F; Wed, 14 Feb 2018 02:48:27 +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 w1E2mRvT073532; Wed, 14 Feb 2018 02:48:27 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1E2mRQ9073531; Wed, 14 Feb 2018 02:48:27 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201802140248.w1E2mRQ9073531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 14 Feb 2018 02:48:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329257 - head/sys/powerpc/pseries X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/pseries X-SVN-Commit-Revision: 329257 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 14 Feb 2018 02:48:27 -0000 Author: jhibbits Date: Wed Feb 14 02:48:27 2018 New Revision: 329257 URL: https://svnweb.freebsd.org/changeset/base/329257 Log: powerpc64/pseries: Define new hcalls Summary: Define new hcalls as in 'Linux on Power Architecture Platform Reference' version 1.1 (24 March 2016) downloaded from: https://members.openpowerfoundation.org/document/dl/469 Submitted by: Breno Leitao Differential Revision: https://reviews.freebsd.org/D14281 Modified: head/sys/powerpc/pseries/phyp-hvcall.h Modified: head/sys/powerpc/pseries/phyp-hvcall.h ============================================================================== --- head/sys/powerpc/pseries/phyp-hvcall.h Wed Feb 14 00:34:02 2018 (r329256) +++ head/sys/powerpc/pseries/phyp-hvcall.h Wed Feb 14 02:48:27 2018 (r329257) @@ -296,7 +296,25 @@ #define H_VPM_STAT 0x2bc #define H_SET_MPP 0x2d0 #define H_GET_MPP 0x2d4 -#define MAX_HCALL_OPCODE H_GET_MPP +#define H_MO_PERF 0x2d8 +#define H_REG_SUB_CRQ 0x2dc +#define H_FREE_SUB_CRQ 0x2e0 +#define H_SEND_SUB_CRQ 0x2e4 +#define H_SEND_SUB_CRQ_IND 0x2e8 +#define H_HOME_NODE_ASSOC 0x2ec +/* Reserved ... */ +#define H_BEST_ENERGY 0x2f4 +#define H_REG_SNS 0x2f8 +#define H_X_XIRR 0x2fc +#define H_RANDOM 0x300 +/* Reserved ... */ +#define H_COP_OP 0x304 +#define H_STOP_COP_OP 0x308 +#define H_GET_MPP_X 0x314 +#define H_SET_MODE 0x31C +/* Reserved ... */ +#define H_GET_DMA_XLATES_L 0x324 +#define MAX_HCALL_OPCODE H_GET_DMA_XLATES_L int64_t phyp_hcall(uint64_t opcode, ...); int64_t phyp_pft_hcall(uint64_t opcode, uint64_t flags, uint64_t pteidx, From owner-svn-src-head@freebsd.org Wed Feb 14 02:51: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 A1ECDF1AA8A; Wed, 14 Feb 2018 02:51:28 +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 557307FB88; Wed, 14 Feb 2018 02:51:28 +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 5081919AD; Wed, 14 Feb 2018 02:51:28 +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 w1E2pSpW074476; Wed, 14 Feb 2018 02:51:28 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1E2pSoA074475; Wed, 14 Feb 2018 02:51:28 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201802140251.w1E2pSoA074475@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 14 Feb 2018 02:51:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329258 - head/sys/powerpc/pseries X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/pseries X-SVN-Commit-Revision: 329258 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 14 Feb 2018 02:51:28 -0000 Author: jhibbits Date: Wed Feb 14 02:51:28 2018 New Revision: 329258 URL: https://svnweb.freebsd.org/changeset/base/329258 Log: PPC64: Get the timestap from the proper OF field Summary: After revision rS328534('PPC64: use hwref instead of cpuid'), FreeBSD on powerpc64 virtual machine panics since it is unable to read the timebase, showing the following error: get-property for timebase-frequency on zero phandle panic: Unable to determine timebase frequency! With the change above, cpuref->cr_hwref does not contain the phandle anymore, thus, it never reads the proper CPU entry in OF. Submitted by: Breno Leitao Differential Revision: https://reviews.freebsd.org/D14204 Modified: head/sys/powerpc/pseries/platform_chrp.c Modified: head/sys/powerpc/pseries/platform_chrp.c ============================================================================== --- head/sys/powerpc/pseries/platform_chrp.c Wed Feb 14 02:48:27 2018 (r329257) +++ head/sys/powerpc/pseries/platform_chrp.c Wed Feb 14 02:51:28 2018 (r329258) @@ -285,12 +285,24 @@ chrp_real_maxaddr(platform_t plat) static u_long chrp_timebase_freq(platform_t plat, struct cpuref *cpuref) { - phandle_t phandle; + phandle_t cpus, cpunode; int32_t ticks = -1; + int res; + char buf[8]; - phandle = cpuref->cr_hwref; + cpus = OF_finddevice("/cpus"); + if (cpus <= 0) + panic("CPU tree not found on Open Firmware\n"); - OF_getencprop(phandle, "timebase-frequency", &ticks, sizeof(ticks)); + for (cpunode = OF_child(cpus); cpunode != 0; cpunode = OF_peer(cpunode)) { + res = OF_getprop(cpunode, "device_type", buf, sizeof(buf)); + if (res > 0 && strcmp(buf, "cpu") == 0) + break; + } + if (cpunode <= 0) + panic("CPU node not found on Open Firmware\n"); + + OF_getencprop(cpunode, "timebase-frequency", &ticks, sizeof(ticks)); if (ticks <= 0) panic("Unable to determine timebase frequency!"); From owner-svn-src-head@freebsd.org Wed Feb 14 04:11: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 A31F2F20702; Wed, 14 Feb 2018 04:11:33 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (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 385FA826A3; Wed, 14 Feb 2018 04:11:33 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net (cpe-75-82-218-62.socal.res.rr.com [75.82.218.62]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id w1E4BSap011739 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Tue, 13 Feb 2018 20:11:29 -0800 Subject: Re: svn commit: r329257 - head/sys/powerpc/pseries To: Justin Hibbits , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201802140248.w1E2mRQ9073531@repo.freebsd.org> From: Nathan Whitehorn Message-ID: Date: Tue, 13 Feb 2018 20:11:28 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <201802140248.w1E2mRQ9073531@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Sonic-CAuth: UmFuZG9tSVbsKgPEspO6ST0hQgP9oqQqwBYMhUZVpLS+AyjOHwC4NrptfkzqWjRcDp4MOIbpdW1rtAEWxjM2D6wujY0Zx+9w3KDd0Esn8Yw= X-Sonic-ID: C;xIFgIT0R6BGz91DNXaHR5A== M;nuwLIj0R6BGz91DNXaHR5A== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 14 Feb 2018 04:11:33 -0000 There is another set of these that Linux added recently that are used for Meltdown/Spectre workarounds. Might be worth importing while these are being updated... -Nathan On 02/13/18 18:48, Justin Hibbits wrote: > Author: jhibbits > Date: Wed Feb 14 02:48:27 2018 > New Revision: 329257 > URL: https://svnweb.freebsd.org/changeset/base/329257 > > Log: > powerpc64/pseries: Define new hcalls > > Summary: > Define new hcalls as in 'Linux on Power Architecture Platform Reference' > version 1.1 (24 March 2016) downloaded from: > > https://members.openpowerfoundation.org/document/dl/469 > > Submitted by: Breno Leitao > Differential Revision: https://reviews.freebsd.org/D14281 > > Modified: > head/sys/powerpc/pseries/phyp-hvcall.h > > Modified: head/sys/powerpc/pseries/phyp-hvcall.h > ============================================================================== > --- head/sys/powerpc/pseries/phyp-hvcall.h Wed Feb 14 00:34:02 2018 (r329256) > +++ head/sys/powerpc/pseries/phyp-hvcall.h Wed Feb 14 02:48:27 2018 (r329257) > @@ -296,7 +296,25 @@ > #define H_VPM_STAT 0x2bc > #define H_SET_MPP 0x2d0 > #define H_GET_MPP 0x2d4 > -#define MAX_HCALL_OPCODE H_GET_MPP > +#define H_MO_PERF 0x2d8 > +#define H_REG_SUB_CRQ 0x2dc > +#define H_FREE_SUB_CRQ 0x2e0 > +#define H_SEND_SUB_CRQ 0x2e4 > +#define H_SEND_SUB_CRQ_IND 0x2e8 > +#define H_HOME_NODE_ASSOC 0x2ec > +/* Reserved ... */ > +#define H_BEST_ENERGY 0x2f4 > +#define H_REG_SNS 0x2f8 > +#define H_X_XIRR 0x2fc > +#define H_RANDOM 0x300 > +/* Reserved ... */ > +#define H_COP_OP 0x304 > +#define H_STOP_COP_OP 0x308 > +#define H_GET_MPP_X 0x314 > +#define H_SET_MODE 0x31C > +/* Reserved ... */ > +#define H_GET_DMA_XLATES_L 0x324 > +#define MAX_HCALL_OPCODE H_GET_DMA_XLATES_L > > int64_t phyp_hcall(uint64_t opcode, ...); > int64_t phyp_pft_hcall(uint64_t opcode, uint64_t flags, uint64_t pteidx, > From owner-svn-src-head@freebsd.org Wed Feb 14 05:20: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 7CD21F00FFD; Wed, 14 Feb 2018 05:20:30 +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 EAE148473C; Wed, 14 Feb 2018 05:20:29 +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 F3D293C5F4C; Wed, 14 Feb 2018 16:20:21 +1100 (AEDT) Date: Wed, 14 Feb 2018 16:20:21 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore cc: Ed Maste , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329237 - head/sys/libkern In-Reply-To: <1518551679.72050.4.camel@freebsd.org> Message-ID: <20180214160048.E1450@besplex.bde.org> References: <201802131917.w1DJHmso047463@repo.freebsd.org> <1518549829.85310.39.camel@freebsd.org> <1518551679.72050.4.camel@freebsd.org> MIME-Version: 1.0 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=nlC_4_pT8q9DhB4Ho9EA:9 a=6I5d2MoRAAAA:8 a=j84lBZEu4_Iwgp79yk0A:9 a=45ClL6m2LaAA:10 a=IjZwj45LgO3ly-622nXo:22 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 14 Feb 2018 05:20:30 -0000 On Tue, 13 Feb 2018, Ian Lepore wrote: > On Tue, 2018-02-13 at 14:43 -0500, Ed Maste wrote: >> On 13 February 2018 at 14:23, Ian Lepore wrote: >>> >>> On Tue, 2018-02-13 at 19:17 +0000, Ed Maste wrote: >>>> >>>> Author: emaste >>>> Date: Tue Feb 13 19:17:48 2018 >>>> New Revision: 329237 >>>> URL: https://svnweb.freebsd.org/changeset/base/329237 >>>> >>>> Log: >>>> =A0 libkern: use nul for terminating char rather than 0 >>>> >>>> =A0 Akin to the change made in r188080 for lib/libc/string/. >>>> >>>> =A0 Reported by:=A0=A0=A0=A0=A0=A0=A0=A0bde >>>> =A0 Sponsored by:=A0=A0=A0=A0=A0=A0=A0The FreeBSD Foundation >>> There are many ways to spell 0.=A0=A0Why are we using something other >>> than >>> the simplest way?=A0=A0Is it a style rule thing, or is it portability- >>> correctness, or what? style(9) requires '\0' (by always spelling the character constant with value 0 like that). >> I made the change to improve consistency between lib/libc/string and >> sys/libkern, which is what Bruce commented on some time ago. I don't >> have a personal preference for 0 or '\0' but definitely believe that >> if we have multiple, similar copies of a function they ought to avoid >> gratuitous differences. (I'm happy to change both trees to 0 if >> that's >> preferred.) Core parts of libc like stdio and (MI) string use '\0' fairly consistently. There were about 10-20 plain 0's in string in FreeBSD-5, but most of these have been changed to '\0'. This gives a much larger set of examples of normal style. > Oh, I agree completely about consistancy being important. =A0I just > wanted to know whether I should try to remember to always use \0 > because it's a rule or has some benefit I didn't know about. > > 20+ years ago I used to slavishly ensure I always used \0 when a char > type was involved, just as a personal style thing. =A0Then over time I > came to the conclusion that "0 is 0 no matter how you spell it, so keep > it simple" (except for pointers... even in c++ I've always used NULL). Probably the BSD style rule has the same origin. Bruce From owner-svn-src-head@freebsd.org Wed Feb 14 07:59: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 32341F09902; Wed, 14 Feb 2018 07:59:31 +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 D278F697F9; Wed, 14 Feb 2018 07:59:30 +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 CCF725021; Wed, 14 Feb 2018 07:59:30 +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 w1E7xU9m027315; Wed, 14 Feb 2018 07:59:30 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1E7xUCH027314; Wed, 14 Feb 2018 07:59:30 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201802140759.w1E7xUCH027314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Wed, 14 Feb 2018 07:59:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329259 - head/lib/msun/src X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/lib/msun/src X-SVN-Commit-Revision: 329259 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 14 Feb 2018 07:59:31 -0000 Author: eadler Date: Wed Feb 14 07:59:30 2018 New Revision: 329259 URL: https://svnweb.freebsd.org/changeset/base/329259 Log: msun: signed overflow in atan2 As a component of atan2(y, x), the case of x == 1.0 is farmed out to atan(y). The current implementation of this comparison is vulnerable to signed integer underflow (that is, undefined behavior), and it's performed in a somewhat more complicated way than it need be. Change it to not be quite so cute, rather directly comparing the high/low bits of x to the specific IEEE-754 bit pattern that encodes 1.0. Note that while there are three different e_atan* files in the relevant directory, only this one needs fixing. e_atan2f.c already compares against the full bit pattern encoding 1.0f, while e_atan2l.cuses bitwise-ands/ors/nots and so doesn't require a change. Closes #130 Submitted by: Jeff Walden (@jswalden github PR #130) Reviewed by: bde MFC After: 1 month Modified: head/lib/msun/src/e_atan2.c Modified: head/lib/msun/src/e_atan2.c ============================================================================== --- head/lib/msun/src/e_atan2.c Wed Feb 14 02:51:28 2018 (r329258) +++ head/lib/msun/src/e_atan2.c Wed Feb 14 07:59:30 2018 (r329259) @@ -71,7 +71,7 @@ __ieee754_atan2(double y, double x) if(((ix|((lx|-lx)>>31))>0x7ff00000)|| ((iy|((ly|-ly)>>31))>0x7ff00000)) /* x or y is NaN */ return x+y; - if((hx-0x3ff00000|lx)==0) return atan(y); /* x=1.0 */ + if(hx==0x3ff00000&&lx==0) return atan(y); /* x=1.0 */ m = ((hy>>31)&1)|((hx>>30)&2); /* 2*sign(x)+sign(y) */ /* when y = 0 */ From owner-svn-src-head@freebsd.org Wed Feb 14 15:12: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 16225F06011; Wed, 14 Feb 2018 15:12:10 +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 C08AA7CDC7; Wed, 14 Feb 2018 15:12:09 +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 BB84C117CC; Wed, 14 Feb 2018 15:12:09 +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 w1EFC9EO049591; Wed, 14 Feb 2018 15:12:09 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1EFC9f1049589; Wed, 14 Feb 2018 15:12:09 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201802141512.w1EFC9f1049589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 14 Feb 2018 15:12:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329262 - head/sys/geom/part X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/geom/part X-SVN-Commit-Revision: 329262 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 14 Feb 2018 15:12:10 -0000 Author: jhibbits Date: Wed Feb 14 15:12:09 2018 New Revision: 329262 URL: https://svnweb.freebsd.org/changeset/base/329262 Log: Fix a panic introduced in r329225 Some GEOM partition tables may be destroyed with incomplete partition entries. Guard against this with NULL checks. Reported by: pholm,others Reviewed by: markj Tested by: pholm Modified: head/sys/geom/part/g_part.c Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Wed Feb 14 14:29:11 2018 (r329261) +++ head/sys/geom/part/g_part.c Wed Feb 14 15:12:09 2018 (r329262) @@ -1549,9 +1549,11 @@ g_part_wither(struct g_geom *gp, int error) while ((entry = LIST_FIRST(&table->gpt_entry)) != NULL) { LIST_REMOVE(entry, gpe_entry); pp = entry->gpe_pp; - entry->gpe_pp->private = NULL; entry->gpe_pp = NULL; - g_wither_provider(pp, error); + if (pp != NULL) { + pp->private = NULL; + g_wither_provider(pp, error); + } g_free(entry); } G_PART_DESTROY(table, NULL); From owner-svn-src-head@freebsd.org Wed Feb 14 15:40: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 0582CF086D9; Wed, 14 Feb 2018 15:40:14 +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 AF5597E67F; Wed, 14 Feb 2018 15:40:13 +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 AA4CD11B47; Wed, 14 Feb 2018 15:40:13 +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 w1EFeDFq059618; Wed, 14 Feb 2018 15:40:13 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1EFeDD6059615; Wed, 14 Feb 2018 15:40:13 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802141540.w1EFeDD6059615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 14 Feb 2018 15:40:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329264 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 329264 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 14 Feb 2018 15:40:14 -0000 Author: kevans Date: Wed Feb 14 15:40:13 2018 New Revision: 329264 URL: https://svnweb.freebsd.org/changeset/base/329264 Log: libsa: Fix IP recv timeout readip() doesn't, at the moment, properly indicate to callers that it has timed out. One can tell that it's timed out if errno == EAGAIN when it returns, but this is not ideal. Restructure it a little bit to explicitly set errno to ETIMEDOUT if we've exhausted tleft. I found two places that care about where it timed out or not: sendrecv in net.c and sendrecv_tftp. Both are structured to pass smaller timeout values to readip while tracking a larger timeout. Neither of them were able to do this properly with readip not indicating ETIMEDOUT, so fix it. While here, straighten out the time (t/t1) usage in sendrecv_tftp. This would have manifested itself in periodic failures to NFS/TFTP boot for no apparent reason because MINTMO/MAXTMO were not actually being respected properly. Problems were not reported with NFS, only TFTP. Reported by: sbruno Reviewed by: sbruno, tsoome MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D14350 Modified: head/stand/libsa/ip.c head/stand/libsa/net.c head/stand/libsa/tftp.c Modified: head/stand/libsa/ip.c ============================================================================== --- head/stand/libsa/ip.c Wed Feb 14 15:14:20 2018 (r329263) +++ head/stand/libsa/ip.c Wed Feb 14 15:40:13 2018 (r329264) @@ -416,8 +416,13 @@ readip(struct iodesc *d, void **pkt, void **payload, t while ((getsecs() - t) < tleft) { errno = 0; ret = readipv4(d, pkt, payload, tleft, proto); + if (ret >= 0) + return (ret); + /* Bubble up the error if it wasn't successful */ if (errno != EAGAIN) - break; + return (-1); } - return (ret); + /* We've exhausted tleft; timeout */ + errno = ETIMEDOUT; + return (-1); } Modified: head/stand/libsa/net.c ============================================================================== --- head/stand/libsa/net.c Wed Feb 14 15:14:20 2018 (r329263) +++ head/stand/libsa/net.c Wed Feb 14 15:40:13 2018 (r329264) @@ -118,7 +118,7 @@ sendrecv(struct iodesc *d, /* Try to get a packet and process it. */ cc = (*rproc)(d, pkt, payload, tleft); /* Return on data, EOF or real error. */ - if (cc != -1 || errno != 0) + if (cc != -1 || (errno != 0 && errno != ETIMEDOUT)) return (cc); /* Timed out or didn't get the packet we're waiting for */ Modified: head/stand/libsa/tftp.c ============================================================================== --- head/stand/libsa/tftp.c Wed Feb 14 15:14:20 2018 (r329263) +++ head/stand/libsa/tftp.c Wed Feb 14 15:40:13 2018 (r329264) @@ -638,14 +638,20 @@ sendrecv_tftp(struct tftp_handle *h, if (cc == -1) { /* Error on transmit; wait before retrying */ while ((getsecs() - t1) < tleft); + t1 = getsecs(); continue; } + t = t1 = getsecs(); recvnext: + if ((getsecs() - t) > MAXTMO) { + errno = ETIMEDOUT; + return -1; + } /* Try to get a packet and process it. */ cc = (*rproc)(h, pkt, payload, tleft, rtype); /* Return on data, EOF or real error. */ - if (cc != -1 || errno != 0) + if (cc != -1 || (errno != 0 && errno != ETIMEDOUT)) return (cc); if ((getsecs() - t1) < tleft) { goto recvnext; From owner-svn-src-head@freebsd.org Wed Feb 14 15:49: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 093B0F09215; Wed, 14 Feb 2018 15:49: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 AE77E7ED9D; Wed, 14 Feb 2018 15:49:31 +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 A980711CE4; Wed, 14 Feb 2018 15:49:31 +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 w1EFnVoJ064849; Wed, 14 Feb 2018 15:49:31 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1EFnVBV064848; Wed, 14 Feb 2018 15:49:31 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201802141549.w1EFnVBV064848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 14 Feb 2018 15:49:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329265 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 329265 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 14 Feb 2018 15:49:32 -0000 Author: asomers Date: Wed Feb 14 15:49:31 2018 New Revision: 329265 URL: https://svnweb.freebsd.org/changeset/base/329265 Log: Implement .vop_pathconf and .vop_getacl for the .zfs ctldir zfsctl_common_pathconf will report all the same variables that regular ZFS volumes report. zfsctl_common_getacl will report an ACL equivalent to 555, except that you can't read xattrs or edit attributes. Fixes a bug where "ls .zfs" will occasionally print something like: ls: .zfs/.: Operation not supported PR: 225793 Reviewed by: avg MFC after: 3 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D14365 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Wed Feb 14 15:40:13 2018 (r329264) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Wed Feb 14 15:49:31 2018 (r329265) @@ -80,6 +80,10 @@ #include "zfs_namecheck.h" +/* Common access mode for all virtual directories under the ctldir */ +const u_short zfsctl_ctldir_mode = S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | + S_IROTH | S_IXOTH; + /* * "Synthetic" filesystem implementation. */ @@ -496,8 +500,7 @@ zfsctl_common_getattr(vnode_t *vp, vattr_t *vap) vap->va_nblocks = 0; vap->va_seq = 0; vn_fsid(vp, vap); - vap->va_mode = S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | - S_IROTH | S_IXOTH; + vap->va_mode = zfsctl_ctldir_mode; vap->va_type = VDIR; /* * We live in the now (for atime). @@ -724,6 +727,87 @@ zfsctl_root_vptocnp(struct vop_vptocnp_args *ap) return (0); } +static int +zfsctl_common_pathconf(ap) + struct vop_pathconf_args /* { + struct vnode *a_vp; + int a_name; + int *a_retval; + } */ *ap; +{ + /* + * We care about ACL variables so that user land utilities like ls + * can display them correctly. Since the ctldir's st_dev is set to be + * the same as the parent dataset, we must support all variables that + * it supports. + */ + switch (ap->a_name) { + case _PC_LINK_MAX: + *ap->a_retval = INT_MAX; + return (0); + + case _PC_FILESIZEBITS: + *ap->a_retval = 64; + return (0); + + case _PC_MIN_HOLE_SIZE: + *ap->a_retval = (int)SPA_MINBLOCKSIZE; + return (0); + + case _PC_ACL_EXTENDED: + *ap->a_retval = 0; + return (0); + + case _PC_ACL_NFS4: + *ap->a_retval = 1; + return (0); + + case _PC_ACL_PATH_MAX: + *ap->a_retval = ACL_MAX_ENTRIES; + return (0); + + default: + return (EINVAL); + } +} + +/** + * Returns a trivial ACL + */ +int +zfsctl_common_getacl(ap) + struct vop_getacl_args /* { + struct vnode *vp; + acl_type_t a_type; + struct acl *a_aclp; + struct ucred *cred; + struct thread *td; + } */ *ap; +{ + int i; + + if (ap->a_type != ACL_TYPE_NFS4) + return (EINVAL); + + acl_nfs4_sync_acl_from_mode(ap->a_aclp, zfsctl_ctldir_mode, 0); + /* + * acl_nfs4_sync_acl_from_mode assumes that the owner can always modify + * attributes. That is not the case for the ctldir, so we must clear + * those bits. We also must clear ACL_READ_NAMED_ATTRS, because xattrs + * aren't supported by the ctldir. + */ + for (i = 0; i < ap->a_aclp->acl_cnt; i++) { + struct acl_entry *entry; + entry = &(ap->a_aclp->acl_entry[i]); + uint32_t old_perm = entry->ae_perm; + entry->ae_perm &= ~(ACL_WRITE_ACL | ACL_WRITE_OWNER | + ACL_WRITE_ATTRIBUTES | ACL_WRITE_NAMED_ATTRS | + ACL_READ_NAMED_ATTRS ); + } + + return (0); +} + static struct vop_vector zfsctl_ops_root = { .vop_default = &default_vnodeops, .vop_open = zfsctl_common_open, @@ -738,6 +822,8 @@ static struct vop_vector zfsctl_ops_root = { .vop_fid = zfsctl_common_fid, .vop_print = zfsctl_common_print, .vop_vptocnp = zfsctl_root_vptocnp, + .vop_pathconf = zfsctl_common_pathconf, + .vop_getacl = zfsctl_common_getacl, }; static int @@ -1066,6 +1152,8 @@ static struct vop_vector zfsctl_ops_snapdir = { .vop_reclaim = zfsctl_common_reclaim, .vop_fid = zfsctl_common_fid, .vop_print = zfsctl_common_print, + .vop_pathconf = zfsctl_common_pathconf, + .vop_getacl = zfsctl_common_getacl, }; static int From owner-svn-src-head@freebsd.org Wed Feb 14 17:51: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 F2089F129DE; Wed, 14 Feb 2018 17:51: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 9F92C84BBE; Wed, 14 Feb 2018 17:51:51 +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 9A8D7131B3; Wed, 14 Feb 2018 17:51:51 +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 w1EHpp3P027255; Wed, 14 Feb 2018 17:51:51 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1EHppNe027242; Wed, 14 Feb 2018 17:51:51 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802141751.w1EHppNe027242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 14 Feb 2018 17:51:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329266 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 329266 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 14 Feb 2018 17:51:52 -0000 Author: imp Date: Wed Feb 14 17:51:51 2018 New Revision: 329266 URL: https://svnweb.freebsd.org/changeset/base/329266 Log: A quick test script that we can run to use userboot's test mode to excersize the load loader. Assumes that we already have a suitable root area that you pass in with the first arg. Added: head/tools/boot/lua-test.sh (contents, props changed) Added: head/tools/boot/lua-test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/boot/lua-test.sh Wed Feb 14 17:51:51 2018 (r329266) @@ -0,0 +1,22 @@ +#!/bin/sh +# $FreeBSD$ + +die() { + echo $* + exit 1 +} + +dir=$1 +cd $(make -V SRCTOP)/stand +obj=$(make -V .OBJDIR) +t=$obj/userboot/test/test +u=$obj/userboot/userboot/userboot.so + +[ -n "$dir" ] || die "No directory specified" +[ -d "$dir" ] || die "Directory $dir doesn't exist" +[ -f "$dir/boot/lua/loader.lua" ] || die "No boot/lua/loader.lua found" +[ -f "$dir/boot/kernel/kernel" ] || die "No kernel to load" +[ -x "$t" ] || die "no userboot test jig found ($t)" +[ -x "$u" ] || die "no userboot.so ($u) found" + +$t -h $dir -b $u From owner-svn-src-head@freebsd.org Wed Feb 14 18:05: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 2A780F1396B; Wed, 14 Feb 2018 18:05:38 +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 D207385914; Wed, 14 Feb 2018 18:05:37 +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 CCD17133AD; Wed, 14 Feb 2018 18:05:37 +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 w1EI5bXT035979; Wed, 14 Feb 2018 18:05:37 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1EI5bs2035976; Wed, 14 Feb 2018 18:05:37 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201802141805.w1EI5bs2035976@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 14 Feb 2018 18:05:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329268 - in head/stand/efi: include libefi loader X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/stand/efi: include libefi loader X-SVN-Commit-Revision: 329268 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 14 Feb 2018 18:05:38 -0000 Author: manu Date: Wed Feb 14 18:05:37 2018 New Revision: 329268 URL: https://svnweb.freebsd.org/changeset/base/329268 Log: efi: Only scan the BLKIO MEDIA once Scan only the BLOCK IO MEDIA once instead of each time for each type of device (fd, cd and hdd). Leave the mechanism to free and reprobe all devices if one day we want to implement a "dev rescan" thing. Reviewed by: imp, tsoome MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D14334 Modified: head/stand/efi/include/efilib.h head/stand/efi/libefi/efipart.c head/stand/efi/loader/main.c Modified: head/stand/efi/include/efilib.h ============================================================================== --- head/stand/efi/include/efilib.h Wed Feb 14 17:59:04 2018 (r329267) +++ head/stand/efi/include/efilib.h Wed Feb 14 18:05:37 2018 (r329268) @@ -106,4 +106,7 @@ int wcscmp(CHAR16 *, CHAR16 *); void cpy8to16(const char *, CHAR16 *, size_t); void cpy16to8(const CHAR16 *, char *, size_t); +/* efipart.c */ +int efipart_inithandles(void); + #endif /* _LOADER_EFILIB_H */ Modified: head/stand/efi/libefi/efipart.c ============================================================================== --- head/stand/efi/libefi/efipart.c Wed Feb 14 17:59:04 2018 (r329267) +++ head/stand/efi/libefi/efipart.c Wed Feb 14 18:05:37 2018 (r329268) @@ -148,7 +148,7 @@ efiblk_pdinfo_count(pdinfo_list_t *pdi) return (i); } -static int +int efipart_inithandles(void) { UINTN sz; @@ -176,6 +176,10 @@ efipart_inithandles(void) efipart_handles = hin; efipart_nhandles = sz; +#ifdef EFIPART_DEBUG + printf("%s: Got %d BLOCK IO MEDIA handle(s)\n", __func__, + efipart_nhandles); +#endif return (0); } @@ -319,11 +323,7 @@ efipart_updatefd(void) static int efipart_initfd(void) { - int rv; - rv = efipart_inithandles(); - if (rv != 0) - return (rv); STAILQ_INIT(&fdinfo); efipart_updatefd(); @@ -439,11 +439,7 @@ efipart_updatecd(void) static int efipart_initcd(void) { - int rv; - rv = efipart_inithandles(); - if (rv != 0) - return (rv); STAILQ_INIT(&cdinfo); efipart_updatecd(); @@ -685,11 +681,7 @@ efipart_updatehd(void) static int efipart_inithd(void) { - int rv; - rv = efipart_inithandles(); - if (rv != 0) - return (rv); STAILQ_INIT(&hdinfo); efipart_updatehd(); Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Wed Feb 14 17:59:04 2018 (r329267) +++ head/stand/efi/loader/main.c Wed Feb 14 18:05:37 2018 (r329268) @@ -456,11 +456,15 @@ main(int argc, CHAR16 *argv[]) } /* - * March through the device switch probing for things. + * Scan the BLOCK IO MEDIA handles then + * march through the device switch probing for things. */ - for (i = 0; devsw[i] != NULL; i++) - if (devsw[i]->dv_init != NULL) - (devsw[i]->dv_init)(); + if ((i = efipart_inithandles()) == 0) { + for (i = 0; devsw[i] != NULL; i++) + if (devsw[i]->dv_init != NULL) + (devsw[i]->dv_init)(); + } else + printf("efipart_inithandles failed %d, expect failures", i); printf("Command line arguments:"); for (i = 0; i < argc; i++) From owner-svn-src-head@freebsd.org Wed Feb 14 18:07: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 01BBAF13B47; Wed, 14 Feb 2018 18:07:28 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A1C1085B02; Wed, 14 Feb 2018 18:07:27 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9BB87133C3; Wed, 14 Feb 2018 18:07:27 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1EI7RCQ036079; Wed, 14 Feb 2018 18:07:27 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1EI7Ror036078; Wed, 14 Feb 2018 18:07:27 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201802141807.w1EI7Ror036078@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: benno set sender to benno@FreeBSD.org using -f From: Benno Rice Date: Wed, 14 Feb 2018 18:07:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329269 - head/stand/i386/boot2 X-SVN-Group: head X-SVN-Commit-Author: benno X-SVN-Commit-Paths: head/stand/i386/boot2 X-SVN-Commit-Revision: 329269 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 14 Feb 2018 18:07:28 -0000 Author: benno Date: Wed Feb 14 18:07:27 2018 New Revision: 329269 URL: https://svnweb.freebsd.org/changeset/base/329269 Log: Reformat to come significantly closer to style(9). Reviewed by: imp, jhibbits Differential Revision: https://reviews.freebsd.org/D14366 Modified: head/stand/i386/boot2/boot2.c Modified: head/stand/i386/boot2/boot2.c ============================================================================== --- head/stand/i386/boot2/boot2.c Wed Feb 14 18:05:37 2018 (r329268) +++ head/stand/i386/boot2/boot2.c Wed Feb 14 18:07:27 2018 (r329269) @@ -72,33 +72,33 @@ extern uint32_t _end; static const char optstr[NOPT] = "DhaCcdgmnpqrsv"; /* Also 'P', 'S' */ static const unsigned char flags[NOPT] = { - RBX_DUAL, - RBX_SERIAL, - RBX_ASKNAME, - RBX_CDROM, - RBX_CONFIG, - RBX_KDB, - RBX_GDB, - RBX_MUTE, - RBX_NOINTR, - RBX_PAUSE, - RBX_QUIET, - RBX_DFLTROOT, - RBX_SINGLE, - RBX_VERBOSE + RBX_DUAL, + RBX_SERIAL, + RBX_ASKNAME, + RBX_CDROM, + RBX_CONFIG, + RBX_KDB, + RBX_GDB, + RBX_MUTE, + RBX_NOINTR, + RBX_PAUSE, + RBX_QUIET, + RBX_DFLTROOT, + RBX_SINGLE, + RBX_VERBOSE }; static const char *const dev_nm[NDEV] = {"ad", "da", "fd"}; static const unsigned char dev_maj[NDEV] = {30, 4, 2}; static struct dsk { - unsigned drive; - unsigned type; - unsigned unit; - uint8_t slice; - uint8_t part; - unsigned start; - int init; + unsigned drive; + unsigned type; + unsigned unit; + uint8_t slice; + uint8_t part; + unsigned start; + int init; } dsk; static char cmd[512], cmddup[512], knamebuf[1024]; static const char *kname; @@ -126,18 +126,21 @@ static void memcpy(void *, const void *, int); static void memcpy(void *dst, const void *src, int len) { - const char *s = src; - char *d = dst; + const char *s; + char *d; - while (len--) - *d++ = *s++; + s = src; + d = dst; + while (len--) + *d++ = *s++; } static inline int strcmp(const char *s1, const char *s2) { - for (; *s1 == *s2 && *s1; s1++, s2++); - return (unsigned char)*s1 - (unsigned char)*s2; + + for (; *s1 == *s2 && *s1; s1++, s2++); + return ((unsigned char)*s1 - (unsigned char)*s2); } #define UFS_SMALL_CGBASE @@ -146,501 +149,519 @@ strcmp(const char *s1, const char *s2) static int xfsread(ufs_ino_t inode, void *buf, size_t nbyte) { - if ((size_t)fsread(inode, buf, nbyte) != nbyte) { - printf("Invalid %s\n", "format"); - return -1; - } - return 0; + + if ((size_t)fsread(inode, buf, nbyte) != nbyte) { + printf("Invalid %s\n", "format"); + return (-1); + } + return (0); } static inline void getstr(void) { - char *s; - int c; + char *s; + int c; - s = cmd; - for (;;) { - switch (c = xgetc(0)) { - case 0: - break; - case '\177': - case '\b': - if (s > cmd) { - s--; - printf("\b \b"); - } - break; - case '\n': - case '\r': - *s = 0; - return; - default: - if (s - cmd < sizeof(cmd) - 1) - *s++ = c; - putchar(c); + s = cmd; + for (;;) { + switch (c = xgetc(0)) { + case 0: + break; + case '\177': + case '\b': + if (s > cmd) { + s--; + printf("\b \b"); + } + break; + case '\n': + case '\r': + *s = 0; + return; + default: + if (s - cmd < sizeof(cmd) - 1) + *s++ = c; + putchar(c); + } } - } } static inline void putc(int c) { - v86.addr = 0x10; - v86.eax = 0xe00 | (c & 0xff); - v86.ebx = 0x7; - v86int(); + + v86.addr = 0x10; + v86.eax = 0xe00 | (c & 0xff); + v86.ebx = 0x7; + v86int(); } int main(void) { - uint8_t autoboot; - ufs_ino_t ino; - size_t nbyte; + uint8_t autoboot; + ufs_ino_t ino; + size_t nbyte; - dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); - v86.ctl = V86_FLAGS; - v86.efl = PSL_RESERVED_DEFAULT | PSL_I; - dsk.drive = *(uint8_t *)PTOV(ARGS); - dsk.type = dsk.drive & DRV_HARD ? TYPE_AD : TYPE_FD; - dsk.unit = dsk.drive & DRV_MASK; - dsk.slice = *(uint8_t *)PTOV(ARGS + 1) + 1; - bootinfo.bi_version = BOOTINFO_VERSION; - bootinfo.bi_size = sizeof(bootinfo); + dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); + v86.ctl = V86_FLAGS; + v86.efl = PSL_RESERVED_DEFAULT | PSL_I; + dsk.drive = *(uint8_t *)PTOV(ARGS); + dsk.type = dsk.drive & DRV_HARD ? TYPE_AD : TYPE_FD; + dsk.unit = dsk.drive & DRV_MASK; + dsk.slice = *(uint8_t *)PTOV(ARGS + 1) + 1; + bootinfo.bi_version = BOOTINFO_VERSION; + bootinfo.bi_size = sizeof(bootinfo); - /* Process configuration file */ + /* Process configuration file */ - autoboot = 1; + autoboot = 1; - if ((ino = lookup(PATH_CONFIG)) || - (ino = lookup(PATH_DOTCONFIG))) { - nbyte = fsread(ino, cmd, sizeof(cmd) - 1); - cmd[nbyte] = '\0'; - } + if ((ino = lookup(PATH_CONFIG)) || + (ino = lookup(PATH_DOTCONFIG))) { + nbyte = fsread(ino, cmd, sizeof(cmd) - 1); + cmd[nbyte] = '\0'; + } - if (*cmd) { - memcpy(cmddup, cmd, sizeof(cmd)); - if (parse()) - autoboot = 0; - if (!OPT_CHECK(RBX_QUIET)) - printf("%s: %s", PATH_CONFIG, cmddup); - /* Do not process this command twice */ - *cmd = 0; - } + if (*cmd) { + memcpy(cmddup, cmd, sizeof(cmd)); + if (parse()) + autoboot = 0; + if (!OPT_CHECK(RBX_QUIET)) + printf("%s: %s", PATH_CONFIG, cmddup); + /* Do not process this command twice */ + *cmd = 0; + } - /* - * Try to exec stage 3 boot loader. If interrupted by a keypress, - * or in case of failure, try to load a kernel directly instead. - */ + /* + * Try to exec stage 3 boot loader. If interrupted by a keypress, + * or in case of failure, try to load a kernel directly instead. + */ - if (!kname) { - kname = PATH_LOADER; - if (autoboot && !keyhit(3*SECOND)) { - load(); - kname = PATH_KERNEL; + if (!kname) { + kname = PATH_LOADER; + if (autoboot && !keyhit(3*SECOND)) { + load(); + kname = PATH_KERNEL; + } } - } - /* Present the user with the boot2 prompt. */ + /* Present the user with the boot2 prompt. */ - for (;;) { - if (!autoboot || !OPT_CHECK(RBX_QUIET)) - printf("\nFreeBSD/x86 boot\n" - "Default: %u:%s(%u,%c)%s\n" - "boot: ", - dsk.drive & DRV_MASK, dev_nm[dsk.type], dsk.unit, - 'a' + dsk.part, kname); - if (DO_SIO) - sio_flush(); - if (!autoboot || keyhit(3*SECOND)) - getstr(); - else if (!autoboot || !OPT_CHECK(RBX_QUIET)) - putchar('\n'); - autoboot = 0; - if (parse()) - putchar('\a'); - else - load(); - } + for (;;) { + if (!autoboot || !OPT_CHECK(RBX_QUIET)) + printf("\nFreeBSD/x86 boot\n" + "Default: %u:%s(%u,%c)%s\n" + "boot: ", + dsk.drive & DRV_MASK, dev_nm[dsk.type], dsk.unit, + 'a' + dsk.part, kname); + if (DO_SIO) + sio_flush(); + if (!autoboot || keyhit(3*SECOND)) + getstr(); + else if (!autoboot || !OPT_CHECK(RBX_QUIET)) + putchar('\n'); + autoboot = 0; + if (parse()) + putchar('\a'); + else + load(); + } } /* XXX - Needed for btxld to link the boot2 binary; do not remove. */ void exit(int x) { + } static void load(void) { - union { - struct exec ex; - Elf32_Ehdr eh; - } hdr; - static Elf32_Phdr ep[2]; - static Elf32_Shdr es[2]; - caddr_t p; - ufs_ino_t ino; - uint32_t addr; - int k; - uint8_t i, j; + union { + struct exec ex; + Elf32_Ehdr eh; + } hdr; + static Elf32_Phdr ep[2]; + static Elf32_Shdr es[2]; + caddr_t p; + ufs_ino_t ino; + uint32_t addr; + int k; + uint8_t i, j; - if (!(ino = lookup(kname))) { - if (!ls) - printf("No %s\n", kname); - return; - } - if (xfsread(ino, &hdr, sizeof(hdr))) - return; - - if (N_GETMAGIC(hdr.ex) == ZMAGIC) { - addr = hdr.ex.a_entry & 0xffffff; - p = PTOV(addr); - fs_off = PAGE_SIZE; - if (xfsread(ino, p, hdr.ex.a_text)) - return; - p += roundup2(hdr.ex.a_text, PAGE_SIZE); - if (xfsread(ino, p, hdr.ex.a_data)) - return; - } else if (IS_ELF(hdr.eh)) { - fs_off = hdr.eh.e_phoff; - for (j = k = 0; k < hdr.eh.e_phnum && j < 2; k++) { - if (xfsread(ino, ep + j, sizeof(ep[0]))) + if (!(ino = lookup(kname))) { + if (!ls) + printf("No %s\n", kname); return; - if (ep[j].p_type == PT_LOAD) - j++; } - for (i = 0; i < 2; i++) { - p = PTOV(ep[i].p_paddr & 0xffffff); - fs_off = ep[i].p_offset; - if (xfsread(ino, p, ep[i].p_filesz)) + if (xfsread(ino, &hdr, sizeof(hdr))) return; - } - p += roundup2(ep[1].p_memsz, PAGE_SIZE); - bootinfo.bi_symtab = VTOP(p); - if (hdr.eh.e_shnum == hdr.eh.e_shstrndx + 3) { - fs_off = hdr.eh.e_shoff + sizeof(es[0]) * - (hdr.eh.e_shstrndx + 1); - if (xfsread(ino, &es, sizeof(es))) + + if (N_GETMAGIC(hdr.ex) == ZMAGIC) { + addr = hdr.ex.a_entry & 0xffffff; + p = PTOV(addr); + fs_off = PAGE_SIZE; + if (xfsread(ino, p, hdr.ex.a_text)) + return; + p += roundup2(hdr.ex.a_text, PAGE_SIZE); + if (xfsread(ino, p, hdr.ex.a_data)) + return; + } else if (IS_ELF(hdr.eh)) { + fs_off = hdr.eh.e_phoff; + for (j = k = 0; k < hdr.eh.e_phnum && j < 2; k++) { + if (xfsread(ino, ep + j, sizeof(ep[0]))) + return; + if (ep[j].p_type == PT_LOAD) + j++; + } + for (i = 0; i < 2; i++) { + p = PTOV(ep[i].p_paddr & 0xffffff); + fs_off = ep[i].p_offset; + if (xfsread(ino, p, ep[i].p_filesz)) + return; + } + p += roundup2(ep[1].p_memsz, PAGE_SIZE); + bootinfo.bi_symtab = VTOP(p); + if (hdr.eh.e_shnum == hdr.eh.e_shstrndx + 3) { + fs_off = hdr.eh.e_shoff + sizeof(es[0]) * + (hdr.eh.e_shstrndx + 1); + if (xfsread(ino, &es, sizeof(es))) + return; + for (i = 0; i < 2; i++) { + *(Elf32_Word *)p = es[i].sh_size; + p += sizeof(es[i].sh_size); + fs_off = es[i].sh_offset; + if (xfsread(ino, p, es[i].sh_size)) + return; + p += es[i].sh_size; + } + } + addr = hdr.eh.e_entry & 0xffffff; + bootinfo.bi_esymtab = VTOP(p); + } else { + printf("Invalid %s\n", "format"); return; - for (i = 0; i < 2; i++) { - *(Elf32_Word *)p = es[i].sh_size; - p += sizeof(es[i].sh_size); - fs_off = es[i].sh_offset; - if (xfsread(ino, p, es[i].sh_size)) - return; - p += es[i].sh_size; - } } - addr = hdr.eh.e_entry & 0xffffff; - bootinfo.bi_esymtab = VTOP(p); - } else { - printf("Invalid %s\n", "format"); - return; - } - bootinfo.bi_kernelname = VTOP(kname); - bootinfo.bi_bios_dev = dsk.drive; - __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), - MAKEBOOTDEV(dev_maj[dsk.type], dsk.slice, dsk.unit, dsk.part), - 0, 0, 0, VTOP(&bootinfo)); + bootinfo.bi_kernelname = VTOP(kname); + bootinfo.bi_bios_dev = dsk.drive; + __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), + MAKEBOOTDEV(dev_maj[dsk.type], dsk.slice, dsk.unit, dsk.part), + 0, 0, 0, VTOP(&bootinfo)); } static int parse() { - char *arg = cmd; - char *ep, *p, *q; - const char *cp; - unsigned int drv; - int c, i, j; - size_t k; + char *arg; + char *ep, *p, *q; + const char *cp; + unsigned int drv; + int c, i, j; + size_t k; - while ((c = *arg++)) { - if (c == ' ' || c == '\t' || c == '\n') - continue; - for (p = arg; *p && *p != '\n' && *p != ' ' && *p != '\t'; p++); - ep = p; - if (*p) - *p++ = 0; - if (c == '-') { - while ((c = *arg++)) { - if (c == 'P') { - if (*(uint8_t *)PTOV(0x496) & 0x10) { - cp = "yes"; - } else { - opts |= OPT_SET(RBX_DUAL) | OPT_SET(RBX_SERIAL); - cp = "no"; - } - printf("Keyboard: %s\n", cp); - continue; + arg = cmd; + + while ((c = *arg++)) { + if (c == ' ' || c == '\t' || c == '\n') + continue; + for (p = arg; *p && *p != '\n' && *p != ' ' && *p != '\t'; p++); + ep = p; + if (*p) + *p++ = 0; + if (c == '-') { + while ((c = *arg++)) { + if (c == 'P') { + if (*(uint8_t *)PTOV(0x496) & 0x10) { + cp = "yes"; + } else { + opts |= OPT_SET(RBX_DUAL) | + OPT_SET(RBX_SERIAL); + cp = "no"; + } + printf("Keyboard: %s\n", cp); + continue; #if SERIAL - } else if (c == 'S') { - j = 0; - while ((unsigned int)(i = *arg++ - '0') <= 9) - j = j * 10 + i; - if (j > 0 && i == -'0') { - comspeed = j; - break; - } - /* Fall through to error below ('S' not in optstr[]). */ + } else if (c == 'S') { + j = 0; + while (*arg <= '9') { + i = (unsigned int)(*arg - '0'); + j = j * 10 + i; + arg++; + } + if (j > 0 && i == -'0') { + comspeed = j; + break; + } + /* + * Fall through to error below + * ('S' not in optstr[]). + */ #endif - } - for (i = 0; c != optstr[i]; i++) - if (i == NOPT - 1) - return -1; - opts ^= OPT_SET(flags[i]); - } + } + for (i = 0; c != optstr[i]; i++) + if (i == NOPT - 1) + return (-1); + opts ^= OPT_SET(flags[i]); + } #if SERIAL - ioctrl = OPT_CHECK(RBX_DUAL) ? (IO_SERIAL|IO_KEYBOARD) : - OPT_CHECK(RBX_SERIAL) ? IO_SERIAL : IO_KEYBOARD; - if (DO_SIO) { - if (sio_init(115200 / comspeed) != 0) - ioctrl &= ~IO_SERIAL; - } + ioctrl = OPT_CHECK(RBX_DUAL) ? + (IO_SERIAL|IO_KEYBOARD) : + OPT_CHECK(RBX_SERIAL) ? IO_SERIAL : IO_KEYBOARD; + if (DO_SIO) { + if (sio_init(115200 / comspeed) != 0) + ioctrl &= ~IO_SERIAL; + } #endif - } else { - for (q = arg--; *q && *q != '('; q++); - if (*q) { - drv = -1; - if (arg[1] == ':') { - drv = *arg - '0'; - if (drv > 9) - return (-1); - arg += 2; + } else { + for (q = arg--; *q && *q != '('; q++); + if (*q) { + drv = -1; + if (arg[1] == ':') { + drv = *arg - '0'; + if (drv > 9) + return (-1); + arg += 2; + } + if (q - arg != 2) + return -1; + for (i = 0; arg[0] != dev_nm[i][0] || + arg[1] != dev_nm[i][1]; i++) + if (i == NDEV - 1) + return (-1); + dsk.type = i; + arg += 3; + dsk.unit = *arg - '0'; + if (arg[1] != ',' || dsk.unit > 9) + return (-1); + arg += 2; + dsk.slice = WHOLE_DISK_SLICE; + if (arg[1] == ',') { + dsk.slice = *arg - '0' + 1; + if (dsk.slice > NDOSPART + 1) + return (-1); + arg += 2; + } + if (arg[1] != ')') + return (-1); + dsk.part = *arg - 'a'; + if (dsk.part > 7) + return (-1); + arg += 2; + if (drv == -1) + drv = dsk.unit; + dsk.drive = (dsk.type <= TYPE_MAXHARD + ? DRV_HARD : 0) + drv; + dsk_meta = 0; + } + k = ep - arg; + if (k > 0) { + if (k >= sizeof(knamebuf)) + return (-1); + memcpy(knamebuf, arg, k + 1); + kname = knamebuf; + } } - if (q - arg != 2) - return -1; - for (i = 0; arg[0] != dev_nm[i][0] || - arg[1] != dev_nm[i][1]; i++) - if (i == NDEV - 1) - return -1; - dsk.type = i; - arg += 3; - dsk.unit = *arg - '0'; - if (arg[1] != ',' || dsk.unit > 9) - return -1; - arg += 2; - dsk.slice = WHOLE_DISK_SLICE; - if (arg[1] == ',') { - dsk.slice = *arg - '0' + 1; - if (dsk.slice > NDOSPART + 1) - return -1; - arg += 2; - } - if (arg[1] != ')') - return -1; - dsk.part = *arg - 'a'; - if (dsk.part > 7) - return (-1); - arg += 2; - if (drv == -1) - drv = dsk.unit; - dsk.drive = (dsk.type <= TYPE_MAXHARD - ? DRV_HARD : 0) + drv; - dsk_meta = 0; - } - k = ep - arg; - if (k > 0) { - if (k >= sizeof(knamebuf)) - return -1; - memcpy(knamebuf, arg, k + 1); - kname = knamebuf; - } + arg = p; } - arg = p; - } - return 0; + return (0); } static int dskread(void *buf, unsigned lba, unsigned nblk) { - struct dos_partition *dp; - struct disklabel *d; - char *sec; - unsigned i; - uint8_t sl; - const char *reason; + struct dos_partition *dp; + struct disklabel *d; + char *sec; + unsigned i; + uint8_t sl; + const char *reason; - if (!dsk_meta) { - sec = dmadat->secbuf; - dsk.start = 0; - if (drvread(sec, DOSBBSECTOR, 1)) - return -1; - dp = (void *)(sec + DOSPARTOFF); - sl = dsk.slice; - if (sl < BASE_SLICE) { - for (i = 0; i < NDOSPART; i++) - if (dp[i].dp_typ == DOSPTYP_386BSD && - (dp[i].dp_flag & 0x80 || sl < BASE_SLICE)) { - sl = BASE_SLICE + i; - if (dp[i].dp_flag & 0x80 || - dsk.slice == COMPATIBILITY_SLICE) - break; + if (!dsk_meta) { + sec = dmadat->secbuf; + dsk.start = 0; + if (drvread(sec, DOSBBSECTOR, 1)) + return (-1); + dp = (void *)(sec + DOSPARTOFF); + sl = dsk.slice; + if (sl < BASE_SLICE) { + for (i = 0; i < NDOSPART; i++) + if (dp[i].dp_typ == DOSPTYP_386BSD && + (dp[i].dp_flag & 0x80 || sl < BASE_SLICE)) { + sl = BASE_SLICE + i; + if (dp[i].dp_flag & 0x80 || + dsk.slice == COMPATIBILITY_SLICE) + break; + } + if (dsk.slice == WHOLE_DISK_SLICE) + dsk.slice = sl; } - if (dsk.slice == WHOLE_DISK_SLICE) - dsk.slice = sl; + if (sl != WHOLE_DISK_SLICE) { + if (sl != COMPATIBILITY_SLICE) + dp += sl - BASE_SLICE; + if (dp->dp_typ != DOSPTYP_386BSD) { + reason = "slice"; + goto error; + } + dsk.start = dp->dp_start; + } + if (drvread(sec, dsk.start + LABELSECTOR, 1)) + return (-1); + d = (void *)(sec + LABELOFFSET); + if (d->d_magic != DISKMAGIC || d->d_magic2 != DISKMAGIC) { + if (dsk.part != RAW_PART) { + reason = "label"; + goto error; + } + } else { + if (!dsk.init) { + if (d->d_type == DTYPE_SCSI) + dsk.type = TYPE_DA; + dsk.init++; + } + if (dsk.part >= d->d_npartitions || + !d->d_partitions[dsk.part].p_size) { + reason = "partition"; + goto error; + } + dsk.start += d->d_partitions[dsk.part].p_offset; + dsk.start -= d->d_partitions[RAW_PART].p_offset; + } } - if (sl != WHOLE_DISK_SLICE) { - if (sl != COMPATIBILITY_SLICE) - dp += sl - BASE_SLICE; - if (dp->dp_typ != DOSPTYP_386BSD) { - reason = "slice"; - goto error; - } - dsk.start = dp->dp_start; - } - if (drvread(sec, dsk.start + LABELSECTOR, 1)) - return -1; - d = (void *)(sec + LABELOFFSET); - if (d->d_magic != DISKMAGIC || d->d_magic2 != DISKMAGIC) { - if (dsk.part != RAW_PART) { - reason = "label"; - goto error; - } - } else { - if (!dsk.init) { - if (d->d_type == DTYPE_SCSI) - dsk.type = TYPE_DA; - dsk.init++; - } - if (dsk.part >= d->d_npartitions || - !d->d_partitions[dsk.part].p_size) { - reason = "partition"; - goto error; - } - dsk.start += d->d_partitions[dsk.part].p_offset; - dsk.start -= d->d_partitions[RAW_PART].p_offset; - } - } - return drvread(buf, dsk.start + lba, nblk); + return (drvread(buf, dsk.start + lba, nblk)); error: - printf("Invalid %s\n", reason); - return -1; + printf("Invalid %s\n", reason); + return (-1); } static void printf(const char *fmt,...) { - va_list ap; - static char buf[10]; - char *s; - unsigned u; - int c; + va_list ap; + static char buf[10]; + char *s; + unsigned u; + int c; - va_start(ap, fmt); - while ((c = *fmt++)) { - if (c == '%') { - c = *fmt++; - switch (c) { - case 'c': - putchar(va_arg(ap, int)); - continue; - case 's': - for (s = va_arg(ap, char *); *s; s++) - putchar(*s); - continue; - case 'u': - u = va_arg(ap, unsigned); - s = buf; - do - *s++ = '0' + u % 10U; - while (u /= 10U); - while (--s >= buf) - putchar(*s); - continue; - } + va_start(ap, fmt); + while ((c = *fmt++)) { + if (c == '%') { + c = *fmt++; + switch (c) { + case 'c': + putchar(va_arg(ap, int)); + continue; + case 's': + for (s = va_arg(ap, char *); *s; s++) + putchar(*s); + continue; + case 'u': + u = va_arg(ap, unsigned); + s = buf; + do + *s++ = '0' + u % 10U; + while (u /= 10U); + while (--s >= buf) + putchar(*s); + continue; + } + } + putchar(c); } - putchar(c); - } - va_end(ap); - return; + va_end(ap); + return; } static void putchar(int c) { - if (c == '\n') - xputc('\r'); - xputc(c); + + if (c == '\n') + xputc('\r'); + xputc(c); } static int drvread(void *buf, unsigned lba, unsigned nblk) { - static unsigned c = 0x2d5c7c2f; + static unsigned c = 0x2d5c7c2f; - if (!OPT_CHECK(RBX_QUIET)) { - xputc(c = c << 8 | c >> 24); - xputc('\b'); - } - v86.ctl = V86_ADDR | V86_CALLF | V86_FLAGS; - v86.addr = XREADORG; /* call to xread in boot1 */ - v86.es = VTOPSEG(buf); - v86.eax = lba; - v86.ebx = VTOPOFF(buf); - v86.ecx = lba >> 16; - v86.edx = nblk << 8 | dsk.drive; - v86int(); - v86.ctl = V86_FLAGS; - if (V86_CY(v86.efl)) { - printf("error %u lba %u\n", v86.eax >> 8 & 0xff, lba); - return -1; - } - return 0; + if (!OPT_CHECK(RBX_QUIET)) { + xputc(c = c << 8 | c >> 24); + xputc('\b'); + } + v86.ctl = V86_ADDR | V86_CALLF | V86_FLAGS; + v86.addr = XREADORG; /* call to xread in boot1 */ + v86.es = VTOPSEG(buf); + v86.eax = lba; + v86.ebx = VTOPOFF(buf); + v86.ecx = lba >> 16; + v86.edx = nblk << 8 | dsk.drive; + v86int(); + v86.ctl = V86_FLAGS; + if (V86_CY(v86.efl)) { + printf("error %u lba %u\n", v86.eax >> 8 & 0xff, lba); + return (-1); + } + return (0); } static int keyhit(unsigned ticks) { - uint32_t t0, t1; + uint32_t t0, t1; - if (OPT_CHECK(RBX_NOINTR)) - return 0; - t0 = 0; - for (;;) { - if (xgetc(1)) - return 1; - t1 = *(uint32_t *)PTOV(0x46c); - if (!t0) - t0 = t1; - if ((uint32_t)(t1 - t0) >= ticks) - return 0; - } + if (OPT_CHECK(RBX_NOINTR)) + return (0); + t0 = 0; + for (;;) { + if (xgetc(1)) + return (1); + t1 = *(uint32_t *)PTOV(0x46c); + if (!t0) + t0 = t1; + if ((uint32_t)(t1 - t0) >= ticks) + return (0); + } } static int xputc(int c) { - if (DO_KBD) - putc(c); - if (DO_SIO) - sio_putc(c); - return c; + + if (DO_KBD) + putc(c); + if (DO_SIO) + sio_putc(c); + return (c); } static int getc(int fn) { - v86.addr = 0x16; - v86.eax = fn << 8; - v86int(); - return fn == 0 ? v86.eax & 0xff : !V86_ZR(v86.efl); + + v86.addr = 0x16; + v86.eax = fn << 8; + v86int(); + return (fn == 0 ? v86.eax & 0xff : !V86_ZR(v86.efl)); } static int xgetc(int fn) { - if (OPT_CHECK(RBX_NOINTR)) - return 0; - for (;;) { - if (DO_KBD && getc(1)) - return fn ? 1 : getc(0); - if (DO_SIO && sio_ischar()) - return fn ? 1 : sio_getc(); - if (fn) - return 0; - } + + if (OPT_CHECK(RBX_NOINTR)) + return (0); + + for (;;) { + if (DO_KBD && getc(1)) + return (fn ? 1 : getc(0)); + if (DO_SIO && sio_ischar()) + return (fn ? 1 : sio_getc()); + if (fn) + return (0); + } } From owner-svn-src-head@freebsd.org Wed Feb 14 18: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 10761F14B7C; Wed, 14 Feb 2018 18:21:55 +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 B6AAE865C6; Wed, 14 Feb 2018 18:21:54 +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 B18E1136C8; Wed, 14 Feb 2018 18:21:54 +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 w1EILs3n045203; Wed, 14 Feb 2018 18:21:54 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1EILs5U045202; Wed, 14 Feb 2018 18:21:54 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802141821.w1EILs5U045202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 14 Feb 2018 18:21:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329270 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 329270 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 14 Feb 2018 18:21:55 -0000 Author: imp Date: Wed Feb 14 18:21:54 2018 New Revision: 329270 URL: https://svnweb.freebsd.org/changeset/base/329270 Log: Simple script to image a small test area from a built tree. Build with 'cd stand; make MK_FORTH=no MK_LOADER_LUA=yes' then run this script. You can then test with lua-test.sh with the same parameter. Added: head/tools/boot/lua-img.sh (contents, props changed) Added: head/tools/boot/lua-img.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/boot/lua-img.sh Wed Feb 14 18:21:54 2018 (r329270) @@ -0,0 +1,25 @@ +#!/bin/sh +# $FreeBSD$ + +# Quick script to build a suitable /boot dir somewhere in the tree for testing. + +die() { + echo $* + exit 1 +} + +dir=$1 +cd $(make -V SRCTOP) + +[ -n "$dir" ] || die "No directory specified" + +set -e + +rm -rf ${dir} +mkdir -p ${dir} +mtree -deUW -f etc/mtree/BSD.root.dist -p ${dir} +mtree -deUW -f etc/mtree/BSD.usr.dist -p ${dir}/usr +cd stand +make install DESTDIR=${dir} NO_ROOT=t MK_LOADER_LUA=yes MK_FORTH=no MK_INSTALL_AS_USER=yes +mkdir -p ${dir}/boot/kernel +cp /boot/kernel/kernel ${dir}/boot/kernel From owner-svn-src-head@freebsd.org Wed Feb 14 18:43: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 EE3ECF16553; Wed, 14 Feb 2018 18:43:50 +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 A3A36876D4; Wed, 14 Feb 2018 18:43:50 +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 9E84513A58; Wed, 14 Feb 2018 18:43:50 +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 w1EIho1f056639; Wed, 14 Feb 2018 18:43:50 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1EIhocY056637; Wed, 14 Feb 2018 18:43:50 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201802141843.w1EIhocY056637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 14 Feb 2018 18:43:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329271 - in head: contrib/netbsd-tests/lib/libc/sys sys/kern X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: in head: contrib/netbsd-tests/lib/libc/sys sys/kern X-SVN-Commit-Revision: 329271 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 14 Feb 2018 18:43:51 -0000 Author: bdrewery Date: Wed Feb 14 18:43:50 2018 New Revision: 329271 URL: https://svnweb.freebsd.org/changeset/base/329271 Log: nanosleep(2): Fix bogus incrementing of rmtp by tc_tick_sbt on [EINTR]. sbt is the time in the future that the tsleep_sbt() is expected to be completed at. sbtt is the current time. Depending on the precision with sysctl kern.timecounter.alloweddeviation the start time may be incremented by tc_tick_sbt. The same increment is needed for the current time of sbtt before calculating the difference. The impact of missing this increment is that rmtp may increase by one tc_tick_sbt on every early [EINTR] return. If the same struct is passed in for rqtp as rmtp this can result in rqtp effectively incrementing by tc_tick_sbt and sleeping longer than originally intended. This problem was introduced in r247797. Reviewed by: kib, markj, vangyzen (all on an older version of the test) MFC after: 2 weeks Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D14362 Modified: head/contrib/netbsd-tests/lib/libc/sys/t_nanosleep.c head/sys/kern/kern_time.c Modified: head/contrib/netbsd-tests/lib/libc/sys/t_nanosleep.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_nanosleep.c Wed Feb 14 18:21:54 2018 (r329270) +++ head/contrib/netbsd-tests/lib/libc/sys/t_nanosleep.c Wed Feb 14 18:43:50 2018 (r329271) @@ -50,6 +50,15 @@ handler(int signo __unused) /* Nothing. */ } +static int got_info; +static void +info_handler(int signo __unused) +{ + + got_info = 1; +} + + ATF_TC(nanosleep_basic); ATF_TC_HEAD(nanosleep_basic, tc) { @@ -176,12 +185,84 @@ ATF_TC_BODY(nanosleep_sig, tc) atf_tc_fail("signal did not interrupt nanosleep(2)"); } +ATF_TC(nanosleep_eintr); +ATF_TC_HEAD(nanosleep_eintr, tc) +{ + atf_tc_set_md_var(tc, "descr", "Test [EINTR] for nanosleep(2)"); + atf_tc_set_md_var(tc, "timeout", "7"); +} + +ATF_TC_BODY(nanosleep_eintr, tc) +{ + struct sigaction act; + struct timespec tso, ts; + pid_t pid; + int sta; + + /* + * Test that [EINTR] properly handles rmtp for nanosleep(2). + */ + pid = fork(); + + ATF_REQUIRE(pid >= 0); + + got_info = 0; + + if (pid == 0) { + act.sa_handler = info_handler; + sigemptyset(&act.sa_mask); + act.sa_flags = 0; /* Don't allow restart. */ + ATF_REQUIRE(sigaction(SIGINFO, &act, NULL) == 0); + + tso.tv_sec = 5; + tso.tv_nsec = 0; + + ts.tv_sec = tso.tv_sec; + ts.tv_nsec = tso.tv_nsec; + + errno = 0; + while (nanosleep(&ts, &ts) != 0) { + ATF_REQUIRE_MSG(timespeccmp(&ts, &tso, <=), + "errno=%d ts=%0.9f should be <= last tso=%0.9f\n", + errno, + ts.tv_sec + ts.tv_nsec / 1e9, + tso.tv_sec + tso.tv_nsec / 1e9); + if (errno == EINTR && got_info == 1) { + got_info = 0; + errno = 0; + tso.tv_sec = ts.tv_sec; + tso.tv_nsec = ts.tv_nsec; + continue; + } + _exit(EXIT_FAILURE); + } + + if (errno != 0) + _exit(EXIT_FAILURE); + + _exit(EXIT_SUCCESS); + } + + /* Flood the process with SIGINFO until it exits. */ + do { + for (int i = 0; i < 10; i++) + ATF_REQUIRE(kill(pid, SIGINFO) == 0); + ATF_REQUIRE(usleep(10000) == 0); + } while (waitpid(pid, &sta, WNOHANG) == 0); + + ATF_REQUIRE(WIFEXITED(sta) == 1); + + if (WEXITSTATUS(sta) != EXIT_SUCCESS) + atf_tc_fail("nanosleep(2) handled rtmp incorrectly"); +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, nanosleep_basic); ATF_TP_ADD_TC(tp, nanosleep_err); ATF_TP_ADD_TC(tp, nanosleep_sig); + ATF_TP_ADD_TC(tp, nanosleep_eintr); return atf_no_error(); } Modified: head/sys/kern/kern_time.c ============================================================================== --- head/sys/kern/kern_time.c Wed Feb 14 18:21:54 2018 (r329270) +++ head/sys/kern/kern_time.c Wed Feb 14 18:43:50 2018 (r329271) @@ -563,7 +563,8 @@ kern_clock_nanosleep(struct thread *td, clockid_t cloc } while (error == 0 && is_abs_real && td->td_rtcgen == 0); td->td_rtcgen = 0; if (error != EWOULDBLOCK) { - TIMESEL(&sbtt, tmp); + if (TIMESEL(&sbtt, tmp)) + sbtt += tc_tick_sbt; if (sbtt >= sbt) return (0); if (error == ERESTART) From owner-svn-src-head@freebsd.org Wed Feb 14 20:15: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 B4B8BF1CC5C; Wed, 14 Feb 2018 20:15:33 +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 684176B008; Wed, 14 Feb 2018 20:15:33 +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 6292314935; Wed, 14 Feb 2018 20:15:33 +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 w1EKFXLY000964; Wed, 14 Feb 2018 20:15:33 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1EKFWkn000961; Wed, 14 Feb 2018 20:15:32 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201802142015.w1EKFWkn000961@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 14 Feb 2018 20:15:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329273 - in head: sys/geom/eli tests/sys/geom/class/eli X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head: sys/geom/eli tests/sys/geom/class/eli X-SVN-Commit-Revision: 329273 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 14 Feb 2018 20:15:34 -0000 Author: asomers Date: Wed Feb 14 20:15:32 2018 New Revision: 329273 URL: https://svnweb.freebsd.org/changeset/base/329273 Log: geli: append "/eli" to the underlying provider's physical path If the underlying provider's physical path is null, then the geli device's physical path will be, too. Otherwise, it will append "/eli". This will make geli work better with zfsd(8). PR: 224962 MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D13979 Added: head/tests/sys/geom/class/eli/misc_test.sh (contents, props changed) Modified: head/sys/geom/eli/g_eli.c head/tests/sys/geom/class/eli/Makefile Modified: head/sys/geom/eli/g_eli.c ============================================================================== --- head/sys/geom/eli/g_eli.c Wed Feb 14 20:01:39 2018 (r329272) +++ head/sys/geom/eli/g_eli.c Wed Feb 14 20:15:32 2018 (r329273) @@ -212,6 +212,16 @@ g_eli_crypto_rerun(struct cryptop *crp) return (error); } +static void +g_eli_getattr_done(struct bio *bp) +{ + if (bp->bio_error == 0 && + !strcmp(bp->bio_attribute, "GEOM::physpath")) { + strlcat(bp->bio_data, "/eli", bp->bio_length); + } + g_std_done(bp); +} + /* * The function is called afer reading encrypted data from the provider. * @@ -380,7 +390,10 @@ g_eli_start(struct bio *bp) case BIO_FLUSH: case BIO_DELETE: case BIO_ZONE: - cbp->bio_done = g_std_done; + if (bp->bio_cmd == BIO_GETATTR) + cbp->bio_done = g_eli_getattr_done; + else + cbp->bio_done = g_std_done; cp = LIST_FIRST(&sc->sc_geom->consumer); cbp->bio_to = cp->provider; G_ELI_LOGREQ(2, cbp, "Sending request."); Modified: head/tests/sys/geom/class/eli/Makefile ============================================================================== --- head/tests/sys/geom/class/eli/Makefile Wed Feb 14 20:01:39 2018 (r329272) +++ head/tests/sys/geom/class/eli/Makefile Wed Feb 14 20:15:32 2018 (r329273) @@ -14,6 +14,7 @@ ATF_TESTS_SH+= detach_test ATF_TESTS_SH+= init_test ATF_TESTS_SH+= integrity_test ATF_TESTS_SH+= kill_test +ATF_TESTS_SH+= misc_test ATF_TESTS_SH+= onetime_test ATF_TESTS_SH+= resize_test ATF_TESTS_SH+= setkey_test Added: head/tests/sys/geom/class/eli/misc_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/geom/class/eli/misc_test.sh Wed Feb 14 20:15:32 2018 (r329273) @@ -0,0 +1,177 @@ +# Copyright (c) 2018 Alan Somers +# 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. +# +# $FreeBSD$ + +atf_test_case preserve_props cleanup +preserve_props_head() +{ + atf_set "descr" "geli should preserve basic GEOM properties" + atf_set "require.user" "root" + atf_set "timeout" 15 +} +preserve_props_body() +{ + . $(atf_get_srcdir)/conf.sh + md=$(attach_md -s1m) + atf_check geli onetime /dev/${md} + md_secsize=$(diskinfo ${md} | cut -wf 2) + md_stripesize=$(diskinfo ${md} | cut -wf 5) + eli_secsize=$(diskinfo ${md}.eli | cut -wf 2) + eli_stripesize=$(diskinfo ${md}.eli | cut -wf 5) + atf_check_equal "$md_secsize" "$eli_secsize" + atf_check_equal "$md_stripesize" "$eli_stripesize" +} +preserve_props_cleanup() +{ + . $(atf_get_srcdir)/conf.sh + geli_test_cleanup +} + +atf_test_case preserve_disk_props cleanup +preserve_disk_props_head() +{ + atf_set "descr" "geli should preserve properties for disks" + atf_set "require.user" "root" + atf_set "require.config" "disks" + atf_set "timeout" 15 +} +preserve_disk_props_body() +{ + . $(atf_get_srcdir)/conf.sh + disks=`atf_config_get disks` + disk=${disks%% *} + if [ -z "$disk" ]; then + atf_skip "Must define disks (see tests(7))" + fi + atf_check geli onetime ${disk} + + disk_ident=$(diskinfo -s ${disk}) + disk_descr=$(diskinfo -v ${disk} | awk '/Disk descr/ {print $1}') + disk_rotrate=$(diskinfo -v ${disk} | awk '/Rotation rate/ {print $1}') + disk_zonemode=$(diskinfo -v ${disk} | awk '/Zone Mode/ {print $1}') + eli_ident=$(diskinfo -s ${disk}.eli) + eli_descr=$(diskinfo -v ${disk}.eli | awk '/Disk descr/ {print $1}') + eli_rotrate=$(diskinfo -v ${disk}.eli | awk '/Rotation/ {print $1}') + eli_zonemode=$(diskinfo -v ${disk}.eli | awk '/Zone Mode/ {print $1}') + atf_check_equal "$disk_ident" "$eli_ident" + atf_check_equal "$disk_descr" "$eli_descr" + atf_check_equal "$disk_rotrate" "$eli_rotrate" + atf_check_equal "$disk_zonemode" "$eli_zonemode" +} +preserve_disk_props_cleanup() +{ + . $(atf_get_srcdir)/conf.sh + disk_cleanup + geli_test_cleanup +} + +atf_test_case physpath cleanup +physpath_head() +{ + atf_set "descr" "geli should append /eli to the underlying device's physical path" + atf_set "require.user" "root" + atf_set "timeout" 15 +} +physpath_body() +{ + . $(atf_get_srcdir)/conf.sh + load_gnop + + md=$(attach_md -s1m) + # If the underlying device has no physical path, then geli should not + # create one. + atf_check -o empty -e ignore diskinfo -p $md + atf_check -s exit:0 geli onetime $md + atf_check -o empty -e ignore diskinfo -p $md.eli + atf_check -s exit:0 geli kill $md + + # If the underlying device does have a physical path, then geli should + # append "/eli" + physpath="some/physical/path" + atf_check gnop create -z $physpath ${md} + atf_check -s exit:0 geli onetime $md.nop + atf_check -o match:"^${physpath}/eli$" diskinfo -p $md.nop.eli +} +physpath_cleanup() +{ + . $(atf_get_srcdir)/conf.sh + + if [ -f "$TEST_MDS_FILE" ]; then + while read md; do + [ -c /dev/${md}.nop.eli ] && \ + geli detach $md.nop.eli 2>/dev/null + [ -c /dev/${md}.nop ] && \ + gnop destroy -f $md.nop 2>/dev/null + [ -c /dev/${md}.eli ] && \ + geli detach $md.eli 2>/dev/null + mdconfig -d -u $md 2>/dev/null + done < $TEST_MDS_FILE + fi + true +} + +atf_init_test_cases() +{ + atf_add_test_case physpath + atf_add_test_case preserve_props + atf_add_test_case preserve_disk_props +} + + +common_cleanup() +{ + + if [ -f "$MD_DEVS" ]; then + while read test_md; do + gnop destroy -f ${test_md}.nop 2>/dev/null + mdconfig -d -u $test_md 2>/dev/null + done < $MD_DEVS + rm $MD_DEVS + fi + + if [ -f "$PLAINFILES" ]; then + while read f; do + rm -f ${f} + done < ${PLAINFILES} + rm ${PLAINFILES} + fi + true +} + +disk_cleanup() +{ + disks=`atf_config_get disks` + disk=${disks%% *} + if [ -n "$disk" ]; then + geli kill ${disk} 2>/dev/null + fi +} + +load_gnop() +{ + if ! kldstat -q -m g_nop; then + geom nop load || atf_skip "could not load module for geom nop" + fi +} From owner-svn-src-head@freebsd.org Wed Feb 14 20:18: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 A4B8AF1CFD0; Wed, 14 Feb 2018 20:18:23 +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 53D496B2B2; Wed, 14 Feb 2018 20:18:23 +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 4E86014945; Wed, 14 Feb 2018 20:18:23 +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 w1EKIN3W001143; Wed, 14 Feb 2018 20:18:23 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1EKIN7C001142; Wed, 14 Feb 2018 20:18:23 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802142018.w1EKIN7C001142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 14 Feb 2018 20:18:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329274 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329274 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 14 Feb 2018 20:18:23 -0000 Author: kevans Date: Wed Feb 14 20:18:23 2018 New Revision: 329274 URL: https://svnweb.freebsd.org/changeset/base/329274 Log: stand/lua: Exit sub-menus on backspace Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Wed Feb 14 20:15:32 2018 (r329273) +++ head/stand/lua/menu.lua Wed Feb 14 20:18:23 2018 (r329274) @@ -270,8 +270,14 @@ function menu.run(m) cont = true; while cont do - local key = string.char(io.getchar()); + local key = io.getchar(); + -- Exit on backspace + if (key == 127) and (m ~= menu.welcome) then + break + end + + key = string.char(key) -- check to see if key is an alias local sel_entry = nil; for k, v in pairs(alias_table) do From owner-svn-src-head@freebsd.org Wed Feb 14 20:26: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 A4921F1D868; Wed, 14 Feb 2018 20:26:10 +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 552A66B82F; Wed, 14 Feb 2018 20:26: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 4FFC414AE4; Wed, 14 Feb 2018 20:26: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 w1EKQArD006029; Wed, 14 Feb 2018 20:26:10 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1EKQ9g8006025; Wed, 14 Feb 2018 20:26:09 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201802142026.w1EKQ9g8006025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 14 Feb 2018 20:26:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329275 - in head: sys/geom/part tests/sys/geom/class tests/sys/geom/class/part X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head: sys/geom/part tests/sys/geom/class tests/sys/geom/class/part X-SVN-Commit-Revision: 329275 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 14 Feb 2018 20:26:10 -0000 Author: asomers Date: Wed Feb 14 20:26:09 2018 New Revision: 329275 URL: https://svnweb.freebsd.org/changeset/base/329275 Log: gpart: append partition name to the underlying provider's physical path If the underlying provider's physical path is null, then the gpart device's physical path will be, too. Otherwise, it will append the partition name, such as "/p1" or "/s1/a". This will make gpart work better with zfsd(8). PR: 224965 MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D14010 Added: head/tests/sys/geom/class/part/ head/tests/sys/geom/class/part/Makefile (contents, props changed) head/tests/sys/geom/class/part/misc.sh (contents, props changed) Modified: head/sys/geom/part/g_part.c head/tests/sys/geom/class/Makefile Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Wed Feb 14 20:18:23 2018 (r329274) +++ head/sys/geom/part/g_part.c Wed Feb 14 20:26:09 2018 (r329275) @@ -275,6 +275,35 @@ g_part_geometry(struct g_part_table *table, struct g_c } } +static void +g_part_get_physpath_done(struct bio *bp) +{ + struct g_geom *gp; + struct g_part_entry *entry; + struct g_part_table *table; + struct g_provider *pp; + struct bio *pbp; + + pbp = bp->bio_parent; + pp = pbp->bio_to; + gp = pp->geom; + table = gp->softc; + entry = pp->private; + + if (bp->bio_error == 0) { + char *end; + size_t len, remainder; + len = strlcat(bp->bio_data, "/", bp->bio_length); + if (len < bp->bio_length) { + end = bp->bio_data + len; + remainder = bp->bio_length - len; + G_PART_NAME(table, entry, end, remainder); + } + } + g_std_done(bp); +} + + #define DPRINTF(...) if (bootverbose) { \ printf("GEOM_PART: " __VA_ARGS__); \ } @@ -2189,6 +2218,7 @@ g_part_start(struct bio *bp) struct g_part_table *table; struct g_kerneldump *gkd; struct g_provider *pp; + void (*done_func)(struct bio *) = g_std_done; char buf[64]; biotrack(bp, __func__); @@ -2243,6 +2273,10 @@ g_part_start(struct bio *bp) if (g_handleattr_str(bp, "PART::type", G_PART_TYPE(table, entry, buf, sizeof(buf)))) return; + if (!strcmp("GEOM::physpath", bp->bio_attribute)) { + done_func = g_part_get_physpath_done; + break; + } if (!strcmp("GEOM::kerneldump", bp->bio_attribute)) { /* * Check that the partition is suitable for kernel @@ -2279,7 +2313,7 @@ g_part_start(struct bio *bp) g_io_deliver(bp, ENOMEM); return; } - bp2->bio_done = g_std_done; + bp2->bio_done = done_func; g_io_request(bp2, cp); } Modified: head/tests/sys/geom/class/Makefile ============================================================================== --- head/tests/sys/geom/class/Makefile Wed Feb 14 20:18:23 2018 (r329274) +++ head/tests/sys/geom/class/Makefile Wed Feb 14 20:26:09 2018 (r329275) @@ -7,10 +7,9 @@ TESTSDIR= ${TESTSBASE}/sys/geom/class TESTS_SUBDIRS+= concat TESTS_SUBDIRS+= eli TESTS_SUBDIRS+= gate -# XXX: might not work due to geom(4) changes; more investigation's needed -#TESTS_SUBDIRS+= gpt TESTS_SUBDIRS+= mirror TESTS_SUBDIRS+= nop +TESTS_SUBDIRS+= part TESTS_SUBDIRS+= raid3 TESTS_SUBDIRS+= shsec TESTS_SUBDIRS+= stripe Added: head/tests/sys/geom/class/part/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/geom/class/part/Makefile Wed Feb 14 20:26:09 2018 (r329275) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +PACKAGE= tests + +TESTSDIR= ${TESTSBASE}/sys/geom/class/${.CURDIR:T} + +# TODO: port the perl tests in tools/regression/geom_gpt +ATF_TESTS_SH+= misc + +.include Added: head/tests/sys/geom/class/part/misc.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/geom/class/part/misc.sh Wed Feb 14 20:26:09 2018 (r329275) @@ -0,0 +1,187 @@ +# Copyright (c) 2018 Alan Somers +# 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. +# +# $FreeBSD$ + +MD_DEVS="md.devs" + +atf_test_case blank_physpath cleanup +blank_physpath_head() +{ + atf_set "descr" "gpart shouldn't add physical paths to underlying providers that have none" + atf_set "require.user" "root" +} +blank_physpath_body() +{ + load_gnop + load_gpart + md=$(alloc_md) + atf_check -o empty -e ignore diskinfo -p ${md} + atf_check -s exit:0 -o ignore gpart create -s bsd ${md} + atf_check -s exit:0 -o ignore gpart add -t freebsd-ufs ${md} + atf_check -o empty -e ignore diskinfo -p ${md}a +} +blank_physpath_cleanup() +{ + common_cleanup +} + + +atf_test_case bsd_physpath cleanup +bsd_physpath_head() +{ + atf_set "descr" "BSD partitions should append /X to the underlying device's physical path" + atf_set "require.user" "root" +} +bsd_physpath_body() +{ + load_gnop + load_gpart + md=$(alloc_md) + physpath="some/physical/path" + atf_check gnop create -z $physpath /dev/${md} + atf_check -s exit:0 -o ignore gpart create -s bsd ${md}.nop + atf_check -s exit:0 -o ignore gpart add -t freebsd-ufs ${md}.nop + gpart_physpath=$(diskinfo -p ${md}.nopa) + atf_check_equal "${physpath}/a" "$gpart_physpath" +} +bsd_physpath_cleanup() +{ + common_cleanup +} + +atf_test_case gpt_physpath cleanup +gpt_physpath_head() +{ + atf_set "descr" "GPT partitions should append /pX to the underlying device's physical path" + atf_set "require.user" "root" +} +gpt_physpath_body() +{ + load_gnop + load_gpart + md=$(alloc_md) + physpath="some/physical/path" + atf_check gnop create -z $physpath /dev/${md} + atf_check -s exit:0 -o ignore gpart create -s gpt ${md}.nop + atf_check -s exit:0 -o ignore gpart add -t efi ${md}.nop + gpart_physpath=$(diskinfo -p ${md}.nopp1) + atf_check_equal "${physpath}/p1" "$gpart_physpath" +} +gpt_physpath_cleanup() +{ + common_cleanup +} + +atf_test_case mbr_physpath cleanup +mbr_physpath_head() +{ + atf_set "descr" "MBR partitions should append /sX to the underlying device's physical path" + atf_set "require.user" "root" +} +mbr_physpath_body() +{ + load_gnop + load_gpart + md=$(alloc_md) + physpath="some/physical/path" + atf_check gnop create -z $physpath /dev/${md} + atf_check -s exit:0 -o ignore gpart create -s mbr ${md}.nop + atf_check -s exit:0 -o ignore gpart add -t freebsd ${md}.nop + gpart_physpath=$(diskinfo -p ${md}.nops1) + atf_check_equal "${physpath}/s1" "$gpart_physpath" +} +mbr_physpath_cleanup() +{ + common_cleanup +} + +atf_test_case mbr_bsd_physpath cleanup +mbr_bsd_physpath_head() +{ + atf_set "descr" "BSD partitions nested within MBR partitions should append /sX/Y to the underlying device's physical path" + atf_set "require.user" "root" +} +mbr_bsd_physpath_body() +{ + load_gnop + load_gpart + md=$(alloc_md) + physpath="some/physical/path" + atf_check gnop create -z $physpath /dev/${md} + atf_check -s exit:0 -o ignore gpart create -s mbr ${md}.nop + atf_check -s exit:0 -o ignore gpart add -t freebsd ${md}.nop + atf_check -s exit:0 -o ignore gpart create -s bsd ${md}.nops1 + atf_check -s exit:0 -o ignore gpart add -t freebsd-ufs ${md}.nops1 + gpart_physpath=$(diskinfo -p ${md}.nops1a) + atf_check_equal "${physpath}/s1/a" "$gpart_physpath" +} +mbr_bsd_physpath_cleanup() +{ + common_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case blank_physpath + atf_add_test_case bsd_physpath + atf_add_test_case gpt_physpath + atf_add_test_case mbr_physpath + atf_add_test_case mbr_bsd_physpath +} + +alloc_md() +{ + local md + + md=$(mdconfig -a -t swap -s 1M) || atf_fail "mdconfig -a failed" + echo ${md} >> $MD_DEVS + echo ${md} +} + +common_cleanup() +{ + if [ -f "$MD_DEVS" ]; then + while read test_md; do + gnop destroy -f ${test_md}.nop 2>/dev/null + mdconfig -d -u $test_md 2>/dev/null + done < $MD_DEVS + rm $MD_DEVS + fi + true +} + +load_gpart() +{ + if ! kldstat -q -m g_part; then + geom part load || atf_skip "could not load module for geom part" + fi +} + +load_gnop() +{ + if ! kldstat -q -m g_nop; then + geom nop load || atf_skip "could not load module for geom nop" + fi +} From owner-svn-src-head@freebsd.org Wed Feb 14 20:37: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 AE2B9F1E521; Wed, 14 Feb 2018 20:37:34 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 54EB06C0B9; Wed, 14 Feb 2018 20:37:34 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4691214CA1; Wed, 14 Feb 2018 20:37:34 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1EKbYho011261; Wed, 14 Feb 2018 20:37:34 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1EKbYuf011260; Wed, 14 Feb 2018 20:37:34 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201802142037.w1EKbYuf011260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 14 Feb 2018 20:37:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329276 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 329276 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 14 Feb 2018 20:37:34 -0000 Author: mjg Date: Wed Feb 14 20:37:33 2018 New Revision: 329276 URL: https://svnweb.freebsd.org/changeset/base/329276 Log: rwlock: diff-reduction of runlock compared to sx sunlock Modified: head/sys/kern/kern_rwlock.c Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Wed Feb 14 20:26:09 2018 (r329275) +++ head/sys/kern/kern_rwlock.c Wed Feb 14 20:37:33 2018 (r329276) @@ -760,22 +760,19 @@ __rw_runlock_hard(struct rwlock *rw, struct thread *td if (SCHEDULER_STOPPED()) return; + if (__rw_runlock_try(rw, td, &v)) + goto out_lockstat; + + /* + * Ok, we know we have waiters and we think we are the + * last reader, so grab the turnstile lock. + */ + turnstile_chain_lock(&rw->lock_object); + v = RW_READ_VALUE(rw); for (;;) { if (__rw_runlock_try(rw, td, &v)) break; - /* - * Ok, we know we have waiters and we think we are the - * last reader, so grab the turnstile lock. - */ - turnstile_chain_lock(&rw->lock_object); - v = RW_READ_VALUE(rw); -retry_ts: - if (__rw_runlock_try(rw, td, &v)) { - turnstile_chain_unlock(&rw->lock_object); - break; - } - v &= (RW_LOCK_WAITERS | RW_LOCK_WRITE_SPINNER); MPASS(v & RW_LOCK_WAITERS); @@ -803,7 +800,7 @@ retry_ts: } v |= RW_READERS_LOCK(1); if (!atomic_fcmpset_rel_ptr(&rw->rw_lock, &v, setv)) - goto retry_ts; + continue; if (LOCK_LOG_TEST(&rw->lock_object, 0)) CTR2(KTR_LOCK, "%s: %p last succeeded with waiters", __func__, rw); @@ -819,10 +816,11 @@ retry_ts: MPASS(ts != NULL); turnstile_broadcast(ts, queue); turnstile_unpend(ts, TS_SHARED_LOCK); - turnstile_chain_unlock(&rw->lock_object); td->td_rw_rlocks--; break; } + turnstile_chain_unlock(&rw->lock_object); +out_lockstat: LOCKSTAT_PROFILE_RELEASE_RWLOCK(rw__release, rw, LOCKSTAT_READER); } From owner-svn-src-head@freebsd.org Wed Feb 14 21:02: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 68CA7F1FF72; Wed, 14 Feb 2018 21:02:41 +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 409CF6D187; Wed, 14 Feb 2018 21:02:39 +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 83A931516B; Wed, 14 Feb 2018 21:02:38 +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 w1EL2cTQ025843; Wed, 14 Feb 2018 21:02:38 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1EL2cvf025842; Wed, 14 Feb 2018 21:02:38 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201802142102.w1EL2cvf025842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 14 Feb 2018 21:02:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329277 - head/etc/mtree X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/etc/mtree X-SVN-Commit-Revision: 329277 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 14 Feb 2018 21:02:41 -0000 Author: asomers Date: Wed Feb 14 21:02:38 2018 New Revision: 329277 URL: https://svnweb.freebsd.org/changeset/base/329277 Log: Add mtree entry for 329275 MFC after: 3 weeks X-MFC-With: 329275 Sponsored by: Spectra Logic Corp Modified: head/etc/mtree/BSD.tests.dist Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Wed Feb 14 20:37:33 2018 (r329276) +++ head/etc/mtree/BSD.tests.dist Wed Feb 14 21:02:38 2018 (r329277) @@ -450,6 +450,8 @@ .. nop .. + part + .. raid3 .. shsec From owner-svn-src-head@freebsd.org Wed Feb 14 21:17: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 0D5FEF21128; Wed, 14 Feb 2018 21:17:45 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AC4D06DCE8; Wed, 14 Feb 2018 21:17:44 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A2FD61531A; Wed, 14 Feb 2018 21:17:44 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1ELHiUN031477; Wed, 14 Feb 2018 21:17:44 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1ELHiOj031474; Wed, 14 Feb 2018 21:17:44 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201802142117.w1ELHiOj031474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Wed, 14 Feb 2018 21:17:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329279 - in head: share/man/man4 sys/netgraph X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: in head: share/man/man4 sys/netgraph X-SVN-Commit-Revision: 329279 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 14 Feb 2018 21:17:45 -0000 Author: eugen Date: Wed Feb 14 21:17:44 2018 New Revision: 329279 URL: https://svnweb.freebsd.org/changeset/base/329279 Log: ng_pppoe(8): add support for user-supplied Host-Uniq tag. A few ISP filter PADI requests based on such tag, to force the use of their own routers. The custom Host-Uniq tag is passed in the NGM_PPPOE_CONNECT control message, so it can be used with FreeBSD ppp(8) and mpd without any other change. Add support to send and receive PADM messages, HURL and MOTM, often used by service providers to provide ACS information and other configuration settings to the user CPE. Submitted by: ale Approved by: mav (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D9270 Modified: head/share/man/man4/ng_pppoe.4 head/sys/netgraph/ng_pppoe.c head/sys/netgraph/ng_pppoe.h Modified: head/share/man/man4/ng_pppoe.4 ============================================================================== --- head/share/man/man4/ng_pppoe.4 Wed Feb 14 21:14:28 2018 (r329278) +++ head/share/man/man4/ng_pppoe.4 Wed Feb 14 21:17:44 2018 (r329279) @@ -35,7 +35,7 @@ .\" $FreeBSD$ .\" $Whistle: ng_pppoe.8,v 1.1 1999/01/25 23:46:27 archie Exp $ .\" -.Dd September 15, 2015 +.Dd February 14, 2018 .Dt NG_PPPOE 4 .Os .Sh NAME @@ -104,12 +104,33 @@ the state machine as a client. It must be newly created and a service name can be given as an argument. It is legal to specify a zero-length service name, this is common on some DSL setups. -It is possible to request a connection to a specific -access concentrator by its name using the "AC-Name\\Service-Name" syntax. -A session request packet will be broadcasted on the Ethernet. +It is possible to request a connection to a specific access concentrator, +and/or set a specific Host-Uniq tag, required by some Internet providers, +using the +.Qq Li [AC-Name\\][Host-Uniq|]Service-Name +syntax. +To set a binary Host-Uniq, it must be encoded as a hexadecimal lowercase +string and prefixed with +.Qq Li 0x , +for example +.Qq Li 0x6d792d746167 +is equivalent to +.Qq Li my-tag . +A session request packet will be broadcast on the Ethernet. This command uses the .Dv ngpppoe_init_data structure shown below. +For example, this init data argument can be used to +connect to +.Qq Li my-isp +service with +.Qq Li my-host +uniq tag, accepting only +.Qq Li remote-ac +as access concentrator: +.Bd -literal -offset indent +"remote-ac\\my-host|my-isp" +.Ed .It Dv NGM_PPPOE_LISTEN Pq Ic pppoe_listen Tell a nominated newly created hook that its session should enter the state machine as a server listener. @@ -258,7 +279,41 @@ struct ngpppoe_maxp { uint16_t data; }; .Ed +.It Dv NGM_PPPOE_SEND_HURL Pq Ic send_hurl +Tell a nominated hook with an active session to send a PADM message with +a HURL tag. +The argument is the URL to be delivered to the client: +.Bd -literal -offset indent +ngctl msg fxp0:orphans send_hurl '{ hook="myHook" data="http://example.net/cpe" }' +.Ed +.It Dv NGM_PPPOE_SEND_MOTM Pq Ic send_motm +Tell a nominated hook with an active session to send a PADM message with +a MOTM tag. +The argument is the message to be delivered to the client: +.Bd -literal -offset indent +ngctl msg fxp0:orphans send_motm '{ hook="myHook" data="Welcome aboard" }' +.Ed .El +.Pp +The two commands above use the same ngpppoe_init_data structure described +above. +.Bl -tag -width 3n +.It Dv NGM_PPPOE_HURL +This command is sent to the node that started this session when a PADM +message with a HURL tag is received, and contains a URL that the host can +pass to a web browser for presentation to the user. +.It Dv NGM_PPPOE_MOTM +This command is sent to the node that started this session when a PADM +message with a MOTM tag is received, and contains a Message Of The +Minute that the host can display to the user. +.El +.Pp +The two commands above use a common data structure: +.Bd -literal -offset 4n +struct ngpppoe_padm { + char msg[PPPOE_PADM_VALUE_SIZE]; +}; +.Ed .Sh SHUTDOWN This node shuts down upon receipt of a .Dv NGM_SHUTDOWN Modified: head/sys/netgraph/ng_pppoe.c ============================================================================== --- head/sys/netgraph/ng_pppoe.c Wed Feb 14 21:14:28 2018 (r329278) +++ head/sys/netgraph/ng_pppoe.c Wed Feb 14 21:17:44 2018 (r329279) @@ -175,6 +175,20 @@ static const struct ng_cmdlist ng_pppoe_cmds[] = { &ng_parse_uint16_type, NULL }, + { + NGM_PPPOE_COOKIE, + NGM_PPPOE_SEND_HURL, + "send_hurl", + &ngpppoe_init_data_state_type, + NULL + }, + { + NGM_PPPOE_COOKIE, + NGM_PPPOE_SEND_MOTM, + "send_motm", + &ngpppoe_init_data_state_type, + NULL + }, { 0 } }; @@ -226,9 +240,11 @@ struct sess_neg { const struct pppoe_tag *tags[NUMTAGS]; u_int service_len; u_int ac_name_len; + u_int host_uniq_len; struct datatag service; struct datatag ac_name; + struct datatag host_uniq; }; typedef struct sess_neg *negp; @@ -589,22 +605,47 @@ static hook_p pppoe_finduniq(node_p node, const struct pppoe_tag *tag) { hook_p hook = NULL; - union uniq uniq; + sessp sp; - bcopy(tag + 1, uniq.bytes, sizeof(void *)); /* Cycle through all known hooks. */ LIST_FOREACH(hook, &node->nd_hooks, hk_hooks) { /* Skip any nonsession hook. */ if (NG_HOOK_PRIVATE(hook) == NULL) continue; - if (uniq.pointer == NG_HOOK_PRIVATE(hook)) + sp = NG_HOOK_PRIVATE(hook); + /* Skip already connected sessions. */ + if (sp->neg == NULL) + continue; + if (sp->neg->host_uniq_len == ntohs(tag->tag_len) && + bcmp(sp->neg->host_uniq.data, (const char *)(tag + 1), + sp->neg->host_uniq_len) == 0) break; } - CTR3(KTR_NET, "%20s: matched %p for %p", __func__, hook, uniq.pointer); + CTR3(KTR_NET, "%20s: matched %p for %p", __func__, hook, sp); return (hook); } +static hook_p +pppoe_findcookie(node_p node, const struct pppoe_tag *tag) +{ + hook_p hook = NULL; + union uniq cookie; + + bcopy(tag + 1, cookie.bytes, sizeof(void *)); + /* Cycle through all known hooks. */ + LIST_FOREACH(hook, &node->nd_hooks, hk_hooks) { + /* Skip any nonsession hook. */ + if (NG_HOOK_PRIVATE(hook) == NULL) + continue; + if (cookie.pointer == NG_HOOK_PRIVATE(hook)) + break; + } + CTR3(KTR_NET, "%20s: matched %p for %p", __func__, hook, cookie.pointer); + + return (hook); +} + /************************************************************************** * Start of Netgraph entrypoints. * **************************************************************************/ @@ -744,17 +785,29 @@ ng_pppoe_rcvmsg(node_p node, item_p item, hook_p lasth case NGM_PPPOE_LISTEN: case NGM_PPPOE_OFFER: case NGM_PPPOE_SERVICE: + case NGM_PPPOE_SEND_HURL: + case NGM_PPPOE_SEND_MOTM: ourmsg = (struct ngpppoe_init_data *)msg->data; if (msg->header.arglen < sizeof(*ourmsg)) { log(LOG_ERR, "ng_pppoe[%x]: init data too " "small\n", node->nd_ID); LEAVE(EMSGSIZE); } - if (msg->header.arglen - sizeof(*ourmsg) > - PPPOE_SERVICE_NAME_SIZE) { - log(LOG_ERR, "ng_pppoe[%x]: service name " - "too big\n", node->nd_ID); - LEAVE(EMSGSIZE); + if (msg->header.cmd == NGM_PPPOE_SEND_HURL || + msg->header.cmd == NGM_PPPOE_SEND_MOTM) { + if (msg->header.arglen - sizeof(*ourmsg) > + PPPOE_PADM_VALUE_SIZE) { + log(LOG_ERR, "ng_pppoe[%x]: message " + "too big\n", node->nd_ID); + LEAVE(EMSGSIZE); + } + } else { + if (msg->header.arglen - sizeof(*ourmsg) > + PPPOE_SERVICE_NAME_SIZE) { + log(LOG_ERR, "ng_pppoe[%x]: service name " + "too big\n", node->nd_ID); + LEAVE(EMSGSIZE); + } } if (msg->header.arglen - sizeof(*ourmsg) < ourmsg->data_len) { @@ -794,6 +847,20 @@ ng_pppoe_rcvmsg(node_p node, item_p item, hook_p lasth if (msg->header.cmd == NGM_PPPOE_SERVICE) break; + /* + * PADM messages are set up on active sessions. + */ + if (msg->header.cmd == NGM_PPPOE_SEND_HURL || + msg->header.cmd == NGM_PPPOE_SEND_MOTM) { + if (sp->state != PPPOE_NEWCONNECTED && + sp->state != PPPOE_CONNECTED) { + log(LOG_NOTICE, "ng_pppoe[%x]: session is not " + "active\n", node->nd_ID); + LEAVE(EISCONN); + } + break; + } + if (sp->state != PPPOE_SNONE) { log(LOG_NOTICE, "ng_pppoe[%x]: Session already " "active\n", node->nd_ID); @@ -848,12 +915,15 @@ ng_pppoe_rcvmsg(node_p node, item_p item, hook_p lasth * Check the hook exists and is Uninitialised. * Send a PADI request, and start the timeout logic. * Store the originator of this message so we can send - * a success of fail message to them later. + * a success or fail message to them later. * Move the session to SINIT. * Set up the session to the correct state and * start it. */ - int i, acnlen = 0, acnsep = 0, srvlen; + int acnpos, acnlen = 0, acnsep = 0; + int hupos, hulen = 0, husep = 0; + int i, srvpos, srvlen; + acnpos = 0; for (i = 0; i < ourmsg->data_len; i++) { if (ourmsg->data[i] == '\\') { acnlen = i; @@ -861,15 +931,56 @@ ng_pppoe_rcvmsg(node_p node, item_p item, hook_p lasth break; } } - srvlen = ourmsg->data_len - acnlen - acnsep; + hupos = acnlen + acnsep; + for (i = hupos; i < ourmsg->data_len; i++) { + if (ourmsg->data[i] == '|') { + hulen = i - hupos; + husep = 1; + break; + } + } + srvpos = hupos + hulen + husep; + srvlen = ourmsg->data_len - srvpos; - bcopy(ourmsg->data, neg->ac_name.data, acnlen); + bcopy(ourmsg->data + acnpos, neg->ac_name.data, acnlen); neg->ac_name_len = acnlen; + neg->host_uniq.hdr.tag_type = PTT_HOST_UNIQ; + if (hulen == 0) { + /* Not provided, generate one */ + neg->host_uniq.hdr.tag_len = htons(sizeof(sp)); + bcopy(&sp, neg->host_uniq.data, sizeof(sp)); + neg->host_uniq_len = sizeof(sp); + } else if (hulen > 2 && ourmsg->data[hupos] == '0' && + ourmsg->data[hupos + 1] == 'x' && hulen % 2 == 0) { + /* Hex encoded */ + static const char hexdig[16] = "0123456789abcdef"; + int j; + + neg->host_uniq.hdr.tag_len = htons((uint16_t)(hulen / 2 - 1)); + for (i = 0; i < hulen - 2; i++) { + for (j = 0; + j < 16 && + ourmsg->data[hupos + 2 + i] != hexdig[j]; + j++); + if (j == 16) + LEAVE(EINVAL); + if (i % 2 == 0) + neg->host_uniq.data[i / 2] = j << 4; + else + neg->host_uniq.data[i / 2] |= j; + } + neg->host_uniq_len = hulen / 2 - 1; + } else { + /* Plain string */ + neg->host_uniq.hdr.tag_len = htons((uint16_t)hulen); + bcopy(ourmsg->data + hupos, neg->host_uniq.data, hulen); + neg->host_uniq_len = hulen; + } + neg->service.hdr.tag_type = PTT_SRV_NAME; neg->service.hdr.tag_len = htons((uint16_t)srvlen); - bcopy(ourmsg->data + acnlen + acnsep, - neg->service.data, srvlen); + bcopy(ourmsg->data + srvpos, neg->service.data, srvlen); neg->service_len = srvlen; pppoe_start(sp); break; @@ -879,7 +990,7 @@ ng_pppoe_rcvmsg(node_p node, item_p item, hook_p lasth * Check the hook exists and is Uninitialised. * Install the service matching string. * Store the originator of this message so we can send - * a success of fail message to them later. + * a success or fail message to them later. * Move the hook to 'LISTENING' */ neg->service.hdr.tag_type = PTT_SRV_NAME; @@ -1019,6 +1130,92 @@ ng_pppoe_rcvmsg(node_p node, item_p item, hook_p lasth privp->max_payload.hdr.tag_len = htons(sizeof(uint16_t)); privp->max_payload.data = htons(*((uint16_t *)msg->data)); break; + case NGM_PPPOE_SEND_HURL: + { + struct mbuf *m; + + /* Generate a packet of that type. */ + m = m_gethdr(M_NOWAIT, MT_DATA); + if (m == NULL) + log(LOG_NOTICE, "ng_pppoe[%x]: session out of " + "mbufs\n", node->nd_ID); + else { + struct pppoe_full_hdr *wh; + struct pppoe_tag *tag; + int error = 0; + + wh = mtod(m, struct pppoe_full_hdr *); + bcopy(&sp->pkt_hdr, wh, sizeof(*wh)); + + /* Revert the stored header to DISC/PADM mode. */ + wh->ph.code = PADM_CODE; + /* + * Configure ethertype depending on what + * was used during sessions stage. + */ + if (wh->eh.ether_type == + ETHERTYPE_PPPOE_3COM_SESS) + wh->eh.ether_type = ETHERTYPE_PPPOE_3COM_DISC; + else + wh->eh.ether_type = ETHERTYPE_PPPOE_DISC; + /* + * Add PADM message and adjust sizes. + */ + tag = (void *)(&wh->ph + 1); + tag->tag_type = PTT_HURL; + tag->tag_len = htons(ourmsg->data_len); + strncpy((char *)(tag + 1), ourmsg->data, ourmsg->data_len); + m->m_pkthdr.len = m->m_len = sizeof(*wh) + sizeof(*tag) + + ourmsg->data_len; + wh->ph.length = htons(sizeof(*tag) + ourmsg->data_len); + NG_SEND_DATA_ONLY(error, + privp->ethernet_hook, m); + } + break; + } + case NGM_PPPOE_SEND_MOTM: + { + struct mbuf *m; + + /* Generate a packet of that type. */ + m = m_gethdr(M_NOWAIT, MT_DATA); + if (m == NULL) + log(LOG_NOTICE, "ng_pppoe[%x]: session out of " + "mbufs\n", node->nd_ID); + else { + struct pppoe_full_hdr *wh; + struct pppoe_tag *tag; + int error = 0; + + wh = mtod(m, struct pppoe_full_hdr *); + bcopy(&sp->pkt_hdr, wh, sizeof(*wh)); + + /* Revert the stored header to DISC/PADM mode. */ + wh->ph.code = PADM_CODE; + /* + * Configure ethertype depending on what + * was used during sessions stage. + */ + if (wh->eh.ether_type == + ETHERTYPE_PPPOE_3COM_SESS) + wh->eh.ether_type = ETHERTYPE_PPPOE_3COM_DISC; + else + wh->eh.ether_type = ETHERTYPE_PPPOE_DISC; + /* + * Add PADM message and adjust sizes. + */ + tag = (void *)(&wh->ph + 1); + tag->tag_type = PTT_MOTM; + tag->tag_len = htons(ourmsg->data_len); + strncpy((char *)(tag + 1), ourmsg->data, ourmsg->data_len); + m->m_pkthdr.len = m->m_len = sizeof(*wh) + sizeof(*tag) + + ourmsg->data_len; + wh->ph.length = htons(sizeof(*tag) + ourmsg->data_len); + NG_SEND_DATA_ONLY(error, + privp->ethernet_hook, m); + } + break; + } default: LEAVE(EINVAL); } @@ -1061,10 +1258,6 @@ pppoe_start(sessp sp) node_p node = NG_HOOK_NODE(hook); priv_p privp = NG_NODE_PRIVATE(node); negp neg = sp->neg; - struct { - struct pppoe_tag hdr; - union uniq data; - } __packed uniqtag; struct mbuf *m0; int error; @@ -1080,11 +1273,8 @@ pppoe_start(sessp sp) memcpy((void *)&neg->pkt->pkt_header.eh, &privp->eh, sizeof(struct ether_header)); neg->pkt->pkt_header.ph.code = PADI_CODE; - uniqtag.hdr.tag_type = PTT_HOST_UNIQ; - uniqtag.hdr.tag_len = htons((u_int16_t)sizeof(uniqtag.data)); - uniqtag.data.pointer = sp; init_tags(sp); - insert_tag(sp, &uniqtag.hdr); + insert_tag(sp, &neg->host_uniq.hdr); insert_tag(sp, &neg->service.hdr); if (privp->max_payload.data != 0) insert_tag(sp, &privp->max_payload.hdr); @@ -1163,6 +1353,52 @@ send_maxp(sessp sp, const struct pppoe_tag *tag) return (error); } +static int +send_hurl(sessp sp, const struct pppoe_tag *tag) +{ + int error, tlen; + struct ng_mesg *msg; + struct ngpppoe_padm *padm; + + CTR2(KTR_NET, "%20s: called %d", __func__, sp->Session_ID); + + NG_MKMESSAGE(msg, NGM_PPPOE_COOKIE, NGM_PPPOE_HURL, + sizeof(struct ngpppoe_padm), M_NOWAIT); + if (msg == NULL) + return (ENOMEM); + + padm = (struct ngpppoe_padm *)msg->data; + tlen = min(PPPOE_PADM_VALUE_SIZE - 1, ntohs(tag->tag_len)); + strncpy(padm->msg, (const char *)(tag + 1), tlen); + padm->msg[tlen] = '\0'; + NG_SEND_MSG_ID(error, NG_HOOK_NODE(sp->hook), msg, sp->creator, 0); + + return (error); +} + +static int +send_motm(sessp sp, const struct pppoe_tag *tag) +{ + int error, tlen; + struct ng_mesg *msg; + struct ngpppoe_padm *padm; + + CTR2(KTR_NET, "%20s: called %d", __func__, sp->Session_ID); + + NG_MKMESSAGE(msg, NGM_PPPOE_COOKIE, NGM_PPPOE_MOTM, + sizeof(struct ngpppoe_padm), M_NOWAIT); + if (msg == NULL) + return (ENOMEM); + + padm = (struct ngpppoe_padm *)msg->data; + tlen = min(PPPOE_PADM_VALUE_SIZE - 1, ntohs(tag->tag_len)); + strncpy(padm->msg, (const char *)(tag + 1), tlen); + padm->msg[tlen] = '\0'; + NG_SEND_MSG_ID(error, NG_HOOK_NODE(sp->hook), msg, sp->creator, 0); + + return (error); +} + /* * Receive data from session hook and do something with it. */ @@ -1320,6 +1556,7 @@ ng_pppoe_rcvdata_ether(hook_p hook, item_p item) const priv_p privp = NG_NODE_PRIVATE(node); sessp sp; const struct pppoe_tag *utag = NULL, *tag = NULL; + const struct pppoe_tag sntag = { PTT_SRV_NAME, 0 }; const struct pppoe_full_hdr *wh; const struct pppoe_hdr *ph; negp neg = NULL; @@ -1409,11 +1646,8 @@ ng_pppoe_rcvdata_ether(hook_p hook, item_p item) * processing. */ tag = get_tag(ph, PTT_SRV_NAME); - if (tag == NULL) { - CTR1(KTR_NET, "%20s: PADI w/o Service-Name", - __func__); - LEAVE(ENETUNREACH); - } + if (tag == NULL) + tag = &sntag; /* * First, try to match Service-Name against our @@ -1438,8 +1672,7 @@ ng_pppoe_rcvdata_ether(hook_p hook, item_p item) * For now simply accept the first we receive. */ utag = get_tag(ph, PTT_HOST_UNIQ); - if ((utag == NULL) || - (ntohs(utag->tag_len) != sizeof(sp))) { + if (utag == NULL) { log(LOG_NOTICE, "ng_pppoe[%x]: no host " "unique field\n", node->nd_ID); LEAVE(ENETUNREACH); @@ -1529,7 +1762,7 @@ ng_pppoe_rcvdata_ether(hook_p hook, item_p item) LEAVE(ENETUNREACH); } - sendhook = pppoe_finduniq(node, utag); + sendhook = pppoe_findcookie(node, utag); if (sendhook == NULL) LEAVE(ENETUNREACH); @@ -1605,8 +1838,7 @@ ng_pppoe_rcvdata_ether(hook_p hook, item_p item) * set us into Session mode. */ utag = get_tag(ph, PTT_HOST_UNIQ); - if ((utag == NULL) || - (ntohs(utag->tag_len) != sizeof(sp))) { + if (utag == NULL) { LEAVE (ENETUNREACH); } sendhook = pppoe_finduniq(node, utag); @@ -1659,6 +1891,19 @@ ng_pppoe_rcvdata_ether(hook_p hook, item_p item) /* Disconnect that hook. */ ng_rmhook_self(sp->hook); break; + case PADM_CODE: + /* + * We are a client: + * find matching peer/session combination. + */ + sp = pppoe_findsession(privp, wh); + if (sp == NULL) + LEAVE (ENETUNREACH); + if ((tag = get_tag(ph, PTT_HURL))) + send_hurl(sp, tag); + if ((tag = get_tag(ph, PTT_MOTM))) + send_motm(sp, tag); + break; default: LEAVE(EPFNOSUPPORT); } @@ -1781,7 +2026,7 @@ ng_pppoe_disconnect(hook_p hook) struct mbuf *m; /* Generate a packet of that type. */ - MGETHDR(m, M_NOWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) log(LOG_NOTICE, "ng_pppoe[%x]: session out of " "mbufs\n", node->nd_ID); @@ -1791,8 +2036,6 @@ ng_pppoe_disconnect(hook_p hook) int msglen = strlen(SIGNOFF); int error = 0; - m->m_pkthdr.rcvif = NULL; - m->m_pkthdr.len = m->m_len = sizeof(*wh); wh = mtod(m, struct pppoe_full_hdr *); bcopy(&sp->pkt_hdr, wh, sizeof(*wh)); @@ -1815,8 +2058,8 @@ ng_pppoe_disconnect(hook_p hook) tag->tag_type = PTT_GEN_ERR; tag->tag_len = htons((u_int16_t)msglen); strncpy((char *)(tag + 1), SIGNOFF, msglen); - m->m_pkthdr.len = (m->m_len += sizeof(*tag) + - msglen); + m->m_pkthdr.len = m->m_len = sizeof(*wh) + sizeof(*tag) + + msglen; wh->ph.length = htons(sizeof(*tag) + msglen); NG_SEND_DATA_ONLY(error, privp->ethernet_hook, m); @@ -1933,6 +2176,8 @@ scan_tags(sessp sp, const struct pppoe_hdr* ph) case PTT_SYS_ERR: case PTT_GEN_ERR: case PTT_MAX_PAYL: + case PTT_HURL: + case PTT_MOTM: break; } pt = (const struct pppoe_tag*)ptn; Modified: head/sys/netgraph/ng_pppoe.h ============================================================================== --- head/sys/netgraph/ng_pppoe.h Wed Feb 14 21:14:28 2018 (r329278) +++ head/sys/netgraph/ng_pppoe.h Wed Feb 14 21:17:44 2018 (r329279) @@ -52,8 +52,10 @@ #define NGM_PPPOE_COOKIE 1089893072 #define NGM_PPPOE_SETMAXP_COOKIE 1441624322 +#define NGM_PPPOE_PADM_COOKIE 1488405822 #define PPPOE_SERVICE_NAME_SIZE 64 /* for now */ +#define PPPOE_PADM_VALUE_SIZE 128 /* for now */ /* Hook names */ #define NG_PPPOE_HOOK_ETHERNET "ethernet" @@ -84,7 +86,11 @@ enum cmd { NGM_PPPOE_SETMODE = 12, /* set to standard or compat modes */ NGM_PPPOE_GETMODE = 13, /* see current mode */ NGM_PPPOE_SETENADDR = 14, /* set Ethernet address */ - NGM_PPPOE_SETMAXP = 15 /* Set PPP-Max-Payload value */ + NGM_PPPOE_SETMAXP = 15, /* Set PPP-Max-Payload value */ + NGM_PPPOE_SEND_HURL = 16, /* Send PADM HURL message */ + NGM_PPPOE_HURL = 17, /* HURL for informational purposes */ + NGM_PPPOE_SEND_MOTM = 18, /* Send PADM MOTM message */ + NGM_PPPOE_MOTM = 19 /* MOTM for informational purposes */ }; /*********************** @@ -157,6 +163,13 @@ struct ngpppoe_maxp { uint16_t data; }; +/* + * This structure is used to send PADM messages from server to client. + */ +struct ngpppoe_padm { + char msg[PPPOE_PADM_VALUE_SIZE]; +}; + /******************************************************************** * Constants and definitions specific to pppoe ********************************************************************/ @@ -171,6 +184,7 @@ struct ngpppoe_maxp { #define PADR_CODE 0x19 #define PADS_CODE 0x65 #define PADT_CODE 0xa7 +#define PADM_CODE 0xd3 /* Tag identifiers */ #if BYTE_ORDER == BIG_ENDIAN @@ -181,6 +195,8 @@ struct ngpppoe_maxp { #define PTT_AC_COOKIE (0x0104) #define PTT_VENDOR (0x0105) #define PTT_RELAY_SID (0x0110) +#define PTT_HURL (0x0111) /* PPPoE Extensions (CARREL) */ +#define PTT_MOTM (0x0112) /* PPPoE Extensions (CARREL) */ #define PTT_MAX_PAYL (0x0120) /* PPP-Max-Payload (RFC4638) */ #define PTT_SRV_ERR (0x0201) #define PTT_SYS_ERR (0x0202) @@ -198,6 +214,8 @@ struct ngpppoe_maxp { #define PTT_AC_COOKIE (0x0401) #define PTT_VENDOR (0x0501) #define PTT_RELAY_SID (0x1001) +#define PTT_HURL (0x1101) /* PPPoE Extensions (CARREL) */ +#define PTT_MOTM (0x1201) /* PPPoE Extensions (CARREL) */ #define PTT_MAX_PAYL (0x2001) /* PPP-Max-Payload (RFC4638) */ #define PTT_SRV_ERR (0x0102) #define PTT_SYS_ERR (0x0202) From owner-svn-src-head@freebsd.org Wed Feb 14 23: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 C2703F06617; Wed, 14 Feb 2018 23:35:48 +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 7201E73542; Wed, 14 Feb 2018 23:35:48 +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 52D5A16A28; Wed, 14 Feb 2018 23:35:48 +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 w1ENZmfh002609; Wed, 14 Feb 2018 23:35:48 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1ENZmVU002607; Wed, 14 Feb 2018 23:35:48 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802142335.w1ENZmVU002607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 14 Feb 2018 23:35:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329281 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 329281 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 14 Feb 2018 23:35:49 -0000 Author: cem Date: Wed Feb 14 23:35:47 2018 New Revision: 329281 URL: https://svnweb.freebsd.org/changeset/base/329281 Log: x86 pmap: Make memory mapped via pmap_qenter() non-executable The idea is, the pmap_qenter() API is now defined to not produce executable mappings. If you need executable mappings, use another API. Add pg_nx flag in pmap_qenter on x86 to make kernel pages non-executable. Other architectures that support execute-specific permissons on page table entries should subsequently be updated to match. Submitted by: Darrick Lew Reviewed by: markj Discussed with: alc, jhb, kib Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D14062 Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Wed Feb 14 21:39:10 2018 (r329280) +++ head/sys/amd64/amd64/pmap.c Wed Feb 14 23:35:47 2018 (r329281) @@ -2338,7 +2338,7 @@ pmap_qenter(vm_offset_t sva, vm_page_t *ma, int count) pa = VM_PAGE_TO_PHYS(m) | cache_bits; if ((*pte & (PG_FRAME | X86_PG_PTE_CACHE)) != pa) { oldpte |= *pte; - pte_store(pte, pa | pg_g | X86_PG_RW | X86_PG_V); + pte_store(pte, pa | pg_g | pg_nx | X86_PG_RW | X86_PG_V); } pte++; } Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Wed Feb 14 21:39:10 2018 (r329280) +++ head/sys/i386/i386/pmap.c Wed Feb 14 23:35:47 2018 (r329281) @@ -1677,7 +1677,11 @@ pmap_qenter(vm_offset_t sva, vm_page_t *ma, int count) pa = VM_PAGE_TO_PHYS(m) | pmap_cache_bits(m->md.pat_mode, 0); if ((*pte & (PG_FRAME | PG_PTE_CACHE)) != pa) { oldpte |= *pte; +#if defined(PAE) || defined(PAE_TABLES) + pte_store(pte, pa | pgeflag | pg_nx | PG_RW | PG_V); +#else pte_store(pte, pa | pgeflag | PG_RW | PG_V); +#endif } pte++; } From owner-svn-src-head@freebsd.org Wed Feb 14 23:47: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 847FDF07226; Wed, 14 Feb 2018 23:47:05 +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 3314273CB7; Wed, 14 Feb 2018 23:47:05 +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 2DEBA16BE6; Wed, 14 Feb 2018 23:47:05 +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 w1ENl4vr007624; Wed, 14 Feb 2018 23:47:04 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1ENl4In007623; Wed, 14 Feb 2018 23:47:04 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802142347.w1ENl4In007623@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 14 Feb 2018 23:47:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329282 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 329282 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 14 Feb 2018 23:47:05 -0000 Author: cem Date: Wed Feb 14 23:47:04 2018 New Revision: 329282 URL: https://svnweb.freebsd.org/changeset/base/329282 Log: pmap_qenter.9: Document API NX mapping A follow-up to r329281. Sponsored by: Dell EMC Isilon Modified: head/share/man/man9/pmap_qenter.9 Modified: head/share/man/man9/pmap_qenter.9 ============================================================================== --- head/share/man/man9/pmap_qenter.9 Wed Feb 14 23:35:47 2018 (r329281) +++ head/share/man/man9/pmap_qenter.9 Wed Feb 14 23:47:04 2018 (r329282) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 21, 2003 +.Dd February 14, 2018 .Dt PMAP_QENTER 9 .Os .Sh NAME @@ -50,6 +50,7 @@ pointers to wired pages and enters each of these pages into the kernel virtual address (KVA) space, beginning at the address .Fa sva . +The pages are mapped non-executable. .Pp The .Fn pmap_qremove From owner-svn-src-head@freebsd.org Wed Feb 14 23:52: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 4F23AF07949; Wed, 14 Feb 2018 23:52:40 +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 0148A742CB; Wed, 14 Feb 2018 23:52:40 +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 F02AE16D7A; Wed, 14 Feb 2018 23:52:39 +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 w1ENqdcm012239; Wed, 14 Feb 2018 23:52:39 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1ENqd6b012235; Wed, 14 Feb 2018 23:52:39 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201802142352.w1ENqd6b012235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 14 Feb 2018 23:52:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329284 - in head: cddl/usr.sbin/zfsd lib/libdevdctl X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head: cddl/usr.sbin/zfsd lib/libdevdctl X-SVN-Commit-Revision: 329284 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 14 Feb 2018 23:52:40 -0000 Author: asomers Date: Wed Feb 14 23:52:39 2018 New Revision: 329284 URL: https://svnweb.freebsd.org/changeset/base/329284 Log: zfsd: Allow zfsd to work on any type of GEOM provider cddl/usr.sbin/zfsd/zfsd_event.cc Remove the check for da and ada devices. This way zfsd can work on md, geli, glabel, gstripe, etc devices. geli in particular is useful combined with ZFS. gnop is also useful for simulating drive pulls in the ZFSD test suite. Also, eliminate the DevfsEvent class entirely. Move its responsibilities into GeomEvent. We can get everything we need to know just from listening to GEOM events. lib/libdevdctl/event.cc Fix GeomEvent::DevName for CREATE events. Oddly, the relevant field is named "cdev" for CREATE events but "devname" for disk events. MFC after: 3 weeks Relnotes: Yes (probably worth mentioning the geli part) Sponsored by: Spectra Logic Corp Modified: head/cddl/usr.sbin/zfsd/zfsd.cc head/cddl/usr.sbin/zfsd/zfsd_event.cc head/cddl/usr.sbin/zfsd/zfsd_event.h head/lib/libdevdctl/event.cc Modified: head/cddl/usr.sbin/zfsd/zfsd.cc ============================================================================== --- head/cddl/usr.sbin/zfsd/zfsd.cc Wed Feb 14 23:51:44 2018 (r329283) +++ head/cddl/usr.sbin/zfsd/zfsd.cc Wed Feb 14 23:52:39 2018 (r329284) @@ -98,7 +98,6 @@ int ZfsDaemon::s_signalPipeFD[2]; bool ZfsDaemon::s_systemRescanRequested(false); EventFactory::Record ZfsDaemon::s_registryEntries[] = { - { Event::NOTIFY, "DEVFS", &DevfsEvent::Builder }, { Event::NOTIFY, "GEOM", &GeomEvent::Builder }, { Event::NOTIFY, "ZFS", &ZfsEvent::Builder } }; Modified: head/cddl/usr.sbin/zfsd/zfsd_event.cc ============================================================================== --- head/cddl/usr.sbin/zfsd/zfsd_event.cc Wed Feb 14 23:51:44 2018 (r329283) +++ head/cddl/usr.sbin/zfsd/zfsd_event.cc Wed Feb 14 23:52:39 2018 (r329284) @@ -76,111 +76,32 @@ using std::stringstream; /*=========================== Class Implementations ==========================*/ -/*-------------------------------- DevfsEvent --------------------------------*/ +/*-------------------------------- GeomEvent --------------------------------*/ -//- DevfsEvent Static Public Methods ------------------------------------------- +//- GeomEvent Static Public Methods ------------------------------------------- Event * -DevfsEvent::Builder(Event::Type type, - NVPairMap &nvPairs, - const string &eventString) +GeomEvent::Builder(Event::Type type, + NVPairMap &nvPairs, + const string &eventString) { - return (new DevfsEvent(type, nvPairs, eventString)); + return (new GeomEvent(type, nvPairs, eventString)); } -//- DevfsEvent Static Protected Methods ---------------------------------------- -nvlist_t * -DevfsEvent::ReadLabel(int devFd, bool &inUse, bool °raded) -{ - pool_state_t poolState; - char *poolName; - boolean_t b_inuse; - int nlabels; - - inUse = false; - degraded = false; - poolName = NULL; - if (zpool_in_use(g_zfsHandle, devFd, &poolState, - &poolName, &b_inuse) == 0) { - nvlist_t *devLabel = NULL; - - inUse = b_inuse == B_TRUE; - if (poolName != NULL) - free(poolName); - - nlabels = zpool_read_all_labels(devFd, &devLabel); - /* - * If we find a disk with fewer than the maximum number of - * labels, it might be the whole disk of a partitioned disk - * where ZFS resides on a partition. In that case, we should do - * nothing and wait for the partition to appear. Or, the disk - * might be damaged. In that case, zfsd should do nothing and - * wait for the sysadmin to decide. - */ - if (nlabels != VDEV_LABELS || devLabel == NULL) { - nvlist_free(devLabel); - return (NULL); - } - - try { - Vdev vdev(devLabel); - degraded = vdev.State() != VDEV_STATE_HEALTHY; - return (devLabel); - } catch (ZfsdException &exp) { - string devName = fdevname(devFd); - string devPath = _PATH_DEV + devName; - string context("DevfsEvent::ReadLabel: " - + devPath + ": "); - - exp.GetString().insert(0, context); - exp.Log(); - nvlist_free(devLabel); - } - } - return (NULL); -} - -bool -DevfsEvent::OnlineByLabel(const string &devPath, const string& physPath, - nvlist_t *devConfig) -{ - try { - /* - * A device with ZFS label information has been - * inserted. If it matches a device for which we - * have a case, see if we can solve that case. - */ - syslog(LOG_INFO, "Interrogating VDEV label for %s\n", - devPath.c_str()); - Vdev vdev(devConfig); - CaseFile *caseFile(CaseFile::Find(vdev.PoolGUID(), - vdev.GUID())); - if (caseFile != NULL) - return (caseFile->ReEvaluate(devPath, physPath, &vdev)); - - } catch (ZfsdException &exp) { - string context("DevfsEvent::OnlineByLabel: " + devPath + ": "); - - exp.GetString().insert(0, context); - exp.Log(); - } - return (false); -} - -//- DevfsEvent Virtual Public Methods ------------------------------------------ +//- GeomEvent Virtual Public Methods ------------------------------------------ Event * -DevfsEvent::DeepCopy() const +GeomEvent::DeepCopy() const { - return (new DevfsEvent(*this)); + return (new GeomEvent(*this)); } - + bool -DevfsEvent::Process() const +GeomEvent::Process() const { /* - * We are only concerned with newly discovered - * devices that can be ZFS vdevs. + * We are only concerned with create arrivals and physical path changes, + * because those can be used to satisfy online and autoreplace operations */ - if (Value("type") != "CREATE" || !IsDiskDev()) + if (Value("type") != "GEOM::physpath" && Value("type") != "CREATE") return (false); /* Log the event since it is of interest. */ @@ -199,7 +120,7 @@ DevfsEvent::Process() const nvlist_t *devLabel(ReadLabel(devFd, inUse, degraded)); string physPath; - bool havePhysPath(PhysicalPath(physPath)); + bool havePhysPath(PhysicalPath(physPath)); string devName; DevName(devName); @@ -211,8 +132,8 @@ DevfsEvent::Process() const syslog(LOG_INFO, "%s is marked degraded. Ignoring " "as a replace by physical path candidate.\n", devName.c_str()); - } else if (havePhysPath && IsWholeDev()) { - /* + } else if (havePhysPath) { + /* * TODO: attempt to resolve events using every casefile * that matches this physpath */ @@ -227,93 +148,97 @@ DevfsEvent::Process() const caseFile->ReEvaluate(devPath, physPath, /*vdev*/NULL); } } - if (devLabel != NULL) - nvlist_free(devLabel); return (false); } -//- DevfsEvent Protected Methods ----------------------------------------------- -DevfsEvent::DevfsEvent(Event::Type type, NVPairMap &nvpairs, +//- GeomEvent Protected Methods ----------------------------------------------- +GeomEvent::GeomEvent(Event::Type type, NVPairMap &nvpairs, const string &eventString) - : DevdCtl::DevfsEvent(type, nvpairs, eventString) + : DevdCtl::GeomEvent(type, nvpairs, eventString) { } -DevfsEvent::DevfsEvent(const DevfsEvent &src) - : DevdCtl::DevfsEvent::DevfsEvent(src) +GeomEvent::GeomEvent(const GeomEvent &src) + : DevdCtl::GeomEvent::GeomEvent(src) { } -/*-------------------------------- GeomEvent --------------------------------*/ - -//- GeomEvent Static Public Methods ------------------------------------------- -Event * -GeomEvent::Builder(Event::Type type, - NVPairMap &nvPairs, - const string &eventString) +nvlist_t * +GeomEvent::ReadLabel(int devFd, bool &inUse, bool °raded) { - return (new GeomEvent(type, nvPairs, eventString)); -} + pool_state_t poolState; + char *poolName; + boolean_t b_inuse; + int nlabels; -//- GeomEvent Virtual Public Methods ------------------------------------------ -Event * -GeomEvent::DeepCopy() const -{ - return (new GeomEvent(*this)); -} - -bool -GeomEvent::Process() const -{ - /* - * We are only concerned with physical path changes, because those can - * be used to satisfy autoreplace operations - */ - if (Value("type") != "GEOM::physpath" || !IsDiskDev()) - return (false); + inUse = false; + degraded = false; + poolName = NULL; + if (zpool_in_use(g_zfsHandle, devFd, &poolState, + &poolName, &b_inuse) == 0) { + nvlist_t *devLabel = NULL; - /* Log the event since it is of interest. */ - Log(LOG_INFO); + inUse = b_inuse == B_TRUE; + if (poolName != NULL) + free(poolName); - string devPath; - if (!DevPath(devPath)) - return (false); + nlabels = zpool_read_all_labels(devFd, &devLabel); + /* + * If we find a disk with fewer than the maximum number of + * labels, it might be the whole disk of a partitioned disk + * where ZFS resides on a partition. In that case, we should do + * nothing and wait for the partition to appear. Or, the disk + * might be damaged. In that case, zfsd should do nothing and + * wait for the sysadmin to decide. + */ + if (nlabels != VDEV_LABELS || devLabel == NULL) { + nvlist_free(devLabel); + return (NULL); + } - string physPath; - bool havePhysPath(PhysicalPath(physPath)); + try { + Vdev vdev(devLabel); + degraded = vdev.State() != VDEV_STATE_HEALTHY; + return (devLabel); + } catch (ZfsdException &exp) { + string devName = fdevname(devFd); + string devPath = _PATH_DEV + devName; + string context("GeomEvent::ReadLabel: " + + devPath + ": "); - string devName; - DevName(devName); - - if (havePhysPath) { - /* - * TODO: attempt to resolve events using every casefile - * that matches this physpath - */ - CaseFile *caseFile(CaseFile::Find(physPath)); - if (caseFile != NULL) { - syslog(LOG_INFO, - "Found CaseFile(%s:%s:%s) - ReEvaluating\n", - caseFile->PoolGUIDString().c_str(), - caseFile->VdevGUIDString().c_str(), - zpool_state_to_name(caseFile->VdevState(), - VDEV_AUX_NONE)); - caseFile->ReEvaluate(devPath, physPath, /*vdev*/NULL); + exp.GetString().insert(0, context); + exp.Log(); + nvlist_free(devLabel); } } - return (false); + return (NULL); } -//- GeomEvent Protected Methods ----------------------------------------------- -GeomEvent::GeomEvent(Event::Type type, NVPairMap &nvpairs, - const string &eventString) - : DevdCtl::GeomEvent(type, nvpairs, eventString) +bool +GeomEvent::OnlineByLabel(const string &devPath, const string& physPath, + nvlist_t *devConfig) { -} + try { + /* + * A device with ZFS label information has been + * inserted. If it matches a device for which we + * have a case, see if we can solve that case. + */ + syslog(LOG_INFO, "Interrogating VDEV label for %s\n", + devPath.c_str()); + Vdev vdev(devConfig); + CaseFile *caseFile(CaseFile::Find(vdev.PoolGUID(), + vdev.GUID())); + if (caseFile != NULL) + return (caseFile->ReEvaluate(devPath, physPath, &vdev)); -GeomEvent::GeomEvent(const GeomEvent &src) - : DevdCtl::GeomEvent::GeomEvent(src) -{ + } catch (ZfsdException &exp) { + string context("GeomEvent::OnlineByLabel: " + devPath + ": "); + + exp.GetString().insert(0, context); + exp.Log(); + } + return (false); } Modified: head/cddl/usr.sbin/zfsd/zfsd_event.h ============================================================================== --- head/cddl/usr.sbin/zfsd/zfsd_event.h Wed Feb 14 23:51:44 2018 (r329283) +++ head/cddl/usr.sbin/zfsd/zfsd_event.h Wed Feb 14 23:52:39 2018 (r329284) @@ -60,63 +60,6 @@ typedef struct zpool_handle zpool_handle_t; struct nvlist; typedef struct nvlist nvlist_t; -/*============================= Class Definitions ============================*/ -/*-------------------------------- DevfsEvent --------------------------------*/ -class DevfsEvent : public DevdCtl::DevfsEvent -{ -public: - /** Specialized DevdCtlEvent object factory for Devfs events. */ - static BuildMethod Builder; - - virtual DevdCtl::Event *DeepCopy() const; - - /** - * Interpret and perform any actions necessary to - * consume the event. - * \return True if this event should be queued for later reevaluation - */ - virtual bool Process() const; - -protected: - /** - * \brief Read and return label information for a device. - * - * \param devFd The device from which to read ZFS label information. - * \param inUse The device is part of an active or potentially - * active configuration. - * \param degraded The device label indicates the vdev is not healthy. - * - * \return If label information is available, an nvlist describing - * the vdev configuraiton found on the device specified by - * devFd. Otherwise NULL. - */ - static nvlist_t *ReadLabel(int devFd, bool &inUse, bool °raded); - - /** - * Attempt to match the ZFS labeled device at devPath with an active - * CaseFile for a missing vdev. If a CaseFile is found, attempt - * to re-integrate the device with its pool. - * - * \param devPath The devfs path to the potential leaf vdev. - * \param physPath The physical path string reported by the device - * at devPath. - * \param devConfig The ZFS label information found on the device - * at devPath. - * - * \return true if the event that caused the online action can - * be considered consumed. - */ - static bool OnlineByLabel(const string &devPath, - const string& physPath, - nvlist_t *devConfig); - - /** DeepCopy Constructor. */ - DevfsEvent(const DevfsEvent &src); - - /** Constructor */ - DevfsEvent(Type, DevdCtl::NVPairMap &, const string &); -}; - /*--------------------------------- ZfsEvent ---------------------------------*/ class ZfsEvent : public DevdCtl::ZfsEvent { @@ -164,5 +107,38 @@ class GeomEvent : public DevdCtl::GeomEvent (protected /** Constructor */ GeomEvent(Type, DevdCtl::NVPairMap &, const string &); + + /** + * Attempt to match the ZFS labeled device at devPath with an active + * CaseFile for a missing vdev. If a CaseFile is found, attempt + * to re-integrate the device with its pool. + * + * \param devPath The devfs path to the potential leaf vdev. + * \param physPath The physical path string reported by the device + * at devPath. + * \param devConfig The ZFS label information found on the device + * at devPath. + * + * \return true if the event that caused the online action can + * be considered consumed. + */ + static bool OnlineByLabel(const string &devPath, + const string& physPath, + nvlist_t *devConfig); + + /** + * \brief Read and return label information for a device. + * + * \param devFd The device from which to read ZFS label information. + * \param inUse The device is part of an active or potentially + * active configuration. + * \param degraded The device label indicates the vdev is not healthy. + * + * \return If label information is available, an nvlist describing + * the vdev configuraiton found on the device specified by + * devFd. Otherwise NULL. + */ + static nvlist_t *ReadLabel(int devFd, bool &inUse, bool °raded); + }; #endif /*_ZFSD_EVENT_H_ */ Modified: head/lib/libdevdctl/event.cc ============================================================================== --- head/lib/libdevdctl/event.cc Wed Feb 14 23:51:44 2018 (r329283) +++ head/lib/libdevdctl/event.cc Wed Feb 14 23:52:39 2018 (r329284) @@ -542,7 +542,10 @@ GeomEvent::DeepCopy() const bool GeomEvent::DevName(std::string &name) const { - name = Value("devname"); + if (Value("subsystem") == "disk") + name = Value("devname"); + else + name = Value("cdev"); return (!name.empty()); } From owner-svn-src-head@freebsd.org Thu Feb 15 03:22: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 B04CAF19EA1; Thu, 15 Feb 2018 03:22: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 5FBE57ED37; Thu, 15 Feb 2018 03:22: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 5A3661936D; Thu, 15 Feb 2018 03:22: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 w1F3Mrk9018787; Thu, 15 Feb 2018 03:22:53 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1F3Mrie018786; Thu, 15 Feb 2018 03:22:53 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201802150322.w1F3Mrie018786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 15 Feb 2018 03:22:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329296 - head/sbin/devd X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/sbin/devd X-SVN-Commit-Revision: 329296 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 15 Feb 2018 03:22:53 -0000 Author: eadler Date: Thu Feb 15 03:22:53 2018 New Revision: 329296 URL: https://svnweb.freebsd.org/changeset/base/329296 Log: devd: don't pass &fds in useless parameters to select(2) select(2) should be declared as restrict. In addition the only fd in the fdset is open O_RDONLY, and it's not a socket that can provide OOB notifications, Reviewed by: ian, imp, vangyzen Modified: head/sbin/devd/devd.cc Modified: head/sbin/devd/devd.cc ============================================================================== --- head/sbin/devd/devd.cc Thu Feb 15 03:22:04 2018 (r329295) +++ head/sbin/devd/devd.cc Thu Feb 15 03:22:53 2018 (r329296) @@ -1021,7 +1021,7 @@ event_loop(void) tv.tv_usec = 0; FD_ZERO(&fds); FD_SET(fd, &fds); - rv = select(fd + 1, &fds, &fds, &fds, &tv); + rv = select(fd + 1, &fds, NULL, NULL, &tv); // No events -> we've processed all pending events if (rv == 0) { devdlog(LOG_DEBUG, "Calling daemon\n"); From owner-svn-src-head@freebsd.org Thu Feb 15 03:22: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 25325F19D62; Thu, 15 Feb 2018 03:22:05 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD4CF7EB56; Thu, 15 Feb 2018 03:22:04 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C840019343; Thu, 15 Feb 2018 03:22:04 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1F3M44x017816; Thu, 15 Feb 2018 03:22:04 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1F3M4fC017815; Thu, 15 Feb 2018 03:22:04 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <201802150322.w1F3M4fC017815@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Thu, 15 Feb 2018 03:22:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329295 - head/sys/dev/mxge X-SVN-Group: head X-SVN-Commit-Author: rpokala X-SVN-Commit-Paths: head/sys/dev/mxge X-SVN-Commit-Revision: 329295 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 15 Feb 2018 03:22:05 -0000 Author: rpokala Date: Thu Feb 15 03:22:04 2018 New Revision: 329295 URL: https://svnweb.freebsd.org/changeset/base/329295 Log: mxge(4) should pass unhandled ioctls to ether_ioctl() Panasas discovered that ioctl(SIOCGLAGGPORT) returns ENOTTY for mxge(4) when the NIC is not a member of a lagg. This came as a surprise, because the SIOCGLAGGPORT handler in if_lagg.c only returns ENOENT (if run against the laggX interface, rather than a physical port) or EINVAL (if run against a non-member physical port). This behavior was not seen with other drivers, such as bge(4), igb(4), and cxl(4). When I compared their respective ioctl handlers, I found that they all called ether_ioctl() for the default (i.e. unhandled) case; by contrast, mxge(4) only calls ether_ioctl() for two specific cases, and returns ENOTTY for the default case. Remove the two cases which explicitly call ether_ioctl(), and let the default case call it instead. This matches what the vast majority of the NIC drivers do. Reviewed by: kmacy MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D14381 Modified: head/sys/dev/mxge/if_mxge.c Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Thu Feb 15 00:27:30 2018 (r329294) +++ head/sys/dev/mxge/if_mxge.c Thu Feb 15 03:22:04 2018 (r329295) @@ -4162,11 +4162,6 @@ mxge_ioctl(struct ifnet *ifp, u_long command, caddr_t err = 0; switch (command) { - case SIOCSIFADDR: - case SIOCGIFADDR: - err = ether_ioctl(ifp, command, data); - break; - case SIOCSIFMTU: err = mxge_change_mtu(sc, ifr->ifr_mtu); break; @@ -4290,7 +4285,8 @@ mxge_ioctl(struct ifnet *ifp, u_long command, caddr_t break; default: - err = ENOTTY; + err = ether_ioctl(ifp, command, data); + break; } return err; } From owner-svn-src-head@freebsd.org Thu Feb 15 03:39: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 F1CCBF1B396 for ; Thu, 15 Feb 2018 03:39:51 +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 6EEB27F7AE for ; Thu, 15 Feb 2018 03:39:51 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x233.google.com with SMTP id o13so17737424ito.2 for ; Wed, 14 Feb 2018 19:39:51 -0800 (PST) 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=LC2xR4FMqy9J6AA4ctQRdfbG9xgivjbDZQhPLrKOPZs=; b=Q1FZU97/OthCitbvMiQvY67xhHk39/XxIadKkiMAkqHip+c1WkBe3lf5lJPgDsvPTR qICVpXEd0qOPey1uGcsmat0McblfRlwNNsOFvAAt/gDAe+erHRBXQ9WSSFVujZXj8937 vUa0X9elK9v2jAHB7iDDQdohN9RyLN6usvYtgzfrmBJkQus4ApR7p0pDvA9UP99keeNB TWtkGD/61fLXV2WksUtOreF3RanwEGOtlWDGPyp//UWa6xLoXPBDn5yIUTDyNFTD5pci f8fhsswnSOdyWwm4OUm3WUZ382UAJQavPfHzhWc6MZ4pXkGsS1Fq3vdUxAzPBN5Mg/rQ m18A== 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=LC2xR4FMqy9J6AA4ctQRdfbG9xgivjbDZQhPLrKOPZs=; b=CTChWasZjmBXyC51m6+jGty6DOUVS5zMFWDOPnSFIUaljh27Xth7x+zvUoo7j/k8L+ fla3j72TfEh4/BQrkaiuwpPT2LcCILv1/usE6j9TDg/j8iRt6oaF9+gvAlRvirIPIHRA DEtPehsU4DNkC062rKMeDEHmXhIMwR6qXb+yZmao2T4ZQN5drd36ImXSz2wBzLMMfAJ/ SLnzR4NirqI5kzL+9AarUiZ4saEz81O4lbgt/yTXbC+TcdPFeJJ7tXBduGJxF0SAHpf8 v1aXZuAdbdNzN/Eb/YxM0yLk56JuyLdWYUxbwwiHbsBgdIwgrTSs7NrjCK3PF/tTnzGo UdAg== X-Gm-Message-State: APf1xPBMWK3dnRLYsaOibc32vnYvD8omQ6KwdG5j6ZrMeN0W5lxQD5lR d7S1ByalKZUW8Ej+y9st1Xew8I9q+J2BJrC5AEDutg== X-Google-Smtp-Source: AH8x224m7KgYWrPHB2mrZtA9jJQa1L1jXbURmlfujLGvZU/tXx3sKSVu/B1nUmsBAtqWCrgdNi32HfWD6cn6xQBIw+I= X-Received: by 10.36.80.17 with SMTP id m17mr779905itb.64.1518665990395; Wed, 14 Feb 2018 19:39:50 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Wed, 14 Feb 2018 19:39:49 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:c5d:377:1ec2:48fe] Received: by 10.79.201.67 with HTTP; Wed, 14 Feb 2018 19:39:49 -0800 (PST) In-Reply-To: <201802150322.w1F3Mrie018786@repo.freebsd.org> References: <201802150322.w1F3Mrie018786@repo.freebsd.org> From: Warner Losh Date: Wed, 14 Feb 2018 20:39:49 -0700 X-Google-Sender-Auth: aL3iPQDiVL6pdXlnKttV5qb78CQ Message-ID: Subject: Re: svn commit: r329296 - head/sbin/devd To: Eitan Adler 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.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 15 Feb 2018 03:39:52 -0000 On Feb 14, 2018 8:23 PM, "Eitan Adler" wrote: Author: eadler Date: Thu Feb 15 03:22:53 2018 New Revision: 329296 URL: https://svnweb.freebsd.org/changeset/base/329296 Log: devd: don't pass &fds in useless parameters to select(2) select(2) should be declared as restrict. In addition the only fd in the fdset is open O_RDONLY, and it's not a socket that can provide OOB notifications, Reviewed by: ian, imp, vangyzen Don't put my name on this. I specifically and clearly objected to the change anf tld yoy not to do it. Warner Modified: head/sbin/devd/devd.cc Modified: head/sbin/devd/devd.cc ============================================================ ================== --- head/sbin/devd/devd.cc Thu Feb 15 03:22:04 2018 (r329295) +++ head/sbin/devd/devd.cc Thu Feb 15 03:22:53 2018 (r329296) @@ -1021,7 +1021,7 @@ event_loop(void) tv.tv_usec = 0; FD_ZERO(&fds); FD_SET(fd, &fds); - rv = select(fd + 1, &fds, &fds, &fds, &tv); + rv = select(fd + 1, &fds, NULL, NULL, &tv); // No events -> we've processed all pending events if (rv == 0) { devdlog(LOG_DEBUG, "Calling daemon\n"); From owner-svn-src-head@freebsd.org Thu Feb 15 03: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 25CB7F1BEB8 for ; Thu, 15 Feb 2018 03:48:20 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x230.google.com (mail-it0-x230.google.com [IPv6:2607:f8b0:4001:c0b::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 A8DE37FE0E for ; Thu, 15 Feb 2018 03:48:19 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x230.google.com with SMTP id o13so17750722ito.2 for ; Wed, 14 Feb 2018 19:48:19 -0800 (PST) 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=rWMv9ny2NVak8POaHA41XoU/1yDC9h1dG2Ugiqacqgk=; b=HKziAGRn7yZBDDVhlE4DJp/JYXnT6Mrwag+255pkijmzUvVzHPi4OA51oP7IAuCbJ0 ypuBI56Vh4msj7IBVI3hCPSkXXcA3PBGuiXLv9FvCfMaGcXlkVTHscUocDtrSA8UShbc S6abrrqi61reyN+4gA9JxoG1WXsQ9856sJGmVkli/Yt8Hkfblj0yyhid9Vr84LM8GHep TMRfzPaB1QO2CnOWcFtCFzI1Je1JEVvROX4rZBHIIR9uxebKyvct5bqPNs6np6fAGSIU F6avhGiNc0Hkzkrj8iQlspCTw+finK6RyJ+lDxmHlw1dBhQzJI/v0F3XbfWiqV974ARU Z55w== 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=rWMv9ny2NVak8POaHA41XoU/1yDC9h1dG2Ugiqacqgk=; b=UjKF30c8qcsu+MCcMGGHxBdernni+uhmdH83sm2ch5xoWxqWBVLaujKJ7h69l+9WWC RmxtwOG7mjD8doOtNcUr7mSUGvqVKpUr0uBe3TapZzQl26fDl49Ks68q5/UVicx6L7FU 0AgC/gOXYYff8m0m4Jyen324Lujz7AW8/NNvGwiViZvLfvm6aUEe8WbDM+z3JBYDDzRZ 93ZhkWpD8X3IJM1jvoFS6d9q7+/qx09tu3BqtdQ5/ZK/bW5Nl+Q27IkP7YwDv/6G1mnN 7Jos7sWVOc7ogX8RP+GmMPk/QVA/XkPDqEyEjA8+TJJXNR8kyfhBOjoHZgDz+VVTTvX1 ymEg== X-Gm-Message-State: APf1xPARGt7//OL3ojrdW+phBxFrhn53wzUigJD3ROcTWILjYxO2yA28 VmHO/vOQHx5fRdWWOOTqJ7JRb7yl2tC15zeF4zpYFA== X-Google-Smtp-Source: AH8x225W+GX1H0vBstb9iVM+oY3UUkapty6qKsLNto6rY8viPZp1heh90dKT3Nb63EaWCn5W5nCxkM04u/nNYlSG1sk= X-Received: by 10.36.54.66 with SMTP id l63mr1712304itl.50.1518666498892; Wed, 14 Feb 2018 19:48:18 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Wed, 14 Feb 2018 19:48:17 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:18a2:a4f7:170:8dd9] In-Reply-To: References: <201802150322.w1F3Mrie018786@repo.freebsd.org> From: Warner Losh Date: Wed, 14 Feb 2018 20:48:17 -0700 X-Google-Sender-Auth: He8XBqbzz7KSorqQJpudx0r3r0s Message-ID: Subject: Re: svn commit: r329296 - head/sbin/devd To: Eitan Adler 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.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 15 Feb 2018 03:48:20 -0000 On Wed, Feb 14, 2018 at 8:39 PM, Warner Losh wrote: > > > On Feb 14, 2018 8:23 PM, "Eitan Adler" wrote: > > Author: eadler > Date: Thu Feb 15 03:22:53 2018 > New Revision: 329296 > URL: https://svnweb.freebsd.org/changeset/base/329296 > > Log: > devd: don't pass &fds in useless parameters to select(2) > > select(2) should be declared as restrict. In addition the only fd in > the fdset is open O_RDONLY, and it's not a socket that can provide OOB > notifications, > > Reviewed by: ian, imp, vangyzen > > > Don't put my name on this. I specifically and clearly objected to the > change anf tld yoy not to do it. > Stupid phone... I specifically objected to this change. I said not to make it because it wasn't necessary. You did it any way. Don't put "reviewed by" for that. Put "objected to but I did it anyway by: imp" Warner > > Warner > > > Modified: > head/sbin/devd/devd.cc > > Modified: head/sbin/devd/devd.cc > ============================================================ > ================== > --- head/sbin/devd/devd.cc Thu Feb 15 03:22:04 2018 (r329295) > +++ head/sbin/devd/devd.cc Thu Feb 15 03:22:53 2018 (r329296) > @@ -1021,7 +1021,7 @@ event_loop(void) > tv.tv_usec = 0; > FD_ZERO(&fds); > FD_SET(fd, &fds); > - rv = select(fd + 1, &fds, &fds, &fds, &tv); > + rv = select(fd + 1, &fds, NULL, NULL, &tv); > // No events -> we've processed all pending events > if (rv == 0) { > devdlog(LOG_DEBUG, "Calling daemon\n"); > > > From owner-svn-src-head@freebsd.org Thu Feb 15 03:52: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 7C66FF1C3F9 for ; Thu, 15 Feb 2018 03:52:25 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-yw0-x22c.google.com (mail-yw0-x22c.google.com [IPv6:2607:f8b0:4002:c05::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 17708802E9 for ; Thu, 15 Feb 2018 03:52:24 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: by mail-yw0-x22c.google.com with SMTP id f12so7514671ywb.8 for ; Wed, 14 Feb 2018 19:52:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=TPS7dD6g7UgUP1Cc8iRJ960Olx+NvONeaULq/mBB/xQ=; b=F5QXnbw39F/VNe/Tan5FEFCLwfVKB5OqGkvMKAQA0lrgEWvCVeRSeNOE7fc8ohp9Ip WQK9FUFrEm4asms2YE/nepDh+wDo00av50t0YsBkwx6wRiGKgKWiTmgqk+DswsTDFUY9 2dkggfyO1pGjftou7Pd3mFUbxpNojQLpZ1508= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=TPS7dD6g7UgUP1Cc8iRJ960Olx+NvONeaULq/mBB/xQ=; b=Sv25g+u7ZjF2xckUU7/EaPKysDmxp2svrOfSsYUFtsj2WxjzEWXu/LrIrheEfoLpDF XM3SFWxqTdw2rC4XWuV9QgURKKx5Vv8S52/tRQ97R1yOVDyU1rD5HNRTplAkAcaMbw4Q VoSzbOnDJ2bWKbk/pHrKTVCHR7xswKC4L86LV/e1hjjifhcM3qa3ht28XImPvJW0uPOe lDW6DmrFOPD8SEHPit43xRq5y/Dq8eRAzlCUBFdzRQw9uRFwZfSJt9K8b5mH3Rywry67 7SOLjjVCsMhmyde4jI7dmx/YDi4aN4nCKgXqE2QOlpVqfEVeUJ3ZkF08ClaTLMZyOJUB aopw== 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=TPS7dD6g7UgUP1Cc8iRJ960Olx+NvONeaULq/mBB/xQ=; b=tc/Iife7mRfmutSmMI5iw60K/kz8rTeTjNXFyff7BlRRHKD7OAGLOmMbH/LKUPuwuz nm6sY5cWV0EJI6ZYJu/Hmz3UOrqZaaBv6TcBRNrGtWNEOJUmTNMf86EbdQ/YR9XehImh 8kv7PGdYOq2jMcFvFBhn0g/lQwwl3QgaGfdNb7IF7e3P2fSuirYxLwqTOmfJt7YQA3za 2NpSjvlcJexBX+GwyK5aWp/M6vxiLP+u3Linhz7Gz71UuKf6/LOPfTGeoIpiFcLg1YQx nhvKAp/jFg9iNHENGfJAiDafIknMGy4HttNeFb+ifgvzB5ydt9RGOeUVBlQQAtUtGbQu tx3A== X-Gm-Message-State: APf1xPD9hO1RYOLnImO8fxU+u582/UrsHRuXpN+/xoO8PG22Ef76c06h IoMOSmyFZXdW/4gNZIdDNqzZZw25jV2lGHULsLCsEA== X-Google-Smtp-Source: AH8x2247r2B3oq8M+PSCdEc6iWOxDCfieLxy2BDeajzQlWxH/JeQOon58s9ii3MAmUOOBeLbtN2U0O5spymvmdIQWyQ= X-Received: by 10.37.37.18 with SMTP id l18mr89941ybl.277.1518666744379; Wed, 14 Feb 2018 19:52:24 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 2002:a25:7107:0:0:0:0:0 with HTTP; Wed, 14 Feb 2018 19:51:53 -0800 (PST) In-Reply-To: References: <201802150322.w1F3Mrie018786@repo.freebsd.org> From: Eitan Adler Date: Wed, 14 Feb 2018 19:51:53 -0800 X-Google-Sender-Auth: hQZOgaKuW6-k6HEUWGefzSTwT9Y Message-ID: Subject: Re: svn commit: r329296 - head/sbin/devd To: Warner Losh 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.25 Precedence: list List-Id: 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, 15 Feb 2018 03:52:25 -0000 On 14 February 2018 at 19:48, Warner Losh wrote: > > > On Wed, Feb 14, 2018 at 8:39 PM, Warner Losh wrote: >> >> >> >> On Feb 14, 2018 8:23 PM, "Eitan Adler" wrote: >> >> Author: eadler >> Date: Thu Feb 15 03:22:53 2018 >> New Revision: 329296 >> URL: https://svnweb.freebsd.org/changeset/base/329296 >> >> Log: >> devd: don't pass &fds in useless parameters to select(2) >> >> select(2) should be declared as restrict. In addition the only fd in >> the fdset is open O_RDONLY, and it's not a socket that can provide OOB >> notifications, >> >> Reviewed by: ian, imp, vangyzen >> >> >> Don't put my name on this. I specifically and clearly objected to the >> change anf tld yoy not to do it. > > > Stupid phone... > > I specifically objected to this change. I said not to make it because it > wasn't necessary. You did it any way. Don't put "reviewed by" for that. Put > "objected to but I did it anyway by: imp" hrm.. rereading the thread I think I missed your original email. Only comment I saw was "poll is a better interface". Sorry for mis-stating your opinion. FTR I'd like to fix the declaration of select(2) anyways. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@freebsd.org Thu Feb 15 06:24: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 737FAF00B9F for ; Thu, 15 Feb 2018 06:24:30 +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 E984E84D10 for ; Thu, 15 Feb 2018 06:24:29 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x230.google.com with SMTP id t126so4480244iof.4 for ; Wed, 14 Feb 2018 22:24:29 -0800 (PST) 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=a3CIRNYArpEDA0/ijtxxsKh/DUxNYxlsY/3QMZmhVgM=; b=At9s+Ew1lOr2eAGKJtQY35P43mfzDCTaTjf4Iqw6oLwIonyl0dv0xkmbj9Ax4odSLk EOC2dxcmu1fIP/3b8CdZcrBI36ED/1kDwDM9ic5EEHrTvgLU9at5EFJLBlEjtH15PQod igvPjT4lsD+/SaKDGkKsCZ9qTWGn8cIJ02mDXkLQsJTNRWwqXT/Mj0QJbKVAZd0sfaIh EDzaJfPNF0R1BhRIJ3xKXqb5Kfls0i31ZXbwB6PxxTabDuKGF4ygJWpHU4H3nmftfDf+ 77yyCv/vi596GhLQkLHPxnrgCX8wIFGWmJTBiNukB1C6qrk0f+VBuIKV3fwgG7gOda6x 47og== 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=a3CIRNYArpEDA0/ijtxxsKh/DUxNYxlsY/3QMZmhVgM=; b=gnIPESG9hGQmTRTpTP0PafqgWju82LnbW8mMeKrcbVb+wdSFofqFVPLsalvKutTQE/ RQoleXlZ1gj+cBEiEBxBDmtNybV25cgugcwSkhR70QHmH3zXQR5C7QmoKv/euKce6W0C emk85BVugTjNzOesmsMLw/oOTEQbMgpp/iVRNYESAqHUe9Jh4JF1LWQomHxbw70XPiC6 P3fjS2KY8LxpTmvOBcG/5ToacCXinJZ0W9kNC11k2quRcFV6eh5XBltdhVB+2Bnj5A9M V2qjIr4+q14QCxdYU1GT/2UtyeBkt9CpIRtdEdbYINZoBNhCi/b6HjtiTy9ABLkxlMrT aQ9w== X-Gm-Message-State: APf1xPBPt6xa+RU03Q5fWtFYJO6fGBt0S92xSoYLpcLeL02yDQutSxzT As8X39Kp2ty/tTPRa2j/GsAfh4C2Mx+i3AbceM5xYg== X-Google-Smtp-Source: AH8x224r2pHl2tV6R4/UIpdO9ib8/tYZ5CTT07yjz4k9JFZBLdlrgIYFvWu+HxgyDmjw2D6n0odSYhMy/XGz4D47hQg= X-Received: by 10.107.232.7 with SMTP id f7mr691289ioh.130.1518675869088; Wed, 14 Feb 2018 22:24:29 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Wed, 14 Feb 2018 22:24:28 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:18a2:a4f7:170:8dd9] In-Reply-To: References: <201802150322.w1F3Mrie018786@repo.freebsd.org> From: Warner Losh Date: Wed, 14 Feb 2018 23:24:28 -0700 X-Google-Sender-Auth: HoMnuRv9rVfnlFc6xarkjfCdjyc Message-ID: Subject: Re: svn commit: r329296 - head/sbin/devd To: Eitan Adler 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.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 15 Feb 2018 06:24:30 -0000 On Wed, Feb 14, 2018 at 8:51 PM, Eitan Adler wrote: > On 14 February 2018 at 19:48, Warner Losh wrote: > > > > > > On Wed, Feb 14, 2018 at 8:39 PM, Warner Losh wrote: > >> > >> > >> > >> On Feb 14, 2018 8:23 PM, "Eitan Adler" wrote: > >> > >> Author: eadler > >> Date: Thu Feb 15 03:22:53 2018 > >> New Revision: 329296 > >> URL: https://svnweb.freebsd.org/changeset/base/329296 > >> > >> Log: > >> devd: don't pass &fds in useless parameters to select(2) > >> > >> select(2) should be declared as restrict. In addition the only fd in > >> the fdset is open O_RDONLY, and it's not a socket that can provide OOB > >> notifications, > >> > >> Reviewed by: ian, imp, vangyzen > >> > >> > >> Don't put my name on this. I specifically and clearly objected to the > >> change anf tld yoy not to do it. > > > > > > Stupid phone... > > > > I specifically objected to this change. I said not to make it because it > > wasn't necessary. You did it any way. Don't put "reviewed by" for that. > Put > > "objected to but I did it anyway by: imp" > > hrm.. rereading the thread I think I missed your original email. Only > comment I saw was "poll is a better interface". Sorry for mis-stating > your opinion. > Yea. It was more of a "don't change it, since it's fine now" and then the "poll" comment was "better to just change to a better interface." > FTR I'd like to fix the declaration of select(2) anyways. That's unlikely to end well... I wish you luck... The pattern I used in devd for select was nearly universal a decade ago... Maybe things have changed... Warner From owner-svn-src-head@freebsd.org Thu Feb 15 07:23: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 894FBF03293; Thu, 15 Feb 2018 07:23:42 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 095A386A4C; Thu, 15 Feb 2018 07:23:42 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0444B1BA7A; Thu, 15 Feb 2018 07:23:42 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1F7Nf64037460; Thu, 15 Feb 2018 07:23:41 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1F7NfKj037459; Thu, 15 Feb 2018 07:23:41 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201802150723.w1F7NfKj037459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 15 Feb 2018 07:23:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329297 - head/sys/x86/xen X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/x86/xen X-SVN-Commit-Revision: 329297 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 15 Feb 2018 07:23:42 -0000 Author: mjg Date: Thu Feb 15 07:23:41 2018 New Revision: 329297 URL: https://svnweb.freebsd.org/changeset/base/329297 Log: xen: fix smp boot after r328157 mce_stack was left unset leading to early crashes Modified: head/sys/x86/xen/pv.c Modified: head/sys/x86/xen/pv.c ============================================================================== --- head/sys/x86/xen/pv.c Thu Feb 15 03:22:53 2018 (r329296) +++ head/sys/x86/xen/pv.c Thu Feb 15 07:23:41 2018 (r329297) @@ -99,6 +99,7 @@ static int xen_pv_start_all_aps(void); #ifdef SMP /* Variables used by amd64 mp_machdep to start APs */ extern char *doublefault_stack; +extern char *mce_stack; extern char *nmi_stack; #endif @@ -218,6 +219,8 @@ start_xen_ap(int cpu) bootstacks[cpu] = (void *)kmem_malloc(kernel_arena, stacksize, M_WAITOK | M_ZERO); doublefault_stack = + (char *)kmem_malloc(kernel_arena, PAGE_SIZE, M_WAITOK | M_ZERO); + mce_stack = (char *)kmem_malloc(kernel_arena, PAGE_SIZE, M_WAITOK | M_ZERO); nmi_stack = (char *)kmem_malloc(kernel_arena, PAGE_SIZE, M_WAITOK | M_ZERO); From owner-svn-src-head@freebsd.org Thu Feb 15 10:48: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 20A0DF11D3D for ; Thu, 15 Feb 2018 10:48:18 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Received: from dec.sakura.ne.jp (dec.sakura.ne.jp [210.188.226.8]) (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 77BEF70B42; Thu, 15 Feb 2018 10:48:17 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Received: from fortune.joker.local (124-18-70-98.dz.commufa.jp [124.18.70.98]) (authenticated bits=0) by dec.sakura.ne.jp (8.15.2/8.15.2/[SAKURA-WEB]/20080708) with ESMTPA id w1FAAqnL052825; Thu, 15 Feb 2018 19:10:52 +0900 (JST) (envelope-from junchoon@dec.sakura.ne.jp) Date: Thu, 15 Feb 2018 19:10:51 +0900 From: Tomoaki AOKI To: svn-src-head@freebsd.org Cc: kevans@freebsd.org, mizhka@FreeBSD.org Subject: Re: svn commit: r327058 - head/stand/efi/boot1 Message-Id: <20180215191051.55cd6dd9b08d2715ca4e3e1f@dec.sakura.ne.jp> Organization: Junchoon corps X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.31; amd64-portbld-freebsd11.1) 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.25 Precedence: list List-Id: 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, 15 Feb 2018 10:48:18 -0000 > On Thu, Dec 21, 2017 at 6:21 AM, Michael Zhilin wrote: >> Author: mizhka >> Date: Thu Dec 21 12:21:35 2017 >> New Revision: 327058 >> URL: https://svnweb.freebsd.org/changeset/base/327058 >> >> Log: >> [boot/efi] scan all display modes rather than sequential try-fail way >> >> This patch allows to scan all display modes in boot1 as loader does. >> >> Before system tried to select optimal display mode by sequential scan of >> modes and if error then stop scanning. This way is not good, because >> if mode N is not present, mode N+1 may exist. >> >> In loader we use conout->Mode->MaxMode to identify maximum number of modes. >> This commit is to use same way in boot1 as in loader. >> >> Reported by: Andrey Pustovetov >> Reviewed by: tsoome >> Differential Revision: https://reviews.freebsd.org/D13541 >> > > HI, > > Just FYI- we've had several reports of this doing the wrong thing for > many people, most recently by Allan yesterday (IIRC). I'm going to > avoid MFC'ing it, I think we should either back this out or figure out > where it's going wrong sooner rather than later. =( > > Thanks, > >Kyle Evans +1. I've been reporting back to mizhka@ what he wants off-list. (First report is on-list. [1]) Please wait MFC for this fixed, and, if possible, report below to mizhka@. *Output of "mode" command of loader console. *Video of broken boot process or photo of broken screen. *CPU model with integrated video. *Which mode worked and which isn't if specified by loader command. *Result of `got list` by loader command. *Result of `uga list` by loader command. As no one other than me posts negative comment to the commit mail here, I've not requested him to revert this. (Requested to do so if someone else reports problem.) FYI: For me, boot1 and loader screen are OK, but once kernel starts, broken screen. So vt (efifb) driver should be fixed to be aware of current (actual) screen mode. [1] https://lists.freebsd.org/pipermail/svn-src-head/2017-December/107598.html -- Tomoaki AOKI From owner-svn-src-head@freebsd.org Thu Feb 15 11:13: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 69F41F13971; Thu, 15 Feb 2018 11:13: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 11E1271848; Thu, 15 Feb 2018 11:13:22 +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 0AE331E015; Thu, 15 Feb 2018 11:13:22 +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 w1FBDLOL053925; Thu, 15 Feb 2018 11:13:21 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FBDLrd053924; Thu, 15 Feb 2018 11:13:21 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201802151113.w1FBDLrd053924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 15 Feb 2018 11:13:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329311 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 329311 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 15 Feb 2018 11:13:22 -0000 Author: eadler Date: Thu Feb 15 11:13:21 2018 New Revision: 329311 URL: https://svnweb.freebsd.org/changeset/base/329311 Log: share: update pci_vendors to 2018.02.15 MFC After: 1 week Modified: head/share/misc/pci_vendors Modified: head/share/misc/pci_vendors ============================================================================== --- head/share/misc/pci_vendors Thu Feb 15 09:12:07 2018 (r329310) +++ head/share/misc/pci_vendors Thu Feb 15 11:13:21 2018 (r329311) @@ -1,10 +1,9 @@ # $FreeBSD$ -# # List of PCI ID's # -# Version: 2018.01.14 -# Date: 2018-01-14 03:15:02 +# Version: 2018.02.15 +# Date: 2018-02-15 03:15:01 # # Maintained by Albert Pool, Martin Mares, and other volunteers from # the PCI ID Project at http://pci-ids.ucw.cz/. @@ -252,6 +251,7 @@ 1028 1fd4 PERC H745P MX 1d49 0602 ThinkSystem RAID 930-16i 4GB Flash PCIe 12Gb Adapter 1d49 0604 ThinkSystem RAID 930-8e 4GB Flash PCIe 12Gb Adapter + 1d49 0607 ThinkSystem RAID 930-16i 8GB Flash PCIe 12Gb Adapter 8086 352d Integrated RAID Module RMSP3AD160F 8086 9460 RAID Controller RSP3TD160F 8086 9480 RAID Controller RSP3MD088F @@ -786,7 +786,7 @@ 18bc 0101 GC-R9600PRO (Primary) 4151 RV350 [Radeon 9600 Series] 1043 c004 A9600SE - 174b 7c37 Radeon 9600 SE + 174b 7c37 Radeon 9600SE 128M DDR V/D/VO 4152 RV360 [Radeon 9600/X1050 Series] 1002 0002 Radeon 9600XT 1002 4772 All-in-Wonder 9600 XT @@ -816,7 +816,7 @@ 18bc 0100 GC-R9600PRO (Secondary) 4171 RV350 [Radeon 9600] (Secondary) 1043 c005 A9600SE (Secondary) - 174b 7c36 Radeon 9600 SE (secondary) + 174b 7c36 Radeon 9600SE 128M DDR V/D/VO (secondary) 4172 RV350 [Radeon 9600/X1050 Series] (Secondary) 1002 0003 Radeon 9600XT (Secondary) 1002 4773 All-in-Wonder 9600 XT (Secondary) @@ -923,6 +923,7 @@ 1043 836c M4A785TD Motherboard 1043 8410 M4A89GTD PRO/USB3 Motherboard 1043 841b M5A88-V EVO + 1043 8445 M5A78L LE 105b 0e13 N15235/A74MX mainboard / AMD SB700 1179 ff50 Satellite P305D-S8995E 1458 a022 GA-MA770-DS3rev2.0 Motherboard @@ -1609,6 +1610,7 @@ 1028 0684 FirePro W4170M 6607 Mars LE [Radeon HD 8530M / R5 M240] 6608 Oland GL [FirePro W2100] + 13cc 3d28 MXRT-2600 6610 Oland XT [Radeon HD 8670 / R7 250/350] 1019 0030 Radeon HD 8670 1028 2120 Radeon R7 250 @@ -1641,6 +1643,7 @@ 1002 0b0c FirePro W4300 103c 0b0c Bonaire [FirePro W4300] 103c 230c FirePro W5100 + 13cc 3d2a MXRT-5600 6650 Bonaire 6651 Bonaire 6658 Bonaire XTX [Radeon R7 260X/360] @@ -1879,7 +1882,10 @@ 8086 2111 Radeon HD 6625M 6743 Whistler [Radeon E6760] 6749 Turks GL [FirePro V4900] + 15c3 2b06 MED-X4900 674a Turks GL [FirePro V3900] + 13cc 3d22 MXRT-2500 + 15c3 0106 MED-X3900 6750 Onega [Radeon HD 6650A/7650A] 1462 2670 Radeon HD 6670A 17aa 3079 Radeon HD 7650A @@ -2192,11 +2198,13 @@ 1043 3001 Tahiti XTL [ROG Matrix R9 280X] 1043 3006 Tahiti XTL [Radeon R9 280X DirectCU II TOP] 1043 9999 ARES II + 106b 0127 FirePro D700 + 106b 0128 FirePro D700 1092 3000 Tahiti XT2 [Radeon HD 7970 GHz Edition] 1458 2261 Tahiti XT2 [Radeon HD 7970 GHz Edition OC] # GV-R928XOC-3GD 1458 3001 Tahiti XTL [Radeon R9 280X OC] - 1462 2774 MSI R7970 TF 3GD5/OC BE + 1462 2774 HD 7970 TwinFrozr III Boost Edition OC 1682 3001 Tahiti XTL [Radeon R9 280X] 1682 3211 Double D HD 7970 Black Edition # FX-797A-TNBC @@ -2217,6 +2225,8 @@ 1462 8036 Radeon HD 8990 OEM 148c 8990 Radeon HD 8990 OEM 679e Tahiti LE [Radeon HD 7870 XT] + 106b 0125 FirePro D500 + 106b 0126 FirePro D500 1787 2328 Radeon HD 7870 Black Edition 2 GB GDDR5 [2GBD5-2DHV3E] 679f Tahiti 67a0 Hawaii XT GL [FirePro W9100] @@ -2271,7 +2281,7 @@ 174b e324 Sapphire Nitro R9 390 67b9 Vesuvius [Radeon R9 295X2] 67be Hawaii LE - 67c0 Ellesmere [Radeon Pro WX 7100] + 67c0 Ellesmere [Radeon Pro WX 7100 Mobile] 67c2 Ellesmere [Radeon Pro V7300X / V7350x2] 67c4 Ellesmere [Radeon Pro WX 7100] 1002 0336 Radeon Pro Duo @@ -2301,10 +2311,20 @@ 1787 a480 Radeon RX 480 1da2 e353 Sapphire Radeon RX 580 Pulse 8GB 1da2 e366 Nitro+ Radeon RX 580 4GB - 67e0 Baffin [Polaris11] + 67e0 Baffin [Radeon Pro WX 4170] + 103c 8270 Radeon Pro WX 4170 + 103c 8272 Radeon Pro WX 4170 67e1 Baffin [Polaris11] 67e3 Baffin [Radeon Pro WX 4100] - 67e8 Baffin [Polaris11] + 67e8 Baffin [Radeon Pro WX 4130/4150] + 1028 075d Radeon Pro WX 4150 + 1028 07b0 Radeon Pro WX 4130/4150 + 1028 07b1 Radeon Pro WX 4130 + 1028 175d Radeon Pro WX 4150 + 1028 17b0 Radeon Pro WX 4130/4150 + 1028 17b1 Radeon Pro WX 4130 + 103c 8275 Radeon Pro WX 4150 + 103c 8277 Radeon Pro WX 4150 67e9 Baffin [Polaris11] 67eb Baffin [Radeon Pro V5300X] 67ef Baffin [Radeon RX 460/560D / Pro 450/455/460/560] @@ -2329,8 +2349,14 @@ 6808 Pitcairn XT GL [FirePro W7000] 1002 0310 FirePro S7000 1002 0420 Radeon Sky 500 + 13cc 3d25 MXRT-7500 6809 Pitcairn LE GL [FirePro W5000] + 13cc 3d23 MXRT-5500 + 13cc 3d24 MXRT-5550 + 15c3 0b06 MED-X5000 6810 Curacao XT / Trinidad XT [Radeon R7 370 / R9 270X/370X] + 106b 012a FirePro D300 + 106b 012b FirePro D300 148c 0908 Radeon R9 370 OEM 1682 7370 Radeon R7 370 6811 Curacao PRO [Radeon R7 370 / R9 270/370 OEM] @@ -2376,6 +2402,7 @@ 6826 Chelsea LP [Radeon HD 7700M Series] 6827 Heathrow PRO [Radeon HD 7850M/8850M] 6828 Cape Verde PRO [FirePro W600] + 15c3 2b1e MED-X6000 6829 Cape Verde 682a Venus PRO 682b Venus LE / Tropo PRO-L [Radeon HD 8830M / R7 M465X] @@ -2514,17 +2541,19 @@ 6842 Thames LE [Radeon HD 7000M Series] 6843 Thames [Radeon HD 7670M] 6860 Vega 10 [Radeon Instinct MI25] + 106b 017c Radeon Pro Vega 64 6861 Vega 10 XT [Radeon PRO WX 9100] 6862 Vega 10 XT [Radeon PRO SSG] 6863 Vega 10 XTX [Radeon Vega Frontier Edition] 6864 Vega - 6867 Vega + 6867 Vega 10 XL [Radeon Pro Vega 56] 6868 Vega 686c Vega 10 [Radeon Instinct MI25 MxGPU] 687f Vega 10 XT [Radeon RX Vega 64] 6888 Cypress XT [FirePro V8800] 6889 Cypress PRO [FirePro V7800] 1002 0301 FirePro V7800P + 13cc 3d1f MXRT-7400 688a Cypress XT [FirePro V9800] 1002 030c FirePro V9800P 688c Cypress XT GL [FireStream 9370] @@ -2572,6 +2601,8 @@ 103c 159b Radeon HD 6850M 144d c0ad Radeon HD 6850M 68a9 Juniper XT [FirePro V5800] + 13cc 3d1e MXRT-5400 + 13cc 3d20 MXRT-5450 68b8 Juniper XT [Radeon HD 5770] 106b 00cf MacPro5,1 [Mac Pro 2.8GHz DDR3] 68b9 Juniper LE [Radeon HD 5670 640SP Edition] @@ -2733,6 +2764,7 @@ 1462 2246 Radeon HD 6550A 68c8 Redwood XT GL [FirePro V4800] 68c9 Redwood PRO GL [FirePro V3800] + 13cc 3d1d MXRT-2400 68d8 Redwood XT [Radeon HD 5670/5690/5730] 1028 68e0 Radeon HD 5670 174b 5690 Radeon HD 5690 @@ -3015,6 +3047,7 @@ 6921 Amethyst XT [Radeon R9 M295X] 6929 Tonga XT GL [FirePro S7150] 692b Tonga PRO GL [FirePro W7100] + 13cc 3d2b MXRT-7600 692f Tonga XTV GL [FirePro S7150V] 6938 Tonga XT / Amethyst XT [Radeon R9 380X / R9 M295X] 1043 04f5 Radeon R9 380X @@ -3045,17 +3078,27 @@ 7101 R520/M58 [Mobility Radeon X1800 XT] 7102 R520/M58 [Mobility Radeon X1800] 7104 R520 GL [FireGL V7200] + 13cc 3d0a MXRT-5100 7109 R520 [Radeon X1800 XL] 1002 0322 All-in-Wonder X1800XL 1002 0d02 Radeon X1800 CrossFire Edition 710a R520 [Radeon X1800 GTO] 1002 0b12 Radeon X1800 GTO² 710b R520 [Radeon X1800 GTO] + 710e R520 GL [FireGL V7300] + 13cc 3d0c MXRT-5150 + 710f R520 GL [FireGL V7350] + 13cc 3d0e MXRT-7100 7120 R520 [Radeon X1800] (Secondary) 7124 R520 GL [FireGL V7200] (Secondary) + 13cc 3d0b MXRT-5100 (Secondary) 7129 R520 [Radeon X1800] (Secondary) 1002 0323 All-In-Wonder X1800 XL (Secondary) 1002 0d03 Radeon X1800 CrossFire Edition (Secondary) + 712e R520 GL [FireGL V7300] (Secondary) + 13cc 3d0d MXRT-5150 (Secondary) + 712f R520 GL [FireGL V7350] (Secondary) + 13cc 3d0f MXRT-7100 (Secondary) 7140 RV515 [Radeon X1300/X1550/X1600 Series] 7142 RV515 PRO [Radeon X1300/X1550 Series] 1002 0322 All-in-Wonder 2006 PCI-E Edition @@ -3095,12 +3138,16 @@ 7193 RV516 [Radeon X1550 Series] 7196 RV516/M62-S [Mobility Radeon X1350] 719b RV516 GL [FireMV 2250] + 13cc 3d12 MXRT-1150 + 13cc 3d14 MXRT-2150 719f RV516 [Radeon X1550 Series] 71a0 RV516 [Radeon X1300/X1550 Series] (Secondary) 71a1 RV516 [Radeon X1600/X1650 Series] (Secondary) 71a3 RV516 [Radeon X1300/X1550 Series] (Secondary) 71a7 RV516 [Radeon X1300/X1550 Series] (Secondary) 71bb RV516 GL [FireMV 2250] (Secondary) + 13cc 3d13 MXRT-1150 (Secondary) + 13cc 3d15 MXRT-2150 (Secondary) 71c0 RV530 [Radeon X1600 XT/X1650 GTO] 1002 e160 Radeon X1650 GTO 174b e160 Radeon X1650 GTO @@ -3119,6 +3166,7 @@ 1787 3000 PowerColor X1650 PRO AGP 71ce RV530 [Radeon X1300 XT/X1600 PRO] 71d2 RV530 GL [FireGL V3400] + 13cc 3d08 MXRT-2100 71d4 RV530/M66 GL [Mobility FireGL V5250] 71d5 RV530/M66-P [Mobility Radeon X1700] 71d6 RV530/M66-XT [Mobility Radeon X1700] @@ -3132,6 +3180,7 @@ 71e7 RV535 [Radeon X1650 PRO] (Secondary) 1787 3001 Radeon X1650 PRO AGP 71f2 RV530 GL [FireGL V3400] (Secondary) + 13cc 3d09 MXRT-2100 (Secondary) 7210 RV550/M71 [Mobility Radeon HD 2300] 7211 RV550/M71 [Mobility Radeon X2300 HD] 7240 R580+ [Radeon X1950 XTX] @@ -3208,6 +3257,7 @@ 9403 R600 [Radeon HD 2900 PRO] 9405 R600 [Radeon HD 2900 GT] 940a R600 GL [FireGL V8650] + 13cc 3d16 MXRT-7200 940b R600 GL [FireGL V8600] 940f R600 GL [FireGL V7600] 9440 RV770 [Radeon HD 4870] @@ -3245,6 +3295,7 @@ 174b 0028 Radeon HD 4650 AGP DDR2 9498 RV730 PRO [Radeon HD 4650] 949c RV730 GL [FirePro V7750] + 13cc 3d1b MXRT-7300 949e RV730 GL [FirePro V5700] 949f RV730 GL [FirePro V3750] 94a0 RV740/M97 [Mobility Radeon HD 4830] @@ -3331,6 +3382,7 @@ 958a RV630 [Radeon HD 2600 X2] 958b RV630/M76 [Mobility Radeon HD 2600 XT] 958c RV630 GL [FireGL V5600] + 13cc 3d18 MXRT-5200 958d RV630 GL [FireGL V3600] 9591 RV635/M86 [Mobility Radeon HD 3650] 1002 9591 Mobility Radeon HD 3650 @@ -3345,6 +3397,7 @@ 1043 3001 Radeon HD 4570 174b 3001 Radeon HD 3750 174b 4580 RV635 PRO [Radeon HD 4580] + 17af 3011 RV635 PRO [Radeon HD 4580] 9599 RV635 PRO [Radeon HD 3650 AGP] 95c0 RV620 PRO [Radeon HD 3470] 1002 95c0 Mobility Radeon HD 3470 @@ -3444,8 +3497,8 @@ 103c 194e ProBook 455 G1 Notebook 103c 1952 ProBook 455 G1 Notebook 9904 Trinity [Radeon HD 7560D] - 9905 Trinity [FirePro A300 Series Graphics] - 9906 Trinity [FirePro A300 Series Graphics] + 9905 Trinity GL [FirePro A300] + 9906 Trinity GL [FirePro A320] 9907 Trinity [Radeon HD 7620G] 9908 Trinity [Radeon HD 7600G] 9909 Trinity [Radeon HD 7500G] @@ -4081,7 +4134,7 @@ 1463 Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 3 1464 Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 4 1465 Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 5 - 1466 Family 17h (Models 00h-0fh) Data Fabric Device 18h Function 6 + 1466 Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 6 1467 Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 7 1510 Family 14h Processor Root Complex 174b 1001 PURE Fusion Mini @@ -4098,6 +4151,17 @@ 1535 Family 16h Processor Function 5 1536 Family 16h Processor Root Complex 1538 Family 16h Processor Function 0 + 1570 Family 15h (Models 60h-6fh) Processor Function 0 + 1571 Family 15h (Models 60h-6fh) Processor Function 1 + 1572 Family 15h (Models 60h-6fh) Processor Function 2 + 1573 Family 15h (Models 60h-6fh) Processor Function 3 + 1574 Family 15h (Models 60h-6fh) Processor Function 4 + 1575 Family 15h (Models 60h-6fh) Processor Function 5 + 1576 Family 15h (Models 60h-6fh) Processor Root Complex + 1577 Family 15h (Models 60h-6fh) I/O Memory Management Unit + 157a Family 15h (Models 60h-6fh) Audio Controller + 157b Family 15h (Models 60h-6fh) Host Bridge + 157c Family 15h (Models 60h-6fh) Processor Root Port 1600 Family 15h Processor Function 0 1601 Family 15h Processor Function 1 1602 Family 15h Processor Function 2 @@ -4167,8 +4231,11 @@ 43a1 Hudson PCI to PCI bridge (PCIE port 1) 43a2 Hudson PCI to PCI bridge (PCIE port 2) 43a3 Hudson PCI to PCI bridge (PCIE port 3) + 43b1 X399 Series Chipset PCIe Bridge 43b4 300 Series Chipset PCIe Port + 43b6 X399 Series Chipset SATA Controller 43b7 300 Series Chipset SATA Controller + 43ba X399 Series Chipset USB 3.1 xHCI Controller 43bb 300 Series Chipset USB 3.1 xHCI Controller 7006 AMD-751 [Irongate] System Controller 7007 AMD-751 [Irongate] AGP Bridge @@ -4625,7 +4692,7 @@ 103c 3381 iLO4 0534 G200eR2 0536 Integrated Matrox G200eW3 Graphics Controller - 0538 G200eH + 0538 MGA G200eH3 1590 00e4 iLO5 VGA 0540 M91XX 102b 2080 M9140 LP PCIe x16 @@ -5311,7 +5378,7 @@ c824 82C824 c825 82C825 [Firebridge 2] c832 82C832 - c861 82C861 + c861 82C861 OHCI USB Host c881 82C881 [FireLink] 1394 OHCI Link Controller c895 82C895 c935 EV1935 ECTIVA MachOne PCIAudio @@ -9295,6 +9362,7 @@ 0424 G86 [GeForce 8400 GS] 0425 G86M [GeForce 8600M GS] 1025 0121 Aspire 5920G + 1043 1514 F3SV 0426 G86M [GeForce 8400M GT] 0427 G86M [GeForce 8400M GS] 103c 30cc Pavilion dv6700 @@ -9466,6 +9534,7 @@ 1682 2385 GeForce 9600 GSO 768mb 0611 G92 [GeForce 8800 GT] 107d 2ab0 Winfast PX8800 GT PCI-E + 1462 1170 NX8800GT series model V117 2xDVI+TV 19da 1040 ZT-88TES2P-FSP 0612 G92 [GeForce 9800 GTX / 9800 GTX+] 0613 G92 [GeForce 9800 GTX+] @@ -10250,8 +10319,10 @@ 102a GK110BGL [Tesla K40t] 102d GK210GL [Tesla K80] 102e GK110BGL [Tesla K40d] + 102f GK110BGL [Tesla Stella Solo] 103a GK110GL [Quadro K6000] 103c GK110GL [Quadro K5200] + 103f GK110BGL [Tesla Stella SXM] 1040 GF119 [GeForce GT 520] 1043 83a0 ENGT520 SILENT 1042 GF119 [GeForce 510] @@ -10705,6 +10776,7 @@ 11a3 GK104M [GeForce GTX 680MX] 106b 010d iMac 13,2 11a7 GK104M [GeForce GTX 675MX] + 11af GK104GLM [GRID IceCube] # GRID K2 Quadro USM 11b0 GK104GL [GRID K240Q\K260Q vGPU] 10de 101a GRID K240Q @@ -10884,6 +10956,7 @@ 13bd GM107GL [Tesla M10] 10de 110a GRID M40 10de 1160 Tesla M10 + 10de 11d2 GRID M10-8Q 13c0 GM204 [GeForce GTX 980] 1043 8504 GTX980-4GD5 13c1 GM204 @@ -10897,6 +10970,10 @@ 13f0 GM204GL [Quadro M5000] 13f1 GM204GL [Quadro M4000] 13f2 GM204GL [Tesla M60] + 10de 114d GRID M60-1Q + 10de 114e GRID M60-2Q + 10de 1150 GRID M60-8Q + 10de 11b0 GRID M60-4A 13f3 GM204GL [Tesla M6] 10de 1184 GRID M6-8Q 13f8 GM204GLM [Quadro M5000M / M5000 SE] @@ -10927,6 +11004,7 @@ 172f GP100 174d GM108M [GeForce MX130] 174e GM108M [GeForce MX110] + 1789 GM107GL [GRID M3-3020] 17c2 GM200 [GeForce GTX TITAN X] 17c8 GM200 [GeForce GTX 980 Ti] 17f0 GM200GL [Quadro M6000] @@ -10998,12 +11076,13 @@ 1cb1 GP107GL [Quadro P1000] 1cb2 GP107GL [Quadro P600] 1cb3 GP107GL [Quadro P400] + 1cb6 GP107GL [Quadro P620] 1d01 GP108 [GeForce GT 1030] 1d10 GP108M [GeForce MX150] 1d33 GP108GL [Quadro P500] 1d81 GV100 [TITAN V] - 1db1 GV100 [Tesla V100 SXM2] - 1db4 GV100 [Tesla V100 PCIe] + 1db1 GV100GL [Tesla V100 SXM2] + 1db4 GV100GL [Tesla V100 PCIe] 10df Emulex Corporation 0720 OneConnect NIC (Skyhawk) 103c 1934 FlexFabric 20Gb 2-port 650M Adapter @@ -11282,7 +11361,7 @@ 1043 16d5 U6V/U31J laptop 1043 81aa P5B 1043 82c6 M3A78 Series Motherboard - 1043 83a3 M4A785TD Motherboard + 1043 83a3 M4A785/P7P55 Motherboard 1043 8432 P8P67 and other motherboards 1043 8505 P8 series motherboard 105b 0d7c D270S/D250S Motherboard @@ -11290,6 +11369,7 @@ 144d c652 RTL8168 on a NP300E5C series laptop 1458 e000 Onboard Ethernet 1462 238c Onboard RTL8111b on MSI P965 Platinum Mainboard + 1462 345c RTL8111B on MS-7345 Motherboard 1462 368c K9AG Neo2 1462 4180 Wind PC MS-7418 1462 7522 X58 Pro-E @@ -13306,9 +13386,47 @@ 117c 802f ExpressPCI UL5D Low Profile 0033 SAS Adapter 0041 ExpressSAS R30F + 0042 ExpressSAS 6Gb/s SAS/SATA HBA + 117c 0042 ExpressSAS H680 + 117c 0043 ExpressSAS H608 + 117c 0044 ExpressSAS H60F + 117c 0045 ExpressSAS H6F0 + 117c 0046 ExpressSAS H644 + 117c 004f ExpressSAS M608 + 117c 0057 ExpressSAS M680 + 117c 0058 ExpressSAS M644 + 117c 0059 ExpressSAS W608 + 117c 005a ExpressSAS W680 + 117c 005b ExpressSAS W644 + 0049 ExpressSAS 6Gb SAS/SATA RAID Adapter + 117c 0049 ExpressSAS R680 + 117c 004a ExpressSAS R608 + 117c 004b ExpressSAS R60F + 117c 004c ExpressSAS R6F0 + 117c 004d ExpressSAS R644 + 117c 004e ExpressSAS R648 + 0064 Celerity FC 16Gb/s Gen 5 Fibre Channel HBA + 117c 0063 Celerity FC-161E + 117c 0064 Celerity FC-162E + 117c 0065 Celerity FC-164E + 0094 Celerity FC 16/32Gb/s Gen 6 Fibre Channel HBA + 117c 0094 Celerity FC-162P + 117c 00a0 Celerity FC-161P + 117c 00a1 Celerity FC-164P + 117c 00a2 Celerity FC-321E + 117c 00a3 Celerity FC-322E + 117c 00ac Celerity FC-324E 8013 ExpressPCI UL4D 8014 ExpressPCI UL4S 8027 ExpressPCI UL5D + 8070 ExpressSAS 12Gb/s SAS/SATA HBA + 117c 0070 ExpressSAS H1280 + 117c 0071 ExpressSAS H1208 + 117c 0080 ExpressSAS H1244 + 8072 ExpressSAS 12Gb/s SAS/SATA HBA + 117c 0072 ExpressSAS H12F0 + 117c 0073 ExpressSAS H120F + 117c 0082 ExpressSAS H1288 117d Becton & Dickinson 117e T/R Systems 117f Integrated Circuit Systems @@ -13363,6 +13481,7 @@ 1025 0121 Aspire 5920G 1028 01d7 XPS M1210 1028 01f3 Inspiron 1420 + 1028 022f Inspiron 1525 103c 30b5 Presario V3242AU 103c 30b7 Presario V6133CL 103c 30cc Pavilion dv6700 @@ -13380,6 +13499,7 @@ 1028 01a2 Inspiron 9200 1028 01d7 XPS M1210 1028 01f3 Inspiron 1420 + 1028 022f Inspiron 1525 103c 03b5 Presario V3242AU 103c 30b7 Presario V6133CL 103c 30c1 Compaq 6910p @@ -13396,6 +13516,7 @@ 1025 0121 Aspire 5920G 1028 01d7 XPS M1210 1028 01f3 Inspiron 1420 + 1028 022f Inspiron 1525 1028 024d Latitude E4300 103c 30b5 Presario V3242AU 103c 30b7 Presario V6133CL @@ -13418,6 +13539,7 @@ 0852 xD-Picture Card Controller 1025 0121 Aspire 5920G 1028 01f3 Inspiron 1420 + 1028 022f Inspiron 1525 103c 30b5 Presario V3242AU 103c 30b7 Presario V6133CL 103c 30cc Pavilion dv6700 @@ -13669,6 +13791,7 @@ 4353 88E8039 PCI-E Fast Ethernet Controller 104d 902d VAIO VGN-NR120E 4354 88E8040 PCI-E Fast Ethernet Controller + 1028 022f Inspiron 1525 144d c06a R730 Laptop 144d c072 Notebook N150P 4355 88E8040T PCI-E Fast Ethernet Controller @@ -13764,8 +13887,9 @@ 6081 MV88SX6081 8-port SATA II PCI-X Controller 6101 88SE6101/6102 single-port PATA133 interface 1043 82e0 P5K PRO Motherboard - 6111 88SE6111 1-port PATA133(IDE) and 1-port SATA II Controllers - 6121 88SE6121 SATA II / PATA Controller + 6121 88SE6111/6121 SATA II / PATA Controller +# 6111: 1 SATA port; 6121: 2 SATA ports + 11ab 6121 88SE6111/6121 1/2 port SATA II + 1 port PATA Controller 6141 88SE614x SATA II PCI-E controller 6145 88SE6145 SATA II PCI-E controller 6180 88F6180 [Kirkwood] ARM SoC @@ -14091,6 +14215,7 @@ 8000 PM8000 [SPC - SAS Protocol Controller] 8009 PM8009 SPCve 8x6G 8032 ATTO Celerity FC8xEN + 117c 003a Celerity FC-81EN Fibre Channel Adapter 117c 003b Celerity FC-82EN Fibre Channel Adapter 117c 003c Celerity FC-84EN Fibre Channel Adapter 8053 PM8053 SXP 12G 24-port SAS/SATA expander @@ -14111,39 +14236,39 @@ 11fc Silicon Magic 11fd High Street Consultants 11fe Comtrol Corporation - 0001 RocketPort 32 port w/external I/F - 0002 RocketPort 8 port w/external I/F - 0003 RocketPort 16 port w/external I/F - 0004 RocketPort 4 port w/quad cable - 0005 RocketPort 8 port w/octa cable - 0006 RocketPort 8 port w/RJ11 connectors - 0007 RocketPort 4 port w/RJ11 connectors - 0008 RocketPort 8 port w/ DB78 SNI (Siemens) connector - 0009 RocketPort 16 port w/ DB78 SNI (Siemens) connector - 000a RocketPort Plus 4 port - 000b RocketPort Plus 8 port - 000c RocketModem 6 port + 0001 RocketPort PCI 32-port w/external I/F + 0002 RocketPort PCI 8-port w/external I/F + 0003 RocketPort PCI 16-port w/external I/F + 0004 RocketPort PCI 4-port w/Quad Cable + 0005 RocketPort PCI 8-port w/Octa Cable + 0006 RocketPort PCI 8-port w/RJ11 connectors + 0007 RocketPort PCI 4-port w/RJ45 connectors + 0008 RocketPort PCI 8-port w/DB78 SNI connector (Siemens) + 0009 RocketPort PCI 16-port w/DB78 SNI connector (Siemens) + 000a RocketPort PCI Plus 4-port w/Quad Cable + 000b RocketPort PCI Plus 8-port w/Octa Cable + 000c RocketModem II 6-port 000d RocketModem 4-port - 000e RocketPort Plus 2 port RS232 - 000f RocketPort Plus 2 port RS422 - 0040 RocketPort Infinity Octa, 8port, RJ45 - 0041 RocketPort Infinity 32port, External Interface - 0042 RocketPort Infinity 8port, External Interface - 0043 RocketPort Infinity 16port, External Interface - 0044 RocketPort Infinity Quad, 4port, DB - 0045 RocketPort Infinity Octa, 8port, DB + 000e RocketPort PCI Plus 2-port RS-232 w/DB9 connectors + 000f RocketPort PCI Plus 2-port SMPTE w/DB9 connectors + 0040 RocketPort INFINITY 8-port w/Octa Cable RJ45 + 0041 RocketPort INFINITY 32-port w/external I/F + 0042 RocketPort INFINITY 8-port w/external I/F + 0043 RocketPort INFINITY 16-port w/external I/F + 0044 RocketPort INFINITY 4-port w/Quad Cable DB + 0045 RocketPort INFINITY 8-port w/Octa Cable DB 0046 RocketPort INFINITY 4-port w/external I/F - 0047 RocketPort Infinity 4port, RJ45 + 0047 RocketPort INFINITY 4J (4-port) w/RJ45 connectors 0048 RocketPort INFINITY 4J (4-port) w/RJ45 connectors 004a RocketPort INFINITY Plus 4-port 004b RocketPort INFINITY Plus 8-port 004c RocketModem INFINITY III 8-port 004d RocketModem INFINITY III 4-port 004e RocketPort INFINITY Plus 2-port - 004f RocketPort Infinity 2port, SMPTE + 004f RocketPort INFINITY 2-port SMPTE w/DB9 connectors 0050 RocketPort INFINITY Plus 4-port RJ45 0051 RocketPort INFINITY Plus 8-port RJ11 - 0052 RocketPort Infinity Octa, 8port, SMPTE + 0052 RocketPort INFINITY 8-port SMPTE w/DB9 Connectors 0060 RocketPort EXPRESS 8-port w/Octa Cable 0061 RocketPort EXPRESS 32-port w/external I/F 0062 RocketPort EXPRESS 8-Port w/external I/F @@ -14161,7 +14286,7 @@ 0805 RocketPort uPCI 8-port w/Octa Cable 080b RocketPort Plus uPCI 8-port w/Octa Cable 080c RocketModem III 8-port - 080d RcoketModem III 4-port + 080d RocketModem III 4-port 080e RocketPort uPCI 2-port RS232 w/DB9 connectors 080f RocketPort uPCI SMPTE 2-port 0810 RocketPort Plus uPCI 4J (4-port) w/RJ45 connectors @@ -16337,6 +16462,7 @@ 4887 T440T-4087 Unified Wire Ethernet Controller [VF] 4888 T440-4088 Unified Wire Ethernet Controller [VF] 5001 T520-CR Unified Wire Ethernet Controller + 193d 1001 510F-B 5002 T522-CR Unified Wire Ethernet Controller 5003 T540-CR Unified Wire Ethernet Controller 5004 T520-BCH Unified Wire Ethernet Controller @@ -17060,6 +17186,7 @@ 14be L3 Communications 14bf SPIDER Communications Inc. 14c0 COMPAL Electronics Inc + 1201 X550 10Gb 2P RJ45 OCP Mezz # now owned by CSP, Inc. 14c1 MYRICOM Inc. 0008 Myri-10G Dual-Protocol NIC @@ -17168,7 +17295,12 @@ 107b 5048 E4500 Onboard 1259 2705 AT-2711FX 1601 NetXtreme BCM5752M Gigabit Ethernet PCI Express + 1604 BCM5745X NetXtreme-E Ethernet Partition + 1605 BCM5745X NetXtreme-E RDMA Partition + 1606 BCM5745X NetXtreme-E RDMA Virtual Function + 1609 BCM5745X NetXtreme-E Ethernet Virtual Function 1612 BCM70012 Video Decoder [Crystal HD] + 1614 BCM57454 NetXtreme-E 10Gb/25Gb/40Gb/50Gb/100Gb Ethernet 1615 BCM70015 Video Decoder [Crystal HD] 1639 NetXtreme II BCM5709 Gigabit Ethernet 1028 0235 PowerEdge R710 BCM5709 Gigabit Ethernet @@ -17411,6 +17543,8 @@ 103c 193a FlexFabric 10Gb 2-port 533FLR-T Adapter 103c 3382 Ethernet 10Gb 2-port 530FLR-SFP+ Adapter 103c 339d Ethernet 10Gb 2-port 530SFP+ Adapter + 193d 1003 530F-B + 193d 1006 530F-L 1690 NetXtreme BCM57760 Gigabit Ethernet PCIe 1691 NetLink BCM57788 Gigabit Ethernet PCIe 1028 04aa XPS 8300 @@ -17583,6 +17717,7 @@ 16ed BCM57414 NetXtreme-E RDMA Partition 16ee BCM57416 NetXtreme-E Ethernet Partition 16ef BCM57416 NetXtreme-E RDMA Partition + 16f1 BCM57452 NetXtreme-E 10Gb/25Gb/40Gb/50Gb Ethernet 16f3 NetXtreme BCM5727 Gigabit Ethernet PCIe 16f7 NetXtreme BCM5753 Gigabit Ethernet PCI Express 16fd NetXtreme BCM5753M Gigabit Ethernet PCI Express @@ -17859,6 +17994,13 @@ aa52 BCM43602 802.11ac Wireless LAN SoC b302 BCM56302 StrataXGS 24x1GE 2x10GE Switch Controller b334 BCM56334 StrataXGS 24x1GE 4x10GE Switch Controller + b370 BCM56370 Switch ASIC + b371 BCM56371 Switch ASIC + b372 BCM56372 Switch ASIC + b375 BCM56375 Switch ASIC + b376 BCM56376 Switch ASIC + b377 BCM56377 Switch ASIC + b379 Broadcom BCM56379 Switch ASIC b800 BCM56800 StrataXGS 10GE Switch Controller b842 BCM56842 Trident 10GE Switch Controller # Trident2 @@ -18567,6 +18709,7 @@ 15b3 0078 ConnectX-3 Pro 10 GbE Dual Port KR Mezzanine Card 15b3 0079 ConnectX-3 Pro 40 GbE Dual Port QSFP+ Adapter 15b3 0080 ConnectX-3 Pro 10 GbE Dual Port SFP+ Adapter + 193d 1002 520F-B 1009 MT27530 Family 100a MT27531 Family 100b MT27540 Family @@ -18594,6 +18737,7 @@ 15b3 0020 MCX4411A-ACQN, ConnectX-4 Lx EN OCP, 1x25Gb 15b3 0021 MCX4421A-ACQN ConnectX-4 Lx EN OCP,2x25G 15b3 0025 ConnectX-4 Lx 25 GbE Dual Port SFP28 rNDC + 193d 100a 620F-B 1016 MT27710 Family [ConnectX-4 Lx Virtual Function] 1017 MT27800 Family [ConnectX-5] 1018 MT27800 Family [ConnectX-5 Virtual Function] @@ -18661,7 +18805,7 @@ # Spectrum, 100GbE Switch cb84 MT52100 cf08 MT53236 - cf6c MT53100 [Spectrum-2, 64 x 100GbE switch] + cf6c MT53100 [Spectrum-2] d2f0 Switch-IB 3 HDR (200Gbps) switch 15b4 CCI/TRIAD 15b5 Cimetrics Inc @@ -18826,6 +18970,14 @@ 5641 FarSync T4Ee PCI Express (4 port X.21/V.35/V.24) 6620 FarSync T2U-PMC PCI Express (2 port X.21/V.35/V.24) 161f Rioworks +1621 Lynx Studio Technology, Inc. + 0020 LynxTWO-A + 0021 LynxTWO-B + 0022 LynxTWO-C + 0023 Lynx L22 + 0024 Lynx AES16 + 0025 Lynx AES16-SRC + 0028 Lynx AES16e 1626 TDK Semiconductor Corp. 8410 RTL81xx Fast Ethernet 1629 Kongsberg Spacetec AS @@ -19346,6 +19498,9 @@ 7029 AP342 14-bit, 12-Channel Isolated Simultaneous Conversion Analog Input Module 702a AP226 12-Bit, 8-Channel Isolated Analog Output Module 702b AP236 16-Bit, 8-Channel Isolated Analog Output Module + 7031 AP441-1: 32-Channel Isolated Digital Input Module + 7032 AP441-2: 32-Channel Isolated Digital Input Module + 7033 AP441-3: 32-Channel Isolated Digital Input Module 7042 AP482 Counter Timer Module with TTL Level Input/Output 7043 AP483 Counter Timer Module with TTL Level and RS422 Input/Output 7044 AP484 Counter Timer Module with RS422 Input/Output @@ -19418,6 +19573,7 @@ 0101 PCD-7004 Digital Bi-Directional Ports PCI Card 0102 PCD-7104 Digital Input & Output PCI Card 0303 PCD-7006C Digital Input & Output PCI Card +1761 Pickering Interfaces Ltd 1771 InnoVISION Multimedia Ltd. # nee SBS Technologies 1775 GE Intelligent Platforms @@ -20620,6 +20776,7 @@ 0009 RAIDCore Controller 000a RAIDCore Controller 1aae Global Velocity, Inc. +1ab4 FFEI Ltd 1ab6 CalDigit, Inc. 6201 RAID Card # Parallels VM virtual devices @@ -20794,6 +20951,9 @@ 91a4 88SE912x IDE Controller 9220 88SE9220 PCIe 2.0 x2 2-port SATA 6 Gb/s RAID Controller 9230 88SE9230 PCIe SATA 6Gb/s Controller + 1028 1fd6 BOSS-S1 Adapter + 1028 1fdf BOSS-S1 Modular + 1028 1fe2 BOSS-S1 Adapter 1d49 0300 ThinkSystem M.2 with Mirroring Enablement Kit 9235 88SE9235 PCIe 2.0 x2 4-port SATA 6 Gb/s Controller 9445 88SE9445 PCIe 2.0 x4 4-Port SAS/SATA 6 Gbps RAID Controller @@ -20936,6 +21096,8 @@ 1014 04f5 PCIe3 1.6TB NVMe Flash Adapter 1014 04f6 PCIe3 3.2TB NVMe Flash Adapter 0023 Ultrastar SN200 Series NVMe SSD +1c5c SK hynix + 1283 PC300 NVMe Solid State Drive 1c5f Beijing Memblaze Technology Co. Ltd. 0540 PBlaze4 NVMe SSD # http://www.nicevt.ru/ (in Russian) @@ -21139,6 +21301,9 @@ e00b Skylark PCI Express Root Port 6 [X-Gene 3] e00c Skylark PCI Express Root Port 7 [X-Gene 3] 1df7 opencpi.org + 0001 ml605 + 0002 alst4 + 0003 alst4x # nee Tumsan Oy 1fc0 Ascom (Finland) Oy 0300 E2200 Dual E1/Rawpipe Card @@ -21189,6 +21354,7 @@ 4027 TN9710P 10GBase-T/NBASE-T Ethernet Adapter 1154 0368 LGY-PCIE-MG 1432 8104 10 Gigabit Ethernet PCI Express Adapter + 1546 4027 IOI9710P 10Gbase-T/NBASE-T Ethernet Adapter 1fc9 3015 Ethernet Adapter 4527 TN9710Q 5GBase-T/NBASE-T Ethernet Adapter 1fcc StreamLabs @@ -23254,6 +23420,7 @@ 17aa 402b 82599ES 10Gb 2-port Server Adapter X520-DA2 17aa 402f FPGA Card XC7VX690T-3FFG1157E 18d4 0c09 82599ES 10Gb 2-port SFP+ OCP Mezz Card MOP81-I-10GS2 + 193d 1004 560F-B 1bd4 001b 10G SFP+ DP ER102Fi4 Rack Adapter 1bd4 002f 10G SFP+ DP EP102Fi4A Adapter 1bd4 0032 10G SFP+ DP EP102Fi4 Adapter @@ -23572,6 +23739,8 @@ 17aa 1074 ThinkServer I350-T4 AnyFabric 17aa 4005 I350 Gigabit Network Connection 18d4 0c07 I350 1Gb 2-port RJ45 OCP Mezz Card MOP41-I-1GT2 + 193d 1005 360T-B + 193d 1007 360T-L 1bd4 001d 1G base-T QP EP014Ti1 Adapter 1bd4 0035 1G base-T QP EP014Ti1 Adapter 8086 0001 Ethernet Server Adapter I350-T4 @@ -23685,9 +23854,12 @@ 1563 Ethernet Controller 10G X550T 1028 1fa8 Ethernet 10G 4P X550/I350 rNDC 1028 1fa9 Ethernet 10G 4P X550 rNDC + 14c0 1201 X550 10Gb 2P RJ45 OCP Mezz 1590 00d1 Ethernet 10Gb 2-port 562T Adapter 1590 00d2 Ethernet 10Gb 2-port 562FLR-T Adapter 18d4 0c08 X550 10Gb 2-port RJ45 OCP Mezz Card MOP81-I-10GT2 + 193d 1008 560T-B + 193d 1009 560T-L 8086 0001 Ethernet Converged Network Adapter X550-T2 8086 001a Ethernet Converged Network Adapter X550-T2 8086 001b Ethernet Server Adapter X550-T2 for OCP @@ -24698,6 +24870,7 @@ 1043 8277 P5K PRO Motherboard 1043 844d P8 series motherboard 1458 5000 Motherboard + 1462 7345 MS-7345 Motherboard: Intel 82801I/IR [ICH9/ICH9R] 1462 7418 Wind PC MS-7418 15d9 060d C7SIM-Q Motherboard 15d9 9680 X7DBN Motherboard @@ -25186,6 +25359,7 @@ 24f4 Wireless 8260 # Snow Field Peak AC 8086 0030 Dual Band Wireless-AC 8260 + 24fb Dual Band Wireless-AC 3168NGW [Stone Peak] 24fd Wireless 8265 / 8275 # Windstorm Peak 8086 0010 Dual Band Wireless-AC 8265 @@ -25199,6 +25373,7 @@ 250f 82820 820 (Camino) Chipset AGP Bridge 2520 82805AA MTH Memory Translator Hub 2521 82804AA MRH-S Memory Repeater Hub for SDRAM + 2526 Wireless-AC 9260 2530 82850 850 (Tehama) Chipset Host Bridge (MCH) 1028 00c7 Dimension 8100 147b 0507 TH7II-RAID @@ -26072,6 +26247,7 @@ 2815 82801HM (ICH8M) LPC Interface Controller 1025 0121 Aspire 5920G 1028 01f3 Inspiron 1420 + 1028 022f Inspiron 1525 103c 30c0 Compaq 6710b 103c 30cc Pavilion dv6700 103c 30d9 Presario C700 @@ -26087,6 +26263,7 @@ 1028 020d Inspiron 530 103c 2a6f Asus IPIBL-LB Motherboard 1043 8277 P5K PRO Motherboard: 82801IR [ICH9R] + 1462 7345 MS-7345 Motherboard: Intel 82801I/IR [ICH9/ICH9R] 2823 C610/X99 series chipset sSATA Controller [RAID mode] 2824 82801HB (ICH8) 4 port SATA Controller [AHCI mode] 1043 81ec P5B @@ -26108,6 +26285,7 @@ e4bf cc47 CCG-RUMBA 2829 82801HM/HEM (ICH8M/ICH8M-E) SATA Controller [AHCI mode] 1025 0121 Aspire 5920G + 1028 022f Inspiron 1525 103c 30c0 Compaq 6710b 103c 30c1 Compaq 6910p 103c 30cc Pavilion dv6700 @@ -26124,6 +26302,7 @@ 1025 0121 Aspire 5920G 1028 01da OptiPlex 745 1028 01f3 Inspiron 1420 + 1028 022f Inspiron 1525 103c 30c0 Compaq 6710b 103c 30c1 Compaq 6910p 103c 30cc Pavilion dv6700 @@ -26139,6 +26318,7 @@ 1025 0121 Aspire 5920G 1028 01da OptiPlex 745 1028 01f3 Inspiron 1420 + 1028 022f Inspiron 1525 103c 30c0 Compaq 6710b 103c 30c1 Compaq 6910p 103c 30cc Pavilion dv6700 @@ -26154,6 +26334,7 @@ 1025 0121 Aspire 5920G 1028 01da OptiPlex 745 1028 01f3 Inspiron 1420 + 1028 022f Inspiron 1525 103c 30c0 Compaq 6710b 103c 30c1 Compaq 6910p 103c 30cc Pavilion dv6700 @@ -26170,6 +26351,7 @@ 1025 0121 Aspire 5920G 1028 01da OptiPlex 745 1028 01f3 Inspiron 1420 + 1028 022f Inspiron 1525 103c 30c0 Compaq 6710b 103c 30c1 Compaq 6910p 103c 30cc Pavilion dv6700 @@ -26184,6 +26366,7 @@ 1025 0121 Aspire 5920G 1028 01da OptiPlex 745 1028 01f3 Inspiron 1420 + 1028 022f Inspiron 1525 103c 30c0 Compaq 6710b 103c 30c1 Compaq 6910p 103c 30cc Pavilion dv6700 @@ -26197,6 +26380,7 @@ 1025 0121 Aspire 5920G 1028 01da OptiPlex 745 1028 01f3 Inspiron 1420 + 1028 022f Inspiron 1525 103c 30c0 Compaq 6710b 103c 30c1 Compaq 6910p 103c 30cc Pavilion dv6700 @@ -26212,6 +26396,7 @@ 1025 0121 Aspire 5920G 1028 01da OptiPlex 745 1028 01f3 Inspiron 1420 + 1028 022f Inspiron 1525 103c 30c0 Compaq 6710b 103c 30c1 Compaq 6910p 103c 30cc Pavilion dv6700 @@ -26225,6 +26410,7 @@ 1025 0121 Aspire 5920G 1028 01da OptiPlex 745 1028 01f3 Inspiron 1420 + 1028 022f Inspiron 1525 103c 30d9 Presario C700 1043 81ec P5B 104d 9005 Vaio VGN-FZ260E @@ -26266,6 +26452,7 @@ 1028 01f3 Inspiron 1420 1028 01f9 Latitude D630 1028 01ff Precision M4300 + 1028 022f Inspiron 1525 1028 0256 Studio 1735 103c 2802 Compaq dc7700p 103c 30c0 Compaq 6710b @@ -26286,6 +26473,7 @@ 2850 82801HM/HEM (ICH8M/ICH8M-E) IDE Controller 1025 0121 Aspire 5920G 1028 01f3 Inspiron 1420 + 1028 022f Inspiron 1525 103c 30c0 Compaq 6710b 103c 30c1 Compaq 6910p 103c 30cc Pavilion dv6700 @@ -26302,6 +26490,7 @@ 1028 020d Inspiron 530 103c 2a6f Asus IPIBL-LB Motherboard 1043 8277 P5K PRO Motherboard + 1462 7345 MS-7345 Motherboard 8086 5044 Desktop Board DP35DP 2917 ICH9M-E LPC Interface Controller e4bf cc4d CCM-BOOGIE @@ -26317,6 +26506,7 @@ 1028 0211 Optiplex 755 1028 023c PowerEdge R200 onboard SATA Controller 1043 8277 P5K PRO Motherboard: 82801IR [ICH9R] + 1462 7345 MS-7345 Motherboard: Intel 82801IR [ICH9R] 2921 82801IB (ICH9) 2 port SATA Controller [IDE mode] 1028 0235 PowerEdge R710 SATA IDE Controller 1028 0236 PowerEdge R610 SATA IDE Controller @@ -26324,6 +26514,7 @@ 1462 7360 G33/P35 Neo 2922 82801IR/IO/IH (ICH9R/DO/DH) 6 port SATA Controller [AHCI mode] 1043 8277 P5K PRO Motherboard: 82801IR [ICH9R] + 1462 7345 MS-7345 Motherboard: Intel 82801IR [ICH9R] 1af4 1100 QEMU Virtual Machine 8086 5044 Desktop Board DP35DP 2923 82801IB (ICH9) 4 port SATA Controller [AHCI mode] @@ -26336,6 +26527,7 @@ 1028 0210 PowerEdge T300 onboard SATA Controller 1028 0211 Optiplex 755 1043 8277 P5K PRO Motherboard: 82801IR [ICH9R] + 1462 7345 MS-7345 Motherboard: Intel 82801IR [ICH9R] 1462 7360 G33/P35 Neo 2928 82801IBM/IEM (ICH9M/ICH9M-E) 2 port SATA Controller [IDE mode] 2929 82801IBM/IEM (ICH9M/ICH9M-E) 4 port SATA Controller [AHCI mode] @@ -26350,6 +26542,7 @@ 103c 2a6f Asus IPIBL-LB Motherboard 103c 3628 dv6-1190en 1043 8277 P5K PRO Motherboard: 82801IR [ICH9R] + 1462 7345 MS-7345 Motherboard: Intel 82801I/IR [ICH9/ICH9R] 1462 7360 G33/P35 Neo 1af4 1100 QEMU Virtual Machine 8086 5044 Desktop Board DP35DP @@ -26370,6 +26563,7 @@ 1028 2011 Optiplex 755 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Feb 15 11:39: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 C1B53F1589B; Thu, 15 Feb 2018 11:39:59 +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 2992E7289E; Thu, 15 Feb 2018 11:39:59 +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 ESMTPS id w1FBdpGZ053041 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 15 Feb 2018 13:39:54 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w1FBdpGZ053041 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w1FBdpkK053040; Thu, 15 Feb 2018 13:39:51 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 15 Feb 2018 13:39:51 +0200 From: Konstantin Belousov To: Conrad Meyer Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329282 - head/share/man/man9 Message-ID: <20180215113951.GH94212@kib.kiev.ua> References: <201802142347.w1ENl4In007623@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201802142347.w1ENl4In007623@repo.freebsd.org> User-Agent: Mutt/1.9.3 (2018-01-21) 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.25 Precedence: list List-Id: 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, 15 Feb 2018 11:39:59 -0000 On Wed, Feb 14, 2018 at 11:47:04PM +0000, Conrad Meyer wrote: > Author: cem > Date: Wed Feb 14 23:47:04 2018 > New Revision: 329282 > URL: https://svnweb.freebsd.org/changeset/base/329282 > > Log: > pmap_qenter.9: Document API NX mapping > > A follow-up to r329281. > > Sponsored by: Dell EMC Isilon > > Modified: > head/share/man/man9/pmap_qenter.9 > > Modified: head/share/man/man9/pmap_qenter.9 > ============================================================================== > --- head/share/man/man9/pmap_qenter.9 Wed Feb 14 23:35:47 2018 (r329281) > +++ head/share/man/man9/pmap_qenter.9 Wed Feb 14 23:47:04 2018 (r329282) > @@ -25,7 +25,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd July 21, 2003 > +.Dd February 14, 2018 > .Dt PMAP_QENTER 9 > .Os > .Sh NAME > @@ -50,6 +50,7 @@ pointers to wired pages > and enters each of these pages into the kernel virtual address (KVA) space, > beginning at the address > .Fa sva . > +The pages are mapped non-executable. I think that this is too strong statement. It is not even true on i386 without PAE. Also, the man page describes the interface between pmap and MI VM, so it should explain the difference between required in allowed. In this case, it is acceptable for an architecture to implement pmap_qenter() by creating non-exec mappings, but the architecture is not required to do that. > .Pp > The > .Fn pmap_qremove From owner-svn-src-head@freebsd.org Thu Feb 15 11: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 ACA6DF15A94; Thu, 15 Feb 2018 11:41:38 +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 5A58772CD1; Thu, 15 Feb 2018 11:41:38 +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 553ED1E4A5; Thu, 15 Feb 2018 11:41:38 +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 w1FBfcEj066408; Thu, 15 Feb 2018 11:41:38 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FBfcBq066407; Thu, 15 Feb 2018 11:41:38 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201802151141.w1FBfcBq066407@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 15 Feb 2018 11:41:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329312 - head/etc/autofs X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/etc/autofs X-SVN-Commit-Revision: 329312 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 15 Feb 2018 11:41:38 -0000 Author: eadler Date: Thu Feb 15 11:41:38 2018 New Revision: 329312 URL: https://svnweb.freebsd.org/changeset/base/329312 Log: etc: clean up trailing whitespace in autofs Obtained from: DragonFlyBSD (48a93f514f93ff671b7b6c9bbed54d45b3f65180) Modified: head/etc/autofs/special_media Modified: head/etc/autofs/special_media ============================================================================== --- head/etc/autofs/special_media Thu Feb 15 11:13:21 2018 (r329311) +++ head/etc/autofs/special_media Thu Feb 15 11:41:38 2018 (r329312) @@ -41,7 +41,7 @@ print_map_entry() { case "${_fstype}" in "exfat") if [ -f "/usr/local/sbin/mount.exfat" ]; then - echo "-mountprog=/usr/local/sbin/mount.exfat,fstype=${_fstype},nosuid :/dev/${_p}" + echo "-mountprog=/usr/local/sbin/mount.exfat,fstype=${_fstype},nosuid :/dev/${_p}" else /usr/bin/logger -p info -t "special_media[$$]" \ "Cannot mount ${_fstype} formatted device /dev/${_p}: Install sysutils/fusefs-exfat first" @@ -50,7 +50,7 @@ print_map_entry() { ;; "ntfs") if [ -f "/usr/local/bin/ntfs-3g" ]; then - echo "-mountprog=/usr/local/bin/ntfs-3g,fstype=${_fstype},nosuid :/dev/${_p}" + echo "-mountprog=/usr/local/bin/ntfs-3g,fstype=${_fstype},nosuid :/dev/${_p}" else /usr/bin/logger -p info -t "special_media[$$]" \ "Cannot mount ${_fstype} formatted device /dev/${_p}: Install sysutils/fusefs-ntfs first" @@ -58,10 +58,10 @@ print_map_entry() { fi ;; "ext2fs" | "msdosfs") - echo "-fstype=${_fstype},nosuid,async :/dev/${_p}" + echo "-fstype=${_fstype},nosuid,async :/dev/${_p}" ;; *) - echo "-fstype=${_fstype},nosuid :/dev/${_p}" + echo "-fstype=${_fstype},nosuid :/dev/${_p}" ;; esac } From owner-svn-src-head@freebsd.org Thu Feb 15 12:23: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 CDC2CF19567; Thu, 15 Feb 2018 12:23:06 +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 B00B8747CD; Thu, 15 Feb 2018 12:23:05 +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 A80CD1047FC1; Thu, 15 Feb 2018 23:22:57 +1100 (AEDT) Date: Thu, 15 Feb 2018 23:22:56 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh cc: Eitan Adler , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329296 - head/sbin/devd In-Reply-To: Message-ID: <20180215231649.Q985@besplex.bde.org> References: <201802150322.w1F3Mrie018786@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=6I5d2MoRAAAA:8 a=7Qk2ozbKAAAA:8 a=vSB-gUQo5yuNJ_K1mewA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=1lyxoWkJIXJV6VJUPhuM:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 15 Feb 2018 12:23:07 -0000 On Wed, 14 Feb 2018, Warner Losh wrote: > On Wed, Feb 14, 2018 at 8:51 PM, Eitan Adler wrote: > >> On 14 February 2018 at 19:48, Warner Losh wrote: >>> >>> On Wed, Feb 14, 2018 at 8:39 PM, Warner Losh wrote: >>>> >>>> On Feb 14, 2018 8:23 PM, "Eitan Adler" wrote: >>>> Log: >>>> devd: don't pass &fds in useless parameters to select(2) >>>> >>>> select(2) should be declared as restrict. In addition the only fd in >>>> the fdset is open O_RDONLY, and it's not a socket that can provide OOB >>>> notifications, >>>> >>>> Reviewed by: ian, imp, vangyzen >>>> >>>> Don't put my name on this. I specifically and clearly objected to the >>>> change anf tld yoy not to do it. >>> >>> Stupid phone... >>> >>> I specifically objected to this change. I said not to make it because it >>> wasn't necessary. You did it any way. Don't put "reviewed by" for that. >> Put >>> "objected to but I did it anyway by: imp" It is worse than unnecessary. It breaks at least "any" in the comment before it. "any" means read, write or exeptional descriptors, but now only read descriptors are checked. >> hrm.. rereading the thread I think I missed your original email. Only >> comment I saw was "poll is a better interface". Sorry for mis-stating >> your opinion. > > Yea. It was more of a "don't change it, since it's fine now" and then the > "poll" comment was "better to just change to a better interface." > >> FTR I'd like to fix the declaration of select(2) anyways. > > That's unlikely to end well... I wish you luck... The pattern I used in > devd for select was nearly universal a decade ago... Maybe things have > changed... It can't be nearly universal except possibly for the very special check where you don't care which events occurred, just whether there was one, and also don't wait for any events, but just check for one in a racy way. Bruce From owner-svn-src-head@freebsd.org Thu Feb 15 14:46: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 9C927F23988; Thu, 15 Feb 2018 14:46:30 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C7807BD8A; Thu, 15 Feb 2018 14:46:30 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 42C27201E7; Thu, 15 Feb 2018 14:46:30 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1FEkUup065186; Thu, 15 Feb 2018 14:46:30 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FEkT4Q065184; Thu, 15 Feb 2018 14:46:29 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802151446.w1FEkT4Q065184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 15 Feb 2018 14:46:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329314 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Commit-Revision: 329314 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 15 Feb 2018 14:46:30 -0000 Author: avg Date: Thu Feb 15 14:46:29 2018 New Revision: 329314 URL: https://svnweb.freebsd.org/changeset/base/329314 Log: MFV r329313: 8857 zio_remove_child() panic due to already destroyed parent zio illumos/illumos-gate@d6e1c446d7897003fd9fd36ef5aa7da350b7f6af https://github.com/illumos/illumos-gate/commit/d6e1c446d7897003fd9fd36ef5aa7da350b7f6af https://www.illumos.org/issues/8857 I had an OS panic on one of our servers: ffffff01809128c0 vpanic() ffffff01809128e0 mutex_panic+0x58(fffffffffb94c904, ffffff597dde7f80) ffffff0180912950 mutex_vector_enter+0x347(ffffff597dde7f80) ffffff01809129b0 zio_remove_child+0x50(ffffff597dde7c58, ffffff32bd901ac0, ffffff3373370908) ffffff0180912a40 zio_done+0x390(ffffff32bd901ac0) ffffff0180912a70 zio_execute+0x78(ffffff32bd901ac0) ffffff0180912b30 taskq_thread+0x2d0(ffffff33bae44140) ffffff0180912b40 thread_start+8() It panicked here: http://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/fs/zfs/ zio.c#430 pio->io_lock is DEAD, thus a panic. Further analysis shows the "pio" (parent zio of "cio") has already been destroyed. Reviewed by: Matthew Ahrens Reviewed by: Andriy Gapon Reviewed by: Youzhong Yang Approved by: Dan McDonald Author: George Wilson PR: 223803 Tested by: shiva.bhanujan@quorum.com MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Thu Feb 15 14:34:18 2018 (r329313) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Thu Feb 15 14:46:29 2018 (r329314) @@ -201,6 +201,9 @@ enum zio_flag { (((zio)->io_flags & ZIO_FLAG_VDEV_INHERIT) | \ ZIO_FLAG_CANFAIL) +#define ZIO_CHILD_BIT(x) (1 << (x)) +#define ZIO_CHILD_BIT_IS_SET(val, x) ((val) & (1 << (x))) + enum zio_child { ZIO_CHILD_VDEV = 0, ZIO_CHILD_GANG, @@ -208,6 +211,14 @@ enum zio_child { ZIO_CHILD_LOGICAL, ZIO_CHILD_TYPES }; + +#define ZIO_CHILD_VDEV_BIT ZIO_CHILD_BIT(ZIO_CHILD_VDEV) +#define ZIO_CHILD_GANG_BIT ZIO_CHILD_BIT(ZIO_CHILD_GANG) +#define ZIO_CHILD_DDT_BIT ZIO_CHILD_BIT(ZIO_CHILD_DDT) +#define ZIO_CHILD_LOGICAL_BIT ZIO_CHILD_BIT(ZIO_CHILD_LOGICAL) +#define ZIO_CHILD_ALL_BITS \ + (ZIO_CHILD_VDEV_BIT | ZIO_CHILD_GANG_BIT | \ + ZIO_CHILD_DDT_BIT | ZIO_CHILD_LOGICAL_BIT) enum zio_wait_type { ZIO_WAIT_READY = 0, Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Thu Feb 15 14:34:18 2018 (r329313) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Thu Feb 15 14:46:29 2018 (r329314) @@ -512,21 +512,26 @@ zio_remove_child(zio_t *pio, zio_t *cio, zio_link_t *z } static boolean_t -zio_wait_for_children(zio_t *zio, enum zio_child child, enum zio_wait_type wait) +zio_wait_for_children(zio_t *zio, uint8_t childbits, enum zio_wait_type wait) { - uint64_t *countp = &zio->io_children[child][wait]; boolean_t waiting = B_FALSE; mutex_enter(&zio->io_lock); ASSERT(zio->io_stall == NULL); - if (*countp != 0) { - zio->io_stage >>= 1; - ASSERT3U(zio->io_stage, !=, ZIO_STAGE_OPEN); - zio->io_stall = countp; - waiting = B_TRUE; + for (int c = 0; c < ZIO_CHILD_TYPES; c++) { + if (!(ZIO_CHILD_BIT_IS_SET(childbits, c))) + continue; + + uint64_t *countp = &zio->io_children[c][wait]; + if (*countp != 0) { + zio->io_stage >>= 1; + ASSERT3U(zio->io_stage, !=, ZIO_STAGE_OPEN); + zio->io_stall = countp; + waiting = B_TRUE; + break; + } } mutex_exit(&zio->io_lock); - return (waiting); } @@ -1330,9 +1335,10 @@ zio_write_compress(zio_t *zio) * If our children haven't all reached the ready stage, * wait for them and then repeat this pipeline stage. */ - if (zio_wait_for_children(zio, ZIO_CHILD_GANG, ZIO_WAIT_READY) || - zio_wait_for_children(zio, ZIO_CHILD_LOGICAL, ZIO_WAIT_READY)) + if (zio_wait_for_children(zio, ZIO_CHILD_LOGICAL_BIT | + ZIO_CHILD_GANG_BIT, ZIO_WAIT_READY)) { return (ZIO_PIPELINE_STOP); + } if (!IO_IS_ALLOCATING(zio)) return (ZIO_PIPELINE_CONTINUE); @@ -2180,8 +2186,9 @@ zio_gang_issue(zio_t *zio) { blkptr_t *bp = zio->io_bp; - if (zio_wait_for_children(zio, ZIO_CHILD_GANG, ZIO_WAIT_DONE)) + if (zio_wait_for_children(zio, ZIO_CHILD_GANG_BIT, ZIO_WAIT_DONE)) { return (ZIO_PIPELINE_STOP); + } ASSERT(BP_IS_GANG(bp) && zio->io_gang_leader == zio); ASSERT(zio->io_child_type > ZIO_CHILD_GANG); @@ -2502,8 +2509,9 @@ zio_ddt_read_done(zio_t *zio) { blkptr_t *bp = zio->io_bp; - if (zio_wait_for_children(zio, ZIO_CHILD_DDT, ZIO_WAIT_DONE)) + if (zio_wait_for_children(zio, ZIO_CHILD_DDT_BIT, ZIO_WAIT_DONE)) { return (ZIO_PIPELINE_STOP); + } ASSERT(BP_GET_DEDUP(bp)); ASSERT(BP_GET_PSIZE(bp) == zio->io_size); @@ -3235,8 +3243,9 @@ zio_vdev_io_done(zio_t *zio) vdev_ops_t *ops = vd ? vd->vdev_ops : &vdev_mirror_ops; boolean_t unexpected_error = B_FALSE; - if (zio_wait_for_children(zio, ZIO_CHILD_VDEV, ZIO_WAIT_DONE)) + if (zio_wait_for_children(zio, ZIO_CHILD_VDEV_BIT, ZIO_WAIT_DONE)) { return (ZIO_PIPELINE_STOP); + } ASSERT(zio->io_type == ZIO_TYPE_READ || zio->io_type == ZIO_TYPE_WRITE || zio->io_type == ZIO_TYPE_FREE); @@ -3312,8 +3321,9 @@ zio_vdev_io_assess(zio_t *zio) { vdev_t *vd = zio->io_vd; - if (zio_wait_for_children(zio, ZIO_CHILD_VDEV, ZIO_WAIT_DONE)) + if (zio_wait_for_children(zio, ZIO_CHILD_VDEV_BIT, ZIO_WAIT_DONE)) { return (ZIO_PIPELINE_STOP); + } if (vd == NULL && !(zio->io_flags & ZIO_FLAG_CONFIG_WRITER)) spa_config_exit(zio->io_spa, SCL_ZIO, zio); @@ -3544,9 +3554,10 @@ zio_ready(zio_t *zio) zio_t *pio, *pio_next; zio_link_t *zl = NULL; - if (zio_wait_for_children(zio, ZIO_CHILD_GANG, ZIO_WAIT_READY) || - zio_wait_for_children(zio, ZIO_CHILD_DDT, ZIO_WAIT_READY)) + if (zio_wait_for_children(zio, ZIO_CHILD_GANG_BIT | ZIO_CHILD_DDT_BIT, + ZIO_WAIT_READY)) { return (ZIO_PIPELINE_STOP); + } if (zio->io_ready) { ASSERT(IO_IS_ALLOCATING(zio)); @@ -3686,11 +3697,9 @@ zio_done(zio_t *zio) * If our children haven't all completed, * wait for them and then repeat this pipeline stage. */ - if (zio_wait_for_children(zio, ZIO_CHILD_VDEV, ZIO_WAIT_DONE) || - zio_wait_for_children(zio, ZIO_CHILD_GANG, ZIO_WAIT_DONE) || - zio_wait_for_children(zio, ZIO_CHILD_DDT, ZIO_WAIT_DONE) || - zio_wait_for_children(zio, ZIO_CHILD_LOGICAL, ZIO_WAIT_DONE)) + if (zio_wait_for_children(zio, ZIO_CHILD_ALL_BITS, ZIO_WAIT_DONE)) { return (ZIO_PIPELINE_STOP); + } /* * If the allocation throttle is enabled, then update the accounting. From owner-svn-src-head@freebsd.org Thu Feb 15 15:01: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 A7C9CF2484A; Thu, 15 Feb 2018 15:01:07 +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 5993E7C88C; Thu, 15 Feb 2018 15:01:07 +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 5478B20497; Thu, 15 Feb 2018 15:01:07 +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 w1FF178S070943; Thu, 15 Feb 2018 15:01:07 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FF17bB070942; Thu, 15 Feb 2018 15:01:07 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802151501.w1FF17bB070942@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 15 Feb 2018 15:01:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329315 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 329315 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 15 Feb 2018 15:01:07 -0000 Author: kevans Date: Thu Feb 15 15:01:07 2018 New Revision: 329315 URL: https://svnweb.freebsd.org/changeset/base/329315 Log: stand: Fix ubldr after r329190 metadata load files were consolidated in r329190, and these relocation fixup bits were inadvertently dropped in the process. Re-add them to fix boot with ubldr. Glanced over by: jhibbits X-MFC-With: r329190 Modified: head/stand/common/metadata.c Modified: head/stand/common/metadata.c ============================================================================== --- head/stand/common/metadata.c Thu Feb 15 14:46:29 2018 (r329314) +++ head/stand/common/metadata.c Thu Feb 15 15:01:07 2018 (r329315) @@ -38,6 +38,9 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef __arm__ +#include +#endif #include #include "bootstrap.h" @@ -315,7 +318,23 @@ md_load_dual(char *args, vm_offset_t *modulep, vm_offs uint64_t scratch64; char *rootdevname; int howto; +#ifdef __arm__ + vm_offset_t vaddr; + int i; + /* + * These metadata addreses must be converted for kernel after + * relocation. + */ + uint32_t mdt[] = { + MODINFOMD_SSYM, MODINFOMD_ESYM, MODINFOMD_KERNEND, + MODINFOMD_ENVP, +#if defined(LOADER_FDT_SUPPORT) + MODINFOMD_DTBP +#endif + }; +#endif + align = kern64 ? 8 : 4; howto = md_getboothowto(args); @@ -409,6 +428,23 @@ md_load_dual(char *args, vm_offset_t *modulep, vm_offs } else { bcopy(&kernend, md->md_data, sizeof kernend); } + +#ifdef __arm__ + /* Convert addresses to the final VA */ + *modulep -= __elfN(relocation_offset); + + /* Do relocation fixup on metadata of each module. */ + for (xp = file_findfile(NULL, NULL); xp != NULL; xp = xp->f_next) { + for (i = 0; i < nitems(mdt); i++) { + md = file_findmetadata(xp, mdt[i]); + if (md) { + bcopy(md->md_data, &vaddr, sizeof vaddr); + vaddr -= __elfN(relocation_offset); + bcopy(&vaddr, md->md_data, sizeof vaddr); + } + } + } +#endif (void)md_copymodules(addr, kern64); #if defined(LOADER_FDT_SUPPORT) From owner-svn-src-head@freebsd.org Thu Feb 15 15:46: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 388C2F02889; Thu, 15 Feb 2018 15:46:15 +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 D1B2E7EDCE; Thu, 15 Feb 2018 15:46:14 +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 C83C820B73; Thu, 15 Feb 2018 15:46:14 +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 w1FFkEi2095746; Thu, 15 Feb 2018 15:46:14 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FFkEBb095745; Thu, 15 Feb 2018 15:46:14 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201802151546.w1FFkEBb095745@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Thu, 15 Feb 2018 15:46:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329317 - head/sys/arm/arm X-SVN-Group: head X-SVN-Commit-Author: cognet X-SVN-Commit-Paths: head/sys/arm/arm X-SVN-Commit-Revision: 329317 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 15 Feb 2018 15:46:15 -0000 Author: cognet Date: Thu Feb 15 15:46:14 2018 New Revision: 329317 URL: https://svnweb.freebsd.org/changeset/base/329317 Log: Rename the ACPI variant of the gicv2m driver from "gicv2m" to "gicv2m_acpi". The FDT variant is called "gicv2m" too, and as both would try to register on gic, only one of them would succeed, while we want them both in a GENERIC kernel. Reviewed by: andrew Modified: head/sys/arm/arm/gic_acpi.c Modified: head/sys/arm/arm/gic_acpi.c ============================================================================== --- head/sys/arm/arm/gic_acpi.c Thu Feb 15 15:33:17 2018 (r329316) +++ head/sys/arm/arm/gic_acpi.c Thu Feb 15 15:46:14 2018 (r329317) @@ -342,5 +342,5 @@ DEFINE_CLASS_1(gicv2m, arm_gicv2m_acpi_driver, arm_gic static devclass_t arm_gicv2m_acpi_devclass; -EARLY_DRIVER_MODULE(gicv2m, gic, arm_gicv2m_acpi_driver, +EARLY_DRIVER_MODULE(gicv2m_acpi, gic, arm_gicv2m_acpi_driver, arm_gicv2m_acpi_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); From owner-svn-src-head@freebsd.org Thu Feb 15 17:26: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 C31D2F0A331; Thu, 15 Feb 2018 17:26:30 +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 76A1C83FFB; Thu, 15 Feb 2018 17:26:30 +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 715ED21B94; Thu, 15 Feb 2018 17:26:30 +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 w1FHQU9S059730; Thu, 15 Feb 2018 17:26:30 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FHQUqW059729; Thu, 15 Feb 2018 17:26:30 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201802151726.w1FHQUqW059729@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 15 Feb 2018 17:26:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329322 - head/sys/compat/freebsd32 X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/compat/freebsd32 X-SVN-Commit-Revision: 329322 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 15 Feb 2018 17:26:30 -0000 Author: brooks Date: Thu Feb 15 17:26:30 2018 New Revision: 329322 URL: https://svnweb.freebsd.org/changeset/base/329322 Log: Fix getdirentries(2) under 32-bit compat. The latest version of getdirentries (syscall 554) takes a pointer an an off_t as the last argument. The old version which copies out an int32_t was being used instead. Use the standard sys_getdirentries() implementation instead. Reviewed by: kib Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14379 Modified: head/sys/compat/freebsd32/syscalls.master Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Thu Feb 15 17:10:42 2018 (r329321) +++ head/sys/compat/freebsd32/syscalls.master Thu Feb 15 17:26:30 2018 (r329322) @@ -1097,9 +1097,9 @@ 553 AUE_FHSTAT STD { int freebsd32_fhstat( \ const struct fhandle *u_fhp, \ struct stat32 *sb); } -554 AUE_GETDIRENTRIES STD { ssize_t freebsd32_getdirentries( \ +554 AUE_GETDIRENTRIES NOPROTO { ssize_t getdirentries( \ int fd, char *buf, size_t count, \ - int32_t *basep); } + off_t *basep); } 555 AUE_STATFS NOPROTO { int statfs(char *path, \ struct statfs32 *buf); } 556 AUE_FSTATFS NOPROTO { int fstatfs(int fd, struct statfs32 *buf); } From owner-svn-src-head@freebsd.org Thu Feb 15 17:27: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 C7D80F0A45F; Thu, 15 Feb 2018 17:27:20 +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 222658418C; Thu, 15 Feb 2018 17:27:20 +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 1C9D221B99; Thu, 15 Feb 2018 17:27:20 +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 w1FHRJkE059889; Thu, 15 Feb 2018 17:27:19 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FHRJ6e059882; Thu, 15 Feb 2018 17:27:19 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201802151727.w1FHRJ6e059882@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 15 Feb 2018 17:27:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329323 - head/sys/compat/freebsd32 X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/compat/freebsd32 X-SVN-Commit-Revision: 329323 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 15 Feb 2018 17:27:21 -0000 Author: brooks Date: Thu Feb 15 17:27:19 2018 New Revision: 329323 URL: https://svnweb.freebsd.org/changeset/base/329323 Log: Regen after r329322: Fix getdirentries(2) under 32-bit compat. Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14379 Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/freebsd32/freebsd32_systrace_args.c Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Thu Feb 15 17:26:30 2018 (r329322) +++ head/sys/compat/freebsd32/freebsd32_proto.h Thu Feb 15 17:27:19 2018 (r329323) @@ -680,12 +680,6 @@ struct freebsd32_fhstat_args { char u_fhp_l_[PADL_(const struct fhandle *)]; const struct fhandle * u_fhp; char u_fhp_r_[PADR_(const struct fhandle *)]; char sb_l_[PADL_(struct stat32 *)]; struct stat32 * sb; char sb_r_[PADR_(struct stat32 *)]; }; -struct freebsd32_getdirentries_args { - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; - char count_l_[PADL_(size_t)]; size_t count; char count_r_[PADR_(size_t)]; - char basep_l_[PADL_(int32_t *)]; int32_t * basep; char basep_r_[PADR_(int32_t *)]; -}; struct freebsd32_kevent_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char changelist_l_[PADL_(const struct kevent32 *)]; const struct kevent32 * changelist; char changelist_r_[PADR_(const struct kevent32 *)]; @@ -840,7 +834,6 @@ int freebsd32_utimensat(struct thread *, struct freebs int freebsd32_fstat(struct thread *, struct freebsd32_fstat_args *); int freebsd32_fstatat(struct thread *, struct freebsd32_fstatat_args *); int freebsd32_fhstat(struct thread *, struct freebsd32_fhstat_args *); -int freebsd32_getdirentries(struct thread *, struct freebsd32_getdirentries_args *); int freebsd32_kevent(struct thread *, struct freebsd32_kevent_args *); int freebsd32_cpuset_getdomain(struct thread *, struct freebsd32_cpuset_getdomain_args *); int freebsd32_cpuset_setdomain(struct thread *, struct freebsd32_cpuset_setdomain_args *); @@ -1389,7 +1382,6 @@ int freebsd11_freebsd32_mknodat(struct thread *, struc #define FREEBSD32_SYS_AUE_freebsd32_fstat AUE_FSTAT #define FREEBSD32_SYS_AUE_freebsd32_fstatat AUE_FSTATAT #define FREEBSD32_SYS_AUE_freebsd32_fhstat AUE_FHSTAT -#define FREEBSD32_SYS_AUE_freebsd32_getdirentries AUE_GETDIRENTRIES #define FREEBSD32_SYS_AUE_freebsd32_kevent AUE_KEVENT #define FREEBSD32_SYS_AUE_freebsd32_cpuset_getdomain AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_cpuset_setdomain AUE_NULL Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Thu Feb 15 17:26:30 2018 (r329322) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Thu Feb 15 17:27:19 2018 (r329323) @@ -459,7 +459,7 @@ #define FREEBSD32_SYS_freebsd32_fstat 551 #define FREEBSD32_SYS_freebsd32_fstatat 552 #define FREEBSD32_SYS_freebsd32_fhstat 553 -#define FREEBSD32_SYS_freebsd32_getdirentries 554 +#define FREEBSD32_SYS_getdirentries 554 #define FREEBSD32_SYS_statfs 555 #define FREEBSD32_SYS_fstatfs 556 #define FREEBSD32_SYS_getfsstat 557 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Thu Feb 15 17:26:30 2018 (r329322) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Thu Feb 15 17:27:19 2018 (r329323) @@ -586,7 +586,7 @@ const char *freebsd32_syscallnames[] = { "freebsd32_fstat", /* 551 = freebsd32_fstat */ "freebsd32_fstatat", /* 552 = freebsd32_fstatat */ "freebsd32_fhstat", /* 553 = freebsd32_fhstat */ - "freebsd32_getdirentries", /* 554 = freebsd32_getdirentries */ + "getdirentries", /* 554 = getdirentries */ "statfs", /* 555 = statfs */ "fstatfs", /* 556 = fstatfs */ "getfsstat", /* 557 = getfsstat */ Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Thu Feb 15 17:26:30 2018 (r329322) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Thu Feb 15 17:27:19 2018 (r329323) @@ -635,7 +635,7 @@ struct sysent freebsd32_sysent[] = { { AS(freebsd32_fstat_args), (sy_call_t *)freebsd32_fstat, AUE_FSTAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 551 = freebsd32_fstat */ { AS(freebsd32_fstatat_args), (sy_call_t *)freebsd32_fstatat, AUE_FSTATAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 552 = freebsd32_fstatat */ { AS(freebsd32_fhstat_args), (sy_call_t *)freebsd32_fhstat, AUE_FHSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 553 = freebsd32_fhstat */ - { AS(freebsd32_getdirentries_args), (sy_call_t *)freebsd32_getdirentries, AUE_GETDIRENTRIES, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 554 = freebsd32_getdirentries */ + { AS(getdirentries_args), (sy_call_t *)sys_getdirentries, AUE_GETDIRENTRIES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 554 = getdirentries */ { AS(statfs_args), (sy_call_t *)sys_statfs, AUE_STATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 555 = statfs */ { AS(fstatfs_args), (sy_call_t *)sys_fstatfs, AUE_FSTATFS, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 556 = fstatfs */ { AS(getfsstat_args), (sy_call_t *)sys_getfsstat, AUE_GETFSSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 557 = getfsstat */ Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Feb 15 17:26:30 2018 (r329322) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Feb 15 17:27:19 2018 (r329323) @@ -3183,13 +3183,13 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 2; break; } - /* freebsd32_getdirentries */ + /* getdirentries */ case 554: { - struct freebsd32_getdirentries_args *p = params; + struct getdirentries_args *p = params; iarg[0] = p->fd; /* int */ uarg[1] = (intptr_t) p->buf; /* char * */ uarg[2] = p->count; /* size_t */ - uarg[3] = (intptr_t) p->basep; /* int32_t * */ + uarg[3] = (intptr_t) p->basep; /* off_t * */ *n_args = 4; break; } @@ -8626,7 +8626,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; - /* freebsd32_getdirentries */ + /* getdirentries */ case 554: switch(ndx) { case 0: @@ -8639,7 +8639,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "size_t"; break; case 3: - p = "userland int32_t *"; + p = "userland off_t *"; break; default: break; @@ -10606,7 +10606,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char * if (ndx == 0 || ndx == 1) p = "int"; break; - /* freebsd32_getdirentries */ + /* getdirentries */ case 554: if (ndx == 0 || ndx == 1) p = "ssize_t"; From owner-svn-src-head@freebsd.org Thu Feb 15 17:35: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 6C22CF0ACA7; Thu, 15 Feb 2018 17:35:41 +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 1FD0384998; Thu, 15 Feb 2018 17:35:41 +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 1ACE721D38; Thu, 15 Feb 2018 17:35:41 +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 w1FHZes3065898; Thu, 15 Feb 2018 17:35:40 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FHZetl065897; Thu, 15 Feb 2018 17:35:40 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802151735.w1FHZetl065897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 15 Feb 2018 17:35:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329325 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 329325 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 15 Feb 2018 17:35:41 -0000 Author: markj Date: Thu Feb 15 17:35:40 2018 New Revision: 329325 URL: https://svnweb.freebsd.org/changeset/base/329325 Log: Fix the test for SET_FOREACH termination. Unlike the queue(3) _FOREACH macros, the iterator for a SET_FOREACH is not NULL after the end of the set is reached. Modified: head/sys/kern/subr_compressor.c Modified: head/sys/kern/subr_compressor.c ============================================================================== --- head/sys/kern/subr_compressor.c Thu Feb 15 17:27:34 2018 (r329324) +++ head/sys/kern/subr_compressor.c Thu Feb 15 17:35:40 2018 (r329325) @@ -498,7 +498,7 @@ compressor_init(compressor_cb_t cb, int format, size_t if ((*iter)->format == format) break; } - if (iter == NULL) + if (iter == SET_LIMIT(compressors)) return (NULL); priv = (*iter)->init(maxiosize, level); From owner-svn-src-head@freebsd.org Thu Feb 15 17:47: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 952FAF0BB7A; Thu, 15 Feb 2018 17:47:44 +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 46DCC857E6; Thu, 15 Feb 2018 17:47:44 +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 289E421EEB; Thu, 15 Feb 2018 17:47:44 +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 w1FHlheY072521; Thu, 15 Feb 2018 17:47:43 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FHlhE7072520; Thu, 15 Feb 2018 17:47:43 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802151747.w1FHlhE7072520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 15 Feb 2018 17:47:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329326 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 329326 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 15 Feb 2018 17:47:44 -0000 Author: kevans Date: Thu Feb 15 17:47:43 2018 New Revision: 329326 URL: https://svnweb.freebsd.org/changeset/base/329326 Log: Set svn:executable on lua-img.sh Modified: Directory Properties: head/tools/boot/lua-img.sh (props changed) From owner-svn-src-head@freebsd.org Thu Feb 15 17:56: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 1D03BF0C7B8; Thu, 15 Feb 2018 17:56:46 +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 C5D778612A; Thu, 15 Feb 2018 17:56:45 +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 C0B982207C; Thu, 15 Feb 2018 17:56:45 +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 w1FHujX6077951; Thu, 15 Feb 2018 17:56:45 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FHujpo077950; Thu, 15 Feb 2018 17:56:45 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802151756.w1FHujpo077950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 15 Feb 2018 17:56:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329327 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 329327 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 15 Feb 2018 17:56:46 -0000 Author: kevans Date: Thu Feb 15 17:56:45 2018 New Revision: 329327 URL: https://svnweb.freebsd.org/changeset/base/329327 Log: Build loader before installing it in lua-img.sh Slightly more foolproof when all you're wanting to do is quickly get off the ground with testing the lua loader. Modified: head/tools/boot/lua-img.sh Modified: head/tools/boot/lua-img.sh ============================================================================== --- head/tools/boot/lua-img.sh Thu Feb 15 17:47:43 2018 (r329326) +++ head/tools/boot/lua-img.sh Thu Feb 15 17:56:45 2018 (r329327) @@ -20,6 +20,7 @@ mkdir -p ${dir} mtree -deUW -f etc/mtree/BSD.root.dist -p ${dir} mtree -deUW -f etc/mtree/BSD.usr.dist -p ${dir}/usr cd stand +make MK_LOADER_LUA=yes MK_FORTH=no make install DESTDIR=${dir} NO_ROOT=t MK_LOADER_LUA=yes MK_FORTH=no MK_INSTALL_AS_USER=yes mkdir -p ${dir}/boot/kernel cp /boot/kernel/kernel ${dir}/boot/kernel From owner-svn-src-head@freebsd.org Thu Feb 15 17:58: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 0C145F0CA3F; Thu, 15 Feb 2018 17:58:53 +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 A9BB886347; Thu, 15 Feb 2018 17:58:52 +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 9FD242207D; Thu, 15 Feb 2018 17:58:52 +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 w1FHwq4e078191; Thu, 15 Feb 2018 17:58:52 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FHwpgI078185; Thu, 15 Feb 2018 17:58:51 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201802151758.w1FHwpgI078185@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 15 Feb 2018 17:58:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329328 - head/sys/compat/freebsd32 X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/compat/freebsd32 X-SVN-Commit-Revision: 329328 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 15 Feb 2018 17:58:53 -0000 Author: brooks Date: Thu Feb 15 17:58:51 2018 New Revision: 329328 URL: https://svnweb.freebsd.org/changeset/base/329328 Log: Revert r329323. I missed something in my testing. Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/freebsd32/freebsd32_systrace_args.c Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Thu Feb 15 17:56:45 2018 (r329327) +++ head/sys/compat/freebsd32/freebsd32_proto.h Thu Feb 15 17:58:51 2018 (r329328) @@ -680,6 +680,12 @@ struct freebsd32_fhstat_args { char u_fhp_l_[PADL_(const struct fhandle *)]; const struct fhandle * u_fhp; char u_fhp_r_[PADR_(const struct fhandle *)]; char sb_l_[PADL_(struct stat32 *)]; struct stat32 * sb; char sb_r_[PADR_(struct stat32 *)]; }; +struct freebsd32_getdirentries_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; + char count_l_[PADL_(size_t)]; size_t count; char count_r_[PADR_(size_t)]; + char basep_l_[PADL_(int32_t *)]; int32_t * basep; char basep_r_[PADR_(int32_t *)]; +}; struct freebsd32_kevent_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char changelist_l_[PADL_(const struct kevent32 *)]; const struct kevent32 * changelist; char changelist_r_[PADR_(const struct kevent32 *)]; @@ -834,6 +840,7 @@ int freebsd32_utimensat(struct thread *, struct freebs int freebsd32_fstat(struct thread *, struct freebsd32_fstat_args *); int freebsd32_fstatat(struct thread *, struct freebsd32_fstatat_args *); int freebsd32_fhstat(struct thread *, struct freebsd32_fhstat_args *); +int freebsd32_getdirentries(struct thread *, struct freebsd32_getdirentries_args *); int freebsd32_kevent(struct thread *, struct freebsd32_kevent_args *); int freebsd32_cpuset_getdomain(struct thread *, struct freebsd32_cpuset_getdomain_args *); int freebsd32_cpuset_setdomain(struct thread *, struct freebsd32_cpuset_setdomain_args *); @@ -1382,6 +1389,7 @@ int freebsd11_freebsd32_mknodat(struct thread *, struc #define FREEBSD32_SYS_AUE_freebsd32_fstat AUE_FSTAT #define FREEBSD32_SYS_AUE_freebsd32_fstatat AUE_FSTATAT #define FREEBSD32_SYS_AUE_freebsd32_fhstat AUE_FHSTAT +#define FREEBSD32_SYS_AUE_freebsd32_getdirentries AUE_GETDIRENTRIES #define FREEBSD32_SYS_AUE_freebsd32_kevent AUE_KEVENT #define FREEBSD32_SYS_AUE_freebsd32_cpuset_getdomain AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_cpuset_setdomain AUE_NULL Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Thu Feb 15 17:56:45 2018 (r329327) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Thu Feb 15 17:58:51 2018 (r329328) @@ -459,7 +459,7 @@ #define FREEBSD32_SYS_freebsd32_fstat 551 #define FREEBSD32_SYS_freebsd32_fstatat 552 #define FREEBSD32_SYS_freebsd32_fhstat 553 -#define FREEBSD32_SYS_getdirentries 554 +#define FREEBSD32_SYS_freebsd32_getdirentries 554 #define FREEBSD32_SYS_statfs 555 #define FREEBSD32_SYS_fstatfs 556 #define FREEBSD32_SYS_getfsstat 557 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Thu Feb 15 17:56:45 2018 (r329327) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Thu Feb 15 17:58:51 2018 (r329328) @@ -586,7 +586,7 @@ const char *freebsd32_syscallnames[] = { "freebsd32_fstat", /* 551 = freebsd32_fstat */ "freebsd32_fstatat", /* 552 = freebsd32_fstatat */ "freebsd32_fhstat", /* 553 = freebsd32_fhstat */ - "getdirentries", /* 554 = getdirentries */ + "freebsd32_getdirentries", /* 554 = freebsd32_getdirentries */ "statfs", /* 555 = statfs */ "fstatfs", /* 556 = fstatfs */ "getfsstat", /* 557 = getfsstat */ Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Thu Feb 15 17:56:45 2018 (r329327) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Thu Feb 15 17:58:51 2018 (r329328) @@ -635,7 +635,7 @@ struct sysent freebsd32_sysent[] = { { AS(freebsd32_fstat_args), (sy_call_t *)freebsd32_fstat, AUE_FSTAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 551 = freebsd32_fstat */ { AS(freebsd32_fstatat_args), (sy_call_t *)freebsd32_fstatat, AUE_FSTATAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 552 = freebsd32_fstatat */ { AS(freebsd32_fhstat_args), (sy_call_t *)freebsd32_fhstat, AUE_FHSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 553 = freebsd32_fhstat */ - { AS(getdirentries_args), (sy_call_t *)sys_getdirentries, AUE_GETDIRENTRIES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 554 = getdirentries */ + { AS(freebsd32_getdirentries_args), (sy_call_t *)freebsd32_getdirentries, AUE_GETDIRENTRIES, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 554 = freebsd32_getdirentries */ { AS(statfs_args), (sy_call_t *)sys_statfs, AUE_STATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 555 = statfs */ { AS(fstatfs_args), (sy_call_t *)sys_fstatfs, AUE_FSTATFS, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 556 = fstatfs */ { AS(getfsstat_args), (sy_call_t *)sys_getfsstat, AUE_GETFSSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 557 = getfsstat */ Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Feb 15 17:56:45 2018 (r329327) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Feb 15 17:58:51 2018 (r329328) @@ -3183,13 +3183,13 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 2; break; } - /* getdirentries */ + /* freebsd32_getdirentries */ case 554: { - struct getdirentries_args *p = params; + struct freebsd32_getdirentries_args *p = params; iarg[0] = p->fd; /* int */ uarg[1] = (intptr_t) p->buf; /* char * */ uarg[2] = p->count; /* size_t */ - uarg[3] = (intptr_t) p->basep; /* off_t * */ + uarg[3] = (intptr_t) p->basep; /* int32_t * */ *n_args = 4; break; } @@ -8626,7 +8626,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; - /* getdirentries */ + /* freebsd32_getdirentries */ case 554: switch(ndx) { case 0: @@ -8639,7 +8639,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "size_t"; break; case 3: - p = "userland off_t *"; + p = "userland int32_t *"; break; default: break; @@ -10606,7 +10606,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char * if (ndx == 0 || ndx == 1) p = "int"; break; - /* getdirentries */ + /* freebsd32_getdirentries */ case 554: if (ndx == 0 || ndx == 1) p = "ssize_t"; From owner-svn-src-head@freebsd.org Thu Feb 15 18:16: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 47565F0E0D2; Thu, 15 Feb 2018 18:16:17 +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 F162887372; Thu, 15 Feb 2018 18:16:16 +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 E7B2D223B4; Thu, 15 Feb 2018 18:16:16 +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 w1FIGGGo089378; Thu, 15 Feb 2018 18:16:16 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FIGGt8089377; Thu, 15 Feb 2018 18:16:16 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802151816.w1FIGGt8089377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 15 Feb 2018 18:16:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329329 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329329 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 15 Feb 2018 18:16:17 -0000 Author: kevans Date: Thu Feb 15 18:16:16 2018 New Revision: 329329 URL: https://svnweb.freebsd.org/changeset/base/329329 Log: stand/lua: Always boot on 'enter' keypress in menus Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Thu Feb 15 17:58:51 2018 (r329328) +++ head/stand/lua/menu.lua Thu Feb 15 18:16:16 2018 (r329329) @@ -152,7 +152,7 @@ menu.welcome = { core.setSingleUser(false); core.boot(); end, - alias = {"b", "B", "\013"} + alias = {"b", "B"} }, -- boot single user @@ -272,9 +272,12 @@ function menu.run(m) while cont do local key = io.getchar(); - -- Exit on backspace + -- Special key behaviors if (key == 127) and (m ~= menu.welcome) then break + elseif (key == 13) then + core.boot(); + -- Should not return end key = string.char(key) From owner-svn-src-head@freebsd.org Thu Feb 15 18:19: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 B4D06F0E455; Thu, 15 Feb 2018 18:19:25 +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 5F62187798; Thu, 15 Feb 2018 18:19:25 +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 5A02C223D7; Thu, 15 Feb 2018 18:19:25 +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 w1FIJPok089790; Thu, 15 Feb 2018 18:19:25 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FIJPq3089789; Thu, 15 Feb 2018 18:19:25 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802151819.w1FIJPq3089789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 15 Feb 2018 18:19:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329330 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 329330 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 15 Feb 2018 18:19:25 -0000 Author: cem Date: Thu Feb 15 18:19:25 2018 New Revision: 329330 URL: https://svnweb.freebsd.org/changeset/base/329330 Log: pmap_qenter.9: Clarify that not all arch can map NX The goal is to use security features when architectures provide them. Reported by: kib Sponsored by: Dell EMC Isilon Modified: head/share/man/man9/pmap_qenter.9 Modified: head/share/man/man9/pmap_qenter.9 ============================================================================== --- head/share/man/man9/pmap_qenter.9 Thu Feb 15 18:16:16 2018 (r329329) +++ head/share/man/man9/pmap_qenter.9 Thu Feb 15 18:19:25 2018 (r329330) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 14, 2018 +.Dd February 15, 2018 .Dt PMAP_QENTER 9 .Os .Sh NAME @@ -50,7 +50,8 @@ pointers to wired pages and enters each of these pages into the kernel virtual address (KVA) space, beginning at the address .Fa sva . -The pages are mapped non-executable. +The pages are mapped non-executable, if possible. +(For example, non-PAE i386 has no capability to map pages non-executable.) .Pp The .Fn pmap_qremove From owner-svn-src-head@freebsd.org Thu Feb 15 18:26: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 C558DF0ED00; Thu, 15 Feb 2018 18:26:45 +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 7845587DDA; Thu, 15 Feb 2018 18:26:45 +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 72DC722590; Thu, 15 Feb 2018 18:26:45 +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 w1FIQjxS095389; Thu, 15 Feb 2018 18:26:45 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FIQjxk095386; Thu, 15 Feb 2018 18:26:45 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802151826.w1FIQjxk095386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 15 Feb 2018 18:26:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329331 - head/usr.sbin/trpt X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/usr.sbin/trpt X-SVN-Commit-Revision: 329331 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 15 Feb 2018 18:26:46 -0000 Author: cem Date: Thu Feb 15 18:26:45 2018 New Revision: 329331 URL: https://svnweb.freebsd.org/changeset/base/329331 Log: trpt(8): Fully remove and undocument '-t' option disabled in 1999 The relevant code was commented out in r50680. PR: 57045 Submitted by: Fernando Apesteguía Modified: head/usr.sbin/trpt/trpt.8 head/usr.sbin/trpt/trpt.c Modified: head/usr.sbin/trpt/trpt.8 ============================================================================== --- head/usr.sbin/trpt/trpt.8 Thu Feb 15 18:19:25 2018 (r329330) +++ head/usr.sbin/trpt/trpt.8 Thu Feb 15 18:26:45 2018 (r329331) @@ -28,7 +28,7 @@ .\" @(#)trpt.8 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd December 11, 1993 +.Dd February 15, 2018 .Dt TRPT 8 .Os .Sh NAME @@ -41,7 +41,6 @@ .Op Fl j .Op Fl p Ar hex-address .Op Fl s -.Op Fl t .Oo .Ar system Op Ar core .Oc @@ -86,10 +85,6 @@ control block at the given address In addition to the normal output, print a detailed description of the packet sequencing information. -.It Fl t -In addition to the normal output, -print the values for all timers at each -point in the trace. .El .Pp The recommended use of Modified: head/usr.sbin/trpt/trpt.c ============================================================================== --- head/usr.sbin/trpt/trpt.c Thu Feb 15 18:19:25 2018 (r329330) +++ head/usr.sbin/trpt/trpt.c Thu Feb 15 18:26:45 2018 (r329331) @@ -90,7 +90,7 @@ struct nlist nl[3]; static caddr_t tcp_pcbs[TCP_NDEBUG]; static n_time ntime; -static int aflag, kflag, memf, follow, sflag, tflag; +static int aflag, kflag, memf, follow, sflag; void dotrace(caddr_t); void klseek(int, off_t, int); @@ -108,7 +108,7 @@ main(int argc, char **argv) nl[1].n_name = strdup("_tcp_debx"); jflag = npcbs = 0; - while ((ch = getopt(argc, argv, "afjp:st")) != -1) + while ((ch = getopt(argc, argv, "afjp:s")) != -1) switch (ch) { case 'a': ++aflag; @@ -128,9 +128,6 @@ main(int argc, char **argv) case 's': ++sflag; break; - case 't': - ++tflag; - break; case '?': default: usage(); @@ -216,7 +213,7 @@ static void usage() { (void)fprintf(stderr, - "usage: trpt [-afjst] [-p hex-address] [system [core]]\n"); + "usage: trpt [-afjs] [-p hex-address] [system [core]]\n"); exit(1); } @@ -427,28 +424,6 @@ tcp_trace(short act, short ostate, struct tcpcb *tp, i (u_long)tp->snd_wl1, (u_long)tp->snd_wl2, (u_long)tp->snd_wnd); } - /* print out timers? */ -#if 0 - /* - * XXX - * kernel now uses callouts, not integer time values. - */ - if (tflag) { - register char *cp = "\t"; - register int i; - - for (i = 0; i < TCPT_NTIMERS; i++) { - if (tp->t_timer[i] == 0) - continue; - printf("%s%s=%d", cp, tcptimers[i], tp->t_timer[i]); - if (i == TCPT_REXMT) - printf(" (t_rxtshft=%d)", tp->t_rxtshift); - cp = ", "; - } - if (*cp != '\t') - putchar('\n'); - } -#endif } int From owner-svn-src-head@freebsd.org Thu Feb 15 18:31: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 93D01F0F3C5; Thu, 15 Feb 2018 18:31:44 +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 49DD8682E1; Thu, 15 Feb 2018 18:31:44 +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 44CE7225F0; Thu, 15 Feb 2018 18:31:44 +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 w1FIViL1097560; Thu, 15 Feb 2018 18:31:44 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FIViw4097559; Thu, 15 Feb 2018 18:31:44 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201802151831.w1FIViw4097559@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 15 Feb 2018 18:31:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329332 - head/sys/compat/freebsd32 X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/compat/freebsd32 X-SVN-Commit-Revision: 329332 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 15 Feb 2018 18:31:44 -0000 Author: brooks Date: Thu Feb 15 18:31:43 2018 New Revision: 329332 URL: https://svnweb.freebsd.org/changeset/base/329332 Log: Remove freebsd32_getdirentries(), it will be unused after the next commit. Modified: head/sys/compat/freebsd32/freebsd32_misc.c Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Thu Feb 15 18:26:45 2018 (r329331) +++ head/sys/compat/freebsd32/freebsd32_misc.c Thu Feb 15 18:31:43 2018 (r329332) @@ -1786,25 +1786,6 @@ freebsd11_freebsd32_getdents(struct thread *td, } #endif /* COMPAT_FREEBSD11 */ -int -freebsd32_getdirentries(struct thread *td, - struct freebsd32_getdirentries_args *uap) -{ - long base; - int32_t base32; - int error; - - error = kern_getdirentries(td, uap->fd, uap->buf, uap->count, &base, - NULL, UIO_USERSPACE); - if (error) - return (error); - if (uap->basep != NULL) { - base32 = base; - error = copyout(&base32, uap->basep, sizeof(int32_t)); - } - return (error); -} - #ifdef COMPAT_FREEBSD6 /* versions with the 'int pad' argument */ int From owner-svn-src-head@freebsd.org Thu Feb 15 18:32: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 574E2F0F476; Thu, 15 Feb 2018 18:32:12 +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 2D8156848B; Thu, 15 Feb 2018 18:32:12 +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 2878A2261A; Thu, 15 Feb 2018 18:32:12 +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 w1FIWCPa098357; Thu, 15 Feb 2018 18:32:12 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FIWBRX098350; Thu, 15 Feb 2018 18:32:11 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201802151832.w1FIWBRX098350@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 15 Feb 2018 18:32:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329333 - head/sys/compat/freebsd32 X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/compat/freebsd32 X-SVN-Commit-Revision: 329333 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 15 Feb 2018 18:32:12 -0000 Author: brooks Date: Thu Feb 15 18:32:11 2018 New Revision: 329333 URL: https://svnweb.freebsd.org/changeset/base/329333 Log: Regen after r329322. Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/freebsd32/freebsd32_systrace_args.c Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Thu Feb 15 18:31:43 2018 (r329332) +++ head/sys/compat/freebsd32/freebsd32_proto.h Thu Feb 15 18:32:11 2018 (r329333) @@ -680,12 +680,6 @@ struct freebsd32_fhstat_args { char u_fhp_l_[PADL_(const struct fhandle *)]; const struct fhandle * u_fhp; char u_fhp_r_[PADR_(const struct fhandle *)]; char sb_l_[PADL_(struct stat32 *)]; struct stat32 * sb; char sb_r_[PADR_(struct stat32 *)]; }; -struct freebsd32_getdirentries_args { - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; - char count_l_[PADL_(size_t)]; size_t count; char count_r_[PADR_(size_t)]; - char basep_l_[PADL_(int32_t *)]; int32_t * basep; char basep_r_[PADR_(int32_t *)]; -}; struct freebsd32_kevent_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char changelist_l_[PADL_(const struct kevent32 *)]; const struct kevent32 * changelist; char changelist_r_[PADR_(const struct kevent32 *)]; @@ -840,7 +834,6 @@ int freebsd32_utimensat(struct thread *, struct freebs int freebsd32_fstat(struct thread *, struct freebsd32_fstat_args *); int freebsd32_fstatat(struct thread *, struct freebsd32_fstatat_args *); int freebsd32_fhstat(struct thread *, struct freebsd32_fhstat_args *); -int freebsd32_getdirentries(struct thread *, struct freebsd32_getdirentries_args *); int freebsd32_kevent(struct thread *, struct freebsd32_kevent_args *); int freebsd32_cpuset_getdomain(struct thread *, struct freebsd32_cpuset_getdomain_args *); int freebsd32_cpuset_setdomain(struct thread *, struct freebsd32_cpuset_setdomain_args *); @@ -1389,7 +1382,6 @@ int freebsd11_freebsd32_mknodat(struct thread *, struc #define FREEBSD32_SYS_AUE_freebsd32_fstat AUE_FSTAT #define FREEBSD32_SYS_AUE_freebsd32_fstatat AUE_FSTATAT #define FREEBSD32_SYS_AUE_freebsd32_fhstat AUE_FHSTAT -#define FREEBSD32_SYS_AUE_freebsd32_getdirentries AUE_GETDIRENTRIES #define FREEBSD32_SYS_AUE_freebsd32_kevent AUE_KEVENT #define FREEBSD32_SYS_AUE_freebsd32_cpuset_getdomain AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_cpuset_setdomain AUE_NULL Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Thu Feb 15 18:31:43 2018 (r329332) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Thu Feb 15 18:32:11 2018 (r329333) @@ -459,7 +459,7 @@ #define FREEBSD32_SYS_freebsd32_fstat 551 #define FREEBSD32_SYS_freebsd32_fstatat 552 #define FREEBSD32_SYS_freebsd32_fhstat 553 -#define FREEBSD32_SYS_freebsd32_getdirentries 554 +#define FREEBSD32_SYS_getdirentries 554 #define FREEBSD32_SYS_statfs 555 #define FREEBSD32_SYS_fstatfs 556 #define FREEBSD32_SYS_getfsstat 557 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Thu Feb 15 18:31:43 2018 (r329332) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Thu Feb 15 18:32:11 2018 (r329333) @@ -586,7 +586,7 @@ const char *freebsd32_syscallnames[] = { "freebsd32_fstat", /* 551 = freebsd32_fstat */ "freebsd32_fstatat", /* 552 = freebsd32_fstatat */ "freebsd32_fhstat", /* 553 = freebsd32_fhstat */ - "freebsd32_getdirentries", /* 554 = freebsd32_getdirentries */ + "getdirentries", /* 554 = getdirentries */ "statfs", /* 555 = statfs */ "fstatfs", /* 556 = fstatfs */ "getfsstat", /* 557 = getfsstat */ Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Thu Feb 15 18:31:43 2018 (r329332) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Thu Feb 15 18:32:11 2018 (r329333) @@ -635,7 +635,7 @@ struct sysent freebsd32_sysent[] = { { AS(freebsd32_fstat_args), (sy_call_t *)freebsd32_fstat, AUE_FSTAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 551 = freebsd32_fstat */ { AS(freebsd32_fstatat_args), (sy_call_t *)freebsd32_fstatat, AUE_FSTATAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 552 = freebsd32_fstatat */ { AS(freebsd32_fhstat_args), (sy_call_t *)freebsd32_fhstat, AUE_FHSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 553 = freebsd32_fhstat */ - { AS(freebsd32_getdirentries_args), (sy_call_t *)freebsd32_getdirentries, AUE_GETDIRENTRIES, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 554 = freebsd32_getdirentries */ + { AS(getdirentries_args), (sy_call_t *)sys_getdirentries, AUE_GETDIRENTRIES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 554 = getdirentries */ { AS(statfs_args), (sy_call_t *)sys_statfs, AUE_STATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 555 = statfs */ { AS(fstatfs_args), (sy_call_t *)sys_fstatfs, AUE_FSTATFS, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 556 = fstatfs */ { AS(getfsstat_args), (sy_call_t *)sys_getfsstat, AUE_GETFSSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 557 = getfsstat */ Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Feb 15 18:31:43 2018 (r329332) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Feb 15 18:32:11 2018 (r329333) @@ -3183,13 +3183,13 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 2; break; } - /* freebsd32_getdirentries */ + /* getdirentries */ case 554: { - struct freebsd32_getdirentries_args *p = params; + struct getdirentries_args *p = params; iarg[0] = p->fd; /* int */ uarg[1] = (intptr_t) p->buf; /* char * */ uarg[2] = p->count; /* size_t */ - uarg[3] = (intptr_t) p->basep; /* int32_t * */ + uarg[3] = (intptr_t) p->basep; /* off_t * */ *n_args = 4; break; } @@ -8626,7 +8626,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; - /* freebsd32_getdirentries */ + /* getdirentries */ case 554: switch(ndx) { case 0: @@ -8639,7 +8639,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "size_t"; break; case 3: - p = "userland int32_t *"; + p = "userland off_t *"; break; default: break; @@ -10606,7 +10606,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char * if (ndx == 0 || ndx == 1) p = "int"; break; - /* freebsd32_getdirentries */ + /* getdirentries */ case 554: if (ndx == 0 || ndx == 1) p = "ssize_t"; From owner-svn-src-head@freebsd.org Thu Feb 15 18:37: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 A004BF0FA71; Thu, 15 Feb 2018 18:37:33 +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 4E0E8689C1; Thu, 15 Feb 2018 18:37:33 +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 490B022752; Thu, 15 Feb 2018 18:37:33 +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 w1FIbXsa001595; Thu, 15 Feb 2018 18:37:33 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FIbXbI001594; Thu, 15 Feb 2018 18:37:33 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201802151837.w1FIbXbI001594@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 15 Feb 2018 18:37:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329334 - head/cddl/lib/libdtrace X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/cddl/lib/libdtrace X-SVN-Commit-Revision: 329334 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 15 Feb 2018 18:37:33 -0000 Author: dteske Date: Thu Feb 15 18:37:32 2018 New Revision: 329334 URL: https://svnweb.freebsd.org/changeset/base/329334 Log: Add the following errno definitions to /usr/lib/dtrace/errno.d ENOTCAPABLE (93) ECAPMODE (94) ENOTRECOVERABLE (95) EOWNERDEAD (96) ERELOOKUP (-5) and update ELAST (92 -> 96) Reviewed by: markj Sponsored by: Smule, Inc. Differential Revision: https://reviews.freebsd.org/D14340 Modified: head/cddl/lib/libdtrace/errno.d Modified: head/cddl/lib/libdtrace/errno.d ============================================================================== --- head/cddl/lib/libdtrace/errno.d Thu Feb 15 18:32:11 2018 (r329333) +++ head/cddl/lib/libdtrace/errno.d Thu Feb 15 18:37:32 2018 (r329334) @@ -216,7 +216,15 @@ inline int ENOLINK = 91; #pragma D binding "1.0" ENOLINK inline int EPROTO = 92; #pragma D binding "1.0" EPROTO -inline int ELAST = 92; +inline int ENOTCAPABLE = 93; +#pragma D binding "1.13" ENOTCAPABLE +inline int ECAPMODE = 94; +#pragma D binding "1.13" ECAPMODE +inline int ENOTRECOVERABLE = 95; +#pragma D binding "1.13" ENOTRECOVERABLE +inline int EOWNERDEAD = 96; +#pragma D binding "1.13" EOWNERDEAD +inline int ELAST = 96; #pragma D binding "1.0" ELAST inline int ERESTART = -1; #pragma D binding "1.0" ERESTART @@ -226,3 +234,5 @@ inline int ENOIOCTL = -3; #pragma D binding "1.0" ENOIOCTL inline int EDIRIOCTL = -4; #pragma D binding "1.0" EDIRIOCTL +inline int ERELOOKUP = -5; +#pragma D binding "1.13" ERELOOKUP From owner-svn-src-head@freebsd.org Thu Feb 15 18:39: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 7EC55F0FCFA; Thu, 15 Feb 2018 18:39:44 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2FC9A68C99; Thu, 15 Feb 2018 18:39:44 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2ACFB2275C; Thu, 15 Feb 2018 18:39:44 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1FIdigL002043; Thu, 15 Feb 2018 18:39:44 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FIdiND002042; Thu, 15 Feb 2018 18:39:44 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201802151839.w1FIdiND002042@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Thu, 15 Feb 2018 18:39:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329335 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 329335 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 15 Feb 2018 18:39:44 -0000 Author: shurd Date: Thu Feb 15 18:39:43 2018 New Revision: 329335 URL: https://svnweb.freebsd.org/changeset/base/329335 Log: bnxt: Update man page with newly supported devices, options, etc update man page with * Newly supported devices * Newly added options * 'maintained by' Email ID Submitted by: Siva Kallam Reviewed by: shurd, sbruno Approved by: shurd Sponsored by: Broadcom Limited Differential Revision: https://reviews.freebsd.org/D13982 Modified: head/share/man/man4/bnxt.4 Modified: head/share/man/man4/bnxt.4 ============================================================================== --- head/share/man/man4/bnxt.4 Thu Feb 15 18:37:32 2018 (r329334) +++ head/share/man/man4/bnxt.4 Thu Feb 15 18:39:43 2018 (r329335) @@ -68,25 +68,41 @@ Broadcom BCM57302 NetXtreme-C 10Gb/25Gb Ethernet Contr .It Broadcom BCM57304 NetXtreme-C 10Gb/25Gb/40Gb/50Gb Ethernet Controller .It -Broadcom BCM57402 NetXtreme-E 10Gb Ethernet Controller +Broadcom BCM57304 NetXtreme-C Ethernet Virtual Function .It -Broadcom BCM57404 NetXtreme-E 10Gb/25Gb Ethernet Controller +Broadcom BCM57314 NetXtreme-C Ethernet Virtual Function .It -Broadcom BCM57406 NetXtreme-E 10GBase-T Ethernet Controller +Broadcom BCM57402 NetXtreme-E 10Gb Ethernet Controller .It -Broadcom BCM57402 NetXtreme-E Partition +Broadcom BCM57402 NetXtreme-E Ethernet Partition .It -Broadcom BCM57407 NetXtreme-E 10GBase-T Ethernet Controller +Broadcom BCM57404 NetXtreme-E 10Gb/25Gb Ethernet Controller .It +Broadcom BCM57404 NetXtreme-E Ethernet Virtual Function +.It Broadcom BCM57404 NetXtreme-E Partition .It +Broadcom BCM57406 NetXtreme-E 10GBASE-T Ethernet Controller +.It Broadcom BCM57406 NetXtreme-E Partition .It +Broadcom BCM57407 NetXtreme-E 10GBase-T Ethernet Controller +.It Broadcom BCM57407 NetXtreme-E 25Gb Ethernet Controller .It -Broadcom BCM57304 NetXtreme-C Virtual Function +Broadcom BCM57407 NetXtreme-E Partition .It -Broadcom BCM57404 NetXtreme-E Virtual Function +Broadcom BCM57412 NetXtreme-E Partition +.It +Broadcom BCM57414 NetXtreme-E Ethernet Virtual Function +.It +Broadcom BCM57414 NetXtreme-E Partition +.It +Broadcom BCM57416 NetXtreme-E Partition +.It +Broadcom BCM57417 NetXtreme-E Ethernet Partition +.It +Broadcom BCM57454 NetXtreme-E 10Gb/25Gb/40Gb/50Gb/100Gb Ethernet .El .Sh SYSCTL VARIABLES These variables must be set before loading the driver, either via @@ -181,11 +197,20 @@ Supported HWRM API version of the currently running fi HWRM API version the driver was built to support. .It Va dev.bnxt.X.hwstats.* Per-queue statistics tracked by the hardware. +.It Va dev.bnxt.X.hwstats.port_stats.* +Per-port statistics tracked by the hardware. .It Va dev.bnxt.X.hwstats.rxq0.drop_pkts Number of packets dropped by hardware on queue zero. This number might seem high, but the count includes packets dropped due to incorrect destination MAC, unsubscribed multicast address, and other normal reasons to ignore Ethernet frames. +.It Va dev.bnxt.X.hwstats.rxq0.tpa_* +statistics related to HW LRO. +.It Va dev.bnxt.X.hw_lro.* +Enable / Disable HW LRO feature. Defaults to disable. +Enabling HW LRO could cause issues when forwarding is enabled on host. +.It Va dev.bnxt.X.fc +Enable / Disable Flow Control feature. Defaults to Enable .El .Sh DIAGNOSTICS .Bl -diag @@ -219,6 +244,8 @@ device driver first appeared in The .Nm driver was written by -.An Jack Vogel Aq Mt jfvogel@gmail.com , +.An Jack Vogel Aq Mt jfvogel@gmail.com +and +.An Stephen Hurd Aq Mt shurd@freebsd.org , and is currently maintained by -.An Stephen Hurd Aq Mt stephen.hurd@broadcom.com . +.An Broadcom Limited Aq Mt freebsd.pdl@broadcom.com . From owner-svn-src-head@freebsd.org Thu Feb 15 18:57: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 E1C50F11256; Thu, 15 Feb 2018 18:57:22 +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 8928E6A0F4; Thu, 15 Feb 2018 18:57:22 +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 6587822ADD; Thu, 15 Feb 2018 18:57:22 +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 w1FIvMBx013915; Thu, 15 Feb 2018 18:57:22 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FIvMS7013914; Thu, 15 Feb 2018 18:57:22 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201802151857.w1FIvMS7013914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 15 Feb 2018 18:57:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329336 - head/sys/security/mac X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/security/mac X-SVN-Commit-Revision: 329336 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 15 Feb 2018 18:57:23 -0000 Author: brooks Date: Thu Feb 15 18:57:22 2018 New Revision: 329336 URL: https://svnweb.freebsd.org/changeset/base/329336 Log: Reduce duplication in __mac_*_(file|link)(2) implementation. Reviewed by: rwatson Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14175 Modified: head/sys/security/mac/mac_syscalls.c Modified: head/sys/security/mac/mac_syscalls.c ============================================================================== --- head/sys/security/mac/mac_syscalls.c Thu Feb 15 18:39:43 2018 (r329335) +++ head/sys/security/mac/mac_syscalls.c Thu Feb 15 18:57:22 2018 (r329336) @@ -76,6 +76,11 @@ __FBSDID("$FreeBSD$"); FEATURE(security_mac, "Mandatory Access Control Framework support"); +static int kern___mac_get_path(struct thread *td, const char *path_p, + struct mac *mac_p, int follow); +static int kern___mac_set_path(struct thread *td, const char *path_p, + struct mac *mac_p, int follow); + int sys___mac_get_pid(struct thread *td, struct __mac_get_pid_args *uap) { @@ -315,57 +320,21 @@ out: int sys___mac_get_file(struct thread *td, struct __mac_get_file_args *uap) { - char *elements, *buffer; - struct nameidata nd; - struct label *intlabel; - struct mac mac; - int error; - if (!(mac_labeled & MPC_OBJECT_VNODE)) - return (EINVAL); - - error = copyin(uap->mac_p, &mac, sizeof(mac)); - if (error) - return (error); - - error = mac_check_structmac_consistent(&mac); - if (error) - return (error); - - elements = malloc(mac.m_buflen, M_MACTEMP, M_WAITOK); - error = copyinstr(mac.m_string, elements, mac.m_buflen, NULL); - if (error) { - free(elements, M_MACTEMP); - return (error); - } - - buffer = malloc(mac.m_buflen, M_MACTEMP, M_WAITOK | M_ZERO); - NDINIT(&nd, LOOKUP, LOCKLEAF | FOLLOW, UIO_USERSPACE, - uap->path_p, td); - error = namei(&nd); - if (error) - goto out; - - intlabel = mac_vnode_label_alloc(); - mac_vnode_copy_label(nd.ni_vp->v_label, intlabel); - error = mac_vnode_externalize_label(intlabel, elements, buffer, - mac.m_buflen); - - NDFREE(&nd, 0); - mac_vnode_label_free(intlabel); - if (error == 0) - error = copyout(buffer, mac.m_string, strlen(buffer)+1); - -out: - free(buffer, M_MACTEMP); - free(elements, M_MACTEMP); - - return (error); + return (kern___mac_get_path(td, uap->path_p, uap->mac_p, FOLLOW)); } int sys___mac_get_link(struct thread *td, struct __mac_get_link_args *uap) { + + return (kern___mac_get_path(td, uap->path_p, uap->mac_p, NOFOLLOW)); +} + +static int +kern___mac_get_path(struct thread *td, const char *path_p, struct mac *mac_p, + int follow) +{ char *elements, *buffer; struct nameidata nd; struct label *intlabel; @@ -375,7 +344,7 @@ sys___mac_get_link(struct thread *td, struct __mac_get if (!(mac_labeled & MPC_OBJECT_VNODE)) return (EINVAL); - error = copyin(uap->mac_p, &mac, sizeof(mac)); + error = copyin(mac_p, &mac, sizeof(mac)); if (error) return (error); @@ -391,8 +360,7 @@ sys___mac_get_link(struct thread *td, struct __mac_get } buffer = malloc(mac.m_buflen, M_MACTEMP, M_WAITOK | M_ZERO); - NDINIT(&nd, LOOKUP, LOCKLEAF | NOFOLLOW, UIO_USERSPACE, - uap->path_p, td); + NDINIT(&nd, LOOKUP, LOCKLEAF | follow, UIO_USERSPACE, path_p, td); error = namei(&nd); if (error) goto out; @@ -518,58 +486,21 @@ out: int sys___mac_set_file(struct thread *td, struct __mac_set_file_args *uap) { - struct label *intlabel; - struct nameidata nd; - struct mount *mp; - struct mac mac; - char *buffer; - int error; - if (!(mac_labeled & MPC_OBJECT_VNODE)) - return (EINVAL); - - error = copyin(uap->mac_p, &mac, sizeof(mac)); - if (error) - return (error); - - error = mac_check_structmac_consistent(&mac); - if (error) - return (error); - - buffer = malloc(mac.m_buflen, M_MACTEMP, M_WAITOK); - error = copyinstr(mac.m_string, buffer, mac.m_buflen, NULL); - if (error) { - free(buffer, M_MACTEMP); - return (error); - } - - intlabel = mac_vnode_label_alloc(); - error = mac_vnode_internalize_label(intlabel, buffer); - free(buffer, M_MACTEMP); - if (error) - goto out; - - NDINIT(&nd, LOOKUP, LOCKLEAF | FOLLOW, UIO_USERSPACE, - uap->path_p, td); - error = namei(&nd); - if (error == 0) { - error = vn_start_write(nd.ni_vp, &mp, V_WAIT | PCATCH); - if (error == 0) { - error = vn_setlabel(nd.ni_vp, intlabel, - td->td_ucred); - vn_finished_write(mp); - } - } - - NDFREE(&nd, 0); -out: - mac_vnode_label_free(intlabel); - return (error); + return (kern___mac_set_path(td, uap->path_p, uap->mac_p, FOLLOW)); } int sys___mac_set_link(struct thread *td, struct __mac_set_link_args *uap) { + + return (kern___mac_set_path(td, uap->path_p, uap->mac_p, NOFOLLOW)); +} + +static int +kern___mac_set_path(struct thread *td, const char *path_p, struct mac *mac_p, + int follow) +{ struct label *intlabel; struct nameidata nd; struct mount *mp; @@ -580,7 +511,7 @@ sys___mac_set_link(struct thread *td, struct __mac_set if (!(mac_labeled & MPC_OBJECT_VNODE)) return (EINVAL); - error = copyin(uap->mac_p, &mac, sizeof(mac)); + error = copyin(mac_p, &mac, sizeof(mac)); if (error) return (error); @@ -601,8 +532,7 @@ sys___mac_set_link(struct thread *td, struct __mac_set if (error) goto out; - NDINIT(&nd, LOOKUP, LOCKLEAF | NOFOLLOW, UIO_USERSPACE, - uap->path_p, td); + NDINIT(&nd, LOOKUP, LOCKLEAF | follow, UIO_USERSPACE, path_p, td); error = namei(&nd); if (error == 0) { error = vn_start_write(nd.ni_vp, &mp, V_WAIT | PCATCH); From owner-svn-src-head@freebsd.org Thu Feb 15 18:57: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 15F49F11362; Thu, 15 Feb 2018 18:57:55 +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 BD4716A243; Thu, 15 Feb 2018 18:57:54 +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 B856222AE2; Thu, 15 Feb 2018 18:57:54 +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 w1FIvsJn014040; Thu, 15 Feb 2018 18:57:54 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FIvsqS014039; Thu, 15 Feb 2018 18:57:54 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802151857.w1FIvsqS014039@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 15 Feb 2018 18:57:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329337 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 329337 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 15 Feb 2018 18:57:55 -0000 Author: imp Date: Thu Feb 15 18:57:54 2018 New Revision: 329337 URL: https://svnweb.freebsd.org/changeset/base/329337 Log: Report the number of remaining retries when we have an error that we're retrying. Modified: head/sys/cam/cam_periph.c Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Thu Feb 15 18:57:22 2018 (r329336) +++ head/sys/cam/cam_periph.c Thu Feb 15 18:57:54 2018 (r329337) @@ -1911,8 +1911,11 @@ cam_periph_error(union ccb *ccb, cam_flags camflags, error, action_string); } else if (action_string != NULL) xpt_print(ccb->ccb_h.path, "%s\n", action_string); - else - xpt_print(ccb->ccb_h.path, "Retrying command\n"); + else { + xpt_print(ccb->ccb_h.path, + "Retrying command, %d more tries remain\n", + ccb->ccb_h.retry_count); + } } if (devctl_err && (error != 0 || (action & SSQ_PRINT_SENSE) != 0)) From owner-svn-src-head@freebsd.org Thu Feb 15 18:58: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 1809AF113C5; Thu, 15 Feb 2018 18:58: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 815476A38A; Thu, 15 Feb 2018 18:58: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 DB32422AE5; Thu, 15 Feb 2018 18:58:03 +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 w1FIw37B014248; Thu, 15 Feb 2018 18:58:03 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FIw39O014247; Thu, 15 Feb 2018 18:58:03 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802151858.w1FIw39O014247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 15 Feb 2018 18:58:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329338 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 329338 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 15 Feb 2018 18:58:06 -0000 Author: imp Date: Thu Feb 15 18:58:03 2018 New Revision: 329338 URL: https://svnweb.freebsd.org/changeset/base/329338 Log: Simplify building before installing. Modified: head/tools/boot/lua-img.sh Modified: head/tools/boot/lua-img.sh ============================================================================== --- head/tools/boot/lua-img.sh Thu Feb 15 18:57:54 2018 (r329337) +++ head/tools/boot/lua-img.sh Thu Feb 15 18:58:03 2018 (r329338) @@ -20,7 +20,6 @@ mkdir -p ${dir} mtree -deUW -f etc/mtree/BSD.root.dist -p ${dir} mtree -deUW -f etc/mtree/BSD.usr.dist -p ${dir}/usr cd stand -make MK_LOADER_LUA=yes MK_FORTH=no -make install DESTDIR=${dir} NO_ROOT=t MK_LOADER_LUA=yes MK_FORTH=no MK_INSTALL_AS_USER=yes +make all install DESTDIR=${dir} NO_ROOT=t MK_LOADER_LUA=yes MK_FORTH=no MK_INSTALL_AS_USER=yes mkdir -p ${dir}/boot/kernel cp /boot/kernel/kernel ${dir}/boot/kernel From owner-svn-src-head@freebsd.org Thu Feb 15 19:49: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 A066DF14D19; Thu, 15 Feb 2018 19:49:16 +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 4E4DD6CA38; Thu, 15 Feb 2018 19:49:16 +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 4531223330; Thu, 15 Feb 2018 19:49:16 +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 w1FJnG1T044420; Thu, 15 Feb 2018 19:49:16 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FJnFS4044411; Thu, 15 Feb 2018 19:49:15 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802151949.w1FJnFS4044411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 15 Feb 2018 19:49:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329339 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 329339 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 15 Feb 2018 19:49:16 -0000 Author: kevans Date: Thu Feb 15 19:49:15 2018 New Revision: 329339 URL: https://svnweb.freebsd.org/changeset/base/329339 Log: libsa: Consolidate tftp sendrecv into net.c sendrecv bootp/arp/rarp/rpc all use the sendrecv implementation in net.c. tftp has its own implementation because it passes an extra parameter into the recv callback for the received payload type to be held. These sendrecv implementations are otherwise equivalent, so consolidate them. The other users of sendrecv won't be using the extra argument to recv, but this gives us only one place to worry about respecting timeouts and one consistent timeout behavior. Tested by: sbruno Reviewed by: sbruno, tsoome MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D14373 Modified: head/stand/libsa/arp.c head/stand/libsa/bootp.c head/stand/libsa/net.c head/stand/libsa/net.h head/stand/libsa/rarp.c head/stand/libsa/rpc.c head/stand/libsa/tftp.c Modified: head/stand/libsa/arp.c ============================================================================== --- head/stand/libsa/arp.c Thu Feb 15 18:58:03 2018 (r329338) +++ head/stand/libsa/arp.c Thu Feb 15 19:49:15 2018 (r329339) @@ -65,7 +65,7 @@ int arp_num = 1; /* Local forwards */ static ssize_t arpsend(struct iodesc *, void *, size_t); -static ssize_t arprecv(struct iodesc *, void **, void **, time_t); +static ssize_t arprecv(struct iodesc *, void **, void **, time_t, void *); /* Broadcast an ARP packet, asking who has addr on interface d */ u_char * @@ -118,7 +118,7 @@ arpwhohas(struct iodesc *d, struct in_addr addr) ah = NULL; i = sendrecv(d, arpsend, &wbuf.data, sizeof(wbuf.data), - arprecv, &pkt, (void **)&ah); + arprecv, &pkt, (void **)&ah, NULL); if (i == -1) { panic("arp: no response for %s\n", inet_ntoa(addr)); @@ -160,7 +160,7 @@ arpsend(struct iodesc *d, void *pkt, size_t len) * else -1 (and errno == 0) */ static ssize_t -arprecv(struct iodesc *d, void **pkt, void **payload, time_t tleft) +arprecv(struct iodesc *d, void **pkt, void **payload, time_t tleft, void *extra) { ssize_t n; struct ether_arp *ah; Modified: head/stand/libsa/bootp.c ============================================================================== --- head/stand/libsa/bootp.c Thu Feb 15 18:58:03 2018 (r329338) +++ head/stand/libsa/bootp.c Thu Feb 15 19:49:15 2018 (r329339) @@ -73,7 +73,7 @@ static char vm_cmu[4] = VM_CMU; /* Local forwards */ static ssize_t bootpsend(struct iodesc *, void *, size_t); -static ssize_t bootprecv(struct iodesc *, void **, void **, time_t); +static ssize_t bootprecv(struct iodesc *, void **, void **, time_t, void *); static int vend_rfc1048(u_char *, u_int); #ifdef BOOTP_VEND_CMU static void vend_cmu(u_char *); @@ -183,7 +183,7 @@ bootp(int sock) if(sendrecv(d, bootpsend, bp, sizeof(*bp), - bootprecv, &pkt, (void **)&rbootp) == -1) { + bootprecv, &pkt, (void **)&rbootp, NULL) == -1) { printf("bootp: no reply\n"); return; } @@ -209,7 +209,7 @@ bootp(int sock) free(pkt); if(sendrecv(d, bootpsend, bp, sizeof(*bp), - bootprecv, &pkt, (void **)&rbootp) == -1) { + bootprecv, &pkt, (void **)&rbootp, NULL) == -1) { printf("DHCPREQUEST failed\n"); return; } @@ -286,7 +286,8 @@ bootpsend(struct iodesc *d, void *pkt, size_t len) } static ssize_t -bootprecv(struct iodesc *d, void **pkt, void **payload, time_t tleft) +bootprecv(struct iodesc *d, void **pkt, void **payload, time_t tleft, + void *extra) { ssize_t n; struct bootp *bp; Modified: head/stand/libsa/net.c ============================================================================== --- head/stand/libsa/net.c Thu Feb 15 18:58:03 2018 (r329338) +++ head/stand/libsa/net.c Thu Feb 15 19:49:15 2018 (r329339) @@ -72,8 +72,8 @@ ssize_t sendrecv(struct iodesc *d, ssize_t (*sproc)(struct iodesc *, void *, size_t), void *sbuf, size_t ssize, - ssize_t (*rproc)(struct iodesc *, void **, void **, time_t), - void **pkt, void **payload) + ssize_t (*rproc)(struct iodesc *, void **, void **, time_t, void *), + void **pkt, void **payload, void *recv_extra) { ssize_t cc; time_t t, tmo, tlast; @@ -116,7 +116,7 @@ sendrecv(struct iodesc *d, } /* Try to get a packet and process it. */ - cc = (*rproc)(d, pkt, payload, tleft); + cc = (*rproc)(d, pkt, payload, tleft, recv_extra); /* Return on data, EOF or real error. */ if (cc != -1 || (errno != 0 && errno != ETIMEDOUT)) return (cc); Modified: head/stand/libsa/net.h ============================================================================== --- head/stand/libsa/net.h Thu Feb 15 18:58:03 2018 (r329338) +++ head/stand/libsa/net.h Thu Feb 15 19:49:15 2018 (r329339) @@ -115,8 +115,9 @@ ssize_t readudp(struct iodesc *, void **, void **, tim ssize_t sendrecv(struct iodesc *, ssize_t (*)(struct iodesc *, void *, size_t), void *, size_t, - ssize_t (*)(struct iodesc *, void **, void **, time_t), - void **, void **); + ssize_t (*)(struct iodesc *, void **, void **, time_t, + void *), + void **, void **, void *); /* bootp/DHCP */ void bootp(int); Modified: head/stand/libsa/rarp.c ============================================================================== --- head/stand/libsa/rarp.c Thu Feb 15 18:58:03 2018 (r329338) +++ head/stand/libsa/rarp.c Thu Feb 15 19:49:15 2018 (r329339) @@ -54,7 +54,7 @@ __FBSDID("$FreeBSD$"); static ssize_t rarpsend(struct iodesc *, void *, size_t); -static ssize_t rarprecv(struct iodesc *, void **, void **, time_t); +static ssize_t rarprecv(struct iodesc *, void **, void **, time_t, void *); /* * Ethernet (Reverse) Address Resolution Protocol (see RFC 903, and 826). @@ -99,7 +99,7 @@ rarp_getipaddress(int sock) if (sendrecv(d, rarpsend, &wbuf.data, sizeof(wbuf.data), - rarprecv, &pkt, (void *)&ap) < 0) { + rarprecv, &pkt, (void *)&ap, NULL) < 0) { printf("No response for RARP request\n"); return (-1); } @@ -143,7 +143,8 @@ rarpsend(struct iodesc *d, void *pkt, size_t len) * else -1 (and errno == 0) */ static ssize_t -rarprecv(struct iodesc *d, void **pkt, void **payload, time_t tleft) +rarprecv(struct iodesc *d, void **pkt, void **payload, time_t tleft, + void *extra) { ssize_t n; struct ether_arp *ap; Modified: head/stand/libsa/rpc.c ============================================================================== --- head/stand/libsa/rpc.c Thu Feb 15 18:58:03 2018 (r329338) +++ head/stand/libsa/rpc.c Thu Feb 15 19:49:15 2018 (r329339) @@ -97,7 +97,7 @@ struct rpc_reply { }; /* Local forwards */ -static ssize_t recvrpc(struct iodesc *, void **, void **, time_t); +static ssize_t recvrpc(struct iodesc *, void **, void **, time_t, void *); static int rpc_getport(struct iodesc *, n_long, n_long); int rpc_xid; @@ -167,7 +167,7 @@ rpc_call(struct iodesc *d, n_long prog, n_long vers, n ptr = NULL; cc = sendrecv(d, sendudp, send_head, send_tail - send_head, - recvrpc, &ptr, (void **)&reply); + recvrpc, &ptr, (void **)&reply, NULL); #ifdef RPC_DEBUG if (debug) @@ -217,7 +217,7 @@ rpc_call(struct iodesc *d, n_long prog, n_long vers, n * Remaining checks are done by callrpc */ static ssize_t -recvrpc(struct iodesc *d, void **pkt, void **payload, time_t tleft) +recvrpc(struct iodesc *d, void **pkt, void **payload, time_t tleft, void *extra) { void *ptr; struct rpc_reply *reply; Modified: head/stand/libsa/tftp.c ============================================================================== --- head/stand/libsa/tftp.c Thu Feb 15 18:58:03 2018 (r329338) +++ head/stand/libsa/tftp.c Thu Feb 15 19:49:15 2018 (r329339) @@ -61,7 +61,10 @@ __FBSDID("$FreeBSD$"); #include "tftp.h" struct tftp_handle; +struct tftprecv_extra; +static ssize_t recvtftp(struct iodesc *d, void **pkt, void **payload, + time_t tleft, void *recv_extra); static int tftp_open(const char *path, struct open_file *f); static int tftp_close(struct open_file *f); static int tftp_parse_oack(struct tftp_handle *h, char *buf, size_t len); @@ -70,11 +73,6 @@ static int tftp_write(struct open_file *f, void *buf, static off_t tftp_seek(struct open_file *f, off_t offset, int where); static int tftp_set_blksize(struct tftp_handle *h, const char *str); static int tftp_stat(struct open_file *f, struct stat *sb); -static ssize_t sendrecv_tftp(struct tftp_handle *h, - ssize_t (*sproc)(struct iodesc *, void *, size_t), - void *sbuf, size_t ssize, - ssize_t (*rproc)(struct tftp_handle *h, void **, void **, time_t, unsigned short *), - void **, void **, unsigned short *rtype); struct fs_ops tftp_fsops = { "tftp", @@ -118,6 +116,11 @@ struct tftp_handle { struct tftphdr *tftp_hdr; }; +struct tftprecv_extra { + struct tftp_handle *tftp_handle; + unsigned short rtype; /* Received type */ +}; + #define TFTP_MAX_ERRCODE EOPTNEG static const int tftperrors[TFTP_MAX_ERRCODE + 1] = { 0, /* ??? */ @@ -178,15 +181,19 @@ tftp_sendack(struct tftp_handle *h) } static ssize_t -recvtftp(struct tftp_handle *h, void **pkt, void **payload, time_t tleft, - unsigned short *rtype) +recvtftp(struct iodesc *d, void **pkt, void **payload, time_t tleft, + void *recv_extra) { - struct iodesc *d = h->iodesc; + struct tftprecv_extra *extra; + struct tftp_handle *h; struct tftphdr *t; + unsigned short *rtype; void *ptr = NULL; ssize_t len; errno = 0; + extra = (struct tftprecv_extra *)recv_extra; + h = extra->tftp_handle; len = readudp(d, &ptr, (void **)&t, tleft); @@ -195,7 +202,7 @@ recvtftp(struct tftp_handle *h, void **pkt, void **pay return (-1); } - *rtype = ntohs(t->th_opcode); + extra->rtype = ntohs(t->th_opcode); switch (ntohs(t->th_opcode)) { case DATA: { int got; @@ -282,6 +289,7 @@ tftp_makereq(struct tftp_handle *h) struct tftphdr t; u_char space[FNAME_SIZE + 6]; } __packed __aligned(4) wbuf; + struct tftprecv_extra recv_extra; char *wtail; int l; ssize_t res; @@ -289,7 +297,6 @@ tftp_makereq(struct tftp_handle *h) struct tftphdr *t; char *tftp_blksize = NULL; int blksize_l; - unsigned short rtype = 0; /* * Allow overriding default TFTP block size by setting @@ -334,8 +341,9 @@ tftp_makereq(struct tftp_handle *h) h->validsize = 0; pkt = NULL; - res = sendrecv_tftp(h, &sendudp, &wbuf.t, wtail - (char *) &wbuf.t, - &recvtftp, &pkt, (void **)&t, &rtype); + recv_extra.tftp_handle = h; + res = sendrecv(h->iodesc, &sendudp, &wbuf.t, wtail - (char *) &wbuf.t, + (void *)&recvtftp, &pkt, (void **)&t, &recv_extra); if (res == -1) { free(pkt); return (errno); @@ -345,13 +353,13 @@ tftp_makereq(struct tftp_handle *h) h->pkt = pkt; h->tftp_hdr = t; - if (rtype == OACK) + if (recv_extra.rtype == OACK) return (tftp_getnextblock(h)); /* Server ignored our blksize request, revert to TFTP default. */ h->tftp_blksize = SEGSIZE; - switch (rtype) { + switch (recv_extra.rtype) { case DATA: { h->currblock = 1; h->validsize = res; @@ -377,11 +385,11 @@ tftp_getnextblock(struct tftp_handle *h) u_char header[HEADER_SIZE]; struct tftphdr t; } __packed __aligned(4) wbuf; + struct tftprecv_extra recv_extra; char *wtail; int res; void *pkt; struct tftphdr *t; - unsigned short rtype = 0; wbuf.t.th_opcode = htons((u_short) ACK); wtail = (char *) &wbuf.t.th_block; wbuf.t.th_block = htons((u_short) h->currblock); @@ -390,8 +398,9 @@ tftp_getnextblock(struct tftp_handle *h) h->iodesc->xid = h->currblock + 1; /* expected block */ pkt = NULL; - res = sendrecv_tftp(h, &sendudp, &wbuf.t, wtail - (char *) &wbuf.t, - &recvtftp, &pkt, (void **)&t, &rtype); + recv_extra.tftp_handle = h; + res = sendrecv(h->iodesc, &sendudp, &wbuf.t, wtail - (char *) &wbuf.t, + (void *)&recvtftp, &pkt, (void **)&t, &recv_extra); if (res == -1) { /* 0 is OK! */ free(pkt); @@ -603,67 +612,6 @@ tftp_seek(struct open_file *f, off_t offset, int where return (-1); } return (tftpfile->off); -} - -static ssize_t -sendrecv_tftp(struct tftp_handle *h, - ssize_t (*sproc)(struct iodesc *, void *, size_t), - void *sbuf, size_t ssize, - ssize_t (*rproc)(struct tftp_handle *, void **, void **, time_t, - unsigned short *), - void **pkt, void **payload, unsigned short *rtype) -{ - struct iodesc *d = h->iodesc; - ssize_t cc; - time_t t, t1, tleft; - -#ifdef TFTP_DEBUG - if (debug) - printf("sendrecv: called\n"); -#endif - - tleft = MINTMO; - t = t1 = getsecs(); - for (;;) { - if ((getsecs() - t) > MAXTMO) { - errno = ETIMEDOUT; - return -1; - } - - cc = (*sproc)(d, sbuf, ssize); - if (cc != -1 && cc < ssize) - panic("sendrecv: short write! (%zd < %zu)", - cc, ssize); - - if (cc == -1) { - /* Error on transmit; wait before retrying */ - while ((getsecs() - t1) < tleft); - t1 = getsecs(); - continue; - } - - t = t1 = getsecs(); -recvnext: - if ((getsecs() - t) > MAXTMO) { - errno = ETIMEDOUT; - return -1; - } - /* Try to get a packet and process it. */ - cc = (*rproc)(h, pkt, payload, tleft, rtype); - /* Return on data, EOF or real error. */ - if (cc != -1 || (errno != 0 && errno != ETIMEDOUT)) - return (cc); - if ((getsecs() - t1) < tleft) { - goto recvnext; - } - - /* Timed out or didn't get the packet we're waiting for */ - tleft += MINTMO; - if (tleft > (2 * MINTMO)) { - tleft = (2 * MINTMO); - } - t1 = getsecs(); - } } static int From owner-svn-src-head@freebsd.org Thu Feb 15 20:42: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 C23D5F18BA6; Thu, 15 Feb 2018 20:42:38 +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 75C2C6F2C9; Thu, 15 Feb 2018 20:42:38 +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 70B7123CFD; Thu, 15 Feb 2018 20:42:38 +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 w1FKgceD079602; Thu, 15 Feb 2018 20:42:38 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FKgcDd079601; Thu, 15 Feb 2018 20:42:38 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201802152042.w1FKgcDd079601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 15 Feb 2018 20:42:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329340 - head/sys/amd64/include X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: head/sys/amd64/include X-SVN-Commit-Revision: 329340 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 15 Feb 2018 20:42:38 -0000 Author: jkim Date: Thu Feb 15 20:42:38 2018 New Revision: 329340 URL: https://svnweb.freebsd.org/changeset/base/329340 Log: Change size of padding to reflect reality. No functional change. Discussed with: kib Modified: head/sys/amd64/include/pcpu.h Modified: head/sys/amd64/include/pcpu.h ============================================================================== --- head/sys/amd64/include/pcpu.h Thu Feb 15 19:49:15 2018 (r329339) +++ head/sys/amd64/include/pcpu.h Thu Feb 15 20:42:38 2018 (r329340) @@ -75,7 +75,7 @@ uint32_t pc_pcid_gen; \ uint32_t pc_smp_tlb_done; /* TLB op acknowledgement */ \ uint32_t pc_ibpb_set; \ - char __pad[216] /* be divisor of PAGE_SIZE \ + char __pad[224] /* be divisor of PAGE_SIZE \ after cache alignment */ #define PC_DBREG_CMD_NONE 0 From owner-svn-src-head@freebsd.org Thu Feb 15 21:06: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 9B0C1F1A592; Thu, 15 Feb 2018 21:06:57 +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 4BBC4705A8; Thu, 15 Feb 2018 21:06:57 +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 424F024042; Thu, 15 Feb 2018 21:06:57 +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 w1FL6v1a092372; Thu, 15 Feb 2018 21:06:57 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FL6uNa092369; Thu, 15 Feb 2018 21:06:56 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802152106.w1FL6uNa092369@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 15 Feb 2018 21:06:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329341 - head/usr.sbin/trpt X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/usr.sbin/trpt X-SVN-Commit-Revision: 329341 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 15 Feb 2018 21:06:57 -0000 Author: cem Date: Thu Feb 15 21:06:56 2018 New Revision: 329341 URL: https://svnweb.freebsd.org/changeset/base/329341 Log: trpt(8): Sprinkle style(9) and adddress warnings Update function definitions to post-ISO style; remove deprecated "register" keyword. Correct indentation. Sprinkle 'static' on file-local variables. Appease warnings at WARNS=6, for both Clang and GCC. Sponsored by: Dell EMC Isilon Modified: head/usr.sbin/trpt/Makefile head/usr.sbin/trpt/trpt.c Modified: head/usr.sbin/trpt/Makefile ============================================================================== --- head/usr.sbin/trpt/Makefile Thu Feb 15 20:42:38 2018 (r329340) +++ head/usr.sbin/trpt/Makefile Thu Feb 15 21:06:56 2018 (r329341) @@ -8,10 +8,12 @@ MAN= trpt.8 BINGRP= kmem BINMODE= 2555 -WARNS?= 4 - .if ${MK_INET6_SUPPORT} != "no" CFLAGS+= -DINET6 .endif .include + +# Several included system headers tickle this warning in ways that are +# difficult to work around in this program. +CFLAGS+= -Wno-missing-variable-declarations Modified: head/usr.sbin/trpt/trpt.c ============================================================================== --- head/usr.sbin/trpt/trpt.c Thu Feb 15 20:42:38 2018 (r329340) +++ head/usr.sbin/trpt/trpt.c Thu Feb 15 21:06:56 2018 (r329341) @@ -79,12 +79,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include -struct nlist nl[3]; +static struct nlist nl[3]; #define N_TCP_DEBUG 0 #define N_TCP_DEBX 1 @@ -92,10 +93,10 @@ static caddr_t tcp_pcbs[TCP_NDEBUG]; static n_time ntime; static int aflag, kflag, memf, follow, sflag; -void dotrace(caddr_t); -void klseek(int, off_t, int); -int numeric(const void *, const void *); -void tcp_trace(short, short, struct tcpcb *, int, void *, struct tcphdr *, int); +static void dotrace(caddr_t); +static void klseek(int, off_t, int); +static int numeric(const void *, const void *); +static void tcp_trace(short, short, struct tcpcb *, int, void *, struct tcphdr *, int); static void usage(void); int @@ -150,8 +151,7 @@ main(int argc, char **argv) */ if (setgid(getgid()) != 0) err(1, "setgid"); - } - else + } else syst = getbootfile(); if (nlist(syst, nl) < 0 || !nl[0].n_value) @@ -178,8 +178,8 @@ main(int argc, char **argv) */ if (!npcbs) { for (i = 0; i < TCP_NDEBUG; i++) { - register struct tcp_debug *td = &tcp_debug[i]; - register int j; + struct tcp_debug *td = &tcp_debug[i]; + int j; if (td->td_tcb == 0) continue; @@ -201,31 +201,31 @@ main(int argc, char **argv) fputs(", ", stdout); } putchar('\n'); - } - else for (i = 0; i < npcbs; i++) { - printf("\n%p:\n", tcp_pcbs[i]); - dotrace(tcp_pcbs[i]); - } + } else + for (i = 0; i < npcbs; i++) { + printf("\n%p:\n", tcp_pcbs[i]); + dotrace(tcp_pcbs[i]); + } exit(0); } static void -usage() +usage(void) { (void)fprintf(stderr, - "usage: trpt [-afjs] [-p hex-address] [system [core]]\n"); + "usage: trpt [-afjs] [-p hex-address] [system [core]]\n"); exit(1); } -void -dotrace(tcpcb) - register caddr_t tcpcb; +static void +dotrace(caddr_t tcpcb) { - register struct tcp_debug *td; - register int i; + struct tcp_debug *td; + int i; int prev_debx = tcp_debx, family; -again: if (--tcp_debx < 0) +again: + if (--tcp_debx < 0) tcp_debx = TCP_NDEBUG - 1; for (i = prev_debx % TCP_NDEBUG; i < TCP_NDEBUG; i++) { td = &tcp_debug[i]; @@ -237,17 +237,17 @@ again: if (--tcp_debx < 0) #else family = AF_INET; #endif - switch(family) { + switch (family) { case AF_INET: - tcp_trace(td->td_act, td->td_ostate, - &td->td_cb, td->td_family, &td->td_ti.ti_i, - &td->td_ti.ti_t, td->td_req); + tcp_trace(td->td_act, td->td_ostate, &td->td_cb, + td->td_family, &td->td_ti.ti_i, &td->td_ti.ti_t, + td->td_req); break; #ifdef INET6 case AF_INET6: - tcp_trace(td->td_act, td->td_ostate, - &td->td_cb, td->td_family, &td->td_ti6.ip6, - &td->td_ti6.th, td->td_req); + tcp_trace(td->td_act, td->td_ostate, &td->td_cb, + td->td_family, &td->td_ti6.ip6, &td->td_ti6.th, + td->td_req); break; #endif } @@ -264,22 +264,23 @@ again: if (--tcp_debx < 0) #else family = AF_INET; #endif - switch(family) { + switch (family) { case AF_INET: - tcp_trace(td->td_act, td->td_ostate, - &td->td_cb, td->td_family, &td->td_ti.ti_i, - &td->td_ti.ti_t, td->td_req); + tcp_trace(td->td_act, td->td_ostate, &td->td_cb, + td->td_family, &td->td_ti.ti_i, &td->td_ti.ti_t, + td->td_req); break; #ifdef INET6 case AF_INET6: - tcp_trace(td->td_act, td->td_ostate, - &td->td_cb, td->td_family, &td->td_ti6.ip6, - &td->td_ti6.th, td->td_req); + tcp_trace(td->td_act, td->td_ostate, &td->td_cb, + td->td_family, &td->td_ti6.ip6, &td->td_ti6.th, + td->td_req); break; #endif } } -done: if (follow) { +done: + if (follow) { prev_debx = tcp_debx + 1; if (prev_debx >= TCP_NDEBUG) prev_debx = 0; @@ -302,7 +303,7 @@ done: if (follow) { * Tcp debug routines */ /*ARGSUSED*/ -void +static void tcp_trace(short act, short ostate, struct tcpcb *tp, int family __unused, void *ip, struct tcphdr *th, int req) { @@ -310,21 +311,26 @@ tcp_trace(short act, short ostate, struct tcpcb *tp, i int flags, len, win, timer; struct ip *ip4; #ifdef INET6 - int isipv6, nopkt = 1; + bool isipv6, nopkt = true; struct ip6_hdr *ip6; char ntop_buf[INET6_ADDRSTRLEN]; #endif #ifdef INET6 + /* Appease GCC -Wmaybe-uninitialized */ + ip4 = NULL; + ip6 = NULL; + isipv6 = false; + switch (family) { case AF_INET: - nopkt = 0; - isipv6 = 0; + nopkt = false; + isipv6 = false; ip4 = (struct ip *)ip; break; case AF_INET6: - nopkt = 0; - isipv6 = 1; + nopkt = false; + isipv6 = true; ip6 = (struct ip6_hdr *)ip; case 0: default: @@ -333,43 +339,39 @@ tcp_trace(short act, short ostate, struct tcpcb *tp, i #else ip4 = (struct ip *)ip; #endif - printf("%03ld %s:%s ", (long)((ntime/10) % 1000), tcpstates[ostate], + printf("%03ld %s:%s ", (long)((ntime / 10) % 1000), tcpstates[ostate], tanames[act]); switch (act) { case TA_INPUT: case TA_OUTPUT: case TA_DROP: #ifdef INET6 - if (nopkt != 0) + if (nopkt) break; #endif if (aflag) { printf("(src=%s,%u, ", #ifdef INET6 - isipv6 - ? inet_ntop(AF_INET6, &ip6->ip6_src, ntop_buf, - sizeof(ntop_buf)) : + isipv6 ? inet_ntop(AF_INET6, &ip6->ip6_src, + ntop_buf, sizeof(ntop_buf)) : #endif - inet_ntoa(ip4->ip_src), - ntohs(th->th_sport)); + inet_ntoa(ip4->ip_src), ntohs(th->th_sport)); printf("dst=%s,%u)", #ifdef INET6 - isipv6 - ? inet_ntop(AF_INET6, &ip6->ip6_dst, ntop_buf, - sizeof(ntop_buf)) : + isipv6 ? inet_ntop(AF_INET6, &ip6->ip6_dst, + ntop_buf, sizeof(ntop_buf)) : #endif - inet_ntoa(ip4->ip_dst), - ntohs(th->th_dport)); + inet_ntoa(ip4->ip_dst), ntohs(th->th_dport)); } seq = th->th_seq; ack = th->th_ack; len = #ifdef INET6 - isipv6 ? ip6->ip6_plen : + isipv6 ? ip6->ip6_plen : #endif - ip4->ip_len; + ip4->ip_len; win = th->th_win; if (act == TA_OUTPUT) { seq = ntohl(seq); @@ -421,23 +423,21 @@ tcp_trace(short act, short ostate, struct tcpcb *tp, i (u_long)tp->snd_una, (u_long)tp->snd_nxt, (u_long)tp->snd_max); printf("\tsnd_wl1 %lx snd_wl2 %lx snd_wnd %lx\n", - (u_long)tp->snd_wl1, - (u_long)tp->snd_wl2, (u_long)tp->snd_wnd); + (u_long)tp->snd_wl1, (u_long)tp->snd_wl2, + (u_long)tp->snd_wnd); } } -int -numeric(v1, v2) - const void *v1, *v2; +static int +numeric(const void *v1, const void *v2) { const caddr_t *c1 = v1, *c2 = v2; - return(*c1 - *c2); + + return (*c1 - *c2); } -void -klseek(fd, base, off) - int fd, off; - off_t base; +static void +klseek(int fd, off_t base, int off) { (void)lseek(fd, base, off); } From owner-svn-src-head@freebsd.org Thu Feb 15 21:24: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 A5085F1B952; Thu, 15 Feb 2018 21:24:44 +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 5868971153; Thu, 15 Feb 2018 21:24:44 +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 5348D24364; Thu, 15 Feb 2018 21:24:44 +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 w1FLOiYY004067; Thu, 15 Feb 2018 21:24:44 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FLOi6M004066; Thu, 15 Feb 2018 21:24:44 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201802152124.w1FLOi6M004066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 15 Feb 2018 21:24:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329342 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 329342 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 15 Feb 2018 21:24:44 -0000 Author: brooks Date: Thu Feb 15 21:24:43 2018 New Revision: 329342 URL: https://svnweb.freebsd.org/changeset/base/329342 Log: Reduce duplication in __acl_*_(file|link). Add const to new kern_ functions and push down as required. Reviewed by: rwatson Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14174 Modified: head/sys/kern/vfs_acl.c Modified: head/sys/kern/vfs_acl.c ============================================================================== --- head/sys/kern/vfs_acl.c Thu Feb 15 21:06:56 2018 (r329341) +++ head/sys/kern/vfs_acl.c Thu Feb 15 21:24:43 2018 (r329342) @@ -67,12 +67,21 @@ CTASSERT(ACL_MAX_ENTRIES >= OLDACL_MAX_ENTRIES); MALLOC_DEFINE(M_ACL, "acl", "Access Control Lists"); + +static int kern___acl_aclcheck_path(struct thread *td, const char *path, + acl_type_t type, struct acl *aclp, int follow); +static int kern___acl_delete_path(struct thread *td, const char *path, + acl_type_t type, int follow); +static int kern___acl_get_path(struct thread *td, const char *path, + acl_type_t type, struct acl *aclp, int follow); +static int kern___acl_set_path(struct thread *td, const char *path, + acl_type_t type, const struct acl *aclp, int follow); static int vacl_set_acl(struct thread *td, struct vnode *vp, - acl_type_t type, struct acl *aclp); + acl_type_t type, const struct acl *aclp); static int vacl_get_acl(struct thread *td, struct vnode *vp, acl_type_t type, struct acl *aclp); static int vacl_aclcheck(struct thread *td, struct vnode *vp, - acl_type_t type, struct acl *aclp); + acl_type_t type, const struct acl *aclp); int acl_copy_oldacl_into_acl(const struct oldacl *source, struct acl *dest) @@ -130,7 +139,7 @@ acl_copy_acl_into_oldacl(const struct acl *source, str * format. */ static int -acl_copyin(void *user_acl, struct acl *kernel_acl, acl_type_t type) +acl_copyin(const void *user_acl, struct acl *kernel_acl, acl_type_t type) { int error; struct oldacl old; @@ -154,7 +163,7 @@ acl_copyin(void *user_acl, struct acl *kernel_acl, acl } static int -acl_copyout(struct acl *kernel_acl, void *user_acl, acl_type_t type) +acl_copyout(const struct acl *kernel_acl, void *user_acl, acl_type_t type) { uint32_t am; int error; @@ -218,7 +227,7 @@ acl_type_unold(int type) */ static int vacl_set_acl(struct thread *td, struct vnode *vp, acl_type_t type, - struct acl *aclp) + const struct acl *aclp) { struct acl *inkernelacl; struct mount *mp; @@ -319,7 +328,7 @@ out: */ static int vacl_aclcheck(struct thread *td, struct vnode *vp, acl_type_t type, - struct acl *aclp) + const struct acl *aclp) { struct acl *inkernelacl; int error; @@ -346,17 +355,9 @@ out: int sys___acl_get_file(struct thread *td, struct __acl_get_file_args *uap) { - struct nameidata nd; - int error; - NDINIT(&nd, LOOKUP, FOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, - td); - error = namei(&nd); - if (error == 0) { - error = vacl_get_acl(td, nd.ni_vp, uap->type, uap->aclp); - NDFREE(&nd, 0); - } - return (error); + return (kern___acl_get_path(td, uap->path, uap->type, uap->aclp, + FOLLOW)); } /* @@ -365,14 +366,22 @@ sys___acl_get_file(struct thread *td, struct __acl_get int sys___acl_get_link(struct thread *td, struct __acl_get_link_args *uap) { + + return(kern___acl_get_path(td, uap->path, uap->type, uap->aclp, + NOFOLLOW)); +} + +static int +kern___acl_get_path(struct thread *td, const char *path, acl_type_t type, + struct acl *aclp, int follow) +{ struct nameidata nd; int error; - NDINIT(&nd, LOOKUP, NOFOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, - td); + NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, UIO_USERSPACE, path, td); error = namei(&nd); if (error == 0) { - error = vacl_get_acl(td, nd.ni_vp, uap->type, uap->aclp); + error = vacl_get_acl(td, nd.ni_vp, type, aclp); NDFREE(&nd, 0); } return (error); @@ -384,17 +393,9 @@ sys___acl_get_link(struct thread *td, struct __acl_get int sys___acl_set_file(struct thread *td, struct __acl_set_file_args *uap) { - struct nameidata nd; - int error; - NDINIT(&nd, LOOKUP, FOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, - td); - error = namei(&nd); - if (error == 0) { - error = vacl_set_acl(td, nd.ni_vp, uap->type, uap->aclp); - NDFREE(&nd, 0); - } - return (error); + return(kern___acl_set_path(td, uap->path, uap->type, uap->aclp, + FOLLOW)); } /* @@ -403,14 +404,22 @@ sys___acl_set_file(struct thread *td, struct __acl_set int sys___acl_set_link(struct thread *td, struct __acl_set_link_args *uap) { + + return(kern___acl_set_path(td, uap->path, uap->type, uap->aclp, + NOFOLLOW)); +} + +static int +kern___acl_set_path(struct thread *td, const char *path, + acl_type_t type, const struct acl *aclp, int follow) +{ struct nameidata nd; int error; - NDINIT(&nd, LOOKUP, NOFOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, - td); + NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, UIO_USERSPACE, path, td); error = namei(&nd); if (error == 0) { - error = vacl_set_acl(td, nd.ni_vp, uap->type, uap->aclp); + error = vacl_set_acl(td, nd.ni_vp, type, aclp); NDFREE(&nd, 0); } return (error); @@ -462,16 +471,8 @@ sys___acl_set_fd(struct thread *td, struct __acl_set_f int sys___acl_delete_file(struct thread *td, struct __acl_delete_file_args *uap) { - struct nameidata nd; - int error; - NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, td); - error = namei(&nd); - if (error == 0) { - error = vacl_delete(td, nd.ni_vp, uap->type); - NDFREE(&nd, 0); - } - return (error); + return (kern___acl_delete_path(td, uap->path, uap->type, FOLLOW)); } /* @@ -480,13 +481,21 @@ sys___acl_delete_file(struct thread *td, struct __acl_ int sys___acl_delete_link(struct thread *td, struct __acl_delete_link_args *uap) { + + return (kern___acl_delete_path(td, uap->path, uap->type, NOFOLLOW)); +} + +static int +kern___acl_delete_path(struct thread *td, const char *path, + acl_type_t type, int follow) +{ struct nameidata nd; int error; - NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, follow, UIO_USERSPACE, path, td); error = namei(&nd); if (error == 0) { - error = vacl_delete(td, nd.ni_vp, uap->type); + error = vacl_delete(td, nd.ni_vp, type); NDFREE(&nd, 0); } return (error); @@ -518,16 +527,9 @@ sys___acl_delete_fd(struct thread *td, struct __acl_de int sys___acl_aclcheck_file(struct thread *td, struct __acl_aclcheck_file_args *uap) { - struct nameidata nd; - int error; - NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, td); - error = namei(&nd); - if (error == 0) { - error = vacl_aclcheck(td, nd.ni_vp, uap->type, uap->aclp); - NDFREE(&nd, 0); - } - return (error); + return (kern___acl_aclcheck_path(td, uap->path, uap->type, uap->aclp, + FOLLOW)); } /* @@ -536,13 +538,21 @@ sys___acl_aclcheck_file(struct thread *td, struct __ac int sys___acl_aclcheck_link(struct thread *td, struct __acl_aclcheck_link_args *uap) { + return (kern___acl_aclcheck_path(td, uap->path, uap->type, uap->aclp, + NOFOLLOW)); +} + +static int +kern___acl_aclcheck_path(struct thread *td, const char *path, acl_type_t type, + struct acl *aclp, int follow) +{ struct nameidata nd; int error; - NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, follow, UIO_USERSPACE, path, td); error = namei(&nd); if (error == 0) { - error = vacl_aclcheck(td, nd.ni_vp, uap->type, uap->aclp); + error = vacl_aclcheck(td, nd.ni_vp, type, aclp); NDFREE(&nd, 0); } return (error); From owner-svn-src-head@freebsd.org Thu Feb 15 21:30: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 CEB64F1C08F; Thu, 15 Feb 2018 21:30:31 +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 7D0C87167F; Thu, 15 Feb 2018 21:30:31 +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 5DD3A2437C; Thu, 15 Feb 2018 21:30:31 +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 w1FLUVZg005134; Thu, 15 Feb 2018 21:30:31 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1FLUVwU005130; Thu, 15 Feb 2018 21:30:31 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201802152130.w1FLUVwU005130@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 15 Feb 2018 21:30:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329344 - head/cddl/usr.sbin/zfsd X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/cddl/usr.sbin/zfsd X-SVN-Commit-Revision: 329344 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 15 Feb 2018 21:30:32 -0000 Author: asomers Date: Thu Feb 15 21:30:30 2018 New Revision: 329344 URL: https://svnweb.freebsd.org/changeset/base/329344 Log: Optimize zfsd for the happy case If there are no damaged pools, then ignore all GEOM events. We only use them to fix damaged pools. However, still pay attention to ZFS events. MFC after: 20 days X-MFC-With: 329284 Sponsored by: Spectra Logic Corp Modified: head/cddl/usr.sbin/zfsd/case_file.cc head/cddl/usr.sbin/zfsd/case_file.h head/cddl/usr.sbin/zfsd/zfsd_event.cc Modified: head/cddl/usr.sbin/zfsd/case_file.cc ============================================================================== --- head/cddl/usr.sbin/zfsd/case_file.cc Thu Feb 15 21:27:24 2018 (r329343) +++ head/cddl/usr.sbin/zfsd/case_file.cc Thu Feb 15 21:30:30 2018 (r329344) @@ -186,6 +186,12 @@ CaseFile::DeSerialize() free(caseFiles); } +bool +CaseFile::Empty() +{ + return (s_activeCases.empty()); +} + void CaseFile::LogAll() { Modified: head/cddl/usr.sbin/zfsd/case_file.h ============================================================================== --- head/cddl/usr.sbin/zfsd/case_file.h Thu Feb 15 21:27:24 2018 (r329343) +++ head/cddl/usr.sbin/zfsd/case_file.h Thu Feb 15 21:30:30 2018 (r329344) @@ -135,6 +135,11 @@ class CaseFile (public) static void DeSerialize(); /** + * \brief returns true if there are no CaseFiles + */ + static bool Empty(); + + /** * \brief Emit syslog data on all active CaseFile%%s in the system. */ static void LogAll(); Modified: head/cddl/usr.sbin/zfsd/zfsd_event.cc ============================================================================== --- head/cddl/usr.sbin/zfsd/zfsd_event.cc Thu Feb 15 21:27:24 2018 (r329343) +++ head/cddl/usr.sbin/zfsd/zfsd_event.cc Thu Feb 15 21:30:30 2018 (r329344) @@ -98,8 +98,16 @@ bool GeomEvent::Process() const { /* - * We are only concerned with create arrivals and physical path changes, - * because those can be used to satisfy online and autoreplace operations + * We only use GEOM events to repair damaged pools. So return early if + * there are no damaged pools + */ + if (CaseFile::Empty()) + return (false); + + /* + * We are only concerned with arrivals and physical path changes, + * because those can be used to satisfy online and autoreplace + * operations */ if (Value("type") != "GEOM::physpath" && Value("type") != "CREATE") return (false); From owner-svn-src-head@freebsd.org Thu Feb 15 23:16: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 319B7F22F0C; Thu, 15 Feb 2018 23:16:31 +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 D6F6A758C8; Thu, 15 Feb 2018 23:16:30 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 18DDC10AFAD; Thu, 15 Feb 2018 18:16:24 -0500 (EST) From: John Baldwin To: Alan Somers Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329265 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Date: Thu, 15 Feb 2018 11:18:15 -0800 Message-ID: <3148002.4yJvN52HMT@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201802141549.w1EFnVBV064848@repo.freebsd.org> References: <201802141549.w1EFnVBV064848@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Thu, 15 Feb 2018 18:16:24 -0500 (EST) 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.25 Precedence: list List-Id: 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, 15 Feb 2018 23:16:31 -0000 On Wednesday, February 14, 2018 03:49:31 PM Alan Somers wrote: > Author: asomers > Date: Wed Feb 14 15:49:31 2018 > New Revision: 329265 > URL: https://svnweb.freebsd.org/changeset/base/329265 > > Log: > Implement .vop_pathconf and .vop_getacl for the .zfs ctldir > > zfsctl_common_pathconf will report all the same variables that regular ZFS > volumes report. zfsctl_common_getacl will report an ACL equivalent to 555, > except that you can't read xattrs or edit attributes. > > Fixes a bug where "ls .zfs" will occasionally print something like: > ls: .zfs/.: Operation not supported > > PR: 225793 > Reviewed by: avg > MFC after: 3 weeks > Sponsored by: Spectra Logic Corp > Differential Revision: https://reviews.freebsd.org/D14365 > > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Wed Feb 14 15:40:13 2018 (r329264) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Wed Feb 14 15:49:31 2018 (r329265) > @@ -80,6 +80,10 @@ > > #include "zfs_namecheck.h" > > +/* Common access mode for all virtual directories under the ctldir */ > +const u_short zfsctl_ctldir_mode = S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | > + S_IROTH | S_IXOTH; > + > /* > * "Synthetic" filesystem implementation. > */ > @@ -496,8 +500,7 @@ zfsctl_common_getattr(vnode_t *vp, vattr_t *vap) > vap->va_nblocks = 0; > vap->va_seq = 0; > vn_fsid(vp, vap); > - vap->va_mode = S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | > - S_IROTH | S_IXOTH; > + vap->va_mode = zfsctl_ctldir_mode; > vap->va_type = VDIR; > /* > * We live in the now (for atime). > @@ -724,6 +727,87 @@ zfsctl_root_vptocnp(struct vop_vptocnp_args *ap) > return (0); > } > > +static int > +zfsctl_common_pathconf(ap) > + struct vop_pathconf_args /* { > + struct vnode *a_vp; > + int a_name; > + int *a_retval; > + } */ *ap; > +{ > + /* > + * We care about ACL variables so that user land utilities like ls > + * can display them correctly. Since the ctldir's st_dev is set to be > + * the same as the parent dataset, we must support all variables that > + * it supports. > + */ > + switch (ap->a_name) { > + case _PC_LINK_MAX: > + *ap->a_retval = INT_MAX; > + return (0); On HEAD this should probably match the existing ZFS pathconf (min(LONG_MAX, ZFS_LINK_MAX IIRC), though if these directories can only ever have a link count of 2 (which seems true from zfsctl_common_getattr()) then it would be fine to return '2' here instead. For stable you'd have to restrict it to LINK_MAX if you don't use '2'. Also, you should call vfs_stdpathconf() in the default: case. -- John Baldwin From owner-svn-src-head@freebsd.org Fri Feb 16 00:17: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 CB726F01FD1; Fri, 16 Feb 2018 00:17:33 +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 78D2577DF8; Fri, 16 Feb 2018 00:17: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 73A6025EFD; Fri, 16 Feb 2018 00:17:33 +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 w1G0HXI6094650; Fri, 16 Feb 2018 00:17:33 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G0HWq8094640; Fri, 16 Feb 2018 00:17:32 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802160017.w1G0HWq8094640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 16 Feb 2018 00:17:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329345 - in head: share/mk stand stand/fdt stand/ficl stand/geli stand/libsa stand/mips/uboot stand/uboot/fdt stand/uboot/lib stand/zfs X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: share/mk stand stand/fdt stand/ficl stand/geli stand/libsa stand/mips/uboot stand/uboot/fdt stand/uboot/lib stand/zfs X-SVN-Commit-Revision: 329345 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 00:17:34 -0000 Author: imp Date: Fri Feb 16 00:17:32 2018 New Revision: 329345 URL: https://svnweb.freebsd.org/changeset/base/329345 Log: Eliminate bsd.stand.mk and -fPIC 32-bit intel builds OK. We don't really need a bsd.stand.mk, and it was causing a -fPIC for the toolchain to be added (bogusly) when building on amd64. Pull all relevant defs back into defs.mk and delete bsd.stand.mk. This saves about 15-20k on i386 loader and zfsloader which when combined with Lua give us a lot more stack space in those constrained environments. Deleted: head/share/mk/bsd.stand.mk Modified: head/stand/defs.mk head/stand/fdt/Makefile head/stand/ficl/Makefile head/stand/geli/Makefile head/stand/libsa/Makefile head/stand/mips/uboot/Makefile head/stand/uboot/fdt/Makefile head/stand/uboot/lib/Makefile head/stand/zfs/Makefile Modified: head/stand/defs.mk ============================================================================== --- head/stand/defs.mk Thu Feb 15 21:30:30 2018 (r329344) +++ head/stand/defs.mk Fri Feb 16 00:17:32 2018 (r329345) @@ -101,8 +101,10 @@ SSP_CFLAGS= # currently has no /boot/loader, but may soon. CFLAGS+= -ffreestanding ${CFLAGS_NO_SIMD} .if ${MACHINE_CPUARCH} == "aarch64" -CFLAGS+= -mgeneral-regs-only -.elif ${MACHINE_CPUARCH} != "riscv" +CFLAGS+= -mgeneral-regs-only -fPIC +.elif ${MACHINE_CPUARCH} == "riscv" +CFLAGS+= -march=rv64imac -mabi=lp64 +.else CFLAGS+= -msoft-float .endif @@ -110,8 +112,10 @@ CFLAGS+= -msoft-float CFLAGS+= -march=i386 CFLAGS.gcc+= -mpreferred-stack-boundary=2 .endif +.if ${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 0 +CFLAGS+= -fPIC -mno-red-zone +.endif - .if ${MACHINE_CPUARCH} == "arm" # Do not generate movt/movw, because the relocation fixup for them does not # translate to the -Bsymbolic -pie format required by self_reloc() in loader(8). @@ -122,6 +126,7 @@ CFLAGS.clang+= -mllvm -arm-use-movt=0 CFLAGS.clang+= -mno-movt .endif CFLAGS.clang+= -mfpu=none +CFLAGS+= -fPIC .endif # The boot loader build uses dd status=none, where possible, for reproducible @@ -130,6 +135,10 @@ CFLAGS.clang+= -mfpu=none # when this test succeeds rather than require dd to be a bootstrap tool. DD_NOSTATUS!=(dd status=none count=0 2> /dev/null && echo status=none) || true DD=dd ${DD_NOSTATUS} + +.if ${MACHINE_CPUARCH} == "mips" +CFLAGS+= -G0 -fno-pic -mno-abicalls +.endif .if ${MK_LOADER_FORCE_LE} != "no" .if ${MACHINE_ARCH} == "powerpc64" Modified: head/stand/fdt/Makefile ============================================================================== --- head/stand/fdt/Makefile Thu Feb 15 21:30:30 2018 (r329344) +++ head/stand/fdt/Makefile Fri Feb 16 00:17:32 2018 (r329345) @@ -17,5 +17,4 @@ CFLAGS+= -I${SYSDIR}/contrib/libfdt/ -I${LDRSRC} CFLAGS+= -Wformat -Wall -.include .include Modified: head/stand/ficl/Makefile ============================================================================== --- head/stand/ficl/Makefile Thu Feb 15 21:30:30 2018 (r329344) +++ head/stand/ficl/Makefile Fri Feb 16 00:17:32 2018 (r329345) @@ -12,7 +12,6 @@ BASE_SRCS= dict.c ficl.c fileaccess.c float.c loader.c SRCS= ${BASE_SRCS} sysdep.c softcore.c CLEANFILES+= softcore.c testmain testmain.o -.include .ifmake testmain CFLAGS+= -DTESTMAIN -D_TESTMAIN SRCS+= testmain.c Modified: head/stand/geli/Makefile ============================================================================== --- head/stand/geli/Makefile Thu Feb 15 21:30:30 2018 (r329344) +++ head/stand/geli/Makefile Fri Feb 16 00:17:32 2018 (r329345) @@ -34,5 +34,4 @@ SRCS+= geliboot_crypto.c g_eli_hmac.c g_eli_key.c g_e .PATH: ${SYSDIR}/opencrypto SRCS+= xform_aes_xts.c -.include .include Modified: head/stand/libsa/Makefile ============================================================================== --- head/stand/libsa/Makefile Thu Feb 15 21:30:30 2018 (r329344) +++ head/stand/libsa/Makefile Fri Feb 16 00:17:32 2018 (r329345) @@ -151,5 +151,4 @@ CFLAGS.bzipfs.c+= -I${SRCTOP}/contrib/bzip2 .PATH: ${SYSDIR}/libkern SRCS+= explicit_bzero.c -.include .include Modified: head/stand/mips/uboot/Makefile ============================================================================== --- head/stand/mips/uboot/Makefile Thu Feb 15 21:30:30 2018 (r329344) +++ head/stand/mips/uboot/Makefile Fri Feb 16 00:17:32 2018 (r329345) @@ -53,5 +53,4 @@ ubldr: ${OBJS} ldscript.abs ${.CURDIR}/ldscript.${MACH CLEANFILES+= ldscript.abs ldscript.pie ubldr ubldr.pie ubldr.bin -.include .include Modified: head/stand/uboot/fdt/Makefile ============================================================================== --- head/stand/uboot/fdt/Makefile Thu Feb 15 21:30:30 2018 (r329344) +++ head/stand/uboot/fdt/Makefile Fri Feb 16 00:17:32 2018 (r329345) @@ -18,5 +18,4 @@ CFLAGS+= -I${FDTSRC} # Pick up the bootstrap header for some interface items CFLAGS+= -I${LDRSRC} -.include .include Modified: head/stand/uboot/lib/Makefile ============================================================================== --- head/stand/uboot/lib/Makefile Thu Feb 15 21:30:30 2018 (r329344) +++ head/stand/uboot/lib/Makefile Fri Feb 16 00:17:32 2018 (r329345) @@ -24,5 +24,4 @@ CFLAGS+= -I${LDRSRC} CFLAGS+= -DDISK_DEBUG .endif -.include .include Modified: head/stand/zfs/Makefile ============================================================================== --- head/stand/zfs/Makefile Thu Feb 15 21:30:30 2018 (r329344) +++ head/stand/zfs/Makefile Fri Feb 16 00:17:32 2018 (r329345) @@ -17,5 +17,4 @@ CFLAGS+= -I${SYSDIR}/crypto/skein CFLAGS+= -Wformat -Wall -.include .include From owner-svn-src-head@freebsd.org Fri Feb 16 01:03: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 C85C4F04D78; Fri, 16 Feb 2018 01:03:08 +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 7A1F179CDA; Fri, 16 Feb 2018 01:03:08 +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 74FDD26710; Fri, 16 Feb 2018 01:03:08 +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 w1G1384f019406; Fri, 16 Feb 2018 01:03:08 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G138kW019405; Fri, 16 Feb 2018 01:03:08 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802160103.w1G138kW019405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 16 Feb 2018 01:03:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329346 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 329346 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 01:03:09 -0000 Author: cem Date: Fri Feb 16 01:03:08 2018 New Revision: 329346 URL: https://svnweb.freebsd.org/changeset/base/329346 Log: rc.conf.5: Flip default background_fsck language to match defaults Reviewed by: Daniel O'Connor Sponsored by: Dell EMC Isilon Modified: head/share/man/man5/rc.conf.5 Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Fri Feb 16 00:17:32 2018 (r329345) +++ head/share/man/man5/rc.conf.5 Fri Feb 16 01:03:08 2018 (r329346) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 9, 2017 +.Dd February 15, 2018 .Dt RC.CONF 5 .Os .Sh NAME @@ -2056,8 +2056,8 @@ of the file systems fails. .It Va background_fsck .Pq Vt bool If set to -.Dq Li YES , -the system will attempt to run +.Dq Li NO , +the system will not attempt to run .Xr fsck 8 in the background where possible. .It Va background_fsck_delay From owner-svn-src-head@freebsd.org Fri Feb 16 01:08: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 3FCCCF05478; Fri, 16 Feb 2018 01:08:33 +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 DDE317A1B4; Fri, 16 Feb 2018 01:08:32 +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 CD5B526712; Fri, 16 Feb 2018 01:08:32 +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 w1G18WqH019632; Fri, 16 Feb 2018 01:08:32 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G18Wv9019631; Fri, 16 Feb 2018 01:08:32 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201802160108.w1G18Wv9019631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 16 Feb 2018 01:08:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329347 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 329347 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 01:08:33 -0000 Author: kib Date: Fri Feb 16 01:08:32 2018 New Revision: 329347 URL: https://svnweb.freebsd.org/changeset/base/329347 Log: Note that on amd64 pmap_enter(psind = 1) works (since r321378). Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/share/man/man9/pmap_enter.9 Modified: head/share/man/man9/pmap_enter.9 ============================================================================== --- head/share/man/man9/pmap_enter.9 Fri Feb 16 01:03:08 2018 (r329346) +++ head/share/man/man9/pmap_enter.9 Fri Feb 16 01:08:32 2018 (r329347) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 27, 2015 +.Dd February 16, 2018 .Dt PMAP_ENTER 9 .Os .Sh NAME @@ -133,13 +133,13 @@ The function must handle the multiprocessor TLB consistency for the given address. .Sh NOTES -On amd64, arm and i386 architectures the existing implementation +On arm and i386 architectures the existing implementation of the .Nm function is incomplete, only value 0 for .Fa psind is supported. -Other supported architectures have +Other supported architectures, except amd64, have .Dv pagesizes[] array of size 1. .Sh RETURN VALUES From owner-svn-src-head@freebsd.org Fri Feb 16 01:33: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 630AFF06D71; Fri, 16 Feb 2018 01:33:02 +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 153527B208; Fri, 16 Feb 2018 01:33:02 +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 1000E26BE4; Fri, 16 Feb 2018 01:33:02 +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 w1G1X11t034141; Fri, 16 Feb 2018 01:33:01 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G1X18D034134; Fri, 16 Feb 2018 01:33:01 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201802160133.w1G1X18D034134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 16 Feb 2018 01:33:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329348 - in head: sys/sys usr.bin/ipcrm usr.bin/ipcs X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: sys/sys usr.bin/ipcrm usr.bin/ipcs X-SVN-Commit-Revision: 329348 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 01:33:02 -0000 Author: brooks Date: Fri Feb 16 01:33:01 2018 New Revision: 329348 URL: https://svnweb.freebsd.org/changeset/base/329348 Log: Get rid of the requirement to include SysV IPC headers with _KERNEL defined in ipcrm by introducing _WANT_SYSVxxx_INTERNALS defines. Reviewed by: jhb Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14271 Modified: head/sys/sys/ipc.h head/sys/sys/msg.h head/sys/sys/sem.h head/sys/sys/shm.h head/usr.bin/ipcrm/ipcrm.c head/usr.bin/ipcs/ipc.h Modified: head/sys/sys/ipc.h ============================================================================== --- head/sys/sys/ipc.h Fri Feb 16 01:08:32 2018 (r329347) +++ head/sys/sys/ipc.h Fri Feb 16 01:33:01 2018 (r329348) @@ -119,12 +119,14 @@ struct ipc_perm { #define IPC_INFO 3 /* get info */ #endif -#ifdef _KERNEL +#if defined(_KERNEL) || defined(_WANT_SYSVIPC_INTERNALS) /* Macros to convert between ipc ids and array indices or sequence ids */ #define IPCID_TO_IX(id) ((id) & 0xffff) #define IPCID_TO_SEQ(id) (((id) >> 16) & 0xffff) #define IXSEQ_TO_IPCID(ix,perm) (((perm.seq) << 16) | (ix & 0xffff)) +#endif +#ifdef _KERNEL struct thread; struct proc; struct vmspace; Modified: head/sys/sys/msg.h ============================================================================== --- head/sys/sys/msg.h Fri Feb 16 01:08:32 2018 (r329347) +++ head/sys/sys/msg.h Fri Feb 16 01:33:01 2018 (r329348) @@ -25,6 +25,9 @@ #include #include +#ifdef _WANT_SYSVMSG_INTERNALS +#define _WANT_SYSVIPC_INTERNALS +#endif #include /* @@ -116,7 +119,6 @@ struct mymsg { #endif #ifdef _KERNEL - struct msg { struct msg *msg_next; /* next msg in the chain */ long msg_type; /* type of this message */ @@ -126,7 +128,9 @@ struct msg { short msg_spot; /* location of start of msg in buffer */ struct label *label; /* MAC Framework label */ }; +#endif +#if defined(_KERNEL) || defined(_WANT_SYSVMSG_INTERNALS) /* * Based on the configuration parameters described in an SVR2 (yes, two) * config(1m) man page. @@ -145,7 +149,6 @@ struct msginfo { int msgssz; /* size of a message segment (see note) */ int msgseg; /* number of message segments */ }; -extern struct msginfo msginfo; /* * Kernel wrapper for the user-level structure. @@ -162,10 +165,13 @@ struct msqid_kernel { struct label *label; /* MAC label */ struct ucred *cred; /* creator's credentials */ }; +#endif -#endif /* _KERNEL */ +#ifdef _KERNEL +extern struct msginfo msginfo; -#if !defined(_KERNEL) || defined(_WANT_MSG_PROTOTYPES) +#else /* _KERNEL */ + __BEGIN_DECLS int msgctl(int, int, struct msqid_ds *); int msgget(key_t, int); @@ -175,7 +181,6 @@ int msgsnd(int, const void *, size_t, int); int msgsys(int, ...); #endif __END_DECLS - -#endif /* !_KERNEL || _WANT_MSG_PROTOTYPES */ +#endif /* !_KERNEL */ #endif /* !_SYS_MSG_H_ */ Modified: head/sys/sys/sem.h ============================================================================== --- head/sys/sys/sem.h Fri Feb 16 01:08:32 2018 (r329347) +++ head/sys/sys/sem.h Fri Feb 16 01:33:01 2018 (r329348) @@ -10,6 +10,9 @@ #ifndef _SYS_SEM_H_ #define _SYS_SEM_H_ +#ifdef _WANT_SYSVSEM_INTERNALS +#define _WANT_SYSVIPC_INTERNALS +#endif #include #ifndef _PID_T_DECLARED @@ -101,8 +104,7 @@ union semun { #define SEM_A IPC_W /* alter permission */ #define SEM_R IPC_R /* read permission */ -#ifdef _KERNEL - +#if defined(_KERNEL) || defined(_WANT_SYSVSEM_INTERNALS) /* * semaphore info struct */ @@ -117,7 +119,6 @@ struct seminfo { int semvmx; /* semaphore maximum value */ int semaem; /* adjust on exit max value */ }; -extern struct seminfo seminfo; /* * Kernel wrapper for the user-level structure @@ -131,15 +132,17 @@ struct semid_kernel { /* internal "mode" bits */ #define SEM_ALLOC 01000 /* semaphore is allocated */ #define SEM_DEST 02000 /* semaphore will be destroyed on last detach */ +#endif +#ifdef _KERNEL +extern struct seminfo seminfo; /* * Process sem_undo vectors at proc exit. */ void semexit(struct proc *p); -#endif /* _KERNEL */ +#else /* !_KERNEL */ -#if !defined(_KERNEL) || defined(_WANT_SEM_PROTOTYPES) __BEGIN_DECLS #if __BSD_VISIBLE int semsys(int, ...); @@ -149,6 +152,6 @@ int semget(key_t, int, int); int semop(int, struct sembuf *, size_t); __END_DECLS -#endif /* !_KERNEL || _WANT_SEM_PROTOTYPES */ +#endif /* !_KERNEL */ #endif /* !_SYS_SEM_H_ */ Modified: head/sys/sys/shm.h ============================================================================== --- head/sys/sys/shm.h Fri Feb 16 01:08:32 2018 (r329347) +++ head/sys/sys/shm.h Fri Feb 16 01:33:01 2018 (r329348) @@ -42,6 +42,9 @@ #define _SYS_SHM_H_ #include +#ifdef _WANT_SYSVSHM_INTERNALS +#define _WANT_SYSVIPC_INTERNALS +#endif #include #include @@ -107,9 +110,7 @@ struct shmid_ds { time_t shm_ctime; /* time of last change by shmctl() */ }; -#ifdef _KERNEL -#include - +#if defined(_KERNEL) || defined(_WANT_SYSVSHM_INTERNALS) /* * System 5 style catch-all structure for shared memory constants that * might be of interest to user programs. Do we really want/need this? @@ -122,19 +123,20 @@ struct shminfo { u_long shmall; /* max amount of shared memory (pages) */ }; +struct vm_object; + /* * Add a kernel wrapper to the shmid_ds struct so that private info (like the * MAC label) can be added to it, without changing the user interface. */ struct shmid_kernel { struct shmid_ds u; - vm_object_t object; + struct vm_object *object; struct label *label; /* MAC label */ struct ucred *cred; /* creator's credendials */ }; +#endif -extern struct shminfo shminfo; - struct shm_info { int used_ids; unsigned long shm_tot; @@ -144,15 +146,17 @@ struct shm_info { unsigned long swap_successes; }; -struct thread; +#ifdef _KERNEL struct proc; struct vmspace; +extern struct shminfo shminfo; + void shmexit(struct vmspace *); void shmfork(struct proc *, struct proc *); -#endif /* _KERNEL */ -#if !defined(_KERNEL) || defined(_WANT_SHM_PROTOTYPES) +#else /* !_KERNEL */ + #include #ifndef _SIZE_T_DECLARED @@ -170,6 +174,6 @@ int shmctl(int, int, struct shmid_ds *); int shmdt(const void *); __END_DECLS -#endif /* _KERNEL || _WANT_SHM_PROTOTYPES */ +#endif /* _KERNEL */ #endif /* !_SYS_SHM_H_ */ Modified: head/usr.bin/ipcrm/ipcrm.c ============================================================================== --- head/usr.bin/ipcrm/ipcrm.c Fri Feb 16 01:08:32 2018 (r329347) +++ head/usr.bin/ipcrm/ipcrm.c Fri Feb 16 01:33:01 2018 (r329348) @@ -36,14 +36,12 @@ __FBSDID("$FreeBSD$"); #include -#define _WANT_MSG_PROTOTYPES -#define _WANT_SEM_PROTOTYPES -#define _WANT_SHM_PROTOTYPES -#define _KERNEL +#define _WANT_SYSVMSG_INTERNALS +#include +#define _WANT_SYSVSEM_INTERNALS #include +#define _WANT_SYSVSHM_INTERNALS #include -#include -#undef _KERNEL #include #include Modified: head/usr.bin/ipcs/ipc.h ============================================================================== --- head/usr.bin/ipcs/ipc.h Fri Feb 16 01:08:32 2018 (r329347) +++ head/usr.bin/ipcs/ipc.h Fri Feb 16 01:33:01 2018 (r329348) @@ -68,3 +68,6 @@ extern kvm_t *kd; extern struct semid_kernel *sema; extern struct msqid_kernel *msqids; extern struct shmid_kernel *shmsegs; +extern struct seminfo seminfo; +extern struct msginfo msginfo; +extern struct shminfo shminfo; From owner-svn-src-head@freebsd.org Fri Feb 16 03:12: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 1ED1FF0D404; Fri, 16 Feb 2018 03:12:25 +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 C21F87F436; Fri, 16 Feb 2018 03:12:24 +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 BD2CA27C57; Fri, 16 Feb 2018 03:12:24 +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 w1G3COu4085742; Fri, 16 Feb 2018 03:12:24 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G3CO3r085739; Fri, 16 Feb 2018 03:12:24 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802160312.w1G3CO3r085739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 03:12:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329349 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329349 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 03:12:25 -0000 Author: kevans Date: Fri Feb 16 03:12:24 2018 New Revision: 329349 URL: https://svnweb.freebsd.org/changeset/base/329349 Log: stand/lua: Reduce magic numbers Enter/backspace values are hardcoded in both the menu and password scripts. Separate these out to core for reuse between the two. Modified: head/stand/lua/core.lua head/stand/lua/menu.lua head/stand/lua/password.lua Modified: head/stand/lua/core.lua ============================================================================== --- head/stand/lua/core.lua Fri Feb 16 01:33:01 2018 (r329348) +++ head/stand/lua/core.lua Fri Feb 16 03:12:24 2018 (r329349) @@ -28,6 +28,10 @@ local core = {}; +-- Commonly appearing constants +core.KEY_ENTER = 13 +core.KEY_BACKSPACE = 127 + function core.setVerbose(b) if (b == nil) then b = not core.verbose; Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Fri Feb 16 01:33:01 2018 (r329348) +++ head/stand/lua/menu.lua Fri Feb 16 03:12:24 2018 (r329349) @@ -273,9 +273,9 @@ function menu.run(m) local key = io.getchar(); -- Special key behaviors - if (key == 127) and (m ~= menu.welcome) then + if (key == core.KEY_BACKSPACE) and (m ~= menu.welcome) then break - elseif (key == 13) then + elseif (key == core.KEY_ENTER) then core.boot(); -- Should not return end @@ -357,7 +357,7 @@ function menu.autoboot() screen.defcursor(); if io.ischar() then local ch = io.getchar(); - if ch == 13 then + if ch == core.KEY_ENTER then break; else -- prevent autoboot when escaping to interpreter Modified: head/stand/lua/password.lua ============================================================================== --- head/stand/lua/password.lua Fri Feb 16 01:33:01 2018 (r329348) +++ head/stand/lua/password.lua Fri Feb 16 03:12:24 2018 (r329349) @@ -37,11 +37,11 @@ function password.read() repeat ch = io.getchar(); - if ch == 13 then + if ch == core.KEY_ENTER then break; end - if ch == 8 then + if ch == core.KEY_BACKSPACE then if n > 0 then n = n - 1; -- loader.printc("\008 \008"); From owner-svn-src-head@freebsd.org Fri Feb 16 03:14: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 90B76F0D6B2; Fri, 16 Feb 2018 03:14:24 +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 3FB367F62C; Fri, 16 Feb 2018 03:14:24 +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 391EA27C60; Fri, 16 Feb 2018 03:14:24 +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 w1G3EOsR085849; Fri, 16 Feb 2018 03:14:24 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G3EOmI085848; Fri, 16 Feb 2018 03:14:24 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802160314.w1G3EOmI085848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 03:14:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329350 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329350 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 03:14:24 -0000 Author: kevans Date: Fri Feb 16 03:14:23 2018 New Revision: 329350 URL: https://svnweb.freebsd.org/changeset/base/329350 Log: stand/lua: Don't descend into an empty kernels submenu This submenu is likely going to go away in favor of kernel selection as it is done in forth at the moment, but for the time being don't descend into it if we have no kernels available for listing. Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Fri Feb 16 03:12:24 2018 (r329349) +++ head/stand/lua/menu.lua Fri Feb 16 03:14:23 2018 (r329350) @@ -218,6 +218,9 @@ menu.welcome = { -- dynamically build the kernel menu: local kernels = core.kernelList(); + if #kernels == 0 then + return nil; + end for k, v in ipairs(kernels) do menu.kernel_options[#menu.kernel_options + 1] = { entry_type = "entry", From owner-svn-src-head@freebsd.org Fri Feb 16 04:03: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 B4DE6F10B16; Fri, 16 Feb 2018 04:03:16 +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 6AEFE81FFD; Fri, 16 Feb 2018 04:03:16 +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 65C284EB; Fri, 16 Feb 2018 04:03:16 +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 w1G43G7x011580; Fri, 16 Feb 2018 04:03:16 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G43GKn011579; Fri, 16 Feb 2018 04:03:16 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802160403.w1G43GKn011579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 04:03:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329351 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329351 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 04:03:16 -0000 Author: kevans Date: Fri Feb 16 04:03:15 2018 New Revision: 329351 URL: https://svnweb.freebsd.org/changeset/base/329351 Log: stand/lua: Set reasonable ACPI default based on presence Set it based on hint.acpi.0.rsdp. Initially, hint.acpi.0.disabled will be respected. "Using System Defaults" will override whether it's explicitly disabled by hint and re-load it based on whether it's present on the system. Unlike the 4th version, this is not restricted to x86. I have no strong reasoning for this, so this is definitely open to change. Modified: head/stand/lua/core.lua Modified: head/stand/lua/core.lua ============================================================================== --- head/stand/lua/core.lua Fri Feb 16 03:14:23 2018 (r329350) +++ head/stand/lua/core.lua Fri Feb 16 04:03:15 2018 (r329351) @@ -58,6 +58,20 @@ function core.setSingleUser(b) core.su = b; end +function core.getACPIPresent(checkingSystemDefaults) + local c = loader.getenv("hint.acpi.0.rsdp"); + + if (c ~= nil) then + if (checkingSystemDefaults == true) then + return true; + end + -- Otherwise, respect disabled if it's set + c = loader.getenv("hint.acpi.0.disabled"); + return (c == nil) or (tonumber(c) ~= 1); + end + return false; +end + function core.setACPI(b) if (b == nil) then b = not core.acpi; @@ -120,7 +134,7 @@ function core.kernelList() end function core.setDefaults() - core.setACPI(true); + core.setACPI(core.getACPIPresent(true)); core.setSafeMode(false); core.setSingleUser(false); core.setVerbose(false); @@ -155,4 +169,5 @@ function core.bootserial() return false; end +core.acpi = core.getACPIPresent(false) return core From owner-svn-src-head@freebsd.org Fri Feb 16 04:10: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 C7C7DF111FD; Fri, 16 Feb 2018 04:10:11 +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 7117C8232B; Fri, 16 Feb 2018 04:10:11 +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 5A2174F1; Fri, 16 Feb 2018 04:10:11 +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 w1G4ABPT011994; Fri, 16 Feb 2018 04:10:11 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G4ABRs011993; Fri, 16 Feb 2018 04:10:11 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802160410.w1G4ABRs011993@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 04:10:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329352 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329352 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 04:10:12 -0000 Author: kevans Date: Fri Feb 16 04:10:10 2018 New Revision: 329352 URL: https://svnweb.freebsd.org/changeset/base/329352 Log: stand/lua: Consistently use semicolons for line endings Modified: head/stand/lua/core.lua Modified: head/stand/lua/core.lua ============================================================================== --- head/stand/lua/core.lua Fri Feb 16 04:03:15 2018 (r329351) +++ head/stand/lua/core.lua Fri Feb 16 04:10:10 2018 (r329352) @@ -29,8 +29,8 @@ local core = {}; -- Commonly appearing constants -core.KEY_ENTER = 13 -core.KEY_BACKSPACE = 127 +core.KEY_ENTER = 13; +core.KEY_BACKSPACE = 127; function core.setVerbose(b) if (b == nil) then @@ -169,5 +169,5 @@ function core.bootserial() return false; end -core.acpi = core.getACPIPresent(false) +core.acpi = core.getACPIPresent(false); return core From owner-svn-src-head@freebsd.org Fri Feb 16 04:22: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 03B4DF120C8; Fri, 16 Feb 2018 04:22:30 +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 AA61F82E5E; Fri, 16 Feb 2018 04:22:29 +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 A53D680D; Fri, 16 Feb 2018 04:22:29 +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 w1G4MTri021809; Fri, 16 Feb 2018 04:22:29 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G4MTEx021808; Fri, 16 Feb 2018 04:22:29 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201802160422.w1G4MTEx021808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Fri, 16 Feb 2018 04:22:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329353 - head/cddl/lib/libdtrace X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/cddl/lib/libdtrace X-SVN-Commit-Revision: 329353 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 04:22:30 -0000 Author: dteske Date: Fri Feb 16 04:22:29 2018 New Revision: 329353 URL: https://svnweb.freebsd.org/changeset/base/329353 Log: Add inline to errno.d for translating int to string Gives DTrace scripts strerror(3) functionality. Reviewed by: markj Sponsored by: Smule, Inc. Differential Revision: https://reviews.freebsd.org/D14386 Modified: head/cddl/lib/libdtrace/errno.d Modified: head/cddl/lib/libdtrace/errno.d ============================================================================== --- head/cddl/lib/libdtrace/errno.d Fri Feb 16 04:10:10 2018 (r329352) +++ head/cddl/lib/libdtrace/errno.d Fri Feb 16 04:22:29 2018 (r329353) @@ -20,6 +20,7 @@ * CDDL HEADER END * * Portions Copyright 2006-2008 John Birrell jb@freebsd.org + * Portions Copyright 2018 Devin Teske dteske@freebsd.org * * $FreeBSD$ */ @@ -236,3 +237,112 @@ inline int EDIRIOCTL = -4; #pragma D binding "1.0" EDIRIOCTL inline int ERELOOKUP = -5; #pragma D binding "1.13" ERELOOKUP + +/* + * Error strings from + */ +#pragma D binding "1.13" strerror +inline string strerror[int errno] = + errno == 0 ? "Success" : + errno == EPERM ? "Operation not permitted" : + errno == ENOENT ? "No such file or directory" : + errno == ESRCH ? "No such process" : + errno == EINTR ? "Interrupted system call" : + errno == EIO ? "Input/output error" : + errno == ENXIO ? "Device not configured" : + errno == E2BIG ? "Argument list too long" : + errno == ENOEXEC ? "Exec format error" : + errno == EBADF ? "Bad file descriptor" : + errno == ECHILD ? "No child processes" : + errno == EDEADLK ? "Resource deadlock avoided" : + errno == ENOMEM ? "Cannot allocate memory" : + errno == EACCES ? "Permission denied" : + errno == EFAULT ? "Bad address" : + errno == ENOTBLK ? "Block device required" : + errno == EBUSY ? "Device busy" : + errno == EEXIST ? "File exists" : + errno == EXDEV ? "Cross-device link" : + errno == ENODEV ? "Operation not supported by device" : + errno == ENOTDIR ? "Not a directory" : + errno == EISDIR ? "Is a directory" : + errno == EINVAL ? "Invalid argument" : + errno == ENFILE ? "Too many open files in system" : + errno == EMFILE ? "Too many open files" : + errno == ENOTTY ? "Inappropriate ioctl for device" : + errno == ETXTBSY ? "Text file busy" : + errno == EFBIG ? "File too large" : + errno == ENOSPC ? "No space left on device" : + errno == ESPIPE ? "Illegal seek" : + errno == EROFS ? "Read-only filesystem" : + errno == EMLINK ? "Too many links" : + errno == EPIPE ? "Broken pipe" : + errno == EDOM ? "Numerical argument out of domain" : + errno == ERANGE ? "Result too large" : + errno == EAGAIN ? "Resource temporarily unavailable" : + errno == EINPROGRESS ? "Operation now in progress" : + errno == EALREADY ? "Operation already in progress" : + errno == ENOTSOCK ? "Socket operation on non-socket" : + errno == EDESTADDRREQ ? "Destination address required" : + errno == EMSGSIZE ? "Message too long" : + errno == EPROTOTYPE ? "Protocol wrong type for socket" : + errno == ENOPROTOOPT ? "Protocol not available" : + errno == EPROTONOSUPPORT ? "Protocol not supported" : + errno == ESOCKTNOSUPPORT ? "Socket type not supported" : + errno == EOPNOTSUPP ? "Operation not supported" : + errno == EPFNOSUPPORT ? "Protocol family not supported" : + errno == EAFNOSUPPORT ? "Address family not supported by protocol family" : + errno == EADDRINUSE ? "Address already in use" : + errno == EADDRNOTAVAIL ? "Can't assign requested address" : + errno == ENETDOWN ? "Network is down" : + errno == ENETUNREACH ? "Network is unreachable" : + errno == ENETRESET ? "Network dropped connection on reset" : + errno == ECONNABORTED ? "Software caused connection abort" : + errno == ECONNRESET ? "Connection reset by peer" : + errno == ENOBUFS ? "No buffer space available" : + errno == EISCONN ? "Socket is already connected" : + errno == ENOTCONN ? "Socket is not connected" : + errno == ESHUTDOWN ? "Can't send after socket shutdown" : + errno == ETOOMANYREFS ? "Too many references: can't splice" : + errno == ETIMEDOUT ? "Operation timed out" : + errno == ECONNREFUSED ? "Connection refused" : + errno == ELOOP ? "Too many levels of symbolic links" : + errno == ENAMETOOLONG ? "File name too long" : + errno == EHOSTDOWN ? "Host is down" : + errno == EHOSTUNREACH ? "No route to host" : + errno == ENOTEMPTY ? "Directory not empty" : + errno == EPROCLIM ? "Too many processes" : + errno == EUSERS ? "Too many users" : + errno == EDQUOT ? "Disc quota exceeded" : + errno == ESTALE ? "Stale NFS file handle" : + errno == EREMOTE ? "Too many levels of remote in path" : + errno == EBADRPC ? "RPC struct is bad" : + errno == ERPCMISMATCH ? "RPC version wrong" : + errno == EPROGUNAVAIL ? "RPC prog. not avail" : + errno == EPROGMISMATCH ? "Program version wrong" : + errno == EPROCUNAVAIL ? "Bad procedure for program" : + errno == ENOLCK ? "No locks available" : + errno == ENOSYS ? "Function not implemented" : + errno == EFTYPE ? "Inappropriate file type or format" : + errno == EAUTH ? "Authentication error" : + errno == ENEEDAUTH ? "Need authenticator" : + errno == EIDRM ? "Identifier removed" : + errno == ENOMSG ? "No message of desired type" : + errno == EOVERFLOW ? "Value too large to be stored in data type" : + errno == ECANCELED ? "Operation canceled" : + errno == EILSEQ ? "Illegal byte sequence" : + errno == ENOATTR ? "Attribute not found" : + errno == EDOOFUS ? "Programming error" : + errno == EBADMSG ? "Bad message" : + errno == EMULTIHOP ? "Multihop attempted" : + errno == ENOLINK ? "Link has been severed" : + errno == EPROTO ? "Protocol error" : + errno == ENOTCAPABLE ? "Capabilities insufficient" : + errno == ECAPMODE ? "Not permitted in capability mode" : + errno == ENOTRECOVERABLE ? "State not recoverable" : + errno == EOWNERDEAD ? "Previous owner died" : + errno == ERESTART ? "restart syscall" : + errno == EJUSTRETURN ? "don't modify regs, just return" : + errno == ENOIOCTL ? "ioctl not handled by this layer" : + errno == EDIRIOCTL ? "do direct ioctl in GEOM" : + errno == ERELOOKUP ? "retry the directory lookup" : + "Unknown error"; From owner-svn-src-head@freebsd.org Fri Feb 16 04:30: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 245A6F1295F; Fri, 16 Feb 2018 04:30:58 +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 C9E1B832AB; Fri, 16 Feb 2018 04:30:57 +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 C4BEE82D; Fri, 16 Feb 2018 04:30:57 +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 w1G4Uvbd022334; Fri, 16 Feb 2018 04:30:57 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G4UvCr022333; Fri, 16 Feb 2018 04:30:57 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802160430.w1G4UvCr022333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 16 Feb 2018 04:30:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329354 - head/usr.sbin/trpt X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/usr.sbin/trpt X-SVN-Commit-Revision: 329354 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 04:30:58 -0000 Author: cem Date: Fri Feb 16 04:30:57 2018 New Revision: 329354 URL: https://svnweb.freebsd.org/changeset/base/329354 Log: trpt(8): Work around GCC4 shenanigans Reduce warns to known good value and do not add -Wno- flag the ancient GCC4 does not understand. Reported by: jhibbits Sponsored by: Dell EMC Isilon Modified: head/usr.sbin/trpt/Makefile Modified: head/usr.sbin/trpt/Makefile ============================================================================== --- head/usr.sbin/trpt/Makefile Fri Feb 16 04:22:29 2018 (r329353) +++ head/usr.sbin/trpt/Makefile Fri Feb 16 04:30:57 2018 (r329354) @@ -8,12 +8,20 @@ MAN= trpt.8 BINGRP= kmem BINMODE= 2555 +.if ${MACHINE_CPUARCH} != "aarch64" && ${MACHINE_CPUARCH} != "amd64" && \ + ${MACHINE_CPUARCH} != "i386" && ${MACHINE_CPUARCH} != "riscv" +WARNS?= 4 +.endif + .if ${MK_INET6_SUPPORT} != "no" CFLAGS+= -DINET6 .endif .include +.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \ + ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "riscv" # Several included system headers tickle this warning in ways that are # difficult to work around in this program. CFLAGS+= -Wno-missing-variable-declarations +.endif From owner-svn-src-head@freebsd.org Fri Feb 16 04:31: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 D1839F12ACC; Fri, 16 Feb 2018 04:31:09 +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 8467A833B3; Fri, 16 Feb 2018 04:31:09 +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 7F7DD83B; Fri, 16 Feb 2018 04:31:09 +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 w1G4V9AQ022399; Fri, 16 Feb 2018 04:31:09 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G4V9iu022398; Fri, 16 Feb 2018 04:31:09 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802160431.w1G4V9iu022398@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 04:31:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329355 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329355 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 04:31:10 -0000 Author: kevans Date: Fri Feb 16 04:31:09 2018 New Revision: 329355 URL: https://svnweb.freebsd.org/changeset/base/329355 Log: stand/lua: Move kernel selection into main menu This matches the corresponding 4th behavior. Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Fri Feb 16 04:30:57 2018 (r329354) +++ head/stand/lua/menu.lua Fri Feb 16 04:31:09 2018 (r329355) @@ -39,26 +39,14 @@ local OnOff; local skip; local run; local autoboot; +local current_kernel_index = 1; --loader menu tree: --rooted at menu.welcome --submenu declarations: -local kernel_options; local boot_options; local welcome; -menu.kernel_options = { - -- this table is dynamically appended to when accessed - -- return to welcome menu - { - entry_type = "return", - name = function() - return "Back to main menu"..color.highlight(" [Backspace]"); - end, - alias = {"\08"} - } -}; - menu.boot_options = { -- return to welcome menu { @@ -206,35 +194,34 @@ menu.welcome = { -- kernel options { - entry_type = "submenu", + entry_type = "entry", name = function() local kernels = core.kernelList(); if #kernels == 0 then - return "Kernels (not available)"; + return "Kernel: "; end - return color.highlight("K").."ernels"; + + local kernel_name = color.escapef(color.GREEN) .. + kernels[current_kernel_index] .. color.default(); + if (current_kernel_index == 1) then + kernel_name = "default/" .. kernel_name; + end + return color.highlight("K").."ernel: " .. kernel_name .. + " (" .. current_kernel_index .. + " of " .. #kernels .. ")"; end, - submenu = function() + func = function() -- dynamically build the kernel menu: local kernels = core.kernelList(); - if #kernels == 0 then + -- Don't do anything if we don't have multiple kernels + if #kernels <= 1 then return nil; end - for k, v in ipairs(kernels) do - menu.kernel_options[#menu.kernel_options + 1] = { - entry_type = "entry", - name = function() - return v; - end, - func = function() - config.reload(v); - end, - alias = {} -- automatically enumerated - } - end - - return menu.kernel_options; + current_kernel_index = (current_kernel_index % #kernels) + + 1; + local current_kernel = kernels[current_kernel_index]; + config.reload(current_kernel) end, alias = {"k", "K"} }, From owner-svn-src-head@freebsd.org Fri Feb 16 04:44: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 3F6FBF13C75; Fri, 16 Feb 2018 04:44:48 +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 E6F1A84040; Fri, 16 Feb 2018 04:44:47 +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 DDB12B5D; Fri, 16 Feb 2018 04:44:47 +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 w1G4ilch031908; Fri, 16 Feb 2018 04:44:47 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G4il7X031907; Fri, 16 Feb 2018 04:44:47 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802160444.w1G4il7X031907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 04:44:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329356 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329356 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 04:44:48 -0000 Author: kevans Date: Fri Feb 16 04:44:47 2018 New Revision: 329356 URL: https://svnweb.freebsd.org/changeset/base/329356 Log: stand/lua: Allow menu items to not have explicit aliases This will generally be used for cases like "Back to main menu" that already have global aliases installed. Modified: head/stand/lua/drawer.lua Modified: head/stand/lua/drawer.lua ============================================================================== --- head/stand/lua/drawer.lua Fri Feb 16 04:31:09 2018 (r329355) +++ head/stand/lua/drawer.lua Fri Feb 16 04:44:47 2018 (r329356) @@ -173,8 +173,10 @@ function drawer.drawmenu(m) -- fill the alias table alias_table[tostring(entry_num)] = e; - for n, a in ipairs(e.alias) do - alias_table[a] = e; + if (e.alias ~= nil) then + for n, a in ipairs(e.alias) do + alias_table[a] = e; + end end else screen.setcursor(x, y + line_num); From owner-svn-src-head@freebsd.org Fri Feb 16 04: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 641A0F13DB0; Fri, 16 Feb 2018 04:45:54 +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 3B6E0841AF; Fri, 16 Feb 2018 04:45:54 +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 362AEB5E; Fri, 16 Feb 2018 04:45:54 +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 w1G4js5x032004; Fri, 16 Feb 2018 04:45:54 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G4jsoq032003; Fri, 16 Feb 2018 04:45:54 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802160445.w1G4jsoq032003@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 04:45:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329357 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329357 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 04:45:54 -0000 Author: kevans Date: Fri Feb 16 04:45:53 2018 New Revision: 329357 URL: https://svnweb.freebsd.org/changeset/base/329357 Log: stand/lua: Remove explicit alias from "Back to main menu" This removes a redundant alias that has since been converted into a global alias. It was converted to a global alias before to ensure that we always have a way to go up one level in the menu. Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Fri Feb 16 04:44:47 2018 (r329356) +++ head/stand/lua/menu.lua Fri Feb 16 04:45:53 2018 (r329357) @@ -53,8 +53,7 @@ menu.boot_options = { entry_type = "return", name = function() return "Back to main menu"..color.highlight(" [Backspace]"); - end, - alias = {"\08"} + end }, -- load defaults From owner-svn-src-head@freebsd.org Fri Feb 16 04:50: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 EBDCCF1423B; Fri, 16 Feb 2018 04:50:14 +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 9B91B843F4; Fri, 16 Feb 2018 04:50:14 +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 92808B63; Fri, 16 Feb 2018 04:50:14 +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 w1G4oEVL032265; Fri, 16 Feb 2018 04:50:14 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G4oEXI032264; Fri, 16 Feb 2018 04:50:14 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802160450.w1G4oEXI032264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 04:50:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329358 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329358 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 04:50:15 -0000 Author: kevans Date: Fri Feb 16 04:50:14 2018 New Revision: 329358 URL: https://svnweb.freebsd.org/changeset/base/329358 Log: stand/lua: Say "loader prompt" instead of "lua interpreter" Noting that we're in lualoader is nice, but it's not a difference we raelly need to expose to Fred. Re-word it to match the 4th wording and reduce differences. Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Fri Feb 16 04:45:53 2018 (r329357) +++ head/stand/lua/menu.lua Fri Feb 16 04:50:14 2018 (r329358) @@ -159,7 +159,7 @@ menu.welcome = { { entry_type = "return", name = function() - return color.highlight("Esc").."ape to lua interpreter"; + return color.highlight("Esc").."ape to loader prompt"; end, alias = {"\027"} }, From owner-svn-src-head@freebsd.org Fri Feb 16 04:59: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 E5EABF14CC7; Fri, 16 Feb 2018 04:59:21 +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 9A82184A59; Fri, 16 Feb 2018 04:59:21 +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 90C7ECF6; Fri, 16 Feb 2018 04:59:21 +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 w1G4xLrc037121; Fri, 16 Feb 2018 04:59:21 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G4xLe9037119; Fri, 16 Feb 2018 04:59:21 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802160459.w1G4xLe9037119@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 04:59:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329359 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329359 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 04:59:22 -0000 Author: kevans Date: Fri Feb 16 04:59:21 2018 New Revision: 329359 URL: https://svnweb.freebsd.org/changeset/base/329359 Log: stand/lua: Remove a magic number/string (not a trivial literal) We'll arbitrarily use KEYSTR_ for string representations of non-trivial characters. Modified: head/stand/lua/core.lua head/stand/lua/menu.lua Modified: head/stand/lua/core.lua ============================================================================== --- head/stand/lua/core.lua Fri Feb 16 04:50:14 2018 (r329358) +++ head/stand/lua/core.lua Fri Feb 16 04:59:21 2018 (r329359) @@ -32,6 +32,8 @@ local core = {}; core.KEY_ENTER = 13; core.KEY_BACKSPACE = 127; +core.KEYSTR_ESCAPE = "\027"; + function core.setVerbose(b) if (b == nil) then b = not core.verbose; Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Fri Feb 16 04:50:14 2018 (r329358) +++ head/stand/lua/menu.lua Fri Feb 16 04:59:21 2018 (r329359) @@ -161,7 +161,7 @@ menu.welcome = { name = function() return color.highlight("Esc").."ape to loader prompt"; end, - alias = {"\027"} + alias = {core.KEYSTR_ESCAPE} }, -- reboot From owner-svn-src-head@freebsd.org Fri Feb 16 05:17: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 C66DDF15ED2; Fri, 16 Feb 2018 05:17:01 +0000 (UTC) (envelope-from anish@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7873F853BC; Fri, 16 Feb 2018 05:17:01 +0000 (UTC) (envelope-from anish@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F0F0102D; Fri, 16 Feb 2018 05:17:01 +0000 (UTC) (envelope-from anish@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1G5H1nZ047282; Fri, 16 Feb 2018 05:17:01 GMT (envelope-from anish@FreeBSD.org) Received: (from anish@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G5H1XH047278; Fri, 16 Feb 2018 05:17:01 GMT (envelope-from anish@FreeBSD.org) Message-Id: <201802160517.w1G5H1XH047278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: anish set sender to anish@FreeBSD.org using -f From: Anish Gupta Date: Fri, 16 Feb 2018 05:17:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329360 - in head/sys: amd64/vmm/amd contrib/dev/acpica/include X-SVN-Group: head X-SVN-Commit-Author: anish X-SVN-Commit-Paths: in head/sys: amd64/vmm/amd contrib/dev/acpica/include X-SVN-Commit-Revision: 329360 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 05:17:02 -0000 Author: anish Date: Fri Feb 16 05:17:00 2018 New Revision: 329360 URL: https://svnweb.freebsd.org/changeset/base/329360 Log: This change fixes duplicate detection of same IOMMU/AMD-Vi device for Ryzen with EFR support. IVRS can have entry of type legacy and non-legacy present at same time for same AMD-Vi device. ivhd driver will ignore legacy if new IVHD type is present as specified in AMD-Vi specification. Earlier both of IVHD entries used and two ivhd devices were created. Add support for new IVHD type 0x11 and 0x40 in ACPI. Create new struct of type acpi_ivrs_hardware_new for these new type of IVHDs. Legacy type 0x10 will continue to use acpi_ivrs_hardware. Reviewed by: avg Approved by: grehan Differential Revision:https://reviews.freebsd.org/D13160 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/contrib/dev/acpica/include/actbl2.h Modified: head/sys/amd64/vmm/amd/amdvi_hw.c ============================================================================== --- head/sys/amd64/vmm/amd/amdvi_hw.c Fri Feb 16 04:59:21 2018 (r329359) +++ head/sys/amd64/vmm/amd/amdvi_hw.c Fri Feb 16 05:17:00 2018 (r329360) @@ -745,23 +745,8 @@ amdvi_print_pci_cap(device_t dev) softc->pci_cap = cap >> 24; device_printf(softc->dev, "PCI cap 0x%x@0x%x feature:%b\n", cap, off, softc->pci_cap, - "\020\001IOTLB\002HT\003NPCache\004EFR"); + "\20\1IOTLB\2HT\3NPCache\4EFR\5CapExt"); - /* IOMMU spec Rev 2.0, section 3.7.2.1 */ - softc->pci_efr = softc->ctrl->ex_feature; - if (softc->pci_efr) { - device_printf(softc->dev, "PCI extended Feature:%b\n", - (int)softc->pci_efr, - "\020\001PreFSup\002PPRSup\003XTSup\004NXSup\006IASup" - "\007GASup\008HESup\009PCSup"); - device_printf(softc->dev, - "PCI HATS = %d GATS = %d GLXSup = %d, max PASID: 0x%x ", - (int)((softc->pci_efr >> 10) & 0x3), - (int)((softc->pci_efr >> 12) & 0x3), - (int)((softc->pci_efr >> 14) & 0x3), - (int)((softc->pci_efr >> 32) & 0x1F) + 1); - } - return (0); } @@ -1040,7 +1025,7 @@ amdvi_init(void) } if (!amdvi_enable_user && ivhd_count) { printf("bhyve: Found %d AMD-Vi/IOMMU device(s), " - "use hw.vmm.amdvi_enable=1 to enable pass-through.\n", + "use hw.vmm.amdvi.enable=1 to enable pass-through.\n", ivhd_count); return (EINVAL); } @@ -1315,40 +1300,41 @@ static void amdvi_set_dte(struct amdvi_domain *domain, uint16_t devid, bool enable) { struct amdvi_softc *softc; - struct amdvi_dte temp; + struct amdvi_dte* temp; + KASSERT(domain, ("domain is NULL for pci_rid:0x%x\n", devid)); + softc = amdvi_find_iommu(devid); KASSERT(softc, ("softc is NULL for pci_rid:0x%x\n", devid)); - memset(&temp, 0, sizeof(struct amdvi_dte)); + temp = &amdvi_dte[devid]; #ifdef AMDVI_ATS_ENABLE /* If IOMMU and device support IOTLB, enable it. */ if (amdvi_dev_support_iotlb(softc, devid) && softc->iotlb) - temp.iotlb_enable = 1; + temp->iotlb_enable = 1; #endif /* Avoid duplicate I/O faults. */ - temp.sup_second_io_fault = 1; - temp.sup_all_io_fault = amdvi_disable_io_fault; + temp->sup_second_io_fault = 1; + temp->sup_all_io_fault = amdvi_disable_io_fault; - temp.dt_valid = 1; - temp.domain_id = domain->id; + temp->dt_valid = 1; + temp->domain_id = domain->id; if (enable) { if (domain->ptp) { - temp.pt_base = vtophys(domain->ptp) >> 12; - temp.pt_level = amdvi_ptp_level; + temp->pt_base = vtophys(domain->ptp) >> 12; + temp->pt_level = amdvi_ptp_level; } /* * XXX: Page table valid[TV] bit must be set even if host domain * page tables are not enabled. */ - temp.pt_valid = 1; - temp.read_allow = 1; - temp.write_allow = 1; + temp->pt_valid = 1; + temp->read_allow = 1; + temp->write_allow = 1; } - amdvi_dte[devid] = temp; } static void Modified: head/sys/amd64/vmm/amd/amdvi_priv.h ============================================================================== --- head/sys/amd64/vmm/amd/amdvi_priv.h Fri Feb 16 04:59:21 2018 (r329359) +++ head/sys/amd64/vmm/amd/amdvi_priv.h Fri Feb 16 05:17:00 2018 (r329360) @@ -29,6 +29,8 @@ #ifndef _AMDVI_PRIV_H_ #define _AMDVI_PRIV_H_ +#include + #define BIT(n) (1ULL << (n)) /* Return value of bits[n:m] where n and (n >= ) m are bit positions. */ #define REG_BITS(x, n, m) (((x) >> (m)) & \ @@ -358,6 +360,7 @@ struct amdvi_domain { struct amdvi_softc { struct amdvi_ctrl *ctrl; /* Control area. */ device_t dev; /* IOMMU device. */ + enum AcpiIvrsType ivhd_type; /* IOMMU IVHD type 0x10/0x11 or 0x40 */ bool iotlb; /* IOTLB supported by IOMMU */ struct amdvi_cmd *cmd; /* Command descriptor area. */ int cmd_max; /* Max number of commands. */ @@ -370,11 +373,11 @@ struct amdvi_softc { int event_rid; /* ACPI various flags. */ uint32_t ivhd_flag; /* ACPI IVHD flag. */ - uint32_t ivhd_efr; /* ACPI v1 Reserved or v2 EFR . */ + uint32_t ivhd_feature; /* ACPI v1 Reserved or v2 attribute. */ + uint64_t ext_feature; /* IVHD EFR */ /* PCI related. */ uint16_t cap_off; /* PCI Capability offset. */ uint8_t pci_cap; /* PCI capability. */ - uint64_t pci_efr; /* PCI EFR for rev2.0 */ uint16_t pci_seg; /* IOMMU PCI domain/segment. */ uint16_t pci_rid; /* PCI BDF of IOMMU */ /* Device range under this IOMMU. */ Modified: head/sys/amd64/vmm/amd/ivrs_drv.c ============================================================================== --- head/sys/amd64/vmm/amd/ivrs_drv.c Fri Feb 16 04:59:21 2018 (r329359) +++ head/sys/amd64/vmm/amd/ivrs_drv.c Fri Feb 16 05:17:00 2018 (r329360) @@ -47,12 +47,16 @@ __FBSDID("$FreeBSD$"); #include "amdvi_priv.h" device_t *ivhd_devs; /* IVHD or AMD-Vi device list. */ -int ivhd_count; /* Number of IVHD or AMD-Vi devices. */ +int ivhd_count; /* Number of IVHD header. */ +/* + * Cached IVHD header list. + * Single entry for each IVHD, filtered the legacy one. + */ +ACPI_IVRS_HARDWARE *ivhd_hdrs[10]; extern int amdvi_ptp_level; /* Page table levels. */ -typedef int (*ivhd_iter_t)(ACPI_IVRS_HEADER * ptr, void *arg); - +typedef int (*ivhd_iter_t)(ACPI_IVRS_HEADER *ptr, void *arg); /* * Iterate IVRS table for IVHD and IVMD device type. */ @@ -107,14 +111,19 @@ ivrs_hdr_iterate_tbl(ivhd_iter_t iter, void *arg) } } -static int +static bool ivrs_is_ivhd(UINT8 type) { - if ((type == ACPI_IVRS_TYPE_HARDWARE) || (type == 0x11) || (type == 0x40)) - return (1); + switch(type) { + case ACPI_IVRS_TYPE_HARDWARE: + case ACPI_IVRS_TYPE_HARDWARE_EXT1: + case ACPI_IVRS_TYPE_HARDWARE_EXT2: + return (true); - return (0); + default: + return (false); + } } /* Count the number of AMD-Vi devices in the system. */ @@ -184,7 +193,7 @@ ivhd_dev_add_entry(struct amdvi_softc *softc, uint32_t * Record device attributes as suggested by BIOS. */ static int -ivhd_dev_parse(ACPI_IVRS_HARDWARE * ivhd, struct amdvi_softc *softc) +ivhd_dev_parse(ACPI_IVRS_HARDWARE* ivhd, struct amdvi_softc *softc) { ACPI_IVRS_DE_HEADER *de; uint8_t *p, *end; @@ -196,11 +205,26 @@ ivhd_dev_parse(ACPI_IVRS_HARDWARE * ivhd, struct amdvi softc->start_dev_rid = ~0; softc->end_dev_rid = 0; - /* - * XXX The following actually depends on Header.Type and - * is only true for 0x10. - */ - p = (uint8_t *)ivhd + sizeof(ACPI_IVRS_HARDWARE); + switch (ivhd->Header.Type) { + case ACPI_IVRS_TYPE_HARDWARE_EXT1: + case ACPI_IVRS_TYPE_HARDWARE_EXT2: + p = (uint8_t *)ivhd + sizeof(ACPI_IVRS_HARDWARE_NEW); + de = (ACPI_IVRS_DE_HEADER *) ((uint8_t *)ivhd + + sizeof(ACPI_IVRS_HARDWARE_NEW)); + break; + + case ACPI_IVRS_TYPE_HARDWARE: + p = (uint8_t *)ivhd + sizeof(ACPI_IVRS_HARDWARE); + de = (ACPI_IVRS_DE_HEADER *) ((uint8_t *)ivhd + + sizeof(ACPI_IVRS_HARDWARE)); + break; + + default: + device_printf(softc->dev, + "unknown type: 0x%x\n", ivhd->Header.Type); + return (-1); + } + end = (uint8_t *)ivhd + ivhd->Header.Length; while (p < end) { @@ -285,14 +309,30 @@ ivhd_dev_parse(ACPI_IVRS_HARDWARE * ivhd, struct amdvi return (0); } +static bool +ivhd_is_newer(ACPI_IVRS_HEADER *old, ACPI_IVRS_HEADER *new) +{ + /* + * Newer IVRS header type take precedence. + */ + if ((old->DeviceId == new->DeviceId) && + (old->Type == ACPI_IVRS_TYPE_HARDWARE) && + ((new->Type == ACPI_IVRS_TYPE_HARDWARE_EXT1) || + (new->Type == ACPI_IVRS_TYPE_HARDWARE_EXT1))) { + return (true); + } + + return (false); +} + static void ivhd_identify(driver_t *driver, device_t parent) { ACPI_TABLE_IVRS *ivrs; ACPI_IVRS_HARDWARE *ivhd; ACPI_STATUS status; - uint32_t info; int i, count = 0; + uint32_t ivrs_ivinfo; if (acpi_disabled("ivhd")) return; @@ -305,25 +345,41 @@ ivhd_identify(driver_t *driver, device_t parent) return; } - info = ivrs->Info; - printf("AMD-Vi IVRS VAsize = %d PAsize = %d GVAsize = %d flags:%b\n", - REG_BITS(info, 21, 15), REG_BITS(info, 14, 8), - REG_BITS(info, 7, 5), REG_BITS(info, 22, 22), - "\020\001HtAtsResv"); + ivrs_ivinfo = ivrs->Info; + printf("AMD-Vi: IVRS Info VAsize = %d PAsize = %d GVAsize = %d" + " flags:%b\n", + REG_BITS(ivrs_ivinfo, 21, 15), REG_BITS(ivrs_ivinfo, 14, 8), + REG_BITS(ivrs_ivinfo, 7, 5), REG_BITS(ivrs_ivinfo, 22, 22), + "\020\001EFRSup"); ivrs_hdr_iterate_tbl(ivhd_count_iter, NULL); if (!ivhd_count) return; - ivhd_devs = malloc(sizeof(device_t) * ivhd_count, M_DEVBUF, - M_WAITOK | M_ZERO); for (i = 0; i < ivhd_count; i++) { ivhd = ivhd_find_by_index(i); - if (ivhd == NULL) { - printf("Can't find IVHD entry%d\n", i); - continue; + KASSERT(ivhd, ("ivhd%d is NULL\n", i)); + ivhd_hdrs[i] = ivhd; + } + + /* + * Scan for presence of legacy and non-legacy device type + * for same AMD-Vi device and override the old one. + */ + for (i = ivhd_count - 1 ; i > 0 ; i--){ + if (ivhd_is_newer(&ivhd_hdrs[i-1]->Header, + &ivhd_hdrs[i]->Header)) { + ivhd_hdrs[i-1] = ivhd_hdrs[i]; + ivhd_count--; } + } + ivhd_devs = malloc(sizeof(device_t) * ivhd_count, M_DEVBUF, + M_WAITOK | M_ZERO); + for (i = 0; i < ivhd_count; i++) { + ivhd = ivhd_hdrs[i]; + KASSERT(ivhd, ("ivhd%d is NULL\n", i)); + /* * Use a high order to ensure that this driver is probed after * the Host-PCI bridge and the root PCI bus. @@ -338,7 +394,7 @@ ivhd_identify(driver_t *driver, device_t parent) if (ivhd_devs[i] == NULL) { ivhd_devs[i] = device_find_child(parent, "ivhd", i); if (ivhd_devs[i] == NULL) { - printf("AMD-Vi: cant find AMD-Vi dev%d\n", i); + printf("AMD-Vi: cant find ivhd%d\n", i); break; } } @@ -354,14 +410,169 @@ ivhd_identify(driver_t *driver, device_t parent) static int ivhd_probe(device_t dev) { + ACPI_IVRS_HARDWARE *ivhd; + int unit; if (acpi_get_handle(dev) != NULL) return (ENXIO); - device_set_desc(dev, "AMD-Vi/IOMMU or ivhd"); + unit = device_get_unit(dev); + KASSERT((unit < ivhd_count), + ("ivhd unit %d > count %d", unit, ivhd_count)); + ivhd = ivhd_hdrs[unit]; + KASSERT(ivhd, ("ivhd is NULL")); + + if (ivhd->Header.Type == ACPI_IVRS_TYPE_HARDWARE) + device_set_desc(dev, "AMD-Vi/IOMMU ivhd"); + else + device_set_desc(dev, "AMD-Vi/IOMMU ivhd with EFR"); + return (BUS_PROBE_NOWILDCARD); } +static void +ivhd_print_flag(device_t dev, enum AcpiIvrsType ivhd_type, uint8_t flag) +{ + /* + * IVHD lgeacy type has two extra high bits in flag which has + * been moved to EFR for non-legacy device. + */ + switch (ivhd_type) { + case ACPI_IVRS_TYPE_HARDWARE: + device_printf(dev, "Flag:%b\n", flag, + "\020" + "\001HtTunEn" + "\002PassPW" + "\003ResPassPW" + "\004Isoc" + "\005IotlbSup" + "\006Coherent" + "\007PreFSup" + "\008PPRSup"); + break; + + case ACPI_IVRS_TYPE_HARDWARE_EXT1: + case ACPI_IVRS_TYPE_HARDWARE_EXT2: + device_printf(dev, "Flag:%b\n", flag, + "\020" + "\001HtTunEn" + "\002PassPW" + "\003ResPassPW" + "\004Isoc" + "\005IotlbSup" + "\006Coherent"); + break; + + default: + device_printf(dev, "Can't decode flag of ivhd type :0x%x\n", + ivhd_type); + break; + } +} + +/* + * Feature in legacy IVHD type(0x10) and attribute in newer type(0x11 and 0x40). + */ +static void +ivhd_print_feature(device_t dev, enum AcpiIvrsType ivhd_type, uint32_t feature) +{ + switch (ivhd_type) { + case ACPI_IVRS_TYPE_HARDWARE: + device_printf(dev, "Features(type:0x%x) HATS = %d GATS = %d" + " MsiNumPPR = %d PNBanks= %d PNCounters= %d\n", + ivhd_type, + REG_BITS(feature, 31, 30), + REG_BITS(feature, 29, 28), + REG_BITS(feature, 27, 23), + REG_BITS(feature, 22, 17), + REG_BITS(feature, 16, 13)); + device_printf(dev, "max PASID = %d GLXSup = %d Feature:%b\n", + REG_BITS(feature, 12, 8), + REG_BITS(feature, 4, 3), + feature, + "\020" + "\002NXSup" + "\003GTSup" + "\004" + "\005IASup" + "\006GASup" + "\007HESup"); + break; + + /* Fewer features or attributes are reported in non-legacy type. */ + case ACPI_IVRS_TYPE_HARDWARE_EXT1: + case ACPI_IVRS_TYPE_HARDWARE_EXT2: + device_printf(dev, "Features(type:0x%x) MsiNumPPR = %d" + " PNBanks= %d PNCounters= %d\n", + ivhd_type, + REG_BITS(feature, 27, 23), + REG_BITS(feature, 22, 17), + REG_BITS(feature, 16, 13)); + break; + + default: /* Other ivhd type features are not decoded. */ + device_printf(dev, "Can't decode ivhd type :0x%x\n", ivhd_type); + } +} + +/* Print extended features of IOMMU. */ +static void +ivhd_print_ext_feature(device_t dev, uint64_t ext_feature) +{ + uint32_t ext_low, ext_high; + + if (!ext_feature) + return; + + ext_low = ext_feature; + device_printf(dev, "Extended features[31:0]:%b " + "HATS = 0x%x GATS = 0x%x " + "GLXSup = 0x%x SmiFSup = 0x%x SmiFRC = 0x%x " + "GAMSup = 0x%x DualPortLogSup = 0x%x DualEventLogSup = 0x%x\n", + (int)ext_low, + "\020" + "\001PreFSup" + "\002PPRSup" + "\003" + "\004NXSup" + "\005GTSup" + "\006" + "\007IASup" + "\008GASup" + "\009HESup" + "\010PCSup", + REG_BITS(ext_low, 11, 10), + REG_BITS(ext_low, 13, 12), + REG_BITS(ext_low, 15, 14), + REG_BITS(ext_low, 17, 16), + REG_BITS(ext_low, 20, 18), + REG_BITS(ext_low, 23, 21), + REG_BITS(ext_low, 25, 24), + REG_BITS(ext_low, 29, 28)); + + ext_high = ext_feature >> 32; + device_printf(dev, "Extended features[62:32]:%b " + "Max PASID: 0x%x DevTblSegSup = 0x%x " + "MarcSup = 0x%x\n", + (int)(ext_high), + "\020" + "\006USSup" + "\009PprOvrflwEarlySup" + "\010PPRAutoRspSup" + "\013BlKStopMrkSup" + "\014PerfOptSup" + "\015MsiCapMmioSup" + "\017GIOSup" + "\018HASup" + "\019EPHSup" + "\020AttrFWSup" + "\021HDSup" + "\023InvIotlbSup", + REG_BITS(ext_high, 5, 0), + REG_BITS(ext_high, 8, 7), + REG_BITS(ext_high, 11, 10)); +} + static int ivhd_print_cap(struct amdvi_softc *softc, ACPI_IVRS_HARDWARE * ivhd) { @@ -369,41 +580,23 @@ ivhd_print_cap(struct amdvi_softc *softc, ACPI_IVRS_HA int max_ptp_level; dev = softc->dev; - device_printf(dev, "Flag:%b\n", softc->ivhd_flag, - "\020\001HtTunEn\002PassPW\003ResPassPW\004Isoc\005IotlbSup" - "\006Coherent\007PreFSup\008PPRSup"); - /* - * If no extended feature[EFR], its rev1 with maximum paging level as 7. - */ + + ivhd_print_flag(dev, softc->ivhd_type, softc->ivhd_flag); + ivhd_print_feature(dev, softc->ivhd_type, softc->ivhd_feature); + ivhd_print_ext_feature(dev, softc->ext_feature); max_ptp_level = 7; - if (softc->ivhd_efr) { - device_printf(dev, "EFR HATS = %d GATS = %d GLXSup = %d " - "MsiNumPr = %d PNBanks= %d PNCounters= %d\n" - "max PASID = %d EFR: %b \n", - REG_BITS(softc->ivhd_efr, 31, 30), - REG_BITS(softc->ivhd_efr, 29, 28), - REG_BITS(softc->ivhd_efr, 4, 3), - REG_BITS(softc->ivhd_efr, 27, 23), - REG_BITS(softc->ivhd_efr, 22, 17), - REG_BITS(softc->ivhd_efr, 16, 13), - REG_BITS(softc->ivhd_efr, 12, 8), - softc->ivhd_efr, "\020\001XTSup\002NXSup\003GTSup\005IASup" - "\006GASup\007HESup\008PPRSup"); - - max_ptp_level = REG_BITS(softc->ivhd_efr, 31, 30) + 4; - } - /* Make sure device support minimum page level as requested by user. */ if (max_ptp_level < amdvi_ptp_level) { - device_printf(dev, "Insufficient PTP level:%d\n", - max_ptp_level); + device_printf(dev, "insufficient PTP level:%d\n", + max_ptp_level); return (EINVAL); + } else { + device_printf(softc->dev, "supported paging level:%d, will use only: %d\n", + max_ptp_level, amdvi_ptp_level); } - device_printf(softc->dev, "max supported paging level:%d restricting to: %d\n", - max_ptp_level, amdvi_ptp_level); - device_printf(softc->dev, "device supported range " - "[0x%x - 0x%x]\n", softc->start_dev_rid, softc->end_dev_rid); + device_printf(softc->dev, "device range: 0x%x - 0x%x\n", + softc->start_dev_rid, softc->end_dev_rid); return (0); } @@ -412,25 +605,32 @@ static int ivhd_attach(device_t dev) { ACPI_IVRS_HARDWARE *ivhd; + ACPI_IVRS_HARDWARE_NEW *ivhd1; struct amdvi_softc *softc; int status, unit; unit = device_get_unit(dev); + KASSERT((unit < ivhd_count), + ("ivhd unit %d > count %d", unit, ivhd_count)); /* Make sure its same device for which attach is called. */ - if (ivhd_devs[unit] != dev) - panic("Not same device old %p new %p", ivhd_devs[unit], dev); + KASSERT((ivhd_devs[unit] == dev), + ("Not same device old %p new %p", ivhd_devs[unit], dev)); softc = device_get_softc(dev); softc->dev = dev; - ivhd = ivhd_find_by_index(unit); - if (ivhd == NULL) - return (EINVAL); + ivhd = ivhd_hdrs[unit]; + KASSERT(ivhd, ("ivhd is NULL")); + softc->ivhd_type = ivhd->Header.Type; softc->pci_seg = ivhd->PciSegmentGroup; softc->pci_rid = ivhd->Header.DeviceId; softc->ivhd_flag = ivhd->Header.Flags; - softc->ivhd_efr = ivhd->Reserved; /* + * On lgeacy IVHD type(0x10), it is documented as feature + * but in newer type it is attribute. + */ + softc->ivhd_feature = ivhd->Reserved; + /* * PCI capability has more capabilities that are not part of IVRS. */ softc->cap_off = ivhd->CapabilityOffset; @@ -439,6 +639,15 @@ ivhd_attach(device_t dev) /* IVHD Info bit[4:0] is event MSI/X number. */ softc->event_msix = ivhd->Info & 0x1F; #endif + switch (ivhd->Header.Type) { + case ACPI_IVRS_TYPE_HARDWARE_EXT1: + case ACPI_IVRS_TYPE_HARDWARE_EXT2: + ivhd1 = (ACPI_IVRS_HARDWARE_NEW *)ivhd; + softc->ext_feature = ivhd1->ExtFR; + break; + + } + softc->ctrl = (struct amdvi_ctrl *) PHYS_TO_DMAP(ivhd->BaseAddress); status = ivhd_dev_parse(ivhd, softc); if (status != 0) { Modified: head/sys/contrib/dev/acpica/include/actbl2.h ============================================================================== --- head/sys/contrib/dev/acpica/include/actbl2.h Fri Feb 16 04:59:21 2018 (r329359) +++ head/sys/contrib/dev/acpica/include/actbl2.h Fri Feb 16 05:17:00 2018 (r329360) @@ -444,6 +444,8 @@ typedef struct acpi_ivrs_header enum AcpiIvrsType { ACPI_IVRS_TYPE_HARDWARE = 0x10, + ACPI_IVRS_TYPE_HARDWARE_EXT1 = 0x11, + ACPI_IVRS_TYPE_HARDWARE_EXT2 = 0x40, ACPI_IVRS_TYPE_MEMORY1 = 0x20, ACPI_IVRS_TYPE_MEMORY2 = 0x21, ACPI_IVRS_TYPE_MEMORY3 = 0x22 @@ -481,6 +483,21 @@ typedef struct acpi_ivrs_hardware UINT32 Reserved; } ACPI_IVRS_HARDWARE; + +/* 0x11 and 0x40: I/O Virtualization Hardware Definition Block (IVHD) */ + +typedef struct acpi_ivrs_hardware_new +{ + ACPI_IVRS_HEADER Header; + UINT16 CapabilityOffset; /* Offset for IOMMU control fields */ + UINT64 BaseAddress; /* IOMMU control registers */ + UINT16 PciSegmentGroup; + UINT16 Info; /* MSI number and unit ID */ + UINT32 Attr; /* IOMMU Feature */ + UINT64 ExtFR; /* IOMMU Extended Feature */ + UINT64 Reserved; /* v1 feature or v2 attribute */ + +} ACPI_IVRS_HARDWARE_NEW; /* Masks for Info field above */ From owner-svn-src-head@freebsd.org Fri Feb 16 05:48: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 02D6FF17F83; Fri, 16 Feb 2018 05:48:46 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AAB4A866F7; Fri, 16 Feb 2018 05:48:45 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A18D1151F; Fri, 16 Feb 2018 05:48:45 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1G5mjOY062434; Fri, 16 Feb 2018 05:48:45 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G5mjGo062432; Fri, 16 Feb 2018 05:48:45 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201802160548.w1G5mjGo062432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 16 Feb 2018 05:48:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329361 - head/lib/libc/string X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/lib/libc/string X-SVN-Commit-Revision: 329361 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 05:48:46 -0000 Author: cy Date: Fri Feb 16 05:48:45 2018 New Revision: 329361 URL: https://svnweb.freebsd.org/changeset/base/329361 Log: Document memset_s(3). memset_s(3) is defined in C11 standard (ISO/IEC 9899:2011) K.3.7.4.1 The memset_s function (p: 621-622) Fix memset(3) portion of the man page by replacing the first argument (destination) "b" with "dest", which is more descriptive than "b". This also makes it consistent with the term used in the memset_s() portion of the man page. See also http://en.cppreference.com/w/c/string/byte/memset. Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D13682 Modified: head/lib/libc/string/Makefile.inc head/lib/libc/string/memset.3 Modified: head/lib/libc/string/Makefile.inc ============================================================================== --- head/lib/libc/string/Makefile.inc Fri Feb 16 05:17:00 2018 (r329360) +++ head/lib/libc/string/Makefile.inc Fri Feb 16 05:48:45 2018 (r329361) @@ -50,6 +50,7 @@ MLINKS+=ffs.3 ffsl.3 \ ffs.3 flsll.3 MLINKS+=index.3 rindex.3 MLINKS+=memchr.3 memrchr.3 +MLINKS+=memset.3 memset_s.3 MLINKS+=strcasecmp.3 strncasecmp.3 \ strcasecmp.3 strcasecmp_l.3 \ strcasecmp.3 strncasecmp_l.3 Modified: head/lib/libc/string/memset.3 ============================================================================== --- head/lib/libc/string/memset.3 Fri Feb 16 05:17:00 2018 (r329360) +++ head/lib/libc/string/memset.3 Fri Feb 16 05:48:45 2018 (r329361) @@ -32,7 +32,7 @@ .\" @(#)memset.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd February 15, 2018 .Dt MEMSET 3 .Os .Sh NAME @@ -43,7 +43,9 @@ .Sh SYNOPSIS .In string.h .Ft void * -.Fn memset "void *b" "int c" "size_t len" +.Fn memset "void *dest" "int c" "size_t len" +.Ft errno_t +.Fn memset_s "void *dest" "rsize_t destsz" "int c" "rsize_t len" .Sh DESCRIPTION The .Fn memset @@ -55,13 +57,66 @@ bytes of value (converted to an .Vt "unsigned char" ) to the string -.Fa b . +.Fa dest . +Undefined behaviour from +.Fn memset , +resulting from storage overflow, will occur if +.Fa len +is greater than the the length of buffer +.Fa dest . +The behaviour is also undefined if +.Fa dest +is an invalid pointer. +.Pp +The +.Fn memset_s +function behaves the same as +.Fn memset +except that an error is returned and the currently registered +runtime-constraint handler is called if +.Fa dest +is a null pointer, +.Fa destsz +or +.Fa len +is greater than +.Dv RSIZE_MAX , +or +.Sp +.Fa len +is greater than +.Fa destsz +(buffer overflow would occur). +The runtime-constraint handler is called first and may not return. +If it does return, an error is returned to the caller. +Like +.Xr explicit_bzero 3 , +.Fn memset_s +is not removed through Dead Store Elimination (DSE), making it useful for +clearing sensitve data. +In contrast +.Fn memset +function +may be optimized away if the object modified by the function is not accessed +again. +To clear memory that will not subsequently be accessed it is advised to use +.Fn memset_s +instead of +.Fn memset . +For instance, a buffer containing a password should be cleared with +.Fn memset_s +before +.Xr free 3 . .Sh RETURN VALUES The .Fn memset function returns its first argument. +The +.Fn memset_s +function returns zero on success, non-zero on error. .Sh SEE ALSO .Xr bzero 3 , +.Xr explicit_bzero 3 , .Xr swab 3 , .Xr wmemset 3 .Sh STANDARDS @@ -70,3 +125,7 @@ The function conforms to .St -isoC . +.Fn memset_s +conforms to: +.St -isoC-2011 +K.3.7.4.1. From owner-svn-src-head@freebsd.org Fri Feb 16 06:51: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 62083F1A9A2; Fri, 16 Feb 2018 06:51:40 +0000 (UTC) (envelope-from silby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 13A8A68D67; Fri, 16 Feb 2018 06:51:40 +0000 (UTC) (envelope-from silby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E83D1F1C; Fri, 16 Feb 2018 06:51:40 +0000 (UTC) (envelope-from silby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1G6pd0O093347; Fri, 16 Feb 2018 06:51:39 GMT (envelope-from silby@FreeBSD.org) Received: (from silby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G6pdoQ093346; Fri, 16 Feb 2018 06:51:39 GMT (envelope-from silby@FreeBSD.org) Message-Id: <201802160651.w1G6pdoQ093346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: silby set sender to silby@FreeBSD.org using -f From: Mike Silbersack Date: Fri, 16 Feb 2018 06:51:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329362 - head/sbin/savecore X-SVN-Group: head X-SVN-Commit-Author: silby X-SVN-Commit-Paths: head/sbin/savecore X-SVN-Commit-Revision: 329362 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 06:51:40 -0000 Author: silby Date: Fri Feb 16 06:51:39 2018 New Revision: 329362 URL: https://svnweb.freebsd.org/changeset/base/329362 Log: Prevent savecore from reading bounds from the current directory. Rev 244218 removed the requirement that you provide a dump directory when checking if there is a coredump ready to be written. That had the side-effect of causing the bounds file to be read from the current working directory instead of the dump directory. As the bounds file is irrelevant when just checking, the simplest fix is to not read the bounds file when checking. Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D14383 Modified: head/sbin/savecore/savecore.c Modified: head/sbin/savecore/savecore.c ============================================================================== --- head/sbin/savecore/savecore.c Fri Feb 16 05:48:45 2018 (r329361) +++ head/sbin/savecore/savecore.c Fri Feb 16 06:51:39 2018 (r329362) @@ -172,6 +172,13 @@ getbounds(void) char buf[6]; int ret; + /* + * If we are just checking, then we haven't done a chdir to the dump + * directory and we should not try to read a bounds file. + */ + if (checkfor) + return (0); + ret = 0; if ((fp = fopen("bounds", "r")) == NULL) { From owner-svn-src-head@freebsd.org Fri Feb 16 06:59: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 DF415F1B0E0; Fri, 16 Feb 2018 06:59:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 945996923E; Fri, 16 Feb 2018 06:59:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F0B8206A; Fri, 16 Feb 2018 06:59:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1G6xZFH096739; Fri, 16 Feb 2018 06:59:35 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G6xZWg096736; Fri, 16 Feb 2018 06:59:35 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802160659.w1G6xZWg096736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 16 Feb 2018 06:59:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329363 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Commit-Revision: 329363 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 06:59:36 -0000 Author: avg Date: Fri Feb 16 06:59:35 2018 New Revision: 329363 URL: https://svnweb.freebsd.org/changeset/base/329363 Log: read-behind / read-ahead support for zfs_getpages() ZFS caches blocks it reads in its ARC, so in general the optional pages are not as useful as with filesystems that read the data directly into the target pages. But still the optional pages are useful to reduce the number of page faults and associated VM / VFS / ZFS calls. Another case that gets optimized (as a side effect) is paging in from a hole. ZFS DMU does not currently provide a convenient API to check for a hole. Instead it creates a temporary zero-filled block and allows accessing it as if it were a normal data block. Getting multiple pages one by one from a hole results in repeated creation and destruction of the temporary block (and an associated ARC header). Tested with fsx using various supported blocks sizes from 512 bytes to 128 KB and additionally 1 MB. Please note that in illumos and ZoL they do not do the range-locking in the page-in path. This is because ZFS has a double-caching problem between ARC and page cache and that requires zfs_read() and zfs_write() to consult pages in the page cache. So, in those functions they first lock a range and then lock pages corresponding to the range. While in the page-in (and maybe page-out) path they first lock the pages and then would lock the range. So, they would have a deadlock. I believe that FreeBSD does not have that problem, because the page-in deals only with invalid pages while zfs_read() and zfs_write() need to access only valid pages. They do not wait on a busy page unless it's already valid. Reviewed by: kib MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D14263 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Fri Feb 16 06:51:39 2018 (r329362) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Fri Feb 16 06:59:35 2018 (r329363) @@ -1518,6 +1518,188 @@ dmu_write_pages(objset_t *os, uint64_t object, uint64_ dmu_buf_rele_array(dbp, numbufs, FTAG); return (err); } + +int +dmu_read_pages(objset_t *os, uint64_t object, vm_page_t *ma, int count, + int *rbehind, int *rahead, int last_size) +{ + struct sf_buf *sf; + vm_object_t vmobj; + vm_page_t m; + dmu_buf_t **dbp; + dmu_buf_t *db; + caddr_t va; + int numbufs, i; + int bufoff, pgoff, tocpy; + int mi, di; + int err; + + ASSERT3U(ma[0]->pindex + count - 1, ==, ma[count - 1]->pindex); + ASSERT(last_size <= PAGE_SIZE); + + err = dmu_buf_hold_array(os, object, IDX_TO_OFF(ma[0]->pindex), + IDX_TO_OFF(count - 1) + last_size, TRUE, FTAG, &numbufs, &dbp); + if (err != 0) + return (err); + +#ifdef DEBUG + IMPLY(last_size < PAGE_SIZE, *rahead == 0); + if (dbp[0]->db_offset != 0 || numbufs > 1) { + for (i = 0; i < numbufs; i++) { + ASSERT(ISP2(dbp[i]->db_size)); + ASSERT((dbp[i]->db_offset % dbp[i]->db_size) == 0); + ASSERT3U(dbp[i]->db_size, ==, dbp[0]->db_size); + } + } +#endif + + vmobj = ma[0]->object; + zfs_vmobject_wlock(vmobj); + + db = dbp[0]; + for (i = 0; i < *rbehind; i++) { + m = vm_page_grab(vmobj, ma[0]->pindex - 1 - i, + VM_ALLOC_NORMAL | VM_ALLOC_NOWAIT | VM_ALLOC_NOBUSY); + if (m == NULL) + break; + if (m->valid != 0) { + ASSERT3U(m->valid, ==, VM_PAGE_BITS_ALL); + break; + } + ASSERT(m->dirty == 0); + ASSERT(!pmap_page_is_mapped(m)); + + ASSERT(db->db_size > PAGE_SIZE); + bufoff = IDX_TO_OFF(m->pindex) % db->db_size; + va = zfs_map_page(m, &sf); + bcopy((char *)db->db_data + bufoff, va, PAGESIZE); + zfs_unmap_page(sf); + m->valid = VM_PAGE_BITS_ALL; + vm_page_lock(m); + if ((m->busy_lock & VPB_BIT_WAITERS) != 0) + vm_page_activate(m); + else + vm_page_deactivate(m); + vm_page_unlock(m); + } + *rbehind = i; + + bufoff = IDX_TO_OFF(ma[0]->pindex) % db->db_size; + pgoff = 0; + for (mi = 0, di = 0; mi < count && di < numbufs; ) { + if (pgoff == 0) { + m = ma[mi]; + vm_page_assert_xbusied(m); + ASSERT(m->valid == 0); + ASSERT(m->dirty == 0); + ASSERT(!pmap_page_is_mapped(m)); + va = zfs_map_page(m, &sf); + } + if (bufoff == 0) + db = dbp[di]; + + ASSERT3U(IDX_TO_OFF(m->pindex) + pgoff, ==, + db->db_offset + bufoff); + + /* + * We do not need to clamp the copy size by the file + * size as the last block is zero-filled beyond the + * end of file anyway. + */ + tocpy = MIN(db->db_size - bufoff, PAGESIZE - pgoff); + bcopy((char *)db->db_data + bufoff, va + pgoff, tocpy); + + pgoff += tocpy; + ASSERT(pgoff <= PAGESIZE); + if (pgoff == PAGESIZE) { + zfs_unmap_page(sf); + m->valid = VM_PAGE_BITS_ALL; + ASSERT(mi < count); + mi++; + pgoff = 0; + } + + bufoff += tocpy; + ASSERT(bufoff <= db->db_size); + if (bufoff == db->db_size) { + ASSERT(di < numbufs); + di++; + bufoff = 0; + } + } + +#ifdef DEBUG + /* + * Three possibilities: + * - last requested page ends at a buffer boundary and , thus, + * all pages and buffers have been iterated; + * - all requested pages are filled, but the last buffer + * has not been exhausted; + * the read-ahead is possible only in this case; + * - all buffers have been read, but the last page has not been + * fully filled; + * this is only possible if the file has only a single buffer + * with a size that is not a multiple of the page size. + */ + if (mi == count) { + ASSERT(di >= numbufs - 1); + IMPLY(*rahead != 0, di == numbufs - 1); + IMPLY(*rahead != 0, bufoff != 0); + ASSERT(pgoff == 0); + } + if (di == numbufs) { + ASSERT(mi >= count - 1); + ASSERT(*rahead == 0); + IMPLY(pgoff == 0, mi == count); + if (pgoff != 0) { + ASSERT(mi == count - 1); + ASSERT((dbp[0]->db_size & PAGE_MASK) != 0); + } + } +#endif + if (pgoff != 0) { + bzero(va + pgoff, PAGESIZE - pgoff); + zfs_unmap_page(sf); + m->valid = VM_PAGE_BITS_ALL; + } + + for (i = 0; i < *rahead; i++) { + m = vm_page_grab(vmobj, ma[count - 1]->pindex + 1 + i, + VM_ALLOC_NORMAL | VM_ALLOC_NOWAIT | VM_ALLOC_NOBUSY); + if (m == NULL) + break; + if (m->valid != 0) { + ASSERT3U(m->valid, ==, VM_PAGE_BITS_ALL); + break; + } + ASSERT(m->dirty == 0); + ASSERT(!pmap_page_is_mapped(m)); + + ASSERT(db->db_size > PAGE_SIZE); + bufoff = IDX_TO_OFF(m->pindex) % db->db_size; + tocpy = MIN(db->db_size - bufoff, PAGESIZE); + va = zfs_map_page(m, &sf); + bcopy((char *)db->db_data + bufoff, va, tocpy); + if (tocpy < PAGESIZE) { + ASSERT(i == *rahead - 1); + ASSERT((db->db_size & PAGE_MASK) != 0); + bzero(va + tocpy, PAGESIZE - tocpy); + } + zfs_unmap_page(sf); + m->valid = VM_PAGE_BITS_ALL; + vm_page_lock(m); + if ((m->busy_lock & VPB_BIT_WAITERS) != 0) + vm_page_activate(m); + else + vm_page_deactivate(m); + vm_page_unlock(m); + } + *rahead = i; + zfs_vmobject_wunlock(vmobj); + + dmu_buf_rele_array(dbp, numbufs, FTAG); + return (0); +} #endif /* illumos */ #endif /* _KERNEL */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Fri Feb 16 06:51:39 2018 (r329362) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Fri Feb 16 06:59:35 2018 (r329363) @@ -750,6 +750,8 @@ int dmu_write_pages(objset_t *os, uint64_t object, uin #else int dmu_write_pages(objset_t *os, uint64_t object, uint64_t offset, uint64_t size, struct vm_page **ppa, dmu_tx_t *tx); +int dmu_read_pages(objset_t *os, uint64_t object, vm_page_t *ma, int count, + int *rbehind, int *rahead, int last_size); #endif #endif struct arc_buf *dmu_request_arcbuf(dmu_buf_t *handle, int size); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Feb 16 06:51:39 2018 (r329362) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Feb 16 06:59:35 2018 (r329363) @@ -4514,81 +4514,85 @@ zfs_setsecattr(vnode_t *vp, vsecattr_t *vsecp, int fla } static int -zfs_getpages(struct vnode *vp, vm_page_t *m, int count, int *rbehind, +zfs_getpages(struct vnode *vp, vm_page_t *ma, int count, int *rbehind, int *rahead) { znode_t *zp = VTOZ(vp); zfsvfs_t *zfsvfs = zp->z_zfsvfs; objset_t *os = zp->z_zfsvfs->z_os; - vm_page_t mlast; + rl_t *rl; vm_object_t object; - caddr_t va; - struct sf_buf *sf; - off_t startoff, endoff; - int i, error; - vm_pindex_t reqstart, reqend; - int lsize, size; + off_t start, end, obj_size; + uint_t blksz; + int pgsin_b, pgsin_a; + int error; - object = m[0]->object; - error = 0; - ZFS_ENTER(zfsvfs); ZFS_VERIFY_ZP(zp); - zfs_vmobject_wlock(object); - if (m[count - 1]->valid != 0 && --count == 0) { - zfs_vmobject_wunlock(object); - goto out; + start = IDX_TO_OFF(ma[0]->pindex); + end = IDX_TO_OFF(ma[count - 1]->pindex + 1); + + /* + * Lock a range covering all required and optional pages. + * Note that we need to handle the case of the block size growing. + */ + for (;;) { + blksz = zp->z_blksz; + rl = zfs_range_lock(zp, rounddown(start, blksz), + roundup(end, blksz) - rounddown(start, blksz), RL_READER); + if (blksz == zp->z_blksz) + break; + zfs_range_unlock(rl); } - mlast = m[count - 1]; - - if (IDX_TO_OFF(mlast->pindex) >= - object->un_pager.vnp.vnp_size) { - zfs_vmobject_wunlock(object); + object = ma[0]->object; + zfs_vmobject_wlock(object); + obj_size = object->un_pager.vnp.vnp_size; + zfs_vmobject_wunlock(object); + if (IDX_TO_OFF(ma[count - 1]->pindex) >= obj_size) { + zfs_range_unlock(rl); ZFS_EXIT(zfsvfs); return (zfs_vm_pagerret_bad); } - VM_CNT_INC(v_vnodein); - VM_CNT_ADD(v_vnodepgsin, count); + pgsin_b = 0; + if (rbehind != NULL) { + pgsin_b = OFF_TO_IDX(start - rounddown(start, blksz)); + pgsin_b = MIN(*rbehind, pgsin_b); + } - lsize = PAGE_SIZE; - if (IDX_TO_OFF(mlast->pindex) + lsize > object->un_pager.vnp.vnp_size) - lsize = object->un_pager.vnp.vnp_size - - IDX_TO_OFF(mlast->pindex); - zfs_vmobject_wunlock(object); - - for (i = 0; i < count; i++) { - size = PAGE_SIZE; - if (i == count - 1) - size = lsize; - va = zfs_map_page(m[i], &sf); - error = dmu_read(os, zp->z_id, IDX_TO_OFF(m[i]->pindex), - size, va, DMU_READ_PREFETCH); - if (size != PAGE_SIZE) - bzero(va + size, PAGE_SIZE - size); - zfs_unmap_page(sf); - if (error != 0) - goto out; + pgsin_a = 0; + if (rahead != NULL) { + pgsin_a = OFF_TO_IDX(roundup(end, blksz) - end); + if (end + IDX_TO_OFF(pgsin_a) >= obj_size) + pgsin_a = OFF_TO_IDX(round_page(obj_size) - end); + pgsin_a = MIN(*rahead, pgsin_a); } - zfs_vmobject_wlock(object); - for (i = 0; i < count; i++) - m[i]->valid = VM_PAGE_BITS_ALL; - zfs_vmobject_wunlock(object); + /* + * NB: we need to pass the exact byte size of the data that we expect + * to read after accounting for the file size. This is required because + * ZFS will panic if we request DMU to read beyond the end of the last + * allocated block. + */ + error = dmu_read_pages(os, zp->z_id, ma, count, &pgsin_b, &pgsin_a, + MIN(end, obj_size) - (end - PAGE_SIZE)); -out: + zfs_range_unlock(rl); ZFS_ACCESSTIME_STAMP(zfsvfs, zp); ZFS_EXIT(zfsvfs); - if (error == 0) { - if (rbehind) - *rbehind = 0; - if (rahead) - *rahead = 0; - return (zfs_vm_pagerret_ok); - } else + + if (error != 0) return (zfs_vm_pagerret_error); + + VM_CNT_INC(v_vnodein); + VM_CNT_ADD(v_vnodepgsin, count + pgsin_b + pgsin_a); + if (rbehind != NULL) + *rbehind = pgsin_b; + if (rahead != NULL) + *rahead = pgsin_a; + return (zfs_vm_pagerret_ok); } static int From owner-svn-src-head@freebsd.org Fri Feb 16 07:02: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 4C81DF1B3A8; Fri, 16 Feb 2018 07:02:15 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2262C69622; Fri, 16 Feb 2018 07:02:15 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D39321E7; Fri, 16 Feb 2018 07:02:15 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1G72EUk000879; Fri, 16 Feb 2018 07:02:14 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G72E96000878; Fri, 16 Feb 2018 07:02:14 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802160702.w1G72E96000878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 16 Feb 2018 07:02:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329364 - head/sys/amd64/vmm/amd X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/amd64/vmm/amd X-SVN-Commit-Revision: 329364 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 07:02:15 -0000 Author: avg Date: Fri Feb 16 07:02:14 2018 New Revision: 329364 URL: https://svnweb.freebsd.org/changeset/base/329364 Log: move vintr_intercept_enabled under INVARIANTS The function is not used outside of INVARIANTS since r328622. MFC after: 1 week Modified: head/sys/amd64/vmm/amd/svm.c Modified: head/sys/amd64/vmm/amd/svm.c ============================================================================== --- head/sys/amd64/vmm/amd/svm.c Fri Feb 16 06:59:35 2018 (r329363) +++ head/sys/amd64/vmm/amd/svm.c Fri Feb 16 07:02:14 2018 (r329364) @@ -969,6 +969,7 @@ svm_save_intinfo(struct svm_softc *svm_sc, int vcpu) vm_exit_intinfo(svm_sc->vm, vcpu, intinfo); } +#ifdef INVARIANTS static __inline int vintr_intercept_enabled(struct svm_softc *sc, int vcpu) { @@ -976,6 +977,7 @@ vintr_intercept_enabled(struct svm_softc *sc, int vcpu return (svm_get_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_VINTR)); } +#endif static __inline void enable_intr_window_exiting(struct svm_softc *sc, int vcpu) From owner-svn-src-head@freebsd.org Fri Feb 16 07:42: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 79A76F1D818; Fri, 16 Feb 2018 07:42:39 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id E7DE06AD40; Fri, 16 Feb 2018 07:42: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 mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 194E7D6924E; Fri, 16 Feb 2018 18:19:15 +1100 (AEDT) Date: Fri, 16 Feb 2018 18:19:14 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jung-uk Kim cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329340 - head/sys/amd64/include In-Reply-To: <201802152042.w1FKgcDd079601@repo.freebsd.org> Message-ID: <20180216172320.I2471@besplex.bde.org> References: <201802152042.w1FKgcDd079601@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=wANgeDMT7b3Cd_af7SoA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 07:42:39 -0000 On Thu, 15 Feb 2018, Jung-uk Kim wrote: > Log: > Change size of padding to reflect reality. No functional change. > > Discussed with: kib > > Modified: > head/sys/amd64/include/pcpu.h > > Modified: head/sys/amd64/include/pcpu.h > ============================================================================== > --- head/sys/amd64/include/pcpu.h Thu Feb 15 19:49:15 2018 (r329339) > +++ head/sys/amd64/include/pcpu.h Thu Feb 15 20:42:38 2018 (r329340) > @@ -75,7 +75,7 @@ > uint32_t pc_pcid_gen; \ > uint32_t pc_smp_tlb_done; /* TLB op acknowledgement */ \ > uint32_t pc_ibpb_set; \ > - char __pad[216] /* be divisor of PAGE_SIZE \ > + char __pad[224] /* be divisor of PAGE_SIZE \ > after cache alignment */ This still has a bogus struct member name. The prefix for names in this struct is pc_, not __. Names beginning with __ are reserved for the implementation. The implementation might define __pad as . To detect this common naming error. It is also used in sys/efi.h. i386/include/pcpu.h and i386/include/pmc_mdep.h. The object of "be" in the comment is unclear. It is the size of the whole struct, not the MD fields. The padding amount is especially odd for i386 pcpu. It is 445 chars there. This means 445 chars of padding in __pad[] and 3 more chars in unnamed padding. The MD fields have no special alignment, and the padding depends on the MI fields too. With this change, on amd64 sizeof(struct pcpu) is 1K. This indeed divides PAGE_SIZE. I don't see what good this does. __pcpu is only aligned to an 0x200 boundary in my test kernel (struct pcpu is aligned to an 0x40 boundary, and aligning to this boundary is what made the old padding work). On i386, the garbage value of 445 also gives sizeof(struct pcpu) = 1K. __pcpu is only aligned to an 0x80 boundary in my test kernel (struct pcpu has the same CACHE_LINE_SIZE = 0x40 boundary as on amd64). Bruce From owner-svn-src-head@freebsd.org Fri Feb 16 09:30: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 52F9EF00E0B; Fri, 16 Feb 2018 09:30:07 +0000 (UTC) (envelope-from cochard@gmail.com) Received: from mail-pg0-f43.google.com (mail-pg0-f43.google.com [74.125.83.43]) (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 D347E6EEAA; Fri, 16 Feb 2018 09:30:06 +0000 (UTC) (envelope-from cochard@gmail.com) Received: by mail-pg0-f43.google.com with SMTP id g12so2005230pgs.0; Fri, 16 Feb 2018 01:30:06 -0800 (PST) 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=eJ76x4LNpFxLA7oZqF8EuQiBc0xDc7BP5omOo0FV6JM=; b=qdP8OPqojPAlEfnckr3IX7WFlicfp/8jfquNiQPJac7LNh0BKkDf5SwASfSCJt1B7S nCa0/gVDEKVcIHv+X0alR7F0SZcUL1mW2WF+1L+CbdVcIrMPCic+YpD7hhlwdYOGu3ti G0F945dgpW3uG8tbif6auHhl9sN3iFEkEr+JOH2sTIMMbN0UFI8Y8cEv2tsHU03Sn/vS 16c8tnYF/3hU0fYf23artfN5rItA+vcYUKe2PCn3RjmgerU/DR/pdGWjK2utfixXzIb6 LjOSq1yDb3j16+ji1XfOKVf6CH4PeHew8mTbUUqJHt5oMuDSRniuj9NJf4GwU+HFXz1E 8z4A== X-Gm-Message-State: APf1xPC0WpdXGYdAkJ2MT5J4uLkrWZSY3llbtAnZYsP83iv49j3+Br+m M/H5hPZcqhnB0EHqUebuNsrnsRim X-Google-Smtp-Source: AH8x2277uO/CNdjrFev0+blF2Y6sgqBfFQBEXoy0dua1EhJlCk9V6gYD2AQZMo9dGzKjshtbXLwBWA== X-Received: by 10.98.170.15 with SMTP id e15mr5498691pff.207.1518773405472; Fri, 16 Feb 2018 01:30:05 -0800 (PST) Received: from mail-pg0-f51.google.com (mail-pg0-f51.google.com. [74.125.83.51]) by smtp.gmail.com with ESMTPSA id e24sm4548704pfd.122.2018.02.16.01.30.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Feb 2018 01:30:04 -0800 (PST) Received: by mail-pg0-f51.google.com with SMTP id j9so1979903pgp.11; Fri, 16 Feb 2018 01:30:04 -0800 (PST) X-Received: by 10.98.156.71 with SMTP id f68mr5571488pfe.193.1518773404280; Fri, 16 Feb 2018 01:30:04 -0800 (PST) MIME-Version: 1.0 Received: by 10.236.165.9 with HTTP; Fri, 16 Feb 2018 01:29:43 -0800 (PST) In-Reply-To: <201802141807.w1EI7Ror036078@repo.freebsd.org> References: <201802141807.w1EI7Ror036078@repo.freebsd.org> From: =?UTF-8?Q?Olivier_Cochard=2DLabb=C3=A9?= Date: Fri, 16 Feb 2018 10:29:43 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r329269 - head/stand/i386/boot2 To: Benno Rice Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 09:30:07 -0000 On Wed, Feb 14, 2018 at 7:07 PM, Benno Rice wrote: > Author: benno > Date: Wed Feb 14 18:07:27 2018 > New Revision: 329269 > URL: https://svnweb.freebsd.org/changeset/base/329269 > > Log: > Reformat to come significantly closer to style(9). > > Reviewed by: imp, jhibbits > Differential Revision: https://reviews.freebsd.org/D14366 > > Modified: > head/stand/i386/boot2/boot2.c > > =E2=80=8BHi, I've got 2 regressions with this commit on my headless servers (Netgate RCC and PC Engines=E2=80=8B =E2=80=8B). I'm using this configuration file on all my headless servers: [root@netgate]~# cat /boot.config -S115200 -h Now with this commit, I meet a first regression: they all stop to boot automatically at the boot stage. ****************************** /boot/config: -S115200 -h FreeBSD/x86 boot Default: 0:ad(0,a)/boot/loader boot: ******************************* I had to connect to the serial console and to press "enter" here for continuing the boot process. Once the boot process go to the next stage, I meet the second regression: loader menu is correctly displayed, but dmesg messages are no visible on the console. Regards, Olivier From owner-svn-src-head@freebsd.org Fri Feb 16 13:32: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 EF63EF13F93; Fri, 16 Feb 2018 13:32:46 +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 A080479878; Fri, 16 Feb 2018 13:32:46 +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 9B1C1658F; Fri, 16 Feb 2018 13:32:46 +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 w1GDWklj097145; Fri, 16 Feb 2018 13:32:46 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GDWk96097144; Fri, 16 Feb 2018 13:32:46 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201802161332.w1GDWk96097144@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 16 Feb 2018 13:32:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329365 - head/sys/amd64/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/include X-SVN-Commit-Revision: 329365 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 13:32:47 -0000 Author: kib Date: Fri Feb 16 13:32:46 2018 New Revision: 329365 URL: https://svnweb.freebsd.org/changeset/base/329365 Log: Use local symbol for offset. Small global symbols confuse ddb which matches them against small unrelated displacements and makes the disassembly ugly. Reported by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/include/asmacros.h Modified: head/sys/amd64/include/asmacros.h ============================================================================== --- head/sys/amd64/include/asmacros.h Fri Feb 16 07:02:14 2018 (r329364) +++ head/sys/amd64/include/asmacros.h Fri Feb 16 13:32:46 2018 (r329365) @@ -175,11 +175,11 @@ .endm .macro MOVE_STACKS qw - offset=0 + .L.offset=0 .rept \qw - movq offset(%rsp),%rdx - movq %rdx,offset(%rax) - offset=offset+8 + movq .L.offset(%rsp),%rdx + movq %rdx,.L.offset(%rax) + .L.offset=.L.offset+8 .endr .endm From owner-svn-src-head@freebsd.org Fri Feb 16 13:57: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 9CEF7F15F05; Fri, 16 Feb 2018 13:57:44 +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 5168B7ABA0; Fri, 16 Feb 2018 13:57:44 +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 47B1568E4; Fri, 16 Feb 2018 13:57:44 +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 w1GDviq1007941; Fri, 16 Feb 2018 13:57:44 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GDvi7i007940; Fri, 16 Feb 2018 13:57:44 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802161357.w1GDvi7i007940@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 13:57:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329366 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329366 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 13:57:44 -0000 Author: kevans Date: Fri Feb 16 13:57:43 2018 New Revision: 329366 URL: https://svnweb.freebsd.org/changeset/base/329366 Log: stand/lua: Set ACPI's default the proper way (setACPI) Modified: head/stand/lua/core.lua Modified: head/stand/lua/core.lua ============================================================================== --- head/stand/lua/core.lua Fri Feb 16 13:32:46 2018 (r329365) +++ head/stand/lua/core.lua Fri Feb 16 13:57:43 2018 (r329366) @@ -171,5 +171,5 @@ function core.bootserial() return false; end -core.acpi = core.getACPIPresent(false); +core.setACPI(core.getACPIPresent(false)) return core From owner-svn-src-head@freebsd.org Fri Feb 16 13:57: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 073B9F15F55 for ; Fri, 16 Feb 2018 13:57:48 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-lf0-f49.google.com (mail-lf0-f49.google.com [209.85.215.49]) (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 65BAA7ABB1 for ; Fri, 16 Feb 2018 13:57:47 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-lf0-f49.google.com with SMTP id v9so2153143lfa.11 for ; Fri, 16 Feb 2018 05:57:47 -0800 (PST) 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:cc; bh=DpPMD+zBTMsR+GwmYL6zKJRDfoK4MAPCuhZofwJ0ZXk=; b=SwE0z7RCOAhotYQxL0AyV3hWxplHz2FmPaqFexrp+WOpN+4so0lSJRm71LzRjMNhwe or7xH7RyBg94FMbyp/USL7CHhZpZUxlgX2CiTvqr7jDuOaBaorMfp+MOycxCozcz/LMT gj3uWbcbBMyMMb7HCxSlu+V2Fjqwusxh+EH8MuHBAAox8gLVvqfikDNInXzk4bP+p9rF nuFd3SnJeas4DCMRCk2EwHi1auqzilFJG0NizPednCO62hpipUl1bYLke6u17L8N1+s0 RwW2c5P2nZFWWmM83nm3pfcqjQFwWBGI+xWkhfuZe+kO2Gb3g63xqiKwmg7tfAwkIIKT lb1w== X-Gm-Message-State: APf1xPCB07NPlBJ4+Mk0u3ubCg6vHlcgAZKJu2sfxeIxEJgZWAJp0K/t ImlobBJQmPpPE8ijNSL1tg4f25ydMRE= X-Google-Smtp-Source: AH8x227RUoGUod2UZ0PQKVYOR5gQYbbfkD+7hMu0zFKpGJMzUX2qiFJNX/Ux+8f1jbi6PKntAt16bw== X-Received: by 10.46.99.11 with SMTP id x11mr4518702ljb.136.1518789459612; Fri, 16 Feb 2018 05:57:39 -0800 (PST) Received: from mail-lf0-f45.google.com (mail-lf0-f45.google.com. [209.85.215.45]) by smtp.gmail.com with ESMTPSA id h76sm3534095ljh.77.2018.02.16.05.57.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Feb 2018 05:57:39 -0800 (PST) Received: by mail-lf0-f45.google.com with SMTP id x196so4125516lfd.12 for ; Fri, 16 Feb 2018 05:57:39 -0800 (PST) X-Received: by 10.46.64.203 with SMTP id r72mt5013130lje.38.1518789458740; Fri, 16 Feb 2018 05:57:38 -0800 (PST) MIME-Version: 1.0 Received: by 10.46.106.8 with HTTP; Fri, 16 Feb 2018 05:57:18 -0800 (PST) In-Reply-To: <201802160312.w1G3CO3r085739@repo.freebsd.org> References: <201802160312.w1G3CO3r085739@repo.freebsd.org> From: Kyle Evans Date: Fri, 16 Feb 2018 07:57:18 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r329349 - head/stand/lua 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.25 Precedence: list List-Id: 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, 16 Feb 2018 13:57:48 -0000 On Thu, Feb 15, 2018 at 9:12 PM, Kyle Evans wrote: > Author: kevans > Date: Fri Feb 16 03:12:24 2018 > New Revision: 329349 > URL: https://svnweb.freebsd.org/changeset/base/329349 > > Log: > stand/lua: Reduce magic numbers > > Enter/backspace values are hardcoded in both the menu and password scripts. > Separate these out to core for reuse between the two. > > Modified: > head/stand/lua/core.lua > head/stand/lua/menu.lua > head/stand/lua/password.lua > > Modified: head/stand/lua/core.lua > ============================================================================== > --- head/stand/lua/core.lua Fri Feb 16 01:33:01 2018 (r329348) > +++ head/stand/lua/core.lua Fri Feb 16 03:12:24 2018 (r329349) > @@ -28,6 +28,10 @@ > > local core = {}; > > +-- Commonly appearing constants > +core.KEY_ENTER = 13 > +core.KEY_BACKSPACE = 127 > + > function core.setVerbose(b) > if (b == nil) then > b = not core.verbose; > > Modified: head/stand/lua/menu.lua > ============================================================================== > --- head/stand/lua/menu.lua Fri Feb 16 01:33:01 2018 (r329348) > +++ head/stand/lua/menu.lua Fri Feb 16 03:12:24 2018 (r329349) > @@ -273,9 +273,9 @@ function menu.run(m) > local key = io.getchar(); > > -- Special key behaviors > - if (key == 127) and (m ~= menu.welcome) then > + if (key == core.KEY_BACKSPACE) and (m ~= menu.welcome) then > break > - elseif (key == 13) then > + elseif (key == core.KEY_ENTER) then > core.boot(); > -- Should not return > end > @@ -357,7 +357,7 @@ function menu.autoboot() > screen.defcursor(); > if io.ischar() then > local ch = io.getchar(); > - if ch == 13 then > + if ch == core.KEY_ENTER then > break; > else > -- prevent autoboot when escaping to interpreter > > Modified: head/stand/lua/password.lua > ============================================================================== > --- head/stand/lua/password.lua Fri Feb 16 01:33:01 2018 (r329348) > +++ head/stand/lua/password.lua Fri Feb 16 03:12:24 2018 (r329349) > @@ -37,11 +37,11 @@ function password.read() > > repeat > ch = io.getchar(); > - if ch == 13 then > + if ch == core.KEY_ENTER then > break; > end > > - if ch == 8 then > + if ch == core.KEY_BACKSPACE then It's worth noting that this changes the comparison from 'ch == 8' to 'ch == 127'. The password prompt was non-functional on my test systems until this change, because I can never type my password right the first time. =) Pointed out by: cem@ From owner-svn-src-head@freebsd.org Fri Feb 16 14:31: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 449D7F18C7B; Fri, 16 Feb 2018 14:31:57 +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 B85447C719; Fri, 16 Feb 2018 14:31:56 +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 0BA4E104B234; Sat, 17 Feb 2018 01:31:46 +1100 (AEDT) Date: Sat, 17 Feb 2018 01:31:45 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Benno Rice cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329269 - head/stand/i386/boot2 In-Reply-To: <201802141807.w1EI7Ror036078@repo.freebsd.org> Message-ID: <20180217000503.F3685@besplex.bde.org> References: <201802141807.w1EI7Ror036078@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=FNpr/6gs c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=zMeS5lR-rpC9UbJK_LUA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 14:31:57 -0000 On Wed, 14 Feb 2018, Benno Rice wrote: > Log: > Reformat to come significantly closer to style(9). This gives unreadable diffs. It does more than reformatting. Bugs have been reported. They must be in the non-reformatting changes. > Modified: head/stand/i386/boot2/boot2.c > ============================================================================== > --- head/stand/i386/boot2/boot2.c Wed Feb 14 18:05:37 2018 (r329268) > +++ head/stand/i386/boot2/boot2.c Wed Feb 14 18:07:27 2018 (r329269) > ... > #if SERIAL > - } else if (c == 'S') { > - j = 0; > - while ((unsigned int)(i = *arg++ - '0') <= 9) > - j = j * 10 + i; > - if (j > 0 && i == -'0') { > - comspeed = j; > - break; > - } > - /* Fall through to error below ('S' not in optstr[]). */ > + } else if (c == 'S') { > + j = 0; > + while (*arg <= '9') { > + i = (unsigned int)(*arg - '0'); > + j = j * 10 + i; > + arg++; > + } > + if (j > 0 && i == -'0') { > + comspeed = j; > + break; > + } > + /* > + * Fall through to error below > + * ('S' not in optstr[]). > + */ > #endif The bugs seem to be only here. The old code uses a bogus cast to obfuscate its classification of digits. The change breaks the classification of digits by moving the cast to a place where it has no effect. Even space separators and '\0' terminators are now misclassified as digits. Space separators seem to be broken anyway, so -S only worked if it is the last arg. Now it never works, since the terminating char is never '\0'. Moving the increment of 'arg' is risky but seems to have no effect since -S must be at the end to work so no further advance of arg is useful. Bruce From owner-svn-src-head@freebsd.org Fri Feb 16 14:39: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 268FCF196DA; Fri, 16 Feb 2018 14:39: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 C8E3E7CD66; Fri, 16 Feb 2018 14:39:41 +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 C248C6F66; Fri, 16 Feb 2018 14:39: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 w1GEdf9Z028461; Fri, 16 Feb 2018 14:39:41 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GEdfTN028459; Fri, 16 Feb 2018 14:39:41 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802161439.w1GEdfTN028459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 14:39:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329367 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329367 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 14:39:42 -0000 Author: kevans Date: Fri Feb 16 14:39:41 2018 New Revision: 329367 URL: https://svnweb.freebsd.org/changeset/base/329367 Log: stand/lua: Create a "carousel" menu entry type This is a pre-cursor to boot environment support in lualoader. Create a new menu item type, "carousel_entry", that generally provides a callback to get the list of items, a carousel_id for storing the current value, and the standard name/func functions that an entry has. The difference between this and a normal menu item, functionally, is that selecting a carousel item will automatically rotate through available items and wrap back at the beginning when the list is exhausted. The 'name' function takes the choice index, current choice, and the list of choices as parameters so that the menu item can decorate the name freely as desired. The 'func' function takes the current choice as a parameter, so it can act accordingly. The kernel menu item has been rewritten to use the carousel_entry type as both an example and initial test of its functionality before it is used for boot environment options. Modified: head/stand/lua/drawer.lua head/stand/lua/menu.lua Modified: head/stand/lua/drawer.lua ============================================================================== --- head/stand/lua/drawer.lua Fri Feb 16 13:57:43 2018 (r329366) +++ head/stand/lua/drawer.lua Fri Feb 16 14:39:41 2018 (r329367) @@ -169,7 +169,21 @@ function drawer.drawmenu(m) if (e.entry_type ~= "separator") then entry_num = entry_num + 1; screen.setcursor(x, y + line_num); - print(entry_num .. ". "..e.name()); + local name = ""; + + if (e.entry_type == "carousel_entry") then + local carid = e.carousel_id; + local caridx = menu.getCarouselIndex(carid); + local choices = e.items(); + + if (#choices < caridx) then + caridx = 1; + end; + name = e.name(caridx, choices[caridx], choices); + else + name = e.name(); + end + print(entry_num .. ". "..name); -- fill the alias table alias_table[tostring(entry_num)] = e; Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Fri Feb 16 13:57:43 2018 (r329366) +++ head/stand/lua/menu.lua Fri Feb 16 14:39:41 2018 (r329367) @@ -39,7 +39,7 @@ local OnOff; local skip; local run; local autoboot; -local current_kernel_index = 1; +local carousel_choices = {}; --loader menu tree: --rooted at menu.welcome @@ -193,34 +193,25 @@ menu.welcome = { -- kernel options { - entry_type = "entry", - name = function() - local kernels = core.kernelList(); - if #kernels == 0 then + entry_type = "carousel_entry", + carousel_id = "kernel", + items = core.kernelList, + name = function(idx, choice, all_choices) + if #all_choices == 0 then return "Kernel: "; end local kernel_name = color.escapef(color.GREEN) .. - kernels[current_kernel_index] .. color.default(); - if (current_kernel_index == 1) then + choice .. color.default(); + if (idx == 1) then kernel_name = "default/" .. kernel_name; end return color.highlight("K").."ernel: " .. kernel_name .. - " (" .. current_kernel_index .. - " of " .. #kernels .. ")"; + " (" .. idx .. + " of " .. #all_choices .. ")"; end, - func = function() - - -- dynamically build the kernel menu: - local kernels = core.kernelList(); - -- Don't do anything if we don't have multiple kernels - if #kernels <= 1 then - return nil; - end - current_kernel_index = (current_kernel_index % #kernels) - + 1; - local current_kernel = kernels[current_kernel_index]; - config.reload(current_kernel) + func = function(choice) + config.reload(choice); end, alias = {"k", "K"} }, @@ -239,6 +230,19 @@ menu.welcome = { }; +-- The first item in every carousel is always the default item. +function menu.getCarouselIndex(id) + local val = carousel_choices[id]; + if (val == nil) then + return 1; + end + return val; +end + +function menu.setCarouselIndex(id, idx) + carousel_choices[id] = idx; +end + function menu.run(m) if (menu.skip()) then @@ -283,6 +287,15 @@ function menu.run(m) if (sel_entry.entry_type == "entry") then -- run function sel_entry.func(); + elseif (sel_entry.entry_type == "carousel_entry") then + -- carousel (rotating) functionality + local carid = sel_entry.carousel_id; + local caridx = menu.getCarouselIndex(carid); + local choices = sel_entry.items(); + + caridx = (caridx % #choices) + 1; + menu.setCarouselIndex(carid, caridx); + sel_entry.func(choices[caridx]); elseif (sel_entry.entry_type == "submenu") then -- recurse cont = menu.run(sel_entry.submenu()); From owner-svn-src-head@freebsd.org Fri Feb 16 14: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 826B9F1B1DE; Fri, 16 Feb 2018 14:57:43 +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 371C67DDB5; Fri, 16 Feb 2018 14:57:43 +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 2DC077291; Fri, 16 Feb 2018 14:57:43 +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 w1GEvhHf038130; Fri, 16 Feb 2018 14:57:43 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GEvgQs038127; Fri, 16 Feb 2018 14:57:42 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802161457.w1GEvgQs038127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 14:57:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329368 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329368 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 14:57:43 -0000 Author: kevans Date: Fri Feb 16 14:57:42 2018 New Revision: 329368 URL: https://svnweb.freebsd.org/changeset/base/329368 Log: stand/lua: Create/use some MENU_ constants where applicable Modified: head/stand/lua/core.lua head/stand/lua/drawer.lua head/stand/lua/menu.lua Modified: head/stand/lua/core.lua ============================================================================== --- head/stand/lua/core.lua Fri Feb 16 14:39:41 2018 (r329367) +++ head/stand/lua/core.lua Fri Feb 16 14:57:42 2018 (r329368) @@ -29,11 +29,17 @@ local core = {}; -- Commonly appearing constants -core.KEY_ENTER = 13; -core.KEY_BACKSPACE = 127; +core.KEY_ENTER = 13; +core.KEY_BACKSPACE = 127; -core.KEYSTR_ESCAPE = "\027"; +core.KEYSTR_ESCAPE = "\027"; +core.MENU_RETURN = "return"; +core.MENU_ENTRY = "entry"; +core.MENU_SEPARATOR = "separator"; +core.MENU_SUBMENU = "submenu"; +core.MENU_CAROUSEL_ENTRY = "carousel_entry"; + function core.setVerbose(b) if (b == nil) then b = not core.verbose; @@ -119,6 +125,7 @@ function core.kernelList() local k = loader.getenv("kernel"); local v = loader.getenv("kernels") or ""; + v = "kernel;kernel.GENERIC" local kernels = {}; local i = 0; if k ~= nil then Modified: head/stand/lua/drawer.lua ============================================================================== --- head/stand/lua/drawer.lua Fri Feb 16 14:39:41 2018 (r329367) +++ head/stand/lua/drawer.lua Fri Feb 16 14:57:42 2018 (r329368) @@ -29,6 +29,7 @@ local drawer = {}; local color = require("color"); +local core = require("core"); local screen = require("screen"); drawer.brand_position = {x = 2, y = 1}; @@ -166,12 +167,12 @@ function drawer.drawmenu(m) local alias_table = {}; local entry_num = 0; for line_num, e in ipairs(m) do - if (e.entry_type ~= "separator") then + if (e.entry_type ~= core.MENU_SEPARATOR) then entry_num = entry_num + 1; screen.setcursor(x, y + line_num); local name = ""; - if (e.entry_type == "carousel_entry") then + if (e.entry_type == core.MENU_CAROUSEL_ENTRY) then local carid = e.carousel_id; local caridx = menu.getCarouselIndex(carid); local choices = e.items(); Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Fri Feb 16 14:39:41 2018 (r329367) +++ head/stand/lua/menu.lua Fri Feb 16 14:57:42 2018 (r329368) @@ -50,7 +50,7 @@ local welcome; menu.boot_options = { -- return to welcome menu { - entry_type = "return", + entry_type = core.MENU_RETURN, name = function() return "Back to main menu"..color.highlight(" [Backspace]"); end @@ -58,7 +58,7 @@ menu.boot_options = { -- load defaults { - entry_type = "entry", + entry_type = core.MENU_ENTRY, name = function() return "Load System "..color.highlight("D").."efaults"; end, @@ -69,14 +69,14 @@ menu.boot_options = { }, { - entry_type = "separator", + entry_type = core.MENU_SEPARATOR, name = function() return ""; end }, { - entry_type = "separator", + entry_type = core.MENU_SEPARATOR, name = function() return "Boot Options:"; end @@ -84,7 +84,7 @@ menu.boot_options = { -- acpi { - entry_type = "entry", + entry_type = core.MENU_ENTRY, name = function() return OnOff(color.highlight("A").."CPI :", core.acpi); end, @@ -95,7 +95,7 @@ menu.boot_options = { }, -- safe mode { - entry_type = "entry", + entry_type = core.MENU_ENTRY, name = function() return OnOff("Safe "..color.highlight("M").."ode :", core.sm); end, @@ -106,7 +106,7 @@ menu.boot_options = { }, -- single user { - entry_type = "entry", + entry_type = core.MENU_ENTRY, name = function() return OnOff(color.highlight("S").."ingle user:", core.su); end, @@ -117,7 +117,7 @@ menu.boot_options = { }, -- verbose boot { - entry_type = "entry", + entry_type = core.MENU_ENTRY, name = function() return OnOff(color.highlight("V").."erbose :", core.verbose); end, @@ -131,7 +131,7 @@ menu.boot_options = { menu.welcome = { -- boot multi user { - entry_type = "entry", + entry_type = core.MENU_ENTRY, name = function() return color.highlight("B").."oot Multi user "..color.highlight("[Enter]"); end, @@ -144,7 +144,7 @@ menu.welcome = { -- boot single user { - entry_type = "entry", + entry_type = core.MENU_ENTRY, name = function() return "Boot "..color.highlight("S").."ingle user"; end, @@ -157,7 +157,7 @@ menu.welcome = { -- escape to interpreter { - entry_type = "return", + entry_type = core.MENU_RETURN, name = function() return color.highlight("Esc").."ape to loader prompt"; end, @@ -166,7 +166,7 @@ menu.welcome = { -- reboot { - entry_type = "entry", + entry_type = core.MENU_ENTRY, name = function() return color.highlight("R").."eboot"; end, @@ -178,14 +178,14 @@ menu.welcome = { { - entry_type = "separator", + entry_type = core.MENU_SEPARATOR, name = function() return ""; end }, { - entry_type = "separator", + entry_type = core.MENU_SEPARATOR, name = function() return "Options:"; end @@ -193,7 +193,7 @@ menu.welcome = { -- kernel options { - entry_type = "carousel_entry", + entry_type = core.MENU_CAROUSEL_ENTRY, carousel_id = "kernel", items = core.kernelList, name = function(idx, choice, all_choices) @@ -218,7 +218,7 @@ menu.welcome = { -- boot options { - entry_type = "submenu", + entry_type = core.MENU_SUBMENU, name = function() return "Boot "..color.highlight("O").."ptions"; end, @@ -284,10 +284,10 @@ function menu.run(m) -- if we have an alias do the assigned action: if(sel_entry ~= nil) then - if (sel_entry.entry_type == "entry") then + if (sel_entry.entry_type == core.MENU_ENTRY) then -- run function sel_entry.func(); - elseif (sel_entry.entry_type == "carousel_entry") then + elseif (sel_entry.entry_type == core.MENU_CAROUSEL_ENTRY) then -- carousel (rotating) functionality local carid = sel_entry.carousel_id; local caridx = menu.getCarouselIndex(carid); @@ -296,10 +296,10 @@ function menu.run(m) caridx = (caridx % #choices) + 1; menu.setCarouselIndex(carid, caridx); sel_entry.func(choices[caridx]); - elseif (sel_entry.entry_type == "submenu") then + elseif (sel_entry.entry_type == core.MENU_SUBMENU) then -- recurse cont = menu.run(sel_entry.submenu()); - elseif (sel_entry.entry_type == "return") then + elseif (sel_entry.entry_type == core.MENU_RETURN) then -- break recurse cont = false; end From owner-svn-src-head@freebsd.org Fri Feb 16 14:59: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 ACE53F1B3C0; Fri, 16 Feb 2018 14:59:11 +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 5CD317DF53; Fri, 16 Feb 2018 14:59:11 +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 57B047292; Fri, 16 Feb 2018 14:59:11 +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 w1GExB6t038220; Fri, 16 Feb 2018 14:59:11 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GExB0i038219; Fri, 16 Feb 2018 14:59:11 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802161459.w1GExB0i038219@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 14:59:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329369 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329369 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 14:59:11 -0000 Author: kevans Date: Fri Feb 16 14:59:11 2018 New Revision: 329369 URL: https://svnweb.freebsd.org/changeset/base/329369 Log: stand/lua: Remove sneaky kernel assignment Modified: head/stand/lua/core.lua Modified: head/stand/lua/core.lua ============================================================================== --- head/stand/lua/core.lua Fri Feb 16 14:57:42 2018 (r329368) +++ head/stand/lua/core.lua Fri Feb 16 14:59:11 2018 (r329369) @@ -125,7 +125,6 @@ function core.kernelList() local k = loader.getenv("kernel"); local v = loader.getenv("kernels") or ""; - v = "kernel;kernel.GENERIC" local kernels = {}; local i = 0; if k ~= nil then From owner-svn-src-head@freebsd.org Fri Feb 16 15:00: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 BBC06F1B552; Fri, 16 Feb 2018 15:00: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 6739D7E121; Fri, 16 Feb 2018 15:00: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 61CCE7296; Fri, 16 Feb 2018 15:00: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 w1GF0Gmc038366; Fri, 16 Feb 2018 15:00:16 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GF0FhT038352; Fri, 16 Feb 2018 15:00:15 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802161500.w1GF0FhT038352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 16 Feb 2018 15:00:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329370 - in head/sys: amd64/linux32 compat/linux i386/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/sys: amd64/linux32 compat/linux i386/linux X-SVN-Commit-Revision: 329370 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 15:00:17 -0000 Author: emaste Date: Fri Feb 16 15:00:14 2018 New Revision: 329370 URL: https://svnweb.freebsd.org/changeset/base/329370 Log: Rationalize license text on Linuxolator files Many licenses on Linuxolator files contained small variations from the standard FreeBSD license text. To avoid license proliferation switch to the standard 2-clause FreeBSD license for those files where I have permission from each of the listed copyright holders. Additional files waiting on permission from others are listed in review D14210. Approved by: kan, marcel, sos, rdivacky MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/linux32/linux32_dummy.c head/sys/compat/linux/linux_file.c head/sys/compat/linux/linux_ioctl.c head/sys/compat/linux/linux_ipc.c head/sys/compat/linux/linux_mib.c head/sys/compat/linux/linux_signal.c head/sys/compat/linux/linux_socket.c head/sys/compat/linux/linux_stats.c head/sys/compat/linux/linux_sysctl.c head/sys/i386/linux/imgact_linux.c head/sys/i386/linux/linux_dummy.c head/sys/i386/linux/linux_machdep.c head/sys/i386/linux/linux_ptrace.c head/sys/i386/linux/linux_sysvec.c Modified: head/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- head/sys/amd64/linux32/linux32_dummy.c Fri Feb 16 14:59:11 2018 (r329369) +++ head/sys/amd64/linux32/linux32_dummy.c Fri Feb 16 15:00:14 2018 (r329370) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 1994-1995 Søren Schmidt * All rights reserved. @@ -8,24 +8,22 @@ * 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. + * 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. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission * - * 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. + * 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 Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Fri Feb 16 14:59:11 2018 (r329369) +++ head/sys/compat/linux/linux_file.c Fri Feb 16 15:00:14 2018 (r329370) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 1994-1995 Søren Schmidt * All rights reserved. @@ -8,24 +8,22 @@ * 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. + * 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. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission * - * 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. + * 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 Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Fri Feb 16 14:59:11 2018 (r329369) +++ head/sys/compat/linux/linux_ioctl.c Fri Feb 16 15:00:14 2018 (r329370) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 1994-1995 Søren Schmidt * All rights reserved. @@ -8,24 +8,22 @@ * 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. + * 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. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission * - * 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. + * 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_compat.h" Modified: head/sys/compat/linux/linux_ipc.c ============================================================================== --- head/sys/compat/linux/linux_ipc.c Fri Feb 16 14:59:11 2018 (r329369) +++ head/sys/compat/linux/linux_ipc.c Fri Feb 16 15:00:14 2018 (r329370) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 1994-1995 Søren Schmidt * All rights reserved. @@ -8,24 +8,22 @@ * 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. + * 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. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission * - * 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. + * 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 Modified: head/sys/compat/linux/linux_mib.c ============================================================================== --- head/sys/compat/linux/linux_mib.c Fri Feb 16 14:59:11 2018 (r329369) +++ head/sys/compat/linux/linux_mib.c Fri Feb 16 15:00:14 2018 (r329370) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 1999 Marcel Moolenaar * All rights reserved. @@ -8,24 +8,22 @@ * 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. + * 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. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. * - * 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. + * 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 Modified: head/sys/compat/linux/linux_signal.c ============================================================================== --- head/sys/compat/linux/linux_signal.c Fri Feb 16 14:59:11 2018 (r329369) +++ head/sys/compat/linux/linux_signal.c Fri Feb 16 15:00:14 2018 (r329370) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 1994-1995 Søren Schmidt * All rights reserved. @@ -8,24 +8,22 @@ * 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. + * 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. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission * - * 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. + * 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 Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Fri Feb 16 14:59:11 2018 (r329369) +++ head/sys/compat/linux/linux_socket.c Fri Feb 16 15:00:14 2018 (r329370) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 1995 Søren Schmidt * All rights reserved. @@ -8,24 +8,22 @@ * 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. + * 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. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission * - * 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. + * 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 Modified: head/sys/compat/linux/linux_stats.c ============================================================================== --- head/sys/compat/linux/linux_stats.c Fri Feb 16 14:59:11 2018 (r329369) +++ head/sys/compat/linux/linux_stats.c Fri Feb 16 15:00:14 2018 (r329370) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 1994-1995 Søren Schmidt * All rights reserved. @@ -8,24 +8,22 @@ * 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. + * 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. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission * - * 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. + * 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 Modified: head/sys/compat/linux/linux_sysctl.c ============================================================================== --- head/sys/compat/linux/linux_sysctl.c Fri Feb 16 14:59:11 2018 (r329369) +++ head/sys/compat/linux/linux_sysctl.c Fri Feb 16 15:00:14 2018 (r329370) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2001 Marcel Moolenaar * All rights reserved. @@ -8,24 +8,22 @@ * 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. + * 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. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. * - * 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. + * 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 Modified: head/sys/i386/linux/imgact_linux.c ============================================================================== --- head/sys/i386/linux/imgact_linux.c Fri Feb 16 14:59:11 2018 (r329369) +++ head/sys/i386/linux/imgact_linux.c Fri Feb 16 15:00:14 2018 (r329370) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 1994-1996 Søren Schmidt * All rights reserved. @@ -11,24 +11,22 @@ * 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. + * 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. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission * - * 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. + * 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 Modified: head/sys/i386/linux/linux_dummy.c ============================================================================== --- head/sys/i386/linux/linux_dummy.c Fri Feb 16 14:59:11 2018 (r329369) +++ head/sys/i386/linux/linux_dummy.c Fri Feb 16 15:00:14 2018 (r329370) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 1994-1995 Søren Schmidt * All rights reserved. @@ -8,24 +8,22 @@ * 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. + * 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. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission * - * 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. + * 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 Modified: head/sys/i386/linux/linux_machdep.c ============================================================================== --- head/sys/i386/linux/linux_machdep.c Fri Feb 16 14:59:11 2018 (r329369) +++ head/sys/i386/linux/linux_machdep.c Fri Feb 16 15:00:14 2018 (r329370) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2000 Marcel Moolenaar * All rights reserved. @@ -8,24 +8,22 @@ * 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. + * 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. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. * - * 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. + * 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 Modified: head/sys/i386/linux/linux_ptrace.c ============================================================================== --- head/sys/i386/linux/linux_ptrace.c Fri Feb 16 14:59:11 2018 (r329369) +++ head/sys/i386/linux/linux_ptrace.c Fri Feb 16 15:00:14 2018 (r329370) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2001 Alexander Kabaev * All rights reserved. @@ -8,24 +8,22 @@ * 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. + * 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. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. * - * 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. + * 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 Modified: head/sys/i386/linux/linux_sysvec.c ============================================================================== --- head/sys/i386/linux/linux_sysvec.c Fri Feb 16 14:59:11 2018 (r329369) +++ head/sys/i386/linux/linux_sysvec.c Fri Feb 16 15:00:14 2018 (r329370) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 1994-1996 Søren Schmidt * All rights reserved. @@ -8,24 +8,22 @@ * 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. + * 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. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission * - * 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. + * 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 From owner-svn-src-head@freebsd.org Fri Feb 16 15: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 EC2DFF1CFC9; Fri, 16 Feb 2018 15:20:21 +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 A27497F30B; Fri, 16 Feb 2018 15:20:21 +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 98DD475E9; Fri, 16 Feb 2018 15:20:21 +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 w1GFKLaS049086; Fri, 16 Feb 2018 15:20:21 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GFKLiA049085; Fri, 16 Feb 2018 15:20:21 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802161520.w1GFKLiA049085@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 16 Feb 2018 15:20:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329371 - 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: 329371 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 15:20:22 -0000 Author: hselasky Date: Fri Feb 16 15:20:21 2018 New Revision: 329371 URL: https://svnweb.freebsd.org/changeset/base/329371 Log: Allow the cmpxchg() macro in the LinuxKPI to work on pointers without generating compiler warnings, -Wint-conversion . Requested by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/asm/atomic.h Modified: head/sys/compat/linuxkpi/common/include/asm/atomic.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/atomic.h Fri Feb 16 15:00:14 2018 (r329370) +++ head/sys/compat/linuxkpi/common/include/asm/atomic.h Fri Feb 16 15:20:21 2018 (r329371) @@ -159,36 +159,41 @@ atomic_cmpxchg(atomic_t *v, int old, int new) return (ret); } -#define cmpxchg(ptr, old, new) ({ \ - __typeof(*(ptr)) __ret; \ - \ - CTASSERT(sizeof(__ret) == 1 || sizeof(__ret) == 2 || \ - sizeof(__ret) == 4 || sizeof(__ret) == 8); \ - \ - __ret = (old); \ - switch (sizeof(__ret)) { \ - case 1: \ - while (!atomic_fcmpset_8((volatile int8_t *)(ptr), \ - (int8_t *)&__ret, (new)) && __ret == (old)) \ - ; \ - break; \ - case 2: \ - while (!atomic_fcmpset_16((volatile int16_t *)(ptr), \ - (int16_t *)&__ret, (new)) && __ret == (old)) \ - ; \ - break; \ - case 4: \ - while (!atomic_fcmpset_32((volatile int32_t *)(ptr), \ - (int32_t *)&__ret, (new)) && __ret == (old)) \ - ; \ - break; \ - case 8: \ - while (!atomic_fcmpset_64((volatile int64_t *)(ptr), \ - (int64_t *)&__ret, (new)) && __ret == (old)) \ - ; \ - break; \ - } \ - __ret; \ +#define cmpxchg(ptr, old, new) ({ \ + union { \ + __typeof(*(ptr)) val; \ + u8 u8[]; \ + u16 u16[]; \ + u32 u32[]; \ + u64 u64[]; \ + } __ret = { .val = (old) }, __new = { .val = (new) }; \ + \ + CTASSERT(sizeof(__ret.val) == 1 || sizeof(__ret.val) == 2 || \ + sizeof(__ret.val) == 4 || sizeof(__ret.val) == 8); \ + \ + switch (sizeof(__ret.val)) { \ + case 1: \ + while (!atomic_fcmpset_8((volatile u8 *)(ptr), \ + __ret.u8, __new.u8[0]) && __ret.val == (old)) \ + ; \ + break; \ + case 2: \ + while (!atomic_fcmpset_16((volatile u16 *)(ptr), \ + __ret.u16, __new.u16[0]) && __ret.val == (old)) \ + ; \ + break; \ + case 4: \ + while (!atomic_fcmpset_32((volatile u32 *)(ptr), \ + __ret.u32, __new.u32[0]) && __ret.val == (old)) \ + ; \ + break; \ + case 8: \ + while (!atomic_fcmpset_64((volatile u64 *)(ptr), \ + __ret.u64, __new.u64[0]) && __ret.val == (old)) \ + ; \ + break; \ + } \ + __ret.val; \ }) #define cmpxchg_relaxed(...) cmpxchg(__VA_ARGS__) From owner-svn-src-head@freebsd.org Fri Feb 16 15:37: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 B9682F1E63A; Fri, 16 Feb 2018 15:37: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 51BB38006A; Fri, 16 Feb 2018 15:37:34 +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 4C6277919; Fri, 16 Feb 2018 15:37:34 +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 w1GFbYsU059034; Fri, 16 Feb 2018 15:37:34 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GFbY8D059033; Fri, 16 Feb 2018 15:37:34 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802161537.w1GFbY8D059033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 16 Feb 2018 15:37:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329372 - 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: 329372 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 15:37:34 -0000 Author: hselasky Date: Fri Feb 16 15:37:33 2018 New Revision: 329372 URL: https://svnweb.freebsd.org/changeset/base/329372 Log: Implement enable_irq() and disable_irq() in the LinuxKPI. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/interrupt.h Modified: head/sys/compat/linuxkpi/common/include/linux/interrupt.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/interrupt.h Fri Feb 16 15:20:21 2018 (r329371) +++ head/sys/compat/linuxkpi/common/include/linux/interrupt.h Fri Feb 16 15:37:33 2018 (r329372) @@ -112,6 +112,38 @@ request_irq(unsigned int irq, irq_handler_t handler, u } static inline int +enable_irq(unsigned int irq) +{ + struct irq_ent *irqe; + struct device *dev; + + dev = linux_pci_find_irq_dev(irq); + if (dev == NULL) + return -EINVAL; + irqe = linux_irq_ent(dev, irq); + if (irqe == NULL) + return -EINVAL; + return -bus_setup_intr(dev->bsddev, irqe->res, INTR_TYPE_NET | INTR_MPSAFE, + NULL, linux_irq_handler, irqe, &irqe->tag); +} + +static inline void +disable_irq(unsigned int irq) +{ + struct irq_ent *irqe; + struct device *dev; + + dev = linux_pci_find_irq_dev(irq); + if (dev == NULL) + return; + irqe = linux_irq_ent(dev, irq); + if (irqe == NULL) + return; + bus_teardown_intr(dev->bsddev, irqe->res, irqe->tag); + irqe->tag = NULL; +} + +static inline int bind_irq_to_cpu(unsigned int irq, int cpu_id) { struct irq_ent *irqe; From owner-svn-src-head@freebsd.org Fri Feb 16 15:38: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 092CAF1E6E6; Fri, 16 Feb 2018 15:38:03 +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 AFD928017C; Fri, 16 Feb 2018 15:38:02 +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 AAAD9791A; Fri, 16 Feb 2018 15:38:02 +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 w1GFc2b2059103; Fri, 16 Feb 2018 15:38:02 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GFc26r059102; Fri, 16 Feb 2018 15:38:02 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802161538.w1GFc26r059102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 16 Feb 2018 15:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329373 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 329373 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 15:38:03 -0000 Author: emaste Date: Fri Feb 16 15:38:02 2018 New Revision: 329373 URL: https://svnweb.freebsd.org/changeset/base/329373 Log: Correct module symbol export handling EXPORT_SYMS can be set to YES, NO, a list of symbols to export from a module, or to a filename containing such a list. For the case that it is set to a symbol list, replace spaces in the list with newlines, so the created file is in the format expected by kmod_syms.awk. Reviewed by: imp, jhb MFC after: 1 month Sponsored by: Turing Robotic Industries Inc. Differential Revision: https://reviews.freebsd.org/D14284 Modified: head/sys/conf/kmod.mk Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Fri Feb 16 15:37:33 2018 (r329372) +++ head/sys/conf/kmod.mk Fri Feb 16 15:38:02 2018 (r329373) @@ -243,14 +243,14 @@ ${FULLPROG}: ${OBJS} .if ${EXPORT_SYMS} == NO :> export_syms .elif !exists(${.CURDIR}/${EXPORT_SYMS}) - echo ${EXPORT_SYMS} > export_syms + echo -n "${EXPORT_SYMS:@s@$s${.newline}@}" > export_syms .else grep -v '^#' < ${EXPORT_SYMS} > export_syms .endif ${AWK} -f ${SYSDIR}/conf/kmod_syms.awk ${.TARGET} \ export_syms | xargs -J% ${OBJCOPY} % ${.TARGET} .endif -.endif +.endif # defined(EXPORT_SYMS) .if defined(PREFIX_SYMS) ${AWK} -v prefix=${PREFIX_SYMS} -f ${SYSDIR}/conf/kmod_syms_prefix.awk \ ${.TARGET} /dev/null | xargs -J% ${OBJCOPY} % ${.TARGET} From owner-svn-src-head@freebsd.org Fri Feb 16 15:38: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 41810F1E738; Fri, 16 Feb 2018 15:38:23 +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 EB287802C1; Fri, 16 Feb 2018 15:38:22 +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 E6200791B; Fri, 16 Feb 2018 15:38:22 +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 w1GFcMaI059158; Fri, 16 Feb 2018 15:38:22 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GFcMOu059157; Fri, 16 Feb 2018 15:38:22 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802161538.w1GFcMOu059157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 16 Feb 2018 15:38:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329374 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 329374 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 15:38:23 -0000 Author: markj Date: Fri Feb 16 15:38:22 2018 New Revision: 329374 URL: https://svnweb.freebsd.org/changeset/base/329374 Log: Use the conventional name for an array of pages. No functional change intended. Discussed with: kib MFC after: 3 days Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Fri Feb 16 15:38:02 2018 (r329373) +++ head/sys/vm/swap_pager.c Fri Feb 16 15:38:22 2018 (r329374) @@ -1084,16 +1084,16 @@ swap_pager_unswapped(vm_page_t m) /* * swap_pager_getpages() - bring pages in from swap * - * Attempt to page in the pages in array "m" of length "count". The caller - * may optionally specify that additional pages preceding and succeeding - * the specified range be paged in. The number of such pages is returned - * in the "rbehind" and "rahead" parameters, and they will be in the - * inactive queue upon return. + * Attempt to page in the pages in array "ma" of length "count". The + * caller may optionally specify that additional pages preceding and + * succeeding the specified range be paged in. The number of such pages + * is returned in the "rbehind" and "rahead" parameters, and they will + * be in the inactive queue upon return. * - * The pages in "m" must be busied and will remain busied upon return. + * The pages in "ma" must be busied and will remain busied upon return. */ static int -swap_pager_getpages(vm_object_t object, vm_page_t *m, int count, int *rbehind, +swap_pager_getpages(vm_object_t object, vm_page_t *ma, int count, int *rbehind, int *rahead) { struct buf *bp; @@ -1108,7 +1108,7 @@ swap_pager_getpages(vm_object_t object, vm_page_t *m, bp = getpbuf(&nsw_rcount); VM_OBJECT_WLOCK(object); - if (!swap_pager_haspage(object, m[0]->pindex, &maxbehind, &maxahead)) { + if (!swap_pager_haspage(object, ma[0]->pindex, &maxbehind, &maxahead)) { relpbuf(bp, &nsw_rcount); return (VM_PAGER_FAIL); } @@ -1120,15 +1120,15 @@ swap_pager_getpages(vm_object_t object, vm_page_t *m, KASSERT(reqcount - 1 <= maxahead, ("page count %d extends beyond swap block", reqcount)); *rahead = imin(*rahead, maxahead - (reqcount - 1)); - pindex = m[reqcount - 1]->pindex; - msucc = TAILQ_NEXT(m[reqcount - 1], listq); + pindex = ma[reqcount - 1]->pindex; + msucc = TAILQ_NEXT(ma[reqcount - 1], listq); if (msucc != NULL && msucc->pindex - pindex - 1 < *rahead) *rahead = msucc->pindex - pindex - 1; } if (rbehind != NULL) { *rbehind = imin(*rbehind, maxbehind); - pindex = m[0]->pindex; - mpred = TAILQ_PREV(m[0], pglist, listq); + pindex = ma[0]->pindex; + mpred = TAILQ_PREV(ma[0], pglist, listq); if (mpred != NULL && pindex - mpred->pindex - 1 < *rbehind) *rbehind = pindex - mpred->pindex - 1; } @@ -1139,7 +1139,7 @@ swap_pager_getpages(vm_object_t object, vm_page_t *m, shift = rbehind != NULL ? *rbehind : 0; if (shift != 0) { for (i = 1; i <= shift; i++) { - p = vm_page_alloc(object, m[0]->pindex - i, + p = vm_page_alloc(object, ma[0]->pindex - i, VM_ALLOC_NORMAL); if (p == NULL) { /* Shift allocated pages to the left. */ @@ -1154,11 +1154,11 @@ swap_pager_getpages(vm_object_t object, vm_page_t *m, *rbehind = shift; } for (i = 0; i < reqcount; i++) - bp->b_pages[i + shift] = m[i]; + bp->b_pages[i + shift] = ma[i]; if (rahead != NULL) { for (i = 0; i < *rahead; i++) { p = vm_page_alloc(object, - m[reqcount - 1]->pindex + i + 1, VM_ALLOC_NORMAL); + ma[reqcount - 1]->pindex + i + 1, VM_ALLOC_NORMAL); if (p == NULL) break; bp->b_pages[shift + reqcount + i] = p; @@ -1203,7 +1203,7 @@ swap_pager_getpages(vm_object_t object, vm_page_t *m, * Instead, we look at the one page we are interested in which we * still hold a lock on even through the I/O completion. * - * The other pages in our m[] array are also released on completion, + * The other pages in our ma[] array are also released on completion, * so we cannot assume they are valid anymore either. * * NOTE: b_blkno is destroyed by the call to swapdev_strategy @@ -1217,8 +1217,8 @@ swap_pager_getpages(vm_object_t object, vm_page_t *m, * is set in the metadata for each page in the request. */ VM_OBJECT_WLOCK(object); - while ((m[0]->oflags & VPO_SWAPINPROG) != 0) { - m[0]->oflags |= VPO_SWAPSLEEP; + while ((ma[0]->oflags & VPO_SWAPINPROG) != 0) { + ma[0]->oflags |= VPO_SWAPSLEEP; VM_CNT_INC(v_intrans); if (VM_OBJECT_SLEEP(object, &object->paging_in_progress, PSWP, "swread", hz * 20)) { @@ -1232,7 +1232,7 @@ swap_pager_getpages(vm_object_t object, vm_page_t *m, * If we had an unrecoverable read error pages will not be valid. */ for (i = 0; i < reqcount; i++) - if (m[i]->valid != VM_PAGE_BITS_ALL) + if (ma[i]->valid != VM_PAGE_BITS_ALL) return (VM_PAGER_ERROR); return (VM_PAGER_OK); @@ -1252,12 +1252,12 @@ swap_pager_getpages(vm_object_t object, vm_page_t *m, * swap_pager_getpages(). */ static int -swap_pager_getpages_async(vm_object_t object, vm_page_t *m, int count, +swap_pager_getpages_async(vm_object_t object, vm_page_t *ma, int count, int *rbehind, int *rahead, pgo_getpages_iodone_t iodone, void *arg) { int r, error; - r = swap_pager_getpages(object, m, count, rbehind, rahead); + r = swap_pager_getpages(object, ma, count, rbehind, rahead); VM_OBJECT_WUNLOCK(object); switch (r) { case VM_PAGER_OK: @@ -1272,7 +1272,7 @@ swap_pager_getpages_async(vm_object_t object, vm_page_ default: panic("unhandled swap_pager_getpages() error %d", r); } - (iodone)(arg, m, count, error); + (iodone)(arg, ma, count, error); VM_OBJECT_WLOCK(object); return (r); @@ -1301,16 +1301,16 @@ swap_pager_getpages_async(vm_object_t object, vm_page_ * We need to unbusy the rest on I/O completion. */ static void -swap_pager_putpages(vm_object_t object, vm_page_t *m, int count, +swap_pager_putpages(vm_object_t object, vm_page_t *ma, int count, int flags, int *rtvals) { int i, n; boolean_t sync; - if (count && m[0]->object != object) { + if (count && ma[0]->object != object) { panic("swap_pager_putpages: object mismatch %p/%p", object, - m[0]->object + ma[0]->object ); } @@ -1388,7 +1388,7 @@ swap_pager_putpages(vm_object_t object, vm_page_t *m, VM_OBJECT_WLOCK(object); for (j = 0; j < n; ++j) { - vm_page_t mreq = m[i+j]; + vm_page_t mreq = ma[i+j]; swp_pager_meta_build( mreq->object, From owner-svn-src-head@freebsd.org Fri Feb 16 15:41: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 E2818F1EA49; Fri, 16 Feb 2018 15:41:04 +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 946F08059B; Fri, 16 Feb 2018 15:41:04 +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 8C0F27952; Fri, 16 Feb 2018 15:41:04 +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 w1GFf4mP061500; Fri, 16 Feb 2018 15:41:04 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GFf3UY061493; Fri, 16 Feb 2018 15:41:03 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802161541.w1GFf3UY061493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 16 Feb 2018 15:41:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329375 - in head: lib/libufs stand/libsa sys/geom sys/geom/journal sys/geom/label sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: lib/libufs stand/libsa sys/geom sys/geom/journal sys/geom/label sys/ufs/ffs X-SVN-Commit-Revision: 329375 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 15:41:05 -0000 Author: markj Date: Fri Feb 16 15:41:03 2018 New Revision: 329375 URL: https://svnweb.freebsd.org/changeset/base/329375 Log: Fix a memory leak introduced in r328426. ffs_sbget() may return a superblock buffer even if it fails, so the caller must be prepared to free it in this case. Moreover, when tasting alternate superblock locations in a loop, ffs_sbget()'s readfunc callback must free the previously allocated buffer. Reported and tested by: pho Reviewed by: kib (previous version) Differential Revision: https://reviews.freebsd.org/D14390 Modified: head/lib/libufs/sblock.c head/stand/libsa/ufs.c head/sys/geom/geom_io.c head/sys/geom/journal/g_journal_ufs.c head/sys/geom/label/g_label_ufs.c head/sys/ufs/ffs/ffs_subr.c head/sys/ufs/ffs/ffs_vfsops.c Modified: head/lib/libufs/sblock.c ============================================================================== --- head/lib/libufs/sblock.c Fri Feb 16 15:38:22 2018 (r329374) +++ head/lib/libufs/sblock.c Fri Feb 16 15:41:03 2018 (r329375) @@ -150,6 +150,7 @@ use_pread(void *devfd, off_t loc, void **bufp, int siz int fd; fd = *(int *)devfd; + free(*bufp); if ((*bufp = malloc(size)) == NULL) return (ENOSPC); if (pread(fd, *bufp, size, loc) != size) Modified: head/stand/libsa/ufs.c ============================================================================== --- head/stand/libsa/ufs.c Fri Feb 16 15:38:22 2018 (r329374) +++ head/stand/libsa/ufs.c Fri Feb 16 15:41:03 2018 (r329375) @@ -687,6 +687,7 @@ ufs_use_sa_read(void *devfd, off_t loc, void **bufp, i int error; f = (struct open_file *)devfd; + free(*bufp); if ((*bufp = malloc(size)) == NULL) return (ENOSPC); error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, loc / DEV_BSIZE, Modified: head/sys/geom/geom_io.c ============================================================================== --- head/sys/geom/geom_io.c Fri Feb 16 15:38:22 2018 (r329374) +++ head/sys/geom/geom_io.c Fri Feb 16 15:41:03 2018 (r329375) @@ -966,6 +966,8 @@ g_use_g_read_data(void *devfd, off_t loc, void **bufp, */ if (loc % cp->provider->sectorsize != 0) return (ENOENT); + if (*bufp != NULL) + g_free(*bufp); *bufp = g_read_data(cp, loc, size, NULL); if (*bufp == NULL) return (ENOENT); Modified: head/sys/geom/journal/g_journal_ufs.c ============================================================================== --- head/sys/geom/journal/g_journal_ufs.c Fri Feb 16 15:38:22 2018 (r329374) +++ head/sys/geom/journal/g_journal_ufs.c Fri Feb 16 15:41:03 2018 (r329375) @@ -70,10 +70,13 @@ g_journal_ufs_dirty(struct g_consumer *cp) struct fs *fs; int error; + fs = NULL; if (SBLOCKSIZE % cp->provider->sectorsize != 0 || ffs_sbget(cp, &fs, -1, NULL, g_use_g_read_data) != 0) { GJ_DEBUG(0, "Cannot find superblock to mark file system %s " "as dirty.", cp->provider->name); + if (fs != NULL) + g_free(fs); return; } GJ_DEBUG(0, "clean=%d flags=0x%x", fs->fs_clean, fs->fs_flags); Modified: head/sys/geom/label/g_label_ufs.c ============================================================================== --- head/sys/geom/label/g_label_ufs.c Fri Feb 16 15:38:22 2018 (r329374) +++ head/sys/geom/label/g_label_ufs.c Fri Feb 16 15:41:03 2018 (r329375) @@ -75,9 +75,14 @@ g_label_ufs_taste_common(struct g_consumer *cp, char * pp = cp->provider; label[0] = '\0'; + fs = NULL; if (SBLOCKSIZE % pp->sectorsize != 0 || - ffs_sbget(cp, &fs, -1, NULL, g_use_g_read_data) != 0) + ffs_sbget(cp, &fs, -1, NULL, g_use_g_read_data) != 0) { + if (fs != NULL) + g_free(fs); return; + } + /* * Check for magic. We also need to check if file system size * is almost equal to providers size, because sysinstall(8) Modified: head/sys/ufs/ffs/ffs_subr.c ============================================================================== --- head/sys/ufs/ffs/ffs_subr.c Fri Feb 16 15:38:22 2018 (r329374) +++ head/sys/ufs/ffs/ffs_subr.c Fri Feb 16 15:41:03 2018 (r329375) @@ -172,6 +172,7 @@ ffs_sbget(void *devfd, struct fs **fsp, off_t altsuper int32_t *lp; char *buf; + *fsp = NULL; if (altsuperblock != -1) { if ((ret = readsuper(devfd, fsp, altsuperblock, readfunc)) != 0) return (ret); @@ -209,9 +210,11 @@ ffs_sbget(void *devfd, struct fs **fsp, off_t altsuper size = fs->fs_bsize; if (i + fs->fs_frag > blks) size = (blks - i) * fs->fs_fsize; + buf = NULL; ret = (*readfunc)(devfd, dbtob(fsbtodb(fs, fs->fs_csaddr + i)), (void **)&buf, size); if (ret) { + UFS_FREE(buf, filltype); UFS_FREE(fs->fs_csp, filltype); fs->fs_csp = NULL; return (ret); Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Fri Feb 16 15:38:22 2018 (r329374) +++ head/sys/ufs/ffs/ffs_vfsops.c Fri Feb 16 15:41:03 2018 (r329375) @@ -1075,6 +1075,7 @@ ffs_use_bread(void *devfd, off_t loc, void **bufp, int struct buf *bp; int error; + free(*bufp, M_UFSMNT); *bufp = malloc(size, M_UFSMNT, M_WAITOK); if ((error = bread((struct vnode *)devfd, btodb(loc), size, NOCRED, &bp)) != 0) { From owner-svn-src-head@freebsd.org Fri Feb 16 15: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 84ABFF1EA9C; Fri, 16 Feb 2018 15:41:17 +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 35C87806C9; Fri, 16 Feb 2018 15:41:17 +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 30B337963; Fri, 16 Feb 2018 15:41:17 +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 w1GFfGVe061553; Fri, 16 Feb 2018 15:41:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GFfG0j061551; Fri, 16 Feb 2018 15:41:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802161541.w1GFfG0j061551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 16 Feb 2018 15:41:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329376 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 329376 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 15:41:17 -0000 Author: hselasky Date: Fri Feb 16 15:41:16 2018 New Revision: 329376 URL: https://svnweb.freebsd.org/changeset/base/329376 Log: Implement tasklet_enable() and tasklet_disable() in the LinuxKPI. MFC after: 1 week Requested by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/interrupt.h head/sys/compat/linuxkpi/common/src/linux_tasklet.c Modified: head/sys/compat/linuxkpi/common/include/linux/interrupt.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/interrupt.h Fri Feb 16 15:41:03 2018 (r329375) +++ head/sys/compat/linuxkpi/common/include/linux/interrupt.h Fri Feb 16 15:41:16 2018 (r329376) @@ -200,5 +200,7 @@ extern void tasklet_schedule(struct tasklet_struct *); extern void tasklet_kill(struct tasklet_struct *); extern void tasklet_init(struct tasklet_struct *, tasklet_func_t *, unsigned long data); +extern void tasklet_enable(struct tasklet_struct *); +extern void tasklet_disable(struct tasklet_struct *); #endif /* _LINUX_INTERRUPT_H_ */ Modified: head/sys/compat/linuxkpi/common/src/linux_tasklet.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_tasklet.c Fri Feb 16 15:41:03 2018 (r329375) +++ head/sys/compat/linuxkpi/common/src/linux_tasklet.c Fri Feb 16 15:41:16 2018 (r329376) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #define TASKLET_ST_BUSY 1 #define TASKLET_ST_EXEC 2 #define TASKLET_ST_LOOP 3 +#define TASKLET_ST_PAUSED 4 #define TASKLET_ST_CMPSET(ts, old, new) \ atomic_cmpset_ptr((volatile uintptr_t *)&(ts)->entry.tqe_prev, old, new) @@ -195,4 +196,22 @@ tasklet_kill(struct tasklet_struct *ts) /* wait until tasklet is no longer busy */ while (TASKLET_ST_GET(ts) != TASKLET_ST_IDLE) pause("W", 1); +} + +void +tasklet_enable(struct tasklet_struct *ts) +{ + (void) TASKLET_ST_CMPSET(ts, TASKLET_ST_PAUSED, TASKLET_ST_IDLE); +} + +void +tasklet_disable(struct tasklet_struct *ts) +{ + while (1) { + if (TASKLET_ST_GET(ts) == TASKLET_ST_PAUSED) + break; + if (TASKLET_ST_CMPSET(ts, TASKLET_ST_IDLE, TASKLET_ST_PAUSED)) + break; + pause("W", 1); + } } From owner-svn-src-head@freebsd.org Fri Feb 16 15:52: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 EA8C9F1FEC1; Fri, 16 Feb 2018 15:52:28 +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 9F02682475; Fri, 16 Feb 2018 15:52:28 +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 99F057C75; Fri, 16 Feb 2018 15:52:28 +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 w1GFqSUd071488; Fri, 16 Feb 2018 15:52:28 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GFqSol071487; Fri, 16 Feb 2018 15:52:28 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802161552.w1GFqSol071487@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 16 Feb 2018 15:52:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329377 - 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: 329377 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 15:52:29 -0000 Author: hselasky Date: Fri Feb 16 15:52:28 2018 New Revision: 329377 URL: https://svnweb.freebsd.org/changeset/base/329377 Log: Implement memdup_user_nul() in the LinuxKPI. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/string.h Modified: head/sys/compat/linuxkpi/common/include/linux/string.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/string.h Fri Feb 16 15:41:16 2018 (r329376) +++ head/sys/compat/linuxkpi/common/include/linux/string.h Fri Feb 16 15:52:28 2018 (r329377) @@ -71,6 +71,22 @@ memdup_user(const void *ptr, size_t len) } static inline void * +memdup_user_nul(const void *ptr, size_t len) +{ + char *retval; + int error; + + retval = malloc(len + 1, M_KMALLOC, M_WAITOK); + error = linux_copyin(ptr, retval, len); + if (error != 0) { + free(retval, M_KMALLOC); + return (ERR_PTR(error)); + } + retval[len] = '\0'; + return (retval); +} + +static inline void * kmemdup(const void *src, size_t len, gfp_t gfp) { void *dst; From owner-svn-src-head@freebsd.org Fri Feb 16 16:01: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 1506BF208F9; Fri, 16 Feb 2018 16:01:40 +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 BB51882A05; Fri, 16 Feb 2018 16:01:39 +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 B66E37DC8; Fri, 16 Feb 2018 16:01:39 +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 w1GG1dU3072607; Fri, 16 Feb 2018 16:01:39 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GG1dhx072606; Fri, 16 Feb 2018 16:01:39 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802161601.w1GG1dhx072606@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 16 Feb 2018 16:01:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329378 - 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: 329378 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 16:01:40 -0000 Author: hselasky Date: Fri Feb 16 16:01:39 2018 New Revision: 329378 URL: https://svnweb.freebsd.org/changeset/base/329378 Log: Implement mutex_trylock_recursive() in the LinuxKPI. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/mutex.h Modified: head/sys/compat/linuxkpi/common/include/linux/mutex.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/mutex.h Fri Feb 16 15:52:28 2018 (r329377) +++ head/sys/compat/linuxkpi/common/include/linux/mutex.h Fri Feb 16 16:01:39 2018 (r329378) @@ -77,6 +77,21 @@ typedef struct mutex { !!sx_try_xlock(&(_m)->sx); \ }) +enum mutex_trylock_recursive_enum { + MUTEX_TRYLOCK_FAILED = 0, + MUTEX_TRYLOCK_SUCCESS = 1, + MUTEX_TRYLOCK_RECURSIVE = 2, +}; + +static inline __must_check enum mutex_trylock_recursive_enum +mutex_trylock_recursive(struct mutex *lock) +{ + if (unlikely(sx_xholder(&lock->sx) == curthread)) + return (MUTEX_TRYLOCK_RECURSIVE); + + return (mutex_trylock(lock)); +} + #define mutex_init(_m) \ linux_mutex_init(_m, mutex_name(#_m), SX_NOWITNESS) From owner-svn-src-head@freebsd.org Fri Feb 16 16:22: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 A1F89F2228D; Fri, 16 Feb 2018 16:22:55 +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 5195F83BB8; Fri, 16 Feb 2018 16:22:55 +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 4C27A1013C; Fri, 16 Feb 2018 16:22:55 +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 w1GGMthj086460; Fri, 16 Feb 2018 16:22:55 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GGMtEj086459; Fri, 16 Feb 2018 16:22:55 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201802161622.w1GGMtEj086459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 16 Feb 2018 16:22:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329382 - head/release/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/release/arm64 X-SVN-Commit-Revision: 329382 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 16:22:55 -0000 Author: andrew Date: Fri Feb 16 16:22:54 2018 New Revision: 329382 URL: https://svnweb.freebsd.org/changeset/base/329382 Log: Put the pine64 root filesystem on teh correct partition. The Pine64 root filesystem was incorrectly created directly on the MBR partition. This can cause the loader to get confused when loading the kernel from this filesystem. The loader will see this as a small partition meaning later checks to ensure it doesn't read past the end of the disk incorrectly report a failure. This seems to work mostly by accident with the released images as they are smaller than the reported size, however after growfs has run the image may no longer boot. Reviewed by: gjb, emaste, imp Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14343 Modified: head/release/arm64/PINE64.conf Modified: head/release/arm64/PINE64.conf ============================================================================== --- head/release/arm64/PINE64.conf Fri Feb 16 16:16:33 2018 (r329381) +++ head/release/arm64/PINE64.conf Fri Feb 16 16:22:54 2018 (r329382) @@ -11,7 +11,7 @@ FAT_SIZE="54m -b 1m" FAT_TYPE="16" IMAGE_SIZE="2560M" KERNEL="GENERIC" -MD_ARGS="-x 16384 -y 255" +MD_ARGS="-x 63 -y 255" NODOC=1 PART_SCHEME="MBR" export BOARDNAME="PINE64" @@ -25,7 +25,7 @@ arm_install_uboot() { of=/dev/${mddev} bs=1k seek=8 conv=sync chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} - chroot ${CHROOTDIR} mount /dev/${mddev}s2 ${UFSMOUNT} + chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} BOOTFILES="$(chroot ${CHROOTDIR} \ env TARGET=${EMBEDDED_TARGET} TARGET_ARCH=${EMBEDDED_TARGET_ARCH} \ From owner-svn-src-head@freebsd.org Fri Feb 16 16:37: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 29491F2321E for ; Fri, 16 Feb 2018 16:37:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22d.google.com (mail-it0-x22d.google.com [IPv6:2607:f8b0:4001:c0b::22d]) (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 AC5A98447C for ; Fri, 16 Feb 2018 16:37:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22d.google.com with SMTP id w63so2432104ita.3 for ; Fri, 16 Feb 2018 08:37:38 -0800 (PST) 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=IAS4hNilnPgjonYhMZABZ/Bvn369ymYEN3iJhTjkIvA=; b=y4Bn5T1RH2T5HGPLqfEulD3OtDthzOOl81/DQ7YKVQoZtkp0YK+1d6ND9N/Tg/k66s iXiPJ5s2Ql6ukxu2BSvIRa4RxRQDaYn+cZ3DWXR+BhJYaS5aD40VoOGKDunzaX6+v6zj QKh7y5g2PrTZHqGczno0IJ70QS+MZLpvinUn3JPOyd5bJvvdc1i+ZkXkKZeaVCba38YW AY8z1BtyQESqO6lQOnELgVNhs2sd2fN6sY9rnP3bcPC7CAOkUzE28Fd2Np37QGfkjxAp Uc372Z4Kathcbsgikur+6F1u5KL/4nFpc9onxIL1jb6hSXdVexRzukIghRtdYbIsfrq+ /fJQ== 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=IAS4hNilnPgjonYhMZABZ/Bvn369ymYEN3iJhTjkIvA=; b=fV+weFgLJPGgVf9mpxFgJlMVyuRuSPJrlJF99Fc+gJKuXH/3dr+G5B4QZZ1WgByq8W XjnerVjInc2rttrQpthYoBy2L21oomN3cQJxISHIRGy+XPItYKFJS+tj8fpy1fB3Vuyz KdsNZkbwSpG+qXdtRNsWG+GIC5eRppUnlGT3PVkVgYr+rVe07OKc9rVZsX+a5WoxsDLx SNJqT/xNwPhheFBaOTwtJ9lwYTynFrElPfJCD1lK0YCuykeywlcgKF3aJrp5Npgs+92N OxcQYnkb+EOdMpApA5yiFX9X4EAAJrI1CiSFs7Bc7ySGM8Rr0983QyKOrw6hdvEx9oJH jXQw== X-Gm-Message-State: APf1xPDaj6ysG4ZBOZ2muTmw/h5e5ZFSURaHhIcDame5Cw9D73tCJtiA 7Yiz7meE9CFJKOLNtvI/dK8+3unTlccPoEXVwCrwQg== X-Google-Smtp-Source: AH8x227btpQZvFvT6spPG1h9AAdhIQRDFFEwhGNnJi61PFnV4htUKx0eMbRjtKF5IfdN/4eBntSqqoNzbwYxdUlON58= X-Received: by 10.36.201.66 with SMTP id h63mr6572248itg.36.1518799057999; Fri, 16 Feb 2018 08:37:37 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Fri, 16 Feb 2018 08:37:37 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: References: <201802160312.w1G3CO3r085739@repo.freebsd.org> From: Warner Losh Date: Fri, 16 Feb 2018 09:37:37 -0700 X-Google-Sender-Auth: C7x2lwvvtYTVkghKhJLE6gNzFFE Message-ID: Subject: Re: svn commit: r329349 - head/stand/lua To: Kyle Evans 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.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 16:37:39 -0000 On Feb 16, 2018 6:58 AM, "Kyle Evans" wrote: On Thu, Feb 15, 2018 at 9:12 PM, Kyle Evans wrote: > Author: kevans > Date: Fri Feb 16 03:12:24 2018 > New Revision: 329349 > URL: https://svnweb.freebsd.org/changeset/base/329349 > > Log: > stand/lua: Reduce magic numbers > > Enter/backspace values are hardcoded in both the menu and password scripts. > Separate these out to core for reuse between the two. > > Modified: > head/stand/lua/core.lua > head/stand/lua/menu.lua > head/stand/lua/password.lua > > Modified: head/stand/lua/core.lua > ============================================================ ================== > --- head/stand/lua/core.lua Fri Feb 16 01:33:01 2018 (r329348) > +++ head/stand/lua/core.lua Fri Feb 16 03:12:24 2018 (r329349) > @@ -28,6 +28,10 @@ > > local core = {}; > > +-- Commonly appearing constants > +core.KEY_ENTER = 13 > +core.KEY_BACKSPACE = 127 > + > function core.setVerbose(b) > if (b == nil) then > b = not core.verbose; > > Modified: head/stand/lua/menu.lua > ============================================================ ================== > --- head/stand/lua/menu.lua Fri Feb 16 01:33:01 2018 (r329348) > +++ head/stand/lua/menu.lua Fri Feb 16 03:12:24 2018 (r329349) > @@ -273,9 +273,9 @@ function menu.run(m) > local key = io.getchar(); > > -- Special key behaviors > - if (key == 127) and (m ~= menu.welcome) then > + if (key == core.KEY_BACKSPACE) and (m ~= menu.welcome) then > break > - elseif (key == 13) then > + elseif (key == core.KEY_ENTER) then > core.boot(); > -- Should not return > end > @@ -357,7 +357,7 @@ function menu.autoboot() > screen.defcursor(); > if io.ischar() then > local ch = io.getchar(); > - if ch == 13 then > + if ch == core.KEY_ENTER then > break; > else > -- prevent autoboot when escaping to interpreter > > Modified: head/stand/lua/password.lua > ============================================================ ================== > --- head/stand/lua/password.lua Fri Feb 16 01:33:01 2018 (r329348) > +++ head/stand/lua/password.lua Fri Feb 16 03:12:24 2018 (r329349) > @@ -37,11 +37,11 @@ function password.read() > > repeat > ch = io.getchar(); > - if ch == 13 then > + if ch == core.KEY_ENTER then > break; > end > > - if ch == 8 then > + if ch == core.KEY_BACKSPACE then It's worth noting that this changes the comparison from 'ch == 8' to 'ch == 127'. The password prompt was non-functional on my test systems until this change, because I can never type my password right the first time. =) Pointed out by: cem@ History has shown we likely want to accept both BS (8) and DEL (127) as logical 'backwards erase character' signals. Warner From owner-svn-src-head@freebsd.org Fri Feb 16 16: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 9BED2F2346F; Fri, 16 Feb 2018 16:38:49 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf0-x230.google.com (mail-lf0-x230.google.com [IPv6:2a00:1450:4010:c07::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 739D584640; Fri, 16 Feb 2018 16:38:48 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf0-x230.google.com with SMTP id f136so4824214lff.8; Fri, 16 Feb 2018 08:38:48 -0800 (PST) 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=9papF+cGJvCk+mNDp5UJdF2GIVU8zFxYGnfOQbNSEJI=; b=lK1g3DjgSargBW1ZgENZKTh3XUhKNzoN/n/RqGn844xT7p095eCbeiFbfovQ/GSBUK YnKU/AyBU27WLPiRAYRKLoIi9D+QDZ7IJO6mQLWi0VVbFReDhNDP3cfWIGhVLL+20HoH uOOuIVNbW3YkpBmPox7nKT9LGZKC4V2Dt7cdrtecm0TfYoNff7Jyu1f22mgEReBBJP7B TtwpTDvI08L6PsPk/Seoq54Civ2i8CQXtoqQRolaXLEFIx9E6jar2tyB/j0nDJM0MfGN UkiF6D8tcfsXaW2v9tdzRF0//+dH34KOH6wJBgb5+tQuGhDCjbbcUY3oP8Ib6NHmINQx pMtg== 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=9papF+cGJvCk+mNDp5UJdF2GIVU8zFxYGnfOQbNSEJI=; b=DMSTWEzErSAxULQ3q7eTP7Cfsi8usTl+0CKhm7OPSJYQCWCn8emGJcDJctoAapXNso BsdQQOaaaIPtBF6gdPY+WXvbNO3v55go4xWBIRNQbdZHulOMyP1ryfCdg4VhNfsS4Te7 7C5wgvfSK9jCTPXOkRGvX3iienRTa+6YNMSlijRifZeRcCXWjykGMmmk/H6oDavGWv8q LSycPGQrqeyxlOQ4wouX5S6Z10L8aZnKsW5dUyNOO6d5MUnJHwe+xG5dDH6uUXJhVyf0 9RkvpIJ8KfiRu/v0y1l0zuK8+zkGhYPGyJ5Sb7ipwLOdopgalMNyiuh0oo4/p6sZSb4K dVKQ== X-Gm-Message-State: APf1xPB2LNF1dw8BkQtwDcLYtt1/oCXb8MjxYst7BqbUTVp2f4JqbR6G V/529YWuwgElHWE++urjdmiw2qW6b1Fa3zV/pYY= X-Google-Smtp-Source: AH8x2263kdJ0ie0gY53oD7YXFTIsomZFiMAIUZw5aCTSC5rEkvJVSjg7fZWCfv8QFIvDIwMR6klfmy1pHlkpwYHeTkU= X-Received: by 10.46.77.197 with SMTP id c66mr1278378ljd.116.1518799126576; Fri, 16 Feb 2018 08:38:46 -0800 (PST) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.179.30.35 with HTTP; Fri, 16 Feb 2018 08:38:45 -0800 (PST) In-Reply-To: <3148002.4yJvN52HMT@ralph.baldwin.cx> References: <201802141549.w1EFnVBV064848@repo.freebsd.org> <3148002.4yJvN52HMT@ralph.baldwin.cx> From: Alan Somers Date: Fri, 16 Feb 2018 09:38:45 -0700 X-Google-Sender-Auth: N-Ysu6lUti1XxtKG-9LzclcHh3s Message-ID: Subject: Re: svn commit: r329265 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs To: John Baldwin 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.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 16:38:49 -0000 On Thu, Feb 15, 2018 at 12:18 PM, John Baldwin wrote: > On Wednesday, February 14, 2018 03:49:31 PM Alan Somers wrote: > > Author: asomers > > Date: Wed Feb 14 15:49:31 2018 > > New Revision: 329265 > > URL: https://svnweb.freebsd.org/changeset/base/329265 > > > > Log: > > Implement .vop_pathconf and .vop_getacl for the .zfs ctldir > > > > zfsctl_common_pathconf will report all the same variables that regular > ZFS > > volumes report. zfsctl_common_getacl will report an ACL equivalent to > 555, > > except that you can't read xattrs or edit attributes. > > > > Fixes a bug where "ls .zfs" will occasionally print something like: > > ls: .zfs/.: Operation not supported > > > > PR: 225793 > > Reviewed by: avg > > MFC after: 3 weeks > > Sponsored by: Spectra Logic Corp > > Differential Revision: https://reviews.freebsd.org/D14365 > > > > Modified: > > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c > > > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ > zfs_ctldir.c > > ============================================================ > ================== > > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c > Wed Feb 14 15:40:13 2018 (r329264) > > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c > Wed Feb 14 15:49:31 2018 (r329265) > > @@ -80,6 +80,10 @@ > > > > #include "zfs_namecheck.h" > > > > +/* Common access mode for all virtual directories under the ctldir */ > > +const u_short zfsctl_ctldir_mode = S_IRUSR | S_IXUSR | S_IRGRP | > S_IXGRP | > > + S_IROTH | S_IXOTH; > > + > > /* > > * "Synthetic" filesystem implementation. > > */ > > @@ -496,8 +500,7 @@ zfsctl_common_getattr(vnode_t *vp, vattr_t *vap) > > vap->va_nblocks = 0; > > vap->va_seq = 0; > > vn_fsid(vp, vap); > > - vap->va_mode = S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | > > - S_IROTH | S_IXOTH; > > + vap->va_mode = zfsctl_ctldir_mode; > > vap->va_type = VDIR; > > /* > > * We live in the now (for atime). > > @@ -724,6 +727,87 @@ zfsctl_root_vptocnp(struct vop_vptocnp_args *ap) > > return (0); > > } > > > > +static int > > +zfsctl_common_pathconf(ap) > > + struct vop_pathconf_args /* { > > + struct vnode *a_vp; > > + int a_name; > > + int *a_retval; > > + } */ *ap; > > +{ > > + /* > > + * We care about ACL variables so that user land utilities like ls > > + * can display them correctly. Since the ctldir's st_dev is set > to be > > + * the same as the parent dataset, we must support all variables > that > > + * it supports. > > + */ > > + switch (ap->a_name) { > > + case _PC_LINK_MAX: > > + *ap->a_retval = INT_MAX; > > + return (0); > > On HEAD this should probably match the existing ZFS pathconf > (min(LONG_MAX, ZFS_LINK_MAX IIRC), though if these directories can only > ever have a link count of 2 (which seems true from zfsctl_common_getattr()) > then it would be fine to return '2' here instead. For stable you'd have to > restrict it to LINK_MAX if you don't use '2'. > > Also, you should call vfs_stdpathconf() in the default: case. > > -- > John Baldwin > All good points. I don't think a max link count of 2 is correct, though, because the real link count can be higher than that. See zfsctl_root_getattr and zfsctl_snapdir_getattr. I'll set it the way that zfs_pathconf does. Also, it looks like I need to add _PC_NAME_MAX. -Alan From owner-svn-src-head@freebsd.org Fri Feb 16 16:44: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 8B403F23DC7; Fri, 16 Feb 2018 16:44:49 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-it0-x22d.google.com (mail-it0-x22d.google.com [IPv6:2607:f8b0:4001:c0b::22d]) (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 1FA1084E8F; Fri, 16 Feb 2018 16:44:49 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-it0-x22d.google.com with SMTP id d10so2528670itj.2; Fri, 16 Feb 2018 08:44:49 -0800 (PST) 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=21b71FkJSNeKb2i/Hxhab5fUhTZTMTBoXfxqlN/A3NI=; b=NoGxtFjfEMVq7Yp0c9IZMKI0HIyR1QoMM8EUDylU6cFESeSsWw53H/a/cyI4wrjHHq 9ZACtOCQNtR6I9Puz738WnUF+nMqprETJHvWyz1AWbuivlzC6CSGPkDaL7XCwhPvdNwz cxGgeP2IX/kpKQbtWT0X+7kG5Vi7kwt3wTLBsXOOWfKQr3CXEkEQFoWrPWAUN6wH3XaN PJ82CQ/6ROui2f6IY77UXOSeVBymM067dCsKwu43NRiDChA+k5wk02ij72/drw1d4BVc y+bP9azlXLwmw/RW2nDJYCefo6I94hVhtaq7vqb9Q/Qlvt16WCZBpWSuh87EW5rBD1FA qKTA== 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=21b71FkJSNeKb2i/Hxhab5fUhTZTMTBoXfxqlN/A3NI=; b=q/mqbGuaqGp3gbDak3GrWCcYt727ZBcHhrpNHQlgJj1cWnLeQ8/JQQMQIKHU/f+pqW 1AwRSczzCO9n+ywOb4/nmjyreGLuYOqvc1Oj+LvWM5qbODVROeKC6vVpcloFQOc3CDFv chMsgKQfcuOxa3tVDB66hb4rLlVNGZO9pjzb71kn9w51nk8Tvro/ZtbBdd8t5sqfV+xl N40oHdzG/rSqiybkUAA8+p8nnokiB97Xoj+IaBnsnQYjSGMZIRhiBYOtP/0daULTP91f JjRhtXZY16pJK9iwCiQKL4+8NyCqch9sQHNdmlKFwl2fBFww/FlrA31b0cL/PbH+260t Lq3A== X-Gm-Message-State: APf1xPDx3Rqzj787caeWGzuy+tBhncU47hR0ors8kBwcF47/6FGNku0g MeZS1/GvHfLtZUu4/5s/fZDUvQ== X-Google-Smtp-Source: AH8x224ioOmoaEEn3oBKcTEHi1JnfJCoX+WHeYMLDMUVcB8AwCWVPAIbIQreSDj6s9FbelD1EG0iPg== X-Received: by 10.36.198.194 with SMTP id j185mr8933472itg.140.1518799488176; Fri, 16 Feb 2018 08:44:48 -0800 (PST) Received: from raichu (toroon0560w-lp130-01-174-88-76-226.dsl.bell.ca. [174.88.76.226]) by smtp.gmail.com with ESMTPSA id k204sm17617378iok.68.2018.02.16.08.44.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Feb 2018 08:44:47 -0800 (PST) Sender: Mark Johnston Date: Fri, 16 Feb 2018 11:44:45 -0500 From: Mark Johnston To: Benno Rice Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329269 - head/stand/i386/boot2 Message-ID: <20180216164445.GB55620@raichu> References: <201802141807.w1EI7Ror036078@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201802141807.w1EI7Ror036078@repo.freebsd.org> User-Agent: Mutt/1.9.3 (2018-01-21) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 16:44:49 -0000 On Wed, Feb 14, 2018 at 06:07:27PM +0000, Benno Rice wrote: > Author: benno > Date: Wed Feb 14 18:07:27 2018 > New Revision: 329269 > URL: https://svnweb.freebsd.org/changeset/base/329269 > > Log: > Reformat to come significantly closer to style(9). > > Reviewed by: imp, jhibbits > Differential Revision: https://reviews.freebsd.org/D14366 > > Modified: > head/stand/i386/boot2/boot2.c > > Modified: head/stand/i386/boot2/boot2.c > ============================================================================== > --- head/stand/i386/boot2/boot2.c Wed Feb 14 18:05:37 2018 (r329268) > +++ head/stand/i386/boot2/boot2.c Wed Feb 14 18:07:27 2018 (r329269) > [...] > #if SERIAL > - } else if (c == 'S') { > - j = 0; > - while ((unsigned int)(i = *arg++ - '0') <= 9) > - j = j * 10 + i; > - if (j > 0 && i == -'0') { > - comspeed = j; > - break; > - } > - /* Fall through to error below ('S' not in optstr[]). */ > + } else if (c == 'S') { > + j = 0; > + while (*arg <= '9') { > + i = (unsigned int)(*arg - '0'); > + j = j * 10 + i; > + arg++; > + } > + if (j > 0 && i == -'0') { > + comspeed = j; > + break; > + } The gcc build is failing now with a claim that "i" may be used uninitialized in the if-statement above. It looks like a bogus error though. From owner-svn-src-head@freebsd.org Fri Feb 16 16:56: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 E959BF24A30; Fri, 16 Feb 2018 16:56:09 +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 9B911858DA; Fri, 16 Feb 2018 16:56:09 +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 95FA610635; Fri, 16 Feb 2018 16:56:09 +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 w1GGu9Bb001828; Fri, 16 Feb 2018 16:56:09 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GGu9VR001827; Fri, 16 Feb 2018 16:56:09 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201802161656.w1GGu9VR001827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 16 Feb 2018 16:56:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329384 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 329384 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 16:56:10 -0000 Author: asomers Date: Fri Feb 16 16:56:09 2018 New Revision: 329384 URL: https://svnweb.freebsd.org/changeset/base/329384 Log: Handle generic pathconf attributes in the .zfs ctldir MFC instructions: change the value of _PC_LINK_MAX to INT_MAX Reported by: jhb MFC after: 19 days X-MFC-With: 329265 Sponsored by: Spectra Logic Corp Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Fri Feb 16 16:41:19 2018 (r329383) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Fri Feb 16 16:56:09 2018 (r329384) @@ -743,7 +743,7 @@ zfsctl_common_pathconf(ap) */ switch (ap->a_name) { case _PC_LINK_MAX: - *ap->a_retval = INT_MAX; + *ap->a_retval = MIN(LONG_MAX, ZFS_LINK_MAX); return (0); case _PC_FILESIZEBITS: @@ -766,8 +766,12 @@ zfsctl_common_pathconf(ap) *ap->a_retval = ACL_MAX_ENTRIES; return (0); + case _PC_NAME_MAX: + *ap->a_retval = NAME_MAX; + return (0); + default: - return (EINVAL); + return (vop_stdpathconf(ap)); } } From owner-svn-src-head@freebsd.org Fri Feb 16 17:42: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 A7282F031D0; Fri, 16 Feb 2018 17:42: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 5939887E9D; Fri, 16 Feb 2018 17:42:39 +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 5405610E6D; Fri, 16 Feb 2018 17:42:39 +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 w1GHgdWU026933; Fri, 16 Feb 2018 17:42:39 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GHgdDk026930; Fri, 16 Feb 2018 17:42:39 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802161742.w1GHgdDk026930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 17:42:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329386 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329386 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 17:42:39 -0000 Author: kevans Date: Fri Feb 16 17:42:38 2018 New Revision: 329386 URL: https://svnweb.freebsd.org/changeset/base/329386 Log: stand/lua: Correct usage and acceptance of BACKSPACE/DELETE keys Modified: head/stand/lua/core.lua head/stand/lua/menu.lua head/stand/lua/password.lua Modified: head/stand/lua/core.lua ============================================================================== --- head/stand/lua/core.lua Fri Feb 16 17:08:42 2018 (r329385) +++ head/stand/lua/core.lua Fri Feb 16 17:42:38 2018 (r329386) @@ -29,8 +29,9 @@ local core = {}; -- Commonly appearing constants +core.KEY_BACKSPACE = 8; core.KEY_ENTER = 13; -core.KEY_BACKSPACE = 127; +core.KEY_DELETE = 127; core.KEYSTR_ESCAPE = "\027"; Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Fri Feb 16 17:08:42 2018 (r329385) +++ head/stand/lua/menu.lua Fri Feb 16 17:42:38 2018 (r329386) @@ -266,7 +266,8 @@ function menu.run(m) local key = io.getchar(); -- Special key behaviors - if (key == core.KEY_BACKSPACE) and (m ~= menu.welcome) then + if ((key == core.KEY_BACKSPACE) or (key == core.KEY_DELETE)) and + (m ~= menu.welcome) then break elseif (key == core.KEY_ENTER) then core.boot(); Modified: head/stand/lua/password.lua ============================================================================== --- head/stand/lua/password.lua Fri Feb 16 17:08:42 2018 (r329385) +++ head/stand/lua/password.lua Fri Feb 16 17:42:38 2018 (r329386) @@ -41,7 +41,7 @@ function password.read() break; end - if ch == core.KEY_BACKSPACE then + if (ch == core.KEY_BACKSPACE) or (ch == core.KEY_DELETE) then if n > 0 then n = n - 1; -- loader.printc("\008 \008"); From owner-svn-src-head@freebsd.org Fri Feb 16 17:46: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 DD804F0354A; Fri, 16 Feb 2018 17:46:07 +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 8F11B68130; Fri, 16 Feb 2018 17:46:07 +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 89E2D10E6F; Fri, 16 Feb 2018 17:46:07 +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 w1GHk7jG027122; Fri, 16 Feb 2018 17:46:07 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GHk72A027121; Fri, 16 Feb 2018 17:46:07 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802161746.w1GHk72A027121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 17:46:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329387 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329387 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 17:46:08 -0000 Author: kevans Date: Fri Feb 16 17:46:07 2018 New Revision: 329387 URL: https://svnweb.freebsd.org/changeset/base/329387 Log: stand/lua: Chop off the decimal for numbers passed to setcursor Decimals screw up the escape sequence and the cursor will not get set. Right now this only affects setting the cursor for drawing "Welcome to FreeBSD" -- the resulting number after our (x+(w/2)-9) calculation gets output as "14.0." This should be fixed at the interpreter level, rather than here, but this is not a widespread problem at the moment so we'll fix it up in further work. Reported by: David Wolfskill Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D14375 Modified: head/stand/lua/screen.lua Modified: head/stand/lua/screen.lua ============================================================================== --- head/stand/lua/screen.lua Fri Feb 16 17:42:38 2018 (r329386) +++ head/stand/lua/screen.lua Fri Feb 16 17:46:07 2018 (r329387) @@ -31,6 +31,17 @@ local screen = {}; local color = require("color"); local core = require("core"); +-- XXX TODO: This should be fixed in the interpreter to not print decimals +function intstring(num) + local str = tostring(num) + local decimal = string.find(str, "[.]") + + if decimal then + return string.sub(str, 1, decimal - 1) + end + return str +end + function screen.clear() if core.bootserial() then return; @@ -42,7 +53,8 @@ function screen.setcursor(x, y) if core.bootserial() then return; end - loader.printc("\027["..y..";"..x.."H"); + + loader.printc("\027["..intstring(y)..";"..intstring(x).."H"); end function screen.setforeground(c) From owner-svn-src-head@freebsd.org Fri Feb 16 17:50: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 925B2F03A73; Fri, 16 Feb 2018 17:50:07 +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 434CC68727; Fri, 16 Feb 2018 17:50:07 +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 39DBA10E7E; Fri, 16 Feb 2018 17:50:07 +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 w1GHo71m027494; Fri, 16 Feb 2018 17:50:07 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GHo7V0027493; Fri, 16 Feb 2018 17:50:07 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201802161750.w1GHo7V0027493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Fri, 16 Feb 2018 17:50:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329388 - head/sys/contrib/ck/include X-SVN-Group: head X-SVN-Commit-Author: cognet X-SVN-Commit-Paths: head/sys/contrib/ck/include X-SVN-Commit-Revision: 329388 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 17:50:07 -0000 Author: cognet Date: Fri Feb 16 17:50:06 2018 New Revision: 329388 URL: https://svnweb.freebsd.org/changeset/base/329388 Log: Define CK_MD_TSO for the relevant arches (i386, amd64 and sparc64). Defaulting to CK_MD_RMO has the unfortunate side effect of generating memory barriers that are useless on those arches, and the even more unfortunate side effect of generating lfence/sfence/mfence on i386, even if older CPUs don't support it. This should fix the panic reported when using IPFW on a Pentium 3. Note that mfence and sfence might still be used in a few case, but that shouldn't happen in FreeBSD right now, and should be fixed upstream first. MFC after: 1 week Modified: head/sys/contrib/ck/include/ck_md.h Modified: head/sys/contrib/ck/include/ck_md.h ============================================================================== --- head/sys/contrib/ck/include/ck_md.h Fri Feb 16 17:46:07 2018 (r329387) +++ head/sys/contrib/ck/include/ck_md.h Fri Feb 16 17:50:06 2018 (r329388) @@ -53,10 +53,6 @@ #define CK_PR_DISABLE_DOUBLE #endif /* CK_PR_DISABLE_DOUBLE */ -#ifndef CK_MD_RMO -#define CK_MD_RMO -#endif /* CK_MD_RMO */ - #define CK_VERSION "0.6.0" #define CK_GIT_SHA "" @@ -65,11 +61,20 @@ */ #if defined(__i386__) && !defined(__x86__) #define __x86__ +#define CK_MD_TSO +#elif defined(__amd64__) +#define CK_MD_TSO #elif defined(__sparc64__) && !defined(__sparcv9__) #define __sparcv9__ +#define CK_MD_TSO #elif defined(__powerpc64__) && !defined(__ppc64__) #define __ppc64__ #elif defined(__powerpc__) && !defined(__ppc__) #define __ppc__ #endif + +#if !defined(CK_MD_RMO) && !defined(CK_MD_TSO) && !defined(CK_MD_PSO) +#define CK_MD_RMO +#endif + #endif /* CK_MD_H */ From owner-svn-src-head@freebsd.org Fri Feb 16 18:04: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 A20CFF04B16; Fri, 16 Feb 2018 18:04:28 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5537E69562; Fri, 16 Feb 2018 18:04:28 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4E8EF111D4; Fri, 16 Feb 2018 18:04:28 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1GI4SGg037885; Fri, 16 Feb 2018 18:04:28 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GI4SMo037884; Fri, 16 Feb 2018 18:04:28 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201802161804.w1GI4SMo037884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Fri, 16 Feb 2018 18:04:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329389 - head/sys/x86/xen X-SVN-Group: head X-SVN-Commit-Author: royger X-SVN-Commit-Paths: head/sys/x86/xen X-SVN-Commit-Revision: 329389 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 18:04:28 -0000 Author: royger Date: Fri Feb 16 18:04:27 2018 New Revision: 329389 URL: https://svnweb.freebsd.org/changeset/base/329389 Log: xen/pv: remove the attach of the ISA bus from the Xen PV bus There's no need to attach the ISA bus from the Xen PV one. Sponsored by: Citrix Systems R&D Modified: head/sys/x86/xen/xenpv.c Modified: head/sys/x86/xen/xenpv.c ============================================================================== --- head/sys/x86/xen/xenpv.c Fri Feb 16 17:50:06 2018 (r329388) +++ head/sys/x86/xen/xenpv.c Fri Feb 16 18:04:27 2018 (r329389) @@ -93,24 +93,20 @@ xenpv_probe(device_t dev) static int xenpv_attach(device_t dev) { - device_t child; + int error; /* * Let our child drivers identify any child devices that they * can find. Once that is done attach any devices that we * found. */ - bus_generic_probe(dev); - bus_generic_attach(dev); + error = bus_generic_probe(dev); + if (error) + return (error); - if (!devclass_get_device(devclass_find("isa"), 0)) { - child = BUS_ADD_CHILD(dev, 0, "isa", 0); - if (child == NULL) - panic("Failed to attach ISA bus."); - device_probe_and_attach(child); - } + error = bus_generic_attach(dev); - return (0); + return (error); } static struct resource * From owner-svn-src-head@freebsd.org Fri Feb 16 18:07: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 0128BF04DBC; Fri, 16 Feb 2018 18:07:05 +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 A952F69742; Fri, 16 Feb 2018 18:07:04 +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 A4277111D6; Fri, 16 Feb 2018 18:07:04 +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 w1GI744x038036; Fri, 16 Feb 2018 18:07:04 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GI74Z1038034; Fri, 16 Feb 2018 18:07:04 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201802161807.w1GI74Z1038034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Fri, 16 Feb 2018 18:07:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329390 - head/usr.bin/ipcs X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/usr.bin/ipcs X-SVN-Commit-Revision: 329390 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 18:07:05 -0000 Author: lwhsu (ports committer) Date: Fri Feb 16 18:07:04 2018 New Revision: 329390 URL: https://svnweb.freebsd.org/changeset/base/329390 Log: Follow r329348 in ipcs for getting rid of the requirement to include SysV IPC headers with _KERNEL Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D14398 Modified: head/usr.bin/ipcs/ipc.c head/usr.bin/ipcs/ipcs.c Modified: head/usr.bin/ipcs/ipc.c ============================================================================== --- head/usr.bin/ipcs/ipc.c Fri Feb 16 18:04:27 2018 (r329389) +++ head/usr.bin/ipcs/ipc.c Fri Feb 16 18:07:04 2018 (r329390) @@ -35,11 +35,12 @@ __FBSDID("$FreeBSD$"); #include #include -#define _KERNEL +#define _WANT_SYSVMSG_INTERNALS +#include +#define _WANT_SYSVSEM_INTERNALS #include +#define _WANT_SYSVSHM_INTERNALS #include -#include -#undef _KERNEL #include #include Modified: head/usr.bin/ipcs/ipcs.c ============================================================================== --- head/usr.bin/ipcs/ipcs.c Fri Feb 16 18:04:27 2018 (r329389) +++ head/usr.bin/ipcs/ipcs.c Fri Feb 16 18:07:04 2018 (r329390) @@ -32,11 +32,12 @@ __FBSDID("$FreeBSD$"); #include #include -#define _KERNEL +#define _WANT_SYSVMSG_INTERNALS +#include +#define _WANT_SYSVSEM_INTERNALS #include +#define _WANT_SYSVSHM_INTERNALS #include -#include -#undef _KERNEL #include #include From owner-svn-src-head@freebsd.org Fri Feb 16 18:37: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 896ABF06FCE; Fri, 16 Feb 2018 18:37:12 +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 17E986AC0C; Fri, 16 Feb 2018 18:37:12 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 23D6B10AFAD; Fri, 16 Feb 2018 13:37:11 -0500 (EST) From: John Baldwin To: Mark Johnston Cc: Benno Rice , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329269 - head/stand/i386/boot2 Date: Fri, 16 Feb 2018 09:58:04 -0800 Message-ID: <2488298.mWgVtp3Hqz@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <20180216164445.GB55620@raichu> References: <201802141807.w1EI7Ror036078@repo.freebsd.org> <20180216164445.GB55620@raichu> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 16 Feb 2018 13:37:11 -0500 (EST) 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.25 Precedence: list List-Id: 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, 16 Feb 2018 18:37:12 -0000 On Friday, February 16, 2018 11:44:45 AM Mark Johnston wrote: > On Wed, Feb 14, 2018 at 06:07:27PM +0000, Benno Rice wrote: > > Author: benno > > Date: Wed Feb 14 18:07:27 2018 > > New Revision: 329269 > > URL: https://svnweb.freebsd.org/changeset/base/329269 > > > > Log: > > Reformat to come significantly closer to style(9). > > > > Reviewed by: imp, jhibbits > > Differential Revision: https://reviews.freebsd.org/D14366 > > > > Modified: > > head/stand/i386/boot2/boot2.c > > > > Modified: head/stand/i386/boot2/boot2.c > > ============================================================================== > > --- head/stand/i386/boot2/boot2.c Wed Feb 14 18:05:37 2018 (r329268) > > +++ head/stand/i386/boot2/boot2.c Wed Feb 14 18:07:27 2018 (r329269) > > [...] > > #if SERIAL > > - } else if (c == 'S') { > > - j = 0; > > - while ((unsigned int)(i = *arg++ - '0') <= 9) > > - j = j * 10 + i; > > - if (j > 0 && i == -'0') { > > - comspeed = j; > > - break; > > - } > > - /* Fall through to error below ('S' not in optstr[]). */ > > + } else if (c == 'S') { > > + j = 0; > > + while (*arg <= '9') { > > + i = (unsigned int)(*arg - '0'); > > + j = j * 10 + i; > > + arg++; > > + } > > + if (j > 0 && i == -'0') { > > + comspeed = j; > > + break; > > + } > > The gcc build is failing now with a claim that "i" may be used > uninitialized in the if-statement above. It looks like a bogus error > though. If this commit mixed functional changes with the reindent it needs to be reverted and the reindent needs to be re-committed as a separate commit. The functional changes (if intended) should then be a separate commit once they are tested. -- John Baldwin From owner-svn-src-head@freebsd.org Fri Feb 16 18:50: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 47A58F07E09; Fri, 16 Feb 2018 18:50:07 +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 E21246B48B; Fri, 16 Feb 2018 18:50:06 +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 DCE2B11882; Fri, 16 Feb 2018 18:50:06 +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 w1GIo6eM058932; Fri, 16 Feb 2018 18:50:06 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GIo64V058931; Fri, 16 Feb 2018 18:50:06 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802161850.w1GIo64V058931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 18:50:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329393 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329393 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 18:50:07 -0000 Author: kevans Date: Fri Feb 16 18:50:06 2018 New Revision: 329393 URL: https://svnweb.freebsd.org/changeset/base/329393 Log: stand/lua: Use escaped dot instead of single character class Modified: head/stand/lua/screen.lua Modified: head/stand/lua/screen.lua ============================================================================== --- head/stand/lua/screen.lua Fri Feb 16 18:49:50 2018 (r329392) +++ head/stand/lua/screen.lua Fri Feb 16 18:50:06 2018 (r329393) @@ -34,7 +34,7 @@ local core = require("core"); -- XXX TODO: This should be fixed in the interpreter to not print decimals function intstring(num) local str = tostring(num) - local decimal = string.find(str, "[.]") + local decimal = string.find(str, "%.") if decimal then return string.sub(str, 1, decimal - 1) From owner-svn-src-head@freebsd.org Fri Feb 16 20:23: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 957E8F0EC41; Fri, 16 Feb 2018 20:23:49 +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 4BC246FEDA; Fri, 16 Feb 2018 20:23:49 +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 45CC812897; Fri, 16 Feb 2018 20:23:49 +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 w1GKNna0009096; Fri, 16 Feb 2018 20:23:49 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GKNnao009094; Fri, 16 Feb 2018 20:23:49 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802162023.w1GKNnao009094@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 20:23:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329406 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 329406 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 20:23:49 -0000 Author: kevans Date: Fri Feb 16 20:23:48 2018 New Revision: 329406 URL: https://svnweb.freebsd.org/changeset/base/329406 Log: Default to /tmp/loadertest for lua test scripts Modified: head/tools/boot/lua-img.sh head/tools/boot/lua-test.sh Modified: head/tools/boot/lua-img.sh ============================================================================== --- head/tools/boot/lua-img.sh Fri Feb 16 19:11:00 2018 (r329405) +++ head/tools/boot/lua-img.sh Fri Feb 16 20:23:48 2018 (r329406) @@ -2,6 +2,7 @@ # $FreeBSD$ # Quick script to build a suitable /boot dir somewhere in the tree for testing. +# dir may be passed in, will default to /tmp/loadertest if not specified die() { echo $* @@ -11,7 +12,7 @@ die() { dir=$1 cd $(make -V SRCTOP) -[ -n "$dir" ] || die "No directory specified" +[ -n "$dir" ] || dir=/tmp/loadertest set -e Modified: head/tools/boot/lua-test.sh ============================================================================== --- head/tools/boot/lua-test.sh Fri Feb 16 19:11:00 2018 (r329405) +++ head/tools/boot/lua-test.sh Fri Feb 16 20:23:48 2018 (r329406) @@ -12,7 +12,7 @@ obj=$(make -V .OBJDIR) t=$obj/userboot/test/test u=$obj/userboot/userboot/userboot.so -[ -n "$dir" ] || die "No directory specified" +[ -n "$dir" ] || dir=/tmp/loadertest [ -d "$dir" ] || die "Directory $dir doesn't exist" [ -f "$dir/boot/lua/loader.lua" ] || die "No boot/lua/loader.lua found" [ -f "$dir/boot/kernel/kernel" ] || die "No kernel to load" From owner-svn-src-head@freebsd.org Fri Feb 16 20:26: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 0BF7AF0EF4D; Fri, 16 Feb 2018 20:26: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 B3C2D700D5; Fri, 16 Feb 2018 20:26:18 +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 AE3031289A; Fri, 16 Feb 2018 20:26:18 +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 w1GKQIHo009224; Fri, 16 Feb 2018 20:26:18 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GKQI7k009223; Fri, 16 Feb 2018 20:26:18 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802162026.w1GKQI7k009223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 20:26:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329407 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 329407 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 20:26:19 -0000 Author: kevans Date: Fri Feb 16 20:26:18 2018 New Revision: 329407 URL: https://svnweb.freebsd.org/changeset/base/329407 Log: lua-test: Image the loader test directory if it doesn't exist yet Modified: head/tools/boot/lua-test.sh Modified: head/tools/boot/lua-test.sh ============================================================================== --- head/tools/boot/lua-test.sh Fri Feb 16 20:23:48 2018 (r329406) +++ head/tools/boot/lua-test.sh Fri Feb 16 20:26:18 2018 (r329407) @@ -1,19 +1,22 @@ #!/bin/sh # $FreeBSD$ +# Will image the test directory (default /tmp/loadertest) if it doesn't exist + die() { echo $* exit 1 } dir=$1 +scriptdir=$(dirname $(realpath $0)) cd $(make -V SRCTOP)/stand obj=$(make -V .OBJDIR) t=$obj/userboot/test/test u=$obj/userboot/userboot/userboot.so [ -n "$dir" ] || dir=/tmp/loadertest -[ -d "$dir" ] || die "Directory $dir doesn't exist" +[ -d "$dir" ] || ${scriptdir}/lua-img.sh ${dir} [ -f "$dir/boot/lua/loader.lua" ] || die "No boot/lua/loader.lua found" [ -f "$dir/boot/kernel/kernel" ] || die "No kernel to load" [ -x "$t" ] || die "no userboot test jig found ($t)" From owner-svn-src-head@freebsd.org Fri Feb 16 20:45: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 BAD66F10A21; Fri, 16 Feb 2018 20:45:35 +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 65ED071704; Fri, 16 Feb 2018 20:45:35 +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 60AD212BE4; Fri, 16 Feb 2018 20:45: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 w1GKjZkj020288; Fri, 16 Feb 2018 20:45:35 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GKjWf2020258; Fri, 16 Feb 2018 20:45:32 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201802162045.w1GKjWf2020258@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 16 Feb 2018 20:45:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329410 - in head: contrib/compiler-rt/lib/asan contrib/llvm/include/llvm/IR contrib/llvm/include/llvm/MC contrib/llvm/include/llvm/Support contrib/llvm/lib/CodeGen contrib/llvm/lib/Cod... X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head: contrib/compiler-rt/lib/asan contrib/llvm/include/llvm/IR contrib/llvm/include/llvm/MC contrib/llvm/include/llvm/Support contrib/llvm/lib/CodeGen contrib/llvm/lib/CodeGen/AsmPrinter contrib/l... X-SVN-Commit-Revision: 329410 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 20:45:36 -0000 Author: dim Date: Fri Feb 16 20:45:32 2018 New Revision: 329410 URL: https://svnweb.freebsd.org/changeset/base/329410 Log: Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to 6.0.0 (branches/release_60 r325330). MFC after: 3 months X-MFC-With: r327952 PR: 224669 Added: head/contrib/llvm/include/llvm/MC/MCAsmMacro.h - copied unchanged from r329405, vendor/llvm/dist-release_60/include/llvm/MC/MCAsmMacro.h Modified: head/contrib/compiler-rt/lib/asan/asan_linux.cc head/contrib/llvm/include/llvm/IR/IntrinsicsAMDGPU.td head/contrib/llvm/include/llvm/IR/IntrinsicsX86.td head/contrib/llvm/include/llvm/MC/MCContext.h head/contrib/llvm/include/llvm/Support/GenericDomTreeConstruction.h head/contrib/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp head/contrib/llvm/lib/CodeGen/LivePhysRegs.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp head/contrib/llvm/lib/CodeGen/SplitKit.cpp head/contrib/llvm/lib/CodeGen/SplitKit.h head/contrib/llvm/lib/IR/AutoUpgrade.cpp head/contrib/llvm/lib/MC/MCParser/AsmParser.cpp head/contrib/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp head/contrib/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.h head/contrib/llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.cpp head/contrib/llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.h head/contrib/llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.td head/contrib/llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp head/contrib/llvm/lib/Target/AMDGPU/SIISelLowering.cpp head/contrib/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp head/contrib/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h head/contrib/llvm/lib/Target/AMDGPU/VOP2Instructions.td head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp head/contrib/llvm/lib/Target/X86/X86AsmPrinter.cpp head/contrib/llvm/lib/Target/X86/X86DomainReassignment.cpp head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp head/contrib/llvm/lib/Target/X86/X86IntrinsicsInfo.h head/contrib/llvm/lib/Target/X86/X86RetpolineThunks.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp head/contrib/llvm/tools/clang/include/clang/AST/DeclBase.h head/contrib/llvm/tools/clang/lib/AST/ASTContext.cpp head/contrib/llvm/tools/clang/lib/AST/DeclBase.cpp head/contrib/llvm/tools/clang/lib/AST/MicrosoftMangle.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp head/contrib/llvm/tools/clang/lib/CodeGen/ItaniumCXXABI.cpp head/contrib/llvm/tools/clang/lib/Format/TokenAnnotator.cpp head/contrib/llvm/tools/clang/lib/Format/UnwrappedLineParser.cpp head/contrib/llvm/tools/clang/lib/Format/UnwrappedLineParser.h head/contrib/llvm/tools/clang/lib/Headers/avx512bwintrin.h head/contrib/llvm/tools/clang/lib/Headers/avx512fintrin.h head/contrib/llvm/tools/clang/lib/Lex/LiteralSupport.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp head/contrib/llvm/tools/lld/COFF/PDB.cpp head/contrib/llvm/tools/lld/ELF/Driver.cpp head/contrib/llvm/tools/lld/ELF/InputFiles.cpp head/contrib/llvm/tools/lld/ELF/Options.td head/contrib/llvm/tools/lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp head/lib/clang/include/clang/Basic/Version.inc head/lib/clang/include/lld/Common/Version.inc head/lib/clang/include/llvm/Support/VCSRevision.h Directory Properties: head/contrib/compiler-rt/ (props changed) head/contrib/libc++/ (props changed) head/contrib/llvm/ (props changed) head/contrib/llvm/tools/clang/ (props changed) head/contrib/llvm/tools/lld/ (props changed) head/contrib/llvm/tools/lldb/ (props changed) Modified: head/contrib/compiler-rt/lib/asan/asan_linux.cc ============================================================================== --- head/contrib/compiler-rt/lib/asan/asan_linux.cc Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/compiler-rt/lib/asan/asan_linux.cc Fri Feb 16 20:45:32 2018 (r329410) @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -214,7 +215,7 @@ void AsanCheckIncompatibleRT() { // the functions in dynamic ASan runtime instead of the functions in // system libraries, causing crashes later in ASan initialization. MemoryMappingLayout proc_maps(/*cache_enabled*/true); - char filename[128]; + char filename[PATH_MAX]; MemoryMappedSegment segment(filename, sizeof(filename)); while (proc_maps.Next(&segment)) { if (IsDynamicRTName(segment.filename)) { Modified: head/contrib/llvm/include/llvm/IR/IntrinsicsAMDGPU.td ============================================================================== --- head/contrib/llvm/include/llvm/IR/IntrinsicsAMDGPU.td Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/include/llvm/IR/IntrinsicsAMDGPU.td Fri Feb 16 20:45:32 2018 (r329410) @@ -238,6 +238,26 @@ def int_amdgcn_cvt_pkrtz : Intrinsic< [IntrNoMem, IntrSpeculatable] >; +def int_amdgcn_cvt_pknorm_i16 : Intrinsic< + [llvm_v2i16_ty], [llvm_float_ty, llvm_float_ty], + [IntrNoMem, IntrSpeculatable] +>; + +def int_amdgcn_cvt_pknorm_u16 : Intrinsic< + [llvm_v2i16_ty], [llvm_float_ty, llvm_float_ty], + [IntrNoMem, IntrSpeculatable] +>; + +def int_amdgcn_cvt_pk_i16 : Intrinsic< + [llvm_v2i16_ty], [llvm_i32_ty, llvm_i32_ty], + [IntrNoMem, IntrSpeculatable] +>; + +def int_amdgcn_cvt_pk_u16 : Intrinsic< + [llvm_v2i16_ty], [llvm_i32_ty, llvm_i32_ty], + [IntrNoMem, IntrSpeculatable] +>; + def int_amdgcn_class : Intrinsic< [llvm_i1_ty], [llvm_anyfloat_ty, llvm_i32_ty], [IntrNoMem, IntrSpeculatable] Modified: head/contrib/llvm/include/llvm/IR/IntrinsicsX86.td ============================================================================== --- head/contrib/llvm/include/llvm/IR/IntrinsicsX86.td Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/include/llvm/IR/IntrinsicsX86.td Fri Feb 16 20:45:32 2018 (r329410) @@ -3738,6 +3738,15 @@ let TargetPrefix = "x86" in { // All intrinsics start def int_x86_avx512_kxnor_w : // TODO: remove this intrinsic Intrinsic<[llvm_i16_ty], [llvm_i16_ty, llvm_i16_ty], [IntrNoMem]>; + def int_x86_avx512_kunpck_bw : GCCBuiltin<"__builtin_ia32_kunpckhi">, + Intrinsic<[llvm_i16_ty], [llvm_i16_ty, llvm_i16_ty], + [IntrNoMem]>; + def int_x86_avx512_kunpck_wd : GCCBuiltin<"__builtin_ia32_kunpcksi">, + Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty], + [IntrNoMem]>; + def int_x86_avx512_kunpck_dq : GCCBuiltin<"__builtin_ia32_kunpckdi">, + Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty], + [IntrNoMem]>; def int_x86_avx512_kortestz_w : GCCBuiltin<"__builtin_ia32_kortestzhi">, Intrinsic<[llvm_i32_ty], [llvm_i16_ty, llvm_i16_ty], [IntrNoMem]>; Copied: head/contrib/llvm/include/llvm/MC/MCAsmMacro.h (from r329405, vendor/llvm/dist-release_60/include/llvm/MC/MCAsmMacro.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/include/llvm/MC/MCAsmMacro.h Fri Feb 16 20:45:32 2018 (r329410, copy of r329405, vendor/llvm/dist-release_60/include/llvm/MC/MCAsmMacro.h) @@ -0,0 +1,38 @@ +//===- MCAsmMacro.h - Assembly Macros ---------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_MC_MCASMMACRO_H +#define LLVM_MC_MCASMMACRO_H + +#include "llvm/MC/MCParser/MCAsmLexer.h" + +namespace llvm { + +struct MCAsmMacroParameter { + StringRef Name; + std::vector Value; + bool Required = false; + bool Vararg = false; + + MCAsmMacroParameter() = default; +}; + +typedef std::vector MCAsmMacroParameters; +struct MCAsmMacro { + StringRef Name; + StringRef Body; + MCAsmMacroParameters Parameters; + +public: + MCAsmMacro(StringRef N, StringRef B, MCAsmMacroParameters P) + : Name(N), Body(B), Parameters(std::move(P)) {} +}; +}; // namespace llvm + +#endif Modified: head/contrib/llvm/include/llvm/MC/MCContext.h ============================================================================== --- head/contrib/llvm/include/llvm/MC/MCContext.h Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/include/llvm/MC/MCContext.h Fri Feb 16 20:45:32 2018 (r329410) @@ -18,6 +18,7 @@ #include "llvm/ADT/StringRef.h" #include "llvm/ADT/Twine.h" #include "llvm/BinaryFormat/Dwarf.h" +#include "llvm/MC/MCAsmMacro.h" #include "llvm/MC/MCDwarf.h" #include "llvm/MC/MCSubtargetInfo.h" #include "llvm/MC/SectionKind.h" @@ -268,6 +269,9 @@ namespace llvm { unsigned UniqueID, const MCSymbolELF *Associated); + /// \brief Map of currently defined macros. + StringMap MacroMap; + public: explicit MCContext(const MCAsmInfo *MAI, const MCRegisterInfo *MRI, const MCObjectFileInfo *MOFI, @@ -618,6 +622,17 @@ namespace llvm { // FIXME: We should really do something about that. LLVM_ATTRIBUTE_NORETURN void reportFatalError(SMLoc L, const Twine &Msg); + + const MCAsmMacro *lookupMacro(StringRef Name) { + StringMap::iterator I = MacroMap.find(Name); + return (I == MacroMap.end()) ? nullptr : &I->getValue(); + } + + void defineMacro(StringRef Name, MCAsmMacro Macro) { + MacroMap.insert(std::make_pair(Name, std::move(Macro))); + } + + void undefineMacro(StringRef Name) { MacroMap.erase(Name); } }; } // end namespace llvm Modified: head/contrib/llvm/include/llvm/Support/GenericDomTreeConstruction.h ============================================================================== --- head/contrib/llvm/include/llvm/Support/GenericDomTreeConstruction.h Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/include/llvm/Support/GenericDomTreeConstruction.h Fri Feb 16 20:45:32 2018 (r329410) @@ -698,24 +698,20 @@ struct SemiNCAInfo { return; // Recalculate the set of roots. - DT.Roots = FindRoots(DT, BUI); - for (const NodePtr R : DT.Roots) { - const TreeNodePtr TN = DT.getNode(R); - // A CFG node was selected as a tree root, but the corresponding tree node - // is not connected to the virtual root. This is because the incremental - // algorithm does not really know or use the set of roots and can make a - // different (implicit) decision about which nodes within an infinite loop - // becomes a root. - if (TN && !DT.isVirtualRoot(TN->getIDom())) { - DEBUG(dbgs() << "Root " << BlockNamePrinter(R) - << " is not virtual root's child\n" - << "The entire tree needs to be rebuilt\n"); - // It should be possible to rotate the subtree instead of recalculating - // the whole tree, but this situation happens extremely rarely in - // practice. - CalculateFromScratch(DT, BUI); - return; - } + auto Roots = FindRoots(DT, BUI); + if (DT.Roots.size() != Roots.size() || + !std::is_permutation(DT.Roots.begin(), DT.Roots.end(), Roots.begin())) { + // The roots chosen in the CFG have changed. This is because the + // incremental algorithm does not really know or use the set of roots and + // can make a different (implicit) decision about which node within an + // infinite loop becomes a root. + + DEBUG(dbgs() << "Roots are different in updated trees\n" + << "The entire tree needs to be rebuilt\n"); + // It may be possible to update the tree without recalculating it, but + // we do not know yet how to do it, and it happens rarely in practise. + CalculateFromScratch(DT, BUI); + return; } } Modified: head/contrib/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp Fri Feb 16 20:45:32 2018 (r329410) @@ -163,7 +163,8 @@ uint64_t DebugHandlerBase::getBaseTypeSize(const DITyp DIType *BaseType = DDTy->getBaseType().resolve(); - assert(BaseType && "Unexpected invalid base type"); + if (!BaseType) + return 0; // If this is a derived type, go ahead and get the base type, unless it's a // reference then it's just the size of the field. Pointer types have no need Modified: head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp Fri Feb 16 20:45:32 2018 (r329410) @@ -1391,7 +1391,8 @@ void DwarfUnit::constructMemberDIE(DIE &Buffer, const if (!Name.empty()) addString(MemberDie, dwarf::DW_AT_name, Name); - addType(MemberDie, resolve(DT->getBaseType())); + if (DIType *Resolved = resolve(DT->getBaseType())) + addType(MemberDie, Resolved); addSourceLine(MemberDie, DT); Modified: head/contrib/llvm/lib/CodeGen/LivePhysRegs.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/LivePhysRegs.cpp Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/CodeGen/LivePhysRegs.cpp Fri Feb 16 20:45:32 2018 (r329410) @@ -205,14 +205,18 @@ void LivePhysRegs::addPristines(const MachineFunction } void LivePhysRegs::addLiveOutsNoPristines(const MachineBasicBlock &MBB) { - if (!MBB.succ_empty()) { - // To get the live-outs we simply merge the live-ins of all successors. - for (const MachineBasicBlock *Succ : MBB.successors()) - addBlockLiveIns(*Succ); - } else if (MBB.isReturnBlock()) { - // For the return block: Add all callee saved registers that are saved and - // restored (somewhere); This does not include callee saved registers that - // are unused and hence not saved and restored; they are called pristine. + // To get the live-outs we simply merge the live-ins of all successors. + for (const MachineBasicBlock *Succ : MBB.successors()) + addBlockLiveIns(*Succ); + if (MBB.isReturnBlock()) { + // Return blocks are a special case because we currently don't mark up + // return instructions completely: specifically, there is no explicit + // use for callee-saved registers. So we add all callee saved registers + // that are saved and restored (somewhere). This does not include + // callee saved registers that are unused and hence not saved and + // restored; they are called pristine. + // FIXME: PEI should add explicit markings to return instructions + // instead of implicitly handling them here. const MachineFunction &MF = *MBB.getParent(); const MachineFrameInfo &MFI = MF.getFrameInfo(); if (MFI.isCalleeSavedInfoValid()) { @@ -225,15 +229,8 @@ void LivePhysRegs::addLiveOutsNoPristines(const Machin void LivePhysRegs::addLiveOuts(const MachineBasicBlock &MBB) { const MachineFunction &MF = *MBB.getParent(); - if (!MBB.succ_empty()) { - addPristines(MF); - addLiveOutsNoPristines(MBB); - } else if (MBB.isReturnBlock()) { - // For the return block: Add all callee saved registers. - const MachineFrameInfo &MFI = MF.getFrameInfo(); - if (MFI.isCalleeSavedInfoValid()) - addCalleeSavedRegs(*this, MF); - } + addPristines(MF); + addLiveOutsNoPristines(MBB); } void LivePhysRegs::addLiveIns(const MachineBasicBlock &MBB) { Modified: head/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Fri Feb 16 20:45:32 2018 (r329410) @@ -16409,7 +16409,9 @@ SDValue DAGCombiner::visitINSERT_SUBVECTOR(SDNode *N) N1.getOperand(0).getOpcode() == ISD::EXTRACT_SUBVECTOR && N1.getOperand(0).getOperand(1) == N2 && N1.getOperand(0).getOperand(0).getValueType().getVectorNumElements() == - VT.getVectorNumElements()) { + VT.getVectorNumElements() && + N1.getOperand(0).getOperand(0).getValueType().getSizeInBits() == + VT.getSizeInBits()) { return DAG.getBitcast(VT, N1.getOperand(0).getOperand(0)); } Modified: head/contrib/llvm/lib/CodeGen/SplitKit.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/SplitKit.cpp Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/CodeGen/SplitKit.cpp Fri Feb 16 20:45:32 2018 (r329410) @@ -491,9 +491,8 @@ VNInfo *SplitEditor::defValue(unsigned RegIdx, return VNI; } -void SplitEditor::forceRecompute(unsigned RegIdx, const VNInfo *ParentVNI) { - assert(ParentVNI && "Mapping NULL value"); - ValueForcePair &VFP = Values[std::make_pair(RegIdx, ParentVNI->id)]; +void SplitEditor::forceRecompute(unsigned RegIdx, const VNInfo &ParentVNI) { + ValueForcePair &VFP = Values[std::make_pair(RegIdx, ParentVNI.id)]; VNInfo *VNI = VFP.getPointer(); // ParentVNI was either unmapped or already complex mapped. Either way, just @@ -777,7 +776,7 @@ SlotIndex SplitEditor::leaveIntvAfter(SlotIndex Idx) { // the source live range. The spiller also won't try to hoist this copy. if (SpillMode && !SlotIndex::isSameInstr(ParentVNI->def, Idx) && MI->readsVirtualRegister(Edit->getReg())) { - forceRecompute(0, ParentVNI); + forceRecompute(0, *ParentVNI); defFromParent(0, ParentVNI, Idx, *MI->getParent(), MI); return Idx; } @@ -835,7 +834,7 @@ void SplitEditor::overlapIntv(SlotIndex Start, SlotInd // The complement interval will be extended as needed by LRCalc.extend(). if (ParentVNI) - forceRecompute(0, ParentVNI); + forceRecompute(0, *ParentVNI); DEBUG(dbgs() << " overlapIntv [" << Start << ';' << End << "):"); RegAssign.insert(Start, End, OpenIdx); DEBUG(dump()); @@ -878,7 +877,7 @@ void SplitEditor::removeBackCopies(SmallVectorImplreadsVirtualRegister(Edit->getReg())) { DEBUG(dbgs() << " cannot find simple kill of RegIdx " << RegIdx << '\n'); - forceRecompute(RegIdx, Edit->getParent().getVNInfoAt(Def)); + forceRecompute(RegIdx, *Edit->getParent().getVNInfoAt(Def)); } else { SlotIndex Kill = LIS.getInstructionIndex(*MBBI).getRegSlot(); DEBUG(dbgs() << " move kill to " << Kill << '\t' << *MBBI); @@ -982,7 +981,7 @@ void SplitEditor::computeRedundantBackCopies( } } if (!DominatedVNIs.empty()) { - forceRecompute(0, ParentVNI); + forceRecompute(0, *ParentVNI); for (auto VNI : DominatedVNIs) { BackCopies.push_back(VNI); } @@ -1102,7 +1101,7 @@ void SplitEditor::hoistCopies() { NotToHoistSet.count(ParentVNI->id)) continue; BackCopies.push_back(VNI); - forceRecompute(0, ParentVNI); + forceRecompute(0, *ParentVNI); } // If it is not beneficial to hoist all the BackCopies, simply remove @@ -1428,6 +1427,41 @@ void SplitEditor::deleteRematVictims() { Edit->eliminateDeadDefs(Dead, None, &AA); } +void SplitEditor::forceRecomputeVNI(const VNInfo &ParentVNI) { + // Fast-path for common case. + if (!ParentVNI.isPHIDef()) { + for (unsigned I = 0, E = Edit->size(); I != E; ++I) + forceRecompute(I, ParentVNI); + return; + } + + // Trace value through phis. + SmallPtrSet Visited; ///< whether VNI was/is in worklist. + SmallVector WorkList; + Visited.insert(&ParentVNI); + WorkList.push_back(&ParentVNI); + + const LiveInterval &ParentLI = Edit->getParent(); + const SlotIndexes &Indexes = *LIS.getSlotIndexes(); + do { + const VNInfo &VNI = *WorkList.back(); + WorkList.pop_back(); + for (unsigned I = 0, E = Edit->size(); I != E; ++I) + forceRecompute(I, VNI); + if (!VNI.isPHIDef()) + continue; + + MachineBasicBlock &MBB = *Indexes.getMBBFromIndex(VNI.def); + for (const MachineBasicBlock *Pred : MBB.predecessors()) { + SlotIndex PredEnd = Indexes.getMBBEndIdx(Pred); + VNInfo *PredVNI = ParentLI.getVNInfoBefore(PredEnd); + assert(PredVNI && "Value available in PhiVNI predecessor"); + if (Visited.insert(PredVNI).second) + WorkList.push_back(PredVNI); + } + } while(!WorkList.empty()); +} + void SplitEditor::finish(SmallVectorImpl *LRMap) { ++NumFinished; @@ -1444,8 +1478,7 @@ void SplitEditor::finish(SmallVectorImpl *LR // Force rematted values to be recomputed everywhere. // The new live ranges may be truncated. if (Edit->didRematerialize(ParentVNI)) - for (unsigned i = 0, e = Edit->size(); i != e; ++i) - forceRecompute(i, ParentVNI); + forceRecomputeVNI(*ParentVNI); } // Hoist back-copies to the complement interval when in spill mode. Modified: head/contrib/llvm/lib/CodeGen/SplitKit.h ============================================================================== --- head/contrib/llvm/lib/CodeGen/SplitKit.h Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/CodeGen/SplitKit.h Fri Feb 16 20:45:32 2018 (r329410) @@ -357,7 +357,11 @@ class LLVM_LIBRARY_VISIBILITY SplitEditor { (private) /// recomputed by LiveRangeCalc::extend regardless of the number of defs. /// This is used for values whose live range doesn't match RegAssign exactly. /// They could have rematerialized, or back-copies may have been moved. - void forceRecompute(unsigned RegIdx, const VNInfo *ParentVNI); + void forceRecompute(unsigned RegIdx, const VNInfo &ParentVNI); + + /// Calls forceRecompute() on any affected regidx and on ParentVNI + /// predecessors in case of a phi definition. + void forceRecomputeVNI(const VNInfo &ParentVNI); /// defFromParent - Define Reg from ParentVNI at UseIdx using either /// rematerialization or a COPY from parent. Return the new value. Modified: head/contrib/llvm/lib/IR/AutoUpgrade.cpp ============================================================================== --- head/contrib/llvm/lib/IR/AutoUpgrade.cpp Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/IR/AutoUpgrade.cpp Fri Feb 16 20:45:32 2018 (r329410) @@ -75,7 +75,6 @@ static bool ShouldUpgradeX86Intrinsic(Function *F, Str Name=="ssse3.pabs.d.128" || // Added in 6.0 Name.startswith("avx512.mask.shuf.i") || // Added in 6.0 Name.startswith("avx512.mask.shuf.f") || // Added in 6.0 - Name.startswith("avx512.kunpck") || //added in 6.0 Name.startswith("avx2.pabs.") || // Added in 6.0 Name.startswith("avx512.mask.pabs.") || // Added in 6.0 Name.startswith("avx512.broadcastm") || // Added in 6.0 @@ -1063,12 +1062,6 @@ void llvm::UpgradeIntrinsicCall(CallInst *CI, Function Rep = Builder.CreateVectorSplat(NumElts, CI->getArgOperand(0)); Rep = EmitX86Select(Builder, CI->getArgOperand(2), Rep, CI->getArgOperand(1)); - } else if (IsX86 && (Name.startswith("avx512.kunpck"))) { - uint64_t Shift = CI->getType()->getScalarSizeInBits() / 2; - uint64_t And = (1ULL << Shift) - 1; - Value* LowBits = Builder.CreateAnd(CI->getArgOperand(0), And); - Value* HighBits = Builder.CreateShl(CI->getArgOperand(1), Shift); - Rep = Builder.CreateOr(LowBits, HighBits); } else if (IsX86 && (Name == "sse.add.ss" || Name == "sse2.add.sd")) { Type *I32Ty = Type::getInt32Ty(C); Value *Elt0 = Builder.CreateExtractElement(CI->getArgOperand(0), Modified: head/contrib/llvm/lib/MC/MCParser/AsmParser.cpp ============================================================================== --- head/contrib/llvm/lib/MC/MCParser/AsmParser.cpp Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/MC/MCParser/AsmParser.cpp Fri Feb 16 20:45:32 2018 (r329410) @@ -83,27 +83,6 @@ namespace { typedef std::vector MCAsmMacroArgument; typedef std::vector MCAsmMacroArguments; -struct MCAsmMacroParameter { - StringRef Name; - MCAsmMacroArgument Value; - bool Required = false; - bool Vararg = false; - - MCAsmMacroParameter() = default; -}; - -typedef std::vector MCAsmMacroParameters; - -struct MCAsmMacro { - StringRef Name; - StringRef Body; - MCAsmMacroParameters Parameters; - -public: - MCAsmMacro(StringRef N, StringRef B, MCAsmMacroParameters P) - : Name(N), Body(B), Parameters(std::move(P)) {} -}; - /// \brief Helper class for storing information about an active macro /// instantiation. struct MacroInstantiation { @@ -164,9 +143,6 @@ class AsmParser : public MCAsmParser { (private) /// addDirectiveHandler. StringMap ExtensionDirectiveMap; - /// \brief Map of currently defined macros. - StringMap MacroMap; - /// \brief Stack of active macro instantiations. std::vector ActiveMacros; @@ -308,17 +284,6 @@ class AsmParser : public MCAsmParser { (private) /// \brief Control a flag in the parser that enables or disables macros. void setMacrosEnabled(bool Flag) {MacrosEnabledFlag = Flag;} - /// \brief Lookup a previously defined macro. - /// \param Name Macro name. - /// \returns Pointer to macro. NULL if no such macro was defined. - const MCAsmMacro* lookupMacro(StringRef Name); - - /// \brief Define a new macro with the given name and information. - void defineMacro(StringRef Name, MCAsmMacro Macro); - - /// \brief Undefine a macro. If no such macro was defined, it's a no-op. - void undefineMacro(StringRef Name); - /// \brief Are we inside a macro instantiation? bool isInsideMacroInstantiation() {return !ActiveMacros.empty();} @@ -1841,7 +1806,7 @@ bool AsmParser::parseStatement(ParseStatementInfo &Inf // If macros are enabled, check to see if this is a macro instantiation. if (areMacrosEnabled()) - if (const MCAsmMacro *M = lookupMacro(IDVal)) { + if (const MCAsmMacro *M = getContext().lookupMacro(IDVal)) { return handleMacroEntry(M, IDLoc); } @@ -2720,17 +2685,6 @@ bool AsmParser::parseMacroArguments(const MCAsmMacro * return TokError("too many positional arguments"); } -const MCAsmMacro *AsmParser::lookupMacro(StringRef Name) { - StringMap::iterator I = MacroMap.find(Name); - return (I == MacroMap.end()) ? nullptr : &I->getValue(); -} - -void AsmParser::defineMacro(StringRef Name, MCAsmMacro Macro) { - MacroMap.insert(std::make_pair(Name, std::move(Macro))); -} - -void AsmParser::undefineMacro(StringRef Name) { MacroMap.erase(Name); } - bool AsmParser::handleMacroEntry(const MCAsmMacro *M, SMLoc NameLoc) { // Arbitrarily limit macro nesting depth (default matches 'as'). We can // eliminate this, although we should protect against infinite loops. @@ -4249,7 +4203,7 @@ bool AsmParser::parseDirectiveMacro(SMLoc DirectiveLoc eatToEndOfStatement(); } - if (lookupMacro(Name)) { + if (getContext().lookupMacro(Name)) { return Error(DirectiveLoc, "macro '" + Name + "' is already defined"); } @@ -4257,7 +4211,7 @@ bool AsmParser::parseDirectiveMacro(SMLoc DirectiveLoc const char *BodyEnd = EndToken.getLoc().getPointer(); StringRef Body = StringRef(BodyStart, BodyEnd - BodyStart); checkForBadMacro(DirectiveLoc, Name, Body, Parameters); - defineMacro(Name, MCAsmMacro(Name, Body, std::move(Parameters))); + getContext().defineMacro(Name, MCAsmMacro(Name, Body, std::move(Parameters))); return false; } @@ -4416,10 +4370,10 @@ bool AsmParser::parseDirectivePurgeMacro(SMLoc Directi "unexpected token in '.purgem' directive")) return true; - if (!lookupMacro(Name)) + if (!getContext().lookupMacro(Name)) return Error(DirectiveLoc, "macro '" + Name + "' is not defined"); - undefineMacro(Name); + getContext().undefineMacro(Name); return false; } Modified: head/contrib/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp Fri Feb 16 20:45:32 2018 (r329410) @@ -3957,6 +3957,10 @@ const char* AMDGPUTargetLowering::getTargetNodeName(un NODE_NAME_CASE(CVT_F32_UBYTE2) NODE_NAME_CASE(CVT_F32_UBYTE3) NODE_NAME_CASE(CVT_PKRTZ_F16_F32) + NODE_NAME_CASE(CVT_PKNORM_I16_F32) + NODE_NAME_CASE(CVT_PKNORM_U16_F32) + NODE_NAME_CASE(CVT_PK_I16_I32) + NODE_NAME_CASE(CVT_PK_U16_U32) NODE_NAME_CASE(FP_TO_FP16) NODE_NAME_CASE(FP16_ZEXT) NODE_NAME_CASE(BUILD_VERTICAL_VECTOR) Modified: head/contrib/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.h ============================================================================== --- head/contrib/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.h Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.h Fri Feb 16 20:45:32 2018 (r329410) @@ -417,6 +417,10 @@ enum NodeType : unsigned { // Convert two float 32 numbers into a single register holding two packed f16 // with round to zero. CVT_PKRTZ_F16_F32, + CVT_PKNORM_I16_F32, + CVT_PKNORM_U16_F32, + CVT_PK_I16_I32, + CVT_PK_U16_U32, // Same as the standard node, except the high bits of the resulting integer // are known 0. Modified: head/contrib/llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.cpp ============================================================================== --- head/contrib/llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.cpp Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.cpp Fri Feb 16 20:45:32 2018 (r329410) @@ -108,3 +108,21 @@ int AMDGPUInstrInfo::pseudoToMCOpcode(int Opcode) cons return MCOp; } + +// TODO: Should largely merge with AMDGPUTTIImpl::isSourceOfDivergence. +bool AMDGPUInstrInfo::isUniformMMO(const MachineMemOperand *MMO) { + const Value *Ptr = MMO->getValue(); + // UndefValue means this is a load of a kernel input. These are uniform. + // Sometimes LDS instructions have constant pointers. + // If Ptr is null, then that means this mem operand contains a + // PseudoSourceValue like GOT. + if (!Ptr || isa(Ptr) || + isa(Ptr) || isa(Ptr)) + return true; + + if (const Argument *Arg = dyn_cast(Ptr)) + return AMDGPU::isArgPassedInSGPR(Arg); + + const Instruction *I = dyn_cast(Ptr); + return I && I->getMetadata("amdgpu.uniform"); +} Modified: head/contrib/llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.h ============================================================================== --- head/contrib/llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.h Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.h Fri Feb 16 20:45:32 2018 (r329410) @@ -50,6 +50,8 @@ class AMDGPUInstrInfo : public AMDGPUGenInstrInfo { (p /// Return -1 if the target-specific opcode for the pseudo instruction does /// not exist. If Opcode is not a pseudo instruction, this is identity. int pseudoToMCOpcode(int Opcode) const; + + static bool isUniformMMO(const MachineMemOperand *MMO); }; } // End llvm namespace Modified: head/contrib/llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.td ============================================================================== --- head/contrib/llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.td Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.td Fri Feb 16 20:45:32 2018 (r329410) @@ -35,6 +35,10 @@ def AMDGPUFPPackOp : SDTypeProfile<1, 2, [SDTCisFP<1>, SDTCisSameAs<1, 2>] >; +def AMDGPUIntPackOp : SDTypeProfile<1, 2, + [SDTCisInt<1>, SDTCisSameAs<1, 2>] +>; + def AMDGPUDivScaleOp : SDTypeProfile<2, 3, [SDTCisFP<0>, SDTCisInt<1>, SDTCisSameAs<0, 2>, SDTCisSameAs<0, 3>, SDTCisSameAs<0, 4>] >; @@ -142,6 +146,10 @@ def AMDGPUrsq_clamp : SDNode<"AMDGPUISD::RSQ_CLAMP", S def AMDGPUldexp : SDNode<"AMDGPUISD::LDEXP", AMDGPULdExpOp>; def AMDGPUpkrtz_f16_f32 : SDNode<"AMDGPUISD::CVT_PKRTZ_F16_F32", AMDGPUFPPackOp>; +def AMDGPUpknorm_i16_f32 : SDNode<"AMDGPUISD::CVT_PKNORM_I16_F32", AMDGPUFPPackOp>; +def AMDGPUpknorm_u16_f32 : SDNode<"AMDGPUISD::CVT_PKNORM_U16_F32", AMDGPUFPPackOp>; +def AMDGPUpk_i16_i32 : SDNode<"AMDGPUISD::CVT_PK_I16_I32", AMDGPUIntPackOp>; +def AMDGPUpk_u16_u32 : SDNode<"AMDGPUISD::CVT_PK_U16_U32", AMDGPUIntPackOp>; def AMDGPUfp_to_f16 : SDNode<"AMDGPUISD::FP_TO_FP16" , SDTFPToIntOp>; def AMDGPUfp16_zext : SDNode<"AMDGPUISD::FP16_ZEXT" , SDTFPToIntOp>; Modified: head/contrib/llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp ============================================================================== --- head/contrib/llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp Fri Feb 16 20:45:32 2018 (r329410) @@ -120,7 +120,7 @@ static bool isInstrUniform(const MachineInstr &MI) { return false; const MachineMemOperand *MMO = *MI.memoperands_begin(); - return AMDGPU::isUniformMMO(MMO); + return AMDGPUInstrInfo::isUniformMMO(MMO); } const RegisterBankInfo::InstructionMapping & Modified: head/contrib/llvm/lib/Target/AMDGPU/SIISelLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/AMDGPU/SIISelLowering.cpp Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/Target/AMDGPU/SIISelLowering.cpp Fri Feb 16 20:45:32 2018 (r329410) @@ -205,6 +205,7 @@ SITargetLowering::SITargetLowering(const TargetMachine setOperationAction(ISD::INTRINSIC_WO_CHAIN, MVT::Other, Custom); setOperationAction(ISD::INTRINSIC_WO_CHAIN, MVT::f32, Custom); setOperationAction(ISD::INTRINSIC_WO_CHAIN, MVT::v4f32, Custom); + setOperationAction(ISD::INTRINSIC_WO_CHAIN, MVT::v2i16, Custom); setOperationAction(ISD::INTRINSIC_WO_CHAIN, MVT::v2f16, Custom); setOperationAction(ISD::INTRINSIC_W_CHAIN, MVT::Other, Custom); @@ -1085,7 +1086,7 @@ bool SITargetLowering::isCheapAddrSpaceCast(unsigned S bool SITargetLowering::isMemOpUniform(const SDNode *N) const { const MemSDNode *MemNode = cast(N); - return AMDGPU::isUniformMMO(MemNode->getMemOperand()); + return AMDGPUInstrInfo::isUniformMMO(MemNode->getMemOperand()); } TargetLoweringBase::LegalizeTypeAction @@ -3517,7 +3518,8 @@ void SITargetLowering::ReplaceNodeResults(SDNode *N, } case ISD::INTRINSIC_WO_CHAIN: { unsigned IID = cast(N->getOperand(0))->getZExtValue(); - if (IID == Intrinsic::amdgcn_cvt_pkrtz) { + switch (IID) { + case Intrinsic::amdgcn_cvt_pkrtz: { SDValue Src0 = N->getOperand(1); SDValue Src1 = N->getOperand(2); SDLoc SL(N); @@ -3526,6 +3528,29 @@ void SITargetLowering::ReplaceNodeResults(SDNode *N, Results.push_back(DAG.getNode(ISD::BITCAST, SL, MVT::v2f16, Cvt)); return; } + case Intrinsic::amdgcn_cvt_pknorm_i16: + case Intrinsic::amdgcn_cvt_pknorm_u16: + case Intrinsic::amdgcn_cvt_pk_i16: + case Intrinsic::amdgcn_cvt_pk_u16: { + SDValue Src0 = N->getOperand(1); + SDValue Src1 = N->getOperand(2); + SDLoc SL(N); + unsigned Opcode; + + if (IID == Intrinsic::amdgcn_cvt_pknorm_i16) + Opcode = AMDGPUISD::CVT_PKNORM_I16_F32; + else if (IID == Intrinsic::amdgcn_cvt_pknorm_u16) + Opcode = AMDGPUISD::CVT_PKNORM_U16_F32; + else if (IID == Intrinsic::amdgcn_cvt_pk_i16) + Opcode = AMDGPUISD::CVT_PK_I16_I32; + else + Opcode = AMDGPUISD::CVT_PK_U16_U32; + + SDValue Cvt = DAG.getNode(Opcode, SL, MVT::i32, Src0, Src1); + Results.push_back(DAG.getNode(ISD::BITCAST, SL, MVT::v2i16, Cvt)); + return; + } + } break; } case ISD::SELECT: { @@ -4424,10 +4449,27 @@ SDValue SITargetLowering::LowerINTRINSIC_WO_CHAIN(SDVa case Intrinsic::amdgcn_ubfe: return DAG.getNode(AMDGPUISD::BFE_U32, DL, VT, Op.getOperand(1), Op.getOperand(2), Op.getOperand(3)); - case Intrinsic::amdgcn_cvt_pkrtz: { - // FIXME: Stop adding cast if v2f16 legal. + case Intrinsic::amdgcn_cvt_pkrtz: + case Intrinsic::amdgcn_cvt_pknorm_i16: + case Intrinsic::amdgcn_cvt_pknorm_u16: + case Intrinsic::amdgcn_cvt_pk_i16: + case Intrinsic::amdgcn_cvt_pk_u16: { + // FIXME: Stop adding cast if v2f16/v2i16 are legal. EVT VT = Op.getValueType(); - SDValue Node = DAG.getNode(AMDGPUISD::CVT_PKRTZ_F16_F32, DL, MVT::i32, + unsigned Opcode; + + if (IntrinsicID == Intrinsic::amdgcn_cvt_pkrtz) + Opcode = AMDGPUISD::CVT_PKRTZ_F16_F32; + else if (IntrinsicID == Intrinsic::amdgcn_cvt_pknorm_i16) + Opcode = AMDGPUISD::CVT_PKNORM_I16_F32; + else if (IntrinsicID == Intrinsic::amdgcn_cvt_pknorm_u16) + Opcode = AMDGPUISD::CVT_PKNORM_U16_F32; + else if (IntrinsicID == Intrinsic::amdgcn_cvt_pk_i16) + Opcode = AMDGPUISD::CVT_PK_I16_I32; + else + Opcode = AMDGPUISD::CVT_PK_U16_U32; + + SDValue Node = DAG.getNode(Opcode, DL, MVT::i32, Op.getOperand(1), Op.getOperand(2)); return DAG.getNode(ISD::BITCAST, DL, VT, Node); } Modified: head/contrib/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp ============================================================================== --- head/contrib/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp Fri Feb 16 20:45:32 2018 (r329410) @@ -871,24 +871,6 @@ bool isArgPassedInSGPR(const Argument *A) { } } -// TODO: Should largely merge with AMDGPUTTIImpl::isSourceOfDivergence. -bool isUniformMMO(const MachineMemOperand *MMO) { - const Value *Ptr = MMO->getValue(); - // UndefValue means this is a load of a kernel input. These are uniform. - // Sometimes LDS instructions have constant pointers. - // If Ptr is null, then that means this mem operand contains a - // PseudoSourceValue like GOT. - if (!Ptr || isa(Ptr) || - isa(Ptr) || isa(Ptr)) - return true; - - if (const Argument *Arg = dyn_cast(Ptr)) - return isArgPassedInSGPR(Arg); - - const Instruction *I = dyn_cast(Ptr); - return I && I->getMetadata("amdgpu.uniform"); -} - int64_t getSMRDEncodedOffset(const MCSubtargetInfo &ST, int64_t ByteOffset) { if (isGCN3Encoding(ST)) return ByteOffset; Modified: head/contrib/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h ============================================================================== --- head/contrib/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h Fri Feb 16 20:45:32 2018 (r329410) @@ -363,7 +363,6 @@ LLVM_READNONE bool isInlinableLiteralV216(int32_t Literal, bool HasInv2Pi); bool isArgPassedInSGPR(const Argument *Arg); -bool isUniformMMO(const MachineMemOperand *MMO); /// \returns The encoding that will be used for \p ByteOffset in the SMRD /// offset field. Modified: head/contrib/llvm/lib/Target/AMDGPU/VOP2Instructions.td ============================================================================== --- head/contrib/llvm/lib/Target/AMDGPU/VOP2Instructions.td Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/Target/AMDGPU/VOP2Instructions.td Fri Feb 16 20:45:32 2018 (r329410) @@ -407,11 +407,11 @@ defm V_MBCNT_LO_U32_B32 : VOP2Inst <"v_mbcnt_lo_u32_b3 defm V_MBCNT_HI_U32_B32 : VOP2Inst <"v_mbcnt_hi_u32_b32", VOP_NO_EXT, int_amdgcn_mbcnt_hi>; defm V_LDEXP_F32 : VOP2Inst <"v_ldexp_f32", VOP_NO_EXT, AMDGPUldexp>; defm V_CVT_PKACCUM_U8_F32 : VOP2Inst <"v_cvt_pkaccum_u8_f32", VOP_NO_EXT>; // TODO: set "Uses = dst" -defm V_CVT_PKNORM_I16_F32 : VOP2Inst <"v_cvt_pknorm_i16_f32", VOP_NO_EXT>; -defm V_CVT_PKNORM_U16_F32 : VOP2Inst <"v_cvt_pknorm_u16_f32", VOP_NO_EXT>; +defm V_CVT_PKNORM_I16_F32 : VOP2Inst <"v_cvt_pknorm_i16_f32", VOP_NO_EXT, AMDGPUpknorm_i16_f32>; +defm V_CVT_PKNORM_U16_F32 : VOP2Inst <"v_cvt_pknorm_u16_f32", VOP_NO_EXT, AMDGPUpknorm_u16_f32>; defm V_CVT_PKRTZ_F16_F32 : VOP2Inst <"v_cvt_pkrtz_f16_f32", VOP_NO_EXT, AMDGPUpkrtz_f16_f32>; -defm V_CVT_PK_U16_U32 : VOP2Inst <"v_cvt_pk_u16_u32", VOP_NO_EXT>; -defm V_CVT_PK_I16_I32 : VOP2Inst <"v_cvt_pk_i16_i32", VOP_NO_EXT>; +defm V_CVT_PK_U16_U32 : VOP2Inst <"v_cvt_pk_u16_u32", VOP_NO_EXT, AMDGPUpk_u16_u32>; +defm V_CVT_PK_I16_I32 : VOP2Inst <"v_cvt_pk_i16_i32", VOP_NO_EXT, AMDGPUpk_i16_i32>; } // End SubtargetPredicate = isGCN Modified: head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp Fri Feb 16 20:45:32 2018 (r329410) @@ -396,10 +396,14 @@ void X86MCCodeEmitter::emitMemModRMByte(const MCInst & // rip-relative addressing is actually relative to the *next* instruction. // Since an immediate can follow the mod/rm byte for an instruction, this - // means that we need to bias the immediate field of the instruction with - // the size of the immediate field. If we have this case, add it into the + // means that we need to bias the displacement field of the instruction with + // the size of the immediate field. If we have this case, add it into the // expression to emit. - int ImmSize = X86II::hasImm(TSFlags) ? X86II::getSizeOfImm(TSFlags) : 0; + // Note: rip-relative addressing using immediate displacement values should + // not be adjusted, assuming it was the user's intent. + int ImmSize = !Disp.isImm() && X86II::hasImm(TSFlags) + ? X86II::getSizeOfImm(TSFlags) + : 0; EmitImmediate(Disp, MI.getLoc(), 4, MCFixupKind(FixupKind), CurByte, OS, Fixups, -ImmSize); Modified: head/contrib/llvm/lib/Target/X86/X86AsmPrinter.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86AsmPrinter.cpp Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/Target/X86/X86AsmPrinter.cpp Fri Feb 16 20:45:32 2018 (r329410) @@ -370,6 +370,8 @@ static void printIntelMemReference(X86AsmPrinter &P, c static bool printAsmMRegister(X86AsmPrinter &P, const MachineOperand &MO, char Mode, raw_ostream &O) { unsigned Reg = MO.getReg(); + bool EmitPercent = true; + switch (Mode) { default: return true; // Unknown mode. case 'b': // Print QImode register @@ -384,6 +386,9 @@ static bool printAsmMRegister(X86AsmPrinter &P, const case 'k': // Print SImode register Reg = getX86SubSuperRegister(Reg, 32); break; + case 'V': + EmitPercent = false; + LLVM_FALLTHROUGH; case 'q': // Print 64-bit register names if 64-bit integer registers are available. // Otherwise, print 32-bit register names. @@ -391,7 +396,10 @@ static bool printAsmMRegister(X86AsmPrinter &P, const break; } - O << '%' << X86ATTInstPrinter::getRegisterName(Reg); + if (EmitPercent) + O << '%'; + + O << X86ATTInstPrinter::getRegisterName(Reg); return false; } @@ -464,6 +472,7 @@ bool X86AsmPrinter::PrintAsmOperand(const MachineInstr case 'w': // Print HImode register case 'k': // Print SImode register case 'q': // Print DImode register + case 'V': // Print native register without '%' if (MO.isReg()) return printAsmMRegister(*this, MO, ExtraCode[0], O); printOperand(*this, MI, OpNo, O); Modified: head/contrib/llvm/lib/Target/X86/X86DomainReassignment.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86DomainReassignment.cpp Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/Target/X86/X86DomainReassignment.cpp Fri Feb 16 20:45:32 2018 (r329410) @@ -663,8 +663,10 @@ void X86DomainReassignment::initConverters() { createReplacer(X86::XOR32rr, X86::KXORDrr); createReplacer(X86::XOR64rr, X86::KXORQrr); - createReplacer(X86::TEST32rr, X86::KTESTDrr); - createReplacer(X86::TEST64rr, X86::KTESTQrr); + // TODO: KTEST is not a replacement for TEST due to flag differences. Need + // to prove only Z flag is used. + //createReplacer(X86::TEST32rr, X86::KTESTDrr); + //createReplacer(X86::TEST64rr, X86::KTESTQrr); } if (STI->hasDQI()) { @@ -684,8 +686,10 @@ void X86DomainReassignment::initConverters() { createReplacer(X86::SHR8ri, X86::KSHIFTRBri); createReplacer(X86::SHL8ri, X86::KSHIFTLBri); - createReplacer(X86::TEST8rr, X86::KTESTBrr); - createReplacer(X86::TEST16rr, X86::KTESTWrr); + // TODO: KTEST is not a replacement for TEST due to flag differences. Need + // to prove only Z flag is used. + //createReplacer(X86::TEST8rr, X86::KTESTBrr); + //createReplacer(X86::TEST16rr, X86::KTESTWrr); createReplacer(X86::XOR8rr, X86::KXORBrr); } Modified: head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Fri Feb 16 20:44:50 2018 (r329409) +++ head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Fri Feb 16 20:45:32 2018 (r329410) @@ -17017,24 +17017,6 @@ static bool hasNonFlagsUse(SDValue Op) { return false; } -// Emit KTEST instruction for bit vectors on AVX-512 -static SDValue EmitKTEST(SDValue Op, SelectionDAG &DAG, - const X86Subtarget &Subtarget) { - if (Op.getOpcode() == ISD::BITCAST) { - auto hasKTEST = [&](MVT VT) { - unsigned SizeInBits = VT.getSizeInBits(); - return (Subtarget.hasDQI() && (SizeInBits == 8 || SizeInBits == 16)) || - (Subtarget.hasBWI() && (SizeInBits == 32 || SizeInBits == 64)); - }; - SDValue Op0 = Op.getOperand(0); - MVT Op0VT = Op0.getValueType().getSimpleVT(); - if (Op0VT.isVector() && Op0VT.getVectorElementType() == MVT::i1 && - hasKTEST(Op0VT)) - return DAG.getNode(X86ISD::KTEST, SDLoc(Op), Op0VT, Op0, Op0); - } - return SDValue(); -} - /// Emit nodes that will be selected as "test Op0,Op0", or something /// equivalent. SDValue X86TargetLowering::EmitTest(SDValue Op, unsigned X86CC, const SDLoc &dl, @@ -17079,9 +17061,6 @@ SDValue X86TargetLowering::EmitTest(SDValue Op, unsign // doing a separate TEST. TEST always sets OF and CF to 0, so unless // we prove that the arithmetic won't overflow, we can't use OF or CF. if (Op.getResNo() != 0 || NeedOF || NeedCF) { - // Emit KTEST for bit vectors - if (auto Node = EmitKTEST(Op, DAG, Subtarget)) - return Node; // Emit a CMP with 0, which is the TEST pattern. return DAG.getNode(X86ISD::CMP, dl, MVT::i32, Op, DAG.getConstant(0, dl, Op.getValueType())); @@ -17310,10 +17289,6 @@ SDValue X86TargetLowering::EmitTest(SDValue Op, unsign } if (Opcode == 0) { - // Emit KTEST for bit vectors - if (auto Node = EmitKTEST(Op, DAG, Subtarget)) - return Node; - // Emit a CMP with 0, which is the TEST pattern. return DAG.getNode(X86ISD::CMP, dl, MVT::i32, Op, DAG.getConstant(0, dl, Op.getValueType())); @@ -18093,6 +18068,34 @@ static SDValue LowerVSETCC(SDValue Op, const X86Subtar return Result; } +// Try to select this as a KTEST+SETCC if possible. +static SDValue EmitKTEST(SDValue Op0, SDValue Op1, ISD::CondCode CC, + const SDLoc &dl, SelectionDAG &DAG, + const X86Subtarget &Subtarget) { + // Only support equality comparisons. + if (CC != ISD::SETEQ && CC != ISD::SETNE) + return SDValue(); + + // Must be a bitcast from vXi1. + if (Op0.getOpcode() != ISD::BITCAST) + return SDValue(); + + Op0 = Op0.getOperand(0); + MVT VT = Op0.getSimpleValueType(); + if (!(Subtarget.hasDQI() && (VT == MVT::v8i1 || VT == MVT::v16i1)) && + !(Subtarget.hasBWI() && (VT == MVT::v32i1 || VT == MVT::v64i1))) + return SDValue(); + + X86::CondCode X86CC; + if (isNullConstant(Op1)) { + X86CC = CC == ISD::SETEQ ? X86::COND_E : X86::COND_NE; + } else + return SDValue(); + + SDValue KTEST = DAG.getNode(X86ISD::KTEST, dl, MVT::i32, Op0, Op0); + return getSETCC(X86CC, KTEST, dl, DAG); +} + SDValue X86TargetLowering::LowerSETCC(SDValue Op, SelectionDAG &DAG) const { MVT VT = Op.getSimpleValueType(); @@ -18115,6 +18118,10 @@ SDValue X86TargetLowering::LowerSETCC(SDValue Op, Sele return NewSetCC; } + // Try to lower using KTEST. + if (SDValue NewSetCC = EmitKTEST(Op0, Op1, CC, dl, DAG, Subtarget)) + return NewSetCC; + // Look for X == 0, X == 1, X != 0, or X != 1. We can simplify some forms of // these. if ((isOneConstant(Op1) || isNullConstant(Op1)) && @@ -20525,6 +20532,18 @@ SDValue X86TargetLowering::LowerINTRINSIC_WO_CHAIN(SDV Mask = DAG.getBitcast(MaskVT, Mask); return DAG.getNode(IntrData->Opc0, dl, Op.getValueType(), Mask); } + case KUNPCK: { + MVT VT = Op.getSimpleValueType(); + MVT MaskVT = MVT::getVectorVT(MVT::i1, VT.getSizeInBits()/2); + + SDValue Src1 = getMaskNode(Op.getOperand(1), MaskVT, Subtarget, DAG, dl); + SDValue Src2 = getMaskNode(Op.getOperand(2), MaskVT, Subtarget, DAG, dl); + // Arguments should be swapped. + SDValue Res = DAG.getNode(IntrData->Opc0, dl, + MVT::getVectorVT(MVT::i1, VT.getSizeInBits()), + Src2, Src1); + return DAG.getBitcast(VT, Res); + } case MASK_BINOP: { MVT VT = Op.getSimpleValueType(); MVT MaskVT = MVT::getVectorVT(MVT::i1, VT.getSizeInBits()); @@ -27094,28 +27113,57 @@ static unsigned getOpcodeForRetpoline(unsigned RPOpc) static const char *getRetpolineSymbol(const X86Subtarget &Subtarget, unsigned Reg) { + if (Subtarget.useRetpolineExternalThunk()) { + // When using an external thunk for retpolines, we pick names that match the + // names GCC happens to use as well. This helps simplify the implementation + // of the thunks for kernels where they have no easy ability to create + // aliases and are doing non-trivial configuration of the thunk's body. For + // example, the Linux kernel will do boot-time hot patching of the thunk + // bodies and cannot easily export aliases of these to loaded modules. + // + // Note that at any point in the future, we may need to change the semantics + // of how we implement retpolines and at that time will likely change the + // name of the called thunk. Essentially, there is no hard guarantee that + // LLVM will generate calls to specific thunks, we merely make a best-effort + // attempt to help out kernels and other systems where duplicating the + // thunks is costly. + switch (Reg) { + case X86::EAX: + assert(!Subtarget.is64Bit() && "Should not be using a 32-bit thunk!"); + return "__x86_indirect_thunk_eax"; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Feb 16 20: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 A6911F10BE6; Fri, 16 Feb 2018 20:46:45 +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 51184718C9; Fri, 16 Feb 2018 20:46:45 +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 4877412BE6; Fri, 16 Feb 2018 20:46:45 +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 w1GKkjpp020383; Fri, 16 Feb 2018 20:46:45 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GKkjHp020382; Fri, 16 Feb 2018 20:46:45 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802162046.w1GKkjHp020382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 16 Feb 2018 20:46:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329411 - head/usr.sbin/trpt X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/usr.sbin/trpt X-SVN-Commit-Revision: 329411 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 20:46:45 -0000 Author: cem Date: Fri Feb 16 20:46:44 2018 New Revision: 329411 URL: https://svnweb.freebsd.org/changeset/base/329411 Log: trpt(8): Clean up build hack to detect ancient compiler Detect ancient GCC specifically, rather than using target architecture as a crude heuristic. Side note: compilers should really ignore -Wno- and -Wno-error= flags they don't recognize. Seems like modern compilers produce warnings instead of errors. Though, with -Werror they turn into errors. Clang's error can be disabled with -Wno-error=unknown-warning-option, but GCC doesn't seem to have a named method to disable the specific warning. Submitted by: rpokala@ (earlier version) Suggested by: rpokala@ Reviewed by: tinderbox Sponsored by: Dell EMC Isilon Modified: head/usr.sbin/trpt/Makefile Modified: head/usr.sbin/trpt/Makefile ============================================================================== --- head/usr.sbin/trpt/Makefile Fri Feb 16 20:45:32 2018 (r329410) +++ head/usr.sbin/trpt/Makefile Fri Feb 16 20:46:44 2018 (r329411) @@ -8,8 +8,7 @@ MAN= trpt.8 BINGRP= kmem BINMODE= 2555 -.if ${MACHINE_CPUARCH} != "aarch64" && ${MACHINE_CPUARCH} != "amd64" && \ - ${MACHINE_CPUARCH} != "i386" && ${MACHINE_CPUARCH} != "riscv" +.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} < 50000 WARNS?= 4 .endif @@ -19,8 +18,7 @@ CFLAGS+= -DINET6 .include -.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \ - ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "riscv" +.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 50000 # Several included system headers tickle this warning in ways that are # difficult to work around in this program. CFLAGS+= -Wno-missing-variable-declarations From owner-svn-src-head@freebsd.org Fri Feb 16 21:59: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 C1B44F16334; Fri, 16 Feb 2018 21:59: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 6EA9D74929; Fri, 16 Feb 2018 21:59: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 69A65137A8; Fri, 16 Feb 2018 21:59: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 w1GLx8qi055046; Fri, 16 Feb 2018 21:59:08 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GLx8qQ055045; Fri, 16 Feb 2018 21:59:08 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201802162159.w1GLx8qQ055045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 16 Feb 2018 21:59:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329412 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 329412 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 21:59:09 -0000 Author: asomers Date: Fri Feb 16 21:59:08 2018 New Revision: 329412 URL: https://svnweb.freebsd.org/changeset/base/329412 Log: zfs: fix formatting in a log statement Submitted by: Dave Baukus MFC after: 3 weeks Sponsored by: Spectra Logic Corp Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Fri Feb 16 20:46:44 2018 (r329411) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Fri Feb 16 21:59:08 2018 (r329412) @@ -239,7 +239,7 @@ vdev_geom_attach(struct g_provider *pp, vdev_t *vd, bo } error = g_access(cp, 1, 0, 1); if (error != 0) { - ZFS_LOG(1, "%s(%d): g_access failed: %d", __func__, + ZFS_LOG(1, "%s(%d): g_access failed: %d\n", __func__, __LINE__, error); vdev_geom_detach(cp, B_FALSE); return (NULL); From owner-svn-src-head@freebsd.org Fri Feb 16 22:17: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 6188AF17887; Fri, 16 Feb 2018 22:17: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 127207551E; Fri, 16 Feb 2018 22:17: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 0BFC013AE7; Fri, 16 Feb 2018 22:17: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 w1GMHU9H064728; Fri, 16 Feb 2018 22:17:30 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GMHUmd064727; Fri, 16 Feb 2018 22:17:30 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802162217.w1GMHUmd064727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 22:17:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329413 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329413 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 22:17:31 -0000 Author: kevans Date: Fri Feb 16 22:17:30 2018 New Revision: 329413 URL: https://svnweb.freebsd.org/changeset/base/329413 Log: stand/lua: Allow MENU_RETURN items to have a func, fix escape to prompt Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Fri Feb 16 21:59:08 2018 (r329412) +++ head/stand/lua/menu.lua Fri Feb 16 22:17:30 2018 (r329413) @@ -161,6 +161,9 @@ menu.welcome = { name = function() return color.highlight("Esc").."ape to loader prompt"; end, + func = function() + loader.setenv("autoboot_delay", "NO") + end, alias = {core.KEYSTR_ESCAPE} }, @@ -301,6 +304,10 @@ function menu.run(m) -- recurse cont = menu.run(sel_entry.submenu()); elseif (sel_entry.entry_type == core.MENU_RETURN) then + -- allow entry to have a function/side effect + if (sel_entry.func ~= nil) then + sel_entry.func(); + end -- break recurse cont = false; end From owner-svn-src-head@freebsd.org Fri Feb 16 22:51: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 683B5F19BF9; Fri, 16 Feb 2018 22:51:09 +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 168C37689C; Fri, 16 Feb 2018 22:51:09 +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 1192A13FF4; Fri, 16 Feb 2018 22:51:09 +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 w1GMp8PD079850; Fri, 16 Feb 2018 22:51:08 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GMp8Bd079849; Fri, 16 Feb 2018 22:51:08 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802162251.w1GMp8Bd079849@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 22:51:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329414 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329414 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 22:51:09 -0000 Author: kevans Date: Fri Feb 16 22:51:08 2018 New Revision: 329414 URL: https://svnweb.freebsd.org/changeset/base/329414 Log: stand/lua: Don't try to divide by 0; do nothing Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Fri Feb 16 22:17:30 2018 (r329413) +++ head/stand/lua/menu.lua Fri Feb 16 22:51:08 2018 (r329414) @@ -297,9 +297,11 @@ function menu.run(m) local caridx = menu.getCarouselIndex(carid); local choices = sel_entry.items(); - caridx = (caridx % #choices) + 1; - menu.setCarouselIndex(carid, caridx); - sel_entry.func(choices[caridx]); + if (#choices > 0) then + caridx = (caridx % #choices) + 1; + menu.setCarouselIndex(carid, caridx); + sel_entry.func(choices[caridx]); + end elseif (sel_entry.entry_type == core.MENU_SUBMENU) then -- recurse cont = menu.run(sel_entry.submenu()); From owner-svn-src-head@freebsd.org Fri Feb 16 22:57: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 DD46AF1A65E; Fri, 16 Feb 2018 22:57:52 +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 9015376D61; Fri, 16 Feb 2018 22:57:52 +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 8AFCF14157; Fri, 16 Feb 2018 22:57:52 +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 w1GMvqcN084676; Fri, 16 Feb 2018 22:57:52 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GMvqBN084675; Fri, 16 Feb 2018 22:57:52 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802162257.w1GMvqBN084675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 22:57:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329415 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329415 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 22:57:53 -0000 Author: kevans Date: Fri Feb 16 22:57:52 2018 New Revision: 329415 URL: https://svnweb.freebsd.org/changeset/base/329415 Log: stand/lua: Don't reload kernel config if we only have one kernel Don't move this into config.reload because we may want to force reloads if /boot changes out from under us later. As a caution: changing kernels in lualoader at the moment might not be loading all of your modules (in my testing, at least) from loader.conf(5). This is a known problem. Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Fri Feb 16 22:51:08 2018 (r329414) +++ head/stand/lua/menu.lua Fri Feb 16 22:57:52 2018 (r329415) @@ -213,8 +213,10 @@ menu.welcome = { " (" .. idx .. " of " .. #all_choices .. ")"; end, - func = function(choice) - config.reload(choice); + func = function(choice, all_choices) + if (#all_choices > 1) then + config.reload(choice); + end end, alias = {"k", "K"} }, @@ -300,7 +302,8 @@ function menu.run(m) if (#choices > 0) then caridx = (caridx % #choices) + 1; menu.setCarouselIndex(carid, caridx); - sel_entry.func(choices[caridx]); + sel_entry.func(choices[caridx], + choices); end elseif (sel_entry.entry_type == core.MENU_SUBMENU) then -- recurse From owner-svn-src-head@freebsd.org Fri Feb 16 23:18: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 E6040F1C02B; Fri, 16 Feb 2018 23:18:42 +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 990B477C04; Fri, 16 Feb 2018 23:18:42 +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 937B214493; Fri, 16 Feb 2018 23:18:42 +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 w1GNIgoh094541; Fri, 16 Feb 2018 23:18:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GNIgsC094540; Fri, 16 Feb 2018 23:18:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201802162318.w1GNIgsC094540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 16 Feb 2018 23:18:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329416 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 329416 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 23:18:43 -0000 Author: kib Date: Fri Feb 16 23:18:42 2018 New Revision: 329416 URL: https://svnweb.freebsd.org/changeset/base/329416 Log: Remove unused symbols. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/x86/x86/mp_x86.c Modified: head/sys/x86/x86/mp_x86.c ============================================================================== --- head/sys/x86/x86/mp_x86.c Fri Feb 16 22:57:52 2018 (r329415) +++ head/sys/x86/x86/mp_x86.c Fri Feb 16 23:18:42 2018 (r329416) @@ -75,15 +75,6 @@ __FBSDID("$FreeBSD$"); #include #include -#define WARMBOOT_TARGET 0 -#define WARMBOOT_OFF (KERNBASE + 0x0467) -#define WARMBOOT_SEG (KERNBASE + 0x0469) - -#define CMOS_REG (0x70) -#define CMOS_DATA (0x71) -#define BIOS_RESET (0x0f) -#define BIOS_WARM (0x0a) - static MALLOC_DEFINE(M_CPUS, "cpus", "CPU items"); /* lock region used by kernel profiling */ From owner-svn-src-head@freebsd.org Fri Feb 16 23:59: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 A053DF1EFC2; Fri, 16 Feb 2018 23:59:51 +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 4E60F79A38; Fri, 16 Feb 2018 23:59:51 +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 4830C14B2C; Fri, 16 Feb 2018 23:59:51 +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 w1GNxpjF015587; Fri, 16 Feb 2018 23:59:51 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GNxp9Z015586; Fri, 16 Feb 2018 23:59:51 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802162359.w1GNxp9Z015586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 23:59:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329417 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329417 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 16 Feb 2018 23:59:51 -0000 Author: kevans Date: Fri Feb 16 23:59:50 2018 New Revision: 329417 URL: https://svnweb.freebsd.org/changeset/base/329417 Log: stand/lua: Make CAROUSEL_ENTRY func parameters consistent with name We have no need for the index yet, but add it anyways to keep signatures consistent. Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Fri Feb 16 23:18:42 2018 (r329416) +++ head/stand/lua/menu.lua Fri Feb 16 23:59:50 2018 (r329417) @@ -213,7 +213,7 @@ menu.welcome = { " (" .. idx .. " of " .. #all_choices .. ")"; end, - func = function(choice, all_choices) + func = function(idx, choice, all_choices) if (#all_choices > 1) then config.reload(choice); end @@ -302,7 +302,7 @@ function menu.run(m) if (#choices > 0) then caridx = (caridx % #choices) + 1; menu.setCarouselIndex(carid, caridx); - sel_entry.func(choices[caridx], + sel_entry.func(caridx, choices[caridx], choices); end elseif (sel_entry.entry_type == core.MENU_SUBMENU) then From owner-svn-src-head@freebsd.org Sat Feb 17 00: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 D5728F20032; Sat, 17 Feb 2018 00:12:30 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 85F057A48B; Sat, 17 Feb 2018 00:12:30 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 809AD14E61; Sat, 17 Feb 2018 00:12:30 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1H0CUYS025361; Sat, 17 Feb 2018 00:12:30 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H0CUJC025360; Sat, 17 Feb 2018 00:12:30 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201802170012.w1H0CUJC025360@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: benno set sender to benno@FreeBSD.org using -f From: Benno Rice Date: Sat, 17 Feb 2018 00:12:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329418 - head/stand/i386/boot2 X-SVN-Group: head X-SVN-Commit-Author: benno X-SVN-Commit-Paths: head/stand/i386/boot2 X-SVN-Commit-Revision: 329418 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 00:12:31 -0000 Author: benno Date: Sat Feb 17 00:12:30 2018 New Revision: 329418 URL: https://svnweb.freebsd.org/changeset/base/329418 Log: Revert r329269. I tried to rework a section to fit inside 80 columns but the change ended up being functional. Back this out so I can readdress. Modified: head/stand/i386/boot2/boot2.c Modified: head/stand/i386/boot2/boot2.c ============================================================================== --- head/stand/i386/boot2/boot2.c Fri Feb 16 23:59:50 2018 (r329417) +++ head/stand/i386/boot2/boot2.c Sat Feb 17 00:12:30 2018 (r329418) @@ -72,33 +72,33 @@ extern uint32_t _end; static const char optstr[NOPT] = "DhaCcdgmnpqrsv"; /* Also 'P', 'S' */ static const unsigned char flags[NOPT] = { - RBX_DUAL, - RBX_SERIAL, - RBX_ASKNAME, - RBX_CDROM, - RBX_CONFIG, - RBX_KDB, - RBX_GDB, - RBX_MUTE, - RBX_NOINTR, - RBX_PAUSE, - RBX_QUIET, - RBX_DFLTROOT, - RBX_SINGLE, - RBX_VERBOSE + RBX_DUAL, + RBX_SERIAL, + RBX_ASKNAME, + RBX_CDROM, + RBX_CONFIG, + RBX_KDB, + RBX_GDB, + RBX_MUTE, + RBX_NOINTR, + RBX_PAUSE, + RBX_QUIET, + RBX_DFLTROOT, + RBX_SINGLE, + RBX_VERBOSE }; static const char *const dev_nm[NDEV] = {"ad", "da", "fd"}; static const unsigned char dev_maj[NDEV] = {30, 4, 2}; static struct dsk { - unsigned drive; - unsigned type; - unsigned unit; - uint8_t slice; - uint8_t part; - unsigned start; - int init; + unsigned drive; + unsigned type; + unsigned unit; + uint8_t slice; + uint8_t part; + unsigned start; + int init; } dsk; static char cmd[512], cmddup[512], knamebuf[1024]; static const char *kname; @@ -126,21 +126,18 @@ static void memcpy(void *, const void *, int); static void memcpy(void *dst, const void *src, int len) { - const char *s; - char *d; + const char *s = src; + char *d = dst; - s = src; - d = dst; - while (len--) - *d++ = *s++; + while (len--) + *d++ = *s++; } static inline int strcmp(const char *s1, const char *s2) { - - for (; *s1 == *s2 && *s1; s1++, s2++); - return ((unsigned char)*s1 - (unsigned char)*s2); + for (; *s1 == *s2 && *s1; s1++, s2++); + return (unsigned char)*s1 - (unsigned char)*s2; } #define UFS_SMALL_CGBASE @@ -149,519 +146,501 @@ strcmp(const char *s1, const char *s2) static int xfsread(ufs_ino_t inode, void *buf, size_t nbyte) { - - if ((size_t)fsread(inode, buf, nbyte) != nbyte) { - printf("Invalid %s\n", "format"); - return (-1); - } - return (0); + if ((size_t)fsread(inode, buf, nbyte) != nbyte) { + printf("Invalid %s\n", "format"); + return -1; + } + return 0; } static inline void getstr(void) { - char *s; - int c; + char *s; + int c; - s = cmd; - for (;;) { - switch (c = xgetc(0)) { - case 0: - break; - case '\177': - case '\b': - if (s > cmd) { - s--; - printf("\b \b"); - } - break; - case '\n': - case '\r': - *s = 0; - return; - default: - if (s - cmd < sizeof(cmd) - 1) - *s++ = c; - putchar(c); - } + s = cmd; + for (;;) { + switch (c = xgetc(0)) { + case 0: + break; + case '\177': + case '\b': + if (s > cmd) { + s--; + printf("\b \b"); + } + break; + case '\n': + case '\r': + *s = 0; + return; + default: + if (s - cmd < sizeof(cmd) - 1) + *s++ = c; + putchar(c); } + } } static inline void putc(int c) { - - v86.addr = 0x10; - v86.eax = 0xe00 | (c & 0xff); - v86.ebx = 0x7; - v86int(); + v86.addr = 0x10; + v86.eax = 0xe00 | (c & 0xff); + v86.ebx = 0x7; + v86int(); } int main(void) { - uint8_t autoboot; - ufs_ino_t ino; - size_t nbyte; + uint8_t autoboot; + ufs_ino_t ino; + size_t nbyte; - dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); - v86.ctl = V86_FLAGS; - v86.efl = PSL_RESERVED_DEFAULT | PSL_I; - dsk.drive = *(uint8_t *)PTOV(ARGS); - dsk.type = dsk.drive & DRV_HARD ? TYPE_AD : TYPE_FD; - dsk.unit = dsk.drive & DRV_MASK; - dsk.slice = *(uint8_t *)PTOV(ARGS + 1) + 1; - bootinfo.bi_version = BOOTINFO_VERSION; - bootinfo.bi_size = sizeof(bootinfo); + dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); + v86.ctl = V86_FLAGS; + v86.efl = PSL_RESERVED_DEFAULT | PSL_I; + dsk.drive = *(uint8_t *)PTOV(ARGS); + dsk.type = dsk.drive & DRV_HARD ? TYPE_AD : TYPE_FD; + dsk.unit = dsk.drive & DRV_MASK; + dsk.slice = *(uint8_t *)PTOV(ARGS + 1) + 1; + bootinfo.bi_version = BOOTINFO_VERSION; + bootinfo.bi_size = sizeof(bootinfo); - /* Process configuration file */ + /* Process configuration file */ - autoboot = 1; + autoboot = 1; - if ((ino = lookup(PATH_CONFIG)) || - (ino = lookup(PATH_DOTCONFIG))) { - nbyte = fsread(ino, cmd, sizeof(cmd) - 1); - cmd[nbyte] = '\0'; - } + if ((ino = lookup(PATH_CONFIG)) || + (ino = lookup(PATH_DOTCONFIG))) { + nbyte = fsread(ino, cmd, sizeof(cmd) - 1); + cmd[nbyte] = '\0'; + } - if (*cmd) { - memcpy(cmddup, cmd, sizeof(cmd)); - if (parse()) - autoboot = 0; - if (!OPT_CHECK(RBX_QUIET)) - printf("%s: %s", PATH_CONFIG, cmddup); - /* Do not process this command twice */ - *cmd = 0; - } + if (*cmd) { + memcpy(cmddup, cmd, sizeof(cmd)); + if (parse()) + autoboot = 0; + if (!OPT_CHECK(RBX_QUIET)) + printf("%s: %s", PATH_CONFIG, cmddup); + /* Do not process this command twice */ + *cmd = 0; + } - /* - * Try to exec stage 3 boot loader. If interrupted by a keypress, - * or in case of failure, try to load a kernel directly instead. - */ + /* + * Try to exec stage 3 boot loader. If interrupted by a keypress, + * or in case of failure, try to load a kernel directly instead. + */ - if (!kname) { - kname = PATH_LOADER; - if (autoboot && !keyhit(3*SECOND)) { - load(); - kname = PATH_KERNEL; - } + if (!kname) { + kname = PATH_LOADER; + if (autoboot && !keyhit(3*SECOND)) { + load(); + kname = PATH_KERNEL; } + } - /* Present the user with the boot2 prompt. */ + /* Present the user with the boot2 prompt. */ - for (;;) { - if (!autoboot || !OPT_CHECK(RBX_QUIET)) - printf("\nFreeBSD/x86 boot\n" - "Default: %u:%s(%u,%c)%s\n" - "boot: ", - dsk.drive & DRV_MASK, dev_nm[dsk.type], dsk.unit, - 'a' + dsk.part, kname); - if (DO_SIO) - sio_flush(); - if (!autoboot || keyhit(3*SECOND)) - getstr(); - else if (!autoboot || !OPT_CHECK(RBX_QUIET)) - putchar('\n'); - autoboot = 0; - if (parse()) - putchar('\a'); - else - load(); - } + for (;;) { + if (!autoboot || !OPT_CHECK(RBX_QUIET)) + printf("\nFreeBSD/x86 boot\n" + "Default: %u:%s(%u,%c)%s\n" + "boot: ", + dsk.drive & DRV_MASK, dev_nm[dsk.type], dsk.unit, + 'a' + dsk.part, kname); + if (DO_SIO) + sio_flush(); + if (!autoboot || keyhit(3*SECOND)) + getstr(); + else if (!autoboot || !OPT_CHECK(RBX_QUIET)) + putchar('\n'); + autoboot = 0; + if (parse()) + putchar('\a'); + else + load(); + } } /* XXX - Needed for btxld to link the boot2 binary; do not remove. */ void exit(int x) { - } static void load(void) { - union { - struct exec ex; - Elf32_Ehdr eh; - } hdr; - static Elf32_Phdr ep[2]; - static Elf32_Shdr es[2]; - caddr_t p; - ufs_ino_t ino; - uint32_t addr; - int k; - uint8_t i, j; + union { + struct exec ex; + Elf32_Ehdr eh; + } hdr; + static Elf32_Phdr ep[2]; + static Elf32_Shdr es[2]; + caddr_t p; + ufs_ino_t ino; + uint32_t addr; + int k; + uint8_t i, j; - if (!(ino = lookup(kname))) { - if (!ls) - printf("No %s\n", kname); + if (!(ino = lookup(kname))) { + if (!ls) + printf("No %s\n", kname); + return; + } + if (xfsread(ino, &hdr, sizeof(hdr))) + return; + + if (N_GETMAGIC(hdr.ex) == ZMAGIC) { + addr = hdr.ex.a_entry & 0xffffff; + p = PTOV(addr); + fs_off = PAGE_SIZE; + if (xfsread(ino, p, hdr.ex.a_text)) + return; + p += roundup2(hdr.ex.a_text, PAGE_SIZE); + if (xfsread(ino, p, hdr.ex.a_data)) + return; + } else if (IS_ELF(hdr.eh)) { + fs_off = hdr.eh.e_phoff; + for (j = k = 0; k < hdr.eh.e_phnum && j < 2; k++) { + if (xfsread(ino, ep + j, sizeof(ep[0]))) return; + if (ep[j].p_type == PT_LOAD) + j++; } - if (xfsread(ino, &hdr, sizeof(hdr))) + for (i = 0; i < 2; i++) { + p = PTOV(ep[i].p_paddr & 0xffffff); + fs_off = ep[i].p_offset; + if (xfsread(ino, p, ep[i].p_filesz)) return; - - if (N_GETMAGIC(hdr.ex) == ZMAGIC) { - addr = hdr.ex.a_entry & 0xffffff; - p = PTOV(addr); - fs_off = PAGE_SIZE; - if (xfsread(ino, p, hdr.ex.a_text)) - return; - p += roundup2(hdr.ex.a_text, PAGE_SIZE); - if (xfsread(ino, p, hdr.ex.a_data)) - return; - } else if (IS_ELF(hdr.eh)) { - fs_off = hdr.eh.e_phoff; - for (j = k = 0; k < hdr.eh.e_phnum && j < 2; k++) { - if (xfsread(ino, ep + j, sizeof(ep[0]))) - return; - if (ep[j].p_type == PT_LOAD) - j++; - } - for (i = 0; i < 2; i++) { - p = PTOV(ep[i].p_paddr & 0xffffff); - fs_off = ep[i].p_offset; - if (xfsread(ino, p, ep[i].p_filesz)) - return; - } - p += roundup2(ep[1].p_memsz, PAGE_SIZE); - bootinfo.bi_symtab = VTOP(p); - if (hdr.eh.e_shnum == hdr.eh.e_shstrndx + 3) { - fs_off = hdr.eh.e_shoff + sizeof(es[0]) * - (hdr.eh.e_shstrndx + 1); - if (xfsread(ino, &es, sizeof(es))) - return; - for (i = 0; i < 2; i++) { - *(Elf32_Word *)p = es[i].sh_size; - p += sizeof(es[i].sh_size); - fs_off = es[i].sh_offset; - if (xfsread(ino, p, es[i].sh_size)) - return; - p += es[i].sh_size; - } - } - addr = hdr.eh.e_entry & 0xffffff; - bootinfo.bi_esymtab = VTOP(p); - } else { - printf("Invalid %s\n", "format"); + } + p += roundup2(ep[1].p_memsz, PAGE_SIZE); + bootinfo.bi_symtab = VTOP(p); + if (hdr.eh.e_shnum == hdr.eh.e_shstrndx + 3) { + fs_off = hdr.eh.e_shoff + sizeof(es[0]) * + (hdr.eh.e_shstrndx + 1); + if (xfsread(ino, &es, sizeof(es))) return; + for (i = 0; i < 2; i++) { + *(Elf32_Word *)p = es[i].sh_size; + p += sizeof(es[i].sh_size); + fs_off = es[i].sh_offset; + if (xfsread(ino, p, es[i].sh_size)) + return; + p += es[i].sh_size; + } } + addr = hdr.eh.e_entry & 0xffffff; + bootinfo.bi_esymtab = VTOP(p); + } else { + printf("Invalid %s\n", "format"); + return; + } - bootinfo.bi_kernelname = VTOP(kname); - bootinfo.bi_bios_dev = dsk.drive; - __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), - MAKEBOOTDEV(dev_maj[dsk.type], dsk.slice, dsk.unit, dsk.part), - 0, 0, 0, VTOP(&bootinfo)); + bootinfo.bi_kernelname = VTOP(kname); + bootinfo.bi_bios_dev = dsk.drive; + __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), + MAKEBOOTDEV(dev_maj[dsk.type], dsk.slice, dsk.unit, dsk.part), + 0, 0, 0, VTOP(&bootinfo)); } static int parse() { - char *arg; - char *ep, *p, *q; - const char *cp; - unsigned int drv; - int c, i, j; - size_t k; + char *arg = cmd; + char *ep, *p, *q; + const char *cp; + unsigned int drv; + int c, i, j; + size_t k; - arg = cmd; - - while ((c = *arg++)) { - if (c == ' ' || c == '\t' || c == '\n') - continue; - for (p = arg; *p && *p != '\n' && *p != ' ' && *p != '\t'; p++); - ep = p; - if (*p) - *p++ = 0; - if (c == '-') { - while ((c = *arg++)) { - if (c == 'P') { - if (*(uint8_t *)PTOV(0x496) & 0x10) { - cp = "yes"; - } else { - opts |= OPT_SET(RBX_DUAL) | - OPT_SET(RBX_SERIAL); - cp = "no"; - } - printf("Keyboard: %s\n", cp); - continue; + while ((c = *arg++)) { + if (c == ' ' || c == '\t' || c == '\n') + continue; + for (p = arg; *p && *p != '\n' && *p != ' ' && *p != '\t'; p++); + ep = p; + if (*p) + *p++ = 0; + if (c == '-') { + while ((c = *arg++)) { + if (c == 'P') { + if (*(uint8_t *)PTOV(0x496) & 0x10) { + cp = "yes"; + } else { + opts |= OPT_SET(RBX_DUAL) | OPT_SET(RBX_SERIAL); + cp = "no"; + } + printf("Keyboard: %s\n", cp); + continue; #if SERIAL - } else if (c == 'S') { - j = 0; - while (*arg <= '9') { - i = (unsigned int)(*arg - '0'); - j = j * 10 + i; - arg++; - } - if (j > 0 && i == -'0') { - comspeed = j; - break; - } - /* - * Fall through to error below - * ('S' not in optstr[]). - */ + } else if (c == 'S') { + j = 0; + while ((unsigned int)(i = *arg++ - '0') <= 9) + j = j * 10 + i; + if (j > 0 && i == -'0') { + comspeed = j; + break; + } + /* Fall through to error below ('S' not in optstr[]). */ #endif - } - for (i = 0; c != optstr[i]; i++) - if (i == NOPT - 1) - return (-1); - opts ^= OPT_SET(flags[i]); - } + } + for (i = 0; c != optstr[i]; i++) + if (i == NOPT - 1) + return -1; + opts ^= OPT_SET(flags[i]); + } #if SERIAL - ioctrl = OPT_CHECK(RBX_DUAL) ? - (IO_SERIAL|IO_KEYBOARD) : - OPT_CHECK(RBX_SERIAL) ? IO_SERIAL : IO_KEYBOARD; - if (DO_SIO) { - if (sio_init(115200 / comspeed) != 0) - ioctrl &= ~IO_SERIAL; - } + ioctrl = OPT_CHECK(RBX_DUAL) ? (IO_SERIAL|IO_KEYBOARD) : + OPT_CHECK(RBX_SERIAL) ? IO_SERIAL : IO_KEYBOARD; + if (DO_SIO) { + if (sio_init(115200 / comspeed) != 0) + ioctrl &= ~IO_SERIAL; + } #endif - } else { - for (q = arg--; *q && *q != '('; q++); - if (*q) { - drv = -1; - if (arg[1] == ':') { - drv = *arg - '0'; - if (drv > 9) - return (-1); - arg += 2; - } - if (q - arg != 2) - return -1; - for (i = 0; arg[0] != dev_nm[i][0] || - arg[1] != dev_nm[i][1]; i++) - if (i == NDEV - 1) - return (-1); - dsk.type = i; - arg += 3; - dsk.unit = *arg - '0'; - if (arg[1] != ',' || dsk.unit > 9) - return (-1); - arg += 2; - dsk.slice = WHOLE_DISK_SLICE; - if (arg[1] == ',') { - dsk.slice = *arg - '0' + 1; - if (dsk.slice > NDOSPART + 1) - return (-1); - arg += 2; - } - if (arg[1] != ')') - return (-1); - dsk.part = *arg - 'a'; - if (dsk.part > 7) - return (-1); - arg += 2; - if (drv == -1) - drv = dsk.unit; - dsk.drive = (dsk.type <= TYPE_MAXHARD - ? DRV_HARD : 0) + drv; - dsk_meta = 0; - } - k = ep - arg; - if (k > 0) { - if (k >= sizeof(knamebuf)) - return (-1); - memcpy(knamebuf, arg, k + 1); - kname = knamebuf; - } + } else { + for (q = arg--; *q && *q != '('; q++); + if (*q) { + drv = -1; + if (arg[1] == ':') { + drv = *arg - '0'; + if (drv > 9) + return (-1); + arg += 2; } - arg = p; + if (q - arg != 2) + return -1; + for (i = 0; arg[0] != dev_nm[i][0] || + arg[1] != dev_nm[i][1]; i++) + if (i == NDEV - 1) + return -1; + dsk.type = i; + arg += 3; + dsk.unit = *arg - '0'; + if (arg[1] != ',' || dsk.unit > 9) + return -1; + arg += 2; + dsk.slice = WHOLE_DISK_SLICE; + if (arg[1] == ',') { + dsk.slice = *arg - '0' + 1; + if (dsk.slice > NDOSPART + 1) + return -1; + arg += 2; + } + if (arg[1] != ')') + return -1; + dsk.part = *arg - 'a'; + if (dsk.part > 7) + return (-1); + arg += 2; + if (drv == -1) + drv = dsk.unit; + dsk.drive = (dsk.type <= TYPE_MAXHARD + ? DRV_HARD : 0) + drv; + dsk_meta = 0; + } + k = ep - arg; + if (k > 0) { + if (k >= sizeof(knamebuf)) + return -1; + memcpy(knamebuf, arg, k + 1); + kname = knamebuf; + } } - return (0); + arg = p; + } + return 0; } static int dskread(void *buf, unsigned lba, unsigned nblk) { - struct dos_partition *dp; - struct disklabel *d; - char *sec; - unsigned i; - uint8_t sl; - const char *reason; + struct dos_partition *dp; + struct disklabel *d; + char *sec; + unsigned i; + uint8_t sl; + const char *reason; - if (!dsk_meta) { - sec = dmadat->secbuf; - dsk.start = 0; - if (drvread(sec, DOSBBSECTOR, 1)) - return (-1); - dp = (void *)(sec + DOSPARTOFF); - sl = dsk.slice; - if (sl < BASE_SLICE) { - for (i = 0; i < NDOSPART; i++) - if (dp[i].dp_typ == DOSPTYP_386BSD && - (dp[i].dp_flag & 0x80 || sl < BASE_SLICE)) { - sl = BASE_SLICE + i; - if (dp[i].dp_flag & 0x80 || - dsk.slice == COMPATIBILITY_SLICE) - break; - } - if (dsk.slice == WHOLE_DISK_SLICE) - dsk.slice = sl; + if (!dsk_meta) { + sec = dmadat->secbuf; + dsk.start = 0; + if (drvread(sec, DOSBBSECTOR, 1)) + return -1; + dp = (void *)(sec + DOSPARTOFF); + sl = dsk.slice; + if (sl < BASE_SLICE) { + for (i = 0; i < NDOSPART; i++) + if (dp[i].dp_typ == DOSPTYP_386BSD && + (dp[i].dp_flag & 0x80 || sl < BASE_SLICE)) { + sl = BASE_SLICE + i; + if (dp[i].dp_flag & 0x80 || + dsk.slice == COMPATIBILITY_SLICE) + break; } - if (sl != WHOLE_DISK_SLICE) { - if (sl != COMPATIBILITY_SLICE) - dp += sl - BASE_SLICE; - if (dp->dp_typ != DOSPTYP_386BSD) { - reason = "slice"; - goto error; - } - dsk.start = dp->dp_start; - } - if (drvread(sec, dsk.start + LABELSECTOR, 1)) - return (-1); - d = (void *)(sec + LABELOFFSET); - if (d->d_magic != DISKMAGIC || d->d_magic2 != DISKMAGIC) { - if (dsk.part != RAW_PART) { - reason = "label"; - goto error; - } - } else { - if (!dsk.init) { - if (d->d_type == DTYPE_SCSI) - dsk.type = TYPE_DA; - dsk.init++; - } - if (dsk.part >= d->d_npartitions || - !d->d_partitions[dsk.part].p_size) { - reason = "partition"; - goto error; - } - dsk.start += d->d_partitions[dsk.part].p_offset; - dsk.start -= d->d_partitions[RAW_PART].p_offset; - } + if (dsk.slice == WHOLE_DISK_SLICE) + dsk.slice = sl; } - return (drvread(buf, dsk.start + lba, nblk)); + if (sl != WHOLE_DISK_SLICE) { + if (sl != COMPATIBILITY_SLICE) + dp += sl - BASE_SLICE; + if (dp->dp_typ != DOSPTYP_386BSD) { + reason = "slice"; + goto error; + } + dsk.start = dp->dp_start; + } + if (drvread(sec, dsk.start + LABELSECTOR, 1)) + return -1; + d = (void *)(sec + LABELOFFSET); + if (d->d_magic != DISKMAGIC || d->d_magic2 != DISKMAGIC) { + if (dsk.part != RAW_PART) { + reason = "label"; + goto error; + } + } else { + if (!dsk.init) { + if (d->d_type == DTYPE_SCSI) + dsk.type = TYPE_DA; + dsk.init++; + } + if (dsk.part >= d->d_npartitions || + !d->d_partitions[dsk.part].p_size) { + reason = "partition"; + goto error; + } + dsk.start += d->d_partitions[dsk.part].p_offset; + dsk.start -= d->d_partitions[RAW_PART].p_offset; + } + } + return drvread(buf, dsk.start + lba, nblk); error: - printf("Invalid %s\n", reason); - return (-1); + printf("Invalid %s\n", reason); + return -1; } static void printf(const char *fmt,...) { - va_list ap; - static char buf[10]; - char *s; - unsigned u; - int c; + va_list ap; + static char buf[10]; + char *s; + unsigned u; + int c; - va_start(ap, fmt); - while ((c = *fmt++)) { - if (c == '%') { - c = *fmt++; - switch (c) { - case 'c': - putchar(va_arg(ap, int)); - continue; - case 's': - for (s = va_arg(ap, char *); *s; s++) - putchar(*s); - continue; - case 'u': - u = va_arg(ap, unsigned); - s = buf; - do - *s++ = '0' + u % 10U; - while (u /= 10U); - while (--s >= buf) - putchar(*s); - continue; - } - } - putchar(c); + va_start(ap, fmt); + while ((c = *fmt++)) { + if (c == '%') { + c = *fmt++; + switch (c) { + case 'c': + putchar(va_arg(ap, int)); + continue; + case 's': + for (s = va_arg(ap, char *); *s; s++) + putchar(*s); + continue; + case 'u': + u = va_arg(ap, unsigned); + s = buf; + do + *s++ = '0' + u % 10U; + while (u /= 10U); + while (--s >= buf) + putchar(*s); + continue; + } } - va_end(ap); - return; + putchar(c); + } + va_end(ap); + return; } static void putchar(int c) { - - if (c == '\n') - xputc('\r'); - xputc(c); + if (c == '\n') + xputc('\r'); + xputc(c); } static int drvread(void *buf, unsigned lba, unsigned nblk) { - static unsigned c = 0x2d5c7c2f; + static unsigned c = 0x2d5c7c2f; - if (!OPT_CHECK(RBX_QUIET)) { - xputc(c = c << 8 | c >> 24); - xputc('\b'); - } - v86.ctl = V86_ADDR | V86_CALLF | V86_FLAGS; - v86.addr = XREADORG; /* call to xread in boot1 */ - v86.es = VTOPSEG(buf); - v86.eax = lba; - v86.ebx = VTOPOFF(buf); - v86.ecx = lba >> 16; - v86.edx = nblk << 8 | dsk.drive; - v86int(); - v86.ctl = V86_FLAGS; - if (V86_CY(v86.efl)) { - printf("error %u lba %u\n", v86.eax >> 8 & 0xff, lba); - return (-1); - } - return (0); + if (!OPT_CHECK(RBX_QUIET)) { + xputc(c = c << 8 | c >> 24); + xputc('\b'); + } + v86.ctl = V86_ADDR | V86_CALLF | V86_FLAGS; + v86.addr = XREADORG; /* call to xread in boot1 */ + v86.es = VTOPSEG(buf); + v86.eax = lba; + v86.ebx = VTOPOFF(buf); + v86.ecx = lba >> 16; + v86.edx = nblk << 8 | dsk.drive; + v86int(); + v86.ctl = V86_FLAGS; + if (V86_CY(v86.efl)) { + printf("error %u lba %u\n", v86.eax >> 8 & 0xff, lba); + return -1; + } + return 0; } static int keyhit(unsigned ticks) { - uint32_t t0, t1; + uint32_t t0, t1; - if (OPT_CHECK(RBX_NOINTR)) - return (0); - t0 = 0; - for (;;) { - if (xgetc(1)) - return (1); - t1 = *(uint32_t *)PTOV(0x46c); - if (!t0) - t0 = t1; - if ((uint32_t)(t1 - t0) >= ticks) - return (0); - } + if (OPT_CHECK(RBX_NOINTR)) + return 0; + t0 = 0; + for (;;) { + if (xgetc(1)) + return 1; + t1 = *(uint32_t *)PTOV(0x46c); + if (!t0) + t0 = t1; + if ((uint32_t)(t1 - t0) >= ticks) + return 0; + } } static int xputc(int c) { - - if (DO_KBD) - putc(c); - if (DO_SIO) - sio_putc(c); - return (c); + if (DO_KBD) + putc(c); + if (DO_SIO) + sio_putc(c); + return c; } static int getc(int fn) { - - v86.addr = 0x16; - v86.eax = fn << 8; - v86int(); - return (fn == 0 ? v86.eax & 0xff : !V86_ZR(v86.efl)); + v86.addr = 0x16; + v86.eax = fn << 8; + v86int(); + return fn == 0 ? v86.eax & 0xff : !V86_ZR(v86.efl); } static int xgetc(int fn) { - - if (OPT_CHECK(RBX_NOINTR)) - return (0); - - for (;;) { - if (DO_KBD && getc(1)) - return (fn ? 1 : getc(0)); - if (DO_SIO && sio_ischar()) - return (fn ? 1 : sio_getc()); - if (fn) - return (0); - } + if (OPT_CHECK(RBX_NOINTR)) + return 0; + for (;;) { + if (DO_KBD && getc(1)) + return fn ? 1 : getc(0); + if (DO_SIO && sio_ischar()) + return fn ? 1 : sio_getc(); + if (fn) + return 0; + } } From owner-svn-src-head@freebsd.org Sat Feb 17 00:21: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 84922F20AFA; Sat, 17 Feb 2018 00:21:51 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 35D157A9B5; Sat, 17 Feb 2018 00:21:51 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 30D6B14ED3; Sat, 17 Feb 2018 00:21:51 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1H0LpXk029357; Sat, 17 Feb 2018 00:21:51 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H0LpaN029356; Sat, 17 Feb 2018 00:21:51 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201802170021.w1H0LpaN029356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 17 Feb 2018 00:21:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329419 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 329419 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 00:21:51 -0000 Author: mjg Date: Sat Feb 17 00:21:50 2018 New Revision: 329419 URL: https://svnweb.freebsd.org/changeset/base/329419 Log: Tidy up kern_wait6 - don't relock curproc in msleep - don't relock proctree if P_STATCHILD is spotted - reformat the proc_to_reap call in the main loop Modified: head/sys/kern/kern_exit.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Sat Feb 17 00:12:30 2018 (r329418) +++ head/sys/kern/kern_exit.c Sat Feb 17 00:21:50 2018 (r329419) @@ -1202,21 +1202,21 @@ loop: q->p_flag &= ~P_STATCHILD; PROC_UNLOCK(q); } - nfound = 0; sx_xlock(&proctree_lock); +loop_locked: + nfound = 0; LIST_FOREACH(p, &q->p_children, p_sibling) { pid = p->p_pid; ret = proc_to_reap(td, p, idtype, id, status, options, wrusage, siginfo, 0); if (ret == 0) continue; - else if (ret == 1) - nfound++; - else { + else if (ret != 1) { td->td_retval[0] = pid; return (0); } + nfound++; PROC_LOCK_ASSERT(p, MA_OWNED); if ((options & (WTRAPPED | WUNTRACED)) != 0) @@ -1237,7 +1237,7 @@ loop: report_alive_proc(td, p, siginfo, status, options, CLD_TRAPPED); return (0); - } + } if ((options & WUNTRACED) != 0 && (p->p_flag & P_STOPPED_SIG) != 0 && p->p_suspcount == p->p_numthreads && @@ -1293,13 +1293,13 @@ loop: return (0); } PROC_LOCK(q); - sx_xunlock(&proctree_lock); if (q->p_flag & P_STATCHILD) { q->p_flag &= ~P_STATCHILD; - error = 0; - } else - error = msleep(q, &q->p_mtx, PWAIT | PCATCH, "wait", 0); - PROC_UNLOCK(q); + PROC_UNLOCK(q); + goto loop_locked; + } + sx_xunlock(&proctree_lock); + error = msleep(q, &q->p_mtx, PWAIT | PCATCH | PDROP, "wait", 0); if (error) return (error); goto loop; From owner-svn-src-head@freebsd.org Sat Feb 17 00:23: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 70746F20D50; Sat, 17 Feb 2018 00:23:29 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2129C7ABE7; Sat, 17 Feb 2018 00:23:29 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C13114FFC; Sat, 17 Feb 2018 00:23:29 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1H0NSfW030382; Sat, 17 Feb 2018 00:23:28 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H0NSH0030381; Sat, 17 Feb 2018 00:23:28 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201802170023.w1H0NSH0030381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 17 Feb 2018 00:23:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329420 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 329420 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 00:23:29 -0000 Author: mjg Date: Sat Feb 17 00:23:28 2018 New Revision: 329420 URL: https://svnweb.freebsd.org/changeset/base/329420 Log: Postpone sx_sunlock(&proctree_lock) on fork until after allproc is dropped. There is a significant contention on the lock during -j 128 package build. This change drops total wait time on this lock by 60%. Modified: head/sys/kern/kern_fork.c Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Sat Feb 17 00:21:50 2018 (r329419) +++ head/sys/kern/kern_fork.c Sat Feb 17 00:23:28 2018 (r329420) @@ -401,8 +401,6 @@ do_fork(struct thread *td, struct fork_req *fr, struct trypid = fork_findpid(fr->fr_flags); - sx_sunlock(&proctree_lock); - p2->p_state = PRS_NEW; /* protect against others */ p2->p_pid = trypid; AUDIT_ARG_PID(p2->p_pid); @@ -414,6 +412,7 @@ do_fork(struct thread *td, struct fork_req *fr, struct PROC_LOCK(p1); sx_xunlock(&allproc_lock); + sx_sunlock(&proctree_lock); bcopy(&p1->p_startcopy, &p2->p_startcopy, __rangeof(struct proc, p_startcopy, p_endcopy)); @@ -977,8 +976,8 @@ fork1(struct thread *td, struct fork_req *fr) } error = EAGAIN; - sx_sunlock(&proctree_lock); sx_xunlock(&allproc_lock); + sx_sunlock(&proctree_lock); #ifdef MAC mac_proc_destroy(newproc); #endif From owner-svn-src-head@freebsd.org Sat Feb 17 00:23: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 77112F20DCC; Sat, 17 Feb 2018 00:23:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2652E7AD19; Sat, 17 Feb 2018 00:23:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2134E14FFD; Sat, 17 Feb 2018 00:23:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1H0NvxE030440; Sat, 17 Feb 2018 00:23:57 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H0Nvqi030439; Sat, 17 Feb 2018 00:23:57 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201802170023.w1H0Nvqi030439@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 17 Feb 2018 00:23:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329421 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 329421 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 00:23:57 -0000 Author: mjg Date: Sat Feb 17 00:23:56 2018 New Revision: 329421 URL: https://svnweb.freebsd.org/changeset/base/329421 Log: Unref the prison after proctree is dropped. Modified: head/sys/kern/kern_exit.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Sat Feb 17 00:23:28 2018 (r329420) +++ head/sys/kern/kern_exit.c Sat Feb 17 00:23:56 2018 (r329421) @@ -530,9 +530,6 @@ exit1(struct thread *td, int rval, int signo) PROC_LOCK(p); p->p_xthread = td; - /* Tell the prison that we are gone. */ - prison_proc_free(p->p_ucred->cr_prison); - #ifdef KDTRACE_HOOKS /* * Tell the DTrace fasttrap provider about the exit if it @@ -602,6 +599,9 @@ exit1(struct thread *td, int rval, int signo) } else PROC_LOCK(p->p_pptr); sx_xunlock(&proctree_lock); + + /* Tell the prison that we are gone. */ + prison_proc_free(p->p_ucred->cr_prison); /* * The state PRS_ZOMBIE prevents other proesses from sending From owner-svn-src-head@freebsd.org Sat Feb 17 00:24: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 2AF8BF20EFD; Sat, 17 Feb 2018 00:24:51 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CDF017AE8C; Sat, 17 Feb 2018 00:24:50 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C90B014FFF; Sat, 17 Feb 2018 00:24:50 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1H0OofI030512; Sat, 17 Feb 2018 00:24:50 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H0OoYR030511; Sat, 17 Feb 2018 00:24:50 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201802170024.w1H0OoYR030511@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 17 Feb 2018 00:24:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329422 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 329422 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 00:24:51 -0000 Author: mjg Date: Sat Feb 17 00:24:50 2018 New Revision: 329422 URL: https://svnweb.freebsd.org/changeset/base/329422 Log: On process exit signal the parent after dropping the proctree lock. Modified: head/sys/kern/kern_exit.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Sat Feb 17 00:23:56 2018 (r329421) +++ head/sys/kern/kern_exit.c Sat Feb 17 00:24:50 2018 (r329422) @@ -193,6 +193,7 @@ exit1(struct thread *td, int rval, int signo) struct proc *p, *nq, *q, *t; struct thread *tdt; ksiginfo_t *ksi, *ksi1; + int signal_parent; mtx_assert(&Giant, MA_NOTOWNED); KASSERT(rval == 0 || signo == 0, ("exit1 rv %d sig %d", rval, signo)); @@ -559,6 +560,7 @@ exit1(struct thread *td, int rval, int signo) * procdesc_exit() to serialize concurrent calls to close() and * exit(). */ + signal_parent = 0; if (p->p_procdesc == NULL || procdesc_exit(p)) { /* * Notify parent that we're gone. If parent has the @@ -588,17 +590,24 @@ exit1(struct thread *td, int rval, int signo) } else mtx_unlock(&p->p_pptr->p_sigacts->ps_mtx); - if (p->p_pptr == p->p_reaper || p->p_pptr == initproc) - childproc_exited(p); - else if (p->p_sigparent != 0) { - if (p->p_sigparent == SIGCHLD) - childproc_exited(p); - else /* LINUX thread */ - kern_psignal(p->p_pptr, p->p_sigparent); + if (p->p_pptr == p->p_reaper || p->p_pptr == initproc) { + signal_parent = 1; + } else if (p->p_sigparent != 0) { + if (p->p_sigparent == SIGCHLD) { + signal_parent = 1; + } else { /* LINUX thread */ + signal_parent = 2; + } } } else PROC_LOCK(p->p_pptr); sx_xunlock(&proctree_lock); + + if (signal_parent == 1) { + childproc_exited(p); + } else if (signal_parent == 2) { + kern_psignal(p->p_pptr, p->p_sigparent); + } /* Tell the prison that we are gone. */ prison_proc_free(p->p_ucred->cr_prison); From owner-svn-src-head@freebsd.org Sat Feb 17 00:42: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 00BEBF221C6; Sat, 17 Feb 2018 00:42:38 +0000 (UTC) (envelope-from jbeich@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 A7CD77B9DF; Sat, 17 Feb 2018 00:42:37 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1354) id A00261819B; Sat, 17 Feb 2018 00:42:37 +0000 (UTC) From: Jan Beich To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329371 - head/sys/compat/linuxkpi/common/include/asm References: <201802161520.w1GFKLiA049085@repo.freebsd.org> Date: Sat, 17 Feb 2018 01:42:15 +0100 In-Reply-To: <201802161520.w1GFKLiA049085@repo.freebsd.org> (Hans Petter Selasky's message of "Fri, 16 Feb 2018 15:20:21 +0000 (UTC)") Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 00:42:38 -0000 Hans Petter Selasky writes: > Author: hselasky > Date: Fri Feb 16 15:20:21 2018 > New Revision: 329371 > URL: https://svnweb.freebsd.org/changeset/base/329371 > > Log: > Allow the cmpxchg() macro in the LinuxKPI to work on pointers without > generating compiler warnings, -Wint-conversion . [...] To generate errors instead ? $ make clean all -C /usr/ports/graphics/drm-next-kmod [...] drm_lock.c:72:10: error: flexible array member 'u8' in a union is not allowed prev = cmpxchg(lock, old, new); ^ /usr/src/sys/compat/linuxkpi/common/include/asm/atomic.h:165:6: note: expanded from macro 'cmpxchg' u8 u8[]; \ ^ drm_lock.c:72:10: error: flexible array member 'u16' in a union is not allowed /usr/src/sys/compat/linuxkpi/common/include/asm/atomic.h:166:7: note: expanded from macro 'cmpxchg' u16 u16[]; \ ^ drm_lock.c:72:10: error: flexible array member 'u32' in a union is not allowed /usr/src/sys/compat/linuxkpi/common/include/asm/atomic.h:167:7: note: expanded from macro 'cmpxchg' u32 u32[]; \ ^ drm_lock.c:72:10: error: flexible array member 'u64' in a union is not allowed /usr/src/sys/compat/linuxkpi/common/include/asm/atomic.h:168:7: note: expanded from macro 'cmpxchg' u64 u64[]; \ ^ From owner-svn-src-head@freebsd.org Sat Feb 17 03:12: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 CD84DF0868D; Sat, 17 Feb 2018 03:12: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 839A78243A; Sat, 17 Feb 2018 03:12: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 7DFDB16EEA; Sat, 17 Feb 2018 03:12:35 +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 w1H3CZHf016406; Sat, 17 Feb 2018 03:12:35 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H3CZw2016405; Sat, 17 Feb 2018 03:12:35 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802170312.w1H3CZw2016405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 17 Feb 2018 03:12:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329424 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329424 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 03:12:36 -0000 Author: kevans Date: Sat Feb 17 03:12:35 2018 New Revision: 329424 URL: https://svnweb.freebsd.org/changeset/base/329424 Log: stand/lua: Don't set autoboot_delay=NO in menu autoboot sequence We'll set it later if "Escape to loader prompt" is actually chosen, there's no need to be setting it here. Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Sat Feb 17 02:14:01 2018 (r329423) +++ head/stand/lua/menu.lua Sat Feb 17 03:12:35 2018 (r329424) @@ -375,8 +375,6 @@ function menu.autoboot() if ch == core.KEY_ENTER then break; else - -- prevent autoboot when escaping to interpreter - loader.setenv("autoboot_delay", "NO"); -- erase autoboot msg screen.setcursor(0, y); print(" " From owner-svn-src-head@freebsd.org Sat Feb 17 04:07: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 9A1F6F0B48B; Sat, 17 Feb 2018 04:07:17 +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 45017843A7; Sat, 17 Feb 2018 04:07:17 +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 3893A177C3; Sat, 17 Feb 2018 04:07:17 +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 w1H47HNM042964; Sat, 17 Feb 2018 04:07:17 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H47HMQ042963; Sat, 17 Feb 2018 04:07:17 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802170407.w1H47HMQ042963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 17 Feb 2018 04:07:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329427 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329427 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 04:07:17 -0000 Author: kevans Date: Sat Feb 17 04:07:16 2018 New Revision: 329427 URL: https://svnweb.freebsd.org/changeset/base/329427 Log: stand/lua: Color non-default kernels blue Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Sat Feb 17 03:39:55 2018 (r329426) +++ head/stand/lua/menu.lua Sat Feb 17 04:07:16 2018 (r329427) @@ -204,11 +204,17 @@ menu.welcome = { return "Kernel: "; end - local kernel_name = color.escapef(color.GREEN) .. - choice .. color.default(); - if (idx == 1) then - kernel_name = "default/" .. kernel_name; + local is_default = (idx == 1); + local kernel_name = ""; + local name_color; + if is_default then + name_color = color.escapef(color.GREEN); + kernel_name = "default/"; + else + name_color = color.escapef(color.BLUE); end + kernel_name = kernel_name .. name_color .. choice .. + color.default(); return color.highlight("K").."ernel: " .. kernel_name .. " (" .. idx .. " of " .. #all_choices .. ")"; From owner-svn-src-head@freebsd.org Sat Feb 17 03:13: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 3DE12F08821; Sat, 17 Feb 2018 03:13:06 +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 E6E478259E; Sat, 17 Feb 2018 03:13:05 +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 E1AB816EF0; Sat, 17 Feb 2018 03:13:05 +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 w1H3D5o3016468; Sat, 17 Feb 2018 03:13:05 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H3D5Ue016467; Sat, 17 Feb 2018 03:13:05 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802170313.w1H3D5Ue016467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 17 Feb 2018 03:13:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329425 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329425 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 03:13:06 -0000 Author: kevans Date: Sat Feb 17 03:13:05 2018 New Revision: 329425 URL: https://svnweb.freebsd.org/changeset/base/329425 Log: stand/lua: Enable menu autoboot; it seems to work Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Sat Feb 17 03:12:35 2018 (r329424) +++ head/stand/lua/menu.lua Sat Feb 17 03:13:05 2018 (r329425) @@ -264,7 +264,7 @@ function menu.run(m) screen.defcursor(); local alias_table = drawer.drawscreen(m); --- menu.autoboot(); + menu.autoboot(); cont = true; while cont do From owner-svn-src-head@freebsd.org Sat Feb 17 04: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 C0912F0BDD8; Sat, 17 Feb 2018 04:22:36 +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 6D357850E8; Sat, 17 Feb 2018 04:22:36 +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 6826E17B97; Sat, 17 Feb 2018 04:22:36 +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 w1H4Ma3B053067; Sat, 17 Feb 2018 04:22:36 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H4MaR8053066; Sat, 17 Feb 2018 04:22:36 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802170422.w1H4MaR8053066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 17 Feb 2018 04:22:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329428 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329428 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 04:22:36 -0000 Author: kevans Date: Sat Feb 17 04:22:36 2018 New Revision: 329428 URL: https://svnweb.freebsd.org/changeset/base/329428 Log: stand/lua: Correct some trivial errors in config An empty module_path to start with isn't ideal, but if all modules are contained within a kernel directory (which is what we just tested) then it isn't strictly an error. Don't assume that module_path has a value already. When we fail to load the kernel, printing the result (which is guaranteed to be nil) is not intended; print the name of the kernel. Modified: head/stand/lua/config.lua Modified: head/stand/lua/config.lua ============================================================================== --- head/stand/lua/config.lua Sat Feb 17 04:07:16 2018 (r329427) +++ head/stand/lua/config.lua Sat Feb 17 04:22:36 2018 (r329428) @@ -297,7 +297,10 @@ function config.loadkernel() -- succeeded add path to module_path if res ~= nil then - loader.setenv("module_path", v..";"..module_path); + if module_path == nil then + loader.setenv("module_path", v..";".. + module_path); + end return true; end end @@ -308,7 +311,7 @@ function config.loadkernel() if res ~= nil then return true; else - print("Failed to load kernel '"..res.."'"); + print("Failed to load kernel '"..kernel.."'"); return false; end end From owner-svn-src-head@freebsd.org Sat Feb 17 03:39: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 017E2F09E6D; Sat, 17 Feb 2018 03:39:56 +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 A770383226; Sat, 17 Feb 2018 03:39:55 +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 A265F17278; Sat, 17 Feb 2018 03:39:55 +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 w1H3dtEV026345; Sat, 17 Feb 2018 03:39:55 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H3dtBF026344; Sat, 17 Feb 2018 03:39:55 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802170339.w1H3dtBF026344@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 17 Feb 2018 03:39:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329426 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329426 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 03:39:56 -0000 Author: kevans Date: Sat Feb 17 03:39:55 2018 New Revision: 329426 URL: https://svnweb.freebsd.org/changeset/base/329426 Log: stand/lua: Correct interpretation of autoboot_delay autoboot_delay=NO is documented to wait for input and *not* autoboot, which is the exact opposite of the current behavior. Additionally, autoboot_delay=-1 is documented to disallow the user from interrupting the boot (i.e. autoboot immediately), which was not previously honored. This also fixes the case insensitive comparison to be truly case insensitive. This is kind of nit-picky, but the previous version would only accept "no" and "NO". Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Sat Feb 17 03:13:05 2018 (r329425) +++ head/stand/lua/menu.lua Sat Feb 17 03:39:55 2018 (r329426) @@ -353,7 +353,9 @@ function menu.autoboot() menu.already_autoboot = true; local ab = loader.getenv("autoboot_delay"); - if ab == "NO" or ab == "no" then + if (ab ~= nil) and (ab:lower() == "no") then + return; + elseif (tonumber(ab) == -1) then core.boot(); end ab = tonumber(ab) or 10; From owner-svn-src-head@freebsd.org Sat Feb 17 04:33: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 B3F41F0C908; Sat, 17 Feb 2018 04:33:37 +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 6504485819; Sat, 17 Feb 2018 04:33:37 +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 5FE2A17D43; Sat, 17 Feb 2018 04:33:37 +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 w1H4XbVI058256; Sat, 17 Feb 2018 04:33:37 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H4Xb0K058255; Sat, 17 Feb 2018 04:33:37 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802170433.w1H4Xb0K058255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 17 Feb 2018 04:33:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329429 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329429 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 04:33:37 -0000 Author: kevans Date: Sat Feb 17 04:33:37 2018 New Revision: 329429 URL: https://svnweb.freebsd.org/changeset/base/329429 Log: stand/lua: Add debug method to dump modules Modified: head/stand/lua/config.lua Modified: head/stand/lua/config.lua ============================================================================== --- head/stand/lua/config.lua Sat Feb 17 04:22:36 2018 (r329428) +++ head/stand/lua/config.lua Sat Feb 17 04:33:37 2018 (r329429) @@ -37,6 +37,14 @@ function config.setKey(k, n, v) modules[k][n] = v; end +function config.dumpModules() + print("== Dumping modules") + for k, v in pairs(modules) do + print(k, v.load); + end + print("== Dump ended") +end + local pattern_table = { [1] = { str = "^%s*(#.*)", From owner-svn-src-head@freebsd.org Sat Feb 17 04:43: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 1060BF0D26D; Sat, 17 Feb 2018 04:43: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 AF65585F5A; Sat, 17 Feb 2018 04:43:41 +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 8CBA917EEE; Sat, 17 Feb 2018 04:43: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 w1H4hfd5063117; Sat, 17 Feb 2018 04:43:41 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H4hfBI063116; Sat, 17 Feb 2018 04:43:41 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802170443.w1H4hfBI063116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 17 Feb 2018 04:43:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329430 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329430 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 04:43:42 -0000 Author: kevans Date: Sat Feb 17 04:43:41 2018 New Revision: 329430 URL: https://svnweb.freebsd.org/changeset/base/329430 Log: stand/lua: Address some nits 1.) Instead of string.function(s, ...), use s:function(...) 2.) Don't try to concatenate `res`, it was just tested to be nil 3.) Note that "Loading configuration" is configured modules, and be a little more precise in mentioning what failed ("loading of one or more modules") Modified: head/stand/lua/config.lua Modified: head/stand/lua/config.lua ============================================================================== --- head/stand/lua/config.lua Sat Feb 17 04:33:37 2018 (r329429) +++ head/stand/lua/config.lua Sat Feb 17 04:43:41 2018 (r329430) @@ -38,11 +38,11 @@ function config.setKey(k, n, v) end function config.dumpModules() - print("== Dumping modules") + print("== Dumping modules"); for k, v in pairs(modules) do print(k, v.load); end - print("== Dump ended") + print("== Dump ended"); end local pattern_table = { @@ -57,7 +57,7 @@ local pattern_table = { if modules[k] == nil then modules[k] = {}; end - modules[k].load = string.upper(v); + modules[k].load = v:upper(); end }, -- module_name="value" @@ -133,9 +133,9 @@ local pattern_table = { function config.isValidComment(c) if c ~= nil then - local s = string.match(c, "^%s*#.*"); + local s = c:match("^%s*#.*"); if s == nil then - s = string.match(c, "^%s*$"); + s = c:match("^%s*$"); end if s == nil then return false; @@ -221,13 +221,13 @@ function config.parse(name, silent) local n = 1; local status = true; - for line in string.gmatch(text, "([^\n]+)") do + for line in text:gmatch("([^\n]+)") do - if string.match(line, "^%s*$") == nil then + if line:match("^%s*$") == nil then local found = false; for i, val in ipairs(pattern_table) do - local k, v, c = string.match(line, val.str); + local k, v, c = line:match(val.str); if k ~= nil then found = true; @@ -287,7 +287,7 @@ function config.loadkernel() if res ~= nil then return true; else - print("Failed to load kernel '"..res.."'"); + print("No kernel set, failed to load from module_path"); return false; end else @@ -338,7 +338,7 @@ function config.load(file) local f = loader.getenv("loader_conf_files"); if f ~= nil then - for name in string.gmatch(f, "([%w%p]+)%s*") do + for name in f:gmatch("([%w%p]+)%s*") do if not config.parse(name) then -- print("Failed to parse configuration: '"..name.."'"); end @@ -348,9 +348,9 @@ function config.load(file) print("Loading kernel..."); config.loadkernel(); - print("Loading configurations..."); + print("Loading configured modules..."); if not config.loadmod(modules) then - print("Could not load configurations!"); + print("Could not load one or more modules!"); end end From owner-svn-src-head@freebsd.org Sat Feb 17 04:46: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 D5225F0D55D; Sat, 17 Feb 2018 04:46:06 +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 87D42861CB; Sat, 17 Feb 2018 04:46:06 +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 813BF17EF3; Sat, 17 Feb 2018 04:46:06 +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 w1H4k6pl063270; Sat, 17 Feb 2018 04:46:06 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H4k6e4063269; Sat, 17 Feb 2018 04:46:06 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802170446.w1H4k6e4063269@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 17 Feb 2018 04:46:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329431 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329431 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 04:46:07 -0000 Author: kevans Date: Sat Feb 17 04:46:06 2018 New Revision: 329431 URL: https://svnweb.freebsd.org/changeset/base/329431 Log: stand/lua: Correct test sense, this should have been 'not nil' Modified: head/stand/lua/config.lua Modified: head/stand/lua/config.lua ============================================================================== --- head/stand/lua/config.lua Sat Feb 17 04:43:41 2018 (r329430) +++ head/stand/lua/config.lua Sat Feb 17 04:46:06 2018 (r329431) @@ -305,7 +305,7 @@ function config.loadkernel() -- succeeded add path to module_path if res ~= nil then - if module_path == nil then + if module_path ~= nil then loader.setenv("module_path", v..";".. module_path); end From owner-svn-src-head@freebsd.org Sat Feb 17 05:02: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 18ED3F0EB43; Sat, 17 Feb 2018 05:02: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 E1E1F86C92; Sat, 17 Feb 2018 05:02: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 C337118243; Sat, 17 Feb 2018 05:02: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 w1H52c7c072897; Sat, 17 Feb 2018 05:02:38 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H52cQf072896; Sat, 17 Feb 2018 05:02:38 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802170502.w1H52cQf072896@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 17 Feb 2018 05:02:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329432 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329432 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 05:02:39 -0000 Author: kevans Date: Sat Feb 17 05:02:38 2018 New Revision: 329432 URL: https://svnweb.freebsd.org/changeset/base/329432 Log: stand/lua: Try to load alternate kernels as directories first This is the procedure that config.loadkernel tries to go through, but reloading kernel config didn't use this function. Amend config.loadkernel to take an optional other_kernel. While here, be a little more verbose ("Trying to load kernel") so that it's easy to follow where we've gone wrong. Modified: head/stand/lua/config.lua Modified: head/stand/lua/config.lua ============================================================================== --- head/stand/lua/config.lua Sat Feb 17 04:46:06 2018 (r329431) +++ head/stand/lua/config.lua Sat Feb 17 05:02:38 2018 (r329432) @@ -253,9 +253,11 @@ function config.parse(name, silent) return status; end -function config.loadkernel() +-- other_kernel is optionally the name of a kernel to load, if not the default +-- or autoloaded default from the module_path +function config.loadkernel(other_kernel) local flags = loader.getenv("kernel_options") or ""; - local kernel = loader.getenv("kernel"); + local kernel = other_kernel or loader.getenv("kernel"); local try_load = function (names) for name in names:gmatch("([^;]+)%s*;?") do @@ -265,7 +267,7 @@ function config.loadkernel() end end return nil; - end; + end local load_bootfile = function() local bootfile = loader.getenv("bootfile"); @@ -294,6 +296,9 @@ function config.loadkernel() local module_path = loader.getenv("module_path"); local res = nil; + if other_kern ~= nil then + kernel = other_kern; + end -- first try load kernel with module_path = /boot/${kernel} -- then try load with module_path=${kernel} local paths = {"/boot/"..kernel, kernel}; @@ -355,22 +360,23 @@ function config.load(file) end function config.reload(kernel) - local res = 1; + local kernel_loaded = false; -- unload all modules print("Unloading modules..."); loader.perform("unload"); - if kernel ~= nil then - res = loader.perform("load "..kernel); - if res == 0 then + if (kernel ~= nil) then + print("Trying to load '" .. kernel .. "'") + kernel_loaded = config.loadkernel(kernel); + if (kernel_loaded) then print("Kernel '"..kernel.."' loaded!"); end end -- failed to load kernel or it is nil -- then load default - if res == 1 then + if (not kernel_loaded) then print("Loading default kernel..."); config.loadkernel(); end From owner-svn-src-head@freebsd.org Sat Feb 17 05:26: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 B8B9DF10123; Sat, 17 Feb 2018 05:26:28 +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 68B69878F8; Sat, 17 Feb 2018 05:26:28 +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 631541859C; Sat, 17 Feb 2018 05:26:28 +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 w1H5QSnn082886; Sat, 17 Feb 2018 05:26:28 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H5QSit082885; Sat, 17 Feb 2018 05:26:28 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802170526.w1H5QSit082885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 17 Feb 2018 05:26:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329433 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329433 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 05:26:29 -0000 Author: kevans Date: Sat Feb 17 05:26:28 2018 New Revision: 329433 URL: https://svnweb.freebsd.org/changeset/base/329433 Log: stand/lua: Add optional GELI passphrase prompt Prompt for GELI passphrase when geom_eli_passphrase_prompt has been set to "YES" in loader.conf(5). This entailed breaking out the password prompt into its own function that can be reused between the password compare bits and this prompt that simply takes the entered password and passes it along in the environment as kern.geom.eli.passphrase. I've also added a TODO to re-evaluate later if we want the "password masking" -- it is currently not functional, so one still can't observe the length of the password typed at the prompt. Modified: head/stand/lua/password.lua Modified: head/stand/lua/password.lua ============================================================================== --- head/stand/lua/password.lua Sat Feb 17 05:02:38 2018 (r329432) +++ head/stand/lua/password.lua Sat Feb 17 05:26:28 2018 (r329433) @@ -40,7 +40,8 @@ function password.read() if ch == core.KEY_ENTER then break; end - + -- XXX TODO: Evaluate if we really want this or not, as a + -- security consideration of sorts if (ch == core.KEY_BACKSPACE) or (ch == core.KEY_DELETE) then if n > 0 then n = n - 1; @@ -58,22 +59,35 @@ end function password.check() screen.defcursor(); - local function compare(prompt, pwd) - if (pwd == nil) then - return; - end + -- pwd is optionally supplied if we want to check it + local function do_prompt(prompt, pwd) while true do loader.printc(prompt); - if (pwd == password.read()) then - break; + local read_pwd = password.read(); + if (not pwd) or (pwd == read_pwd) then + return read_pwd; end print("\n\nloader: incorrect password!\n"); loader.delay(3*1000*1000); end + -- Throw an extra newline out after the password prompt + print("") end + local function compare(prompt, pwd) + if (pwd == nil) then + return; + end + do_prompt(prompt, pwd); + end local boot_pwd = loader.getenv("bootlock_password"); compare("Boot password: ", boot_pwd); + + local geli_pass_prompt = loader.getenv("geom_eli_passphrase_prompt"); + if (geli_pass_prompt:lower() == "yes") then + local passphrase = do_prompt("GELI Passphrase: "); + loader.setenv("kern.geom.eli.passphrase", passphrase) + end local pwd = loader.getenv("password"); if (pwd ~=nil) then From owner-svn-src-head@freebsd.org Sat Feb 17 05: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 5D9DEF10350; Sat, 17 Feb 2018 05:28:07 +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 1201B87ABB; Sat, 17 Feb 2018 05:28:07 +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 0D0D2185A0; Sat, 17 Feb 2018 05:28:07 +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 w1H5S6J4082984; Sat, 17 Feb 2018 05:28:06 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H5S6it082983; Sat, 17 Feb 2018 05:28:06 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802170528.w1H5S6it082983@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 17 Feb 2018 05:28:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329434 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329434 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 05:28:07 -0000 Author: kevans Date: Sat Feb 17 05:28:06 2018 New Revision: 329434 URL: https://svnweb.freebsd.org/changeset/base/329434 Log: stand/lua: Check for nil (GELI prompt) Modified: head/stand/lua/password.lua Modified: head/stand/lua/password.lua ============================================================================== --- head/stand/lua/password.lua Sat Feb 17 05:26:28 2018 (r329433) +++ head/stand/lua/password.lua Sat Feb 17 05:28:06 2018 (r329434) @@ -83,8 +83,8 @@ function password.check() local boot_pwd = loader.getenv("bootlock_password"); compare("Boot password: ", boot_pwd); - local geli_pass_prompt = loader.getenv("geom_eli_passphrase_prompt"); - if (geli_pass_prompt:lower() == "yes") then + local geli_prompt = loader.getenv("geom_eli_passphrase_prompt"); + if (geli_prompt ~= nil) and (geli_prompt:lower() == "yes") then local passphrase = do_prompt("GELI Passphrase: "); loader.setenv("kern.geom.eli.passphrase", passphrase) end From owner-svn-src-head@freebsd.org Sat Feb 17 05:52: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 90E63F11884; Sat, 17 Feb 2018 05:52: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 33A6468840; Sat, 17 Feb 2018 05:52: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 2E7D518A67; Sat, 17 Feb 2018 05:52: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 w1H5qQM1097614; Sat, 17 Feb 2018 05:52:26 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H5qPX4097607; Sat, 17 Feb 2018 05:52:25 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802170552.w1H5qPX4097607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 17 Feb 2018 05:52:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329435 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329435 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 05:52:26 -0000 Author: kevans Date: Sat Feb 17 05:52:25 2018 New Revision: 329435 URL: https://svnweb.freebsd.org/changeset/base/329435 Log: stand/lua: Style pass These are the style points that I'd like to try and maintain in our lua scripts: - Parentheses around conditionals - Trailing semicolons, except on block terminators - s:method(...) instead of string.method(s, ...) where applicable There's likely more, but that'll get hammered out as we continue. Modified: head/stand/lua/color.lua head/stand/lua/config.lua head/stand/lua/core.lua head/stand/lua/drawer.lua head/stand/lua/menu.lua head/stand/lua/password.lua head/stand/lua/screen.lua Modified: head/stand/lua/color.lua ============================================================================== --- head/stand/lua/color.lua Sat Feb 17 05:28:06 2018 (r329434) +++ head/stand/lua/color.lua Sat Feb 17 05:52:25 2018 (r329435) @@ -45,36 +45,35 @@ color.DIM = 2; function color.isEnabled() local c = loader.getenv("loader_color"); - if c ~= nil then - if c:lower() == "no" or c == "0" then + if (c ~= nil) then + if (c:lower() == "no") or (c == "0") then return false; end end - return not core.bootserial(); + return (not core.bootserial()); end -color.disabled = not color.isEnabled(); +color.disabled = (not color.isEnabled()); - function color.escapef(c) - if color.disabled then + if (color.disabled) then return c; end return "\027[3"..c.."m"; end function color.escapeb(c) - if color.disabled then + if (color.disabled) then return c; end return "\027[4"..c.."m"; end function color.escape(fg, bg, att) - if color.disabled then + if (color.disabled) then return ""; end - if not att then + if (not att) then att = "" else att = att..";"; @@ -83,17 +82,17 @@ function color.escape(fg, bg, att) end function color.default() - if color.disabled then + if (color.disabled) then return ""; end return "\027[0;37;40m"; end function color.highlight(str) - if color.disabled then + if (color.disabled) then return str; end return "\027[1m"..str.."\027[0m"; end -return color +return color; Modified: head/stand/lua/config.lua ============================================================================== --- head/stand/lua/config.lua Sat Feb 17 05:28:06 2018 (r329434) +++ head/stand/lua/config.lua Sat Feb 17 05:52:25 2018 (r329435) @@ -280,7 +280,7 @@ function config.loadkernel(other_kernel) end return try_load(bootfile); - end; + end -- kernel not set, try load from default module_path if kernel == nil then Modified: head/stand/lua/core.lua ============================================================================== --- head/stand/lua/core.lua Sat Feb 17 05:28:06 2018 (r329434) +++ head/stand/lua/core.lua Sat Feb 17 05:52:25 2018 (r329435) @@ -128,13 +128,13 @@ function core.kernelList() local kernels = {}; local i = 0; - if k ~= nil then + if (k ~= nil) then i = i + 1; kernels[i] = k; end for n in v:gmatch("([^; ]+)[; ]?") do - if n ~= k then + if (n ~= k) then i = i + 1; kernels[i] = n; end @@ -160,23 +160,23 @@ end function core.bootserial() local c = loader.getenv("console"); - if c ~= nil then - if c:find("comconsole") ~= nil then + if (c ~= nil) then + if (c:find("comconsole") ~= nil) then return true; end end local s = loader.getenv("boot_serial"); - if s ~= nil then + if (s ~= nil) then return true; end local m = loader.getenv("boot_multicons"); - if m ~= nil then + if (m ~= nil) then return true; end return false; end -core.setACPI(core.getACPIPresent(false)) -return core +core.setACPI(core.getACPIPresent(false)); +return core; Modified: head/stand/lua/drawer.lua ============================================================================== --- head/stand/lua/drawer.lua Sat Feb 17 05:28:06 2018 (r329434) +++ head/stand/lua/drawer.lua Sat Feb 17 05:52:25 2018 (r329435) @@ -179,7 +179,7 @@ function drawer.drawmenu(m) if (#choices < caridx) then caridx = 1; - end; + end name = e.name(caridx, choices[caridx], choices); else name = e.name(); @@ -247,60 +247,48 @@ function drawer.draw(x, y, logo) end function drawer.drawbrand() - local x = tonumber(loader.getenv("loader_brand_x")); - local y = tonumber(loader.getenv("loader_brand_y")); + local x = tonumber(loader.getenv("loader_brand_x")) or + drawer.brand_position.x; + local y = tonumber(loader.getenv("loader_brand_y")) or + drawer.brand_position.y; - if not x then - x = drawer.brand_position.x; - end - if not y then - y = drawer.brand_position.y; - end - - local logo = load("return " .. tostring(loader.getenv("loader_brand")))(); - if not logo then - logo = drawer.fbsd_logo; - end + local logo = load("return " .. tostring(loader.getenv("loader_brand")))() or + drawer.fbsd_logo; drawer.draw(x, y, logo); end function drawer.drawlogo() - local x = tonumber(loader.getenv("loader_logo_x")); - local y = tonumber(loader.getenv("loader_logo_y")); + local x = tonumber(loader.getenv("loader_logo_x")) or + drawer.logo_position.x; + local y = tonumber(loader.getenv("loader_logo_y")) or + drawer.logo_position.y; - if not x then - x = drawer.logo_position.x; - end - if not y then - y = drawer.logo_position.y; - end - local logo = loader.getenv("loader_logo"); local s = {x = 0, y = 0}; local colored = color.isEnabled(); - if logo == "beastie" then - if colored then + if (logo == "beastie") then + if (colored) then logo = drawer.beastie_color; end - elseif logo == "beastiebw" then + elseif (logo == "beastiebw") then logo = drawer.beastie; - elseif logo == "fbsdbw" then + elseif (logo == "fbsdbw") then logo = drawer.fbsd_logo_v; s = drawer.fbsd_logo_shift; - elseif logo == "orb" then - if colored then + elseif (logo == "orb") then + if (colored) then logo = drawer.orb_color; end s = drawer.orb_shift; - elseif logo == "orbbw" then + elseif (logo == "orbbw") then logo = drawer.orb; s = drawer.orb_shift; - elseif logo == "tribute" then + elseif (logo == "tribute") then logo = drawer.fbsd_logo; - elseif logo == "tributebw" then + elseif (logo == "tributebw") then logo = drawer.fbsd_logo; - elseif logo == "none" then + elseif (logo == "none") then --centre brand and text if no logo drawer.brand_position.x = drawer.brand_position.x + drawer.none_shift.x; drawer.brand_position.y = drawer.brand_position.y + drawer.none_shift.y; @@ -313,8 +301,8 @@ function drawer.drawlogo() drawer.none_shift.y = 0; logo = drawer.none; end - if not logo then - if colored then + if (not logo) then + if (colored) then logo = drawer.orb_color; else logo = drawer.orb; @@ -323,4 +311,4 @@ function drawer.drawlogo() drawer.draw(x + s.x, y + s.y, logo); end -return drawer +return drawer; Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Sat Feb 17 05:28:06 2018 (r329434) +++ head/stand/lua/menu.lua Sat Feb 17 05:52:25 2018 (r329435) @@ -63,7 +63,7 @@ menu.boot_options = { return "Load System "..color.highlight("D").."efaults"; end, func = function() - core.setDefaults() + core.setDefaults(); end, alias = {"d", "D"} }, @@ -162,7 +162,7 @@ menu.welcome = { return color.highlight("Esc").."ape to loader prompt"; end, func = function() - loader.setenv("autoboot_delay", "NO") + loader.setenv("autoboot_delay", "NO"); end, alias = {core.KEYSTR_ESCAPE} }, @@ -200,14 +200,14 @@ menu.welcome = { carousel_id = "kernel", items = core.kernelList, name = function(idx, choice, all_choices) - if #all_choices == 0 then + if (#all_choices == 0) then return "Kernel: "; end local is_default = (idx == 1); local kernel_name = ""; local name_color; - if is_default then + if (is_default) then name_color = color.escapef(color.GREEN); kernel_name = "default/"; else @@ -273,7 +273,7 @@ function menu.run(m) menu.autoboot(); cont = true; - while cont do + while (cont) do local key = io.getchar(); -- Special key behaviors @@ -295,7 +295,7 @@ function menu.run(m) end -- if we have an alias do the assigned action: - if(sel_entry ~= nil) then + if (sel_entry ~= nil) then if (sel_entry.entry_type == core.MENU_ENTRY) then -- run function sel_entry.func(); @@ -339,11 +339,11 @@ function menu.run(m) end function menu.skip() - if core.bootserial() then + if (core.bootserial() )then return true; end local c = string.lower(loader.getenv("console") or ""); - if (c:match("^efi[ ;]") or c:match("[ ;]efi[ ;]")) ~= nil then + if ((c:match("^efi[ ;]") or c:match("[ ;]efi[ ;]")) ~= nil) then return true; end @@ -353,7 +353,7 @@ function menu.skip() end function menu.autoboot() - if menu.already_autoboot == true then + if (menu.already_autoboot == true) then return; end menu.already_autoboot = true; @@ -378,9 +378,9 @@ function menu.autoboot() print("Autoboot in "..time.." seconds, hit [Enter] to boot" .." or any other key to stop "); screen.defcursor(); - if io.ischar() then + if (io.ischar()) then local ch = io.getchar(); - if ch == core.KEY_ENTER then + if (ch == core.KEY_ENTER) then break; else -- erase autoboot msg @@ -406,4 +406,4 @@ function OnOff(str, b) end end -return menu +return menu; Modified: head/stand/lua/password.lua ============================================================================== --- head/stand/lua/password.lua Sat Feb 17 05:28:06 2018 (r329434) +++ head/stand/lua/password.lua Sat Feb 17 05:52:25 2018 (r329435) @@ -37,23 +37,23 @@ function password.read() repeat ch = io.getchar(); - if ch == core.KEY_ENTER then + if (ch == core.KEY_ENTER) then break; end -- XXX TODO: Evaluate if we really want this or not, as a -- security consideration of sorts if (ch == core.KEY_BACKSPACE) or (ch == core.KEY_DELETE) then - if n > 0 then + if (n > 0) then n = n - 1; -- loader.printc("\008 \008"); - str = string.sub(str, 1, n); + str = str:sub(1, n); end else -- loader.printc("*"); str = str .. string.char(ch); n = n + 1; end - until n == 16 + until (n == 16); return str; end @@ -61,17 +61,17 @@ function password.check() screen.defcursor(); -- pwd is optionally supplied if we want to check it local function do_prompt(prompt, pwd) - while true do + while (true) do loader.printc(prompt); local read_pwd = password.read(); if (not pwd) or (pwd == read_pwd) then + -- Throw an extra newline after password prompt + print(""); return read_pwd; end print("\n\nloader: incorrect password!\n"); loader.delay(3*1000*1000); end - -- Throw an extra newline out after the password prompt - print("") end local function compare(prompt, pwd) if (pwd == nil) then @@ -80,20 +80,20 @@ function password.check() do_prompt(prompt, pwd); end - local boot_pwd = loader.getenv("bootlock_password"); + local boot_pwd = "boot" --loader.getenv("bootlock_password"); compare("Boot password: ", boot_pwd); local geli_prompt = loader.getenv("geom_eli_passphrase_prompt"); if (geli_prompt ~= nil) and (geli_prompt:lower() == "yes") then local passphrase = do_prompt("GELI Passphrase: "); - loader.setenv("kern.geom.eli.passphrase", passphrase) + loader.setenv("kern.geom.eli.passphrase", passphrase); end local pwd = loader.getenv("password"); - if (pwd ~=nil) then + if (pwd ~= nil) then core.autoboot(); end compare("Password: ", pwd); end -return password +return password; Modified: head/stand/lua/screen.lua ============================================================================== --- head/stand/lua/screen.lua Sat Feb 17 05:28:06 2018 (r329434) +++ head/stand/lua/screen.lua Sat Feb 17 05:52:25 2018 (r329435) @@ -33,24 +33,24 @@ local core = require("core"); -- XXX TODO: This should be fixed in the interpreter to not print decimals function intstring(num) - local str = tostring(num) - local decimal = string.find(str, "%.") + local str = tostring(num); + local decimal = str:find("%."); - if decimal then - return string.sub(str, 1, decimal - 1) + if (decimal) then + return str:sub(1, decimal - 1); end - return str + return str; end function screen.clear() - if core.bootserial() then + if (core.bootserial()) then return; end loader.printc("\027[H\027[J"); end function screen.setcursor(x, y) - if core.bootserial() then + if (core.bootserial()) then return; end @@ -58,14 +58,14 @@ function screen.setcursor(x, y) end function screen.setforeground(c) - if color.disabled then + if (color.disabled) then return c; end loader.printc("\027[3"..c.."m"); end function screen.setbackground(c) - if color.disabled then + if (color.disabled) then return c; end loader.printc("\027[4"..c.."m"); @@ -76,10 +76,10 @@ function screen.defcolor() end function screen.defcursor() - if core.bootserial() then + if (core.bootserial()) then return; end loader.printc("\027[25;0H"); end -return screen +return screen; From owner-svn-src-head@freebsd.org Sat Feb 17 05:53: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 09218F119A2; Sat, 17 Feb 2018 05:53:41 +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 9D29668A0D; Sat, 17 Feb 2018 05:53:41 +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 9830D18A76; Sat, 17 Feb 2018 05:53: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 w1H5rfSw097695; Sat, 17 Feb 2018 05:53:41 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H5rfdW097694; Sat, 17 Feb 2018 05:53:41 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802170553.w1H5rfdW097694@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 17 Feb 2018 05:53:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329436 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329436 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 05:53:42 -0000 Author: kevans Date: Sat Feb 17 05:53:41 2018 New Revision: 329436 URL: https://svnweb.freebsd.org/changeset/base/329436 Log: stand/lua: Debugging string snuck in... Modified: head/stand/lua/password.lua Modified: head/stand/lua/password.lua ============================================================================== --- head/stand/lua/password.lua Sat Feb 17 05:52:25 2018 (r329435) +++ head/stand/lua/password.lua Sat Feb 17 05:53:41 2018 (r329436) @@ -80,7 +80,7 @@ function password.check() do_prompt(prompt, pwd); end - local boot_pwd = "boot" --loader.getenv("bootlock_password"); + local boot_pwd = loader.getenv("bootlock_password"); compare("Boot password: ", boot_pwd); local geli_prompt = loader.getenv("geom_eli_passphrase_prompt"); From owner-svn-src-head@freebsd.org Sat Feb 17 05:56: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 DCB16F11B9D for ; Sat, 17 Feb 2018 05:56:03 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-lf0-f44.google.com (mail-lf0-f44.google.com [209.85.215.44]) (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 0E1AB68C35 for ; Sat, 17 Feb 2018 05:56:02 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-lf0-f44.google.com with SMTP id f137so6726868lfe.4 for ; Fri, 16 Feb 2018 21:56:02 -0800 (PST) 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:cc; bh=owguC/Dhmrnpey46JdAXVaW+rvnGpWPHIeKS/h1Kjq8=; b=P+BDvWyVzN59mvretmDP7g3JLPXKvyz+wqq/C+Vbl9sLBG8w18s3WFalolXDPc7ijf 50Hp+1/6eg1QyeDAPLQydBRwRYnOAliT1A88LUYpzphI2Bo8OgJX0CqGimNl340aZZIz IeiN4EuCf4lK4wdquloUhKFVaILhwmlmClXZip8wlMMrjTCaoVr9rx2jTgbLK1wFv6Aj 4evYF0X2+1t2s/JF2r0YLzy4BUK0yHLdv65dS2vP9fbzusDlYw6mof8wOwem5bK8gFgq SXfzkBkuleoHje6lRhLwPMvqfRohYkM/rrt7hGnLSZkNedLq2U4Qdk0gbGBNxW53hV5h au7A== X-Gm-Message-State: APf1xPCucbLwIedgC5FccTM8os29qvEQlQ5wcmc0azn4mjKxQpsEmKP8 7m68yiSK8r6S/KycU7No3TGGhPON X-Google-Smtp-Source: AH8x225hsRUVU0yykm/d139Fgvy+xMqs76m7xT9DB7+Pw+OT00P3VMDMyv3Qb6sBQT+O7ZtYkAbMQg== X-Received: by 10.25.229.129 with SMTP id i1mr869889lfk.66.1518846961039; Fri, 16 Feb 2018 21:56:01 -0800 (PST) Received: from mail-lf0-f49.google.com (mail-lf0-f49.google.com. [209.85.215.49]) by smtp.gmail.com with ESMTPSA id t24sm792644lfi.68.2018.02.16.21.56.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Feb 2018 21:56:00 -0800 (PST) Received: by mail-lf0-f49.google.com with SMTP id j193so6756344lfe.0 for ; Fri, 16 Feb 2018 21:56:00 -0800 (PST) X-Received: by 10.25.77.212 with SMTP id a203mt6109770lfb.14.1518846960067; Fri, 16 Feb 2018 21:56:00 -0800 (PST) MIME-Version: 1.0 Received: by 10.46.106.8 with HTTP; Fri, 16 Feb 2018 21:55:39 -0800 (PST) In-Reply-To: <201802170553.w1H5rfdW097694@repo.freebsd.org> References: <201802170553.w1H5rfdW097694@repo.freebsd.org> From: Kyle Evans Date: Fri, 16 Feb 2018 23:55:39 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r329436 - head/stand/lua 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.25 Precedence: list List-Id: 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, 17 Feb 2018 05:56:04 -0000 On Fri, Feb 16, 2018 at 11:53 PM, Kyle Evans wrote: > Author: kevans > Date: Sat Feb 17 05:53:41 2018 > New Revision: 329436 > URL: https://svnweb.freebsd.org/changeset/base/329436 > > Log: > stand/lua: Debugging string snuck in... > > Modified: > head/stand/lua/password.lua > With this, I think our lualoader menu is fairly stable as-is. Things should calm down while we sketch out the details of boot environment bits. From owner-svn-src-head@freebsd.org Sat Feb 17 06: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 C3AB3F142BB; Sat, 17 Feb 2018 06:57: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 7242E6A6C3; Sat, 17 Feb 2018 06:57: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 53F0C1943A; Sat, 17 Feb 2018 06:57: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 w1H6v45v027387; Sat, 17 Feb 2018 06:57:04 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H6v4x8027385; Sat, 17 Feb 2018 06:57:04 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802170657.w1H6v4x8027385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 17 Feb 2018 06:57:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329437 - in head: sys/sys usr.sbin/kldxref X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: sys/sys usr.sbin/kldxref X-SVN-Commit-Revision: 329437 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 06:57:04 -0000 Author: imp Date: Sat Feb 17 06:57:03 2018 New Revision: 329437 URL: https://svnweb.freebsd.org/changeset/base/329437 Log: Fixup minor nits in the PNP_INFO protocol. Sponsored by: Netflix Modified: head/sys/sys/module.h head/usr.sbin/kldxref/kldxref.c Modified: head/sys/sys/module.h ============================================================================== --- head/sys/sys/module.h Sat Feb 17 05:53:41 2018 (r329436) +++ head/sys/sys/module.h Sat Feb 17 06:57:03 2018 (r329437) @@ -201,7 +201,7 @@ struct mod_pnp_match_info * D pointer to a string to human readable description for device * P A pointer that should be ignored * E EISA PNP Identifier (in binary, but bus publishes string) - * K Key for whole table. pnp_name=value. must be last, if present. + * T Key for whole table. pnp_name=value. must be last, if present. * * The pnp_name "#" is reserved for other fields that should be ignored. * Otherwise pnp_name must match the name from the parent device's pnpinfo Modified: head/usr.sbin/kldxref/kldxref.c ============================================================================== --- head/usr.sbin/kldxref/kldxref.c Sat Feb 17 05:53:41 2018 (r329436) +++ head/usr.sbin/kldxref/kldxref.c Sat Feb 17 06:57:03 2018 (r329437) @@ -213,12 +213,12 @@ typedef TAILQ_HEAD(pnp_head, pnp_elt) pnp_list; * type Output Meaning * I uint32_t Integer equality comparison * J uint32_t Pair of uint16_t fields converted to native - byte order. The two fields both must match. + * byte order. The two fields both must match. * G uint32_t Greater than or equal to * L uint32_t Less than or equal to * M uint32_t Mask of which fields to test. Fields that - take up space increment the count. This - field must be first, and resets the count. + * take up space increment the count. This + * field must be first, and resets the count. * D string Description of the device this pnp info is for * Z string pnp string must match this * T nothing T fields set pnp values that must be true for From owner-svn-src-head@freebsd.org Sat Feb 17 06:57: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 E1D6AF142E1; Sat, 17 Feb 2018 06:57: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 74F796A720; Sat, 17 Feb 2018 06:57: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 9E8DF1943B; Sat, 17 Feb 2018 06:57:08 +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 w1H6v8RF027440; Sat, 17 Feb 2018 06:57:08 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H6v8NL027439; Sat, 17 Feb 2018 06:57:08 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802170657.w1H6v8NL027439@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 17 Feb 2018 06:57:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329438 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 329438 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 06:57:10 -0000 Author: imp Date: Sat Feb 17 06:57:08 2018 New Revision: 329438 URL: https://svnweb.freebsd.org/changeset/base/329438 Log: Add description for T specifier. It's for PNP keys that are checked programatically that must be true for a device to match, but aren't in the table as discrete fields. Sponsored by: Netflix Modified: head/share/man/man9/MODULE_PNP_INFO.9 Modified: head/share/man/man9/MODULE_PNP_INFO.9 ============================================================================== --- head/share/man/man9/MODULE_PNP_INFO.9 Sat Feb 17 06:57:03 2018 (r329437) +++ head/share/man/man9/MODULE_PNP_INFO.9 Sat Feb 17 06:57:08 2018 (r329438) @@ -109,6 +109,11 @@ A pointer to a human readable description for the devi A pointer that should be ignored. .It Dq Vt E EISA PNP Identifier. +.It Dq Vt T +PNP info that's true for the for the whole table. +The driver code checks for these condition pragmatically before using +this table to match devices. +This item must come last in the list. .El .Pp The pseudo-name From owner-svn-src-head@freebsd.org Sat Feb 17 06:57: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 7AFB5F1430E; Sat, 17 Feb 2018 06:57:13 +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 2D8D16A7C0; Sat, 17 Feb 2018 06:57:13 +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 1CB961943C; Sat, 17 Feb 2018 06:57:13 +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 w1H6vCTr027493; Sat, 17 Feb 2018 06:57:12 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H6vCVP027492; Sat, 17 Feb 2018 06:57:12 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802170657.w1H6vCVP027492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 17 Feb 2018 06:57:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329439 - head/sbin/devmatch X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/devmatch X-SVN-Commit-Revision: 329439 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 06:57:13 -0000 Author: imp Date: Sat Feb 17 06:57:12 2018 New Revision: 329439 URL: https://svnweb.freebsd.org/changeset/base/329439 Log: Warn when we encounter unknown PNP field specifiers. The 'T' field went unimplemented for months due to a lack of warning. Add a warnings to detect mistakes sooner. Sponsored by: Netflix Modified: head/sbin/devmatch/devmatch.c Modified: head/sbin/devmatch/devmatch.c ============================================================================== --- head/sbin/devmatch/devmatch.c Sat Feb 17 06:57:08 2018 (r329438) +++ head/sbin/devmatch/devmatch.c Sat Feb 17 06:57:12 2018 (r329439) @@ -314,6 +314,7 @@ search_hints(const char *bus, const char *dev, const c notme++; break; default: + fprintf(stderr, "Unknown field type %c\n:", *cp); break; } bit++; From owner-svn-src-head@freebsd.org Sat Feb 17 06:57: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 96313F1433A; Sat, 17 Feb 2018 06:57:18 +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 B85BA6A88C; Sat, 17 Feb 2018 06:57:17 +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 9ADCA1943D; Sat, 17 Feb 2018 06:57:17 +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 w1H6vHFB027546; Sat, 17 Feb 2018 06:57:17 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H6vHV3027544; Sat, 17 Feb 2018 06:57:17 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802170657.w1H6vHV3027544@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 17 Feb 2018 06:57:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329440 - head/sys/dev/usb X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/usb X-SVN-Commit-Revision: 329440 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 06:57:18 -0000 Author: imp Date: Sat Feb 17 06:57:17 2018 New Revision: 329440 URL: https://svnweb.freebsd.org/changeset/base/329440 Log: Correct the PNP information generated by the usb driver to match the artificial NOMATCH usb does in lieu of creating a device_t for devices with no drivers. Also, correct bus to be 'uhub' since where USB devices attach, even though 'usb' is more logical, we need the physical bus here. Submitted by: hps@ Modified: head/sys/dev/usb/usb_hub.c head/sys/dev/usb/usbdi.h Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Sat Feb 17 06:57:12 2018 (r329439) +++ head/sys/dev/usb/usb_hub.c Sat Feb 17 06:57:17 2018 (r329440) @@ -1733,7 +1733,12 @@ uhub_child_pnpinfo_string(device_t parent, device_t ch } iface = usbd_get_iface(res.udev, res.iface_index); if (iface && iface->idesc) { - snprintf(buf, buflen, "vendor=0x%04x product=0x%04x " + snprintf(buf, buflen, + "bus=usb " +#if USB_HAVE_UGEN + "device=%s " +#endif + "vendor=0x%04x product=0x%04x " "devclass=0x%02x devsubclass=0x%02x " "devproto=0x%02x " "sernum=\"%s\" " @@ -1741,6 +1746,9 @@ uhub_child_pnpinfo_string(device_t parent, device_t ch "mode=%s " "intclass=0x%02x intsubclass=0x%02x " "intprotocol=0x%02x" "%s%s", +#if USB_HAVE_UGEN + res.udev->ugen_name, +#endif UGETW(res.udev->ddesc.idVendor), UGETW(res.udev->ddesc.idProduct), res.udev->ddesc.bDeviceClass, Modified: head/sys/dev/usb/usbdi.h ============================================================================== --- head/sys/dev/usb/usbdi.h Sat Feb 17 06:57:12 2018 (r329439) +++ head/sys/dev/usb/usbdi.h Sat Feb 17 06:57:17 2018 (r329440) @@ -337,18 +337,18 @@ struct usb_device_id { } __aligned(32); #define USB_STD_PNP_INFO "M16:mask;U16:vendor;U16:product;L16:release;G16:release;" \ - "U8:devclass;U8:devsubclass;U8:devprotocol;" \ + "U8:devclass;U8:devsubclass;U8:devproto;" \ "U8:intclass;U8:intsubclass;U8:intprotocol;" #define USB_STD_PNP_HOST_INFO USB_STD_PNP_INFO "T:mode=host;" #define USB_STD_PNP_DEVICE_INFO USB_STD_PNP_INFO "T:mode=device;" #define USB_PNP_HOST_INFO(table) \ - MODULE_PNP_INFO(USB_STD_PNP_HOST_INFO, usb, table, table, sizeof(table[0]), \ + MODULE_PNP_INFO(USB_STD_PNP_HOST_INFO, uhub, table, table, sizeof(table[0]), \ sizeof(table) / sizeof(table[0])) #define USB_PNP_DEVICE_INFO(table) \ - MODULE_PNP_INFO(USB_STD_PNP_DEVICE_INFO, usb, table, table, sizeof(table[0]), \ + MODULE_PNP_INFO(USB_STD_PNP_DEVICE_INFO, uhub, table, table, sizeof(table[0]), \ sizeof(table) / sizeof(table[0])) #define USB_PNP_DUAL_INFO(table) \ - MODULE_PNP_INFO(USB_STD_PNP_INFO, usb, table, table, sizeof(table[0]), \ + MODULE_PNP_INFO(USB_STD_PNP_INFO, uhub, table, table, sizeof(table[0]), \ sizeof(table) / sizeof(table[0])) /* check that the size of the structure above is correct */ From owner-svn-src-head@freebsd.org Sat Feb 17 06:57: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 345D2F1435F; Sat, 17 Feb 2018 06:57:24 +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 091996A980; Sat, 17 Feb 2018 06:57: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 D198F1943E; Sat, 17 Feb 2018 06:57: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 w1H6vLQE027602; Sat, 17 Feb 2018 06:57:21 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H6vLsG027601; Sat, 17 Feb 2018 06:57:21 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802170657.w1H6vLsG027601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 17 Feb 2018 06:57:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329441 - head/etc/rc.d X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/etc/rc.d X-SVN-Commit-Revision: 329441 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 06:57:24 -0000 Author: imp Date: Sat Feb 17 06:57:21 2018 New Revision: 329441 URL: https://svnweb.freebsd.org/changeset/base/329441 Log: If we're passed an argument, then treat it as a single NOMATCH event to parse rather than searching for all events. Pass with new -p arg to devmatch. devmatch will use that one event rather than walking the entire tree. kldload will stop at the first failure. So we need to loop. Also, symbolic links may confused kldload into trying (and failing) to load multiple modules at once, so guard against that. Noticed by: hps (with similar patch) Sponsored by: Netflix Modified: head/etc/rc.d/devmatch Modified: head/etc/rc.d/devmatch ============================================================================== --- head/etc/rc.d/devmatch Sat Feb 17 06:57:17 2018 (r329440) +++ head/etc/rc.d/devmatch Sat Feb 17 06:57:21 2018 (r329441) @@ -37,17 +37,26 @@ desc="Use devmatch(8) to load kernel modules" start_cmd="${name}_start" stop_cmd=':' +[ -n "$2" ] && one_nomatch="-p '$2'" devmatch_start() { local x - x=$(devmatch | sort -u) + x=$(devmatch ${one_nomatch} | sort -u) [ -n "$x" ] || return + # While kldload can accept multiple modules + # on the line at once, we loop here in case + # there's some weird error with one of them. + # We also optimize against the false positives + # or drivers that have symbolic links that + # confuse devmatch by running it -n. echo "Autoloading modules: ${x}" - kldload ${x} + for m in ${x}; do + kldload -n ${m} + done } load_rc_config $name From owner-svn-src-head@freebsd.org Sat Feb 17 06:57: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 89663F1438B; Sat, 17 Feb 2018 06:57: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 2F3C16AA15; Sat, 17 Feb 2018 06:57: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 2BD0C1943F; Sat, 17 Feb 2018 06:57: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 w1H6vQ4S027653; Sat, 17 Feb 2018 06:57:26 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H6vQk0027652; Sat, 17 Feb 2018 06:57:26 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802170657.w1H6vQk0027652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 17 Feb 2018 06:57:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329442 - head/sbin/devmatch X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/devmatch X-SVN-Commit-Revision: 329442 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 06:57:31 -0000 Author: imp Date: Sat Feb 17 06:57:25 2018 New Revision: 329442 URL: https://svnweb.freebsd.org/changeset/base/329442 Log: Implement 'T' field matching. Implement 'T' field matching. This is needed to prevent false positives. However, it's not general enough. It only handles one field and there's a ton of edge cases even with that it likely wouldn't handle. To do it more generally and also eliminate a lot of the hackiness that's in this program now, we'd need to creating directories for lookups ala awk, pearl, python, etc. It appears to be sufficient, though, to get my keyboard loaded on boot. Sponsored by: Netflix Modified: head/sbin/devmatch/devmatch.c Modified: head/sbin/devmatch/devmatch.c ============================================================================== --- head/sbin/devmatch/devmatch.c Sat Feb 17 06:57:21 2018 (r329441) +++ head/sbin/devmatch/devmatch.c Sat Feb 17 06:57:25 2018 (r329442) @@ -265,6 +265,7 @@ search_hints(const char *bus, const char *dev, const c bit = -1; do { switch (*cp) { + /* All integer fields */ case 'I': case 'J': case 'G': @@ -300,6 +301,7 @@ search_hints(const char *bus, const char *dev, const c break; } break; + /* String fields */ case 'D': case 'Z': getstr(&ptr, val1); @@ -311,6 +313,22 @@ search_hints(const char *bus, const char *dev, const c break; s = pnpval_as_str(cp + 2, pnpinfo); if (strcmp(s, val1) != 0) + notme++; + break; + /* Key override fields, required to be last in the string */ + case 'T': + /* + * This is imperfect and only does one key and will be redone + * to be more general for multiple keys. Currently, nothing + * does that. + */ + if (dump_flag) /* No per-row data stored */ + break; + if (cp[strlen(cp) - 1] == ';') /* Skip required ; at end */ + cp[strlen(cp) - 1] = '\0'; /* in case it's not there */ + if ((s = strstr(pnpinfo, cp + 2)) == NULL) + notme++; + else if (s > pnpinfo && s[-1] != ' ') notme++; break; default: From owner-svn-src-head@freebsd.org Sat Feb 17 06:57: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 5F7C6F14395; Sat, 17 Feb 2018 06:57:32 +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 69BF06AA83; Sat, 17 Feb 2018 06:57: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 64C0B19440; Sat, 17 Feb 2018 06:57: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 w1H6vU63027707; Sat, 17 Feb 2018 06:57:30 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H6vUnD027706; Sat, 17 Feb 2018 06:57:30 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802170657.w1H6vUnD027706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 17 Feb 2018 06:57:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329443 - head/sbin/devmatch X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/devmatch X-SVN-Commit-Revision: 329443 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 06:57:32 -0000 Author: imp Date: Sat Feb 17 06:57:30 2018 New Revision: 329443 URL: https://svnweb.freebsd.org/changeset/base/329443 Log: Tweak the 'I' flagged value 'I' was omitting 'zero' values. This is not quite correct, and was put in as a hack but not documented. Remove it. If we find what the hack was really needed for, we'll either fix the need for it, or invent a new flagged value type. Submitted by: hps@ Sponsored by: Netflix Modified: head/sbin/devmatch/devmatch.c Modified: head/sbin/devmatch/devmatch.c ============================================================================== --- head/sbin/devmatch/devmatch.c Sat Feb 17 06:57:25 2018 (r329442) +++ head/sbin/devmatch/devmatch.c Sat Feb 17 06:57:30 2018 (r329443) @@ -285,7 +285,7 @@ search_hints(const char *bus, const char *dev, const c break; /*FALLTHROUGH*/ case 'I': - if (v != ival && ival != 0) + if (v != ival) notme++; break; case 'G': From owner-svn-src-head@freebsd.org Sat Feb 17 06:57: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 2CF5BF143E0; Sat, 17 Feb 2018 06:57: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 4D31F6AB55; Sat, 17 Feb 2018 06:57: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 DF0BC19441; Sat, 17 Feb 2018 06:57:34 +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 w1H6vYFH027759; Sat, 17 Feb 2018 06:57:34 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H6vYdk027757; Sat, 17 Feb 2018 06:57:34 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802170657.w1H6vYdk027757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 17 Feb 2018 06:57:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329444 - head/sbin/devmatch X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/devmatch X-SVN-Commit-Revision: 329444 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 06:57:37 -0000 Author: imp Date: Sat Feb 17 06:57:34 2018 New Revision: 329444 URL: https://svnweb.freebsd.org/changeset/base/329444 Log: Add option to parse NOMATCH event and suggest modules to load Add --nomatch/-p to search for individual drivers based on a NOMATCH event from devd. Submitted by: hps (earlier version) Sponsored by: Netflix Modified: head/sbin/devmatch/devmatch.8 head/sbin/devmatch/devmatch.c Modified: head/sbin/devmatch/devmatch.8 ============================================================================== --- head/sbin/devmatch/devmatch.8 Sat Feb 17 06:57:30 2018 (r329443) +++ head/sbin/devmatch/devmatch.8 Sat Feb 17 06:57:34 2018 (r329444) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 12, 2018 +.Dd February 16, 2018 .Dt DEVMATCH 8 .Os .Sh NAME @@ -33,9 +33,10 @@ .Nd print information about unattached devices .Sh SYNOPSIS .Nm -.Op Fl aduv +.Op Fl adpuv .Op Fl -all .Op Fl -dump +.Op Fl -nomatch .Op Fl -unbound .Op Fl -verbose .Sh DESCRIPTION @@ -50,6 +51,10 @@ Include all devices, not just the ones that are unatta Produce a human readable dump of the .Pa linker.hints file. +.It Fl p Fl -nomatch +Parse and use a standard NOMATCH event from +.Xr devd 8 +for matching instead of searching the device tree. .It Fl u Fl -unbound Attempt to produce a list of those drivers with PNP info whose driver tables with that PNP info can't be found. Modified: head/sbin/devmatch/devmatch.c ============================================================================== --- head/sbin/devmatch/devmatch.c Sat Feb 17 06:57:30 2018 (r329443) +++ head/sbin/devmatch/devmatch.c Sat Feb 17 06:57:34 2018 (r329444) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); static struct option longopts[] = { { "all", no_argument, NULL, 'a' }, { "dump", no_argument, NULL, 'd' }, + { "nomatch", required_argument, NULL, 'p' }, { "unbound", no_argument, NULL, 'u' }, { "verbose", no_argument, NULL, 'v' }, { NULL, 0, NULL, 0 } @@ -54,6 +55,7 @@ static struct option longopts[] = { static int all_flag; static int dump_flag; +static char *nomatch_str; static int unbound_flag; static int verbose_flag; @@ -398,6 +400,46 @@ find_unmatched(struct devinfo_dev *dev, void *arg) } static void +find_nomatch(char *nomatch) +{ + char *bus, *pnpinfo, *tmp; + + /* + * Find our bus name. It will include the unit number. We have to search + * backwards to avoid false positive for any PNP string that has ' on ' + * in them, which would come earlier in the string. Like if there were + * an 'Old Bard' ethernet card made by 'Stratford on Avon Hardware' or + * something silly like that. + */ + tmp = nomatch + strlen(nomatch) - 4; + while (tmp > nomatch && strncmp(tmp, " on ", 4) != 0) + tmp--; + if (tmp == nomatch) + errx(1, "No bus found in nomatch string: '%s'", nomatch); + bus = tmp + 4; + *tmp = '\0'; + tmp = bus + strlen(bus) - 1; + while (tmp > bus && isdigit(*tmp)) + tmp--; + *++tmp = '\0'; + + /* + * Note: the NOMATCH events place both the bus location as well as the + * pnp info after the 'at' and we don't know where one stops and the + * other begins, so we pass the whole thing to our search routine. + */ + if (*nomatch == '?') + nomatch++; + if (strncmp(nomatch, " at ", 4) != 0) + errx(1, "Malformed NOMATCH string: '%s'", nomatch); + pnpinfo = nomatch + 4; + + search_hints(bus, "", pnpinfo); + + exit(0); +} + +static void usage(void) { @@ -410,7 +452,7 @@ main(int argc, char **argv) struct devinfo_dev *root; int ch; - while ((ch = getopt_long(argc, argv, "aduv", + while ((ch = getopt_long(argc, argv, "adp:uv", longopts, NULL)) != -1) { switch (ch) { case 'a': @@ -419,6 +461,9 @@ main(int argc, char **argv) case 'd': dump_flag++; break; + case 'p': + nomatch_str = optarg; + break; case 'u': unbound_flag++; break; @@ -441,6 +486,8 @@ main(int argc, char **argv) exit(0); } + if (nomatch_str != NULL) + find_nomatch(nomatch_str); if (devinfo_init()) err(1, "devinfo_init"); if ((root = devinfo_handle_to_device(DEVINFO_ROOT_DEVICE)) == NULL) From owner-svn-src-head@freebsd.org Sat Feb 17 06: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 D8298F14426; Sat, 17 Feb 2018 06:57:41 +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 01D8A6AC10; Sat, 17 Feb 2018 06:57:39 +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 3958119442; Sat, 17 Feb 2018 06:57:39 +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 w1H6vdKi027813; Sat, 17 Feb 2018 06:57:39 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H6vcnX027812; Sat, 17 Feb 2018 06:57:38 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802170657.w1H6vcnX027812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 17 Feb 2018 06:57:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329445 - head/etc/devd X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/etc/devd X-SVN-Commit-Revision: 329445 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 06:57:42 -0000 Author: imp Date: Sat Feb 17 06:57:38 2018 New Revision: 329445 URL: https://svnweb.freebsd.org/changeset/base/329445 Log: Pass in the NOMATCH event to devmatch In devd/devmatch.conf, we need to pass the event to the devmatch serivce. It gets passed to devmatch -p for matching. We always pass this, unlike hps' original patch, so we kill two birds with one stone and only match modules to the event passed in. Submitted by: hps@ Sponsored by: Netflix Modified: head/etc/devd/devmatch.conf Modified: head/etc/devd/devmatch.conf ============================================================================== --- head/etc/devd/devmatch.conf Sat Feb 17 06:57:34 2018 (r329444) +++ head/etc/devd/devmatch.conf Sat Feb 17 06:57:38 2018 (r329445) @@ -9,7 +9,7 @@ # # Generic NOMATCH event nomatch 100 { - action "service devmatch start"; + action "service devmatch start '?$_'"; }; # Add the following to devd.conf to prevent this from running: From owner-svn-src-head@freebsd.org Sat Feb 17 06:57: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 21967F1445D; Sat, 17 Feb 2018 06:57:46 +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 8A6216ACDB; Sat, 17 Feb 2018 06:57:43 +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 94F5B19444; Sat, 17 Feb 2018 06:57:43 +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 w1H6vhND027866; Sat, 17 Feb 2018 06:57:43 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H6vhaL027864; Sat, 17 Feb 2018 06:57:43 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802170657.w1H6vhaL027864@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 17 Feb 2018 06:57:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329446 - head/sbin/devmatch X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/devmatch X-SVN-Commit-Revision: 329446 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 06:57:46 -0000 Author: imp Date: Sat Feb 17 06:57:43 2018 New Revision: 329446 URL: https://svnweb.freebsd.org/changeset/base/329446 Log: Implement --hints to read hints file directly In testing, it's often useful to copy a few files into a directory and kldxref them to ensure that particular cases are handled correctly. Add --hints (-h) to facilitate this testing and enable future automated testing. Sponsored by: Netflix Modified: head/sbin/devmatch/devmatch.8 head/sbin/devmatch/devmatch.c Modified: head/sbin/devmatch/devmatch.8 ============================================================================== --- head/sbin/devmatch/devmatch.8 Sat Feb 17 06:57:38 2018 (r329445) +++ head/sbin/devmatch/devmatch.8 Sat Feb 17 06:57:43 2018 (r329446) @@ -33,10 +33,11 @@ .Nd print information about unattached devices .Sh SYNOPSIS .Nm -.Op Fl adpuv +.Op Fl adhpuv .Op Fl -all .Op Fl -dump -.Op Fl -nomatch +.Op Fl -hints Ar file +.Op Fl -nomatch Ar event .Op Fl -unbound .Op Fl -verbose .Sh DESCRIPTION @@ -51,7 +52,13 @@ Include all devices, not just the ones that are unatta Produce a human readable dump of the .Pa linker.hints file. -.It Fl p Fl -nomatch +.It Fl h Fl -hints Ar file +Use the named +.Ar file +instead of +.Pa linker.hints +guessed from the current module load path. +.It Fl p Fl -nomatch Ar event Parse and use a standard NOMATCH event from .Xr devd 8 for matching instead of searching the device tree. Modified: head/sbin/devmatch/devmatch.c ============================================================================== --- head/sbin/devmatch/devmatch.c Sat Feb 17 06:57:38 2018 (r329445) +++ head/sbin/devmatch/devmatch.c Sat Feb 17 06:57:43 2018 (r329446) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); static struct option longopts[] = { { "all", no_argument, NULL, 'a' }, { "dump", no_argument, NULL, 'd' }, + { "hints", required_argument, NULL, 'h' }, { "nomatch", required_argument, NULL, 'p' }, { "unbound", no_argument, NULL, 'u' }, { "verbose", no_argument, NULL, 'v' }, @@ -55,6 +56,7 @@ static struct option longopts[] = { static int all_flag; static int dump_flag; +static char *linker_hints; static char *nomatch_str; static int unbound_flag; static int verbose_flag; @@ -62,47 +64,66 @@ static int verbose_flag; static void *hints; static void *hints_end; +static void * +read_hints(const char *fn, size_t *len) +{ + void *h; + int fd; + struct stat sb; + + fd = open(fn, O_RDONLY); + if (fd < 0) { + if (errno == ENOENT) + return NULL; + err(1, "Can't open %s for reading", fn); + } + if (fstat(fd, &sb) != 0) + err(1, "Can't fstat %s\n", fn); + h = malloc(sb.st_size); + if (h == NULL) + err(1, "not enough space to read hints file of %ju bytes", (uintmax_t)sb.st_size); + if (read(fd, h, sb.st_size) != sb.st_size) + err(1, "Can't read in %ju bytes from %s", (uintmax_t)sb.st_size, fn); + close(fd); + *len = sb.st_size; + return h; +} + static void read_linker_hints(void) { char fn[MAXPATHLEN]; - struct stat sb; char *modpath, *p, *q; - size_t buflen; - int fd; + size_t buflen, len; - if (sysctlbyname("kern.module_path", NULL, &buflen, NULL, 0) < 0) - errx(1, "Can't find kernel module path."); - modpath = malloc(buflen); - if (modpath == NULL) - err(1, "Can't get memory for modpath."); - if (sysctlbyname("kern.module_path", modpath, &buflen, NULL, 0) < 0) - errx(1, "Can't find kernel module path."); - p = modpath; - while ((q = strsep(&p, ";")) != NULL) { - snprintf(fn, sizeof(fn), "%s/linker.hints", q); - fd = open(fn, O_RDONLY); - if (fd < 0) { - if (errno == ENOENT) + if (linker_hints == NULL) { + if (sysctlbyname("kern.module_path", NULL, &buflen, NULL, 0) < 0) + errx(1, "Can't find kernel module path."); + modpath = malloc(buflen); + if (modpath == NULL) + err(1, "Can't get memory for modpath."); + if (sysctlbyname("kern.module_path", modpath, &buflen, NULL, 0) < 0) + errx(1, "Can't find kernel module path."); + p = modpath; + while ((q = strsep(&p, ";")) != NULL) { + snprintf(fn, sizeof(fn), "%s/linker.hints", q); + hints = read_hints(fn, &len); + if (hints == NULL) continue; - err(1, "Can't open %s for reading", fn); + break; } - if (fstat(fd, &sb) != 0) - err(1, "Can't fstat %s\n", fn); - hints = malloc(sb.st_size); + if (q == NULL) { + warnx("Can't read linker hints file."); + free(hints); + hints = NULL; + return; + } + } else { + hints = read_hints(linker_hints, &len); if (hints == NULL) - err(1, "not enough space to read hints file of %ju bytes", (uintmax_t)sb.st_size); - if (read(fd, hints, sb.st_size) != sb.st_size) - err(1, "Can't read in %ju bytes from %s", (uintmax_t)sb.st_size, fn); - close(fd); - break; + err(1, "Can't open %s for reading", fn); } - if (q == NULL) { - warnx("Can't read linker hints file."); - free(hints); - hints = NULL; - return; - } + if (*(int *)(intptr_t)hints != LINKER_HINTS_VERSION) { warnx("Linker hints version %d doesn't match expected %d.", *(int *)(intptr_t)hints, LINKER_HINTS_VERSION); @@ -110,7 +131,7 @@ read_linker_hints(void) hints = NULL; } if (hints != NULL) - hints_end = (void *)((intptr_t)hints + (intptr_t)sb.st_size); + hints_end = (void *)((intptr_t)hints + (intptr_t)len); } static int @@ -443,7 +464,7 @@ static void usage(void) { - errx(1, "devmatch [-adv]"); + errx(1, "devmatch [-adv] [-p nomatch] [-h linker-hints]"); } int @@ -452,7 +473,7 @@ main(int argc, char **argv) struct devinfo_dev *root; int ch; - while ((ch = getopt_long(argc, argv, "adp:uv", + while ((ch = getopt_long(argc, argv, "adh:p:uv", longopts, NULL)) != -1) { switch (ch) { case 'a': @@ -460,6 +481,9 @@ main(int argc, char **argv) break; case 'd': dump_flag++; + break; + case 'h': + linker_hints = optarg; break; case 'p': nomatch_str = optarg; From owner-svn-src-head@freebsd.org Sat Feb 17 07:30: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 913EEF168B7; Sat, 17 Feb 2018 07:30:46 +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 2B4F16C2B3; Sat, 17 Feb 2018 07:30:45 +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 F0FD6260329; Sat, 17 Feb 2018 08:30:40 +0100 (CET) Subject: Re: svn commit: r329371 - head/sys/compat/linuxkpi/common/include/asm To: Jan Beich Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201802161520.w1GFKLiA049085@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <4b408add-0b85-d57d-292e-9de76d8c15e5@selasky.org> Date: Sat, 17 Feb 2018 08:27:43 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 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.25 Precedence: list List-Id: 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, 17 Feb 2018 07:30:46 -0000 On 02/17/18 01:42, Jan Beich wrote: > To generate errors instead ? Which compiler are you using? This was tested with clang over here. --HPS From owner-svn-src-head@freebsd.org Sat Feb 17 07: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 CBB58F16E2D; Sat, 17 Feb 2018 07:35:31 +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 5E1FE6C746; Sat, 17 Feb 2018 07:35:31 +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 33C77260329; Sat, 17 Feb 2018 08:35:30 +0100 (CET) Subject: Re: svn commit: r329371 - head/sys/compat/linuxkpi/common/include/asm To: Jan Beich Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201802161520.w1GFKLiA049085@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <6f790c90-8c65-ab0b-4a58-2814be55f09f@selasky.org> Date: Sat, 17 Feb 2018 08:32:34 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 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.25 Precedence: list List-Id: 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, 17 Feb 2018 07:35:32 -0000 On 02/17/18 01:42, Jan Beich wrote: > Hans Petter Selasky writes: > >> Author: hselasky >> Date: Fri Feb 16 15:20:21 2018 >> New Revision: 329371 >> URL: https://svnweb.freebsd.org/changeset/base/329371 >> >> Log: >> Allow the cmpxchg() macro in the LinuxKPI to work on pointers without >> generating compiler warnings, -Wint-conversion . > [...] > > To generate errors instead ? > > $ make clean all -C /usr/ports/graphics/drm-next-kmod > [...] > drm_lock.c:72:10: error: flexible array member 'u8' in a union is not allowed > prev = cmpxchg(lock, old, new); > ^ I believe this is a regression issue in GCC: https://gcc.gnu.org/ml/gcc-patches/2016-07/msg01505.html --HPS From owner-svn-src-head@freebsd.org Sat Feb 17 08: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 A7E8DF19750; Sat, 17 Feb 2018 08:12:36 +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 5D3756DB11; Sat, 17 Feb 2018 08:12:36 +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 582261A168; Sat, 17 Feb 2018 08:12:36 +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 w1H8CaiC066734; Sat, 17 Feb 2018 08:12:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H8CaJg066733; Sat, 17 Feb 2018 08:12:36 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802170812.w1H8CaJg066733@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 17 Feb 2018 08:12:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329447 - 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: 329447 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 08:12:36 -0000 Author: hselasky Date: Sat Feb 17 08:12:35 2018 New Revision: 329447 URL: https://svnweb.freebsd.org/changeset/base/329447 Log: Compile fix for GCC in the LinuxKPI. Older versions of GCC don't allow flexible array members in a union. Use a zero length array instead. MFC after: 1 week Reported by: jbeich@ Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/asm/atomic.h Modified: head/sys/compat/linuxkpi/common/include/asm/atomic.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/atomic.h Sat Feb 17 06:57:43 2018 (r329446) +++ head/sys/compat/linuxkpi/common/include/asm/atomic.h Sat Feb 17 08:12:35 2018 (r329447) @@ -162,10 +162,10 @@ atomic_cmpxchg(atomic_t *v, int old, int new) #define cmpxchg(ptr, old, new) ({ \ union { \ __typeof(*(ptr)) val; \ - u8 u8[]; \ - u16 u16[]; \ - u32 u32[]; \ - u64 u64[]; \ + u8 u8[0]; \ + u16 u16[0]; \ + u32 u32[0]; \ + u64 u64[0]; \ } __ret = { .val = (old) }, __new = { .val = (new) }; \ \ CTASSERT(sizeof(__ret.val) == 1 || sizeof(__ret.val) == 2 || \ From owner-svn-src-head@freebsd.org Sat Feb 17 08:13: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 BF08CF198E4; Sat, 17 Feb 2018 08:13:48 +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 5C00D6DCC9; Sat, 17 Feb 2018 08:13:48 +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 E6D132600DF; Sat, 17 Feb 2018 09:13:40 +0100 (CET) Subject: Re: svn commit: r329371 - head/sys/compat/linuxkpi/common/include/asm From: Hans Petter Selasky To: Jan Beich Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201802161520.w1GFKLiA049085@repo.freebsd.org> <6f790c90-8c65-ab0b-4a58-2814be55f09f@selasky.org> Message-ID: <46eaba10-0433-20ef-12c5-64f285c33041@selasky.org> Date: Sat, 17 Feb 2018 09:10:44 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <6f790c90-8c65-ab0b-4a58-2814be55f09f@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.25 Precedence: list List-Id: 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, 17 Feb 2018 08:13:48 -0000 On 02/17/18 08:32, Hans Petter Selasky wrote: > On 02/17/18 01:42, Jan Beich wrote: >> Hans Petter Selasky writes: >> >>> Author: hselasky >>> Date: Fri Feb 16 15:20:21 2018 >>> New Revision: 329371 >>> URL: https://svnweb.freebsd.org/changeset/base/329371 >>> >>> Log: >>>    Allow the cmpxchg() macro in the LinuxKPI to work on pointers without >>>    generating compiler warnings, -Wint-conversion . >> [...] >> >> To generate errors instead ? >> >> $ make clean all -C /usr/ports/graphics/drm-next-kmod >> [...] >> drm_lock.c:72:10: error: flexible array member 'u8' in a union is not >> allowed >>                  prev = cmpxchg(lock, old, new); >>                         ^ > > I believe this is a regression issue in GCC: > > https://gcc.gnu.org/ml/gcc-patches/2016-07/msg01505.html > See r329447. --HPS From owner-svn-src-head@freebsd.org Sat Feb 17 08:48: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 84255F1C079; Sat, 17 Feb 2018 08:48:46 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 35B956ED32; Sat, 17 Feb 2018 08:48:46 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 304651A64C; Sat, 17 Feb 2018 08:48:46 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1H8mkNn081765; Sat, 17 Feb 2018 08:48:46 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H8mkfb081764; Sat, 17 Feb 2018 08:48:46 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201802170848.w1H8mkfb081764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 17 Feb 2018 08:48:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329448 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 329448 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 08:48:46 -0000 Author: mjg Date: Sat Feb 17 08:48:45 2018 New Revision: 329448 URL: https://svnweb.freebsd.org/changeset/base/329448 Log: exit: get rid of PROC_SLOCK when checking a process to report All accessed fields are protected with already held process lock. Modified: head/sys/kern/kern_exit.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Sat Feb 17 08:12:35 2018 (r329447) +++ head/sys/kern/kern_exit.c Sat Feb 17 08:48:45 2018 (r329448) @@ -1228,15 +1228,11 @@ loop_locked: nfound++; PROC_LOCK_ASSERT(p, MA_OWNED); - if ((options & (WTRAPPED | WUNTRACED)) != 0) - PROC_SLOCK(p); - if ((options & WTRAPPED) != 0 && (p->p_flag & P_TRACED) != 0 && (p->p_flag & (P_STOPPED_TRACE | P_STOPPED_SIG)) != 0 && p->p_suspcount == p->p_numthreads && (p->p_flag & P_WAITED) == 0) { - PROC_SUNLOCK(p); CTR4(KTR_PTRACE, "wait: returning trapped pid %d status %#x " "(xstat %d) xthread %d", @@ -1251,13 +1247,10 @@ loop_locked: (p->p_flag & P_STOPPED_SIG) != 0 && p->p_suspcount == p->p_numthreads && (p->p_flag & P_WAITED) == 0) { - PROC_SUNLOCK(p); report_alive_proc(td, p, siginfo, status, options, CLD_STOPPED); return (0); } - if ((options & (WTRAPPED | WUNTRACED)) != 0) - PROC_SUNLOCK(p); if ((options & WCONTINUED) != 0 && (p->p_flag & P_CONTINUED) != 0) { report_alive_proc(td, p, siginfo, status, options, From owner-svn-src-head@freebsd.org Sat Feb 17 09:03: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 13B8BF1D447; Sat, 17 Feb 2018 09:03:12 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A90BB6F953; Sat, 17 Feb 2018 09:03:11 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A3FC51A98F; Sat, 17 Feb 2018 09:03:11 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1H93BpZ091755; Sat, 17 Feb 2018 09:03:11 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1H93Bq8091754; Sat, 17 Feb 2018 09:03:11 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201802170903.w1H93Bq8091754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 17 Feb 2018 09:03:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329449 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 329449 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 09:03:12 -0000 Author: mjg Date: Sat Feb 17 09:03:11 2018 New Revision: 329449 URL: https://svnweb.freebsd.org/changeset/base/329449 Log: exit: stop doing PROC_SLOCK just to call proc_reap It immediately does PROC_SUNLOCK anyway and the lock plays no role. Modified: head/sys/kern/kern_exit.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Sat Feb 17 08:48:45 2018 (r329448) +++ head/sys/kern/kern_exit.c Sat Feb 17 09:03:11 2018 (r329449) @@ -817,12 +817,10 @@ proc_reap(struct thread *td, struct proc *p, int *stat sx_assert(&proctree_lock, SA_XLOCKED); PROC_LOCK_ASSERT(p, MA_OWNED); - PROC_SLOCK_ASSERT(p, MA_OWNED); KASSERT(p->p_state == PRS_ZOMBIE, ("proc_reap: !PRS_ZOMBIE")); q = td->td_proc; - PROC_SUNLOCK(p); if (status) *status = KW_EXITCODE(p->p_xexit, p->p_xsig); if (options & WNOWAIT) { @@ -1090,7 +1088,6 @@ proc_to_reap(struct thread *td, struct proc *p, idtype } if (p->p_state == PRS_ZOMBIE && !check_only) { - PROC_SLOCK(p); proc_reap(td, p, status, options); return (-1); } From owner-svn-src-head@freebsd.org Sat Feb 17 09:07: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 C9F79F1D9E9; Sat, 17 Feb 2018 09:07:22 +0000 (UTC) (envelope-from jbeich@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 81EB06FC02; Sat, 17 Feb 2018 09:07:22 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1354) id 79D38631; Sat, 17 Feb 2018 09:07:22 +0000 (UTC) From: Jan Beich To: Hans Petter Selasky Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r329371 - head/sys/compat/linuxkpi/common/include/asm References: <201802161520.w1GFKLiA049085@repo.freebsd.org> <4b408add-0b85-d57d-292e-9de76d8c15e5@selasky.org> Date: Sat, 17 Feb 2018 10:07:12 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 09:07:23 -0000 Hans Petter Selasky writes: > On 02/17/18 01:42, Jan Beich wrote: > >> To generate errors instead ? > > Which compiler are you using? > > This was tested with clang over here. $ cc -v FreeBSD clang version 6.0.0 (branches/release_60 324090) (based on LLVM 6.0.0) Target: x86_64-unknown-freebsd12.0 Thread model: posix InstalledDir: /usr/bin $ cat a.c union { char i8[]; short i16[]; int i32[]; long i64[]; } foo; $ cc -c a.c a.c:2:9: error: flexible array member 'i8' in a union is not allowed char i8[]; ^ a.c:3:9: error: flexible array member 'i16' in a union is not allowed short i16[]; ^ a.c:4:9: error: flexible array member 'i32' in a union is not allowed int i32[]; ^ a.c:5:9: error: flexible array member 'i64' in a union is not allowed long i64[]; ^ 4 errors generated. $ gcc7 -c a.c a.c:2:9: error: flexible array member in union char i8[]; ^~ a.c:3:9: error: flexible array member in union short i16[]; ^~~ a.c:4:9: error: flexible array member in union int i32[]; ^~~ a.c:5:9: error: flexible array member in union long i64[]; ^~~ From owner-svn-src-head@freebsd.org Sat Feb 17 09: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 2EF77F1FDD7; Sat, 17 Feb 2018 09:33:48 +0000 (UTC) (envelope-from jbeich@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 D8C2670D49; Sat, 17 Feb 2018 09:33:47 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1354) id D0876B0F; Sat, 17 Feb 2018 09:33:47 +0000 (UTC) From: Jan Beich To: Hans Petter Selasky Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r329371 - head/sys/compat/linuxkpi/common/include/asm References: <201802161520.w1GFKLiA049085@repo.freebsd.org> <6f790c90-8c65-ab0b-4a58-2814be55f09f@selasky.org> Date: Sat, 17 Feb 2018 10:33:40 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 09:33:48 -0000 Hans Petter Selasky writes: > On 02/17/18 01:42, Jan Beich wrote: > >> Hans Petter Selasky writes: >> >>> Author: hselasky >>> Date: Fri Feb 16 15:20:21 2018 >>> New Revision: 329371 >>> URL: https://svnweb.freebsd.org/changeset/base/329371 >>> >>> Log: >>> Allow the cmpxchg() macro in the LinuxKPI to work on pointers without >>> generating compiler warnings, -Wint-conversion . >> [...] >> >> To generate errors instead ? >> >> $ make clean all -C /usr/ports/graphics/drm-next-kmod >> [...] >> drm_lock.c:72:10: error: flexible array member 'u8' in a union is not allowed >> prev = cmpxchg(lock, old, new); >> ^ > > I believe this is a regression issue in GCC: > > https://gcc.gnu.org/ml/gcc-patches/2016-07/msg01505.html If you didn't notice that bug is for C++, not C. GCC and Clang accept flexible array members in unions only in C++. cmpxchg() from linuxkpi doesn't seem to be used anywhere in the tree. If the macro didn't expand there's nothing to produce an error for. Anyway, I confirm r329447 fixed graphics/drm-next-kmod build. From owner-svn-src-head@freebsd.org Sat Feb 17 09:47: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 962A3F20F3F; Sat, 17 Feb 2018 09:47:47 +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 2E1467177A; Sat, 17 Feb 2018 09:47:46 +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 B13942600DF; Sat, 17 Feb 2018 10:47:45 +0100 (CET) Subject: Re: svn commit: r329371 - head/sys/compat/linuxkpi/common/include/asm To: Jan Beich Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org References: <201802161520.w1GFKLiA049085@repo.freebsd.org> <6f790c90-8c65-ab0b-4a58-2814be55f09f@selasky.org> From: Hans Petter Selasky Message-ID: Date: Sat, 17 Feb 2018 10:44:49 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 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.25 Precedence: list List-Id: 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, 17 Feb 2018 09:47:47 -0000 On 02/17/18 10:33, Jan Beich wrote: > Hans Petter Selasky writes: > >> On 02/17/18 01:42, Jan Beich wrote: >> >>> Hans Petter Selasky writes: >>> >>>> Author: hselasky >>>> Date: Fri Feb 16 15:20:21 2018 >>>> New Revision: 329371 >>>> URL: https://svnweb.freebsd.org/changeset/base/329371 >>>> >>>> Log: >>>> Allow the cmpxchg() macro in the LinuxKPI to work on pointers without >>>> generating compiler warnings, -Wint-conversion . >>> [...] >>> >>> To generate errors instead ? >>> >>> $ make clean all -C /usr/ports/graphics/drm-next-kmod >>> [...] >>> drm_lock.c:72:10: error: flexible array member 'u8' in a union is not allowed >>> prev = cmpxchg(lock, old, new); >>> ^ >> >> I believe this is a regression issue in GCC: >> >> https://gcc.gnu.org/ml/gcc-patches/2016-07/msg01505.html > > If you didn't notice that bug is for C++, not C. GCC and Clang accept > flexible array members in unions only in C++. cmpxchg() from linuxkpi > doesn't seem to be used anywhere in the tree. If the macro didn't expand > there's nothing to produce an error for. > > Anyway, I confirm r329447 fixed graphics/drm-next-kmod build. > Hi, It looks like there has been a testing issue on my side: drm_lock.c:72:10: error: field has incomplete type 'u64 []' This is an older clang. Thanks for reporting! --HPS From owner-svn-src-head@freebsd.org Sat Feb 17 09:51: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 D1AFAF212C1; Sat, 17 Feb 2018 09:51:11 +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 6CB0671AF1; Sat, 17 Feb 2018 09:51:11 +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 034BF2600DF; Sat, 17 Feb 2018 10:51:09 +0100 (CET) Subject: Re: svn commit: r329371 - head/sys/compat/linuxkpi/common/include/asm From: Hans Petter Selasky To: Jan Beich Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org References: <201802161520.w1GFKLiA049085@repo.freebsd.org> <6f790c90-8c65-ab0b-4a58-2814be55f09f@selasky.org> Message-ID: <3a3f820f-03c5-99f7-4c6d-ae829e00395c@selasky.org> Date: Sat, 17 Feb 2018 10:48:13 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 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.25 Precedence: list List-Id: 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, 17 Feb 2018 09:51:12 -0000 BTW: drm-next-kmod now also builds on FreeBSD-11-stable (latest) --HPS From owner-svn-src-head@freebsd.org Sat Feb 17 11:27: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 1CB67F026E0; Sat, 17 Feb 2018 11:27:55 +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 8DABF75C9B; Sat, 17 Feb 2018 11:27:54 +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 ESMTPS id w1HBRdKW096529 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 17 Feb 2018 13:27:42 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w1HBRdKW096529 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w1HBRc4Q096528; Sat, 17 Feb 2018 13:27:38 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 17 Feb 2018 13:27:38 +0200 From: Konstantin Belousov To: Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329448 - head/sys/kern Message-ID: <20180217112738.GO94212@kib.kiev.ua> References: <201802170848.w1H8mkfb081764@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201802170848.w1H8mkfb081764@repo.freebsd.org> User-Agent: Mutt/1.9.3 (2018-01-21) 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.25 Precedence: list List-Id: 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, 17 Feb 2018 11:27:55 -0000 On Sat, Feb 17, 2018 at 08:48:46AM +0000, Mateusz Guzik wrote: > Author: mjg > Date: Sat Feb 17 08:48:45 2018 > New Revision: 329448 > URL: https://svnweb.freebsd.org/changeset/base/329448 > > Log: > exit: get rid of PROC_SLOCK when checking a process to report Was this tested ? In particular, are you aware of r309539 ? > > All accessed fields are protected with already held process lock. > > Modified: > head/sys/kern/kern_exit.c > > Modified: head/sys/kern/kern_exit.c > ============================================================================== > --- head/sys/kern/kern_exit.c Sat Feb 17 08:12:35 2018 (r329447) > +++ head/sys/kern/kern_exit.c Sat Feb 17 08:48:45 2018 (r329448) > @@ -1228,15 +1228,11 @@ loop_locked: > nfound++; > PROC_LOCK_ASSERT(p, MA_OWNED); > > - if ((options & (WTRAPPED | WUNTRACED)) != 0) > - PROC_SLOCK(p); > - > if ((options & WTRAPPED) != 0 && > (p->p_flag & P_TRACED) != 0 && > (p->p_flag & (P_STOPPED_TRACE | P_STOPPED_SIG)) != 0 && > p->p_suspcount == p->p_numthreads && > (p->p_flag & P_WAITED) == 0) { > - PROC_SUNLOCK(p); > CTR4(KTR_PTRACE, > "wait: returning trapped pid %d status %#x " > "(xstat %d) xthread %d", > @@ -1251,13 +1247,10 @@ loop_locked: > (p->p_flag & P_STOPPED_SIG) != 0 && > p->p_suspcount == p->p_numthreads && > (p->p_flag & P_WAITED) == 0) { > - PROC_SUNLOCK(p); > report_alive_proc(td, p, siginfo, status, options, > CLD_STOPPED); > return (0); > } > - if ((options & (WTRAPPED | WUNTRACED)) != 0) > - PROC_SUNLOCK(p); > if ((options & WCONTINUED) != 0 && > (p->p_flag & P_CONTINUED) != 0) { > report_alive_proc(td, p, siginfo, status, options, From owner-svn-src-head@freebsd.org Sat Feb 17 12:07: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 4912BF06AFE; Sat, 17 Feb 2018 12:07:10 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E35187A313; Sat, 17 Feb 2018 12:07:09 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE2DB1C6FD; Sat, 17 Feb 2018 12:07:09 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1HC79Q7087360; Sat, 17 Feb 2018 12:07:09 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HC79C1087357; Sat, 17 Feb 2018 12:07:09 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201802171207.w1HC79C1087357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 17 Feb 2018 12:07:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329451 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 329451 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 12:07:10 -0000 Author: mjg Date: Sat Feb 17 12:07:09 2018 New Revision: 329451 URL: https://svnweb.freebsd.org/changeset/base/329451 Log: Undo LOCK_PROFILING pessimisation after r313454 and r313455 With the option used to compile the kernel both sx and rw shared ops would always go to the slow path which added avoidable overhead even when the facility is disabled. Furthermore the increased time spent doing uncontested shared lock acquire would be bogusly added to total wait time, somewhat skewing the results. Restore old behaviour of going there only when profiling is enabled. This change is a no-op for kernels without LOCK_PROFILING (which is the default). Modified: head/sys/kern/kern_rwlock.c head/sys/kern/kern_sx.c head/sys/sys/lockstat.h Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Sat Feb 17 09:58:53 2018 (r329450) +++ head/sys/kern/kern_rwlock.c Sat Feb 17 12:07:09 2018 (r329451) @@ -645,9 +645,12 @@ __rw_rlock_int(struct rwlock *rw LOCK_FILE_LINE_ARG_DE WITNESS_CHECKORDER(&rw->lock_object, LOP_NEWORDER, file, line, NULL); v = RW_READ_VALUE(rw); - if (__predict_false(LOCKSTAT_OOL_PROFILE_ENABLED(rw__acquire) || + if (__predict_false(LOCKSTAT_PROFILE_ENABLED(rw__acquire) || !__rw_rlock_try(rw, td, &v, true LOCK_FILE_LINE_ARG))) __rw_rlock_hard(rw, td, v LOCK_FILE_LINE_ARG); + else + lock_profile_obtain_lock_success(&rw->lock_object, 0, 0, + file, line); LOCK_LOG_LOCK("RLOCK", &rw->lock_object, 0, 0, file, line); WITNESS_LOCK(&rw->lock_object, 0, file, line); @@ -839,9 +842,11 @@ _rw_runlock_cookie_int(struct rwlock *rw LOCK_FILE_LIN td = curthread; v = RW_READ_VALUE(rw); - if (__predict_false(LOCKSTAT_OOL_PROFILE_ENABLED(rw__release) || + if (__predict_false(LOCKSTAT_PROFILE_ENABLED(rw__release) || !__rw_runlock_try(rw, td, &v))) __rw_runlock_hard(rw, td, v LOCK_FILE_LINE_ARG); + else + lock_profile_release_lock(&rw->lock_object); TD_LOCKS_DEC(curthread); } Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Sat Feb 17 09:58:53 2018 (r329450) +++ head/sys/kern/kern_sx.c Sat Feb 17 12:07:09 2018 (r329451) @@ -1122,9 +1122,12 @@ _sx_slock_int(struct sx *sx, int opts LOCK_FILE_LINE_A error = 0; x = SX_READ_VALUE(sx); - if (__predict_false(LOCKSTAT_OOL_PROFILE_ENABLED(sx__acquire) || + if (__predict_false(LOCKSTAT_PROFILE_ENABLED(sx__acquire) || !__sx_slock_try(sx, &x LOCK_FILE_LINE_ARG))) error = _sx_slock_hard(sx, opts, x LOCK_FILE_LINE_ARG); + else + lock_profile_obtain_lock_success(&sx->lock_object, 0, 0, + file, line); if (error == 0) { LOCK_LOG_LOCK("SLOCK", &sx->lock_object, 0, 0, file, line); WITNESS_LOCK(&sx->lock_object, 0, file, line); @@ -1252,9 +1255,11 @@ _sx_sunlock_int(struct sx *sx LOCK_FILE_LINE_ARG_DEF) LOCK_LOG_LOCK("SUNLOCK", &sx->lock_object, 0, 0, file, line); x = SX_READ_VALUE(sx); - if (__predict_false(LOCKSTAT_OOL_PROFILE_ENABLED(sx__release) || + if (__predict_false(LOCKSTAT_PROFILE_ENABLED(sx__release) || !_sx_sunlock_try(sx, &x))) _sx_sunlock_hard(sx, x LOCK_FILE_LINE_ARG); + else + lock_profile_release_lock(&sx->lock_object); TD_LOCKS_DEC(curthread); } Modified: head/sys/sys/lockstat.h ============================================================================== --- head/sys/sys/lockstat.h Sat Feb 17 09:58:53 2018 (r329450) +++ head/sys/sys/lockstat.h Sat Feb 17 12:07:09 2018 (r329451) @@ -109,12 +109,7 @@ extern volatile int lockstat_enabled; LOCKSTAT_RECORD1(probe, lp, a); \ } while (0) -#ifndef LOCK_PROFILING #define LOCKSTAT_PROFILE_ENABLED(probe) __predict_false(lockstat_enabled) -#define LOCKSTAT_OOL_PROFILE_ENABLED(probe) LOCKSTAT_PROFILE_ENABLED(probe) -#else -#define LOCKSTAT_OOL_PROFILE_ENABLED(probe) 1 -#endif struct lock_object; uint64_t lockstat_nsecs(struct lock_object *); @@ -139,10 +134,7 @@ uint64_t lockstat_nsecs(struct lock_object *); #define LOCKSTAT_PROFILE_RELEASE_RWLOCK(probe, lp, a) \ LOCKSTAT_PROFILE_RELEASE_LOCK(probe, lp) -#ifndef LOCK_PROFILING #define LOCKSTAT_PROFILE_ENABLED(probe) 0 -#endif -#define LOCKSTAT_OOL_PROFILE_ENABLED(probe) 1 #endif /* !KDTRACE_HOOKS */ From owner-svn-src-head@freebsd.org Sat Feb 17 12:22: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 5D604F081EB; Sat, 17 Feb 2018 12:22:32 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0CCAA7B125; Sat, 17 Feb 2018 12:22:32 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E2B001CA3C; Sat, 17 Feb 2018 12:22:31 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1HCMVjn097053; Sat, 17 Feb 2018 12:22:31 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HCMTMQ097032; Sat, 17 Feb 2018 12:22:29 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201802171222.w1HCMTMQ097032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sat, 17 Feb 2018 12:22:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329452 - in head/lib/libcasper: libcasper services/cap_dns services/cap_grp services/cap_pwd services/cap_random services/cap_sysctl services/cap_syslog X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: in head/lib/libcasper: libcasper services/cap_dns services/cap_grp services/cap_pwd services/cap_random services/cap_sysctl services/cap_syslog X-SVN-Commit-Revision: 329452 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 12:22:32 -0000 Author: oshogbo Date: Sat Feb 17 12:22:29 2018 New Revision: 329452 URL: https://svnweb.freebsd.org/changeset/base/329452 Log: Introduce channel flags in libcasper. Instead of passing flags (which describe a type of nvlist) every send/recv we remember them in channel. It's enough for use to extract them only during unwrap. This simplify use of Casper. Reviewed by: bruffer@, bcr@ (both man page) Differential Revision: https://reviews.freebsd.org/D14196 (man page) Modified: head/lib/libcasper/libcasper/Makefile head/lib/libcasper/libcasper/libcasper.3 head/lib/libcasper/libcasper/libcasper.c head/lib/libcasper/libcasper/libcasper.h head/lib/libcasper/libcasper/libcasper_impl.h head/lib/libcasper/libcasper/libcasper_service.c head/lib/libcasper/libcasper/libcasper_service.h head/lib/libcasper/libcasper/service.c head/lib/libcasper/services/cap_dns/Makefile head/lib/libcasper/services/cap_dns/cap_dns.c head/lib/libcasper/services/cap_grp/Makefile head/lib/libcasper/services/cap_grp/cap_grp.c head/lib/libcasper/services/cap_pwd/Makefile head/lib/libcasper/services/cap_pwd/cap_pwd.c head/lib/libcasper/services/cap_random/Makefile head/lib/libcasper/services/cap_random/cap_random.c head/lib/libcasper/services/cap_sysctl/Makefile head/lib/libcasper/services/cap_sysctl/cap_sysctl.c head/lib/libcasper/services/cap_syslog/Makefile head/lib/libcasper/services/cap_syslog/cap_syslog.c Modified: head/lib/libcasper/libcasper/Makefile ============================================================================== --- head/lib/libcasper/libcasper/Makefile Sat Feb 17 12:07:09 2018 (r329451) +++ head/lib/libcasper/libcasper/Makefile Sat Feb 17 12:22:29 2018 (r329452) @@ -8,7 +8,7 @@ PACKAGE=casper .if ${MK_CASPER} != "no" SHLIB= casper -SHLIB_MAJOR= 0 +SHLIB_MAJOR= 1 SRCS= libcasper.c SRCS+= libcasper_impl.c Modified: head/lib/libcasper/libcasper/libcasper.3 ============================================================================== --- head/lib/libcasper/libcasper/libcasper.3 Sat Feb 17 12:07:09 2018 (r329451) +++ head/lib/libcasper/libcasper/libcasper.3 Sat Feb 17 12:22:29 2018 (r329452) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 5, 2018 +.Dd February 17, 2018 .Dt LIBCASPER 3 .Os .Sh NAME @@ -53,9 +53,9 @@ .Ft "cap_channel_t *" .Fn cap_init "void" .Ft "cap_channel_t *" -.Fn cap_wrap "int sock" +.Fn cap_wrap "int sock" "int flags" .Ft "int" -.Fn cap_unwrap "cap_channel_t *chan" +.Fn cap_unwrap "cap_channel_t *chan" "int *flags" .Ft "int" .Fn cap_sock "const cap_channel_t *chan" .Ft "cap_channel_t *" @@ -69,9 +69,9 @@ .Ft "int" .Fn cap_send_nvlist "const cap_channel_t *chan" "const nvlist_t *nvl" .Ft "nvlist_t *" -.Fn cap_recv_nvlist "const cap_channel_t *chan" "int flags" +.Fn cap_recv_nvlist "const cap_channel_t *chan" .Ft "nvlist_t *" -.Fn cap_xfer_nvlist "const cap_channel_t *chan" "nvlist_t *nvl" "int flags" +.Fn cap_xfer_nvlist "const cap_channel_t *chan" "nvlist_t *nvl" .Ft "cap_channel_t *" .Fn cap_service_open "const cap_channel_t *chan" "const char *name" .Sh DESCRIPTION @@ -105,6 +105,14 @@ or send over domain socket as a regular file descriptor and has to be represented as .Vt cap_channel_t again. +The +.Fa flags +argument defines the channel behavior. +The supported flags are: +.Bl -ohang -offset indent +.It CASPER_NO_UNIQ +The communication between process and casper uses no unique version of nvlist. +.El .Pp The .Fn cap_unwrap @@ -164,23 +172,11 @@ Most services should provide higher level API. The .Fn cap_recv_nvlist function receives the given nvlist over the given capability. -The -.Fa flags -argument defines what type the top nvlist is expected to be. -If the nvlist flags do not match the flags passed to -.Fn cap_recv_nvlist , -the nvlist will not be returned. .Pp The .Fn cap_xfer_nvlist function sends the given nvlist, destroys it and receives new nvlist in response over the given capability. -The -.Fa flags -argument defines what type the top nvlist is expected to be. -If the nvlist flags do not match the flags passed to -.Fn cap_xfer_nvlist , -the nvlist will not be returned. It does not matter if the function succeeds or fails, the nvlist given for sending will always be destroyed once the function returns. .Pp Modified: head/lib/libcasper/libcasper/libcasper.c ============================================================================== --- head/lib/libcasper/libcasper/libcasper.c Sat Feb 17 12:07:09 2018 (r329451) +++ head/lib/libcasper/libcasper/libcasper.c Sat Feb 17 12:22:29 2018 (r329452) @@ -48,6 +48,8 @@ __FBSDID("$FreeBSD$"); #include "libcasper.h" #include "libcasper_impl.h" +#define CASPER_VALID_FLAGS (CASPER_NO_UNIQ) + /* * Structure describing communication channel between two separated processes. */ @@ -62,6 +64,8 @@ struct cap_channel { int cch_sock; /* Process descriptor for casper. */ int cch_pd; + /* Flags to communicate with casper. */ + int cch_flags; }; static bool @@ -74,6 +78,13 @@ cap_add_pd(cap_channel_t *chan, int pd) return (true); } +int +cap_channel_flags(const cap_channel_t *chan) +{ + + return (chan->cch_flags); +} + cap_channel_t * cap_init(void) { @@ -96,7 +107,7 @@ cap_init(void) } else if (pid > 0) { /* Child. */ close(sock[1]); - chan = cap_wrap(sock[0]); + chan = cap_wrap(sock[0], 0); if (chan == NULL) { serrno = errno; close(sock[0]); @@ -118,17 +129,21 @@ cap_init(void) } cap_channel_t * -cap_wrap(int sock) +cap_wrap(int sock, int flags) { cap_channel_t *chan; if (!fd_is_valid(sock)) return (NULL); + if ((flags & CASPER_VALID_FLAGS) != flags) + return (NULL); + chan = malloc(sizeof(*chan)); if (chan != NULL) { chan->cch_sock = sock; chan->cch_pd = -1; + chan->cch_flags = flags; chan->cch_magic = CAP_CHANNEL_MAGIC; } @@ -136,7 +151,7 @@ cap_wrap(int sock) } int -cap_unwrap(cap_channel_t *chan) +cap_unwrap(cap_channel_t *chan, int *flags) { int sock; @@ -146,6 +161,8 @@ cap_unwrap(cap_channel_t *chan) sock = chan->cch_sock; if (chan->cch_pd != -1) close(chan->cch_pd); + if (flags != NULL) + *flags = chan->cch_flags; chan->cch_magic = 0; free(chan); @@ -162,9 +179,9 @@ cap_clone(const cap_channel_t *chan) assert(chan != NULL); assert(chan->cch_magic == CAP_CHANNEL_MAGIC); - nvl = nvlist_create(0); + nvl = nvlist_create(channel_nvlist_flags(chan)); nvlist_add_string(nvl, "cmd", "clone"); - nvl = cap_xfer_nvlist(chan, nvl, 0); + nvl = cap_xfer_nvlist(chan, nvl); if (nvl == NULL) return (NULL); if (nvlist_get_number(nvl, "error") != 0) { @@ -174,7 +191,7 @@ cap_clone(const cap_channel_t *chan) } newsock = nvlist_take_descriptor(nvl, "sock"); nvlist_destroy(nvl); - newchan = cap_wrap(newsock); + newchan = cap_wrap(newsock, chan->cch_flags); if (newchan == NULL) { int serrno; @@ -216,10 +233,10 @@ cap_limit_set(const cap_channel_t *chan, nvlist_t *lim nvlist_t *nvlmsg; int error; - nvlmsg = nvlist_create(0); + nvlmsg = nvlist_create(channel_nvlist_flags(chan)); nvlist_add_string(nvlmsg, "cmd", "limit_set"); nvlist_add_nvlist(nvlmsg, "limits", limits); - nvlmsg = cap_xfer_nvlist(chan, nvlmsg, 0); + nvlmsg = cap_xfer_nvlist(chan, nvlmsg); if (nvlmsg == NULL) { nvlist_destroy(limits); return (-1); @@ -240,9 +257,9 @@ cap_limit_get(const cap_channel_t *chan, nvlist_t **li nvlist_t *nvlmsg; int error; - nvlmsg = nvlist_create(0); + nvlmsg = nvlist_create(channel_nvlist_flags(chan)); nvlist_add_string(nvlmsg, "cmd", "limit_get"); - nvlmsg = cap_xfer_nvlist(chan, nvlmsg, 0); + nvlmsg = cap_xfer_nvlist(chan, nvlmsg); if (nvlmsg == NULL) return (-1); error = (int)nvlist_get_number(nvlmsg, "error"); @@ -270,23 +287,25 @@ cap_send_nvlist(const cap_channel_t *chan, const nvlis } nvlist_t * -cap_recv_nvlist(const cap_channel_t *chan, int flags) +cap_recv_nvlist(const cap_channel_t *chan) { assert(chan != NULL); assert(chan->cch_magic == CAP_CHANNEL_MAGIC); - return (nvlist_recv(chan->cch_sock, flags)); + return (nvlist_recv(chan->cch_sock, + channel_nvlist_flags(chan))); } nvlist_t * -cap_xfer_nvlist(const cap_channel_t *chan, nvlist_t *nvl, int flags) +cap_xfer_nvlist(const cap_channel_t *chan, nvlist_t *nvl) { assert(chan != NULL); assert(chan->cch_magic == CAP_CHANNEL_MAGIC); - return (nvlist_xfer(chan->cch_sock, nvl, flags)); + return (nvlist_xfer(chan->cch_sock, nvl, + channel_nvlist_flags(chan))); } cap_channel_t * @@ -295,13 +314,14 @@ cap_service_open(const cap_channel_t *chan, const char cap_channel_t *newchan; nvlist_t *nvl; int sock, error; + int flags; sock = -1; - nvl = nvlist_create(0); + nvl = nvlist_create(channel_nvlist_flags(chan)); nvlist_add_string(nvl, "cmd", "open"); nvlist_add_string(nvl, "service", name); - nvl = cap_xfer_nvlist(chan, nvl, 0); + nvl = cap_xfer_nvlist(chan, nvl); if (nvl == NULL) return (NULL); error = (int)nvlist_get_number(nvl, "error"); @@ -311,10 +331,11 @@ cap_service_open(const cap_channel_t *chan, const char return (NULL); } sock = nvlist_take_descriptor(nvl, "chanfd"); + flags = nvlist_take_number(nvl, "chanflags"); assert(sock >= 0); nvlist_destroy(nvl); nvl = NULL; - newchan = cap_wrap(sock); + newchan = cap_wrap(sock, flags); if (newchan == NULL) goto fail; return (newchan); @@ -332,7 +353,7 @@ cap_service_limit(const cap_channel_t *chan, const cha nvlist_t *limits; unsigned int i; - limits = nvlist_create(0); + limits = nvlist_create(channel_nvlist_flags(chan)); for (i = 0; i < nnames; i++) nvlist_add_null(limits, names[i]); return (cap_limit_set(chan, limits)); Modified: head/lib/libcasper/libcasper/libcasper.h ============================================================================== --- head/lib/libcasper/libcasper/libcasper.h Sat Feb 17 12:07:09 2018 (r329451) +++ head/lib/libcasper/libcasper/libcasper.h Sat Feb 17 12:22:29 2018 (r329452) @@ -45,6 +45,8 @@ #include #include +#define CASPER_NO_UNIQ 0x00000001 + #ifndef _NVLIST_T_DECLARED #define _NVLIST_T_DECLARED struct nvlist; @@ -62,12 +64,36 @@ typedef struct cap_channel cap_channel_t; #else struct cap_channel { int cch_fd; + int cch_flags; }; typedef struct cap_channel cap_channel_t; #define CASPER_SUPPORT (0) #endif /* ! WITH_CASPER */ #endif /* ! _CAP_CHANNEL_T_DECLARED */ +#ifdef WITH_CASPER +int cap_channel_flags(const cap_channel_t *chan); +#else +static inline int +cap_channel_flags(const cap_channel_t *chan) +{ + + return (chan->cch_flags); +} +#endif + +static inline int +channel_nvlist_flags(const cap_channel_t *chan) +{ + int flags; + + flags = 0; + if ((cap_channel_flags(chan) & CASPER_NO_UNIQ) != 0) + flags |= NV_FLAG_NO_UNIQUE; + + return (flags); +} + /* * The functions opens unrestricted communication channel to Casper. */ @@ -103,16 +129,17 @@ int cap_service_limit(const cap_channel_t *chan, * The function creates cap_channel_t based on the given socket. */ #ifdef WITH_CASPER -cap_channel_t *cap_wrap(int sock); +cap_channel_t *cap_wrap(int sock, int flags); #else static inline cap_channel_t * -cap_wrap(int sock) +cap_wrap(int sock, int flags) { cap_channel_t *chan; chan = cap_init(); if (chan != NULL) { chan->cch_fd = sock; + chan->cch_flags = flags; } return (chan); } @@ -122,7 +149,7 @@ cap_wrap(int sock) * The function returns communication socket and frees cap_channel_t. */ #ifdef WITH_CASPER -int cap_unwrap(cap_channel_t *chan); +int cap_unwrap(cap_channel_t *chan, int *flags); #else static inline int cap_unwrap(cap_channel_t *chan) @@ -160,6 +187,7 @@ cap_clone(const cap_channel_t *chan) newchan = NULL; } } + newchan->cch_flags = chan->cch_flags; return (newchan); } @@ -212,7 +240,7 @@ static inline int cap_limit_get(const cap_channel_t *chan __unused, nvlist_t **limitsp) { - *limitsp = nvlist_create(0); + *limitsp = nvlist_create(channel_nvlist_flags(chan)); return (0); } #endif @@ -230,9 +258,9 @@ int cap_send_nvlist(const cap_channel_t *chan, const n * Function receives nvlist over the given capability. */ #ifdef WITH_CASPER -nvlist_t *cap_recv_nvlist(const cap_channel_t *chan, int flags); +nvlist_t *cap_recv_nvlist(const cap_channel_t *chan); #else -#define cap_recv_nvlist(chan, flags) (nvlist_create(flags)) +#define cap_recv_nvlist(chan) (nvlist_create(chan->cch_flags)) #endif /* @@ -240,14 +268,14 @@ nvlist_t *cap_recv_nvlist(const cap_channel_t *chan, i * response over the given capability. */ #ifdef WITH_CASPER -nvlist_t *cap_xfer_nvlist(const cap_channel_t *chan, nvlist_t *nvl, int flags); +nvlist_t *cap_xfer_nvlist(const cap_channel_t *chan, nvlist_t *nvl); #else static inline nvlist_t * -cap_xfer_nvlist(const cap_channel_t *chan __unused, nvlist_t *nvl, int flags) +cap_xfer_nvlist(const cap_channel_t *chan, nvlist_t *nvl) { nvlist_destroy(nvl); - return (nvlist_create(flags)); + return (nvlist_create(channel_nvlist_flags(chan))); } #endif Modified: head/lib/libcasper/libcasper/libcasper_impl.h ============================================================================== --- head/lib/libcasper/libcasper/libcasper_impl.h Sat Feb 17 12:07:09 2018 (r329451) +++ head/lib/libcasper/libcasper/libcasper_impl.h Sat Feb 17 12:22:29 2018 (r329452) @@ -54,6 +54,7 @@ void service_message(struct service *service, struct service_connection *sconn); void service_start(struct service *service, int sock, int procfd); const char *service_name(struct service *service); +int service_get_channel_flags(struct service *service); /* Private service connection functions. */ struct service_connection *service_connection_add(struct service *service, Modified: head/lib/libcasper/libcasper/libcasper_service.c ============================================================================== --- head/lib/libcasper/libcasper/libcasper_service.c Sat Feb 17 12:07:09 2018 (r329451) +++ head/lib/libcasper/libcasper/libcasper_service.c Sat Feb 17 12:22:29 2018 (r329452) @@ -201,6 +201,8 @@ casper_command(const char *cmd, const nvlist_t *limits nvlist_destroy(nvl); nvlist_move_descriptor(nvlout, "chanfd", chanfd); + nvlist_add_number(nvlout, "chanflags", + service_get_channel_flags(casserv->cs_service)); return (0); } Modified: head/lib/libcasper/libcasper/libcasper_service.h ============================================================================== --- head/lib/libcasper/libcasper/libcasper_service.h Sat Feb 17 12:07:09 2018 (r329451) +++ head/lib/libcasper/libcasper/libcasper_service.h Sat Feb 17 12:22:29 2018 (r329452) @@ -42,8 +42,9 @@ struct nvlist; typedef struct nvlist nvlist_t; #endif -#define CASPER_SERVICE_STDIO 0x00000001 -#define CASPER_SERVICE_FD 0x00000002 +#define CASPER_SERVICE_STDIO 0x00000001 +#define CASPER_SERVICE_FD 0x00000002 +#define CASPER_SERVICE_NO_UNIQ_LIMITS 0x00000004 typedef int service_limit_func_t(const nvlist_t *, const nvlist_t *); typedef int service_command_func_t(const char *cmd, const nvlist_t *, Modified: head/lib/libcasper/libcasper/service.c ============================================================================== --- head/lib/libcasper/libcasper/service.c Sat Feb 17 12:07:09 2018 (r329451) +++ head/lib/libcasper/libcasper/service.c Sat Feb 17 12:22:29 2018 (r329452) @@ -136,7 +136,8 @@ service_connection_add(struct service *service, int so sconn = malloc(sizeof(*sconn)); if (sconn == NULL) return (NULL); - sconn->sc_chan = cap_wrap(sock); + sconn->sc_chan = cap_wrap(sock, + service_get_channel_flags(service)); if (sconn->sc_chan == NULL) { serrno = errno; free(sconn); @@ -149,7 +150,7 @@ service_connection_add(struct service *service, int so sconn->sc_limits = nvlist_clone(limits); if (sconn->sc_limits == NULL) { serrno = errno; - (void)cap_unwrap(sconn->sc_chan); + (void)cap_unwrap(sconn->sc_chan, NULL); free(sconn); errno = serrno; return (NULL); @@ -266,16 +267,20 @@ service_message(struct service *service, struct servic { nvlist_t *nvlin, *nvlout; const char *cmd; - int error; + int error, flags; - nvlin = cap_recv_nvlist(service_connection_get_chan(sconn), 0); + flags = 0; + if ((service->s_flags & CASPER_SERVICE_NO_UNIQ_LIMITS) != 0) + flags = NV_FLAG_NO_UNIQUE; + + nvlin = cap_recv_nvlist(service_connection_get_chan(sconn)); if (nvlin == NULL) { service_connection_remove(service, sconn); return; } error = EDOOFUS; - nvlout = nvlist_create(0); + nvlout = nvlist_create(flags); cmd = nvlist_get_string(nvlin, "cmd"); if (strcmp(cmd, "limit_set") == 0) { @@ -341,6 +346,20 @@ service_name(struct service *service) assert(service->s_magic == SERVICE_MAGIC); return (service->s_name); +} + +int +service_get_channel_flags(struct service *service) +{ + int flags; + + assert(service->s_magic == SERVICE_MAGIC); + flags = 0; + + if ((service->s_flags & CASPER_SERVICE_NO_UNIQ_LIMITS) != 0) + flags |= CASPER_NO_UNIQ; + + return (flags); } static void Modified: head/lib/libcasper/services/cap_dns/Makefile ============================================================================== --- head/lib/libcasper/services/cap_dns/Makefile Sat Feb 17 12:07:09 2018 (r329451) +++ head/lib/libcasper/services/cap_dns/Makefile Sat Feb 17 12:22:29 2018 (r329452) @@ -6,7 +6,7 @@ SHLIBDIR?= /lib/casper PACKAGE=libcasper -SHLIB_MAJOR= 0 +SHLIB_MAJOR= 1 INCSDIR?= ${INCLUDEDIR}/casper .if ${MK_CASPER} != "no" Modified: head/lib/libcasper/services/cap_dns/cap_dns.c ============================================================================== --- head/lib/libcasper/services/cap_dns/cap_dns.c Sat Feb 17 12:07:09 2018 (r329451) +++ head/lib/libcasper/services/cap_dns/cap_dns.c Sat Feb 17 12:22:29 2018 (r329452) @@ -139,7 +139,7 @@ cap_gethostbyname2(cap_channel_t *chan, const char *na nvlist_add_string(nvl, "cmd", "gethostbyname"); nvlist_add_number(nvl, "family", (uint64_t)type); nvlist_add_string(nvl, "name", name); - nvl = cap_xfer_nvlist(chan, nvl, 0); + nvl = cap_xfer_nvlist(chan, nvl); if (nvl == NULL) { h_errno = NO_RECOVERY; return (NULL); @@ -166,7 +166,7 @@ cap_gethostbyaddr(cap_channel_t *chan, const void *add nvlist_add_string(nvl, "cmd", "gethostbyaddr"); nvlist_add_binary(nvl, "addr", addr, (size_t)len); nvlist_add_number(nvl, "family", (uint64_t)type); - nvl = cap_xfer_nvlist(chan, nvl, 0); + nvl = cap_xfer_nvlist(chan, nvl); if (nvl == NULL) { h_errno = NO_RECOVERY; return (NULL); @@ -242,7 +242,7 @@ cap_getaddrinfo(cap_channel_t *chan, const char *hostn nvlist_add_number(nvl, "hints.ai_protocol", (uint64_t)hints->ai_protocol); } - nvl = cap_xfer_nvlist(chan, nvl, 0); + nvl = cap_xfer_nvlist(chan, nvl); if (nvl == NULL) return (EAI_MEMORY); if (nvlist_get_number(nvl, "error") != 0) { @@ -292,7 +292,7 @@ cap_getnameinfo(cap_channel_t *chan, const struct sock nvlist_add_number(nvl, "servlen", (uint64_t)servlen); nvlist_add_binary(nvl, "sa", sa, (size_t)salen); nvlist_add_number(nvl, "flags", (uint64_t)flags); - nvl = cap_xfer_nvlist(chan, nvl, 0); + nvl = cap_xfer_nvlist(chan, nvl); if (nvl == NULL) return (EAI_MEMORY); if (nvlist_get_number(nvl, "error") != 0) { Modified: head/lib/libcasper/services/cap_grp/Makefile ============================================================================== --- head/lib/libcasper/services/cap_grp/Makefile Sat Feb 17 12:07:09 2018 (r329451) +++ head/lib/libcasper/services/cap_grp/Makefile Sat Feb 17 12:22:29 2018 (r329452) @@ -6,7 +6,7 @@ SHLIBDIR?= /lib/casper PACKAGE=libcasper -SHLIB_MAJOR= 0 +SHLIB_MAJOR= 1 INCSDIR?= ${INCLUDEDIR}/casper .if ${MK_CASPER} != "no" Modified: head/lib/libcasper/services/cap_grp/cap_grp.c ============================================================================== --- head/lib/libcasper/services/cap_grp/cap_grp.c Sat Feb 17 12:07:09 2018 (r329451) +++ head/lib/libcasper/services/cap_grp/cap_grp.c Sat Feb 17 12:22:29 2018 (r329452) @@ -197,7 +197,7 @@ cap_getgrcommon_r(cap_channel_t *chan, const char *cmd } else { abort(); } - nvl = cap_xfer_nvlist(chan, nvl, 0); + nvl = cap_xfer_nvlist(chan, nvl); if (nvl == NULL) { assert(errno != 0); *result = NULL; @@ -321,7 +321,7 @@ cap_setgroupent(cap_channel_t *chan, int stayopen) nvl = nvlist_create(0); nvlist_add_string(nvl, "cmd", "setgroupent"); nvlist_add_bool(nvl, "stayopen", stayopen != 0); - nvl = cap_xfer_nvlist(chan, nvl, 0); + nvl = cap_xfer_nvlist(chan, nvl); if (nvl == NULL) return (0); if (nvlist_get_number(nvl, "error") != 0) { @@ -341,7 +341,7 @@ cap_setgrent(cap_channel_t *chan) nvl = nvlist_create(0); nvlist_add_string(nvl, "cmd", "setgrent"); - nvl = cap_xfer_nvlist(chan, nvl, 0); + nvl = cap_xfer_nvlist(chan, nvl); if (nvl == NULL) return (0); if (nvlist_get_number(nvl, "error") != 0) { @@ -362,7 +362,7 @@ cap_endgrent(cap_channel_t *chan) nvl = nvlist_create(0); nvlist_add_string(nvl, "cmd", "endgrent"); /* Ignore any errors, we have no way to report them. */ - nvlist_destroy(cap_xfer_nvlist(chan, nvl, 0)); + nvlist_destroy(cap_xfer_nvlist(chan, nvl)); } int Modified: head/lib/libcasper/services/cap_pwd/Makefile ============================================================================== --- head/lib/libcasper/services/cap_pwd/Makefile Sat Feb 17 12:07:09 2018 (r329451) +++ head/lib/libcasper/services/cap_pwd/Makefile Sat Feb 17 12:22:29 2018 (r329452) @@ -6,7 +6,7 @@ SHLIBDIR?= /lib/casper PACKAGE=libcasper -SHLIB_MAJOR= 0 +SHLIB_MAJOR= 1 INCSDIR?= ${INCLUDEDIR}/casper .if ${MK_CASPER} != "no" Modified: head/lib/libcasper/services/cap_pwd/cap_pwd.c ============================================================================== --- head/lib/libcasper/services/cap_pwd/cap_pwd.c Sat Feb 17 12:07:09 2018 (r329451) +++ head/lib/libcasper/services/cap_pwd/cap_pwd.c Sat Feb 17 12:22:29 2018 (r329452) @@ -157,7 +157,7 @@ cap_getpwcommon_r(cap_channel_t *chan, const char *cmd } else { abort(); } - nvl = cap_xfer_nvlist(chan, nvl, 0); + nvl = cap_xfer_nvlist(chan, nvl); if (nvl == NULL) { assert(errno != 0); *result = NULL; @@ -281,7 +281,7 @@ cap_setpassent(cap_channel_t *chan, int stayopen) nvl = nvlist_create(0); nvlist_add_string(nvl, "cmd", "setpassent"); nvlist_add_bool(nvl, "stayopen", stayopen != 0); - nvl = cap_xfer_nvlist(chan, nvl, 0); + nvl = cap_xfer_nvlist(chan, nvl); if (nvl == NULL) return (0); if (nvlist_get_number(nvl, "error") != 0) { @@ -302,7 +302,7 @@ cap_set_end_pwent(cap_channel_t *chan, const char *cmd nvl = nvlist_create(0); nvlist_add_string(nvl, "cmd", cmd); /* Ignore any errors, we have no way to report them. */ - nvlist_destroy(cap_xfer_nvlist(chan, nvl, 0)); + nvlist_destroy(cap_xfer_nvlist(chan, nvl)); } void Modified: head/lib/libcasper/services/cap_random/Makefile ============================================================================== --- head/lib/libcasper/services/cap_random/Makefile Sat Feb 17 12:07:09 2018 (r329451) +++ head/lib/libcasper/services/cap_random/Makefile Sat Feb 17 12:22:29 2018 (r329452) @@ -6,7 +6,7 @@ SHLIBDIR?= /lib/casper PACKAGE=libcasper -SHLIB_MAJOR= 0 +SHLIB_MAJOR= 1 INCSDIR?= ${INCLUDEDIR}/casper .if ${MK_CASPER} != "no" Modified: head/lib/libcasper/services/cap_random/cap_random.c ============================================================================== --- head/lib/libcasper/services/cap_random/cap_random.c Sat Feb 17 12:07:09 2018 (r329451) +++ head/lib/libcasper/services/cap_random/cap_random.c Sat Feb 17 12:22:29 2018 (r329452) @@ -63,7 +63,7 @@ cap_random_buf(cap_channel_t *chan, void *buf, size_t nvlist_add_string(nvl, "cmd", "generate"); nvlist_add_number(nvl, "size", (uint64_t)(left > MAXSIZE ? MAXSIZE : left)); - nvl = cap_xfer_nvlist(chan, nvl, 0); + nvl = cap_xfer_nvlist(chan, nvl); if (nvl == NULL) return (-1); if (nvlist_get_number(nvl, "error") != 0) { Modified: head/lib/libcasper/services/cap_sysctl/Makefile ============================================================================== --- head/lib/libcasper/services/cap_sysctl/Makefile Sat Feb 17 12:07:09 2018 (r329451) +++ head/lib/libcasper/services/cap_sysctl/Makefile Sat Feb 17 12:22:29 2018 (r329452) @@ -6,7 +6,7 @@ SHLIBDIR?= /lib/casper PACKAGE=libcasper -SHLIB_MAJOR= 0 +SHLIB_MAJOR= 1 INCSDIR?= ${INCLUDEDIR}/casper .if ${MK_CASPER} != "no" Modified: head/lib/libcasper/services/cap_sysctl/cap_sysctl.c ============================================================================== --- head/lib/libcasper/services/cap_sysctl/cap_sysctl.c Sat Feb 17 12:07:09 2018 (r329451) +++ head/lib/libcasper/services/cap_sysctl/cap_sysctl.c Sat Feb 17 12:22:29 2018 (r329452) @@ -71,7 +71,7 @@ cap_sysctlbyname(cap_channel_t *chan, const char *name nvlist_add_number(nvl, "oldlen", (uint64_t)*oldlenp); if (newp != NULL) nvlist_add_binary(nvl, "newp", newp, newlen); - nvl = cap_xfer_nvlist(chan, nvl, 0); + nvl = cap_xfer_nvlist(chan, nvl); if (nvl == NULL) return (-1); if (nvlist_get_number(nvl, "error") != 0) { Modified: head/lib/libcasper/services/cap_syslog/Makefile ============================================================================== --- head/lib/libcasper/services/cap_syslog/Makefile Sat Feb 17 12:07:09 2018 (r329451) +++ head/lib/libcasper/services/cap_syslog/Makefile Sat Feb 17 12:22:29 2018 (r329452) @@ -6,7 +6,7 @@ SHLIBDIR?= /lib/casper PACKAGE=libcasper -SHLIB_MAJOR= 0 +SHLIB_MAJOR= 1 INCSDIR?= ${INCLUDEDIR}/casper .if ${MK_CASPER} != "no" Modified: head/lib/libcasper/services/cap_syslog/cap_syslog.c ============================================================================== --- head/lib/libcasper/services/cap_syslog/cap_syslog.c Sat Feb 17 12:07:09 2018 (r329451) +++ head/lib/libcasper/services/cap_syslog/cap_syslog.c Sat Feb 17 12:22:29 2018 (r329452) @@ -69,7 +69,7 @@ cap_vsyslog(cap_channel_t *chan, int priority, const c nvlist_add_string(nvl, "cmd", "vsyslog"); nvlist_add_number(nvl, "priority", priority); nvlist_add_string(nvl, "message", message); - nvl = cap_xfer_nvlist(chan, nvl, 0); + nvl = cap_xfer_nvlist(chan, nvl); if (nvl == NULL) { return; } @@ -88,7 +88,7 @@ cap_openlog(cap_channel_t *chan, const char *ident, in } nvlist_add_number(nvl, "logopt", logopt); nvlist_add_number(nvl, "facility", facility); - nvl = cap_xfer_nvlist(chan, nvl, 0); + nvl = cap_xfer_nvlist(chan, nvl); if (nvl == NULL) { return; } @@ -102,7 +102,7 @@ cap_closelog(cap_channel_t *chan) nvl = nvlist_create(0); nvlist_add_string(nvl, "cmd", "closelog"); - nvl = cap_xfer_nvlist(chan, nvl, 0); + nvl = cap_xfer_nvlist(chan, nvl); if (nvl == NULL) { return; } @@ -118,7 +118,7 @@ cap_setlogmask(cap_channel_t *chan, int maskpri) nvl = nvlist_create(0); nvlist_add_string(nvl, "cmd", "setlogmask"); nvlist_add_number(nvl, "maskpri", maskpri); - nvl = cap_xfer_nvlist(chan, nvl, 0); + nvl = cap_xfer_nvlist(chan, nvl); omask = nvlist_get_number(nvl, "omask"); nvlist_destroy(nvl); From owner-svn-src-head@freebsd.org Sat Feb 17 12:32: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 6C16EF0906D; Sat, 17 Feb 2018 12:32:54 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 20DC37B7B0; Sat, 17 Feb 2018 12:32:54 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1BC811CBF8; Sat, 17 Feb 2018 12:32:54 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1HCWr5G002234; Sat, 17 Feb 2018 12:32:53 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HCWr8N002233; Sat, 17 Feb 2018 12:32:53 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201802171232.w1HCWr8N002233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sat, 17 Feb 2018 12:32:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329453 - head/bin/uuidgen X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/bin/uuidgen X-SVN-Commit-Revision: 329453 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 12:32:54 -0000 Author: oshogbo Date: Sat Feb 17 12:32:53 2018 New Revision: 329453 URL: https://svnweb.freebsd.org/changeset/base/329453 Log: Capsicumize uuidgen. Modified: head/bin/uuidgen/uuidgen.c Modified: head/bin/uuidgen/uuidgen.c ============================================================================== --- head/bin/uuidgen/uuidgen.c Sat Feb 17 12:22:29 2018 (r329452) +++ head/bin/uuidgen/uuidgen.c Sat Feb 17 12:32:53 2018 (r329453) @@ -28,6 +28,9 @@ #include __FBSDID("$FreeBSD$"); +#include + +#include #include #include #include @@ -79,6 +82,12 @@ main(int argc, char *argv[]) if (argc) usage(); + + caph_cache_catpages(); + if (caph_limit_stdio() < 0) + err(1, "Unable to limit stdio"); + if (cap_enter() < 0 && errno != ENOSYS) + err(1, "Unable to enter capability mode"); if (count == -1) count = 1; From owner-svn-src-head@freebsd.org Sat Feb 17 12:38: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 6D7FDF097C9; Sat, 17 Feb 2018 12:38:47 +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 15FAA7BC40; Sat, 17 Feb 2018 12:38:47 +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 0F23D1CC10; Sat, 17 Feb 2018 12:38:47 +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 w1HCck27002748; Sat, 17 Feb 2018 12:38:46 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HCckRK002747; Sat, 17 Feb 2018 12:38:46 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802171238.w1HCckRK002747@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 17 Feb 2018 12:38:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329454 - head/sys/dev/usb X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/usb X-SVN-Commit-Revision: 329454 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 12:38:47 -0000 Author: hselasky Date: Sat Feb 17 12:38:46 2018 New Revision: 329454 URL: https://svnweb.freebsd.org/changeset/base/329454 Log: Revert redundant parts of r329440 after recent devmatch(8) changes. Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/usb_hub.c Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Sat Feb 17 12:32:53 2018 (r329453) +++ head/sys/dev/usb/usb_hub.c Sat Feb 17 12:38:46 2018 (r329454) @@ -1733,12 +1733,7 @@ uhub_child_pnpinfo_string(device_t parent, device_t ch } iface = usbd_get_iface(res.udev, res.iface_index); if (iface && iface->idesc) { - snprintf(buf, buflen, - "bus=usb " -#if USB_HAVE_UGEN - "device=%s " -#endif - "vendor=0x%04x product=0x%04x " + snprintf(buf, buflen, "vendor=0x%04x product=0x%04x " "devclass=0x%02x devsubclass=0x%02x " "devproto=0x%02x " "sernum=\"%s\" " @@ -1746,9 +1741,6 @@ uhub_child_pnpinfo_string(device_t parent, device_t ch "mode=%s " "intclass=0x%02x intsubclass=0x%02x " "intprotocol=0x%02x" "%s%s", -#if USB_HAVE_UGEN - res.udev->ugen_name, -#endif UGETW(res.udev->ddesc.idVendor), UGETW(res.udev->ddesc.idProduct), res.udev->ddesc.bDeviceClass, From owner-svn-src-head@freebsd.org Sat Feb 17 13:13: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 9C5DBF0C63C; Sat, 17 Feb 2018 13:13:56 +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 4A2D97D5BF; Sat, 17 Feb 2018 13:13:56 +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 448FB1D2DE; Sat, 17 Feb 2018 13:13:56 +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 w1HDDuQI022702; Sat, 17 Feb 2018 13:13:56 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HDDuJl022701; Sat, 17 Feb 2018 13:13:56 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802171313.w1HDDuJl022701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 17 Feb 2018 13:13:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329455 - head/etc/devd X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/etc/devd X-SVN-Commit-Revision: 329455 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 13:13:56 -0000 Author: hselasky Date: Sat Feb 17 13:13:55 2018 New Revision: 329455 URL: https://svnweb.freebsd.org/changeset/base/329455 Log: Invoke devmatch rc.d script directly instead of depending on "service" which is installed in usr/sbin and might not be available at the time devd is started. Sponsored by: Mellanox Technologies Modified: head/etc/devd/devmatch.conf Modified: head/etc/devd/devmatch.conf ============================================================================== --- head/etc/devd/devmatch.conf Sat Feb 17 12:38:46 2018 (r329454) +++ head/etc/devd/devmatch.conf Sat Feb 17 13:13:55 2018 (r329455) @@ -9,7 +9,7 @@ # # Generic NOMATCH event nomatch 100 { - action "service devmatch start '?$_'"; + action "/etc/rc.d/devmatch start '?$_'"; }; # Add the following to devd.conf to prevent this from running: From owner-svn-src-head@freebsd.org Sat Feb 17 13:32: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 C8A0CF0DFB1; Sat, 17 Feb 2018 13:32:29 +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 7E76C7E2A9; Sat, 17 Feb 2018 13:32:29 +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 796B81D625; Sat, 17 Feb 2018 13:32: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 w1HDWTnt032550; Sat, 17 Feb 2018 13:32:29 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HDWTBr032549; Sat, 17 Feb 2018 13:32:29 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802171332.w1HDWTBr032549@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 17 Feb 2018 13:32:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329456 - head/etc/rc.d X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/etc/rc.d X-SVN-Commit-Revision: 329456 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 13:32:29 -0000 Author: hselasky Date: Sat Feb 17 13:32:29 2018 New Revision: 329456 URL: https://svnweb.freebsd.org/changeset/base/329456 Log: Fix handling of "one_nomatch" shell variable to preserve its contents appearing as a single argument passed to devmatch(8). Don't depend on "sort" utility from usr/bin which might not be available when devd is started. Sponsored by: Mellanox Technologies Modified: head/etc/rc.d/devmatch Modified: head/etc/rc.d/devmatch ============================================================================== --- head/etc/rc.d/devmatch Sat Feb 17 13:13:55 2018 (r329455) +++ head/etc/rc.d/devmatch Sat Feb 17 13:32:29 2018 (r329456) @@ -37,13 +37,17 @@ desc="Use devmatch(8) to load kernel modules" start_cmd="${name}_start" stop_cmd=':' -[ -n "$2" ] && one_nomatch="-p '$2'" +one_nomatch="$2" devmatch_start() { local x - x=$(devmatch ${one_nomatch} | sort -u) + if [ -n "$one_nomatch" ]; then + x=$(devmatch -p "${one_nomatch}") + else + x=$(devmatch) + fi [ -n "$x" ] || return @@ -53,8 +57,8 @@ devmatch_start() # We also optimize against the false positives # or drivers that have symbolic links that # confuse devmatch by running it -n. - echo "Autoloading modules: ${x}" for m in ${x}; do + echo "Autoloading module: ${m}" kldload -n ${m} done } From owner-svn-src-head@freebsd.org Sat Feb 17 14:30: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 6487DF133A5; Sat, 17 Feb 2018 14:30:40 +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 09EBF814ED; Sat, 17 Feb 2018 14:30:40 +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 04A381DE6F; Sat, 17 Feb 2018 14:30:40 +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 w1HEUdvW059088; Sat, 17 Feb 2018 14:30:39 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HEUdxO059087; Sat, 17 Feb 2018 14:30:39 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802171430.w1HEUdxO059087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 17 Feb 2018 14:30:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329457 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329457 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 14:30:40 -0000 Author: kevans Date: Sat Feb 17 14:30:39 2018 New Revision: 329457 URL: https://svnweb.freebsd.org/changeset/base/329457 Log: stand/lua: dumpModules => lsModules rgrimes@ notes that this behavior is more befitting of the latter name than the former, and I'm inclined to agree. Reported by: rgrimes Modified: head/stand/lua/config.lua Modified: head/stand/lua/config.lua ============================================================================== --- head/stand/lua/config.lua Sat Feb 17 13:32:29 2018 (r329456) +++ head/stand/lua/config.lua Sat Feb 17 14:30:39 2018 (r329457) @@ -37,7 +37,7 @@ function config.setKey(k, n, v) modules[k][n] = v; end -function config.dumpModules() +function config.lsModules() print("== Dumping modules"); for k, v in pairs(modules) do print(k, v.load); From owner-svn-src-head@freebsd.org Sat Feb 17 14: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 4AD13F1392A; Sat, 17 Feb 2018 14:34:48 +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 C940F8192E; Sat, 17 Feb 2018 14:34:47 +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 AAD431DFF3; Sat, 17 Feb 2018 14:34:47 +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 w1HEYlYU063604; Sat, 17 Feb 2018 14:34:47 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HEYl8I063603; Sat, 17 Feb 2018 14:34:47 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802171434.w1HEYl8I063603@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 17 Feb 2018 14:34:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329458 - head/sbin/devmatch X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sbin/devmatch X-SVN-Commit-Revision: 329458 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 14:34:48 -0000 Author: hselasky Date: Sat Feb 17 14:34:47 2018 New Revision: 329458 URL: https://svnweb.freebsd.org/changeset/base/329458 Log: Fix USB driver matching in devmatch(8). Multiple drivers can match on the same USB device and the order of loading decides which driver gets the device. Use the supplied mask value as an indication of priority, so that vendor specific device drivers are loaded before more generic ones. Sponsored by: Mellanox Technologies Modified: head/sbin/devmatch/devmatch.c Modified: head/sbin/devmatch/devmatch.c ============================================================================== --- head/sbin/devmatch/devmatch.c Sat Feb 17 14:30:39 2018 (r329457) +++ head/sbin/devmatch/devmatch.c Sat Feb 17 14:34:47 2018 (r329458) @@ -54,6 +54,14 @@ static struct option longopts[] = { { NULL, 0, NULL, 0 } }; +#define DEVMATCH_MAX_HITS 256 + +static struct match_data { + char *descr; + int priority; +} match_data[DEVMATCH_MAX_HITS]; + +static int hit_index; static int all_flag; static int dump_flag; static char *linker_hints; @@ -236,6 +244,35 @@ pnpval_as_str(const char *val, const char *pnpinfo) return retval; } +static int +match_data_compare(const void *_pa, const void *_pb) +{ + const struct match_data *pa = _pa; + const struct match_data *pb = _pb; + + /* biggest value first */ + if (pa->priority > pb->priority) + return (-1); + else if (pa->priority < pb->priority) + return (1); + + /* then sort by string */ + return (strcmp(pa->descr, pb->descr)); +} + +static int +bitrev16(int input) +{ + int retval = 0; + int x; + + for (x = 0; x != 16; x++) { + if ((input >> x) & 1) + retval |= (0x8000 >> x); + } + return (retval); +} + static void search_hints(const char *bus, const char *dev, const char *pnpinfo) { @@ -367,9 +404,20 @@ search_hints(const char *bus, const char *dev, const c printf("\n"); else if (!notme) { if (!unbound_flag) { + char *descr = NULL; + if (all_flag) - printf("%s: ", *dev ? dev : "unattached" ); - printf("%s\n", lastmod); + asprintf(&descr, "%s: %s", *dev ? dev : "unattached", lastmod); + else + asprintf(&descr, "%s", lastmod); + + if (descr != NULL && hit_index < DEVMATCH_MAX_HITS) { + match_data[hit_index].descr = descr; + match_data[hit_index].priority = bitrev16(mask); + hit_index++; + } else { + free(descr); + } } found++; } @@ -382,6 +430,19 @@ search_hints(const char *bus, const char *dev, const c } walker = (void *)(len - sizeof(int) + (intptr_t)walker); } + if (hit_index != 0) { + /* sort hits by priority */ + mergesort(match_data, hit_index, sizeof(match_data[0]), &match_data_compare); + + /* printout */ + for (i = 0; i != hit_index; i++) { + puts(match_data[i].descr); + free(match_data[i].descr); + } + + /* reset hit_index */ + hit_index = 0; + } if (unbound_flag && found == 0 && *pnpinfo) { if (verbose_flag) printf("------------------------- "); From owner-svn-src-head@freebsd.org Sat Feb 17 14:39: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 7E6EBF13EFB; Sat, 17 Feb 2018 14:39:40 +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 D2BFA81C98; Sat, 17 Feb 2018 14:39:39 +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 w1HEdZec068049; Sat, 17 Feb 2018 06:39:35 -0800 (PST) (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 w1HEdZD5068048; Sat, 17 Feb 2018 06:39:35 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201802171439.w1HEdZD5068048@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r329457 - head/stand/lua In-Reply-To: <201802171430.w1HEUdxO059087@repo.freebsd.org> To: Kyle Evans Date: Sat, 17 Feb 2018 06:39:35 -0800 (PST) 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.25 Precedence: list List-Id: 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, 17 Feb 2018 14:39:40 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: kevans > Date: Sat Feb 17 14:30:39 2018 > New Revision: 329457 > URL: https://svnweb.freebsd.org/changeset/base/329457 > > Log: > stand/lua: dumpModules => lsModules > > rgrimes@ notes that this behavior is more befitting of the latter name than > the former, and I'm inclined to agree. > > Reported by: rgrimes > > Modified: > head/stand/lua/config.lua > > Modified: head/stand/lua/config.lua > ============================================================================== > --- head/stand/lua/config.lua Sat Feb 17 13:32:29 2018 (r329456) > +++ head/stand/lua/config.lua Sat Feb 17 14:30:39 2018 (r329457) > @@ -37,7 +37,7 @@ function config.setKey(k, n, v) > modules[k][n] = v; > end > > -function config.dumpModules() > +function config.lsModules() > print("== Dumping modules"); ^^^^^^^ I was more after this word :) > for k, v in pairs(modules) do > print(k, v.load); > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sat Feb 17 14:40: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 5B9FAF1405C; Sat, 17 Feb 2018 14:40:29 +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 DBB9481E51; Sat, 17 Feb 2018 14:40:28 +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 BD8FB1DFFC; Sat, 17 Feb 2018 14:40:28 +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 w1HEeSZt063860; Sat, 17 Feb 2018 14:40:28 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HEeShX063859; Sat, 17 Feb 2018 14:40:28 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802171440.w1HEeShX063859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 17 Feb 2018 14:40:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329459 - head/tools/tools/bus_autoconf X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/tools/tools/bus_autoconf X-SVN-Commit-Revision: 329459 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 14:40:29 -0000 Author: hselasky Date: Sat Feb 17 14:40:28 2018 New Revision: 329459 URL: https://svnweb.freebsd.org/changeset/base/329459 Log: Remove obsolete tool, bus_autoconf, which is replaced by devmatch(8). Deleted: head/tools/tools/bus_autoconf/ From owner-svn-src-head@freebsd.org Sat Feb 17 14:44: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 D2664F14665; Sat, 17 Feb 2018 14:44:03 +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 74D9082377; Sat, 17 Feb 2018 14:44:03 +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 6FBA11E18B; Sat, 17 Feb 2018 14:44:03 +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 w1HEi3tD068586; Sat, 17 Feb 2018 14:44:03 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HEi3sb068585; Sat, 17 Feb 2018 14:44:03 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802171444.w1HEi3sb068585@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 17 Feb 2018 14:44:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329460 - head/sys/dev/usb X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/usb X-SVN-Commit-Revision: 329460 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 14:44:04 -0000 Author: hselasky Date: Sat Feb 17 14:44:03 2018 New Revision: 329460 URL: https://svnweb.freebsd.org/changeset/base/329460 Log: Remove unused bus_autoconf section from usb.ko. Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/usb_lookup.c Modified: head/sys/dev/usb/usb_lookup.c ============================================================================== --- head/sys/dev/usb/usb_lookup.c Sat Feb 17 14:40:28 2018 (r329459) +++ head/sys/dev/usb/usb_lookup.c Sat Feb 17 14:44:03 2018 (r329460) @@ -153,70 +153,3 @@ usbd_lookup_id_by_uaa(const struct usb_device_id *id, return (ENXIO); } -/*------------------------------------------------------------------------* - * Export the USB device ID format we use to userspace tools. - *------------------------------------------------------------------------*/ -#if BYTE_ORDER == LITTLE_ENDIAN -#define U16_XOR "0" -#else -#define U16_XOR "8" -#endif - -#if defined(KLD_MODULE) && (USB_HAVE_ID_SECTION != 0) -static const char __section("bus_autoconf_format") __used usb_id_format[] = { - - /* Declare that three different sections use the same format */ - - "usb_host_id{256,:}" - "usb_device_id{256,:}" - "usb_dual_id{256,:}" - - /* List size of fields in the usb_device_id structure */ - - "mf_vendor{" U16_XOR ",1}" - "mf_product{" U16_XOR ",1}" - "mf_dev_lo{" U16_XOR ",1}" - "mf_dev_hi{" U16_XOR ",1}" - - "mf_dev_class{" U16_XOR ",1}" - "mf_dev_subclass{" U16_XOR ",1}" - "mf_dev_protocol{" U16_XOR ",1}" - "mf_int_class{" U16_XOR ",1}" - - "mf_int_subclass{" U16_XOR ",1}" - "mf_int_protocol{" U16_XOR ",1}" - "unused{" U16_XOR ",6}" - - "idVendor[0]{" U16_XOR ",8}" - "idVendor[1]{" U16_XOR ",8}" - "idProduct[0]{" U16_XOR ",8}" - "idProduct[1]{" U16_XOR ",8}" - "bcdDevice_lo[0]{" U16_XOR ",8}" - "bcdDevice_lo[1]{" U16_XOR ",8}" - "bcdDevice_hi[0]{" U16_XOR ",8}" - "bcdDevice_hi[1]{" U16_XOR ",8}" - - "bDeviceClass{0,8}" - "bDeviceSubClass{0,8}" - "bDeviceProtocol{0,8}" - "bInterfaceClass{0,8}" - "bInterfaceSubClass{0,8}" - "bInterfaceProtocol{0,8}" - -#if USB_HAVE_COMPAT_LINUX - "mfl_vendor{" U16_XOR ",1}" - "mfl_product{" U16_XOR ",1}" - "mfl_dev_lo{" U16_XOR ",1}" - "mfl_dev_hi{" U16_XOR ",1}" - - "mfl_dev_class{" U16_XOR ",1}" - "mfl_dev_subclass{" U16_XOR ",1}" - "mfl_dev_protocol{" U16_XOR ",1}" - "mfl_int_class{" U16_XOR ",1}" - - "mfl_int_subclass{" U16_XOR ",1}" - "mfl_int_protocol{" U16_XOR ",1}" - "unused{" U16_XOR ",6}" -#endif -}; -#endif From owner-svn-src-head@freebsd.org Sat Feb 17 14:51: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 9C2C3F150DF for ; Sat, 17 Feb 2018 14:51:19 +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 2DFB48288A for ; Sat, 17 Feb 2018 14:51:19 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x232.google.com with SMTP id y185so589744itc.1 for ; Sat, 17 Feb 2018 06:51:19 -0800 (PST) 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=cwaRtWSoAVVjPN0apSZw3BueDlMQEhsHkdGk2mtQXL8=; b=Z1NdCGZ+bum2Tv/ny3P6IpOU2dy359KAmhvrhGGvxJ4OXlgp+CZw93UhPxJZLd58dT qTDoHBn2lIyWxGGYCAIpOkKUdZJCmQBEsU/tzE3WhpBr5U6mv9P65aku304IkhbQHg5C udjJtE5fCGIZv70XKsN2b8nGHAestDJjM8UAM1Joyxl47f2Rx8uH/zRzdwegWKSxz3Il KYR2ogWAbp1fYPLnjiiwJajPlz0XBU8O21jNMqaYrwR7KOAMaib62HQzpIJs4m4kgzj0 95ZSJAZ6EBG3m/a95Nfgh6gFhGV2ASQkHXFy7pQk1GbIz5UnVN5eBjLRgtAjT9lumLXS ZZmg== 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=cwaRtWSoAVVjPN0apSZw3BueDlMQEhsHkdGk2mtQXL8=; b=DUy/vL73EXZholiJCD/OJWVTNUlMdJGIW+lRuOTHHvW79RwluXVyr1aM7zChfLVfqP SPT36I8MJWkxkJx/ZYO3faECoZ271TJtEiUx/lP8J1+lQF/OY2ywYKxbg+gNcTO6RJfi GfUqGhnsTfxAg8kUZWdnNfl24LbPvLmkhU+HaLDwv6p7LCWz5Q8Pha7TakJi2DynQupV ck4FRDxNHFuyRxRGiaDOzlhO4xi//I5PT/AosH6X2V1w22lST95yqx2afPds8KqfYkeM MeIg4gyAQ/npJu8ZihL3ATiGED5OtoPmu1XBKZaCG8jLim6h1qanqurjKLsdYBPFmmN0 21CA== X-Gm-Message-State: APf1xPAy/R3d/H5wSQHZ1N8oaMKIYFDzBuTJnVywhOt1GpIQq3Hr4hi1 T5RNq+UvfhyZfizS9p3I9I0Kpf4EMLJcfO9OKOyCSQ== X-Google-Smtp-Source: AH8x224SCPu2/P0kYL8K0Hm3jiwbDpefXF0XInIGYiiNU2v40q4GMP6yeT2+wC+21oPBSqDdtIamD5G5oYFNzZqCl54= X-Received: by 10.36.55.146 with SMTP id r140mr2041246itr.57.1518879078348; Sat, 17 Feb 2018 06:51:18 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Sat, 17 Feb 2018 06:51:17 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: <201802171332.w1HDWTBr032549@repo.freebsd.org> References: <201802171332.w1HDWTBr032549@repo.freebsd.org> From: Warner Losh Date: Sat, 17 Feb 2018 07:51:17 -0700 X-Google-Sender-Auth: VQZyN5U8XCZvczbpnUcAcee1FAw Message-ID: Subject: Re: svn commit: r329456 - head/etc/rc.d To: Hans Petter Selasky 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.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 14:51:19 -0000 On Sat, Feb 17, 2018 at 6:32 AM, Hans Petter Selasky wrote: > Author: hselasky > Date: Sat Feb 17 13:32:29 2018 > New Revision: 329456 > URL: https://svnweb.freebsd.org/changeset/base/329456 > > Log: > Fix handling of "one_nomatch" shell variable to preserve its contents > appearing as a single argument passed to devmatch(8). > > Don't depend on "sort" utility from usr/bin which might not be > available when devd is started. > It's more the unique part than the sort part since otherwise we try to load things a large number of times. I'd preferred if you'd talked to me about a non-urgent change like this (split / and /usr is broken already and there's a few other places that are also a problem) Warner > Sponsored by: Mellanox Technologies > > Modified: > head/etc/rc.d/devmatch > > Modified: head/etc/rc.d/devmatch > ============================================================ > ================== > --- head/etc/rc.d/devmatch Sat Feb 17 13:13:55 2018 (r329455) > +++ head/etc/rc.d/devmatch Sat Feb 17 13:32:29 2018 (r329456) > @@ -37,13 +37,17 @@ desc="Use devmatch(8) to load kernel modules" > > start_cmd="${name}_start" > stop_cmd=':' > -[ -n "$2" ] && one_nomatch="-p '$2'" > +one_nomatch="$2" > > devmatch_start() > { > local x > > - x=$(devmatch ${one_nomatch} | sort -u) > + if [ -n "$one_nomatch" ]; then > + x=$(devmatch -p "${one_nomatch}") > + else > + x=$(devmatch) > + fi > > [ -n "$x" ] || return > > @@ -53,8 +57,8 @@ devmatch_start() > # We also optimize against the false positives > # or drivers that have symbolic links that > # confuse devmatch by running it -n. > - echo "Autoloading modules: ${x}" > for m in ${x}; do > + echo "Autoloading module: ${m}" > kldload -n ${m} > done > } > > From owner-svn-src-head@freebsd.org Sat Feb 17 14:56: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 EB207F157DF for ; Sat, 17 Feb 2018 14:56:52 +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 806CC82D07 for ; Sat, 17 Feb 2018 14:56:52 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x233.google.com with SMTP id v186so4990527itc.5 for ; Sat, 17 Feb 2018 06:56:52 -0800 (PST) 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=u3PsktKgGY5ryCcKThv4IR2sx4sBfgihGaOkFI0iwrA=; b=Q1GkrQ399PB02SiGHoN7RokUnMpMsFUaMxWN5x0VlOiZ1Enq3nwaVFC4WxJk8JMp+A Lk5N+HPtVsCTiQmtgFnoiZNxin/QbMKtlkh+1lM0iJEkiyxDevxBs1S6FBTjKizFEtSo lTNM2HTBNowjrdrmgcK/uaMDf91+5Mnn7bfKGEAzSYC2DMEqDmirsmx+p0iu75Qdy9Jj m7w/z87FQxR03Mk9urxP6gSudsA6x+lAtFNm7UPrIJKneVqBeUeDrhMnL0T1tTk1MP7u CdUmgXqbvTJrBqxP4PeemRmGNSsI25EcZ62aSj8EtShdCpM0MmD99Hs4XFovBG3+rxtY rwqg== 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=u3PsktKgGY5ryCcKThv4IR2sx4sBfgihGaOkFI0iwrA=; b=YwFEFvP5BQZ46jkytUW97J4cQ+81rv4KlxZ0sZElyG+y/G5H+egRkoHpPA88rW5+79 s+JA5q8qakJkFpwBDBl7vzuGLDptjRcmd7c48q6+IzRUmiSauYA5ZlIDNnNYWebGFmgx QZfUjIf4RKcB9XlBi6n/uHWKuRM2WHpS8y7oyE2BX7dwB4vko4ach3/+KR327ZNw/Pf9 HFE1zv78ZHp3K2STw61QQ+8KE6IshVGuczHcbMT1CgbrmW2ETeFk+2EC6skSZ8YkvBpZ egGOgJo5bRUIzmRr/Wp/5VSIp6bQ3nuJ7Z4djp+W0kGNrnP+oVdN3gXwiYfF1irw6Uqc uuRA== X-Gm-Message-State: APf1xPDdfUs3e9IEojPqvc+o1+LbvAnCm6nE4Z8syfPGqpKkJ6shMMhT U8owEU/jeumWLhWjo5A3toPS0tpF88OoMBskccVTMA== X-Google-Smtp-Source: AH8x226AT6BkfOobeyleVuiPVPCaU0chWd9UUwPrnn3Mi9Zs7+ul8qUHrECOSKyffxMTmKHXjE6f1SSKHYu6QtBxzcw= X-Received: by 10.36.55.146 with SMTP id r140mr2056292itr.57.1518879411848; Sat, 17 Feb 2018 06:56:51 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Sat, 17 Feb 2018 06:56:51 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: <201802171434.w1HEYl8I063603@repo.freebsd.org> References: <201802171434.w1HEYl8I063603@repo.freebsd.org> From: Warner Losh Date: Sat, 17 Feb 2018 07:56:51 -0700 X-Google-Sender-Auth: JBVwTcgFx5DKgx9VhCDB_wSnW-I Message-ID: Subject: Re: svn commit: r329458 - head/sbin/devmatch To: Hans Petter Selasky 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.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 14:56:53 -0000 On Sat, Feb 17, 2018 at 7:34 AM, Hans Petter Selasky wrote: > Author: hselasky > Date: Sat Feb 17 14:34:47 2018 > New Revision: 329458 > URL: https://svnweb.freebsd.org/changeset/base/329458 > > Log: > Fix USB driver matching in devmatch(8). > > Multiple drivers can match on the same USB device and the order of > loading > decides which driver gets the device. Use the supplied mask value as an > indication of priority, so that vendor specific device drivers are loaded > before more generic ones. > This change isn't right. I mean, it might cause the special case of USB to get the driver you want loaded, but using the MASK this way is wrong. It's fixing the wrong problem. devmatch can't know who the winners will be and has to recommend all the drivers to load and those drivers have to cope with that. The right fix there, I think, is to load them all at once, in one kldload operation and not loop in /etc/rc.d/devmatch. I'd request you make no further changes to devmatch without a review. Warner > > Sponsored by: Mellanox Technologies > > Modified: > head/sbin/devmatch/devmatch.c > > Modified: head/sbin/devmatch/devmatch.c > ============================================================ > ================== > --- head/sbin/devmatch/devmatch.c Sat Feb 17 14:30:39 2018 > (r329457) > +++ head/sbin/devmatch/devmatch.c Sat Feb 17 14:34:47 2018 > (r329458) > @@ -54,6 +54,14 @@ static struct option longopts[] = { > { NULL, 0, NULL, 0 } > }; > > +#define DEVMATCH_MAX_HITS 256 > + > +static struct match_data { > + char *descr; > + int priority; > +} match_data[DEVMATCH_MAX_HITS]; > + > +static int hit_index; > static int all_flag; > static int dump_flag; > static char *linker_hints; > @@ -236,6 +244,35 @@ pnpval_as_str(const char *val, const char *pnpinfo) > return retval; > } > > +static int > +match_data_compare(const void *_pa, const void *_pb) > +{ > + const struct match_data *pa = _pa; > + const struct match_data *pb = _pb; > + > + /* biggest value first */ > + if (pa->priority > pb->priority) > + return (-1); > + else if (pa->priority < pb->priority) > + return (1); > + > + /* then sort by string */ > + return (strcmp(pa->descr, pb->descr)); > +} > + > +static int > +bitrev16(int input) > +{ > + int retval = 0; > + int x; > + > + for (x = 0; x != 16; x++) { > + if ((input >> x) & 1) > + retval |= (0x8000 >> x); > + } > + return (retval); > +} > + > static void > search_hints(const char *bus, const char *dev, const char *pnpinfo) > { > @@ -367,9 +404,20 @@ search_hints(const char *bus, const char *dev, const c > printf("\n"); > else if (!notme) { > if (!unbound_flag) { > + char *descr = NULL; > + > if (all_flag) > - printf("%s: ", > *dev ? dev : "unattached" ); > - printf("%s\n", lastmod); > + asprintf(&descr, > "%s: %s", *dev ? dev : "unattached", lastmod); > + else > + asprintf(&descr, > "%s", lastmod); > + > + if (descr != NULL && > hit_index < DEVMATCH_MAX_HITS) { > + > match_data[hit_index].descr = descr; > + > match_data[hit_index].priority = bitrev16(mask); > + hit_index++; > + } else { > + free(descr); > + } > } > found++; > } > @@ -382,6 +430,19 @@ search_hints(const char *bus, const char *dev, const c > } > walker = (void *)(len - sizeof(int) + (intptr_t)walker); > } > + if (hit_index != 0) { > + /* sort hits by priority */ > + mergesort(match_data, hit_index, sizeof(match_data[0]), > &match_data_compare); > + > + /* printout */ > + for (i = 0; i != hit_index; i++) { > + puts(match_data[i].descr); > + free(match_data[i].descr); > + } > + > + /* reset hit_index */ > + hit_index = 0; > + } > if (unbound_flag && found == 0 && *pnpinfo) { > if (verbose_flag) > printf("------------------------- "); > > From owner-svn-src-head@freebsd.org Sat Feb 17 14:59: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 BD542F15B51; Sat, 17 Feb 2018 14:59:13 +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 599FF82F64; Sat, 17 Feb 2018 14:59:13 +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 E783726027E; Sat, 17 Feb 2018 15:59:11 +0100 (CET) Subject: Re: svn commit: r329456 - head/etc/rc.d To: Warner Losh Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201802171332.w1HDWTBr032549@repo.freebsd.org> From: Hans Petter Selasky Message-ID: Date: Sat, 17 Feb 2018 15:56:15 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 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.25 Precedence: list List-Id: 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, 17 Feb 2018 14:59:13 -0000 On 02/17/18 15:51, Warner Losh wrote: > It's more the unique part than the sort part since otherwise we try to load > things a large number of times. > I'd preferred if you'd talked to me about a non-urgent change like this > (split / and /usr is broken already and there's a few other places that are > also a problem) This needs to be handled inside devmatch. USB cannot use this sorting at all. --HPS From owner-svn-src-head@freebsd.org Sat Feb 17 15:01: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 CBD75F15E7F; Sat, 17 Feb 2018 15:01:26 +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 6C4838334A; Sat, 17 Feb 2018 15:01:26 +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 5C68226027E; Sat, 17 Feb 2018 16:01:25 +0100 (CET) Subject: Re: svn commit: r329458 - head/sbin/devmatch To: Warner Losh Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201802171434.w1HEYl8I063603@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <5b49c102-ad07-cfdb-2e45-e27cee99ee81@selasky.org> Date: Sat, 17 Feb 2018 15:58:29 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 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.25 Precedence: list List-Id: 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, 17 Feb 2018 15:01:27 -0000 On 02/17/18 15:56, Warner Losh wrote: > I'd request you make no further changes to devmatch without a review. I don't have a problem with that. You can see now what changes are needed. Please make sure you test with real USB devices! Some people are using FreeBSD-current on desktops, and the USB auto-load feature has been broken for almost a week now. --HPS From owner-svn-src-head@freebsd.org Sat Feb 17 15:02: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 DCDA9F16137; Sat, 17 Feb 2018 15:02:11 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-lf0-f43.google.com (mail-lf0-f43.google.com [209.85.215.43]) (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 31AFE8359F; Sat, 17 Feb 2018 15:02:10 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-lf0-f43.google.com with SMTP id f137so7705410lfe.4; Sat, 17 Feb 2018 07:02:10 -0800 (PST) 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=eLkoXLAi8i+56rbZPNHGbvYi8vt8xvk8s4LzVje2YJA=; b=QApZxyIZBlw082I8wVZAVQorRZj+3rH/1HII7cN8mmu+lM0Wgqs0C82nCfKbuXodzw +AOkD4/V0ATImMhO/uXBha3Jjshdnq6WZT1XKks4WwbQYvpLuR+zp0clK951MnLgvYZX 8nnU5YCE6UrKdgUMzIRvpOAzLqBBf22TKYa/IZy9RdOl/bNOsPAWaVNSYmvkN4xKT6qS 215OHDzn/S4i5G0NZXPl+ow7N8eb4KqLq7qK3xbtXqlsWFIUMM3VqOqAb6Ql0jVvNvr9 3uVC6I/jjpdlLwT274ycVnRzavTH4DzE0+h52ybu69cZ2PMDt1mp44BRRPlGIZN3ciZp VGIQ== X-Gm-Message-State: APf1xPBeoEP6airBZ+zNjSq9uHaWAWAPiaIbl34RyXrUskQ81yN5kgCc VqHFGNVwsPudn9hNOlKiEkN/8vFU X-Google-Smtp-Source: AH8x224/+BVlhpnnYXoag2fsi2tgAh73HDG7l7uCBWq3rIrd09K0IsD+Uv6fidAwVfxPSNYaQkcqHg== X-Received: by 10.46.73.81 with SMTP id b17mr6696870ljd.122.1518879729119; Sat, 17 Feb 2018 07:02:09 -0800 (PST) Received: from mail-lf0-f51.google.com (mail-lf0-f51.google.com. [209.85.215.51]) by smtp.gmail.com with ESMTPSA id b27sm2775018ljb.84.2018.02.17.07.02.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 17 Feb 2018 07:02:08 -0800 (PST) Received: by mail-lf0-f51.google.com with SMTP id q69so7691061lfi.10; Sat, 17 Feb 2018 07:02:08 -0800 (PST) X-Received: by 10.46.44.8 with SMTP id s8mr6109234ljs.51.1518879728640; Sat, 17 Feb 2018 07:02:08 -0800 (PST) MIME-Version: 1.0 Received: by 10.46.106.8 with HTTP; Sat, 17 Feb 2018 07:02:07 -0800 (PST) Received: by 10.46.106.8 with HTTP; Sat, 17 Feb 2018 07:02:07 -0800 (PST) In-Reply-To: References: <201802171430.w1HEUdxO059087@repo.freebsd.org> <201802171439.w1HEdZD5068048@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Sat, 17 Feb 2018 09:02:07 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r329457 - head/stand/lua To: rgrimes@freebsd.org 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.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 15:02:12 -0000 On Feb 17, 2018 8:39 AM, "Rodney W. Grimes" wrote: [ Charset UTF-8 unsupported, converting... ] > Author: kevans > Date: Sat Feb 17 14:30:39 2018 > New Revision: 329457 > URL: https://svnweb.freebsd.org/changeset/base/329457 > > Log: > stand/lua: dumpModules => lsModules > > rgrimes@ notes that this behavior is more befitting of the latter name than > the former, and I'm inclined to agree. > > Reported by: rgrimes > > Modified: > head/stand/lua/config.lua > > Modified: head/stand/lua/config.lua > ============================================================ ================== > --- head/stand/lua/config.lua Sat Feb 17 13:32:29 2018 (r329456) > +++ head/stand/lua/config.lua Sat Feb 17 14:30:39 2018 (r329457) > @@ -37,7 +37,7 @@ function config.setKey(k, n, v) > modules[k][n] = v; > end > > -function config.dumpModules() > +function config.lsModules() > print("== Dumping modules"); ^^^^^^^ I was more after this word :) > for k, v in pairs(modules) do > print(k, v.load); > > (apologies for the broken quoting, no longer near a reasonable mail client) Feel free to change it- I personally believe it's pretty obvious from the context once you see this message that these things are being dumped out to the console. It wasn't necessarily obvious from the name of the function that this was the case. Either way, this is purely a debugging aide while I was trying to figure out why it wasn't loading modules on kernel change. I don't really care much about the output as long as it still tells me just as much as it does now. As an aside, for anyone interested that reads this far, it's still handling module_path wrong but in a more subtle way. Every kernel change prepends the kernel path to module_path, and we keep building on this. Eventually you'd end up with: "/boot/kernel.GENERIC;/boot/kernel;..." So it may fallback to another kernel path for modules that may or may not match the current kernel version. From owner-svn-src-head@freebsd.org Sat Feb 17 15: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 6C04CF163EE for ; Sat, 17 Feb 2018 15:03:25 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x230.google.com (mail-it0-x230.google.com [IPv6:2607:f8b0:4001:c0b::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 D75E08383E for ; Sat, 17 Feb 2018 15:03:24 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x230.google.com with SMTP id v194so4548361itb.0 for ; Sat, 17 Feb 2018 07:03:24 -0800 (PST) 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=BxAZITJeqJHICqdMt4RlDcQvYbYDcVlHyQf5Wvkeczw=; b=jj1mQJBA5Pjt/c6goUwfOe6Yj6oqNBkHDfG808W76u+hqawO4KLewftspO5x9AJ0qp GT+m1vxO0m0DAebXmGi3u4FJrka5f5JcG4eZpBb7ZOqDm2oT25q5RBujTL8xCJEObgFH ag3DZF898TApD8XgsDAzUc6HjCLKY85znyiG7v5Eyc8v1jD/OWTadqfb9Rume5XqsJCP cB70JmSABqRNMmy0NYXdcXOiaEnzaOGY9w8iQCAQx//RdV3haD4Am2vFW0iT8GR9NJB9 1eEsAmm0JzrBXXZ5lJqg1zWvSOJt7DfPU8gxvS58oOqaKbIVtuqohyMmGzi3SawZ0PyN DH7Q== 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=BxAZITJeqJHICqdMt4RlDcQvYbYDcVlHyQf5Wvkeczw=; b=YTsrav+CdBsCM2EqRbUrty6ijNBLik4hB+RF0B0D0mIfq4Jaqa3IIyDB+yDaX1TG1j 9Cu+2b2nVpPpacJBj/GxwXode7PtqJXHax9Yd8bJ+ACeSSeJEKn/xCivYCZCS5YxtnUD UhP+927U2tTFHTrZonk06kitCwsFAr/m2rR8R+oVWl+3kcA15rlnZHUtglsowmOBW464 eM0gm6HYAuWGuucNfyyuMvxLLt75JrCOLYh94Xqm+DZUZoBGI0ck/6CPZ6j2gP3nLaSM SrVYqIYO5DU/wuSi2Www+DvQ1CVLEZTJcsVnWSSGQLYjT8PXg2/PMERujD1eKHFqauLI qzLA== X-Gm-Message-State: APf1xPAS8pTPQxK/QCmQSzJ7NImo+fo8xG7Nb+ONkBxjlyXVf1GTW6zT ry5THuhYjmA8csk8FrHrUky+ITLSUV1WXEnwli5Ucg== X-Google-Smtp-Source: AH8x225EHhM7atIEIfvSNqWtjDj6WQ7/qF72uVn3L9gCaxh01RUJ3JBkGonUDZqzNGfkxfJDsFyg74OafuSZt9YNIQM= X-Received: by 10.36.111.4 with SMTP id x4mr4560122itb.51.1518879804217; Sat, 17 Feb 2018 07:03:24 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Sat, 17 Feb 2018 07:03:23 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: References: <201802171332.w1HDWTBr032549@repo.freebsd.org> From: Warner Losh Date: Sat, 17 Feb 2018 08:03:23 -0700 X-Google-Sender-Auth: 6cibwcfC1xmEf5p6bK5PmkcbtMI Message-ID: Subject: Re: svn commit: r329456 - head/etc/rc.d To: Hans Petter Selasky 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.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 15:03:25 -0000 On Sat, Feb 17, 2018 at 7:56 AM, Hans Petter Selasky wrote: > On 02/17/18 15:51, Warner Losh wrote: > >> It's more the unique part than the sort part since otherwise we try to >> load >> things a large number of times. >> I'd preferred if you'd talked to me about a non-urgent change like this >> (split / and /usr is broken already and there's a few other places that >> are >> also a problem) >> > > This needs to be handled inside devmatch. USB cannot use this sorting at > all. This sorting isn't for USB. This sorting is to uniquify the list of modules. so we don't pass ums.ko multiple times, for example. Warner From owner-svn-src-head@freebsd.org Sat Feb 17 15: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 0F754F1692F; Sat, 17 Feb 2018 15:07:04 +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 A112283ADF; Sat, 17 Feb 2018 15:07:03 +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 B3DDE26027E; Sat, 17 Feb 2018 16:07:01 +0100 (CET) Subject: Re: svn commit: r329458 - head/sbin/devmatch To: Warner Losh Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201802171434.w1HEYl8I063603@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <90001804-e025-4981-6b77-350930310ceb@selasky.org> Date: Sat, 17 Feb 2018 16:04:05 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 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.25 Precedence: list List-Id: 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, 17 Feb 2018 15:07:04 -0000 On 02/17/18 15:56, Warner Losh wrote: > The right fix there, I think, is to load them all at once, in one kldload > operation and not loop in /etc/rc.d/devmatch. Each driver will invoke the driver loaded device method, so this will race aswell! You have a point. But, that means devmatch should read ahead the nomatch events until the end, to make sure the correct driver is loaded. For example if first a driver is loaded for a generic device, uhid, then comes a long a ums device, we have a problem this way. Matching should then understand how to reduce the hints, maybe by stripping down the "mask" from least significant bit. It is then important that the order from devmatch is not messed up by "sort -u". BTW: The "sort" utility lives in usr/bin and is not suitable for /etc/rc.d/devmatch, like already pointed out. --HPS From owner-svn-src-head@freebsd.org Sat Feb 17 15: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 174E0F169FF for ; Sat, 17 Feb 2018 15:07:34 +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 9C09E83C23 for ; Sat, 17 Feb 2018 15:07:33 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x232.google.com with SMTP id o9so929371itc.1 for ; Sat, 17 Feb 2018 07:07:33 -0800 (PST) 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=LMc55vynpfNpP2IZ03Giy9p/nvQTjNytGUd/ZaEoEqw=; b=LLFtguy5mU9HZM55Q5sGt205tcj2yV3gqhAuHG1D2MBK8a+9fjSE1BxQvGry6uVeBP UMwgAeyemzpBn4sGuieVq682L/AaALokKQcDK5NTYQFgv+B1Qx8VJy8THI2Y0RmhP/UC IPv0rdhkjB1z9YyuV2TBfINvuh/au8UfxAa9/tqwX+4d4Q4Dza21lo3DLGgHo3rnBwgK /bWaWQ8KEag3JvuvbHmNzvjq3gXYbA9mLGlYvbnim/OzMARjICyakhP6QT5DT2jn72r1 UkXJlm0bhNjhPVu1R4WwLchBA7Px03quba913uB8398KqLOJ0Cqq9lN3BD951+7NTcui uYbg== 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=LMc55vynpfNpP2IZ03Giy9p/nvQTjNytGUd/ZaEoEqw=; b=sYSuU8TjHhTDe5C5JiKGaLiGt1pEu75Jec17yyuiaJ2qfDboGmnxO9tokIFexu6N9D EHYhFpFM2v4b67QTy3Z9MuIYrnbgIc/zNP/6rt+CqTDF7upAumaf8yfn2/z1Hl5s5SND Uo16Wat3XWkFHaSuRt4au/MdnUDuUftcJO13Kti3GaCHYYEgmuC82k62y90SLtMfopgc adp4/c+c0IN9Mkq40B5EAePY/QKOlcQQss4PI7Dv5eF7m/DBMUtBV9tcfqSZv06rafLZ VazsedyBJ2wLXx1d4VSMefjIltv1gKnPIQ4yS8gD/QRYh7OYt1ZsexUMlVendhDeRMv4 pwFg== X-Gm-Message-State: APf1xPAus7VaEimeEwyJ5HCY5QZQLst1A/s0x8vnzDNViUDPIYyqqfgi 4pVzpAg55LziBqLCTcW0eq89TbKvV71W7g2KFe+Cgg== X-Google-Smtp-Source: AH8x224lM9KpVMHHDudWZ6qwzekaHsDivuhJFusz2SaoEnz+sp9E3WEoRv/geacEaHaxr2fgDgbCIR9xGRyHZKpvrG0= X-Received: by 10.36.55.146 with SMTP id r140mr2101041itr.57.1518880053045; Sat, 17 Feb 2018 07:07:33 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Sat, 17 Feb 2018 07:07:32 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: <5b49c102-ad07-cfdb-2e45-e27cee99ee81@selasky.org> References: <201802171434.w1HEYl8I063603@repo.freebsd.org> <5b49c102-ad07-cfdb-2e45-e27cee99ee81@selasky.org> From: Warner Losh Date: Sat, 17 Feb 2018 08:07:32 -0700 X-Google-Sender-Auth: dbe2BymbcSBsk2bhC3o3wvmXqvQ Message-ID: Subject: Re: svn commit: r329458 - head/sbin/devmatch To: Hans Petter Selasky 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.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 15:07:34 -0000 On Sat, Feb 17, 2018 at 7:58 AM, Hans Petter Selasky wrote: > On 02/17/18 15:56, Warner Losh wrote: > >> I'd request you make no further changes to devmatch without a review. >> > > I don't have a problem with that. > > You can see now what changes are needed. Please make sure you test with > real USB devices! Some people are using FreeBSD-current on desktops, and > the USB auto-load feature has been broken for almost a week now. (a) It's current (b) It took longer to sort out than I'd hoped (c) I tested with a keyboard and mouse on my main server. It was absolutely tested. Snide comments like this aren't helping my already grumpy mood over this. It would be more helpful if you could turn on devd's logging (by adding !devd *.>=info /var/log/devd.log to /etc/syslog.conf, restarting syslog and then giving me the exact scenario that's failing so I can add it to a test suite I'm writing. The data will be in /var/log/devd.log. I can't possibly test all the crazy USB scenarios with the hardware I have (there's too many of them), but I can test it in simulation and make sure we're good. The multiple driver matching thing was never ever mentioned in prior things, so getting snippy with me over it for not testing it is not helpful. Understanding what to look for will be helpful in making sure the test suites catch it and we fix the underlying issues. Warner From owner-svn-src-head@freebsd.org Sat Feb 17 15:12: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 00F76F1725B for ; Sat, 17 Feb 2018 15:12:24 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22a.google.com (mail-io0-x22a.google.com [IPv6:2607:f8b0:4001:c06::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 873A8842CF for ; Sat, 17 Feb 2018 15:12:23 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22a.google.com with SMTP id t22so7110239iob.3 for ; Sat, 17 Feb 2018 07:12:23 -0800 (PST) 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=eL3Kz0HerEfMD5H+It9BSbYYKpI+rbgQl99P8Hr8bqY=; b=pVu4YJas5WrVA4btfTSYgFWt16SZ4x5ECf2YoG3RcJSuzSxXxCr4RFXL73koPFrMcG l5r62y+/5IKb53qJ+gbEaPT5fUGzhXeatW2dtTMhw9QyrU3p39qb0C/tMi0k8T8ZGBHy bGsYqBtZouqDNA0vL7xhczNSFKBfGkTgp3LEM7854Fu3NgUBsvgkHtaeDQcbrK00f1XM xBQNTsbeGrYiHZSf/AIwLydWxmJ//j0Y9kHCLoQ8jD/Xu5jCDcTU7NRoO1qkabEgyHuu FcGvE04sEIbcYaXdVbe4Ro3TDu3AphM9Yi0FzypJkXLHLPF6COzeP4WhefjFAfwCehXP ERJA== 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=eL3Kz0HerEfMD5H+It9BSbYYKpI+rbgQl99P8Hr8bqY=; b=K4nLw7K/+dkzOD5RqBdfuxpgQE8EUgsPjOJv4rO8wak6glr7hn6ODJfGQ26vuOIphZ qzIeJ7EgmAObLlqGFPASRT0GkWNl7Fz39ItD+JVpuER+lCC/w3YUcZ6p5G6CItCgFVCS 1B4hg8fCUG2yn61TW2/UiTSZIPTzMZYRR0IEZHxAoFvYhcp8XJnmC+mT//8mlOI+vwgI mDGepJ5EmbQjm4z4LK8SxQ4gjcIwnZEa4MbC6nKndZn4y3vZKYmaSN3ZcOWppB5aaGSC 5X3jwW6gTIJF72oQjGpy4UoxiHwRMYaObhdi2EMiEJjc5OW9dRR3COM6Xj2z7LW6FHCL Ajig== X-Gm-Message-State: APf1xPBPjF4yuebhEhK/ioWjTNV8HuTELg69WC5dfWTH9ZR3Ezw6oADb wiGl3ylTuxS1mhyBq497wi5UGxSR2Yrej/1z56DwuQ== X-Google-Smtp-Source: AH8x224qZMWytFLCXMV823xwEgYETVfx83SKh3fYqPw7rpDVG0Bl2B5CTWCjntond0rWmR0nSnMFGDNq5VAMc5P2Ma4= X-Received: by 10.107.2.6 with SMTP id 6mr12683267ioc.117.1518880342865; Sat, 17 Feb 2018 07:12:22 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Sat, 17 Feb 2018 07:12:22 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: <90001804-e025-4981-6b77-350930310ceb@selasky.org> References: <201802171434.w1HEYl8I063603@repo.freebsd.org> <90001804-e025-4981-6b77-350930310ceb@selasky.org> From: Warner Losh Date: Sat, 17 Feb 2018 08:12:22 -0700 X-Google-Sender-Auth: qdT5KU7L_ZNyhFULPFKW_XN4spg Message-ID: Subject: Re: svn commit: r329458 - head/sbin/devmatch To: Hans Petter Selasky 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.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 15:12:24 -0000 On Sat, Feb 17, 2018 at 8:04 AM, Hans Petter Selasky wrote: > On 02/17/18 15:56, Warner Losh wrote: > >> The right fix there, I think, is to load them all at once, in one kldload >> operation and not loop in /etc/rc.d/devmatch. >> > > Each driver will invoke the driver loaded device method, so this will race > aswell! > > You have a point. But, that means devmatch should read ahead the nomatch > events until the end, to make sure the correct driver is loaded. > We could batch them in the kernel. But that's still unsatisfying since there could still be other races because multiple drivers wanting the same device is well defined only when all the drivers are there at probe/attach time. > For example if first a driver is loaded for a generic device, uhid, then > comes a long a ums device, we have a problem this way. > That makes sense. We likely need to enhance our device model to cope with drivers arriving after a device is attached so this isn't racy. Matching should then understand how to reduce the hints, maybe by stripping > down the "mask" from least significant bit. > > It is then important that the order from devmatch is not messed up by > "sort -u". > No, devmatch is necessarily unordered. We can't reliably use the match like you say. It simply will not work. devmatch has no way of knowing (the mask isn't a viable way) who will win. There must be some other method invented. > BTW: The "sort" utility lives in usr/bin and is not suitable for > /etc/rc.d/devmatch, like already pointed out. Yes. I know that. Continuing to belabor the obvious won't help make me less grumpy. Warner From owner-svn-src-head@freebsd.org Sat Feb 17 15:19: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 7158DF17DEC; Sat, 17 Feb 2018 15:19:58 +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 13E5E849E7; Sat, 17 Feb 2018 15:19:58 +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 0067326027E; Sat, 17 Feb 2018 16:19:56 +0100 (CET) Subject: Re: svn commit: r329458 - head/sbin/devmatch To: Warner Losh Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201802171434.w1HEYl8I063603@repo.freebsd.org> <5b49c102-ad07-cfdb-2e45-e27cee99ee81@selasky.org> From: Hans Petter Selasky Message-ID: Date: Sat, 17 Feb 2018 16:17:00 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 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.25 Precedence: list List-Id: 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, 17 Feb 2018 15:19:58 -0000 On 02/17/18 16:07, Warner Losh wrote: > It would be more helpful if you could turn on devd's logging (by adding > !devd > *.>=info /var/log/devd.log > to /etc/syslog.conf, restarting syslog and then giving me the exact > scenario that's failing so I can add it to a test suite I'm writing. The > data will be in /var/log/devd.log. I can't possibly test all the crazy USB > scenarios with the hardware I have (there's too many of them), but I can > test it in simulation and make sure we're good. It wasn't a problem with devd. It was a problem with /etc/rc.d/devmatch . In your initial devmatch rc.d, look at this: one_nomatch="-p '$2'" devmatch ${one_nomatch} Try this (your initial devmatch): #!/bin/sh test='? at bus=0 hubaddr=1 port=6 devaddr=8 interface=1 ugen=ugen0.8 vendor=0x8087 product=0x0a2b devclass=0xe0 devsubclass=0x01 devproto=0x01 release=0x0001 mode=host intclass=0xe0 intsubclass=0x01 intprotocol=0x01 on uhub0' one_nomatch="-p '$test'" devmatch ${one_nomatch} I fixed it to this, which works: #!/bin/sh test='? at bus=0 hubaddr=1 port=6 devaddr=8 interface=1 ugen=ugen0.8 vendor=0x8087 product=0x0a2b devclass=0xe0 devsubclass=0x01 devproto=0x01 release=0x0001 mode=host intclass=0xe0 intsubclass=0x01 intprotocol=0x01 on uhub0' one_nomatch="$test" devmatch -p "${one_nomatch}" Because the $2 variable already contains ''s from devd, the variable expansion then makes devmatch receive the whole devd generated variable list like a separate arguments. Which leads me to believe you are not using /bin/sh or you tested something different than was committed ?? --HPS From owner-svn-src-head@freebsd.org Sat Feb 17 15:24: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 7DD94F1855B; Sat, 17 Feb 2018 15:24:29 +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 1DA6C84FDC; Sat, 17 Feb 2018 15:24:29 +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 E943426027E; Sat, 17 Feb 2018 16:24:27 +0100 (CET) Subject: Re: svn commit: r329458 - head/sbin/devmatch To: Warner Losh Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201802171434.w1HEYl8I063603@repo.freebsd.org> <90001804-e025-4981-6b77-350930310ceb@selasky.org> From: Hans Petter Selasky Message-ID: <099dcc61-e018-54b2-cd52-074a2c74e5c1@selasky.org> Date: Sat, 17 Feb 2018 16:21:31 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 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.25 Precedence: list List-Id: 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, 17 Feb 2018 15:24:29 -0000 On 02/17/18 16:12, Warner Losh wrote: > Yes. I know that. Continuing to belabor the obvious won't help make me less > grumpy. I'm sorry about that. Implementing a generic solution to match drivers and devices seems more complicated than at first thought :-) OK, I will say away from *devmatch* and discuss with you first. --HPS From owner-svn-src-head@freebsd.org Sat Feb 17 16:07: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 6AE4BF1BF78; Sat, 17 Feb 2018 16:07:08 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qk0-x235.google.com (mail-qk0-x235.google.com [IPv6:2607:f8b0:400d:c09::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 045E087075; Sat, 17 Feb 2018 16:07:08 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qk0-x235.google.com with SMTP id s198so7482909qke.5; Sat, 17 Feb 2018 08:07:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=8myZr/uqljKLWmMNym+YWvpvLj1ff3EOYXzQLOs3wyo=; b=RMirQ4r7W+Q5Zma6jeDnbH0c2MBUm/S5oQKYsE0cj6H6Swcf1aWpqzqLiWiINKJ2ir UFsdrg6OkijUaVejcaahqZ5jpdrQpInjC2y3qfDfRzPSv7NIXodpQXcpyQkIDvwTz/WZ xX6XhhqGJxwCFeqE9oYde0iVCjFrGYZAfVX698AM7AanhfH68UUAyLN/ZHUj7npM8ZCp 9FCbA5x9DL9EdKR/Vyysda1SgCdqlAW27yd5UlYOESgomjj6hPn942JVMw+KPmiKlj3D DbmAD9JMN5/IPdKLsm52sqLHZR9uqJPtDbx5s0arhGDuvdDkKWzak1VdRZ29ZNaOHDq2 7/FA== 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=8myZr/uqljKLWmMNym+YWvpvLj1ff3EOYXzQLOs3wyo=; b=MgEOCPaaoENYr6JvTxIu2TW6co4b8CsgY6yk3FI0IVZR8hYKV8AnT/c0a/5X06URTH ocV2QX22hCuMqFB6tdhi0JM0VMkdKHDsJTan18+829Dfqh46Lf+wU7C7XgeBrRLB/FdB VNimOpwc5am78r+DAmZkbC8kTIMz2CoxoL9ozNUH2jaSYmPcwXo0r6qisxuhaJxdd6En DpD5/0+mai7IJTHGhBesuovmhl5jeE0sHWXz0JEVqUDkUYQmDdmHPSCrOVsqpYbY5WE1 aHo4o7RUZvD+Vo7nXye5uhLih/KL0kez61AYrjJFHfF3YHIOml0QXSX2h70jFTWQYyzL Vd0g== X-Gm-Message-State: APf1xPCOf3SXNenMTdTEo9c/o0NriljRtkXollahn8C3RfkH1W77/man SByOCqzOmxIdS2SELX/gVzN7Wil3G0WhFEHlPwrNPA== X-Google-Smtp-Source: AH8x225G34vMYbt0DgWgvukbr1M3Sa54Yi1C8495DmUFWm/BdYigTy/I+I2P+fT+AziA0LvFbS4SSm0pNjuvFwsMCJk= X-Received: by 10.55.22.144 with SMTP id 16mr14774785qkw.11.1518883627554; Sat, 17 Feb 2018 08:07:07 -0800 (PST) MIME-Version: 1.0 Received: by 10.237.58.99 with HTTP; Sat, 17 Feb 2018 08:07:07 -0800 (PST) In-Reply-To: <20180217112738.GO94212@kib.kiev.ua> References: <201802170848.w1H8mkfb081764@repo.freebsd.org> <20180217112738.GO94212@kib.kiev.ua> From: Mateusz Guzik Date: Sat, 17 Feb 2018 17:07:07 +0100 Message-ID: Subject: Re: svn commit: r329448 - head/sys/kern To: Konstantin Belousov Cc: Mateusz Guzik , 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.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 16:07:08 -0000 On Sat, Feb 17, 2018 at 01:27:38PM +0200, Konstantin Belousov wrote: > On Sat, Feb 17, 2018 at 08:48:46AM +0000, Mateusz Guzik wrote: > > Author: mjg > > Date: Sat Feb 17 08:48:45 2018 > > New Revision: 329448 > > URL: https://svnweb.freebsd.org/changeset/base/329448 > > > > Log: > > exit: get rid of PROC_SLOCK when checking a process to report > Was this tested ? > I was trussing multithreaded microbenchmarks, no issues. > In particular, are you aware of r309539 ? > So it looks like I misread the code - I have grepped thread_suspend_switch operating with the proc locked and misread thread_suspend_one's assert as PROC_LOCK_ASSERT. That said, I think this is harmless. Regardless of the lock the inspecting thread can race and check "too soon". Even for a case where it decides to report, I don't see anything which would depend on the suspending thread to finish. However, locking can be employed in a way which is avoided in the common case: diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index b063bda5b7ff..4ae24bcd7059 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -1174,6 +1174,7 @@ kern_wait6(struct thread *td, idtype_t idtype, id_t id, int *status, struct proc *p, *q; pid_t pid; int error, nfound, ret; + bool report; AUDIT_ARG_VALUE((int)idtype); /* XXX - This is likely wrong! */ AUDIT_ARG_PID((pid_t)id); /* XXX - This may be wrong! */ @@ -1226,27 +1227,36 @@ kern_wait6(struct thread *td, idtype_t idtype, id_t id, int *status, PROC_LOCK_ASSERT(p, MA_OWNED); if ((options & WTRAPPED) != 0 && - (p->p_flag & P_TRACED) != 0 && - (p->p_flag & (P_STOPPED_TRACE | P_STOPPED_SIG)) != 0 && - p->p_suspcount == p->p_numthreads && - (p->p_flag & P_WAITED) == 0) { + (p->p_flag & P_TRACED) != 0) { + PROC_SLOCK(p); + report = + ((p->p_flag & (P_STOPPED_TRACE | P_STOPPED_SIG)) && + p->p_suspcount == p->p_numthreads && + (p->p_flag & P_WAITED) == 0); + PROC_SUNLOCK(p); + if (report) { CTR4(KTR_PTRACE, "wait: returning trapped pid %d status %#x " "(xstat %d) xthread %d", p->p_pid, W_STOPCODE(p->p_xsig), p->p_xsig, p->p_xthread != NULL ? p->p_xthread->td_tid : -1); - report_alive_proc(td, p, siginfo, status, options, - CLD_TRAPPED); - return (0); + report_alive_proc(td, p, siginfo, status, + options, CLD_TRAPPED); + return (0); + } } if ((options & WUNTRACED) != 0 && - (p->p_flag & P_STOPPED_SIG) != 0 && - p->p_suspcount == p->p_numthreads && - (p->p_flag & P_WAITED) == 0) { - report_alive_proc(td, p, siginfo, status, options, + report_alive_proc(td, p, siginfo, status, + options, CLD_TRAPPED); + return (0); + } } if ((options & WUNTRACED) != 0 && - (p->p_flag & P_STOPPED_SIG) != 0 && - p->p_suspcount == p->p_numthreads && - (p->p_flag & P_WAITED) == 0) { - report_alive_proc(td, p, siginfo, status, options, - CLD_STOPPED); - return (0); + (p->p_flag & P_STOPPED_SIG) != 0) { + PROC_SLOCK(p); + report = (p->p_suspcount == p->p_numthreads && + ((p->p_flag & P_WAITED) == 0)); + PROC_SUNLOCK(p); + if (report) { + report_alive_proc(td, p, siginfo, status, + options, CLD_STOPPED); + return (0); + } } if ((options & WCONTINUED) != 0 && (p->p_flag & P_CONTINUED) != 0) { On Sat, Feb 17, 2018 at 12:27 PM, Konstantin Belousov wrote: > On Sat, Feb 17, 2018 at 08:48:46AM +0000, Mateusz Guzik wrote: > > Author: mjg > > Date: Sat Feb 17 08:48:45 2018 > > New Revision: 329448 > > URL: https://svnweb.freebsd.org/changeset/base/329448 > > > > Log: > > exit: get rid of PROC_SLOCK when checking a process to report > Was this tested ? > > In particular, are you aware of r309539 ? > > > > > All accessed fields are protected with already held process lock. > > > > Modified: > > head/sys/kern/kern_exit.c > > > > Modified: head/sys/kern/kern_exit.c > > ============================================================ > ================== > > --- head/sys/kern/kern_exit.c Sat Feb 17 08:12:35 2018 (r329447) > > +++ head/sys/kern/kern_exit.c Sat Feb 17 08:48:45 2018 (r329448) > > @@ -1228,15 +1228,11 @@ loop_locked: > > nfound++; > > PROC_LOCK_ASSERT(p, MA_OWNED); > > > > - if ((options & (WTRAPPED | WUNTRACED)) != 0) > > - PROC_SLOCK(p); > > - > > if ((options & WTRAPPED) != 0 && > > (p->p_flag & P_TRACED) != 0 && > > (p->p_flag & (P_STOPPED_TRACE | P_STOPPED_SIG)) != 0 && > > p->p_suspcount == p->p_numthreads && > > (p->p_flag & P_WAITED) == 0) { > > - PROC_SUNLOCK(p); > > CTR4(KTR_PTRACE, > > "wait: returning trapped pid %d status %#x " > > "(xstat %d) xthread %d", > > @@ -1251,13 +1247,10 @@ loop_locked: > > (p->p_flag & P_STOPPED_SIG) != 0 && > > p->p_suspcount == p->p_numthreads && > > (p->p_flag & P_WAITED) == 0) { > > - PROC_SUNLOCK(p); > > report_alive_proc(td, p, siginfo, status, options, > > CLD_STOPPED); > > return (0); > > } > > - if ((options & (WTRAPPED | WUNTRACED)) != 0) > > - PROC_SUNLOCK(p); > > if ((options & WCONTINUED) != 0 && > > (p->p_flag & P_CONTINUED) != 0) { > > report_alive_proc(td, p, siginfo, status, options, > -- Mateusz Guzik From owner-svn-src-head@freebsd.org Sat Feb 17 16:26: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 C7360F1D77F; Sat, 17 Feb 2018 16:26:44 +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 51AAA87CE3; Sat, 17 Feb 2018 16:26:44 +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 ESMTPS id w1HGQWZx063679 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 17 Feb 2018 18:26:35 +0200 (EET) (envelope-from kib@freebsd.org) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w1HGQWZx063679 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w1HGQW2f063678; Sat, 17 Feb 2018 18:26:32 +0200 (EET) (envelope-from kib@freebsd.org) X-Authentication-Warning: tom.home: kostik set sender to kib@freebsd.org using -f Date: Sat, 17 Feb 2018 18:26:32 +0200 From: Konstantin Belousov To: Mateusz Guzik , peter@holm.cc Cc: Mateusz Guzik , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329448 - head/sys/kern Message-ID: <20180217162632.GQ94212@kib.kiev.ua> References: <201802170848.w1H8mkfb081764@repo.freebsd.org> <20180217112738.GO94212@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.3 (2018-01-21) 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.25 Precedence: list List-Id: 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, 17 Feb 2018 16:26:45 -0000 On Sat, Feb 17, 2018 at 05:07:07PM +0100, Mateusz Guzik wrote: > On Sat, Feb 17, 2018 at 01:27:38PM +0200, Konstantin Belousov wrote: > > On Sat, Feb 17, 2018 at 08:48:46AM +0000, Mateusz Guzik wrote: > > > Author: mjg > > > Date: Sat Feb 17 08:48:45 2018 > > > New Revision: 329448 > > > URL: https://svnweb.freebsd.org/changeset/base/329448 > > > > > > Log: > > > exit: get rid of PROC_SLOCK when checking a process to report > > Was this tested ? > > > > I was trussing multithreaded microbenchmarks, no issues. > > > In particular, are you aware of r309539 ? > > > > So it looks like I misread the code - I have grepped > thread_suspend_switch operating with the proc locked and misread > thread_suspend_one's assert as PROC_LOCK_ASSERT. > > That said, I think this is harmless. Regardless of the lock the > inspecting thread can race and check "too soon". Even for a case where > it decides to report, I don't see anything which would depend on the > suspending thread to finish. It was definitely not harmless when I tried to avoid the spin lock there, but I do not remember exact failure mode. Most likely, it was a missed report of the traced child indeed, but I am not sure that truss triggered it. Most likely, Peter Holm was the reporter, since he is listed in the commit. > > However, locking can be employed in a way which is avoided in the common > case: > > diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c > index b063bda5b7ff..4ae24bcd7059 100644 > --- a/sys/kern/kern_exit.c > +++ b/sys/kern/kern_exit.c > @@ -1174,6 +1174,7 @@ kern_wait6(struct thread *td, idtype_t idtype, id_t > id, int *status, > struct proc *p, *q; > pid_t pid; > int error, nfound, ret; > + bool report; > > AUDIT_ARG_VALUE((int)idtype); /* XXX - This is likely wrong! */ > AUDIT_ARG_PID((pid_t)id); /* XXX - This may be wrong! */ > @@ -1226,27 +1227,36 @@ kern_wait6(struct thread *td, idtype_t idtype, id_t > id, int *status, > PROC_LOCK_ASSERT(p, MA_OWNED); > > if ((options & WTRAPPED) != 0 && > - (p->p_flag & P_TRACED) != 0 && > - (p->p_flag & (P_STOPPED_TRACE | P_STOPPED_SIG)) != 0 && > - p->p_suspcount == p->p_numthreads && > - (p->p_flag & P_WAITED) == 0) { > + (p->p_flag & P_TRACED) != 0) { > + PROC_SLOCK(p); > + report = > + ((p->p_flag & (P_STOPPED_TRACE | > P_STOPPED_SIG)) && > + p->p_suspcount == p->p_numthreads && > + (p->p_flag & P_WAITED) == 0); > + PROC_SUNLOCK(p); > + if (report) { > CTR4(KTR_PTRACE, > "wait: returning trapped pid %d status %#x " > "(xstat %d) xthread %d", > p->p_pid, W_STOPCODE(p->p_xsig), p->p_xsig, > p->p_xthread != NULL ? > p->p_xthread->td_tid : -1); > - report_alive_proc(td, p, siginfo, status, options, > - CLD_TRAPPED); > - return (0); > + report_alive_proc(td, p, siginfo, status, > + options, CLD_TRAPPED); > + return (0); > + } > } > if ((options & WUNTRACED) != 0 && > - (p->p_flag & P_STOPPED_SIG) != 0 && > - p->p_suspcount == p->p_numthreads && > - (p->p_flag & P_WAITED) == 0) { > - report_alive_proc(td, p, siginfo, status, options, > + report_alive_proc(td, p, siginfo, status, > + options, CLD_TRAPPED); > + return (0); > + } > } > if ((options & WUNTRACED) != 0 && > - (p->p_flag & P_STOPPED_SIG) != 0 && > - p->p_suspcount == p->p_numthreads && > - (p->p_flag & P_WAITED) == 0) { > - report_alive_proc(td, p, siginfo, status, options, > - CLD_STOPPED); > - return (0); > + (p->p_flag & P_STOPPED_SIG) != 0) { > + PROC_SLOCK(p); > + report = (p->p_suspcount == p->p_numthreads && > + ((p->p_flag & P_WAITED) == 0)); > + PROC_SUNLOCK(p); > + if (report) { > + report_alive_proc(td, p, siginfo, status, > + options, CLD_STOPPED); > + return (0); > + } > } > if ((options & WCONTINUED) != 0 && > (p->p_flag & P_CONTINUED) != 0) { > If this works, I am fine with the patch. Still, I would prefer to have the original commit reverted for now, until the fix is tested. Then, commit updated patch. From owner-svn-src-head@freebsd.org Sat Feb 17 16:38: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 2DAF8F1E680; Sat, 17 Feb 2018 16:38:33 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay01.pair.com (relay01.pair.com [209.68.5.15]) (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 CFA5688491; Sat, 17 Feb 2018 16:38:32 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x2.osted.lan (87-58-223-204-dynamic.dk.customer.tdc.net [87.58.223.204]) by relay01.pair.com (Postfix) with ESMTP id 75228D00377; Sat, 17 Feb 2018 11:38:25 -0500 (EST) Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.14.9/8.14.9) with ESMTP id w1HGcM9h081691 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 17 Feb 2018 17:38:23 +0100 (CET) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.14.9/8.14.9/Submit) id w1HGcMx3081690; Sat, 17 Feb 2018 17:38:22 +0100 (CET) (envelope-from pho) Date: Sat, 17 Feb 2018 17:38:22 +0100 From: Peter Holm To: Konstantin Belousov Cc: Mateusz Guzik , Mateusz Guzik , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329448 - head/sys/kern Message-ID: <20180217163822.GA81555@x2.osted.lan> References: <201802170848.w1H8mkfb081764@repo.freebsd.org> <20180217112738.GO94212@kib.kiev.ua> <20180217162632.GQ94212@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180217162632.GQ94212@kib.kiev.ua> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 16:38:33 -0000 On Sat, Feb 17, 2018 at 06:26:32PM +0200, Konstantin Belousov wrote: > On Sat, Feb 17, 2018 at 05:07:07PM +0100, Mateusz Guzik wrote: > > On Sat, Feb 17, 2018 at 01:27:38PM +0200, Konstantin Belousov wrote: > > > On Sat, Feb 17, 2018 at 08:48:46AM +0000, Mateusz Guzik wrote: > > > > Author: mjg > > > > Date: Sat Feb 17 08:48:45 2018 > > > > New Revision: 329448 > > > > URL: https://svnweb.freebsd.org/changeset/base/329448 > > > > > > > > Log: > > > > exit: get rid of PROC_SLOCK when checking a process to report > > > Was this tested ? > > > > > > > I was trussing multithreaded microbenchmarks, no issues. > > > > > In particular, are you aware of r309539 ? > > > > > > > So it looks like I misread the code - I have grepped > > thread_suspend_switch operating with the proc locked and misread > > thread_suspend_one's assert as PROC_LOCK_ASSERT. > > > > That said, I think this is harmless. Regardless of the lock the > > inspecting thread can race and check "too soon". Even for a case where > > it decides to report, I don't see anything which would depend on the > > suspending thread to finish. > It was definitely not harmless when I tried to avoid the spin lock there, > but I do not remember exact failure mode. Most likely, it was a missed > report of the traced child indeed, but I am not sure that truss triggered > it. Most likely, Peter Holm was the reporter, since he is listed in > the commit. > I ran a truss(1) test on r329456 and it fails. I have not had a chance to look closer at this, but this is what I see: [root@mercat1 /home/pho]# pgrep truss | xargs ps -Hlp UID PID PPID CPU PRI NI VSZ RSS MWCHAN STAT TT TIME COMMAND 0 41149 41118 0 52 0 11532 2588 wait I 0 0:01.38 truss /tmp/ttruss 10 0 41151 41149 0 52 0 13156 2300 - TX 0 0:00.98 /tmp/ttruss 10 0 41151 41149 0 52 0 13156 2300 - TX 0 0:00.00 /tmp/ttruss 10 [root@mercat1 /home/pho]# procstat -k 41151 PID TID COMM TDNAME KSTACK 41151 100211 ttruss - mi_switch thread_suspend_switch ptracestop amd64_syscall fast_syscall_common 41151 100765 ttruss - mi_switch thread_suspend_check ast doreti_ast [root@mercat1 /home/pho]# > > > > However, locking can be employed in a way which is avoided in the common > > case: > > > > diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c > > index b063bda5b7ff..4ae24bcd7059 100644 > > --- a/sys/kern/kern_exit.c > > +++ b/sys/kern/kern_exit.c > > @@ -1174,6 +1174,7 @@ kern_wait6(struct thread *td, idtype_t idtype, id_t > > id, int *status, > > struct proc *p, *q; > > pid_t pid; > > int error, nfound, ret; > > + bool report; > > > > AUDIT_ARG_VALUE((int)idtype); /* XXX - This is likely wrong! */ > > AUDIT_ARG_PID((pid_t)id); /* XXX - This may be wrong! */ > > @@ -1226,27 +1227,36 @@ kern_wait6(struct thread *td, idtype_t idtype, id_t > > id, int *status, > > PROC_LOCK_ASSERT(p, MA_OWNED); > > > > if ((options & WTRAPPED) != 0 && > > - (p->p_flag & P_TRACED) != 0 && > > - (p->p_flag & (P_STOPPED_TRACE | P_STOPPED_SIG)) != 0 && > > - p->p_suspcount == p->p_numthreads && > > - (p->p_flag & P_WAITED) == 0) { > > + (p->p_flag & P_TRACED) != 0) { > > + PROC_SLOCK(p); > > + report = > > + ((p->p_flag & (P_STOPPED_TRACE | > > P_STOPPED_SIG)) && > > + p->p_suspcount == p->p_numthreads && > > + (p->p_flag & P_WAITED) == 0); > > + PROC_SUNLOCK(p); > > + if (report) { > > CTR4(KTR_PTRACE, > > "wait: returning trapped pid %d status %#x " > > "(xstat %d) xthread %d", > > p->p_pid, W_STOPCODE(p->p_xsig), p->p_xsig, > > p->p_xthread != NULL ? > > p->p_xthread->td_tid : -1); > > - report_alive_proc(td, p, siginfo, status, options, > > - CLD_TRAPPED); > > - return (0); > > + report_alive_proc(td, p, siginfo, status, > > + options, CLD_TRAPPED); > > + return (0); > > + } > > } > > if ((options & WUNTRACED) != 0 && > > - (p->p_flag & P_STOPPED_SIG) != 0 && > > - p->p_suspcount == p->p_numthreads && > > - (p->p_flag & P_WAITED) == 0) { > > - report_alive_proc(td, p, siginfo, status, options, > > + report_alive_proc(td, p, siginfo, status, > > + options, CLD_TRAPPED); > > + return (0); > > + } > > } > > if ((options & WUNTRACED) != 0 && > > - (p->p_flag & P_STOPPED_SIG) != 0 && > > - p->p_suspcount == p->p_numthreads && > > - (p->p_flag & P_WAITED) == 0) { > > - report_alive_proc(td, p, siginfo, status, options, > > - CLD_STOPPED); > > - return (0); > > + (p->p_flag & P_STOPPED_SIG) != 0) { > > + PROC_SLOCK(p); > > + report = (p->p_suspcount == p->p_numthreads && > > + ((p->p_flag & P_WAITED) == 0)); > > + PROC_SUNLOCK(p); > > + if (report) { > > + report_alive_proc(td, p, siginfo, status, > > + options, CLD_STOPPED); > > + return (0); > > + } > > } > > if ((options & WCONTINUED) != 0 && > > (p->p_flag & P_CONTINUED) != 0) { > > > If this works, I am fine with the patch. Still, I would prefer to have > the original commit reverted for now, until the fix is tested. Then, > commit updated patch. -- Peter From owner-svn-src-head@freebsd.org Sat Feb 17 17:23: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 EEC5AF21D87; Sat, 17 Feb 2018 17:23:43 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A2E3B8A399; Sat, 17 Feb 2018 17:23:43 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9DD2B1FB8A; Sat, 17 Feb 2018 17:23:43 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1HHNhwh048329; Sat, 17 Feb 2018 17:23:43 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HHNhHV048328; Sat, 17 Feb 2018 17:23:43 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201802171723.w1HHNhHV048328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 17 Feb 2018 17:23:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329461 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 329461 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 17:23:44 -0000 Author: mjg Date: Sat Feb 17 17:23:43 2018 New Revision: 329461 URL: https://svnweb.freebsd.org/changeset/base/329461 Log: Revert r329448. Turns out is is actually racy, reproducible with stress2/misc/truss.sh Requested by: kib Modified: head/sys/kern/kern_exit.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Sat Feb 17 14:44:03 2018 (r329460) +++ head/sys/kern/kern_exit.c Sat Feb 17 17:23:43 2018 (r329461) @@ -1225,11 +1225,15 @@ loop_locked: nfound++; PROC_LOCK_ASSERT(p, MA_OWNED); + if ((options & (WTRAPPED | WUNTRACED)) != 0) + PROC_SLOCK(p); + if ((options & WTRAPPED) != 0 && (p->p_flag & P_TRACED) != 0 && (p->p_flag & (P_STOPPED_TRACE | P_STOPPED_SIG)) != 0 && p->p_suspcount == p->p_numthreads && (p->p_flag & P_WAITED) == 0) { + PROC_SUNLOCK(p); CTR4(KTR_PTRACE, "wait: returning trapped pid %d status %#x " "(xstat %d) xthread %d", @@ -1244,10 +1248,13 @@ loop_locked: (p->p_flag & P_STOPPED_SIG) != 0 && p->p_suspcount == p->p_numthreads && (p->p_flag & P_WAITED) == 0) { + PROC_SUNLOCK(p); report_alive_proc(td, p, siginfo, status, options, CLD_STOPPED); return (0); } + if ((options & (WTRAPPED | WUNTRACED)) != 0) + PROC_SUNLOCK(p); if ((options & WCONTINUED) != 0 && (p->p_flag & P_CONTINUED) != 0) { report_alive_proc(td, p, siginfo, status, options, From owner-svn-src-head@freebsd.org Sat Feb 17 17: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 C5AEAF228D5; Sat, 17 Feb 2018 17:34:35 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qt0-x244.google.com (mail-qt0-x244.google.com [IPv6:2607:f8b0:400d:c0d::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 660978AABE; Sat, 17 Feb 2018 17:34:35 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qt0-x244.google.com with SMTP id f4so7606613qtj.6; Sat, 17 Feb 2018 09:34:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=SNk8loT5L613jMSozrtvnPdxxFvqJv1Z/FIBCsfWf8A=; b=IO2tu6sg7Yqi0JS4W8N+nsnGVHkdI0PHL7WWEMUuSJUVAFaPUwSI8Rcx+pozFofh3H tHBg6d3MMzy6CCatUijxUk2RghOt8akclnFFMv5frd3uMR/YWAPRxzVyq7eOMjq/sPj8 dIXcTGklm86p+ZlUEcjmj3+KZ9SHlywYC5b8YjATKLX07X2ZC8V94FZRNSfI4ossb7EZ q9O1m7V+7DoUHnrq49pwsGSaG7cniY3xOlrFTQpJQ97zfz1G/TAYEspm/3fnp0R+2NRM sL5ATV5Lv9f9+loH+LVA0TwERQsHTkc5il5o18vY696n87nCXLMUffe4viOdfkEoCslN 3xVg== 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=SNk8loT5L613jMSozrtvnPdxxFvqJv1Z/FIBCsfWf8A=; b=UAgoyT/sn3bdvLmd1Xj94BF3bColgKNikW4LIy1FNqWYHqpEPVsCXGA/tOdHyhTZ7q DgWzdOJQmReqmAO2y03dy123pxpqqD3fKn4I28un/knqtVBICcC7pK2FBY3rHbSZmUgB zchViRXJ6DeHR1u3JdV3nMjmTkj1n8M2lNDwzIuDk+xUgf+XrslimFWAdLxKc6k4zJRR eKFOzHmao0+XMrJ5X3lUjttUIdXkOaeLsBjfxrQdFdPfFxLsL90RSe2RwqmFXKN3zCHE CdMBrvgylaohWCgPyrhu+yoNbzp5ELu7Lt9vW5yOJpuPIC/lTN0stSWk4P6OrW7dtmXT wtjw== X-Gm-Message-State: APf1xPB/u+jLLmjFywNUO3ffCSJtvouZFKsXyImfcFZnxEAX6HRwtSk6 skarda+OyPVMEg2YDUUSCo1AZaaHMRPQtwjN/+ErQA== X-Google-Smtp-Source: AH8x224YYYcaYzeLHLuQvQVesAu8zrUj5V5bTE1+gIPkBZ7VHUH0Xr1d0skEzuDkqM9+H9B7XtmGcpzsmVhdeoV5uNE= X-Received: by 10.200.48.13 with SMTP id f13mr16239329qte.140.1518888874940; Sat, 17 Feb 2018 09:34:34 -0800 (PST) MIME-Version: 1.0 Received: by 10.237.58.99 with HTTP; Sat, 17 Feb 2018 09:34:34 -0800 (PST) In-Reply-To: <20180217163822.GA81555@x2.osted.lan> References: <201802170848.w1H8mkfb081764@repo.freebsd.org> <20180217112738.GO94212@kib.kiev.ua> <20180217162632.GQ94212@kib.kiev.ua> <20180217163822.GA81555@x2.osted.lan> From: Mateusz Guzik Date: Sat, 17 Feb 2018 18:34:34 +0100 Message-ID: Subject: Re: svn commit: r329448 - head/sys/kern To: Peter Holm Cc: Konstantin Belousov , Mateusz Guzik , 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.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 17:34:36 -0000 On Sat, Feb 17, 2018 at 5:38 PM, Peter Holm wrote: > On Sat, Feb 17, 2018 at 06:26:32PM +0200, Konstantin Belousov wrote: > > On Sat, Feb 17, 2018 at 05:07:07PM +0100, Mateusz Guzik wrote: > > > On Sat, Feb 17, 2018 at 01:27:38PM +0200, Konstantin Belousov wrote: > > > > On Sat, Feb 17, 2018 at 08:48:46AM +0000, Mateusz Guzik wrote: > > > > > Author: mjg > > > > > Date: Sat Feb 17 08:48:45 2018 > > > > > New Revision: 329448 > > > > > URL: https://svnweb.freebsd.org/changeset/base/329448 > > > > > > > > > > Log: > > > > > exit: get rid of PROC_SLOCK when checking a process to report > > > > Was this tested ? > > > > > > > > > > I was trussing multithreaded microbenchmarks, no issues. > > > > > > > In particular, are you aware of r309539 ? > > > > > > > > > > So it looks like I misread the code - I have grepped > > > thread_suspend_switch operating with the proc locked and misread > > > thread_suspend_one's assert as PROC_LOCK_ASSERT. > > > > > > That said, I think this is harmless. Regardless of the lock the > > > inspecting thread can race and check "too soon". Even for a case where > > > it decides to report, I don't see anything which would depend on the > > > suspending thread to finish. > > It was definitely not harmless when I tried to avoid the spin lock there, > > but I do not remember exact failure mode. Most likely, it was a missed > > report of the traced child indeed, but I am not sure that truss triggered > > it. Most likely, Peter Holm was the reporter, since he is listed in > > the commit. > > > > I ran a truss(1) test on r329456 and it fails. I have not had a > chance to look closer at this, but this is what I see: > > [root@mercat1 /home/pho]# pgrep truss | xargs ps -Hlp > UID PID PPID CPU PRI NI VSZ RSS MWCHAN STAT TT TIME COMMAND > 0 41149 41118 0 52 0 11532 2588 wait I 0 0:01.38 truss > /tmp/ttruss 10 > 0 41151 41149 0 52 0 13156 2300 - TX 0 0:00.98 /tmp/ttruss > 10 > 0 41151 41149 0 52 0 13156 2300 - TX 0 0:00.00 /tmp/ttruss > 10 > [root@mercat1 /home/pho]# procstat -k 41151 > PID TID COMM TDNAME KSTACK > 41151 100211 ttruss - mi_switch > thread_suspend_switch ptracestop amd64_syscall fast_syscall_common > 41151 100765 ttruss - mi_switch > thread_suspend_check ast doreti_ast > [root@mercat1 /home/pho]# > > Ok, I reproduced the bug with your script. I reverted the change. The patch I mailed in this thread fixes it for me. Below is a variant which can be applied on top of fresh head: https://people.freebsd.org/~mjg/wait6_slock.diff Now that the bug got reported it is rather obvious: the suspending thread does lock -> wakeup -> slock -> unlock -> sunlock -> sleep Only locking the proc puts as in a spot where we are past the wakeup, but before it gets the chance to bump the counter. On the other hand if we slock, we effectively wait for it to bump and go to sleep after which we see what's going on. -- Mateusz Guzik From owner-svn-src-head@freebsd.org Sat Feb 17 18:30: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 B956EF01CFD; Sat, 17 Feb 2018 18:30:25 +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 6B1BF8D48E; Sat, 17 Feb 2018 18:30:25 +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 662632055C; Sat, 17 Feb 2018 18:30:25 +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 w1HIUPmc078726; Sat, 17 Feb 2018 18:30:25 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HIUPKb078725; Sat, 17 Feb 2018 18:30:25 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201802171830.w1HIUPKb078725@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 17 Feb 2018 18:30:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329463 - 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: 329463 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 18:30:25 -0000 Author: manu Date: Sat Feb 17 18:30:25 2018 New Revision: 329463 URL: https://svnweb.freebsd.org/changeset/base/329463 Log: aw_mmc: Only change the clock if it has really changed This also seems to fix problem when booting Pine64 from the mmc. Tested On: Pine64 Tested On: Pine64-LTS Modified: head/sys/arm/allwinner/aw_mmc.c Modified: head/sys/arm/allwinner/aw_mmc.c ============================================================================== --- head/sys/arm/allwinner/aw_mmc.c Sat Feb 17 18:00:01 2018 (r329462) +++ head/sys/arm/allwinner/aw_mmc.c Sat Feb 17 18:30:25 2018 (r329463) @@ -117,6 +117,7 @@ struct aw_mmc_softc { int32_t aw_vdd; regulator_t aw_reg_vmmc; regulator_t aw_reg_vqmmc; + unsigned int aw_clock; /* Fields required for DMA access. */ bus_addr_t aw_dma_desc_phys; @@ -939,8 +940,8 @@ aw_mmc_update_ios(device_t bus, device_t child) reg &= ~AW_MMC_CTRL_DDR_MOD_SEL; AW_MMC_WRITE_4(sc, AW_MMC_GCTL, reg); - if (ios->clock) { - clock = ios->clock; + if (ios->clock && ios->clock != sc->aw_clock) { + sc->aw_clock = clock = ios->clock; /* Disable clock */ error = aw_mmc_update_clock(sc, 0); From owner-svn-src-head@freebsd.org Sat Feb 17 18:43: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 5F1C6F02DA6; Sat, 17 Feb 2018 18:43:04 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay01.pair.com (relay01.pair.com [209.68.5.15]) (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 EF1F28DF30; Sat, 17 Feb 2018 18:43:03 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x2.osted.lan (87-58-223-204-dynamic.dk.customer.tdc.net [87.58.223.204]) by relay01.pair.com (Postfix) with ESMTP id 3D46AD00389; Sat, 17 Feb 2018 13:43:02 -0500 (EST) Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.14.9/8.14.9) with ESMTP id w1HIgxvc084093 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 17 Feb 2018 19:42:59 +0100 (CET) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.14.9/8.14.9/Submit) id w1HIgxZE084090; Sat, 17 Feb 2018 19:42:59 +0100 (CET) (envelope-from pho) Date: Sat, 17 Feb 2018 19:42:59 +0100 From: Peter Holm To: Mateusz Guzik Cc: Konstantin Belousov , Mateusz Guzik , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329448 - head/sys/kern Message-ID: <20180217184259.GA84054@x2.osted.lan> References: <201802170848.w1H8mkfb081764@repo.freebsd.org> <20180217112738.GO94212@kib.kiev.ua> <20180217162632.GQ94212@kib.kiev.ua> <20180217163822.GA81555@x2.osted.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 18:43:04 -0000 On Sat, Feb 17, 2018 at 06:34:34PM +0100, Mateusz Guzik wrote: > On Sat, Feb 17, 2018 at 5:38 PM, Peter Holm wrote: > > > On Sat, Feb 17, 2018 at 06:26:32PM +0200, Konstantin Belousov wrote: > > > On Sat, Feb 17, 2018 at 05:07:07PM +0100, Mateusz Guzik wrote: > > > > On Sat, Feb 17, 2018 at 01:27:38PM +0200, Konstantin Belousov wrote: > > > > > On Sat, Feb 17, 2018 at 08:48:46AM +0000, Mateusz Guzik wrote: > > > > > > Author: mjg > > > > > > Date: Sat Feb 17 08:48:45 2018 > > > > > > New Revision: 329448 > > > > > > URL: https://svnweb.freebsd.org/changeset/base/329448 > > > > > > > > > > > > Log: > > > > > > exit: get rid of PROC_SLOCK when checking a process to report > > > > > Was this tested ? > > > > > > > > > > > > > I was trussing multithreaded microbenchmarks, no issues. > > > > > > > > > In particular, are you aware of r309539 ? > > > > > > > > > > > > > So it looks like I misread the code - I have grepped > > > > thread_suspend_switch operating with the proc locked and misread > > > > thread_suspend_one's assert as PROC_LOCK_ASSERT. > > > > > > > > That said, I think this is harmless. Regardless of the lock the > > > > inspecting thread can race and check "too soon". Even for a case where > > > > it decides to report, I don't see anything which would depend on the > > > > suspending thread to finish. > > > It was definitely not harmless when I tried to avoid the spin lock there, > > > but I do not remember exact failure mode. Most likely, it was a missed > > > report of the traced child indeed, but I am not sure that truss triggered > > > it. Most likely, Peter Holm was the reporter, since he is listed in > > > the commit. > > > > > > > I ran a truss(1) test on r329456 and it fails. I have not had a > > chance to look closer at this, but this is what I see: > > > > [root@mercat1 /home/pho]# pgrep truss | xargs ps -Hlp > > UID PID PPID CPU PRI NI VSZ RSS MWCHAN STAT TT TIME COMMAND > > 0 41149 41118 0 52 0 11532 2588 wait I 0 0:01.38 truss > > /tmp/ttruss 10 > > 0 41151 41149 0 52 0 13156 2300 - TX 0 0:00.98 /tmp/ttruss > > 10 > > 0 41151 41149 0 52 0 13156 2300 - TX 0 0:00.00 /tmp/ttruss > > 10 > > [root@mercat1 /home/pho]# procstat -k 41151 > > PID TID COMM TDNAME KSTACK > > 41151 100211 ttruss - mi_switch > > thread_suspend_switch ptracestop amd64_syscall fast_syscall_common > > 41151 100765 ttruss - mi_switch > > thread_suspend_check ast doreti_ast > > [root@mercat1 /home/pho]# > > > > > Ok, I reproduced the bug with your script. I reverted the change. > > The patch I mailed in this thread fixes it for me. Below is a variant > which can be applied on top of fresh head: > > https://people.freebsd.org/~mjg/wait6_slock.diff > Yes, this also works for me with the truss(1) test scenario. Would you like me to run the full set of test? - Peter From owner-svn-src-head@freebsd.org Sat Feb 17 18:47: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 D668CF0328E; Sat, 17 Feb 2018 18:47:39 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qk0-x243.google.com (mail-qk0-x243.google.com [IPv6:2607:f8b0:400d: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 5D3DC8E224; Sat, 17 Feb 2018 18:47:39 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qk0-x243.google.com with SMTP id b130so7773118qkg.9; Sat, 17 Feb 2018 10:47:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=JUTgfSFBxZ22joGIJLhtM1DR+t8nO6AzUB8hG3fSLSw=; b=qgNrBciXZhIKPXSAzJU/3wiBIoaYo4E6AkIw7YZ20jUftvKALPgPOQ+Vo+8nmoUJaG PxbjORJe2y0HO/AzkqyphfPebVyUa7CqI6MLKePzRjvFMoNB07j6GI16G3lW12fus7zq 77cv5OTrnQ9HSWy8t1jHyWQQqA9/mHKtGtgtxHhVn234mskE+6ZIeXMpynV8toqLCTbZ EjJAV9h6oPaOfpQSvKmpAw890S/oC1oqVhLTVXHbogI0e1YnlmyY+m3ofS+WiVh1e9Bx YCWN6h59QrKop42u/F7PmIn74l5Pitr1ecGyWoCgFBIru8G4RiwZ4jFkeMXCkH5ltMYq Hrtg== 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=JUTgfSFBxZ22joGIJLhtM1DR+t8nO6AzUB8hG3fSLSw=; b=LTKhteCocqE6NkrlzrvbrPM78hR0w6Fn4dUtfExYSzUJKb5ZFSoe0tDxxBwNlU+gyy FK8Ufuo+6wNUwzc5kb54q+b00c9myXFdFgZcEXDrjqSfAwoLPVNpXP7Op/+SRZZJuFZ6 prf7grQF3hEwTFYoZLAuLhvb00p6ZCm4wUsWsiOgQvNmbT6lSqozvFKQWaK3+eLQ9j2s b8oyesq7LkEK2368wr+L0zi7ZADZHuoKMx6uL5iA1kxyiFIq4o+r7kJX5AUFSaVB2Ehw 7yjMRo3JzILlCHTKZebM43ESESvE9Dh2M0w6HF4JFRxlrZ6sExjCBxqVNZ9N70+E0KQ8 UPxg== X-Gm-Message-State: APf1xPB4qXtC77TGnxR5C8ZjsjWaC+HByJ5BSj6RzwbmCt59tXO1KsGN g/l8IwY+X+AoABiGJJAOfA9RkG11y1cgpYJaq1U= X-Google-Smtp-Source: AH8x226pvr68V3cZBUH367gqFRoQ34ChnTaUxkkMjY+NdrU4OtMehlXy0i7ZLRovu8JwU+cCyV2+FKLjdGzOTV3lVHQ= X-Received: by 10.55.74.2 with SMTP id x2mr15449076qka.314.1518893259033; Sat, 17 Feb 2018 10:47:39 -0800 (PST) MIME-Version: 1.0 Received: by 10.237.58.99 with HTTP; Sat, 17 Feb 2018 10:47:38 -0800 (PST) In-Reply-To: <20180217184259.GA84054@x2.osted.lan> References: <201802170848.w1H8mkfb081764@repo.freebsd.org> <20180217112738.GO94212@kib.kiev.ua> <20180217162632.GQ94212@kib.kiev.ua> <20180217163822.GA81555@x2.osted.lan> <20180217184259.GA84054@x2.osted.lan> From: Mateusz Guzik Date: Sat, 17 Feb 2018 19:47:38 +0100 Message-ID: Subject: Re: svn commit: r329448 - head/sys/kern To: Peter Holm Cc: Konstantin Belousov , Mateusz Guzik , 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.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 18:47:40 -0000 On Sat, Feb 17, 2018 at 7:42 PM, Peter Holm wrote: > On Sat, Feb 17, 2018 at 06:34:34PM +0100, Mateusz Guzik wrote: > > On Sat, Feb 17, 2018 at 5:38 PM, Peter Holm wrote: > > > > > On Sat, Feb 17, 2018 at 06:26:32PM +0200, Konstantin Belousov wrote: > > > > On Sat, Feb 17, 2018 at 05:07:07PM +0100, Mateusz Guzik wrote: > > > > > On Sat, Feb 17, 2018 at 01:27:38PM +0200, Konstantin Belousov > wrote: > > > > > > On Sat, Feb 17, 2018 at 08:48:46AM +0000, Mateusz Guzik wrote: > > > > > > > Author: mjg > > > > > > > Date: Sat Feb 17 08:48:45 2018 > > > > > > > New Revision: 329448 > > > > > > > URL: https://svnweb.freebsd.org/changeset/base/329448 > > > > > > > > > > > > > > Log: > > > > > > > exit: get rid of PROC_SLOCK when checking a process to report > > > > > > Was this tested ? > > > > > > > > > > > > > > > > I was trussing multithreaded microbenchmarks, no issues. > > > > > > > > > > > In particular, are you aware of r309539 ? > > > > > > > > > > > > > > > > So it looks like I misread the code - I have grepped > > > > > thread_suspend_switch operating with the proc locked and misread > > > > > thread_suspend_one's assert as PROC_LOCK_ASSERT. > > > > > > > > > > That said, I think this is harmless. Regardless of the lock the > > > > > inspecting thread can race and check "too soon". Even for a case > where > > > > > it decides to report, I don't see anything which would depend on > the > > > > > suspending thread to finish. > > > > It was definitely not harmless when I tried to avoid the spin lock > there, > > > > but I do not remember exact failure mode. Most likely, it was a > missed > > > > report of the traced child indeed, but I am not sure that truss > triggered > > > > it. Most likely, Peter Holm was the reporter, since he is listed in > > > > the commit. > > > > > > > > > > I ran a truss(1) test on r329456 and it fails. I have not had a > > > chance to look closer at this, but this is what I see: > > > > > > [root@mercat1 /home/pho]# pgrep truss | xargs ps -Hlp > > > UID PID PPID CPU PRI NI VSZ RSS MWCHAN STAT TT TIME COMMAND > > > 0 41149 41118 0 52 0 11532 2588 wait I 0 0:01.38 truss > > > /tmp/ttruss 10 > > > 0 41151 41149 0 52 0 13156 2300 - TX 0 0:00.98 > /tmp/ttruss > > > 10 > > > 0 41151 41149 0 52 0 13156 2300 - TX 0 0:00.00 > /tmp/ttruss > > > 10 > > > [root@mercat1 /home/pho]# procstat -k 41151 > > > PID TID COMM TDNAME KSTACK > > > 41151 100211 ttruss - mi_switch > > > thread_suspend_switch ptracestop amd64_syscall fast_syscall_common > > > 41151 100765 ttruss - mi_switch > > > thread_suspend_check ast doreti_ast > > > [root@mercat1 /home/pho]# > > > > > > > > Ok, I reproduced the bug with your script. I reverted the change. > > > > The patch I mailed in this thread fixes it for me. Below is a variant > > which can be applied on top of fresh head: > > > > https://people.freebsd.org/~mjg/wait6_slock.diff > > > > Yes, this also works for me with the truss(1) test scenario. > Would you like me to run the full set of test? > > If you have free cycles I don't see why not, thanks. -- Mateusz Guzik From owner-svn-src-head@freebsd.org Sat Feb 17 20:09: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 2ECC7F0A311; Sat, 17 Feb 2018 20:09:44 +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 D586169C37; Sat, 17 Feb 2018 20:09:43 +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 D0605215DE; Sat, 17 Feb 2018 20:09:43 +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 w1HK9hnK029315; Sat, 17 Feb 2018 20:09:43 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HK9hQr029314; Sat, 17 Feb 2018 20:09:43 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802172009.w1HK9hQr029314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 17 Feb 2018 20:09:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329464 - 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: 329464 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 20:09:44 -0000 Author: hselasky Date: Sat Feb 17 20:09:43 2018 New Revision: 329464 URL: https://svnweb.freebsd.org/changeset/base/329464 Log: Add checks for valid IRQ tag before setting up or tearing down an interrupt handler in the LinuxKPI. This is needed when the interrupt handler is disabled before freeing the interrupt. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/interrupt.h Modified: head/sys/compat/linuxkpi/common/include/linux/interrupt.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/interrupt.h Sat Feb 17 18:30:25 2018 (r329463) +++ head/sys/compat/linuxkpi/common/include/linux/interrupt.h Sat Feb 17 20:09:43 2018 (r329464) @@ -121,7 +121,7 @@ enable_irq(unsigned int irq) if (dev == NULL) return -EINVAL; irqe = linux_irq_ent(dev, irq); - if (irqe == NULL) + if (irqe == NULL || irqe->tag != NULL) return -EINVAL; return -bus_setup_intr(dev->bsddev, irqe->res, INTR_TYPE_NET | INTR_MPSAFE, NULL, linux_irq_handler, irqe, &irqe->tag); @@ -139,7 +139,8 @@ disable_irq(unsigned int irq) irqe = linux_irq_ent(dev, irq); if (irqe == NULL) return; - bus_teardown_intr(dev->bsddev, irqe->res, irqe->tag); + if (irqe->tag != NULL) + bus_teardown_intr(dev->bsddev, irqe->res, irqe->tag); irqe->tag = NULL; } @@ -174,7 +175,8 @@ free_irq(unsigned int irq, void *device) irqe = linux_irq_ent(dev, irq); if (irqe == NULL) return; - bus_teardown_intr(dev->bsddev, irqe->res, irqe->tag); + if (irqe->tag != NULL) + bus_teardown_intr(dev->bsddev, irqe->res, irqe->tag); bus_release_resource(dev->bsddev, SYS_RES_IRQ, rid, irqe->res); list_del(&irqe->links); kfree(irqe); From owner-svn-src-head@freebsd.org Sat Feb 17 20:37: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 6FF3FF0CC6C; Sat, 17 Feb 2018 20:37:22 +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 2574B6B277; Sat, 17 Feb 2018 20:37:22 +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 2045C21AE8; Sat, 17 Feb 2018 20:37:22 +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 w1HKbMVE044620; Sat, 17 Feb 2018 20:37:22 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HKbLfo044617; Sat, 17 Feb 2018 20:37:21 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802172037.w1HKbLfo044617@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 17 Feb 2018 20:37:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329465 - 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: 329465 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 20:37:22 -0000 Author: hselasky Date: Sat Feb 17 20:37:21 2018 New Revision: 329465 URL: https://svnweb.freebsd.org/changeset/base/329465 Log: Move the IRQ_RETVAL() and irqreturn definitions to irqreturn.h in the LinuxKPI to be compatible with Linux. No functional change. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Added: head/sys/compat/linuxkpi/common/include/linux/irqreturn.h (contents, props changed) Modified: head/sys/compat/linuxkpi/common/include/linux/device.h head/sys/compat/linuxkpi/common/include/linux/interrupt.h Modified: head/sys/compat/linuxkpi/common/include/linux/device.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/device.h Sat Feb 17 20:09:43 2018 (r329464) +++ head/sys/compat/linuxkpi/common/include/linux/device.h Sat Feb 17 20:37:21 2018 (r329465) @@ -46,9 +46,6 @@ #include -enum irqreturn { IRQ_NONE = 0, IRQ_HANDLED, IRQ_WAKE_THREAD, }; -typedef enum irqreturn irqreturn_t; - struct device; struct fwnode_handle; Modified: head/sys/compat/linuxkpi/common/include/linux/interrupt.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/interrupt.h Sat Feb 17 20:09:43 2018 (r329464) +++ head/sys/compat/linuxkpi/common/include/linux/interrupt.h Sat Feb 17 20:37:21 2018 (r329465) @@ -33,13 +33,12 @@ #include #include +#include #include #include typedef irqreturn_t (*irq_handler_t)(int, void *); - -#define IRQ_RETVAL(x) ((x) != IRQ_NONE) #define IRQF_SHARED RF_SHAREABLE Added: head/sys/compat/linuxkpi/common/include/linux/irqreturn.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/linux/irqreturn.h Sat Feb 17 20:37:21 2018 (r329465) @@ -0,0 +1,40 @@ +/*- + * Copyright (c) 2017 Limelight Networks, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LINUX_IRQRETURN_H +#define _LINUX_IRQRETURN_H + +typedef enum irqreturn { + IRQ_NONE = 0, + IRQ_HANDLED = 1, + IRQ_WAKE_THREAD = 2 +} irqreturn_t; + +#define IRQ_RETVAL(x) ((x) ? IRQ_HANDLED : IRQ_NONE) + +#endif /* _LINUX_IRQRETURN_H */ From owner-svn-src-head@freebsd.org Sat Feb 17 20:50: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 39069F0DD6C; Sat, 17 Feb 2018 20:50:19 +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 E27A16BB32; Sat, 17 Feb 2018 20:50:18 +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 DD4BD21C88; Sat, 17 Feb 2018 20:50:18 +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 w1HKoIcA049479; Sat, 17 Feb 2018 20:50:18 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HKoIl6049478; Sat, 17 Feb 2018 20:50:18 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802172050.w1HKoIl6049478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 17 Feb 2018 20:50:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329466 - 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: 329466 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 20:50:19 -0000 Author: hselasky Date: Sat Feb 17 20:50:18 2018 New Revision: 329466 URL: https://svnweb.freebsd.org/changeset/base/329466 Log: Add support for __percpu and __weak macros in the LinuxKPI. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/compiler.h Modified: head/sys/compat/linuxkpi/common/include/linux/compiler.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/compiler.h Sat Feb 17 20:37:21 2018 (r329465) +++ head/sys/compat/linuxkpi/common/include/linux/compiler.h Sat Feb 17 20:50:18 2018 (r329466) @@ -56,6 +56,8 @@ #define __devexit #define __exit #define __rcu +#define __percpu +#define __weak __weak_symbol #define __malloc #define ___stringify(...) #__VA_ARGS__ #define __stringify(...) ___stringify(__VA_ARGS__) From owner-svn-src-head@freebsd.org Sat Feb 17 20: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 2FF71F0E209; Sat, 17 Feb 2018 20:52:55 +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 CA8B76BF93; Sat, 17 Feb 2018 20:52:54 +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 C270721E18; Sat, 17 Feb 2018 20:52:54 +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 w1HKqs4R054253; Sat, 17 Feb 2018 20:52:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HKqsTr054252; Sat, 17 Feb 2018 20:52:54 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802172052.w1HKqsTr054252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 17 Feb 2018 20:52:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329467 - 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: 329467 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 20:52:55 -0000 Author: hselasky Date: Sat Feb 17 20:52:54 2018 New Revision: 329467 URL: https://svnweb.freebsd.org/changeset/base/329467 Log: Add support for mmgrab() function in the LinuxKPI. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/mm_types.h Modified: head/sys/compat/linuxkpi/common/include/linux/mm_types.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/mm_types.h Sat Feb 17 20:50:18 2018 (r329466) +++ head/sys/compat/linuxkpi/common/include/linux/mm_types.h Sat Feb 17 20:52:54 2018 (r329467) @@ -62,6 +62,12 @@ mmput(struct mm_struct *mm) mmdrop(mm); } +static inline void +mmgrab(struct mm_struct *mm) +{ + atomic_inc(&mm->mm_count); +} + extern struct mm_struct *linux_get_task_mm(struct task_struct *); #define get_task_mm(task) linux_get_task_mm(task) From owner-svn-src-head@freebsd.org Sat Feb 17 20:56: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 62CB4F0E618; Sat, 17 Feb 2018 20:56:36 +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 171596C1AC; Sat, 17 Feb 2018 20:56:36 +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 1203A21E1E; Sat, 17 Feb 2018 20:56:36 +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 w1HKuZ9u054453; Sat, 17 Feb 2018 20:56:35 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HKuZ6t054452; Sat, 17 Feb 2018 20:56:35 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802172056.w1HKuZ6t054452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 17 Feb 2018 20:56:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329468 - 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: 329468 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 20:56:36 -0000 Author: hselasky Date: Sat Feb 17 20:56:35 2018 New Revision: 329468 URL: https://svnweb.freebsd.org/changeset/base/329468 Log: Add support for kref_read() function in the LinuxKPI. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/kref.h Modified: head/sys/compat/linuxkpi/common/include/linux/kref.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/kref.h Sat Feb 17 20:52:54 2018 (r329467) +++ head/sys/compat/linuxkpi/common/include/linux/kref.h Sat Feb 17 20:56:35 2018 (r329468) @@ -52,6 +52,13 @@ kref_init(struct kref *kref) refcount_init(&kref->refcount.counter, 1); } +static inline unsigned int +kref_read(const struct kref *kref) +{ + + return (atomic_read(&kref->refcount)); +} + static inline void kref_get(struct kref *kref) { From owner-svn-src-head@freebsd.org Sat Feb 17 20:59: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 534B6F0E9FC; Sat, 17 Feb 2018 20:59:14 +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 EEC436C3AF; Sat, 17 Feb 2018 20:59:13 +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 E996221E21; Sat, 17 Feb 2018 20:59:13 +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 w1HKxDZw054608; Sat, 17 Feb 2018 20:59:13 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HKxCWS054597; Sat, 17 Feb 2018 20:59:12 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201802172059.w1HKxCWS054597@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 17 Feb 2018 20:59:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329469 - in head/sys/powerpc: aim booke include powerpc ps3 pseries X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys/powerpc: aim booke include powerpc ps3 pseries X-SVN-Commit-Revision: 329469 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 20:59:14 -0000 Author: jhibbits Date: Sat Feb 17 20:59:12 2018 New Revision: 329469 URL: https://svnweb.freebsd.org/changeset/base/329469 Log: Merge AIM and Book-E PCPU fields This is part of a long-term goal of merging Book-E and AIM into a single GENERIC kernel. As more work is done, the struct may be optimized further. Reviewed by: nwhitehorn Modified: head/sys/powerpc/aim/aim_machdep.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/aim/moea64_native.c head/sys/powerpc/aim/slb.c head/sys/powerpc/booke/booke_machdep.c head/sys/powerpc/booke/pmap.c head/sys/powerpc/include/pcpu.h head/sys/powerpc/powerpc/genassym.c head/sys/powerpc/powerpc/trap.c head/sys/powerpc/ps3/mmu_ps3.c head/sys/powerpc/pseries/mmu_phyp.c Modified: head/sys/powerpc/aim/aim_machdep.c ============================================================================== --- head/sys/powerpc/aim/aim_machdep.c Sat Feb 17 20:56:35 2018 (r329468) +++ head/sys/powerpc/aim/aim_machdep.c Sat Feb 17 20:59:12 2018 (r329469) @@ -442,7 +442,7 @@ cpu_pcpu_init(struct pcpu *pcpu, int cpuid, size_t sz) { #ifdef __powerpc64__ /* Copy the SLB contents from the current CPU */ -memcpy(pcpu->pc_slb, PCPU_GET(slb), sizeof(pcpu->pc_slb)); +memcpy(pcpu->pc_aim.slb, PCPU_GET(aim.slb), sizeof(pcpu->pc_aim.slb)); #endif } Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Sat Feb 17 20:56:35 2018 (r329468) +++ head/sys/powerpc/aim/mmu_oea64.c Sat Feb 17 20:59:12 2018 (r329469) @@ -601,7 +601,7 @@ moea64_bootstrap_slb_prefault(vm_offset_t va, int larg uint64_t esid, slbe; uint64_t i; - cache = PCPU_GET(slb); + cache = PCPU_GET(aim.slb); esid = va >> ADDR_SR_SHFT; slbe = (esid << SLBE_ESID_SHIFT) | SLBE_VALID; @@ -840,8 +840,8 @@ moea64_mid_bootstrap(mmu_t mmup, vm_offset_t kernelsta */ #ifdef __powerpc64__ for (i = 0; i < 64; i++) { - pcpup->pc_slb[i].slbv = 0; - pcpup->pc_slb[i].slbe = 0; + pcpup->pc_aim.slb[i].slbv = 0; + pcpup->pc_aim.slb[i].slbe = 0; } #else for (i = 0; i < 16; i++) @@ -1017,9 +1017,10 @@ moea64_pmap_init_qpages(void) if (pc->pc_qmap_addr == 0) panic("pmap_init_qpages: unable to allocate KVA"); PMAP_LOCK(kernel_pmap); - pc->pc_qmap_pvo = moea64_pvo_find_va(kernel_pmap, pc->pc_qmap_addr); + pc->pc_aim.qmap_pvo = + moea64_pvo_find_va(kernel_pmap, pc->pc_qmap_addr); PMAP_UNLOCK(kernel_pmap); - mtx_init(&pc->pc_qmap_lock, "qmap lock", NULL, MTX_DEF); + mtx_init(&pc->pc_aim.qmap_lock, "qmap lock", NULL, MTX_DEF); } } @@ -1038,7 +1039,7 @@ moea64_activate(mmu_t mmu, struct thread *td) CPU_SET(PCPU_GET(cpuid), &pm->pm_active); #ifdef __powerpc64__ - PCPU_SET(userslb, pm->pm_slb); + PCPU_SET(aim.userslb, pm->pm_slb); __asm __volatile("slbmte %0, %1; isync" :: "r"(td->td_pcb->pcb_cpu.aim.usr_vsid), "r"(USER_SLB_SLBE)); #else @@ -1057,7 +1058,7 @@ moea64_deactivate(mmu_t mmu, struct thread *td) pm = &td->td_proc->p_vmspace->vm_pmap; CPU_CLR(PCPU_GET(cpuid), &pm->pm_active); #ifdef __powerpc64__ - PCPU_SET(userslb, NULL); + PCPU_SET(aim.userslb, NULL); #else PCPU_SET(curpmap, NULL); #endif @@ -1153,12 +1154,12 @@ moea64_copy_pages_dmap(mmu_t mmu, vm_page_t *ma, vm_of while (xfersize > 0) { a_pg_offset = a_offset & PAGE_MASK; cnt = min(xfersize, PAGE_SIZE - a_pg_offset); - a_cp = (char *)PHYS_TO_DMAP( + a_cp = (char *)(uintptr_t)PHYS_TO_DMAP( VM_PAGE_TO_PHYS(ma[a_offset >> PAGE_SHIFT])) + a_pg_offset; b_pg_offset = b_offset & PAGE_MASK; cnt = min(cnt, PAGE_SIZE - b_pg_offset); - b_cp = (char *)PHYS_TO_DMAP( + b_cp = (char *)(uintptr_t)PHYS_TO_DMAP( VM_PAGE_TO_PHYS(mb[b_offset >> PAGE_SHIFT])) + b_pg_offset; bcopy(a_cp, b_cp, cnt); @@ -1219,7 +1220,7 @@ moea64_zero_page_area(mmu_t mmu, vm_page_t m, int off, panic("moea64_zero_page: size + off > PAGE_SIZE"); if (hw_direct_map) { - bzero((caddr_t)PHYS_TO_DMAP(pa) + off, size); + bzero((caddr_t)(uintptr_t)PHYS_TO_DMAP(pa) + off, size); } else { mtx_lock(&moea64_scratchpage_mtx); moea64_set_scratchpage_pa(mmu, 0, pa); @@ -1270,10 +1271,10 @@ moea64_quick_enter_page(mmu_t mmu, vm_page_t m) */ sched_pin(); - mtx_assert(PCPU_PTR(qmap_lock), MA_NOTOWNED); - pvo = PCPU_GET(qmap_pvo); + mtx_assert(PCPU_PTR(aim.qmap_lock), MA_NOTOWNED); + pvo = PCPU_GET(aim.qmap_pvo); - mtx_lock(PCPU_PTR(qmap_lock)); + mtx_lock(PCPU_PTR(aim.qmap_lock)); pvo->pvo_pte.pa = moea64_calc_wimg(pa, pmap_page_get_memattr(m)) | (uint64_t)pa; MOEA64_PTE_REPLACE(mmu, pvo, MOEA64_PTE_INVALIDATE); @@ -1288,10 +1289,10 @@ moea64_quick_remove_page(mmu_t mmu, vm_offset_t addr) if (hw_direct_map) return; - mtx_assert(PCPU_PTR(qmap_lock), MA_OWNED); + mtx_assert(PCPU_PTR(aim.qmap_lock), MA_OWNED); KASSERT(PCPU_GET(qmap_addr) == addr, ("moea64_quick_remove_page: invalid address")); - mtx_unlock(PCPU_PTR(qmap_lock)); + mtx_unlock(PCPU_PTR(aim.qmap_lock)); sched_unpin(); } @@ -1417,11 +1418,11 @@ moea64_syncicache(mmu_t mmu, pmap_t pmap, vm_offset_t * If PMAP is not bootstrapped, we are likely to be * in real mode. */ - __syncicache((void *)pa, sz); + __syncicache((void *)(uintptr_t)pa, sz); } else if (pmap == kernel_pmap) { __syncicache((void *)va, sz); } else if (hw_direct_map) { - __syncicache((void *)PHYS_TO_DMAP(pa), sz); + __syncicache((void *)(uintptr_t)PHYS_TO_DMAP(pa), sz); } else { /* Use the scratch page to set up a temp mapping */ @@ -1802,8 +1803,8 @@ moea64_kenter_attr(mmu_t mmu, vm_offset_t va, vm_paddr } if (error != 0 && error != ENOENT) - panic("moea64_kenter: failed to enter va %#zx pa %#zx: %d", va, - pa, error); + panic("moea64_kenter: failed to enter va %#zx pa %#jx: %d", va, + (uintmax_t)pa, error); } void @@ -2767,7 +2768,7 @@ void moea64_dumpsys_map(mmu_t mmu, vm_paddr_t pa, size_t sz, void **va) { - *va = (void *)pa; + *va = (void *)(uintptr_t)pa; } extern struct dump_pa dump_map[PHYS_AVAIL_SZ + 1]; @@ -2799,7 +2800,7 @@ moea64_scan_init(mmu_t mmu) dump_map[0].pa_start; /* 2nd: msgbuf and tables (see pmap_bootstrap()). */ - dump_map[1].pa_start = (vm_paddr_t)msgbufp->msg_ptr; + dump_map[1].pa_start = (vm_paddr_t)(uintptr_t)msgbufp->msg_ptr; dump_map[1].pa_size = round_page(msgbufp->msg_size); /* 3rd: kernel VM. */ Modified: head/sys/powerpc/aim/moea64_native.c ============================================================================== --- head/sys/powerpc/aim/moea64_native.c Sat Feb 17 20:56:35 2018 (r329468) +++ head/sys/powerpc/aim/moea64_native.c Sat Feb 17 20:59:12 2018 (r329469) @@ -365,7 +365,7 @@ moea64_cpu_bootstrap_native(mmu_t mmup, int ap) { int i = 0; #ifdef __powerpc64__ - struct slb *slb = PCPU_GET(slb); + struct slb *slb = PCPU_GET(aim.slb); register_t seg0; #endif Modified: head/sys/powerpc/aim/slb.c ============================================================================== --- head/sys/powerpc/aim/slb.c Sat Feb 17 20:56:35 2018 (r329468) +++ head/sys/powerpc/aim/slb.c Sat Feb 17 20:59:12 2018 (r329469) @@ -426,7 +426,7 @@ slb_insert_kernel(uint64_t slbe, uint64_t slbv) /* We don't want to be preempted while modifying the kernel map */ critical_enter(); - slbcache = PCPU_GET(slb); + slbcache = PCPU_GET(aim.slb); /* Check for an unused slot, abusing the user slot as a full flag */ if (slbcache[USER_SLB_SLOT].slbe == 0) { Modified: head/sys/powerpc/booke/booke_machdep.c ============================================================================== --- head/sys/powerpc/booke/booke_machdep.c Sat Feb 17 20:56:35 2018 (r329468) +++ head/sys/powerpc/booke/booke_machdep.c Sat Feb 17 20:59:12 2018 (r329469) @@ -380,14 +380,14 @@ void cpu_pcpu_init(struct pcpu *pcpu, int cpuid, size_t sz) { - pcpu->pc_tid_next = TID_MIN; + pcpu->pc_booke.tid_next = TID_MIN; #ifdef SMP uintptr_t *ptr; int words_per_gran = RES_GRANULE / sizeof(uintptr_t); ptr = &tlb0_miss_locks[cpuid * words_per_gran]; - pcpu->pc_booke_tlb_lock = ptr; + pcpu->pc_booke.tlb_lock = ptr; *ptr = TLB_UNLOCKED; *(ptr + 1) = 0; /* recurse counter */ #endif Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Sat Feb 17 20:56:35 2018 (r329468) +++ head/sys/powerpc/booke/pmap.c Sat Feb 17 20:59:12 2018 (r329469) @@ -501,12 +501,12 @@ tlb_miss_lock(void) if (pc != pcpup) { CTR3(KTR_PMAP, "%s: tlb miss LOCK of CPU=%d, " - "tlb_lock=%p", __func__, pc->pc_cpuid, pc->pc_booke_tlb_lock); + "tlb_lock=%p", __func__, pc->pc_cpuid, pc->pc_booke.tlb_lock); KASSERT((pc->pc_cpuid != PCPU_GET(cpuid)), ("tlb_miss_lock: tried to lock self")); - tlb_lock(pc->pc_booke_tlb_lock); + tlb_lock(pc->pc_booke.tlb_lock); CTR1(KTR_PMAP, "%s: locked", __func__); } @@ -528,7 +528,7 @@ tlb_miss_unlock(void) CTR2(KTR_PMAP, "%s: tlb miss UNLOCK of CPU=%d", __func__, pc->pc_cpuid); - tlb_unlock(pc->pc_booke_tlb_lock); + tlb_unlock(pc->pc_booke.tlb_lock); CTR1(KTR_PMAP, "%s: unlocked", __func__); } @@ -3738,10 +3738,10 @@ tid_alloc(pmap_t pmap) thiscpu = PCPU_GET(cpuid); - tid = PCPU_GET(tid_next); + tid = PCPU_GET(booke.tid_next); if (tid > TID_MAX) tid = TID_MIN; - PCPU_SET(tid_next, tid + 1); + PCPU_SET(booke.tid_next, tid + 1); /* If we are stealing TID then clear the relevant pmap's field */ if (tidbusy[thiscpu][tid] != NULL) { @@ -3759,7 +3759,7 @@ tid_alloc(pmap_t pmap) __asm __volatile("msync; isync"); CTR3(KTR_PMAP, "%s: e (%02d next = %02d)", __func__, tid, - PCPU_GET(tid_next)); + PCPU_GET(booke.tid_next)); return (tid); } Modified: head/sys/powerpc/include/pcpu.h ============================================================================== --- head/sys/powerpc/include/pcpu.h Sat Feb 17 20:56:35 2018 (r329468) +++ head/sys/powerpc/include/pcpu.h Sat Feb 17 20:59:12 2018 (r329469) @@ -52,23 +52,22 @@ struct pvo_entry; register_t pc_tempsave[CPUSAVE_LEN]; \ register_t pc_disisave[CPUSAVE_LEN]; \ register_t pc_dbsave[CPUSAVE_LEN]; \ - void *pc_restore; + void *pc_restore; \ + vm_offset_t pc_qmap_addr; #define PCPU_MD_AIM32_FIELDS \ - vm_offset_t pc_qmap_addr; \ - struct pvo_entry *pc_qmap_pvo; \ - struct mtx pc_qmap_lock; \ - char __pad[128] + struct pvo_entry *qmap_pvo; \ + struct mtx qmap_lock; \ + char __pad[128]; #define PCPU_MD_AIM64_FIELDS \ - struct slb pc_slb[64]; \ - struct slb **pc_userslb; \ - register_t pc_slbsave[18]; \ - uint8_t pc_slbstack[1024]; \ - vm_offset_t pc_qmap_addr; \ - struct pvo_entry *pc_qmap_pvo; \ - struct mtx pc_qmap_lock; \ - char __pad[1345] + struct slb slb[64]; \ + struct slb **userslb; \ + register_t slbsave[18]; \ + uint8_t slbstack[1024]; \ + struct pvo_entry *qmap_pvo; \ + struct mtx qmap_lock; \ + char __pad[1345]; #ifdef __powerpc64__ #define PCPU_MD_AIM_FIELDS PCPU_MD_AIM64_FIELDS @@ -87,14 +86,13 @@ struct pvo_entry; #define BOOKE_PCPU_PAD 429 #endif #define PCPU_MD_BOOKE_FIELDS \ - register_t pc_booke_critsave[BOOKE_CRITSAVE_LEN]; \ - register_t pc_booke_mchksave[CPUSAVE_LEN]; \ - register_t pc_booke_tlbsave[BOOKE_TLBSAVE_LEN]; \ - register_t pc_booke_tlb_level; \ - vm_offset_t pc_qmap_addr; \ - uintptr_t *pc_booke_tlb_lock; \ - int pc_tid_next; \ - char __pad[BOOKE_PCPU_PAD] + register_t critsave[BOOKE_CRITSAVE_LEN]; \ + register_t mchksave[CPUSAVE_LEN]; \ + register_t tlbsave[BOOKE_TLBSAVE_LEN]; \ + register_t tlb_level; \ + uintptr_t *tlb_lock; \ + int tid_next; \ + char __pad[BOOKE_PCPU_PAD]; /* Definitions for register offsets within the exception tmp save areas */ #define CPUSAVE_R27 0 /* where r27 gets saved */ @@ -129,24 +127,16 @@ struct pvo_entry; #define TLBSAVE_BOOKE_R30 14 #define TLBSAVE_BOOKE_R31 15 -#ifdef AIM #define PCPU_MD_FIELDS \ PCPU_MD_COMMON_FIELDS \ - PCPU_MD_AIM_FIELDS -#endif -#if defined(BOOKE) -#define PCPU_MD_FIELDS \ - PCPU_MD_COMMON_FIELDS \ - PCPU_MD_BOOKE_FIELDS -#endif - -/* - * Catch-all for ports (e.g. lsof, used by gtop) - */ -#ifndef PCPU_MD_FIELDS -#define PCPU_MD_FIELDS \ - int pc_md_placeholder[32] -#endif + union { \ + struct { \ + PCPU_MD_AIM_FIELDS \ + } pc_aim; \ + struct { \ + PCPU_MD_BOOKE_FIELDS \ + } pc_booke; \ + } #ifdef _KERNEL Modified: head/sys/powerpc/powerpc/genassym.c ============================================================================== --- head/sys/powerpc/powerpc/genassym.c Sat Feb 17 20:56:35 2018 (r329468) +++ head/sys/powerpc/powerpc/genassym.c Sat Feb 17 20:59:12 2018 (r329469) @@ -66,11 +66,11 @@ ASSYM(PC_DBSAVE, offsetof(struct pcpu, pc_dbsave)); ASSYM(PC_RESTORE, offsetof(struct pcpu, pc_restore)); #if defined(BOOKE) -ASSYM(PC_BOOKE_CRITSAVE, offsetof(struct pcpu, pc_booke_critsave)); -ASSYM(PC_BOOKE_MCHKSAVE, offsetof(struct pcpu, pc_booke_mchksave)); -ASSYM(PC_BOOKE_TLBSAVE, offsetof(struct pcpu, pc_booke_tlbsave)); -ASSYM(PC_BOOKE_TLB_LEVEL, offsetof(struct pcpu, pc_booke_tlb_level)); -ASSYM(PC_BOOKE_TLB_LOCK, offsetof(struct pcpu, pc_booke_tlb_lock)); +ASSYM(PC_BOOKE_CRITSAVE, offsetof(struct pcpu, pc_booke.critsave)); +ASSYM(PC_BOOKE_MCHKSAVE, offsetof(struct pcpu, pc_booke.mchksave)); +ASSYM(PC_BOOKE_TLBSAVE, offsetof(struct pcpu, pc_booke.tlbsave)); +ASSYM(PC_BOOKE_TLB_LEVEL, offsetof(struct pcpu, pc_booke.tlb_level)); +ASSYM(PC_BOOKE_TLB_LOCK, offsetof(struct pcpu, pc_booke.tlb_lock)); #endif ASSYM(CPUSAVE_R27, CPUSAVE_R27*sizeof(register_t)); @@ -109,10 +109,10 @@ ASSYM(MTX_LOCK, offsetof(struct mtx, mtx_lock)); #if defined(AIM) ASSYM(USER_ADDR, USER_ADDR); #ifdef __powerpc64__ -ASSYM(PC_KERNSLB, offsetof(struct pcpu, pc_slb)); -ASSYM(PC_USERSLB, offsetof(struct pcpu, pc_userslb)); -ASSYM(PC_SLBSAVE, offsetof(struct pcpu, pc_slbsave)); -ASSYM(PC_SLBSTACK, offsetof(struct pcpu, pc_slbstack)); +ASSYM(PC_KERNSLB, offsetof(struct pcpu, pc_aim.slb)); +ASSYM(PC_USERSLB, offsetof(struct pcpu, pc_aim.userslb)); +ASSYM(PC_SLBSAVE, offsetof(struct pcpu, pc_aim.slbsave)); +ASSYM(PC_SLBSTACK, offsetof(struct pcpu, pc_aim.slbstack)); ASSYM(USER_SLB_SLOT, USER_SLB_SLOT); ASSYM(USER_SLB_SLBE, USER_SLB_SLBE); ASSYM(SEGMENT_MASK, SEGMENT_MASK); Modified: head/sys/powerpc/powerpc/trap.c ============================================================================== --- head/sys/powerpc/powerpc/trap.c Sat Feb 17 20:56:35 2018 (r329468) +++ head/sys/powerpc/powerpc/trap.c Sat Feb 17 20:59:12 2018 (r329469) @@ -652,7 +652,7 @@ handle_kernel_slb_spill(int type, register_t dar, regi int i; addr = (type == EXC_ISE) ? srr0 : dar; - slbcache = PCPU_GET(slb); + slbcache = PCPU_GET(aim.slb); esid = (uintptr_t)addr >> ADDR_SR_SHFT; slbe = (esid << SLBE_ESID_SHIFT) | SLBE_VALID; Modified: head/sys/powerpc/ps3/mmu_ps3.c ============================================================================== --- head/sys/powerpc/ps3/mmu_ps3.c Sat Feb 17 20:56:35 2018 (r329468) +++ head/sys/powerpc/ps3/mmu_ps3.c Sat Feb 17 20:59:12 2018 (r329469) @@ -121,7 +121,7 @@ mps3_bootstrap(mmu_t mmup, vm_offset_t kernelstart, vm static void mps3_cpu_bootstrap(mmu_t mmup, int ap) { - struct slb *slb = PCPU_GET(slb); + struct slb *slb = PCPU_GET(aim.slb); register_t seg0; int i; Modified: head/sys/powerpc/pseries/mmu_phyp.c ============================================================================== --- head/sys/powerpc/pseries/mmu_phyp.c Sat Feb 17 20:56:35 2018 (r329468) +++ head/sys/powerpc/pseries/mmu_phyp.c Sat Feb 17 20:59:12 2018 (r329469) @@ -221,7 +221,7 @@ mphyp_bootstrap(mmu_t mmup, vm_offset_t kernelstart, v static void mphyp_cpu_bootstrap(mmu_t mmup, int ap) { - struct slb *slb = PCPU_GET(slb); + struct slb *slb = PCPU_GET(aim.slb); register_t seg0; int i; From owner-svn-src-head@freebsd.org Sat Feb 17 21: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 7346DF10D71; Sat, 17 Feb 2018 21:25:20 +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 142D86D5E4; Sat, 17 Feb 2018 21:25:20 +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 0ECB822310; Sat, 17 Feb 2018 21:25:20 +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 w1HLPJTR069030; Sat, 17 Feb 2018 21:25:19 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HLPJ8G069029; Sat, 17 Feb 2018 21:25:19 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802172125.w1HLPJ8G069029@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 17 Feb 2018 21:25:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329470 - 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: 329470 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 21:25:20 -0000 Author: hselasky Date: Sat Feb 17 21:25:19 2018 New Revision: 329470 URL: https://svnweb.freebsd.org/changeset/base/329470 Log: Add support for printk_ratelimit() function macro and improve the existing printk_ratelimited() function macro to return a boolean stating if there was a printout, true, or not, false. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/printk.h Modified: head/sys/compat/linuxkpi/common/include/linux/printk.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/printk.h Sat Feb 17 20:59:12 2018 (r329469) +++ head/sys/compat/linuxkpi/common/include/linux/printk.h Sat Feb 17 21:25:19 2018 (r329470) @@ -106,10 +106,16 @@ print_hex_dump_bytes(const char *prefix_str, const int print_hex_dump(NULL, prefix_str, prefix_type, 16, 1, buf, len, 0); } -#define printk_ratelimited(...) do { \ +#define printk_ratelimit() ({ \ static linux_ratelimit_t __ratelimited; \ - if (linux_ratelimited(&__ratelimited)) \ + linux_ratelimited(&__ratelimited); \ +}) + +#define printk_ratelimited(...) ({ \ + bool __retval = printk_ratelimit(); \ + if (__retval) \ printk(__VA_ARGS__); \ -} while (0) + __retval; \ +}) #endif /* _LINUX_PRINTK_H_ */ From owner-svn-src-head@freebsd.org Sat Feb 17 21:40: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 051FDF12114; Sat, 17 Feb 2018 21:40:20 +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 A5B396DF57; Sat, 17 Feb 2018 21:40:19 +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 9C2FB224C2; Sat, 17 Feb 2018 21:40:19 +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 w1HLeJSN074276; Sat, 17 Feb 2018 21:40:19 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HLeJbD074275; Sat, 17 Feb 2018 21:40:19 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802172140.w1HLeJbD074275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 17 Feb 2018 21:40:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329471 - 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: 329471 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 21:40:20 -0000 Author: hselasky Date: Sat Feb 17 21:40:19 2018 New Revision: 329471 URL: https://svnweb.freebsd.org/changeset/base/329471 Log: Implement BUILD_BUG_ON_INVALID() function macro in the LinuxKPI. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies 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 Sat Feb 17 21:25:19 2018 (r329470) +++ head/sys/compat/linuxkpi/common/include/linux/kernel.h Sat Feb 17 21:40:19 2018 (r329471) @@ -89,6 +89,7 @@ #define BUILD_BUG_ON(x) CTASSERT(!(x)) #define BUILD_BUG_ON_MSG(x, msg) BUILD_BUG_ON(x) #define BUILD_BUG_ON_NOT_POWER_OF_2(x) BUILD_BUG_ON(!powerof2(x)) +#define BUILD_BUG_ON_INVALID(expr) while (0) { (void)(expr); } #define BUG() panic("BUG at %s:%d", __FILE__, __LINE__) #define BUG_ON(cond) do { \ From owner-svn-src-head@freebsd.org Sat Feb 17 21:47: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 E2998F12D1F; Sat, 17 Feb 2018 21:47:15 +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 953806E894; Sat, 17 Feb 2018 21:47:15 +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 9021F22673; Sat, 17 Feb 2018 21:47:15 +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 w1HLlFLn079630; Sat, 17 Feb 2018 21:47:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HLlFq3079629; Sat, 17 Feb 2018 21:47:15 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802172147.w1HLlFq3079629@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 17 Feb 2018 21:47:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329472 - 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: 329472 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 21:47:16 -0000 Author: hselasky Date: Sat Feb 17 21:47:15 2018 New Revision: 329472 URL: https://svnweb.freebsd.org/changeset/base/329472 Log: Allow the put_user() function macro to put constant values by using the existing __put_user() macro. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/uaccess.h Modified: head/sys/compat/linuxkpi/common/include/linux/uaccess.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/uaccess.h Sat Feb 17 21:40:19 2018 (r329471) +++ head/sys/compat/linuxkpi/common/include/linux/uaccess.h Sat Feb 17 21:47:15 2018 (r329472) @@ -58,7 +58,7 @@ linux_copyout(&(__x), (_p), sizeof(*(_p))); \ }) #define get_user(_x, _p) linux_copyin((_p), &(_x), sizeof(*(_p))) -#define put_user(_x, _p) linux_copyout(&(_x), (_p), sizeof(*(_p))) +#define put_user(_x, _p) __put_user(_x, _p) #define clear_user(...) linux_clear_user(__VA_ARGS__) #define access_ok(...) linux_access_ok(__VA_ARGS__) From owner-svn-src-head@freebsd.org Sat Feb 17 22:17: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 C4603F1556B; Sat, 17 Feb 2018 22:17:21 +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 9CC636FC0F; Sat, 17 Feb 2018 22:17:21 +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 7D89C22BBD; Sat, 17 Feb 2018 22:17:21 +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 w1HMHLSl094375; Sat, 17 Feb 2018 22:17:21 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HMHL5O094373; Sat, 17 Feb 2018 22:17:21 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802172217.w1HMHL5O094373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 17 Feb 2018 22:17:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329473 - head/stand/liblua X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/stand/liblua X-SVN-Commit-Revision: 329473 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 22:17:22 -0000 Author: cem Date: Sat Feb 17 22:17:21 2018 New Revision: 329473 URL: https://svnweb.freebsd.org/changeset/base/329473 Log: liblua: Clean up io/loader C module registration Utilize registration APIs Lua provides to make module definition a little cleaner. Discussed with: imp Sponsored by: Dell EMC Isilon Modified: head/stand/liblua/lutils.c head/stand/liblua/lutils.h Modified: head/stand/liblua/lutils.c ============================================================================== --- head/stand/liblua/lutils.c Sat Feb 17 21:47:15 2018 (r329472) +++ head/stand/liblua/lutils.c Sat Feb 17 22:17:21 2018 (r329473) @@ -210,59 +210,34 @@ lua_readfile(lua_State *L) return 2; } -void -lregister(lua_State *L, const char *tableName, const char *funcName, int (*funcPointer)(lua_State *)) -{ - lua_getglobal(L, tableName); - if (!lua_istable(L, -1)) { - lua_pop(L, 1); - lua_newtable(L); - lua_setglobal(L, tableName); - lua_getglobal(L, tableName); - } +#define REG_SIMPLE(n) { #n, lua_ ## n } +static const struct luaL_Reg loaderlib[] = { + REG_SIMPLE(delay), + REG_SIMPLE(getenv), + REG_SIMPLE(perform), + REG_SIMPLE(printc), + REG_SIMPLE(setenv), + REG_SIMPLE(time), + REG_SIMPLE(unsetenv), + { NULL, NULL }, +}; - lua_pushcfunction(L, funcPointer); - lua_setfield(L, -2, funcName); - lua_pop(L, 1); -} +static const struct luaL_Reg iolib[] = { + { "close", lua_closefile }, + REG_SIMPLE(getchar), + REG_SIMPLE(gets), + REG_SIMPLE(ischar), + { "open", lua_openfile }, + { "read", lua_readfile }, + { NULL, NULL }, +}; +#undef REG_SIMPLE - -typedef struct utils_func -{ - int (*func)(lua_State *); - const char *table; - const char *name; -} utils_func; - -static utils_func reg_funcs[] = { - {lua_delay, "loader", "delay"}, - {lua_getenv, "loader", "getenv"}, - {lua_perform, "loader", "perform"}, - {lua_printc, "loader", "printc"}, - {lua_setenv, "loader", "setenv"}, - {lua_time, "loader", "time"}, - {lua_unsetenv, "loader", "unsetenv"}, - - {lua_closefile, "io", "close"}, - {lua_getchar, "io", "getchar"}, - {lua_gets, "io", "gets"}, - {lua_ischar, "io", "ischar"}, - {lua_openfile, "io", "open"}, - {lua_readfile, "io", "read"}, - - {NULL, NULL, NULL}, - }; - void register_utils(lua_State *L) { - utils_func *f = reg_funcs; - - while (f->func != NULL && f->name != NULL) { - if (f->table != NULL) - lregister(L, f->table, f->name, f->func); - else - lua_register(L, f->name, f->func); - ++f; - } + luaL_newlib(L, loaderlib); + lua_setglobal(L, "loader"); + luaL_newlib(L, iolib); + lua_setglobal(L, "io"); } Modified: head/stand/liblua/lutils.h ============================================================================== --- head/stand/liblua/lutils.h Sat Feb 17 21:47:15 2018 (r329472) +++ head/stand/liblua/lutils.h Sat Feb 17 22:17:21 2018 (r329473) @@ -28,5 +28,4 @@ #include -void lregister(lua_State *, const char *, const char *, int (*fptr)(lua_State *)); void register_utils(lua_State *); From owner-svn-src-head@freebsd.org Sat Feb 17 22: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 72E6CF15731; Sat, 17 Feb 2018 22:18:40 +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 279D46FDB4; Sat, 17 Feb 2018 22:18:40 +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 220D422BBE; Sat, 17 Feb 2018 22:18:40 +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 w1HMIeQG094466; Sat, 17 Feb 2018 22:18:40 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HMId5X094464; Sat, 17 Feb 2018 22:18:39 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802172218.w1HMId5X094464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 17 Feb 2018 22:18:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329474 - head/stand/liblua X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/stand/liblua X-SVN-Commit-Revision: 329474 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 22:18:40 -0000 Author: cem Date: Sat Feb 17 22:18:39 2018 New Revision: 329474 URL: https://svnweb.freebsd.org/changeset/base/329474 Log: liblua: Emulate DIR, opendir, fdopendir, closedir In a similar fashion to FILE, provide thin shims for the standard directory manipulation functions. Reviewed by: imp Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D14417 Modified: head/stand/liblua/lstd.c head/stand/liblua/lstd.h Modified: head/stand/liblua/lstd.c ============================================================================== --- head/stand/liblua/lstd.c Sat Feb 17 22:17:21 2018 (r329473) +++ head/stand/liblua/lstd.c Sat Feb 17 22:18:39 2018 (r329474) @@ -127,6 +127,42 @@ getc(FILE *stream) return EOF; } +DIR * +opendir(const char *name) +{ + DIR *dp; + int fd; + + fd = open(name, O_RDONLY); + if (fd < 0) + return NULL; + dp = fdopendir(fd); + if (dp == NULL) + close(fd); + return dp; +} + +DIR * +fdopendir(int fd) +{ + DIR *dp; + + dp = malloc(sizeof(*dp)); + if (dp == NULL) + return NULL; + dp->fd = fd; + return dp; +} + +int +closedir(DIR *dp) +{ + close(dp->fd); + dp->fd = -1; + free(dp); + return 0; +} + void luai_writestring(const char *s, int i) { Modified: head/stand/liblua/lstd.h ============================================================================== --- head/stand/liblua/lstd.h Sat Feb 17 22:17:21 2018 (r329473) +++ head/stand/liblua/lstd.h Sat Feb 17 22:18:39 2018 (r329474) @@ -43,6 +43,11 @@ typedef struct FILE size_t size; } FILE; +typedef struct DIR +{ + int fd; +} DIR; + FILE *fopen(const char *filename, const char *mode); FILE *freopen( const char *filename, const char *mode, FILE *stream); size_t fread(void *ptr, size_t size, size_t count, FILE *stream); @@ -50,6 +55,9 @@ int fclose(FILE *stream); int ferror(FILE *stream); int feof(FILE *stream); int getc(FILE * stream); +DIR *opendir(const char *name); +DIR *fdopendir(int fd); +int closedir(DIR *); #ifndef EOF #define EOF (-1) From owner-svn-src-head@freebsd.org Sat Feb 17 22:33: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 DD48BF16CA4; Sat, 17 Feb 2018 22:33:26 +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 8FCD370A81; Sat, 17 Feb 2018 22:33:26 +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 8AA4622EFB; Sat, 17 Feb 2018 22:33:26 +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 w1HMXQGm004660; Sat, 17 Feb 2018 22:33:26 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HMXQOb004659; Sat, 17 Feb 2018 22:33:26 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802172233.w1HMXQOb004659@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 17 Feb 2018 22:33:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329475 - 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: 329475 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 22:33:27 -0000 Author: hselasky Date: Sat Feb 17 22:33:26 2018 New Revision: 329475 URL: https://svnweb.freebsd.org/changeset/base/329475 Log: Implement get_task_pid() function macro in the LinuxKPI. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/pid.h Modified: head/sys/compat/linuxkpi/common/include/linux/pid.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/pid.h Sat Feb 17 22:18:39 2018 (r329474) +++ head/sys/compat/linuxkpi/common/include/linux/pid.h Sat Feb 17 22:33:26 2018 (r329475) @@ -58,6 +58,11 @@ enum pid_type { __ts; \ }) +#define get_task_pid(task, type) ({ \ + CTASSERT((type) == PIDTYPE_PID); \ + (task)->task_thread->td_tid; \ +}) + struct task_struct; extern struct task_struct *linux_pid_task(pid_t); extern struct task_struct *linux_get_pid_task(pid_t); From owner-svn-src-head@freebsd.org Sat Feb 17 22:41: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 523BBF17518; Sat, 17 Feb 2018 22:41:21 +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 0569770F42; Sat, 17 Feb 2018 22:41:21 +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 0063522F48; Sat, 17 Feb 2018 22:41:21 +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 w1HMfKen008058; Sat, 17 Feb 2018 22:41:20 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HMfKXG008057; Sat, 17 Feb 2018 22:41:20 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802172241.w1HMfKXG008057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 17 Feb 2018 22:41:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329476 - 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: 329476 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 22:41:21 -0000 Author: hselasky Date: Sat Feb 17 22:41:20 2018 New Revision: 329476 URL: https://svnweb.freebsd.org/changeset/base/329476 Log: Stub more lockdep function macros in the LinuxKPI. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/lockdep.h Modified: head/sys/compat/linuxkpi/common/include/linux/lockdep.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/lockdep.h Sat Feb 17 22:33:26 2018 (r329475) +++ head/sys/compat/linuxkpi/common/include/linux/lockdep.h Sat Feb 17 22:41:20 2018 (r329476) @@ -48,5 +48,10 @@ struct lock_class_key { #define lockdep_is_held(m) (sx_xholder(&(m)->sx) == curthread) #define might_lock(m) do { } while (0) +#define might_lock_read(m) do { } while (0) + +#define lock_acquire(...) do { } while (0) +#define lock_release(...) do { } while (0) +#define lock_acquire_shared_recursive(...) do { } while (0) #endif /* _LINUX_LOCKDEP_H_ */ From owner-svn-src-head@freebsd.org Sat Feb 17 22:45: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 7A525F17AF4; Sat, 17 Feb 2018 22:45:16 +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 2C16B712CD; Sat, 17 Feb 2018 22:45:16 +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 26915230DE; Sat, 17 Feb 2018 22:45:16 +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 w1HMjGm2009854; Sat, 17 Feb 2018 22:45:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HMjGRD009853; Sat, 17 Feb 2018 22:45:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802172245.w1HMjGRD009853@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 17 Feb 2018 22:45:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329477 - 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: 329477 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 22:45:16 -0000 Author: hselasky Date: Sat Feb 17 22:45:15 2018 New Revision: 329477 URL: https://svnweb.freebsd.org/changeset/base/329477 Log: Implement spin_trylock_irq() function macro in the LinuxKPI. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/spinlock.h Modified: head/sys/compat/linuxkpi/common/include/linux/spinlock.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/spinlock.h Sat Feb 17 22:41:20 2018 (r329476) +++ head/sys/compat/linuxkpi/common/include/linux/spinlock.h Sat Feb 17 22:45:15 2018 (r329477) @@ -98,6 +98,9 @@ typedef struct { __ret; \ }) +#define spin_trylock_irq(_l) \ + spin_trylock(_l) + #define spin_lock_nested(_l, _n) do { \ if (SPIN_SKIP()) \ break; \ From owner-svn-src-head@freebsd.org Sat Feb 17 23:23: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 C1153F1AA9C; Sat, 17 Feb 2018 23:23:27 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A58572A1A; Sat, 17 Feb 2018 23:23:27 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 604E523768; Sat, 17 Feb 2018 23:23:27 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1HNNR99031046; Sat, 17 Feb 2018 23:23:27 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HNNRtE031045; Sat, 17 Feb 2018 23:23:27 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201802172323.w1HNNRtE031045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 17 Feb 2018 23:23:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329479 - head/sys/dev/usb/controller X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/usb/controller X-SVN-Commit-Revision: 329479 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 23:23:27 -0000 Author: ian Date: Sat Feb 17 23:23:27 2018 New Revision: 329479 URL: https://svnweb.freebsd.org/changeset/base/329479 Log: Do not try to deallocate memory that wasn't allocated (you'd think that would be safe, but the function also tries to destroy mutexes that never got created). I guess this can only happen when imx_ehci_detach() is called on the error-exit path from imx_ehci_attach(), and that path never got exercised before today. Modified: head/sys/dev/usb/controller/ehci_imx.c Modified: head/sys/dev/usb/controller/ehci_imx.c ============================================================================== --- head/sys/dev/usb/controller/ehci_imx.c Sat Feb 17 23:05:19 2018 (r329478) +++ head/sys/dev/usb/controller/ehci_imx.c Sat Feb 17 23:23:27 2018 (r329479) @@ -268,6 +268,7 @@ struct imx_ehci_softc { device_t dev; struct resource *ehci_mem_res; /* EHCI core regs. */ struct resource *ehci_irq_res; /* EHCI core IRQ. */ + bool usb_mem_allocated; }; static struct ofw_compat_data compat_data[] = { @@ -331,7 +332,8 @@ imx_ehci_detach(device_t dev) bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->ehci_mem_res); - usb_bus_mem_free_all(&esc->sc_bus, &ehci_iterate_hw_softc); + if (sc->usb_mem_allocated) + usb_bus_mem_free_all(&esc->sc_bus, &ehci_iterate_hw_softc); /* During module unload there are lots of children leftover */ device_delete_children(dev); @@ -413,6 +415,7 @@ imx_ehci_attach(device_t dev) err = ENOMEM; goto out; } + sc->usb_mem_allocated = true; /* * Set handle to USB related registers subregion used by From owner-svn-src-head@freebsd.org Sat Feb 17 23:39: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 27282F1BF5D; Sat, 17 Feb 2018 23:39:11 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C191773362; Sat, 17 Feb 2018 23:39:10 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC5642390B; Sat, 17 Feb 2018 23:39:10 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1HNdAHg036368; Sat, 17 Feb 2018 23:39:10 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1HNdAB0036367; Sat, 17 Feb 2018 23:39:10 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201802172339.w1HNdAB0036367@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 17 Feb 2018 23:39:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329480 - head/sys/dev/sdhci X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/sdhci X-SVN-Commit-Revision: 329480 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 17 Feb 2018 23:39:11 -0000 Author: ian Date: Sat Feb 17 23:39:10 2018 New Revision: 329480 URL: https://svnweb.freebsd.org/changeset/base/329480 Log: Don't call sdhci_cleanup_slot() if sdhci_init_slot() never got called. Also, do callout_init() very early in attach, so that callout_drain() can be called in detach without worrying about whether it ever got init'd. Modified: head/sys/dev/sdhci/fsl_sdhci.c Modified: head/sys/dev/sdhci/fsl_sdhci.c ============================================================================== --- head/sys/dev/sdhci/fsl_sdhci.c Sat Feb 17 23:23:27 2018 (r329479) +++ head/sys/dev/sdhci/fsl_sdhci.c Sat Feb 17 23:39:10 2018 (r329480) @@ -92,6 +92,7 @@ struct fsl_sdhci_softc { uint16_t sdclockreg_freq_bits; uint8_t r1bfix_type; uint8_t hwtype; + bool slot_init_done; }; #define R1BFIX_NONE 0 /* No fix needed at next interrupt. */ @@ -810,6 +811,9 @@ fsl_sdhci_detach(device_t dev) callout_drain(&sc->r1bfix_callout); + if (sc->slot_init_done) + sdhci_cleanup_slot(&sc->slot); + if (sc->intr_cookie != NULL) bus_teardown_intr(dev, sc->irq_res, sc->intr_cookie); if (sc->irq_res != NULL) @@ -817,7 +821,6 @@ fsl_sdhci_detach(device_t dev) rman_get_rid(sc->irq_res), sc->irq_res); if (sc->mem_res != NULL) { - sdhci_cleanup_slot(&sc->slot); bus_release_resource(dev, SYS_RES_MEMORY, rman_get_rid(sc->mem_res), sc->mem_res); } @@ -837,6 +840,8 @@ fsl_sdhci_attach(device_t dev) sc->dev = dev; + callout_init(&sc->r1bfix_callout, 1); + sc->hwtype = ofw_bus_search_compatible(dev, compat_data)->ocd_data; if (sc->hwtype == HWTYPE_NONE) panic("Impossible: not compatible in fsl_sdhci_attach()"); @@ -924,8 +929,8 @@ fsl_sdhci_attach(device_t dev) WR4(sc, SDHC_PROT_CTRL, protctl); #endif - callout_init(&sc->r1bfix_callout, 1); sdhci_init_slot(dev, &sc->slot, 0); + sc->slot_init_done = true; bus_generic_probe(dev); bus_generic_attach(dev);