From owner-svn-src-head@freebsd.org Sun Sep 2 14:16: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 F14F9FF086A; Sun, 2 Sep 2018 14:16:10 +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 A5F157A78B; Sun, 2 Sep 2018 14:16:10 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1354) id 9B4D54D2D; Sun, 2 Sep 2018 14:16:10 +0000 (UTC) From: Jan Beich To: Michal Meloun Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324815 - in head: lib/libc/gen sys/sys References: <201710211206.v9LC6INJ032680@repo.freebsd.org> Date: Sun, 02 Sep 2018 16:16:05 +0200 Message-ID: <5zzo-vvbu-wny@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 02 Sep 2018 14:16:11 -0000 Michal Meloun writes: > Author: mmel > Date: Sat Oct 21 12:06:18 2017 > New Revision: 324815 > URL: https://svnweb.freebsd.org/changeset/base/324815 > > Log: > Make elf_aux_info() as public libc function. > - Teach elf aux vector functions about newly added AT_HWCAP and AT_HWCAP2 > vectors. > - Export _elf_aux_info() as new public libc function elf_aux_info(3) > > The elf_aux_info(3) should be considered as FreeBSD counterpart of glibc > getauxval() with more robust interface. Can you back it out? I've reported sys/auxv.h breaks existing consumers and the function is yet to be documented. 12.0-RELEASE is approaching but there's no fix in sight, and by the time it lands there maybe not enough time to test. http://docs.freebsd.org/cgi/mid.cgi?03a31eff-34e8-be4c-c008-528824fea261 From owner-svn-src-head@freebsd.org Sun Sep 2 15: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 C03EAFF2891; Sun, 2 Sep 2018 15:42:37 +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 793BC7D25A; Sun, 2 Sep 2018 15:42:37 +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 743211B49B; Sun, 2 Sep 2018 15:42:37 +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 w82Fgb0K064455; Sun, 2 Sep 2018 15:42:37 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w82FgbKD064454; Sun, 2 Sep 2018 15:42:37 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201809021542.w82FgbKD064454@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 2 Sep 2018 15:42:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338428 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 338428 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 02 Sep 2018 15:42:38 -0000 Author: kib Date: Sun Sep 2 15:42:37 2018 New Revision: 338428 URL: https://svnweb.freebsd.org/changeset/base/338428 Log: Style cleanup. No functional changes. Sponsored by: The FreeBSD Foundation MFC after: 3 days Approved by: re (rgrimes) Modified: head/libexec/rtld-elf/libmap.c Modified: head/libexec/rtld-elf/libmap.c ============================================================================== --- head/libexec/rtld-elf/libmap.c Sun Sep 2 10:51:31 2018 (r338427) +++ head/libexec/rtld-elf/libmap.c Sun Sep 2 15:42:37 2018 (r338428) @@ -99,10 +99,10 @@ static void lmc_parse_file(char *path) { struct lmc *p; + char *lm_map; struct stat st; ssize_t retval; int fd; - char *lm_map; TAILQ_FOREACH(p, &lmc_head, next) { if (strcmp(p->path, path) == 0) @@ -222,17 +222,20 @@ lmc_parse(char *lm_p, size_t lm_len) t = f = c = NULL; /* Skip over leading space */ - while (rtld_isspace(*cp)) cp++; + while (rtld_isspace(*cp)) + cp++; /* Found a comment or EOL */ - if (iseol(*cp)) continue; + if (iseol(*cp)) + continue; /* Found a constraint selector */ if (*cp == '[') { cp++; /* Skip leading space */ - while (rtld_isspace(*cp)) cp++; + while (rtld_isspace(*cp)) + cp++; /* Found comment, EOL or end of selector */ if (iseol(*cp) || *cp == ']') @@ -244,10 +247,12 @@ lmc_parse(char *lm_p, size_t lm_len) cp++; /* Skip and zero out trailing space */ - while (rtld_isspace(*cp)) *cp++ = '\0'; + while (rtld_isspace(*cp)) + *cp++ = '\0'; /* Check if there is a closing brace */ - if (*cp != ']') continue; + if (*cp != ']') + continue; /* Terminate string if there was no trailing space */ *cp++ = '\0'; @@ -256,8 +261,10 @@ lmc_parse(char *lm_p, size_t lm_len) * There should be nothing except whitespace or comment from this point to the end of the line. */ - while(rtld_isspace(*cp)) cp++; - if (!iseol(*cp)) continue; + while (rtld_isspace(*cp)) + cp++; + if (!iseol(*cp)) + continue; if (strlcpy(prog, c, sizeof prog) >= sizeof prog) continue; @@ -267,23 +274,29 @@ lmc_parse(char *lm_p, size_t lm_len) /* Parse the 'from' candidate. */ f = cp++; - while (!rtld_isspace(*cp) && !iseol(*cp)) cp++; + while (!rtld_isspace(*cp) && !iseol(*cp)) + cp++; /* Skip and zero out the trailing whitespace */ - while (rtld_isspace(*cp)) *cp++ = '\0'; + while (rtld_isspace(*cp)) + *cp++ = '\0'; /* Found a comment or EOL */ - if (iseol(*cp)) continue; + if (iseol(*cp)) + continue; /* Parse 'to' mapping */ t = cp++; - while (!rtld_isspace(*cp) && !iseol(*cp)) cp++; + while (!rtld_isspace(*cp) && !iseol(*cp)) + cp++; /* Skip and zero out the trailing whitespace */ - while (rtld_isspace(*cp)) *cp++ = '\0'; + while (rtld_isspace(*cp)) + *cp++ = '\0'; /* Should be no extra tokens at this point */ - if (!iseol(*cp)) continue; + if (!iseol(*cp)) + continue; *cp = '\0'; if (strcmp(f, "includedir") == 0) @@ -296,7 +309,7 @@ lmc_parse(char *lm_p, size_t lm_len) } static void -lm_free (struct lm_list *lml) +lm_free(struct lm_list *lml) { struct lm *lm; @@ -309,11 +322,10 @@ lm_free (struct lm_list *lml) free(lm->t); free(lm); } - return; } void -lm_fini (void) +lm_fini(void) { struct lmp *lmp; struct lmc *p; @@ -334,11 +346,10 @@ lm_fini (void) lm_free(&lmp->lml); free(lmp); } - return; } static void -lm_add (const char *p, const char *f, const char *t) +lm_add(const char *p, const char *f, const char *t) { struct lm_list *lml; struct lm *lm; @@ -359,7 +370,7 @@ lm_add (const char *p, const char *f, const char *t) } char * -lm_find (const char *p, const char *f) +lm_find(const char *p, const char *f) { struct lm_list *lml; char *t; @@ -380,14 +391,15 @@ lm_find (const char *p, const char *f) lml = lmp_find("$DEFAULT$"); if (lml != NULL) return (lml_find(lml, f)); - else - return (NULL); + return (NULL); } -/* Given a libmap translation list and a library name, return the - replacement library, or NULL */ +/* + * Given a libmap translation list and a library name, return the + * replacement library, or NULL. + */ char * -lm_findn (const char *p, const char *f, const int n) +lm_findn(const char *p, const char *f, const int n) { char pathbuf[64], *s, *t; @@ -404,37 +416,43 @@ lm_findn (const char *p, const char *f, const int n) } static char * -lml_find (struct lm_list *lmh, const char *f) +lml_find(struct lm_list *lmh, const char *f) { struct lm *lm; dbg("%s(%p, \"%s\")", __func__, lmh, f); - TAILQ_FOREACH(lm, lmh, lm_link) + TAILQ_FOREACH(lm, lmh, lm_link) { if (strcmp(f, lm->f) == 0) return (lm->t); + } return (NULL); } -/* Given an executable name, return a pointer to the translation list or - NULL if no matches */ +/* + * Given an executable name, return a pointer to the translation list or + * NULL if no matches. + */ static struct lm_list * -lmp_find (const char *n) +lmp_find(const char *n) { struct lmp *lmp; dbg("%s(\"%s\")", __func__, n); - TAILQ_FOREACH(lmp, &lmp_head, lmp_link) + TAILQ_FOREACH(lmp, &lmp_head, lmp_link) { if ((lmp->type == T_EXACT && strcmp(n, lmp->p) == 0) || - (lmp->type == T_DIRECTORY && strncmp(n, lmp->p, strlen(lmp->p)) == 0) || - (lmp->type == T_BASENAME && strcmp(quickbasename(n), lmp->p) == 0)) + (lmp->type == T_DIRECTORY && strncmp(n, lmp->p, + strlen(lmp->p)) == 0) || + (lmp->type == T_BASENAME && strcmp(quickbasename(n), + lmp->p) == 0)) return (&lmp->lml); + } return (NULL); } static struct lm_list * -lmp_init (char *n) +lmp_init(char *n) { struct lmp *lmp; @@ -442,7 +460,7 @@ lmp_init (char *n) lmp = xmalloc(sizeof(struct lmp)); lmp->p = n; - if (n[strlen(n)-1] == '/') + if (n[strlen(n) - 1] == '/') lmp->type = T_DIRECTORY; else if (strchr(n,'/') == NULL) lmp->type = T_BASENAME; @@ -454,15 +472,18 @@ lmp_init (char *n) return (&lmp->lml); } -/* libc basename is overkill. Return a pointer to the character after the - last /, or the original string if there are no slashes. */ +/* + * libc basename is overkill. Return a pointer to the character after + * the last /, or the original string if there are no slashes. + */ static const char * -quickbasename (const char *path) +quickbasename(const char *path) { - const char *p = path; - for (; *path; path++) { + const char *p; + + for (p = path; *path != '\0'; path++) { if (*path == '/') - p = path+1; + p = path + 1; } return (p); } From owner-svn-src-head@freebsd.org Sun Sep 2 15:53: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 E936FFF2C92; Sun, 2 Sep 2018 15:53:56 +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 912267DA15; Sun, 2 Sep 2018 15:53:56 +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 865FF1B64C; Sun, 2 Sep 2018 15:53:56 +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 w82FrubR069959; Sun, 2 Sep 2018 15:53:56 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w82FruQo069958; Sun, 2 Sep 2018 15:53:56 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201809021553.w82FruQo069958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Sun, 2 Sep 2018 15:53:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338429 - head/usr.sbin/periodic X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: head/usr.sbin/periodic X-SVN-Commit-Revision: 338429 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 02 Sep 2018 15:53:57 -0000 Author: brd Date: Sun Sep 2 15:53:56 2018 New Revision: 338429 URL: https://svnweb.freebsd.org/changeset/base/338429 Log: Move defaults/periodic.conf back to a config file. Ths prevents etcupdate and mergemaster from deleting it for now. Approved by: re (rgrimes), will (mentor) Differential Revision: https://reviews.freebsd.org/D16975 Modified: head/usr.sbin/periodic/Makefile Modified: head/usr.sbin/periodic/Makefile ============================================================================== --- head/usr.sbin/periodic/Makefile Sun Sep 2 15:42:37 2018 (r338428) +++ head/usr.sbin/periodic/Makefile Sun Sep 2 15:53:56 2018 (r338429) @@ -1,7 +1,7 @@ # $FreeBSD$ -FILES= periodic.conf -FILESDIR= /etc/defaults +CONFS= periodic.conf +CONFSDIR= /etc/defaults SCRIPTS=periodic.sh MAN= periodic.8 From owner-svn-src-head@freebsd.org Sun Sep 2 16:44: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 CAD8EFF3F5A for ; Sun, 2 Sep 2018 16:44:51 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (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 592307FB85 for ; Sun, 2 Sep 2018 16:44:51 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: 7ec26eb5-aecf-11e8-a747-09a40681ccbf 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 7ec26eb5-aecf-11e8-a747-09a40681ccbf; Sun, 02 Sep 2018 16:44:45 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w82GiinU024923; Sun, 2 Sep 2018 10:44:44 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1535906683.9486.20.camel@freebsd.org> Subject: Re: svn commit: r324815 - in head: lib/libc/gen sys/sys From: Ian Lepore To: Jan Beich , Michal Meloun Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sun, 02 Sep 2018 10:44:43 -0600 In-Reply-To: <5zzo-vvbu-wny@FreeBSD.org> References: <201710211206.v9LC6INJ032680@repo.freebsd.org> <5zzo-vvbu-wny@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.27 Precedence: list List-Id: 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, 02 Sep 2018 16:44:52 -0000 On Sun, 2018-09-02 at 16:16 +0200, Jan Beich wrote: > Michal Meloun writes: > > > > > Author: mmel > > Date: Sat Oct 21 12:06:18 2017 > > New Revision: 324815 > > URL: https://svnweb.freebsd.org/changeset/base/324815 > > > > Log: > >   Make elf_aux_info() as public libc function. > >   - Teach elf aux vector functions about newly added AT_HWCAP and > > AT_HWCAP2 > >     vectors. > >   - Export _elf_aux_info() as new public libc function > > elf_aux_info(3) > >    > >   The elf_aux_info(3) should be considered as FreeBSD counterpart > > of glibc > >   getauxval() with more robust interface. > Can you back it out? I've reported sys/auxv.h breaks existing > consumers > and the function is yet to be documented. 12.0-RELEASE is approaching > but there's no fix in sight, and by the time it lands there maybe > not enough time to test. > > http://docs.freebsd.org/cgi/mid.cgi?03a31eff-34e8-be4c-c008-528824fea > 261 > Are you seriously suggesting that freebsd is forbidden to add a system header file of any name it chooses, just because some port's autotools stuff mistakenly assumes the presence of that name implies something linux-specific? If the port is broken, fix it. -- Ian From owner-svn-src-head@freebsd.org Sun Sep 2 17:02: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 9D14BFF447C; Sun, 2 Sep 2018 17:02:14 +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 57E648029E; Sun, 2 Sep 2018 17:02:14 +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 5303E1C193; Sun, 2 Sep 2018 17:02:14 +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 w82H2EBT005134; Sun, 2 Sep 2018 17:02:14 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w82H2EqG005133; Sun, 2 Sep 2018 17:02:14 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201809021702.w82H2EqG005133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 2 Sep 2018 17:02:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338430 - head/sys/cddl/dev/fbt X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/cddl/dev/fbt X-SVN-Commit-Revision: 338430 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 02 Sep 2018 17:02:14 -0000 Author: markj Date: Sun Sep 2 17:02:13 2018 New Revision: 338430 URL: https://svnweb.freebsd.org/changeset/base/338430 Log: Fix the hash table lookup in fbt_destroy(). Reported and tested by: pho Approved by: re (kib) X-MFC with: r338359 Modified: head/sys/cddl/dev/fbt/fbt.c Modified: head/sys/cddl/dev/fbt/fbt.c ============================================================================== --- head/sys/cddl/dev/fbt/fbt.c Sun Sep 2 15:53:56 2018 (r338429) +++ head/sys/cddl/dev/fbt/fbt.c Sun Sep 2 17:02:13 2018 (r338430) @@ -212,7 +212,7 @@ fbt_destroy_one(fbt_probe_t *fbt) ndx = FBT_ADDR2NDX(fbt->fbtp_patchpoint); for (hash = fbt_probetab[ndx], hashprev = NULL; hash != NULL; - hash = hash->fbtp_hashnext, hashprev = hash) { + hashprev = hash, hash = hash->fbtp_hashnext) { if (hash == fbt) { if ((next = fbt->fbtp_tracenext) != NULL) next->fbtp_hashnext = hash->fbtp_hashnext; From owner-svn-src-head@freebsd.org Sun Sep 2 18:29: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 C1C25FF5ED4; Sun, 2 Sep 2018 18:29:39 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7B181825B1; Sun, 2 Sep 2018 18:29:39 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5BF151CE87; Sun, 2 Sep 2018 18:29:39 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w82ITdxi047688; Sun, 2 Sep 2018 18:29:39 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w82ITdvi047687; Sun, 2 Sep 2018 18:29:39 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201809021829.w82ITdvi047687@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sun, 2 Sep 2018 18:29:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338431 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 338431 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 02 Sep 2018 18:29:39 -0000 Author: alc Date: Sun Sep 2 18:29:38 2018 New Revision: 338431 URL: https://svnweb.freebsd.org/changeset/base/338431 Log: Recent changes have created, for the first time, physical memory segments that can be coalesced. To be clear, fragmentation of phys_avail[] is not the cause. This fragmentation of vm_phys_segs[] arises from the "special" calls to vm_phys_add_seg(), in other words, not those that derive directly from phys_avail[], but those that we create for the initial kernel page table pages and now for the kernel and modules loaded at boot time. Since we sometimes iterate over the physical memory segments, coalescing these segments at initialization time is a worthwhile change. Reviewed by: kib, markj Approved by: re (rgrimes) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D16976 Modified: head/sys/vm/vm_phys.c Modified: head/sys/vm/vm_phys.c ============================================================================== --- head/sys/vm/vm_phys.c Sun Sep 2 17:02:13 2018 (r338430) +++ head/sys/vm/vm_phys.c Sun Sep 2 18:29:38 2018 (r338431) @@ -460,7 +460,7 @@ void vm_phys_init(void) { struct vm_freelist *fl; - struct vm_phys_seg *seg; + struct vm_phys_seg *end_seg, *prev_seg, *seg, *tmp_seg; u_long npages; int dom, flind, freelist, oind, pind, segind; @@ -544,6 +544,29 @@ vm_phys_init(void) ("vm_phys_init: DEFAULT flind < 0")); } seg->free_queues = &vm_phys_free_queues[seg->domain][flind]; + } + + /* + * Coalesce physical memory segments that are contiguous and share the + * same per-domain free queues. + */ + prev_seg = vm_phys_segs; + seg = &vm_phys_segs[1]; + end_seg = &vm_phys_segs[vm_phys_nsegs]; + while (seg < end_seg) { + if (prev_seg->end == seg->start && + prev_seg->free_queues == seg->free_queues) { + prev_seg->end = seg->end; + KASSERT(prev_seg->domain == seg->domain, + ("vm_phys_init: free queues cannot span domains")); + vm_phys_nsegs--; + end_seg--; + for (tmp_seg = seg; tmp_seg < end_seg; tmp_seg++) + *tmp_seg = *(tmp_seg + 1); + } else { + prev_seg = seg; + seg++; + } } /* From owner-svn-src-head@freebsd.org Sun Sep 2 18:40: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 317A9FF66A5; Sun, 2 Sep 2018 18:40:19 +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 E14AF82CAF; Sun, 2 Sep 2018 18:40: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 D82B61D03D; Sun, 2 Sep 2018 18:40:18 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w82IeIq3052732; Sun, 2 Sep 2018 18:40:18 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w82IeIAL052731; Sun, 2 Sep 2018 18:40:18 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201809021840.w82IeIAL052731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 2 Sep 2018 18:40:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338432 - head/usr.sbin/efibootmgr X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.sbin/efibootmgr X-SVN-Commit-Revision: 338432 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 02 Sep 2018 18:40:19 -0000 Author: imp Date: Sun Sep 2 18:40:18 2018 New Revision: 338432 URL: https://svnweb.freebsd.org/changeset/base/338432 Log: Make -a (to make the entry active) apply to creation of a new boot variable. Approved by: re@ (rgrimes) PR: 231013 Differential Revision: https://reviews.freebsd.org/D16977 Modified: head/usr.sbin/efibootmgr/efibootmgr.c Modified: head/usr.sbin/efibootmgr/efibootmgr.c ============================================================================== --- head/usr.sbin/efibootmgr/efibootmgr.c Sun Sep 2 18:29:38 2018 (r338431) +++ head/usr.sbin/efibootmgr/efibootmgr.c Sun Sep 2 18:40:18 2018 (r338432) @@ -622,7 +622,7 @@ create_loadopt(uint8_t *buf, size_t bufmax, uint32_t a static int make_boot_var(const char *label, const char *loader, const char *kernel, const char *env, bool dry_run, - int bootnum) + int bootnum, bool activate) { struct entry *new_ent; uint32_t load_attrs = 0; @@ -665,6 +665,8 @@ make_boot_var(const char *label, const char *loader, c /* don't make the new bootvar active by default, use the -a option later */ load_attrs = LOAD_OPTION_CATEGORY_BOOT; + if (activate) + load_attrs |= LOAD_OPTION_ACTIVE; load_opt_buf = malloc(MAX_LOADOPT_LEN); if (load_opt_buf == NULL) err(1, "malloc"); @@ -915,7 +917,7 @@ main(int argc, char *argv[]) */ make_boot_var(opts.label ? opts.label : "", opts.loader, opts.kernel, opts.env, opts.dry_run, - opts.has_bootnum ? opts.bootnum : -1); + opts.has_bootnum ? opts.bootnum : -1, opts.set_active); else if (opts.set_active || opts.set_inactive ) handle_activity(opts.bootnum, opts.set_active); else if (opts.order != NULL) From owner-svn-src-head@freebsd.org Sun Sep 2 19:48: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 017B1FF8135; Sun, 2 Sep 2018 19:48:43 +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 A08D284C92; Sun, 2 Sep 2018 19:48: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 95C981DB77; Sun, 2 Sep 2018 19:48: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 w82JmglW089148; Sun, 2 Sep 2018 19:48:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w82JmgT1089146; Sun, 2 Sep 2018 19:48:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201809021948.w82JmgT1089146@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 2 Sep 2018 19:48:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338433 - in head/sys: amd64/include dev/efidev X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/include dev/efidev X-SVN-Commit-Revision: 338433 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 02 Sep 2018 19:48:43 -0000 Author: kib Date: Sun Sep 2 19:48:41 2018 New Revision: 338433 URL: https://svnweb.freebsd.org/changeset/base/338433 Log: Normalize use of semicolon with EFI_TIME_LOCK macros. Reviewed by: kevans Sponsored by: The FreeBSD Foundation MFC after: 1 week Approved by: re (rgrimes) Differential revision: https://reviews.freebsd.org/D16972 Modified: head/sys/amd64/include/efi.h head/sys/dev/efidev/efirt.c Modified: head/sys/amd64/include/efi.h ============================================================================== --- head/sys/amd64/include/efi.h Sun Sep 2 18:40:18 2018 (r338432) +++ head/sys/amd64/include/efi.h Sun Sep 2 19:48:41 2018 (r338433) @@ -48,9 +48,9 @@ #ifdef _KERNEL #include -#define EFI_TIME_LOCK() mtx_lock(&atrtc_time_lock); -#define EFI_TIME_UNLOCK() mtx_unlock(&atrtc_time_lock); -#define EFI_TIME_OWNED() mtx_assert(&atrtc_time_lock, MA_OWNED); +#define EFI_TIME_LOCK() mtx_lock(&atrtc_time_lock) +#define EFI_TIME_UNLOCK() mtx_unlock(&atrtc_time_lock) +#define EFI_TIME_OWNED() mtx_assert(&atrtc_time_lock, MA_OWNED) #endif #endif /* __AMD64_INCLUDE_EFI_H_ */ Modified: head/sys/dev/efidev/efirt.c ============================================================================== --- head/sys/dev/efidev/efirt.c Sun Sep 2 18:40:18 2018 (r338432) +++ head/sys/dev/efidev/efirt.c Sun Sep 2 19:48:41 2018 (r338433) @@ -299,7 +299,7 @@ efi_get_time_locked(struct efi_tm *tm, struct efi_tmca efi_status status; int error; - EFI_TIME_OWNED() + EFI_TIME_OWNED(); error = efi_enter(); if (error != 0) return (error); @@ -317,7 +317,7 @@ efi_get_time(struct efi_tm *tm) if (efi_runtime == NULL) return (ENXIO); - EFI_TIME_LOCK() + EFI_TIME_LOCK(); /* * UEFI spec states that the Capabilities argument to GetTime is * optional, but some UEFI implementations choke when passed a NULL @@ -325,7 +325,7 @@ efi_get_time(struct efi_tm *tm) * to workaround such implementations. */ error = efi_get_time_locked(tm, &dummy); - EFI_TIME_UNLOCK() + EFI_TIME_UNLOCK(); return (error); } @@ -337,9 +337,9 @@ efi_get_time_capabilities(struct efi_tmcap *tmcap) if (efi_runtime == NULL) return (ENXIO); - EFI_TIME_LOCK() + EFI_TIME_LOCK(); error = efi_get_time_locked(&dummy, tmcap); - EFI_TIME_UNLOCK() + EFI_TIME_UNLOCK(); return (error); } @@ -379,9 +379,9 @@ efi_set_time(struct efi_tm *tm) if (efi_runtime == NULL) return (ENXIO); - EFI_TIME_LOCK() + EFI_TIME_LOCK(); error = efi_set_time_locked(tm); - EFI_TIME_UNLOCK() + EFI_TIME_UNLOCK(); return (error); } From owner-svn-src-head@freebsd.org Sun Sep 2 20:07: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 84A1BFF880F; Sun, 2 Sep 2018 20:07:37 +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 3ACED85808; Sun, 2 Sep 2018 20:07:37 +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 2D53C1DEC6; Sun, 2 Sep 2018 20:07:37 +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 w82K7aYn099274; Sun, 2 Sep 2018 20:07:36 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w82K7alM099273; Sun, 2 Sep 2018 20:07:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201809022007.w82K7alM099273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 2 Sep 2018 20:07:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338434 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 338434 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 02 Sep 2018 20:07:37 -0000 Author: kib Date: Sun Sep 2 20:07:36 2018 New Revision: 338434 URL: https://svnweb.freebsd.org/changeset/base/338434 Log: Swap order of dererencing PCPU curpmap and checking for usermode in trap_pfault() KPTI violation check. EFI RT may set curpmap to NULL for the duration of the call for some machines (PCID but no INVPCID). Since apparently EFI RT code must be ready for exceptions from the calls, avoid dereferencing curpmap until we know that this call does not come from usermode. Reviewed by: kevans Sponsored by: The FreeBSD Foundation MFC after: 1 week Approved by: re (rgrimes) Differential revision: https://reviews.freebsd.org/D16972 Modified: head/sys/amd64/amd64/trap.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Sun Sep 2 19:48:41 2018 (r338433) +++ head/sys/amd64/amd64/trap.c Sun Sep 2 20:07:36 2018 (r338434) @@ -806,7 +806,7 @@ trap_pfault(struct trapframe *frame, int usermode) * If nx protection of the usermode portion of kernel page * tables caused trap, panic. */ - if (PCPU_GET(curpmap)->pm_ucr3 != PMAP_NO_CR3 && usermode && + if (usermode && PCPU_GET(curpmap)->pm_ucr3 != PMAP_NO_CR3 && pg_nx != 0 && (frame->tf_err & (PGEX_P | PGEX_W | PGEX_U | PGEX_I)) == (PGEX_P | PGEX_U | PGEX_I) && (curpcb->pcb_saved_ucr3 & ~CR3_PCID_MASK)== From owner-svn-src-head@freebsd.org Sun Sep 2 20:17: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 009A5FF8B95; Sun, 2 Sep 2018 20:17:52 +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 A9DCC85EB6; Sun, 2 Sep 2018 20:17:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A0B691E06B; Sun, 2 Sep 2018 20:17:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w82KHqVZ004646; Sun, 2 Sep 2018 20:17:52 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w82KHqwb004644; Sun, 2 Sep 2018 20:17:52 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201809022017.w82KHqwb004644@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 2 Sep 2018 20:17:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338435 - in head/sys: dev/efidev kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: dev/efidev kern X-SVN-Commit-Revision: 338435 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 02 Sep 2018 20:17:53 -0000 Author: kib Date: Sun Sep 2 20:17:51 2018 New Revision: 338435 URL: https://svnweb.freebsd.org/changeset/base/338435 Log: Improve error messages from clock_if.m method failures. Print error message in verbose mode when CLOCK_SETTIME() clock_if.m method failed. For EFIRT RTC clock, add error code for the failure of CLOCK_GETTIME() report. Reviewed by: kevans Sponsored by: The FreeBSD Foundation MFC after: 1 week Approved by: re (rgrimes) Differential revision: https://reviews.freebsd.org/D16972 Modified: head/sys/dev/efidev/efirtc.c head/sys/kern/subr_rtc.c Modified: head/sys/dev/efidev/efirtc.c ============================================================================== --- head/sys/dev/efidev/efirtc.c Sun Sep 2 20:07:36 2018 (r338434) +++ head/sys/dev/efidev/efirtc.c Sun Sep 2 20:17:51 2018 (r338435) @@ -74,7 +74,8 @@ efirtc_probe(device_t dev) */ if ((error = efi_get_time(&tm)) != 0) { if (bootverbose) - device_printf(dev, "cannot read EFI realtime clock\n"); + device_printf(dev, "cannot read EFI realtime clock, " + "error %d\n", error); return (error); } device_set_desc(dev, "EFI Realtime Clock"); Modified: head/sys/kern/subr_rtc.c ============================================================================== --- head/sys/kern/subr_rtc.c Sun Sep 2 20:07:36 2018 (r338434) +++ head/sys/kern/subr_rtc.c Sun Sep 2 20:17:51 2018 (r338435) @@ -138,6 +138,7 @@ settime_task_func(void *arg, int pending) { struct timespec ts; struct rtc_instance *rtc; + int error; rtc = arg; if (!(rtc->flags & CLOCKF_SETTIME_NO_TS)) { @@ -150,7 +151,9 @@ settime_task_func(void *arg, int pending) ts.tv_sec = 0; ts.tv_nsec = 0; } - CLOCK_SETTIME(rtc->clockdev, &ts); + error = CLOCK_SETTIME(rtc->clockdev, &ts); + if (error != 0 && bootverbose) + device_printf(rtc->clockdev, "CLOCK_SETTIME error %d\n", error); } static void From owner-svn-src-head@freebsd.org Sun Sep 2 21:16: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 944EDFFAB37; Sun, 2 Sep 2018 21:16:44 +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 5183A88FEF; Sun, 2 Sep 2018 21:16:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C8EF1EA21; Sun, 2 Sep 2018 21:16:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w82LGiWm035828; Sun, 2 Sep 2018 21:16:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w82LGht4035827; Sun, 2 Sep 2018 21:16:43 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201809022116.w82LGht4035827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 2 Sep 2018 21:16:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338436 - in head/sys: amd64/include kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/include kern X-SVN-Commit-Revision: 338436 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 02 Sep 2018 21:16:44 -0000 Author: kib Date: Sun Sep 2 21:16:43 2018 New Revision: 338436 URL: https://svnweb.freebsd.org/changeset/base/338436 Log: Add amd64 mdthread fields needed for the upcoming EFI RT exception handling. This is split into a separate commit from the main change to make it easier to handle possible revert after upcoming KBI freeze. Reviewed by: kevans Sponsored by: The FreeBSD Foundation MFC after: 1 week Approved by: re (rgrimes) Differential revision: https://reviews.freebsd.org/D16972 Modified: head/sys/amd64/include/proc.h head/sys/kern/kern_thread.c Modified: head/sys/amd64/include/proc.h ============================================================================== --- head/sys/amd64/include/proc.h Sun Sep 2 20:17:51 2018 (r338435) +++ head/sys/amd64/include/proc.h Sun Sep 2 21:16:43 2018 (r338436) @@ -62,6 +62,8 @@ struct mdthread { register_t md_saved_flags; /* (k) */ register_t md_spurflt_addr; /* (k) Spurious page fault address. */ struct pmap_invl_gen md_invl_gen; + register_t md_efirt_tmp; /* (k) */ + int md_efirt_dis_pf; /* (k) */ }; struct mdproc { Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Sun Sep 2 20:17:51 2018 (r338435) +++ head/sys/kern/kern_thread.c Sun Sep 2 21:16:43 2018 (r338436) @@ -83,7 +83,7 @@ _Static_assert(offsetof(struct thread, td_pflags) == 0 "struct thread KBI td_pflags"); _Static_assert(offsetof(struct thread, td_frame) == 0x470, "struct thread KBI td_frame"); -_Static_assert(offsetof(struct thread, td_emuldata) == 0x518, +_Static_assert(offsetof(struct thread, td_emuldata) == 0x528, "struct thread KBI td_emuldata"); _Static_assert(offsetof(struct proc, p_flag) == 0xb0, "struct proc KBI p_flag"); From owner-svn-src-head@freebsd.org Sun Sep 2 21:37: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 EBAF2FFB082; Sun, 2 Sep 2018 21:37:07 +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 A908689930; Sun, 2 Sep 2018 21:37:07 +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 9F6631ED6C; Sun, 2 Sep 2018 21:37:07 +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 w82Lb7xl046201; Sun, 2 Sep 2018 21:37:07 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w82Lb5FK046191; Sun, 2 Sep 2018 21:37:05 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201809022137.w82Lb5FK046191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 2 Sep 2018 21:37:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338437 - in head/sys: amd64/amd64 amd64/include arm64/arm64 arm64/include conf dev/efidev modules/efirt sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/amd64 amd64/include arm64/arm64 arm64/include conf dev/efidev modules/efirt sys X-SVN-Commit-Revision: 338437 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 02 Sep 2018 21:37:08 -0000 Author: kib Date: Sun Sep 2 21:37:05 2018 New Revision: 338437 URL: https://svnweb.freebsd.org/changeset/base/338437 Log: Catch exceptions during EFI RT calls on amd64. This appeared to be required to have EFI RT support and EFI RTC enabled by default, because there are too many reports of faulting calls on many different machines. The knob is added to leave the exceptions unhandled to allow to debug the actual bugs. Reviewed by: kevans Sponsored by: The FreeBSD Foundation MFC after: 1 week Approved by: re (rgrimes) Differential revision: https://reviews.freebsd.org/D16972 Added: head/sys/amd64/amd64/efirt_support.S (contents, props changed) Modified: head/sys/amd64/amd64/efirt_machdep.c head/sys/amd64/amd64/genassym.c head/sys/amd64/include/efi.h head/sys/arm64/arm64/efirt_machdep.c head/sys/arm64/include/efi.h head/sys/conf/files.amd64 head/sys/dev/efidev/efirt.c head/sys/modules/efirt/Makefile head/sys/sys/efi.h Modified: head/sys/amd64/amd64/efirt_machdep.c ============================================================================== --- head/sys/amd64/amd64/efirt_machdep.c Sun Sep 2 21:16:43 2018 (r338436) +++ head/sys/amd64/amd64/efirt_machdep.c Sun Sep 2 21:37:05 2018 (r338437) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -266,6 +267,7 @@ efi_arch_enter(void) curpmap = PCPU_GET(curpmap); PMAP_LOCK_ASSERT(curpmap, MA_OWNED); + curthread->td_md.md_efirt_dis_pf = vm_fault_disable_pagefaults(); /* * IPI TLB shootdown handler invltlb_pcid_handler() reloads @@ -300,6 +302,7 @@ efi_arch_leave(void) curpmap->pm_pcids[PCPU_GET(cpuid)].pm_pcid : 0)); if (!pmap_pcid_enabled) invltlb(); + vm_fault_enable_pagefaults(curthread->td_md.md_efirt_dis_pf); } /* XXX debug stuff */ Added: head/sys/amd64/amd64/efirt_support.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/amd64/amd64/efirt_support.S Sun Sep 2 21:37:05 2018 (r338437) @@ -0,0 +1,116 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 The FreeBSD Foundation + * All rights reserved. + * + * This software was 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: + * 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$ + */ + +#include + +#include "assym.inc" + + .text +ENTRY(efi_rt_arch_call) + pushq %rbp + movq %rsp, %rbp + + movq %rbx, EC_RBX(%rdi) + movq %rsp, EC_RSP(%rdi) + movq %rbp, EC_RBP(%rdi) + movq %r12, EC_R12(%rdi) + movq %r13, EC_R13(%rdi) + movq %r14, EC_R14(%rdi) + movq %r15, EC_R15(%rdi) + movq PCPU(CURTHREAD), %rax + movq %rdi, TD_MD+MD_EFIRT_TMP(%rax) + movq PCPU(CURPCB), %rsi + + movl EC_ARGCNT(%rdi), %ecx + movl %ecx, %ebx + movl $4, %eax + cmpl %eax, %ecx + cmovbl %eax, %ecx + shll $3, %ecx + subq %rcx, %rsp + + cmpl $0, %ebx + jz 1f + movq EC_ARG1(%rdi), %rcx + decl %ebx + jz 1f + movq EC_ARG2(%rdi), %rdx + decl %ebx + jz 1f + movq EC_ARG3(%rdi), %r8 + decl %ebx + jz 1f + movq EC_ARG4(%rdi), %r9 + decl %ebx + jz 1f + movq EC_ARG5(%rdi), %rax + movq %rax, 4*8(%rsp) + decl %ebx + jz 1f + movq $efi_rt_panic_str, %rdi + call panic +1: movq EC_FPTR(%rdi), %rax + movq $efi_rt_fault, PCB_ONFAULT(%rsi) + callq *%rax + + movq PCPU(CURTHREAD), %rbx + movq TD_MD+MD_EFIRT_TMP(%rbx), %rdi + movq %rax, EC_EFI_STATUS(%rdi) + movq PCPU(CURPCB), %rsi + xorl %eax, %eax + movq %rax, PCB_ONFAULT(%rsi) + +efi_rt_arch_call_tail: + movq EC_R15(%rdi), %r15 + movq EC_R14(%rdi), %r14 + movq EC_R13(%rdi), %r13 + movq EC_R12(%rdi), %r12 + movq EC_RBP(%rdi), %rbp + movq EC_RSP(%rdi), %rsp + movq EC_RBX(%rdi), %rbx + + popq %rbp + ret +END(efi_rt_arch_call) + +ENTRY(efi_rt_fault) + xorl %eax, %eax + movq PCPU(CURPCB), %rsi + movq %rax, PCB_ONFAULT(%rsi) + movl $EFAULT, %eax + movq PCPU(CURTHREAD), %rbx + movq TD_MD+MD_EFIRT_TMP(%rbx), %rdi + jmp efi_rt_arch_call_tail +END(efi_rt_fault) + +efi_rt_panic_str: .asciz "efi_rt_arch_call: too many args" Modified: head/sys/amd64/amd64/genassym.c ============================================================================== --- head/sys/amd64/amd64/genassym.c Sun Sep 2 21:16:43 2018 (r338436) +++ head/sys/amd64/amd64/genassym.c Sun Sep 2 21:37:05 2018 (r338437) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include ASSYM(P_VMSPACE, offsetof(struct proc, p_vmspace)); ASSYM(VM_PMAP, offsetof(struct vmspace, vm_pmap)); @@ -77,12 +78,15 @@ ASSYM(P_MD, offsetof(struct proc, p_md)); ASSYM(MD_LDT, offsetof(struct mdproc, md_ldt)); ASSYM(MD_LDT_SD, offsetof(struct mdproc, md_ldt_sd)); +ASSYM(MD_EFIRT_TMP, offsetof(struct mdthread, md_efirt_tmp)); + ASSYM(TD_LOCK, offsetof(struct thread, td_lock)); ASSYM(TD_FLAGS, offsetof(struct thread, td_flags)); ASSYM(TD_PCB, offsetof(struct thread, td_pcb)); ASSYM(TD_PFLAGS, offsetof(struct thread, td_pflags)); ASSYM(TD_PROC, offsetof(struct thread, td_proc)); ASSYM(TD_FRAME, offsetof(struct thread, td_frame)); +ASSYM(TD_MD, offsetof(struct thread, td_md)); ASSYM(TDF_ASTPENDING, TDF_ASTPENDING); ASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED); @@ -249,3 +253,19 @@ ASSYM(__FreeBSD_version, __FreeBSD_version); #ifdef HWPMC_HOOKS ASSYM(PMC_FN_USER_CALLCHAIN, PMC_FN_USER_CALLCHAIN); #endif + +ASSYM(EC_EFI_STATUS, offsetof(struct efirt_callinfo, ec_efi_status)); +ASSYM(EC_FPTR, offsetof(struct efirt_callinfo, ec_fptr)); +ASSYM(EC_ARGCNT, offsetof(struct efirt_callinfo, ec_argcnt)); +ASSYM(EC_ARG1, offsetof(struct efirt_callinfo, ec_arg1)); +ASSYM(EC_ARG2, offsetof(struct efirt_callinfo, ec_arg2)); +ASSYM(EC_ARG3, offsetof(struct efirt_callinfo, ec_arg3)); +ASSYM(EC_ARG4, offsetof(struct efirt_callinfo, ec_arg4)); +ASSYM(EC_ARG5, offsetof(struct efirt_callinfo, ec_arg5)); +ASSYM(EC_RBX, offsetof(struct efirt_callinfo, ec_rbx)); +ASSYM(EC_RSP, offsetof(struct efirt_callinfo, ec_rsp)); +ASSYM(EC_RBP, offsetof(struct efirt_callinfo, ec_rbp)); +ASSYM(EC_R12, offsetof(struct efirt_callinfo, ec_r12)); +ASSYM(EC_R13, offsetof(struct efirt_callinfo, ec_r13)); +ASSYM(EC_R14, offsetof(struct efirt_callinfo, ec_r14)); +ASSYM(EC_R15, offsetof(struct efirt_callinfo, ec_r15)); Modified: head/sys/amd64/include/efi.h ============================================================================== --- head/sys/amd64/include/efi.h Sun Sep 2 21:16:43 2018 (r338436) +++ head/sys/amd64/include/efi.h Sun Sep 2 21:37:05 2018 (r338437) @@ -51,6 +51,27 @@ #define EFI_TIME_LOCK() mtx_lock(&atrtc_time_lock) #define EFI_TIME_UNLOCK() mtx_unlock(&atrtc_time_lock) #define EFI_TIME_OWNED() mtx_assert(&atrtc_time_lock, MA_OWNED) + +#define EFI_RT_HANDLE_FAULTS_DEFAULT 1 #endif + +struct efirt_callinfo { + const char *ec_name; + register_t ec_efi_status; + register_t ec_fptr; + register_t ec_argcnt; + register_t ec_arg1; + register_t ec_arg2; + register_t ec_arg3; + register_t ec_arg4; + register_t ec_arg5; + register_t ec_rbx; + register_t ec_rsp; + register_t ec_rbp; + register_t ec_r12; + register_t ec_r13; + register_t ec_r14; + register_t ec_r15; +}; #endif /* __AMD64_INCLUDE_EFI_H_ */ Modified: head/sys/arm64/arm64/efirt_machdep.c ============================================================================== --- head/sys/arm64/arm64/efirt_machdep.c Sun Sep 2 21:16:43 2018 (r338436) +++ head/sys/arm64/arm64/efirt_machdep.c Sun Sep 2 21:37:05 2018 (r338437) @@ -268,3 +268,10 @@ efi_arch_leave(void) "isb \n" : : "r"(td->td_proc->p_md.md_l0addr)); } + +int +efi_rt_arch_call(struct efirt_callinfo *ec) +{ + + panic("not implemented"); +} Modified: head/sys/arm64/include/efi.h ============================================================================== --- head/sys/arm64/include/efi.h Sun Sep 2 21:16:43 2018 (r338436) +++ head/sys/arm64/include/efi.h Sun Sep 2 21:37:05 2018 (r338437) @@ -39,6 +39,20 @@ #define EFI_TIME_LOCK() #define EFI_TIME_UNLOCK() #define EFI_TIME_OWNED() + +#define EFI_RT_HANDLE_FAULTS_DEFAULT 0 #endif + +struct efirt_callinfo { + const char *ec_name; + register_t ec_efi_status; + register_t ec_fptr; + register_t ec_argcnt; + register_t ec_arg1; + register_t ec_arg2; + register_t ec_arg3; + register_t ec_arg4; + register_t ec_arg5; +}; #endif /* __ARM64_INCLUDE_EFI_H_ */ Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Sun Sep 2 21:16:43 2018 (r338436) +++ head/sys/conf/files.amd64 Sun Sep 2 21:37:05 2018 (r338437) @@ -134,6 +134,7 @@ amd64/amd64/db_disasm.c optional ddb amd64/amd64/db_interface.c optional ddb amd64/amd64/db_trace.c optional ddb amd64/amd64/efirt_machdep.c optional efirt +amd64/amd64/efirt_support.S optional efirt amd64/amd64/elf_machdep.c standard amd64/amd64/exception.S standard amd64/amd64/fpu.c standard Modified: head/sys/dev/efidev/efirt.c ============================================================================== --- head/sys/dev/efidev/efirt.c Sun Sep 2 21:16:43 2018 (r338436) +++ head/sys/dev/efidev/efirt.c Sun Sep 2 21:37:05 2018 (r338437) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2004 Marcel Moolenaar * Copyright (c) 2001 Doug Rabson - * Copyright (c) 2016 The FreeBSD Foundation + * Copyright (c) 2016, 2018 The FreeBSD Foundation * All rights reserved. * * Portions of this software were developed by Konstantin Belousov @@ -293,22 +293,89 @@ efi_get_table(struct uuid *uuid, void **ptr) return (ENOENT); } +static int efi_rt_handle_faults = EFI_RT_HANDLE_FAULTS_DEFAULT; +SYSCTL_INT(_machdep, OID_AUTO, efi_rt_handle_faults, CTLFLAG_RWTUN, + &efi_rt_handle_faults, 0, + "Call EFI RT methods with fault handler wrapper around"); + static int -efi_get_time_locked(struct efi_tm *tm, struct efi_tmcap *tmcap) +efi_rt_arch_call_nofault(struct efirt_callinfo *ec) { - efi_status status; + + switch (ec->ec_argcnt) { + case 0: + ec->ec_efi_status = ((register_t (*)(void))ec->ec_fptr)(); + break; + case 1: + ec->ec_efi_status = ((register_t (*)(register_t))ec->ec_fptr) + (ec->ec_arg1); + break; + case 2: + ec->ec_efi_status = ((register_t (*)(register_t, register_t)) + ec->ec_fptr)(ec->ec_arg1, ec->ec_arg2); + break; + case 3: + ec->ec_efi_status = ((register_t (*)(register_t, register_t, + register_t))ec->ec_fptr)(ec->ec_arg1, ec->ec_arg2, + ec->ec_arg3); + break; + case 4: + ec->ec_efi_status = ((register_t (*)(register_t, register_t, + register_t, register_t))ec->ec_fptr)(ec->ec_arg1, + ec->ec_arg2, ec->ec_arg3, ec->ec_arg4); + break; + case 5: + ec->ec_efi_status = ((register_t (*)(register_t, register_t, + register_t, register_t, register_t))ec->ec_fptr)( + ec->ec_arg1, ec->ec_arg2, ec->ec_arg3, ec->ec_arg4, + ec->ec_arg5); + break; + default: + panic("efi_rt_arch_call: %d args", (int)ec->ec_argcnt); + } + + return (0); +} + +static int +efi_call(struct efirt_callinfo *ecp) +{ int error; - EFI_TIME_OWNED(); error = efi_enter(); if (error != 0) return (error); - status = efi_runtime->rt_gettime(tm, tmcap); + error = efi_rt_handle_faults ? efi_rt_arch_call(ecp) : + efi_rt_arch_call_nofault(ecp); efi_leave(); - error = efi_status_to_errno(status); + if (error == 0) + error = efi_status_to_errno(ecp->ec_efi_status); + else if (bootverbose) + printf("EFI %s call faulted, error %d\n", ecp->ec_name, error); return (error); } +#define EFI_RT_METHOD_PA(method) \ + ((uintptr_t)((struct efi_rt *)efi_phys_to_kva((uintptr_t) \ + efi_runtime))->method) + +static int +efi_get_time_locked(struct efi_tm *tm, struct efi_tmcap *tmcap) +{ + struct efirt_callinfo ec; + + EFI_TIME_OWNED(); + if (efi_runtime == NULL) + return (ENXIO); + bzero(&ec, sizeof(ec)); + ec.ec_name = "rt_gettime"; + ec.ec_argcnt = 2; + ec.ec_arg1 = (uintptr_t)tm; + ec.ec_arg2 = (uintptr_t)tmcap; + ec.ec_fptr = EFI_RT_METHOD_PA(rt_gettime); + return (efi_call(&ec)); +} + int efi_get_time(struct efi_tm *tm) { @@ -346,30 +413,35 @@ efi_get_time_capabilities(struct efi_tmcap *tmcap) int efi_reset_system(void) { - int error; + struct efirt_callinfo ec; - error = efi_enter(); - if (error != 0) - return (error); - efi_runtime->rt_reset(EFI_RESET_WARM, 0, 0, NULL); - efi_leave(); - return (EIO); + if (efi_runtime == NULL) + return (ENXIO); + bzero(&ec, sizeof(ec)); + ec.ec_name = "rt_reset"; + ec.ec_argcnt = 4; + ec.ec_arg1 = (uintptr_t)EFI_RESET_WARM; + ec.ec_arg1 = (uintptr_t)0; + ec.ec_arg1 = (uintptr_t)0; + ec.ec_arg1 = (uintptr_t)NULL; + ec.ec_fptr = EFI_RT_METHOD_PA(rt_reset); + return (efi_call(&ec)); } static int efi_set_time_locked(struct efi_tm *tm) { - efi_status status; - int error; + struct efirt_callinfo ec; EFI_TIME_OWNED(); - error = efi_enter(); - if (error != 0) - return (error); - status = efi_runtime->rt_settime(tm); - efi_leave(); - error = efi_status_to_errno(status); - return (error); + if (efi_runtime == NULL) + return (ENXIO); + bzero(&ec, sizeof(ec)); + ec.ec_name = "rt_settime"; + ec.ec_argcnt = 1; + ec.ec_arg1 = (uintptr_t)tm; + ec.ec_fptr = EFI_RT_METHOD_PA(rt_settime); + return (efi_call(&ec)); } int @@ -389,47 +461,57 @@ int efi_var_get(efi_char *name, struct uuid *vendor, uint32_t *attrib, size_t *datasize, void *data) { - efi_status status; - int error; + struct efirt_callinfo ec; - error = efi_enter(); - if (error != 0) - return (error); - status = efi_runtime->rt_getvar(name, vendor, attrib, datasize, data); - efi_leave(); - error = efi_status_to_errno(status); - return (error); + if (efi_runtime == NULL) + return (ENXIO); + bzero(&ec, sizeof(ec)); + ec.ec_argcnt = 5; + ec.ec_name = "rt_getvar"; + ec.ec_arg1 = (uintptr_t)name; + ec.ec_arg2 = (uintptr_t)vendor; + ec.ec_arg3 = (uintptr_t)attrib; + ec.ec_arg4 = (uintptr_t)datasize; + ec.ec_arg5 = (uintptr_t)data; + ec.ec_fptr = EFI_RT_METHOD_PA(rt_getvar); + return (efi_call(&ec)); } int efi_var_nextname(size_t *namesize, efi_char *name, struct uuid *vendor) { - efi_status status; - int error; + struct efirt_callinfo ec; - error = efi_enter(); - if (error != 0) - return (error); - status = efi_runtime->rt_scanvar(namesize, name, vendor); - efi_leave(); - error = efi_status_to_errno(status); - return (error); + if (efi_runtime == NULL) + return (ENXIO); + bzero(&ec, sizeof(ec)); + ec.ec_argcnt = 3; + ec.ec_name = "rt_scanvar"; + ec.ec_arg1 = (uintptr_t)namesize; + ec.ec_arg2 = (uintptr_t)name; + ec.ec_arg3 = (uintptr_t)vendor; + ec.ec_fptr = EFI_RT_METHOD_PA(rt_scanvar); + return (efi_call(&ec)); } int efi_var_set(efi_char *name, struct uuid *vendor, uint32_t attrib, size_t datasize, void *data) { - efi_status status; - int error; + struct efirt_callinfo ec; - error = efi_enter(); - if (error != 0) - return (error); - status = efi_runtime->rt_setvar(name, vendor, attrib, datasize, data); - efi_leave(); - error = efi_status_to_errno(status); - return (error); + if (efi_runtime == NULL) + return (ENXIO); + bzero(&ec, sizeof(ec)); + ec.ec_argcnt = 5; + ec.ec_name = "rt_setvar"; + ec.ec_arg1 = (uintptr_t)name; + ec.ec_arg2 = (uintptr_t)vendor; + ec.ec_arg3 = (uintptr_t)attrib; + ec.ec_arg4 = (uintptr_t)datasize; + ec.ec_arg5 = (uintptr_t)data; + ec.ec_fptr = EFI_RT_METHOD_PA(rt_setvar); + return (efi_call(&ec)); } static int Modified: head/sys/modules/efirt/Makefile ============================================================================== --- head/sys/modules/efirt/Makefile Sun Sep 2 21:16:43 2018 (r338436) +++ head/sys/modules/efirt/Makefile Sun Sep 2 21:37:05 2018 (r338437) @@ -8,4 +8,11 @@ SRCS= efirt.c efirt_machdep.c efidev.c SRCS+= efirtc.c SRCS+= device_if.h bus_if.h clock_if.h +.if ${MACHINE_CPUARCH} == "amd64" +SRCS+= efirt_support.S +efirt_support.o: efirt_support.S assym.inc + ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \ + ${.IMPSRC} -o ${.TARGET} +.endif + .include Modified: head/sys/sys/efi.h ============================================================================== --- head/sys/sys/efi.h Sun Sep 2 21:16:43 2018 (r338436) +++ head/sys/sys/efi.h Sun Sep 2 21:37:05 2018 (r338437) @@ -169,10 +169,13 @@ struct efi_systbl { extern vm_paddr_t efi_systbl_phys; +struct efirt_callinfo; + /* Internal MD EFI functions */ int efi_arch_enter(void); void efi_arch_leave(void); vm_offset_t efi_phys_to_kva(vm_paddr_t); +int efi_rt_arch_call(struct efirt_callinfo *); bool efi_create_1t1_map(struct efi_md *, int, int); void efi_destroy_1t1_map(void); From owner-svn-src-head@freebsd.org Mon Sep 3 03:23: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 92860FD50D5; Mon, 3 Sep 2018 03:23:10 +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 477E672A6A; Mon, 3 Sep 2018 03:23:10 +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 426E722611; Mon, 3 Sep 2018 03:23:10 +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 w833NAXd028687; Mon, 3 Sep 2018 03:23:10 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w833NAFC028686; Mon, 3 Sep 2018 03:23:10 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201809030323.w833NAFC028686@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 3 Sep 2018 03:23:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338438 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 338438 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 03 Sep 2018 03:23:10 -0000 Author: kevans Date: Mon Sep 3 03:23:09 2018 New Revision: 338438 URL: https://svnweb.freebsd.org/changeset/base/338438 Log: lualoader: Handle comma-separated kernels as well The format for kernels is documented as being space-delimited, but forthloader was more lenient on this and so people began to depend on it. A later pass will be made to document all of the fun features that forthloader allowed that may not be immediately obvious. Reported by: mmacy Approved by: re (kib) Modified: head/stand/lua/core.lua Modified: head/stand/lua/core.lua ============================================================================== --- head/stand/lua/core.lua Sun Sep 2 21:37:05 2018 (r338437) +++ head/stand/lua/core.lua Mon Sep 3 03:23:09 2018 (r338438) @@ -185,7 +185,7 @@ function core.kernelList() end if v ~= nil then - for n in v:gmatch("([^; ]+)[; ]?") do + for n in v:gmatch("([^;, ]+)[;, ]?") do if unique[n] == nil then i = i + 1 kernels[i] = n From owner-svn-src-head@freebsd.org Mon Sep 3 14:26: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 E3590FEB5AB; Mon, 3 Sep 2018 14:26:44 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9340586A17; Mon, 3 Sep 2018 14:26:44 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8986C11EE; Mon, 3 Sep 2018 14:26:44 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w83EQiKx077207; Mon, 3 Sep 2018 14:26:44 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w83EQihF077205; Mon, 3 Sep 2018 14:26:44 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201809031426.w83EQihF077205@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Mon, 3 Sep 2018 14:26:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338443 - in head: stand/defaults sys/security/audit X-SVN-Group: head X-SVN-Commit-Author: rwatson X-SVN-Commit-Paths: in head: stand/defaults sys/security/audit X-SVN-Commit-Revision: 338443 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 03 Sep 2018 14:26:45 -0000 Author: rwatson Date: Mon Sep 3 14:26:43 2018 New Revision: 338443 URL: https://svnweb.freebsd.org/changeset/base/338443 Log: The kernel DTrace audit provider (dtaudit) relies on auditd(8) to load /etc/security/audit_event to provide a list of audit event-number <-> name mappings. However, this occurs too late for anonymous tracing. With this change, adding 'audit_event_load="YES"' to /boot/loader.conf will cause the boot loader to preload the file, and then the kernel audit code will parse it to register an initial set of audit event-number <-> name mappings. Those mappings can later be updated by auditd(8) if the configuration file changes. Reviewed by: gnn, asomers, markj, allanjude Discussed with: jhb Approved by: re (kib) MFC after: 1 week Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D16589 Modified: head/stand/defaults/loader.conf head/sys/security/audit/audit_bsm_db.c Modified: head/stand/defaults/loader.conf ============================================================================== --- head/stand/defaults/loader.conf Mon Sep 3 08:57:09 2018 (r338442) +++ head/stand/defaults/loader.conf Mon Sep 3 14:26:43 2018 (r338443) @@ -67,6 +67,11 @@ acpi_dsdt_name="/boot/acpi_dsdt.aml" # Override DSDT in BIOS by this file acpi_video_load="NO" # Load the ACPI video extension driver +### Audit settings ######################################### +audit_event_load="NO" # Preload audit_event config +audit_event_name="/etc/security/audit_event" +audit_event_type="etc_security_audit_event" + ### Initial memory disk settings ########################### #mdroot_load="YES" # The "mdroot" prefix is arbitrary. #mdroot_type="md_image" # Create md(4) disk at boot. Modified: head/sys/security/audit/audit_bsm_db.c ============================================================================== --- head/sys/security/audit/audit_bsm_db.c Mon Sep 3 08:57:09 2018 (r338442) +++ head/sys/security/audit/audit_bsm_db.c Mon Sep 3 14:26:43 2018 (r338443) @@ -1,6 +1,6 @@ /* * Copyright (c) 1999-2009 Apple Inc. - * Copyright (c) 2005, 2016-2017 Robert N. M. Watson + * Copyright (c) 2005, 2016-2018 Robert N. M. Watson * All rights reserved. * * Portions of this software were developed by BAE Systems, the University of @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -91,6 +92,7 @@ static struct evclass_list evclass_hash[EVCLASSMAP_HAS * struct evname_elem is defined in audit_private.h so that audit_dtrace.c can * use the definition. */ +#define EVNAMEMAP_HASH_TABLE_MODULE "etc_security_audit_event" #define EVNAMEMAP_HASH_TABLE_SIZE 251 struct evname_list { LIST_HEAD(, evname_elem) enl_head; @@ -261,6 +263,85 @@ au_evnamemap_insert(au_event_t event, const char *name EVNAMEMAP_WUNLOCK(); } +/* + * If /etc/security/audit_event has been preloaded by the boot loader, parse + * it to build an initial set of event number<->name mappings. + */ +static void +au_evnamemap_init_preload(void) +{ + caddr_t kmdp; + char *endptr, *line, *nextline, *ptr; + const char *evnum_str, *evname; + size_t size; + long evnum; + u_int lineno; + + kmdp = preload_search_by_type(EVNAMEMAP_HASH_TABLE_MODULE); + if (kmdp == NULL) + return; + ptr = preload_fetch_addr(kmdp); + size = preload_fetch_size(kmdp); + + /* + * Parse preloaded configuration file "in place". Assume that the + * last character is a new line, meaning that we can replace it with a + * nul byte safely. We can then use strsep(3) to process the full + * buffer. + */ + ptr[size - 1] = '\0'; + + /* + * Process line by line. + */ + nextline = ptr; + lineno = 0; + while ((line = strsep(&nextline, "\n")) != NULL) { + /* + * Skip any leading white space. + */ + while (line[0] == ' ' || line[0] == '\t') + line++; + + /* + * Skip blank lines and comment lines. + */ + if (line[0] == '\0' || line[0] == '#') { + lineno++; + continue; + } + + /* + * Parse each line -- ":"-separated tuple of event number, + * event name, and other material we are less interested in. + */ + evnum_str = strsep(&line, ":"); + if (evnum_str == NULL || *evnum_str == '\0') { + printf("%s: Invalid line %u - evnum strsep\n", + __func__, lineno); + lineno++; + continue; + } + evnum = strtol(evnum_str, &endptr, 10); + if (*evnum_str == '\0' || *endptr != '\0' || + evnum <= 0 || evnum > UINT16_MAX) { + printf("%s: Invalid line %u - evnum strtol\n", + __func__, lineno); + lineno++; + continue; + } + evname = strsep(&line, ":"); + if (evname == NULL || *evname == '\0') { + printf("%s: Invalid line %u - evname strsp\n", + __func__, lineno); + lineno++; + continue; + } + au_evnamemap_insert(evnum, evname); + lineno++; + } +} + void au_evnamemap_init(void) { @@ -269,13 +350,7 @@ au_evnamemap_init(void) EVNAMEMAP_LOCK_INIT(); for (i = 0; i < EVNAMEMAP_HASH_TABLE_SIZE; i++) LIST_INIT(&evnamemap_hash[i].enl_head); - - /* - * XXXRW: Unlike the event-to-class mapping, we don't attempt to - * pre-populate the list. Perhaps we should...? But not sure we - * really want to duplicate /etc/security/audit_event in the kernel - * -- and we'd need a way to remove names? - */ + au_evnamemap_init_preload(); } /* From owner-svn-src-head@freebsd.org Mon Sep 3 14:34: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 72BAEFEBAA3; Mon, 3 Sep 2018 14:34:11 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2493F8712D; Mon, 3 Sep 2018 14:34:11 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F80413C2; Mon, 3 Sep 2018 14:34:11 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w83EYBgl082188; Mon, 3 Sep 2018 14:34:11 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w83EYAsJ082184; Mon, 3 Sep 2018 14:34:10 GMT (envelope-from br@FreeBSD.org) Message-Id: <201809031434.w83EYAsJ082184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 3 Sep 2018 14:34:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338444 - in head/sys: cddl/contrib/opensolaris/uts/common/sys cddl/dev/dtrace/riscv cddl/dev/fbt/riscv riscv/conf riscv/include X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: cddl/contrib/opensolaris/uts/common/sys cddl/dev/dtrace/riscv cddl/dev/fbt/riscv riscv/conf riscv/include X-SVN-Commit-Revision: 338444 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 03 Sep 2018 14:34:11 -0000 Author: br Date: Mon Sep 3 14:34:09 2018 New Revision: 338444 URL: https://svnweb.freebsd.org/changeset/base/338444 Log: Add support for 'C'-compressed ISA extension to DTrace FBT provider. Approved by: re (kib) Sponsored by: DARPA, AFRL Deleted: head/sys/riscv/include/riscv_opcode.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h head/sys/cddl/dev/dtrace/riscv/dtrace_subr.c head/sys/cddl/dev/fbt/riscv/fbt_isa.c head/sys/riscv/conf/GENERIC head/sys/riscv/include/riscvreg.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Mon Sep 3 14:26:43 2018 (r338443) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Mon Sep 3 14:34:09 2018 (r338444) @@ -2496,12 +2496,11 @@ extern void dtrace_helpers_destroy(proc_t *); #elif defined(__riscv) -#define SD_RA_SP_MASK 0x01fff07f -#define SD_RA_SP 0x00113023 - #define DTRACE_INVOP_SD 1 -#define DTRACE_INVOP_RET 2 -#define DTRACE_INVOP_NOP 3 +#define DTRACE_INVOP_C_SDSP 2 +#define DTRACE_INVOP_RET 3 +#define DTRACE_INVOP_C_RET 4 +#define DTRACE_INVOP_NOP 5 #endif Modified: head/sys/cddl/dev/dtrace/riscv/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/riscv/dtrace_subr.c Mon Sep 3 14:26:43 2018 (r338443) +++ head/sys/cddl/dev/dtrace/riscv/dtrace_subr.c Mon Sep 3 14:34:09 2018 (r338444) @@ -19,7 +19,7 @@ * * CDDL HEADER END * - * Portions Copyright 2016 Ruslan Bukin + * Portions Copyright 2016-2018 Ruslan Bukin * * $FreeBSD$ * @@ -42,8 +42,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include -#include #include #include #include @@ -77,7 +77,6 @@ dtrace_invop(uintptr_t addr, struct trapframe *frame, return (0); } - void dtrace_invop_add(int (*func)(uintptr_t, struct trapframe *, uintptr_t)) { @@ -238,29 +237,58 @@ dtrace_probe_error(dtrace_state_t *state, dtrace_epid_ } static int +match_opcode(uint32_t insn, int match, int mask) +{ + + if (((insn ^ match) & mask) == 0) + return (1); + + return (0); +} + +static int dtrace_invop_start(struct trapframe *frame) { - int data, invop, reg, update_sp; - register_t arg1, arg2; register_t *sp; + uint32_t uimm; uint32_t imm; - InstFmt i; - int offs; - int tmp; + int invop; invop = dtrace_invop(frame->tf_sepc, frame, frame->tf_sepc); - if (invop == RISCV_INSN_RET) { + if (match_opcode(invop, (MATCH_SD | RS2_RA | RS1_SP), + (MASK_SD | RS2_MASK | RS1_MASK))) { + /* Non-compressed store of ra to sp */ + imm = (invop >> 7) & 0x1f; + imm |= ((invop >> 25) & 0x7f) << 5; + sp = (register_t *)((uint8_t *)frame->tf_sp + imm); + *sp = frame->tf_ra; + frame->tf_sepc += INSN_SIZE; + return (0); + } + + if (match_opcode(invop, (MATCH_JALR | (X_RA << RS1_SHIFT)), + (MASK_JALR | RD_MASK | RS1_MASK | IMM_MASK))) { + /* Non-compressed ret */ frame->tf_sepc = frame->tf_ra; return (0); } - if ((invop & SD_RA_SP_MASK) == SD_RA_SP) { - i.word = invop; - imm = i.SType.imm0_4 | (i.SType.imm5_11 << 5); - sp = (register_t *)((uint8_t *)frame->tf_sp + imm); + if (match_opcode(invop, (MATCH_C_SDSP | RS2_C_RA), + (MASK_C_SDSP | RS2_C_MASK))) { + /* 'C'-compressed store of ra to sp */ + uimm = ((invop >> 10) & 0x7) << 3; + uimm |= ((invop >> 7) & 0x7) << 6; + sp = (register_t *)((uint8_t *)frame->tf_sp + uimm); *sp = frame->tf_ra; - frame->tf_sepc += INSN_SIZE; + frame->tf_sepc += INSN_C_SIZE; + return (0); + } + + if (match_opcode(invop, (MATCH_C_JR | (X_RA << RD_SHIFT)), + (MASK_C_JR | RD_MASK))) { + /* 'C'-compressed ret */ + frame->tf_sepc = frame->tf_ra; return (0); } Modified: head/sys/cddl/dev/fbt/riscv/fbt_isa.c ============================================================================== --- head/sys/cddl/dev/fbt/riscv/fbt_isa.c Mon Sep 3 14:26:43 2018 (r338443) +++ head/sys/cddl/dev/fbt/riscv/fbt_isa.c Mon Sep 3 14:34:09 2018 (r338444) @@ -21,7 +21,7 @@ * Portions Copyright 2006-2008 John Birrell jb@freebsd.org * Portions Copyright 2013 Justin Hibbits jhibbits@freebsd.org * Portions Copyright 2013 Howard Su howardsu@freebsd.org - * Portions Copyright 2016 Ruslan Bukin + * Portions Copyright 2016-2018 Ruslan Bukin * * $FreeBSD$ */ @@ -37,10 +37,12 @@ #include #include +#include #include "fbt.h" -#define FBT_PATCHVAL (RISCV_INSN_BREAK) +#define FBT_C_PATCHVAL MATCH_C_EBREAK +#define FBT_PATCHVAL MATCH_EBREAK #define FBT_ENTRY "entry" #define FBT_RETURN "return" @@ -73,10 +75,64 @@ void fbt_patch_tracepoint(fbt_probe_t *fbt, fbt_patchval_t val) { - *fbt->fbtp_patchpoint = val; - cpu_icache_sync_range((vm_offset_t)fbt->fbtp_patchpoint, 4); + switch(fbt->fbtp_patchval) { + case FBT_C_PATCHVAL: + *(uint16_t *)fbt->fbtp_patchpoint = (uint16_t)val; + cpu_icache_sync_range((vm_offset_t)fbt->fbtp_patchpoint, 2); + break; + case FBT_PATCHVAL: + *fbt->fbtp_patchpoint = val; + cpu_icache_sync_range((vm_offset_t)fbt->fbtp_patchpoint, 4); + break; + }; } +static int +match_opcode(uint32_t insn, int match, int mask) +{ + + if (((insn ^ match) & mask) == 0) + return (1); + + return (0); +} + +static int +check_c_ret(uint32_t **instr) +{ + uint16_t *instr1; + int i; + + for (i = 0; i < 2; i++) { + instr1 = (uint16_t *)(*instr) + i; + if (match_opcode(*instr1, (MATCH_C_JR | (X_RA << RD_SHIFT)), + (MASK_C_JR | RD_MASK))) { + *instr = (uint32_t *)instr1; + return (1); + } + } + + return (0); +} + +static int +check_c_sdsp(uint32_t **instr) +{ + uint16_t *instr1; + int i; + + for (i = 0; i < 2; i++) { + instr1 = (uint16_t *)(*instr) + i; + if (match_opcode(*instr1, (MATCH_C_SDSP | RS2_C_RA), + (MASK_C_SDSP | RS2_C_MASK))) { + *instr = (uint32_t *)instr1; + return (1); + } + } + + return (0); +} + int fbt_provide_module_function(linker_file_t lf, int symindx, linker_symval_t *symval, void *opaque) @@ -85,6 +141,8 @@ fbt_provide_module_function(linker_file_t lf, int symi uint32_t *instr, *limit; const char *name; char *modname; + int patchval; + int rval; modname = opaque; name = symval->name; @@ -98,8 +156,20 @@ fbt_provide_module_function(linker_file_t lf, int symi /* Look for sd operation */ for (; instr < limit; instr++) { - if ((*instr & SD_RA_SP_MASK) == SD_RA_SP) + /* Look for a non-compressed store of ra to sp */ + if (match_opcode(*instr, (MATCH_SD | RS2_RA | RS1_SP), + (MASK_SD | RS2_MASK | RS1_MASK))) { + rval = DTRACE_INVOP_SD; + patchval = FBT_PATCHVAL; break; + } + + /* Look for a 'C'-compressed store of ra to sp. */ + if (check_c_sdsp(&instr)) { + rval = DTRACE_INVOP_C_SDSP; + patchval = FBT_C_PATCHVAL; + break; + } } if (instr >= limit) @@ -113,8 +183,8 @@ fbt_provide_module_function(linker_file_t lf, int symi fbt->fbtp_ctl = lf; fbt->fbtp_loadcnt = lf->loadcnt; fbt->fbtp_savedval = *instr; - fbt->fbtp_patchval = FBT_PATCHVAL; - fbt->fbtp_rval = DTRACE_INVOP_SD; + fbt->fbtp_patchval = patchval; + fbt->fbtp_rval = rval; fbt->fbtp_symindx = symindx; fbt->fbtp_hashnext = fbt_probetab[FBT_ADDR2NDX(instr)]; @@ -125,8 +195,20 @@ fbt_provide_module_function(linker_file_t lf, int symi retfbt = NULL; again: for (; instr < limit; instr++) { - if (*instr == RISCV_INSN_RET) + /* Look for non-compressed return */ + if (match_opcode(*instr, (MATCH_JALR | (X_RA << RS1_SHIFT)), + (MASK_JALR | RD_MASK | RS1_MASK | IMM_MASK))) { + rval = DTRACE_INVOP_RET; + patchval = FBT_PATCHVAL; break; + } + + /* Look for 'C'-compressed return */ + if (check_c_ret(&instr)) { + rval = DTRACE_INVOP_C_RET; + patchval = FBT_C_PATCHVAL; + break; + } } if (instr >= limit) @@ -150,9 +232,9 @@ again: fbt->fbtp_ctl = lf; fbt->fbtp_loadcnt = lf->loadcnt; fbt->fbtp_symindx = symindx; - fbt->fbtp_rval = DTRACE_INVOP_RET; + fbt->fbtp_rval = rval; fbt->fbtp_savedval = *instr; - fbt->fbtp_patchval = FBT_PATCHVAL; + fbt->fbtp_patchval = patchval; fbt->fbtp_hashnext = fbt_probetab[FBT_ADDR2NDX(instr)]; fbt_probetab[FBT_ADDR2NDX(instr)] = fbt; Modified: head/sys/riscv/conf/GENERIC ============================================================================== --- head/sys/riscv/conf/GENERIC Mon Sep 3 14:26:43 2018 (r338443) +++ head/sys/riscv/conf/GENERIC Mon Sep 3 14:34:09 2018 (r338444) @@ -88,6 +88,15 @@ device vtnet # VirtIO Ethernet device device virtio_blk # VirtIO Block device device virtio_mmio # VirtIO MMIO bus +# DTrace support +# device dtrace +# device dtrace_profile +# device dtrace_sdt +# device dtrace_fbt +# device dtrace_systrace +# device dtrace_prototype +# device dtraceall + # Serial (COM) ports device uart # Generic UART driver device uart_ns8250 # ns8250-type UART driver Modified: head/sys/riscv/include/riscvreg.h ============================================================================== --- head/sys/riscv/include/riscvreg.h Mon Sep 3 14:26:43 2018 (r338443) +++ head/sys/riscv/include/riscvreg.h Mon Sep 3 14:34:09 2018 (r338444) @@ -157,10 +157,31 @@ #define XLEN 8 #define INSN_SIZE 4 +#define INSN_C_SIZE 2 -#define RISCV_INSN_NOP 0x00000013 -#define RISCV_INSN_BREAK 0x00100073 -#define RISCV_INSN_RET 0x00008067 +#define X_RA 1 +#define X_SP 2 +#define X_GP 3 +#define X_TP 4 +#define X_T0 5 +#define X_T1 6 +#define X_T2 7 +#define X_T3 28 + +#define RD_SHIFT 7 +#define RD_MASK (0x1f << RD_SHIFT) +#define RS1_SHIFT 15 +#define RS1_MASK (0x1f << RS1_SHIFT) +#define RS1_SP (X_SP << RS1_SHIFT) +#define RS2_SHIFT 20 +#define RS2_MASK (0x1f << RS2_SHIFT) +#define RS2_RA (X_RA << RS2_SHIFT) +#define IMM_SHIFT 20 +#define IMM_MASK (0xfff << IMM_SHIFT) + +#define RS2_C_SHIFT 2 +#define RS2_C_MASK (0x1f << RS2_C_SHIFT) +#define RS2_C_RA (X_RA << RS2_C_SHIFT) #define CSR_ZIMM(val) \ (__builtin_constant_p(val) && ((u_long)(val) < 32)) From owner-svn-src-head@freebsd.org Mon Sep 3 14:43: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 1F96FFEC03C; Mon, 3 Sep 2018 14:43:18 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C8235880E8; Mon, 3 Sep 2018 14:43:17 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8EB31556; Mon, 3 Sep 2018 14:43:17 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w83EhHTV087282; Mon, 3 Sep 2018 14:43:17 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w83EhH4O087279; Mon, 3 Sep 2018 14:43:17 GMT (envelope-from br@FreeBSD.org) Message-Id: <201809031443.w83EhH4O087279@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 3 Sep 2018 14:43:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338445 - in head: share/mk stand sys/conf X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head: share/mk stand sys/conf X-SVN-Commit-Revision: 338445 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 03 Sep 2018 14:43:18 -0000 Author: br Date: Mon Sep 3 14:43:16 2018 New Revision: 338445 URL: https://svnweb.freebsd.org/changeset/base/338445 Log: Enable 'C'-compressed ISA extension. This was disabled recently due to lack of support in KDB disassembler and DTrace FBT provider. Support for 'C'-extension to both of these was added, so we can now enable 'C'-extension. This reduces size of the kernel important for low-end embedded devices, and saves cache footprint for high perfomance machines. Approved by: re (kib) Sponsored by: DARPA, AFRL Modified: head/share/mk/bsd.cpu.mk head/stand/defs.mk head/sys/conf/kern.mk Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Mon Sep 3 14:34:09 2018 (r338444) +++ head/share/mk/bsd.cpu.mk Mon Sep 3 14:43:16 2018 (r338445) @@ -367,9 +367,9 @@ CFLAGS += -mcpu=8540 -Wa,-me500 -mspe=yes -mabi=spe -m .if ${MACHINE_CPUARCH} == "riscv" .if ${MACHINE_ARCH:Mriscv*sf} -CFLAGS += -march=rv64ima -mabi=lp64 +CFLAGS += -march=rv64imac -mabi=lp64 .else -CFLAGS += -march=rv64imafd -mabi=lp64d +CFLAGS += -march=rv64imafdc -mabi=lp64d .endif .endif Modified: head/stand/defs.mk ============================================================================== --- head/stand/defs.mk Mon Sep 3 14:34:09 2018 (r338444) +++ head/stand/defs.mk Mon Sep 3 14:43:16 2018 (r338445) @@ -108,7 +108,7 @@ CFLAGS+= -ffreestanding ${CFLAGS_NO_SIMD} .if ${MACHINE_CPUARCH} == "aarch64" CFLAGS+= -mgeneral-regs-only -fPIC .elif ${MACHINE_CPUARCH} == "riscv" -CFLAGS+= -march=rv64ima -mabi=lp64 +CFLAGS+= -march=rv64imac -mabi=lp64 .else CFLAGS+= -msoft-float .endif Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Mon Sep 3 14:34:09 2018 (r338444) +++ head/sys/conf/kern.mk Mon Sep 3 14:43:16 2018 (r338445) @@ -131,7 +131,7 @@ INLINE_LIMIT?= 8000 .endif .if ${MACHINE_CPUARCH} == "riscv" -CFLAGS.gcc+= -mcmodel=medany -march=rv64imafd -mabi=lp64 +CFLAGS.gcc+= -mcmodel=medany -march=rv64imafdc -mabi=lp64 INLINE_LIMIT?= 8000 .endif From owner-svn-src-head@freebsd.org Mon Sep 3 16: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 1E236FED994; Mon, 3 Sep 2018 16:07:10 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:13b:39f::9f:25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B247F8A87D; Mon, 3 Sep 2018 16:07:09 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 667E58D4A14C; Mon, 3 Sep 2018 16:07:01 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id C2ED3D1F83A; Mon, 3 Sep 2018 16:07:00 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id aK8-cdZEIEPt; Mon, 3 Sep 2018 16:06:59 +0000 (UTC) Received: from [128.232.18.112] (fresh-ayiya.sbone.de [IPv6:fde9:577b:c1a9:f001::2]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 4632BD1F833; Mon, 3 Sep 2018 16:06:59 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Matt Macy" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335919 - head/sys/netinet6 Date: Mon, 03 Sep 2018 16:06:57 +0000 X-Mailer: MailMate (2.0BETAr6116) Message-ID: <7C27CD20-FDDD-4048-9EC1-A88C148C4D65@lists.zabbadoz.net> In-Reply-To: <201807032330.w63NUr6P074115@repo.freebsd.org> References: <201807032330.w63NUr6P074115@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 03 Sep 2018 16:07:10 -0000 On 3 Jul 2018, at 23:30, Matt Macy wrote: > Author: mmacy > Date: Tue Jul 3 23:30:53 2018 > New Revision: 335919 > URL: https://svnweb.freebsd.org/changeset/base/335919 > > Log: > udp6_input: validate inpcb before use > > When traversing pcbinfo lists (rather than calling lookup) we need > to > explicitly validate an inpcb before use. > > Modified: > head/sys/netinet6/udp6_usrreq.c > why is this needed in udp6 and not for udp where the code looks familiarly similar? /bz From owner-svn-src-head@freebsd.org Mon Sep 3 17:39: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 86E0EFEF74C; Mon, 3 Sep 2018 17:39:10 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 487628D59A; Mon, 3 Sep 2018 17:39:10 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F5AD3106; Mon, 3 Sep 2018 17:39:10 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w83HdAK4074902; Mon, 3 Sep 2018 17:39:10 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w83HdAB9074901; Mon, 3 Sep 2018 17:39:10 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201809031739.w83HdAB9074901@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 3 Sep 2018 17:39:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338446 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 338446 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 03 Sep 2018 17:39:10 -0000 Author: markj Date: Mon Sep 3 17:39:09 2018 New Revision: 338446 URL: https://svnweb.freebsd.org/changeset/base/338446 Log: Use the correct malloc type in in_pcblbgroup_free(). Approved by: re (kib) Sponsored by: The FreeBSD Foundation Modified: head/sys/netinet/in_pcb.c Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Mon Sep 3 14:43:16 2018 (r338445) +++ head/sys/netinet/in_pcb.c Mon Sep 3 17:39:09 2018 (r338446) @@ -244,7 +244,7 @@ in_pcblbgroup_free(struct inpcblbgroup *grp) { LIST_REMOVE(grp, il_list); - free(grp, M_TEMP); + free(grp, M_PCB); } static struct inpcblbgroup * From owner-svn-src-head@freebsd.org Mon Sep 3 22:10: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 76AEDFF7F9E; Mon, 3 Sep 2018 22:10:50 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F4D07869D; Mon, 3 Sep 2018 22:10:50 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A46860EC; Mon, 3 Sep 2018 22:10:50 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w83MAoFU018429; Mon, 3 Sep 2018 22:10:50 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w83MAo0S018428; Mon, 3 Sep 2018 22:10:50 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201809032210.w83MAo0S018428@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 3 Sep 2018 22:10:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338447 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 338447 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 03 Sep 2018 22:10:50 -0000 Author: bz Date: Mon Sep 3 22:10:49 2018 New Revision: 338447 URL: https://svnweb.freebsd.org/changeset/base/338447 Log: Rather than duplicating the functionality of a macro after r322866 use the already existing one. No functional changes. Reviewed by: karels, ae Approved by: re (rgrimes) Differential Revision: https://reviews.freebsd.org/D17004 Modified: head/sys/net/route.h Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Mon Sep 3 17:39:09 2018 (r338446) +++ head/sys/net/route.h Mon Sep 3 22:10:49 2018 (r338447) @@ -410,10 +410,8 @@ struct rt_addrinfo { } while (0) #define RO_RTFREE(_ro) do { \ - if ((_ro)->ro_rt) { \ - RT_LOCK((_ro)->ro_rt); \ - RTFREE_LOCKED((_ro)->ro_rt); \ - } \ + if ((_ro)->ro_rt) \ + RTFREE((_ro)->ro_rt); \ } while (0) #define RO_INVALIDATE_CACHE(ro) do { \ From owner-svn-src-head@freebsd.org Mon Sep 3 22:12: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 7945BFF81CF; Mon, 3 Sep 2018 22:12:49 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2FEDC78EBD; Mon, 3 Sep 2018 22:12:49 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2AEDC6268; Mon, 3 Sep 2018 22:12:49 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w83MCnpb022271; Mon, 3 Sep 2018 22:12:49 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w83MCnC6022270; Mon, 3 Sep 2018 22:12:49 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201809032212.w83MCnC6022270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 3 Sep 2018 22:12:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338448 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 338448 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 03 Sep 2018 22:12:49 -0000 Author: bz Date: Mon Sep 3 22:12:48 2018 New Revision: 338448 URL: https://svnweb.freebsd.org/changeset/base/338448 Log: As discussed in D6262 post-commit review, change inp_route to inp_route6 for IPv6 code after r301217. This was most likely a c&p error from the legacy IP code, which did not matter as it is a union and both structures have the same layout at the beginning. No functional changes. Reviewed by: karels, ae Approved by: re (rgrimes) Differential Revision: https://reviews.freebsd.org/D17005 Modified: head/sys/netinet6/in6_pcb.c Modified: head/sys/netinet6/in6_pcb.c ============================================================================== --- head/sys/netinet6/in6_pcb.c Mon Sep 3 22:10:49 2018 (r338447) +++ head/sys/netinet6/in6_pcb.c Mon Sep 3 22:12:48 2018 (r338448) @@ -853,8 +853,8 @@ in6_losing(struct inpcb *in6p) RTFREE(in6p->inp_route6.ro_rt); in6p->inp_route6.ro_rt = (struct rtentry *)NULL; } - if (in6p->inp_route.ro_lle) - LLE_FREE(in6p->inp_route.ro_lle); /* zeros ro_lle */ + if (in6p->inp_route6.ro_lle) + LLE_FREE(in6p->inp_route6.ro_lle); /* zeros ro_lle */ return; } @@ -870,8 +870,8 @@ in6_rtchange(struct inpcb *inp, int errno) RTFREE(inp->inp_route6.ro_rt); inp->inp_route6.ro_rt = (struct rtentry *)NULL; } - if (inp->inp_route.ro_lle) - LLE_FREE(inp->inp_route.ro_lle); /* zeros ro_lle */ + if (inp->inp_route6.ro_lle) + LLE_FREE(inp->inp_route6.ro_lle); /* zeros ro_lle */ return inp; } From owner-svn-src-head@freebsd.org Mon Sep 3 22:14: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 1A9E2FF82B2; Mon, 3 Sep 2018 22:14:38 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C08257907D; Mon, 3 Sep 2018 22:14:37 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B9EF46271; Mon, 3 Sep 2018 22:14:37 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w83MEbiD022388; Mon, 3 Sep 2018 22:14:37 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w83MEbTa022387; Mon, 3 Sep 2018 22:14:37 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201809032214.w83MEbTa022387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 3 Sep 2018 22:14:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338449 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 338449 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 03 Sep 2018 22:14:38 -0000 Author: bz Date: Mon Sep 3 22:14:37 2018 New Revision: 338449 URL: https://svnweb.freebsd.org/changeset/base/338449 Log: Replicate r307234 from legacy IP to IPv6 code, using the RO_RTFREE() macro rather than hand crafted code. No functional changes. Reviewed by: karels Approved by: re (rgrimes) Differential Revision: https://reviews.freebsd.org/D17006 Modified: head/sys/netinet6/in6_pcb.c Modified: head/sys/netinet6/in6_pcb.c ============================================================================== --- head/sys/netinet6/in6_pcb.c Mon Sep 3 22:12:48 2018 (r338448) +++ head/sys/netinet6/in6_pcb.c Mon Sep 3 22:14:37 2018 (r338449) @@ -849,10 +849,7 @@ void in6_losing(struct inpcb *in6p) { - if (in6p->inp_route6.ro_rt) { - RTFREE(in6p->inp_route6.ro_rt); - in6p->inp_route6.ro_rt = (struct rtentry *)NULL; - } + RO_RTFREE(&in6p->inp_route6); if (in6p->inp_route6.ro_lle) LLE_FREE(in6p->inp_route6.ro_lle); /* zeros ro_lle */ return; @@ -866,10 +863,7 @@ struct inpcb * in6_rtchange(struct inpcb *inp, int errno) { - if (inp->inp_route6.ro_rt) { - RTFREE(inp->inp_route6.ro_rt); - inp->inp_route6.ro_rt = (struct rtentry *)NULL; - } + RO_RTFREE(&in6p->inp_route6); if (inp->inp_route6.ro_lle) LLE_FREE(inp->inp_route6.ro_lle); /* zeros ro_lle */ return inp; From owner-svn-src-head@freebsd.org Mon Sep 3 22:27: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 03977FF85DF; Mon, 3 Sep 2018 22:27:29 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AB69F79589; Mon, 3 Sep 2018 22:27:28 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A075C6423; Mon, 3 Sep 2018 22:27:28 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w83MRSPc027507; Mon, 3 Sep 2018 22:27:28 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w83MRSq1027505; Mon, 3 Sep 2018 22:27:28 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201809032227.w83MRSq1027505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 3 Sep 2018 22:27:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338450 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 338450 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 03 Sep 2018 22:27:29 -0000 Author: bz Date: Mon Sep 3 22:27:27 2018 New Revision: 338450 URL: https://svnweb.freebsd.org/changeset/base/338450 Log: Replicate r328271 from legacy IP to IPv6 using a single macro to clear L2 and L3 route caches. Also mark one function argument as __unused. Reviewed by: karels, ae Approved by: re (rgrimes) Differential Revision: https://reviews.freebsd.org/D17007 Modified: head/sys/netinet6/in6_pcb.c head/sys/netinet6/ip6_output.c Modified: head/sys/netinet6/in6_pcb.c ============================================================================== --- head/sys/netinet6/in6_pcb.c Mon Sep 3 22:14:37 2018 (r338449) +++ head/sys/netinet6/in6_pcb.c Mon Sep 3 22:27:27 2018 (r338450) @@ -846,13 +846,10 @@ in6_pcbpurgeif0(struct inpcbinfo *pcbinfo, struct ifne * (by a redirect), time to try a default gateway again. */ void -in6_losing(struct inpcb *in6p) +in6_losing(struct inpcb *inp) { - RO_RTFREE(&in6p->inp_route6); - if (in6p->inp_route6.ro_lle) - LLE_FREE(in6p->inp_route6.ro_lle); /* zeros ro_lle */ - return; + RO_INVALIDATE_CACHE(&inp->inp_route6); } /* @@ -860,12 +857,10 @@ in6_losing(struct inpcb *in6p) * and allocate a (hopefully) better one. */ struct inpcb * -in6_rtchange(struct inpcb *inp, int errno) +in6_rtchange(struct inpcb *inp, int errno __unused) { - RO_RTFREE(&in6p->inp_route6); - if (inp->inp_route6.ro_lle) - LLE_FREE(inp->inp_route6.ro_lle); /* zeros ro_lle */ + RO_INVALIDATE_CACHE(&inp->inp_route6); return inp; } Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Mon Sep 3 22:14:37 2018 (r338449) +++ head/sys/netinet6/ip6_output.c Mon Sep 3 22:27:27 2018 (r338450) @@ -804,22 +804,16 @@ again: error = netisr_queue(NETISR_IPV6, m); goto done; } else { - RO_RTFREE(ro); + RO_INVALIDATE_CACHE(ro); needfiblookup = 1; /* Redo the routing table lookup. */ - if (ro->ro_lle) - LLE_FREE(ro->ro_lle); /* zeros ro_lle */ - ro->ro_lle = NULL; } } /* See if fib was changed by packet filter. */ if (fibnum != M_GETFIB(m)) { m->m_flags |= M_SKIP_FIREWALL; fibnum = M_GETFIB(m); - RO_RTFREE(ro); + RO_INVALIDATE_CACHE(ro); needfiblookup = 1; - if (ro->ro_lle) - LLE_FREE(ro->ro_lle); /* zeros ro_lle */ - ro->ro_lle = NULL; } if (needfiblookup) goto again; From owner-svn-src-head@freebsd.org Tue Sep 4 09:17: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 A3CE8FE854D; Tue, 4 Sep 2018 09:17:30 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 11C018EE39; Tue, 4 Sep 2018 09:17:29 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from hermann ([141.89.154.175]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MHoWj-1fu53K0ybd-003gAf; Tue, 04 Sep 2018 11:17:19 +0200 Date: Tue, 4 Sep 2018 11:17:16 +0200 From: "Hartmann, O." To: Brad Davis Cc: "O. Hartmann" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r338374 - in head: bin/csh bin/sh etc etc/root Message-ID: <20180904111716.7947af64@hermann> In-Reply-To: <1535643487.1731188.1491479248.1AC042E6@webmail.messagingengine.com> References: <201808291659.w7TGxJqF096282@repo.freebsd.org> <20180830133947.5e68bea3@thor.intern.walstatt.dynvpn.de> <1535643487.1731188.1491479248.1AC042E6@webmail.messagingengine.com> Organization: walstatt.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:6Pljp00pcZCOip33T4j1qvyBPqycqP5jMBsOZfi/pIJljd+ItsW hyPeNAI+Uaj7PijGK9r/vR/MaaeT4jagcsxLPUZnaQ6eScdEgVanMfYpjjJ76IKfbekCG04 hHMsB97ylW+6/VPtWm16LAMiGq5ft0jm5E7gwUiTuZs56v2ovX7KrI0c4a5JP7pVHhB6mRl 8UWc0Vu8IzQKpKa7JoZTg== X-UI-Out-Filterresults: notjunk:1;V01:K0:vvB1mKDBcw0=:Jkh1s6INGEJ2phV88PrqRD ZEPfk+u4Es2hHcDsR57aVRa0OsPffGi2sMcmG6AK/WJJCyvtQHGDUKO/caE+Jw0wBufbHR2xf Nd/P7990bieznHqVQzn2rUffBCRfeFu96I1o16XMAqj+n2iHIx5jTHp5N6qHRt/BnqmzS1YtR k0xQU+h8xW52meMu6v9ZkqwUM/tFi2PVo22kAMSyVJ5ix5TktlKcud7ZB9tnvFsYe14MY0MVy AKw957+ceDouWRhhFuA0J556wE4atGe/FzB2eLW0Xd4k2RyQftP+989cYheJkMX/frsAU76N3 DewUyP27DJ8ynGXZx2jjjcWeuG2dWG3sXih+ta4S7CVlADBygBG//ChV2ld0DIBcaK01I6e+m qr/0Hqv/Ht5vthLLujsRyoJgoTVoUux4R9yFirbRp6Oo42J6ahrjVNYNndc+LeMpwZ1ZZhXH3 TdFaS7zU0TRIhbw9XeJ4uDRGtVy3dTM1EyrWaYIbpnmhctQvmccLm8U4+v1QQZ2btWfX9ZLPU 36oNCQzDbnZewvGv2/Uzf+pkQg9wZ3IG0b9t928WDcPGk/flTNBdENpc4PJLRecjlRHWtlZHQ G1jQm4gmOJ4bzJWHAQ9wHnq3dsE1En4N3JtLbvx6bBVUpnyvnCG4Jc9JYk5pNBLh5ap7u7K1G 7PtOoojl0knLtf4GfKwdbyFLlQaU0uo19bBBiaX+1K41B4KB7U87bvupJa10adSF47FvvhooQ fBDsJrRVOziH24jz8FVVZ9kjnVPfs66GfAjB8C254GTIU+PaoSPWJSS3OgAMRJXYxFH8KF2N7 8I7BUui X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 04 Sep 2018 09:17:30 -0000 On Thu, 30 Aug 2018 09:38:07 -0600 Brad Davis wrote: > On Thu, Aug 30, 2018, at 5:39 AM, O. Hartmann wrote: > > -----BEGIN PGP SIGNED MESSAGE----- > > Hash: SHA512 > > > > Am Wed, 29 Aug 2018 16:59:19 +0000 (UTC) > > Brad Davis schrieb: > > > > > Author: brd > > > Date: Wed Aug 29 16:59:19 2018 > > > New Revision: 338374 > > > URL: https://svnweb.freebsd.org/changeset/base/338374 > > > > > > Log: > > > Finish moving dot.cshrc and dot.profile to bin/csh/ and bin/sh/. > > > > > > Approved by: re (gjb), will (mentor) > > > Differential Revision: https://reviews.freebsd.org/D16770 > > > > > > Added: > > > head/bin/csh/dot.cshrc > > > - copied unchanged from r338373, head/etc/root/dot.cshrc > > > head/bin/sh/dot.profile > > > - copied unchanged from r338373, head/etc/root/dot.profile > > > Deleted: > > > head/etc/root/dot.cshrc > > > head/etc/root/dot.profile > > > Modified: > > > head/bin/csh/Makefile > > > head/bin/sh/Makefile > > > head/etc/Makefile > > > > > > Modified: head/bin/csh/Makefile > > > ============================================================================== > > > --- head/bin/csh/Makefile Wed Aug 29 16:21:34 2018 > > > (r338373) +++ head/bin/csh/Makefile Wed Aug 29 16:59:19 > > > 2018 (r338374) @@ -10,8 +10,9 @@ > > > > > > CONFGROUPS= ETC ROOT > > > ETC= csh.cshrc csh.login csh.logout > > > -ROOT= dot.login > > > +ROOT= dot.cshrc dot.login > > > ROOTDIR= /root > > > +ROOTNAME_dot.cshrc= .cshrc > > > ROOTNAME_dot.login= .login > > > PACKAGE=runtime > > > TCSHDIR= ${SRCTOP}/contrib/tcsh > > > @@ -152,5 +153,11 @@ tc.const.h: tc.const.c sh.char.h config.h > > > config_f.h s sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char > > > \1[];/' | \ sort >> ${.TARGET} > > > @echo '#endif /* _h_tc_const */' >> ${.TARGET} > > > + > > > +beforeinstallconfig: > > > + rm -f ${DESTDIR}/.cshrc > > > + > > > +afterinstallconfig: > > > + ${INSTALL_LINK} ${TAG_ARGS} ${DESTDIR}/root/.cshrc > > > ${DESTDIR}/.cshrc > > > .include > > > > > > Copied: head/bin/csh/dot.cshrc (from r338373, > > > head/etc/root/dot.cshrc) > > > ============================================================================== > > > --- /dev/null 00:00:00 1970 (empty, because file is > > > newly added) +++ head/bin/csh/dot.cshrc Wed Aug 29 > > > 16:59:19 2018 (r338374, copy of r338373, > > > head/etc/root/dot.cshrc) @@ -0,0 +1,43 @@ +# $FreeBSD$ +# > > > +# .cshrc - csh resource script, read at beginning of execution > > > by each shell +# > > > +# see also csh(1), environ(7). > > > +# more examples available at /usr/share/examples/csh/ > > > +# > > > + > > > +alias h history 25 > > > +alias j jobs -l > > > +alias la ls -aF > > > +alias lf ls -FA > > > +alias ll ls -lAF > > > + > > > +# A righteous umask > > > +umask 22 > > > + > > > +set path = > > > (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin > > > $HOME/bin) + +setenv EDITOR vi > > > +setenv PAGER less > > > +setenv BLOCKSIZE K > > > + > > > +if ($?prompt) then > > > + # An interactive shell -- set some stuff up > > > + set prompt = "%N@%m:%~ %# " > > > + set promptchars = "%#" > > > + > > > + set filec > > > + set history = 1000 > > > + set savehist = (1000 merge) > > > + set autolist = ambiguous > > > + # Use history to aid expansion > > > + set autoexpand > > > + set autorehash > > > + set mail = (/var/mail/$USER) > > > + if ( $?tcsh ) then > > > + bindkey "^W" backward-delete-word > > > + bindkey -k up history-search-backward > > > + bindkey -k down history-search-forward > > > + endif > > > + > > > +endif > > > > > > Modified: head/bin/sh/Makefile > > > ============================================================================== > > > --- head/bin/sh/Makefile Wed Aug 29 16:21:34 2018 > > > (r338373) +++ head/bin/sh/Makefile Wed Aug 29 16:59:19 > > > 2018 (r338374) @@ -3,7 +3,9 @@ > > > > > > .include > > > > > > -CONFS= profile > > > +CONFS= dot.profile profile > > > +CONFSDIR_dot.profile= /root > > > +CONFSNAME_dot.profile= .profile > > > PACKAGE=runtime > > > PROG= sh > > > INSTALLFLAGS= -S > > > @@ -60,5 +62,11 @@ token.h: mktokens > > > > > > HAS_TESTS= > > > SUBDIR.${MK_TESTS}+= tests > > > + > > > +beforeinstallconfig: > > > + rm -f ${DESTDIR}/.profile > > > + > > > +afterinstallconfig: > > > + ${INSTALL_LINK} ${TAG_ARGS} ${DESTDIR}/root/.profile > > > ${DESTDIR}/.profile > > > .include > > > > > > Copied: head/bin/sh/dot.profile (from r338373, > > > head/etc/root/dot.profile) > > > ============================================================================== > > > --- /dev/null 00:00:00 1970 (empty, because file is > > > newly added) +++ head/bin/sh/dot.profile Wed Aug 29 > > > 16:59:19 2018 (r338374, copy of r338373, > > > head/etc/root/dot.profile) @@ -0,0 +1,16 @@ +# $FreeBSD$ +# > > > +PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:~/bin > > > +export PATH > > > +HOME=/root > > > +export HOME > > > +TERM=${TERM:-xterm} > > > +export TERM > > > +PAGER=less > > > +export PAGER > > > + > > > +# Query terminal size; useful for serial lines. > > > +if [ -x /usr/bin/resizewin ] ; then /usr/bin/resizewin -z ; fi > > > + > > > +# Uncomment to display a random cookie on each login. > > > +# if [ -x /usr/bin/fortune ] ; then /usr/bin/fortune -s ; fi > > > > > > Modified: head/etc/Makefile > > > ============================================================================== > > > --- head/etc/Makefile Wed Aug 29 16:21:34 2018 > > > (r338373) +++ head/etc/Makefile Wed Aug 29 16:59:19 > > > 2018 (r338374) @@ -155,18 +155,6 @@ distribution: > > > ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ > > > dot.k5login ${DESTDIR}/root/.k5login; > > > .endif > > > - cd ${.CURDIR}/root; \ > > > - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ > > > - dot.profile ${DESTDIR}/root/.profile; \ > > > - rm -f ${DESTDIR}/.profile; \ > > > - ${INSTALL_LINK} ${DESTDIR}/root/.profile > > > ${DESTDIR}/.profile -.if ${MK_TCSH} != "no" > > > - cd ${.CURDIR}/root; \ > > > - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ > > > - dot.cshrc ${DESTDIR}/root/.cshrc; \ > > > - rm -f ${DESTDIR}/.cshrc; \ > > > - ${INSTALL_LINK} ${DESTDIR}/root/.cshrc > > > ${DESTDIR}/.cshrc -.endif > > > > > > .if ${MK_MAIL} != "no" > > > cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} > > > -m 644 \ _______________________________________________ > > > 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" > > > > This commit breaks "make package", at least for me with an obscure > > "Error 70" in the > > make process. > > Thanks for the report. > > The error is above that: > > 09:15:27 pkg: Plist error, @config /root/.cshrc: not a regular file > 09:15:27 pkg: Plist error, @config /root/.profile: not a regular file > > Which is interesting.. I will think about how to solve this. > > > Regards, > Brad Davis Is there a (temporarily) workaround? The problem seems still to be present in r338450. Kind regards, oh From owner-svn-src-head@freebsd.org Tue Sep 4 10:51: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 C2A2AFEB3E9; Tue, 4 Sep 2018 10:51:42 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 77D0A92783; Tue, 4 Sep 2018 10:51:42 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 72C0616133; Tue, 4 Sep 2018 10:51:42 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w84ApgIw012478; Tue, 4 Sep 2018 10:51:42 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w84ApgC8012476; Tue, 4 Sep 2018 10:51:42 GMT (envelope-from des@FreeBSD.org) Message-Id: <201809041051.w84ApgC8012476@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Tue, 4 Sep 2018 10:51:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338453 - head/lib/libpam/modules/pam_exec X-SVN-Group: head X-SVN-Commit-Author: des X-SVN-Commit-Paths: head/lib/libpam/modules/pam_exec X-SVN-Commit-Revision: 338453 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 04 Sep 2018 10:51:42 -0000 Author: des Date: Tue Sep 4 10:51:41 2018 New Revision: 338453 URL: https://svnweb.freebsd.org/changeset/base/338453 Log: For full Linux-PAM compatibility, add a trailing NUL character when passing the authentication token to the external program. Approved by: re (kib) Submitted by: Thomas Munro MFC after: 1 week Differential Revision: D16950 Modified: head/lib/libpam/modules/pam_exec/pam_exec.8 head/lib/libpam/modules/pam_exec/pam_exec.c Modified: head/lib/libpam/modules/pam_exec/pam_exec.8 ============================================================================== --- head/lib/libpam/modules/pam_exec/pam_exec.8 Tue Sep 4 09:58:13 2018 (r338452) +++ head/lib/libpam/modules/pam_exec/pam_exec.8 Tue Sep 4 10:51:41 2018 (r338453) @@ -74,7 +74,8 @@ Ignored for compatibility reasons. Use the program exit status as the return code of the pam_sm_* function. It must be a valid return value for this function. .It Cm expose_authtok -Write the authentication token to the program's standard input stream. +Write the authentication token to the program's standard input stream, +followed by a NUL character. .It Cm -- Stop options parsing; program and its arguments follow. Modified: head/lib/libpam/modules/pam_exec/pam_exec.c ============================================================================== --- head/lib/libpam/modules/pam_exec/pam_exec.c Tue Sep 4 09:58:13 2018 (r338452) +++ head/lib/libpam/modules/pam_exec/pam_exec.c Tue Sep 4 10:51:41 2018 (r338453) @@ -254,7 +254,8 @@ _pam_exec(pam_handle_t *pamh, } rc = pam_get_authtok(pamh, PAM_AUTHTOK, &authtok, NULL); if (rc == PAM_SUCCESS) { - authtok_size = strlen(authtok); + /* We include the trailing NUL-terminator. */ + authtok_size = strlen(authtok) + 1; } else { openpam_log(PAM_LOG_ERROR, "%s: pam_get_authtok(): %s", func, pam_strerror(pamh, rc)); From owner-svn-src-head@freebsd.org Tue Sep 4 15:48:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 672AFFF2FF4; Tue, 4 Sep 2018 15:48:16 +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 165BF747A0; Tue, 4 Sep 2018 15:48:16 +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 101CB19066; Tue, 4 Sep 2018 15:48:16 +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 w84FmGkk063102; Tue, 4 Sep 2018 15:48:16 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w84FmD2V063091; Tue, 4 Sep 2018 15:48:13 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201809041548.w84FmD2V063091@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Tue, 4 Sep 2018 15:48:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338454 - in head: etc etc/etc.aarch64 etc/etc.amd64 etc/etc.arm etc/etc.i386 etc/etc.mips etc/etc.powerpc etc/etc.riscv etc/etc.sparc64 sbin/init X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: in head: etc etc/etc.aarch64 etc/etc.amd64 etc/etc.arm etc/etc.i386 etc/etc.mips etc/etc.powerpc etc/etc.riscv etc/etc.sparc64 sbin/init X-SVN-Commit-Revision: 338454 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 04 Sep 2018 15:48:16 -0000 Author: brd Date: Tue Sep 4 15:48:13 2018 New Revision: 338454 URL: https://svnweb.freebsd.org/changeset/base/338454 Log: Move etc/ttys to sbin/init/. And simplify this a little by flattening the directory structure. Approved by: re (gjb), will (mentor) Differential Revision: https://reviews.freebsd.org/D16955 Added: head/sbin/init/ttys.aarch64 - copied unchanged from r338453, head/etc/etc.aarch64/ttys head/sbin/init/ttys.amd64 - copied unchanged from r338453, head/etc/etc.amd64/ttys head/sbin/init/ttys.arm - copied unchanged from r338453, head/etc/etc.arm/ttys head/sbin/init/ttys.i386 - copied unchanged from r338453, head/etc/etc.i386/ttys head/sbin/init/ttys.mips - copied unchanged from r338453, head/etc/etc.mips/ttys head/sbin/init/ttys.powerpc - copied unchanged from r338453, head/etc/etc.powerpc/ttys head/sbin/init/ttys.riscv - copied unchanged from r338453, head/etc/etc.riscv/ttys head/sbin/init/ttys.sparc64 - copied unchanged from r338453, head/etc/etc.sparc64/ttys Deleted: head/etc/etc.aarch64/ head/etc/etc.amd64/ head/etc/etc.arm/ head/etc/etc.i386/ head/etc/etc.mips/ head/etc/etc.powerpc/ head/etc/etc.riscv/ head/etc/etc.sparc64/ Modified: head/etc/Makefile head/sbin/init/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Tue Sep 4 10:51:41 2018 (r338453) +++ head/etc/Makefile Tue Sep 4 15:48:13 2018 (r338454) @@ -35,16 +35,6 @@ BIN1= crontab \ rpc \ termcap.small -.if exists(${.CURDIR}/etc.${MACHINE}/ttys) -BIN1+= etc.${MACHINE}/ttys -.elif exists(${.CURDIR}/etc.${MACHINE_ARCH}/ttys) -BIN1+= etc.${MACHINE_ARCH}/ttys -.elif exists(${.CURDIR}/etc.${MACHINE_CPUARCH}/ttys) -BIN1+= etc.${MACHINE_CPUARCH}/ttys -.else -.error etc.MACHINE/ttys missing -.endif - # NB: keep these sorted by MK_* knobs .if ${MK_AMD} != "no" Modified: head/sbin/init/Makefile ============================================================================== --- head/sbin/init/Makefile Tue Sep 4 10:51:41 2018 (r338453) +++ head/sbin/init/Makefile Tue Sep 4 15:48:13 2018 (r338454) @@ -1,7 +1,7 @@ # @(#)Makefile 8.1 (Berkeley) 7/19/93 # $FreeBSD$ -CONFGROUPS= CONFETC CONFETCEXEC CONFETCDEFAULTS +CONFGROUPS= CONFETC CONFETCEXEC CONFETCDEFAULTS CONFTTYS CONFETCDIR= /etc CONFETC= network.subr rc rc.initdiskless rc.subr rc.shutdown CONFETCMODE= 644 @@ -18,6 +18,17 @@ PRECIOUSPROG= INSTALLFLAGS=-b -B.bak CFLAGS+=-DDEBUGSHELL -DSECURE -DLOGIN_CAP -DCOMPAT_SYSV_INIT LIBADD= util crypt + +CONFTTYSNAME= ttys +.if exists(${.CURDIR}/ttys.${MACHINE}) +CONFTTYS+= ttys.${MACHINE} +.elif exists(${.CURDIR}/ttys.${MACHINE_ARCH}) +CONFTTYS+= ttys.${MACHINE_ARCH} +.elif exists(${.CURDIR}/ttys.${MACHINE_CPUARCH}) +CONFTTYS+= ttys.${MACHINE_CPUARCH} +.else +.error MACHINE.ttys missing +.endif # Needed for getmntopts.c MOUNT= ${SRCTOP}/sbin/mount Copied: head/sbin/init/ttys.aarch64 (from r338453, head/etc/etc.aarch64/ttys) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/init/ttys.aarch64 Tue Sep 4 15:48:13 2018 (r338454, copy of r338453, head/etc/etc.aarch64/ttys) @@ -0,0 +1,49 @@ +# +# $FreeBSD$ +# @(#)ttys 5.1 (Berkeley) 4/17/89 +# +# This file specifies various information about terminals on the system. +# It is used by several different programs. Common entries for the +# various columns include: +# +# name The name of the terminal device. +# +# getty The program to start running on the terminal. Typically a +# getty program, as the name implies. Other common entries +# include none, when no getty is needed, and xdm, to start the +# X Window System. +# +# type The initial terminal type for this port. For hardwired +# terminal lines, this will contain the type of terminal used. +# For virtual consoles, the correct type is typically xterm. +# Other common values include dialup for incoming modem ports, and +# unknown when the terminal type cannot be predetermined. +# +# status Must be on or off. If on, init will run the getty program on +# the specified port. If the word "secure" appears, this tty +# allows root login. +# +# name getty type status comments +# +# If console is marked "insecure", then init will ask for the root password +# when going to single-user mode. +console none unknown off secure +# +ttyv0 "/usr/libexec/getty Pc" xterm onifexists secure +# Virtual terminals +ttyv1 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv2 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv3 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv4 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv5 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv6 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv7 "/usr/libexec/getty Pc" xterm onifexists secure +#ttyv8 "/usr/local/bin/xdm -nodaemon" xterm onifexists secure +# Serial terminals +# The 'dialup' keyword identifies dialin lines to login, fingerd etc. +ttyu0 "/usr/libexec/getty 3wire" vt100 onifconsole secure +ttyu1 "/usr/libexec/getty 3wire" vt100 onifconsole secure +ttyu2 "/usr/libexec/getty 3wire" vt100 onifconsole secure +ttyu3 "/usr/libexec/getty 3wire" vt100 onifconsole secure +# Dumb console +dcons "/usr/libexec/getty std.9600" vt100 off secure Copied: head/sbin/init/ttys.amd64 (from r338453, head/etc/etc.amd64/ttys) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/init/ttys.amd64 Tue Sep 4 15:48:13 2018 (r338454, copy of r338453, head/etc/etc.amd64/ttys) @@ -0,0 +1,49 @@ +# +# $FreeBSD$ +# @(#)ttys 5.1 (Berkeley) 4/17/89 +# +# This file specifies various information about terminals on the system. +# It is used by several different programs. Common entries for the +# various columns include: +# +# name The name of the terminal device. +# +# getty The program to start running on the terminal. Typically a +# getty program, as the name implies. Other common entries +# include none, when no getty is needed, and xdm, to start the +# X Window System. +# +# type The initial terminal type for this port. For hardwired +# terminal lines, this will contain the type of terminal used. +# For virtual consoles, the correct type is typically xterm. +# Other common values include dialup for incoming modem ports, and +# unknown when the terminal type cannot be predetermined. +# +# status Must be on or off. If on, init will run the getty program on +# the specified port. If the word "secure" appears, this tty +# allows root login. +# +# name getty type status comments +# +# If console is marked "insecure", then init will ask for the root password +# when going to single-user mode. +console none unknown off secure +# +ttyv0 "/usr/libexec/getty Pc" xterm onifexists secure +# Virtual terminals +ttyv1 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv2 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv3 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv4 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv5 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv6 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv7 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure +# Serial terminals +# The 'dialup' keyword identifies dialin lines to login, fingerd etc. +ttyu0 "/usr/libexec/getty 3wire" vt100 onifconsole secure +ttyu1 "/usr/libexec/getty 3wire" vt100 onifconsole secure +ttyu2 "/usr/libexec/getty 3wire" vt100 onifconsole secure +ttyu3 "/usr/libexec/getty 3wire" vt100 onifconsole secure +# Dumb console +dcons "/usr/libexec/getty std.9600" vt100 off secure Copied: head/sbin/init/ttys.arm (from r338453, head/etc/etc.arm/ttys) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/init/ttys.arm Tue Sep 4 15:48:13 2018 (r338454, copy of r338453, head/etc/etc.arm/ttys) @@ -0,0 +1,49 @@ +# +# $FreeBSD$ +# @(#)ttys 5.1 (Berkeley) 4/17/89 +# +# This file specifies various information about terminals on the system. +# It is used by several different programs. Common entries for the +# various columns include: +# +# name The name of the terminal device. +# +# getty The program to start running on the terminal. Typically a +# getty program, as the name implies. Other common entries +# include none, when no getty is needed, and xdm, to start the +# X Window System. +# +# type The initial terminal type for this port. For hardwired +# terminal lines, this will contain the type of terminal used. +# For virtual consoles, the correct type is typically xterm. +# Other common values include dialup for incoming modem ports, and +# unknown when the terminal type cannot be predetermined. +# +# status Must be on or off. If on, init will run the getty program on +# the specified port. If the word "secure" appears, this tty +# allows root login. +# +# name getty type status comments +# +# If console is marked "insecure", then init will ask for the root password +# when going to single-user mode. +console none unknown off secure +# +ttyv0 "/usr/libexec/getty Pc" xterm onifexists secure +# Virtual terminals +ttyv1 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv2 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv3 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv4 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv5 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv6 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv7 "/usr/libexec/getty Pc" xterm onifexists secure +#ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure +# Serial terminals +# The 'dialup' keyword identifies dialin lines to login, fingerd etc. +ttyu0 "/usr/libexec/getty 3wire" vt100 onifconsole secure +ttyu1 "/usr/libexec/getty 3wire" vt100 onifconsole secure +ttyu2 "/usr/libexec/getty 3wire" vt100 onifconsole secure +ttyu3 "/usr/libexec/getty 3wire" vt100 onifconsole secure +# Dumb console +dcons "/usr/libexec/getty std.9600" vt100 off secure Copied: head/sbin/init/ttys.i386 (from r338453, head/etc/etc.i386/ttys) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/init/ttys.i386 Tue Sep 4 15:48:13 2018 (r338454, copy of r338453, head/etc/etc.i386/ttys) @@ -0,0 +1,49 @@ +# +# $FreeBSD$ +# @(#)ttys 5.1 (Berkeley) 4/17/89 +# +# This file specifies various information about terminals on the system. +# It is used by several different programs. Common entries for the +# various columns include: +# +# name The name of the terminal device. +# +# getty The program to start running on the terminal. Typically a +# getty program, as the name implies. Other common entries +# include none, when no getty is needed, and xdm, to start the +# X Window System. +# +# type The initial terminal type for this port. For hardwired +# terminal lines, this will contain the type of terminal used. +# For virtual consoles, the correct type is typically xterm. +# Other common values include dialup for incoming modem ports, and +# unknown when the terminal type cannot be predetermined. +# +# status Must be on or off. If on, init will run the getty program on +# the specified port. If the word "secure" appears, this tty +# allows root login. +# +# name getty type status comments +# +# If console is marked "insecure", then init will ask for the root password +# when going to single-user mode. +console none unknown off secure +# +ttyv0 "/usr/libexec/getty Pc" xterm onifexists secure +# Virtual terminals +ttyv1 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv2 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv3 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv4 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv5 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv6 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv7 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure +# Serial terminals +# The 'dialup' keyword identifies dialin lines to login, fingerd etc. +ttyu0 "/usr/libexec/getty 3wire" vt100 onifconsole secure +ttyu1 "/usr/libexec/getty 3wire" vt100 onifconsole secure +ttyu2 "/usr/libexec/getty 3wire" vt100 onifconsole secure +ttyu3 "/usr/libexec/getty 3wire" vt100 onifconsole secure +# Dumb console +dcons "/usr/libexec/getty std.9600" vt100 off secure Copied: head/sbin/init/ttys.mips (from r338453, head/etc/etc.mips/ttys) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/init/ttys.mips Tue Sep 4 15:48:13 2018 (r338454, copy of r338453, head/etc/etc.mips/ttys) @@ -0,0 +1,36 @@ +# +# $FreeBSD$ +# @(#)ttys 5.1 (Berkeley) 4/17/89 +# +# This file specifies various information about terminals on the system. +# It is used by several different programs. Common entries for the +# various columns include: +# +# name The name of the terminal device. +# +# getty The program to start running on the terminal. Typically a +# getty program, as the name implies. Other common entries +# include none, when no getty is needed, and xdm, to start the +# X Window System. +# +# type The initial terminal type for this port. For hardwired +# terminal lines, this will contain the type of terminal used. +# For virtual consoles, the correct type is typically xterm. +# Other common values include dialup for incoming modem ports, and +# unknown when the terminal type cannot be predetermined. +# +# status Must be on or off. If on, init will run the getty program on +# the specified port. If the word "secure" appears, this tty +# allows root login. +# +# name getty type status comments +# +# If console is marked "insecure", then init will ask for the root password +# when going to single-user mode. +console none unknown off secure +# Serial terminals +# The 'dialup' keyword identifies dialin lines to login, fingerd etc. +ttyu0 "/usr/libexec/getty 3wire" vt100 onifconsole secure +ttyu1 "/usr/libexec/getty 3wire" vt100 onifconsole secure +ttyu2 "/usr/libexec/getty 3wire" vt100 onifconsole secure +ttyu3 "/usr/libexec/getty 3wire" vt100 onifconsole secure Copied: head/sbin/init/ttys.powerpc (from r338453, head/etc/etc.powerpc/ttys) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/init/ttys.powerpc Tue Sep 4 15:48:13 2018 (r338454, copy of r338453, head/etc/etc.powerpc/ttys) @@ -0,0 +1,49 @@ +# +# $FreeBSD$ +# @(#)ttys 5.1 (Berkeley) 4/17/89 +# +# This file specifies various information about terminals on the system. +# It is used by several different programs. Common entries for the +# various columns include: +# +# name The name of the terminal device. +# +# getty The program to start running on the terminal. Typically a +# getty program, as the name implies. Other common entries +# include none, when no getty is needed, and xdm, to start the +# X Window System. +# +# type The initial terminal type for this port. For hardwired +# terminal lines, this will contain the type of terminal used. +# For virtual consoles, the correct type is typically xterm. +# Other common values include dialup for incoming modem ports, and +# unknown when the terminal type cannot be predetermined. +# +# status Must be on or off. If on, init will run the getty program on +# the specified port. If the word "secure" appears, this tty +# allows root login. +# +# name getty type status comments +# +# If console is marked "insecure", then init will ask for the root password +# when going to single-user mode. +console none unknown off secure +# +ttyv0 "/usr/libexec/getty Pc" xterm onifexists secure +# Virtual terminals +ttyv1 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv2 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv3 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv4 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv5 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv6 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv7 "/usr/libexec/getty Pc" xterm onifexists secure +#ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure +# Serial terminals +# The 'dialup' keyword identifies dialin lines to login, fingerd etc. +ttyu0 "/usr/libexec/getty 3wire" vt100 onifconsole secure +ttyu1 "/usr/libexec/getty 3wire" vt100 onifconsole secure +ttyu2 "/usr/libexec/getty 3wire" vt100 onifconsole secure +ttyu3 "/usr/libexec/getty 3wire" vt100 onifconsole secure +# Dumb console +dcons "/usr/libexec/getty std.9600" vt100 off secure Copied: head/sbin/init/ttys.riscv (from r338453, head/etc/etc.riscv/ttys) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/init/ttys.riscv Tue Sep 4 15:48:13 2018 (r338454, copy of r338453, head/etc/etc.riscv/ttys) @@ -0,0 +1,51 @@ +# +# $FreeBSD$ +# @(#)ttys 5.1 (Berkeley) 4/17/89 +# +# This file specifies various information about terminals on the system. +# It is used by several different programs. Common entries for the +# various columns include: +# +# name The name of the terminal device. +# +# getty The program to start running on the terminal. Typically a +# getty program, as the name implies. Other common entries +# include none, when no getty is needed, and xdm, to start the +# X Window System. +# +# type The initial terminal type for this port. For hardwired +# terminal lines, this will contain the type of terminal used. +# For virtual consoles, the correct type is typically xterm. +# Other common values include dialup for incoming modem ports, and +# unknown when the terminal type cannot be predetermined. +# +# status Must be on or off. If on, init will run the getty program on +# the specified port. If the word "secure" appears, this tty +# allows root login. +# +# name getty type status comments +# +# If console is marked "insecure", then init will ask for the root password +# when going to single-user mode. +console none unknown off secure +# +ttyv0 "/usr/libexec/getty Pc" xterm onifexists secure +# Virtual terminals +ttyv1 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv2 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv3 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv4 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv5 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv6 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv7 "/usr/libexec/getty Pc" xterm onifexists secure +#ttyv8 "/usr/local/bin/xdm -nodaemon" xterm onifexists secure +# Serial terminals +# The 'dialup' keyword identifies dialin lines to login, fingerd etc. +ttyu0 "/usr/libexec/getty 3wire" vt100 onifconsole secure +ttyu1 "/usr/libexec/getty 3wire" vt100 onifconsole secure +ttyu2 "/usr/libexec/getty 3wire" vt100 onifconsole secure +ttyu3 "/usr/libexec/getty 3wire" vt100 onifconsole secure +# Dumb console +dcons "/usr/libexec/getty std.9600" vt100 off secure +# RISC-V HTIF console +rcons "/usr/libexec/getty std.9600" vt100 onifconsole secure Copied: head/sbin/init/ttys.sparc64 (from r338453, head/etc/etc.sparc64/ttys) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/init/ttys.sparc64 Tue Sep 4 15:48:13 2018 (r338454, copy of r338453, head/etc/etc.sparc64/ttys) @@ -0,0 +1,54 @@ +# +# $FreeBSD$ +# @(#)ttys 5.1 (Berkeley) 4/17/89 +# +# This file specifies various information about terminals on the system. +# It is used by several different programs. Common entries for the +# various columns include: +# +# name The name of the terminal device. +# +# getty The program to start running on the terminal. Typically a +# getty program, as the name implies. Other common entries +# include none, when no getty is needed, and xdm, to start the +# X Window System. +# +# type The initial terminal type for this port. For hardwired +# terminal lines, this will contain the type of terminal used. +# For virtual consoles, the correct type is typically xterm. +# Other common values include dialup for incoming modem ports, and +# unknown when the terminal type cannot be predetermined. +# +# status Must be on or off. If on, init will run the getty program on +# the specified port. If the word "secure" appears, this tty +# allows root login. +# +# name getty type status comments +# +# If console is marked "insecure", then init will ask for the root password +# when going to single-user mode. +console none unknown off secure +# ofw_console(4) +screen "/usr/libexec/getty Pc" vt100 off secure +ttya "/usr/libexec/getty 3wire.9600" vt100 off secure +ttyb "/usr/libexec/getty 3wire.9600" vt100 off secure +# syscons(4) +ttyv0 "/usr/libexec/getty Pc" xterm onifexists secure +# Virtual terminals +ttyv1 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv2 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv3 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv4 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv5 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv6 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv7 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure +# Serial terminals +# The 'dialup' keyword identifies dialin lines to login, fingerd etc. +# uart(4) +ttyu0 "/usr/libexec/getty 3wire" vt100 onifconsole secure +ttyu1 "/usr/libexec/getty 3wire" vt100 onifconsole secure +ttyu2 "/usr/libexec/getty 3wire" vt100 onifconsole secure +ttyu3 "/usr/libexec/getty 3wire" vt100 onifconsole secure +# Dumb console +dcons "/usr/libexec/getty std.9600" vt100 off secure From owner-svn-src-head@freebsd.org Tue Sep 4 16:53:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3AF2FF5146; Tue, 4 Sep 2018 16:53:32 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f174.google.com (mail-io0-f174.google.com [209.85.223.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 767CB77390; Tue, 4 Sep 2018 16:53:32 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f174.google.com with SMTP id r196-v6so3597018iod.0; Tue, 04 Sep 2018 09:53:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=A0oQw45QlYd8IJ3/3QlHnCPDByJ98sXPikPIhRsQP6U=; b=OzoXci1H+kf1ASD0ZBCp9useIZuT0GGZsu6mpo6ArSll75gqsLQr9lsf9xe5cLCzAW nBs+9+5114RAHQ8jjZzNsaDNCpB9rSBYUgkm8QZfa3IJIdnZ2Y2PqU3CFS8AlOW7fanl 51zRj5G7eFhZFlqJr1t8UOyiyKyK1kU0rbofFOWWXUQEiuwqCyq53bj8oQTn6mY+x+1J M+3bPrTFP1nH3mlg+LywcgNuYvvwUyiaGIOvNfoX76m2fKPV0Xnz2DKZR/vDt/yIx/kB CmZ6t8fmZAsxdwYabYUE7IPv0iO70pEmssu+Z3/JirYg9dPblR0fsW81YkYZnXVgsuNy +jPw== X-Gm-Message-State: APzg51CUVMDzNto7tQpMrXtJhEGKBzHsSbxfQqyrnOtB2Vi3FVwEijkh v/CbnEfxRhIaE5Dytjqg7f2V15s3 X-Google-Smtp-Source: ANB0VdYkYYBzJmFxwAt+q5fGjvYFR95Y3xmN23SX/SF0uZhRBCPqvNpSPmaubu82pJOgfLdLLuKd0A== X-Received: by 2002:a6b:2b51:: with SMTP id r78-v6mr21722619ior.279.1536076096440; Tue, 04 Sep 2018 08:48:16 -0700 (PDT) Received: from mail-it0-f49.google.com (mail-it0-f49.google.com. [209.85.214.49]) by smtp.gmail.com with ESMTPSA id g129-v6sm7120936itg.16.2018.09.04.08.48.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Sep 2018 08:48:16 -0700 (PDT) Received: by mail-it0-f49.google.com with SMTP id e14-v6so5646560itf.1; Tue, 04 Sep 2018 08:48:16 -0700 (PDT) X-Received: by 2002:a24:44d7:: with SMTP id o206-v6mr715569ita.66.1536076096192; Tue, 04 Sep 2018 08:48:16 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:4f1b:0:0:0:0:0 with HTTP; Tue, 4 Sep 2018 08:48:15 -0700 (PDT) In-Reply-To: <201809022137.w82Lb5FK046191@repo.freebsd.org> References: <201809022137.w82Lb5FK046191@repo.freebsd.org> From: Conrad Meyer Date: Tue, 4 Sep 2018 08:48:15 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r338437 - in head/sys: amd64/amd64 amd64/include arm64/arm64 arm64/include conf dev/efidev modules/efirt sys To: Konstantin Belousov Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 04 Sep 2018 16:53:33 -0000 Hi Konstantin, On Sun, Sep 2, 2018 at 2:37 PM, Konstantin Belousov wrote= : > Author: kib > Date: Sun Sep 2 21:37:05 2018 > New Revision: 338437 > URL: https://svnweb.freebsd.org/changeset/base/338437 > > Log: > Catch exceptions during EFI RT calls on amd64. > > This appeared to be required to have EFI RT support and EFI RTC > enabled by default, because there are too many reports of faulting > calls on many different machines. The knob is added to leave the > exceptions unhandled to allow to debug the actual bugs. > ... > > Modified: head/sys/dev/efidev/efirt.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/efidev/efirt.c Sun Sep 2 21:16:43 2018 (r338436) > +++ head/sys/dev/efidev/efirt.c Sun Sep 2 21:37:05 2018 (r338437) > ... > @@ -346,30 +413,35 @@ efi_get_time_capabilities(struct efi_tmcap *tmcap) > int > efi_reset_system(void) > { > - int error; > + struct efirt_callinfo ec; > > - error =3D efi_enter(); > - if (error !=3D 0) > - return (error); > - efi_runtime->rt_reset(EFI_RESET_WARM, 0, 0, NULL); > - efi_leave(); > - return (EIO); > + if (efi_runtime =3D=3D NULL) > + return (ENXIO); > + bzero(&ec, sizeof(ec)); > + ec.ec_name =3D "rt_reset"; > + ec.ec_argcnt =3D 4; > + ec.ec_arg1 =3D (uintptr_t)EFI_RESET_WARM; > + ec.ec_arg1 =3D (uintptr_t)0; > + ec.ec_arg1 =3D (uintptr_t)0; > + ec.ec_arg1 =3D (uintptr_t)NULL; Coverity warns about ec_arg1 being overwritten before use =E2=80=94 should these be ec_arg2, 3, 4? CID 1395456. > + ec.ec_fptr =3D EFI_RT_METHOD_PA(rt_reset); > + return (efi_call(&ec)); > } Best, Conrad From owner-svn-src-head@freebsd.org Tue Sep 4 17:23:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D3C1FF5F59; Tue, 4 Sep 2018 17:23:38 +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 5BD63784C0; Tue, 4 Sep 2018 17:23:37 +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 w84HNLsH015066 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 4 Sep 2018 20:23:25 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w84HNLsH015066 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w84HNLmM015065; Tue, 4 Sep 2018 20:23:21 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 4 Sep 2018 20:23:21 +0300 From: Konstantin Belousov To: Conrad Meyer Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r338437 - in head/sys: amd64/amd64 amd64/include arm64/arm64 arm64/include conf dev/efidev modules/efirt sys Message-ID: <20180904172321.GE2340@kib.kiev.ua> References: <201809022137.w82Lb5FK046191@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) 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.27 Precedence: list List-Id: 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, 04 Sep 2018 17:23:38 -0000 On Tue, Sep 04, 2018 at 08:48:15AM -0700, Conrad Meyer wrote: > Hi Konstantin, > > On Sun, Sep 2, 2018 at 2:37 PM, Konstantin Belousov wrote: > > Author: kib > > Date: Sun Sep 2 21:37:05 2018 > > New Revision: 338437 > > URL: https://svnweb.freebsd.org/changeset/base/338437 > > > > Log: > > Catch exceptions during EFI RT calls on amd64. > > > > This appeared to be required to have EFI RT support and EFI RTC > > enabled by default, because there are too many reports of faulting > > calls on many different machines. The knob is added to leave the > > exceptions unhandled to allow to debug the actual bugs. > > ... > > > > Modified: head/sys/dev/efidev/efirt.c > > ============================================================================== > > --- head/sys/dev/efidev/efirt.c Sun Sep 2 21:16:43 2018 (r338436) > > +++ head/sys/dev/efidev/efirt.c Sun Sep 2 21:37:05 2018 (r338437) > > ... > > @@ -346,30 +413,35 @@ efi_get_time_capabilities(struct efi_tmcap *tmcap) > > int > > efi_reset_system(void) > > { > > - int error; > > + struct efirt_callinfo ec; > > > > - error = efi_enter(); > > - if (error != 0) > > - return (error); > > - efi_runtime->rt_reset(EFI_RESET_WARM, 0, 0, NULL); > > - efi_leave(); > > - return (EIO); > > + if (efi_runtime == NULL) > > + return (ENXIO); > > + bzero(&ec, sizeof(ec)); > > + ec.ec_name = "rt_reset"; > > + ec.ec_argcnt = 4; > > + ec.ec_arg1 = (uintptr_t)EFI_RESET_WARM; > > + ec.ec_arg1 = (uintptr_t)0; > > + ec.ec_arg1 = (uintptr_t)0; > > + ec.ec_arg1 = (uintptr_t)NULL; > > Coverity warns about ec_arg1 being overwritten before use ??? should > these be ec_arg2, 3, 4? CID 1395456. Indeed, thank you for reporting. Amusingly it is innocent. From owner-svn-src-head@freebsd.org Tue Sep 4 19:18: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 98FC4FF9260; Tue, 4 Sep 2018 19:18:56 +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 475A47D245; Tue, 4 Sep 2018 19:18:56 +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 385E01B36B; Tue, 4 Sep 2018 19:18:56 +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 w84JIus9072677; Tue, 4 Sep 2018 19:18:56 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w84JIuYn072676; Tue, 4 Sep 2018 19:18:56 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201809041918.w84JIuYn072676@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 4 Sep 2018 19:18:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338457 - head/sys/dev/extres/regulator X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/extres/regulator X-SVN-Commit-Revision: 338457 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 04 Sep 2018 19:18:56 -0000 Author: manu Date: Tue Sep 4 19:18:55 2018 New Revision: 338457 URL: https://svnweb.freebsd.org/changeset/base/338457 Log: regulator: Use bool values instead of 0/1 While here do not attempt to disable regulators if they are meant to be always on. Reviewed by: mmel Approved by: re (kib) Modified: head/sys/dev/extres/regulator/regulator.c Modified: head/sys/dev/extres/regulator/regulator.c ============================================================================== --- head/sys/dev/extres/regulator/regulator.c Tue Sep 4 16:47:08 2018 (r338456) +++ head/sys/dev/extres/regulator/regulator.c Tue Sep 4 19:18:55 2018 (r338457) @@ -172,7 +172,7 @@ regulator_shutdown(void *dummy) REG_TOPO_SLOCK(); TUNABLE_INT_FETCH("hw.regulator.disable_unused", &disable); TAILQ_FOREACH(entry, ®node_list, reglist_link) { - if (entry->std_param.always_on == 0 && disable) { + if (!entry->std_param.always_on && disable) { if (bootverbose) printf("regulator: shutting down %s\n", entry->name); @@ -595,8 +595,9 @@ regnode_disable(struct regnode *regnode) REGNODE_XLOCK(regnode); /* Disable regulator for each node in chain, starting from consumer. */ - if ((regnode->enable_cnt == 1) && - ((regnode->flags & REGULATOR_FLAGS_NOT_DISABLE) == 0)) { + if (regnode->enable_cnt == 1 && + (regnode->flags & REGULATOR_FLAGS_NOT_DISABLE) == 0 && + !regnode->std_param.always_on) { rv = REGNODE_ENABLE(regnode, false, &udelay); if (rv != 0) { REGNODE_UNLOCK(regnode); @@ -1048,10 +1049,10 @@ regulator_parse_ofw_stdparam(device_t pdev, phandle_t par->enable_delay = 0; if (OF_hasprop(node, "regulator-boot-on")) - par->boot_on = 1; + par->boot_on = true; if (OF_hasprop(node, "regulator-always-on")) - par->always_on = 1; + par->always_on = true; if (OF_hasprop(node, "enable-active-high")) par->enable_active_high = 1; From owner-svn-src-head@freebsd.org Tue Sep 4 19: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 5075CFF94AD; Tue, 4 Sep 2018 19:22:32 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 06C757D64B; Tue, 4 Sep 2018 19:22:32 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 01B321B4FB; Tue, 4 Sep 2018 19:22:32 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w84JMVga077320; Tue, 4 Sep 2018 19:22:31 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w84JMVOb077319; Tue, 4 Sep 2018 19:22:31 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201809041922.w84JMVOb077319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Tue, 4 Sep 2018 19:22:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338458 - head/sys/dev/usb/input X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/usb/input X-SVN-Commit-Revision: 338458 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 04 Sep 2018 19:22:32 -0000 Author: wulf Date: Tue Sep 4 19:22:31 2018 New Revision: 338458 URL: https://svnweb.freebsd.org/changeset/base/338458 Log: wmt(4): Fix regression introduced in r337289 r337289 has a side effect of reducing usb frame 0 buffer size down to touch report size. That broke some devices e.g. "Raydium Touch System" which are capable of generating non-touch frames of bigger length. Fix it with enlarging frame 0 buffer up to internal wmt(4) buffer size. Reported by: Roberto Fernandez Cueto Tested by: Roberto Fernandez Cueto Approved by: re (gjb) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D16772 Modified: head/sys/dev/usb/input/wmt.c Modified: head/sys/dev/usb/input/wmt.c ============================================================================== --- head/sys/dev/usb/input/wmt.c Tue Sep 4 19:18:55 2018 (r338457) +++ head/sys/dev/usb/input/wmt.c Tue Sep 4 19:22:31 2018 (r338458) @@ -521,7 +521,7 @@ tr_ignore: case USB_ST_SETUP: tr_setup: - usbd_xfer_set_frame_len(xfer, 0, sc->isize); + usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer)); usbd_transfer_submit(xfer); break; default: From owner-svn-src-head@freebsd.org Tue Sep 4 19:26: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 34975FF969E; Tue, 4 Sep 2018 19:26:55 +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 CEB147D9A7; Tue, 4 Sep 2018 19:26:54 +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 C3EF01B50A; Tue, 4 Sep 2018 19:26:54 +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 w84JQs7o077720; Tue, 4 Sep 2018 19:26:54 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w84JQsun077719; Tue, 4 Sep 2018 19:26:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201809041926.w84JQsun077719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 4 Sep 2018 19:26:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338459 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 338459 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 04 Sep 2018 19:26:55 -0000 Author: kib Date: Tue Sep 4 19:26:54 2018 New Revision: 338459 URL: https://svnweb.freebsd.org/changeset/base/338459 Log: amd64: For non-PTI mode, do not initialize PCPU kcr3 to KPML4phys. Non-PTI mode does not switch kcr3, which means that kcr3 is almost always stale. This is important for the NMI handler, which reloads %cr3 with PCPU(kcr3) if the value is different from PMAP_NO_CR3. The end result is that curpmap in NMI handler does not match the page table loaded into hardware. The manifestation was copyin(9) looping forever when a usermode access page fault cannot be resolved by vm_fault() updating a different page table. Reported by: mmacy Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 3 days Approved by: re (gjb) Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Tue Sep 4 19:22:31 2018 (r338458) +++ head/sys/amd64/amd64/pmap.c Tue Sep 4 19:26:54 2018 (r338459) @@ -7582,9 +7582,13 @@ pmap_activate_boot(pmap_t pmap) CPU_SET(cpuid, &pmap->pm_active); #endif PCPU_SET(curpmap, pmap); - kcr3 = pmap->pm_cr3; - if (pmap_pcid_enabled) - kcr3 |= pmap->pm_pcids[cpuid].pm_pcid | CR3_PCID_SAVE; + if (pti) { + kcr3 = pmap->pm_cr3; + if (pmap_pcid_enabled) + kcr3 |= pmap->pm_pcids[cpuid].pm_pcid | CR3_PCID_SAVE; + } else { + kcr3 = PMAP_NO_CR3; + } PCPU_SET(kcr3, kcr3); PCPU_SET(ucr3, PMAP_NO_CR3); } From owner-svn-src-head@freebsd.org Tue Sep 4 19:27: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 AC748FF970B; Tue, 4 Sep 2018 19:27:54 +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 5F0D17DB04; Tue, 4 Sep 2018 19:27:54 +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 58C4B1B50B; Tue, 4 Sep 2018 19:27:54 +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 w84JRsux077817; Tue, 4 Sep 2018 19:27:54 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w84JRsWZ077816; Tue, 4 Sep 2018 19:27:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201809041927.w84JRsWZ077816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 4 Sep 2018 19:27:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338460 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 338460 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 04 Sep 2018 19:27:54 -0000 Author: kib Date: Tue Sep 4 19:27:53 2018 New Revision: 338460 URL: https://svnweb.freebsd.org/changeset/base/338460 Log: amd64: Properly re-merge r334537 into SMAP-ified copyin(9) and copyout(9). Also this fixes the eflags.ac leak from copyin_smap() when the copied data length is multiple of eight bytes. Sponsored by: The FreeBSD Foundation Approved by: re (gjb) Modified: head/sys/amd64/amd64/support.S Modified: head/sys/amd64/amd64/support.S ============================================================================== --- head/sys/amd64/amd64/support.S Tue Sep 4 19:26:54 2018 (r338459) +++ head/sys/amd64/amd64/support.S Tue Sep 4 19:27:53 2018 (r338460) @@ -312,9 +312,10 @@ ENTRY(copyout_smap) movsq movb %dl,%cl andb $7,%cl + je 1f rep movsb - clac +1: clac done_copyout: xorl %eax,%eax @@ -361,6 +362,7 @@ ENTRY(copyin_nosmap) movsq movb %al,%cl andb $7,%cl /* copy remaining bytes */ + je done_copyin rep movsb @@ -393,10 +395,10 @@ ENTRY(copyin_smap) movsq movb %al,%cl andb $7,%cl /* copy remaining bytes */ - je done_copyin + je 1f rep movsb - clac +1: clac done_copyin: xorl %eax,%eax From owner-svn-src-head@freebsd.org Tue Sep 4 19:28:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED544FF97C1; Tue, 4 Sep 2018 19:28: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 A0EEA7DC4A; Tue, 4 Sep 2018 19:28: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 9BD171B50D; Tue, 4 Sep 2018 19:28: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 w84JSkp3077905; Tue, 4 Sep 2018 19:28:46 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w84JSkog077904; Tue, 4 Sep 2018 19:28:46 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201809041928.w84JSkog077904@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 4 Sep 2018 19:28:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338461 - head/sys/dev/efidev X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/dev/efidev X-SVN-Commit-Revision: 338461 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 04 Sep 2018 19:28:47 -0000 Author: kib Date: Tue Sep 4 19:28:46 2018 New Revision: 338461 URL: https://svnweb.freebsd.org/changeset/base/338461 Log: Assign to correct structure members. Reported by: cem from Coverity Sponsored by: The FreeBSD Foundation MFC after: 6 days Approved by: re (gjb) Modified: head/sys/dev/efidev/efirt.c Modified: head/sys/dev/efidev/efirt.c ============================================================================== --- head/sys/dev/efidev/efirt.c Tue Sep 4 19:27:53 2018 (r338460) +++ head/sys/dev/efidev/efirt.c Tue Sep 4 19:28:46 2018 (r338461) @@ -421,9 +421,9 @@ efi_reset_system(void) ec.ec_name = "rt_reset"; ec.ec_argcnt = 4; ec.ec_arg1 = (uintptr_t)EFI_RESET_WARM; - ec.ec_arg1 = (uintptr_t)0; - ec.ec_arg1 = (uintptr_t)0; - ec.ec_arg1 = (uintptr_t)NULL; + ec.ec_arg2 = (uintptr_t)0; + ec.ec_arg3 = (uintptr_t)0; + ec.ec_arg4 = (uintptr_t)NULL; ec.ec_fptr = EFI_RT_METHOD_PA(rt_reset); return (efi_call(&ec)); } From owner-svn-src-head@freebsd.org Wed Sep 5 01:46: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 D5859FD5B44; Wed, 5 Sep 2018 01:46:28 +0000 (UTC) (envelope-from kbowling@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 80E428B2C1; Wed, 5 Sep 2018 01:46:28 +0000 (UTC) (envelope-from kbowling@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 778831F396; Wed, 5 Sep 2018 01:46:28 +0000 (UTC) (envelope-from kbowling@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w851kSl0072576; Wed, 5 Sep 2018 01:46:28 GMT (envelope-from kbowling@FreeBSD.org) Received: (from kbowling@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w851kSHG072574; Wed, 5 Sep 2018 01:46:28 GMT (envelope-from kbowling@FreeBSD.org) Message-Id: <201809050146.w851kSHG072574@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kbowling set sender to kbowling@FreeBSD.org using -f From: Kevin Bowling Date: Wed, 5 Sep 2018 01:46:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338465 - in head: share/misc usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: kbowling X-SVN-Commit-Paths: in head: share/misc usr.bin/calendar/calendars X-SVN-Commit-Revision: 338465 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 05 Sep 2018 01:46:29 -0000 Author: kbowling (ports committer) Date: Wed Sep 5 01:46:27 2018 New Revision: 338465 URL: https://svnweb.freebsd.org/changeset/base/338465 Log: Add kbowling to ports committer list and calendar Approved by: re (rgrimes), timur (mentor), krion (mentor) Differential Revision: https://reviews.freebsd.org/D17021 Modified: head/share/misc/committers-ports.dot head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Wed Sep 5 01:33:30 2018 (r338464) +++ head/share/misc/committers-ports.dot Wed Sep 5 01:46:27 2018 (r338465) @@ -149,6 +149,7 @@ jsm [label="Jesper Schmitz Mouridsen\njsm@FreeBSD.org\ junovitch [label="Jason Unovitch\njunovitch@FreeBSD.org\n2015/07/27"] jylefort [label="Jean-Yves Lefort\njylefort@FreeBSD.org\n2005/04/12"] kami [label="Dominic Fandrey\nkami@FreeBSD.org\n2014/09/09"] +kbowling [label="Kevin Bowling\nkbowling@FreeBSD.org\n2018/09/02"] kevlo [label="Kevin Lo\nkevlo@FreeBSD.org\n2003/02/21"] kmoore [label="Kris Moore\nkmoore@FreeBSD.org\n2009/04/14"] knu [label="Akinori Musha\nknu@FreeBSD.org\n2000/03/22"] @@ -487,6 +488,7 @@ koobs -> xmj krion -> "0mp" krion -> brooks +krion -> kbowling krion -> miwi krion -> novel krion -> philip @@ -703,6 +705,8 @@ tcberner -> arrowd thierry -> jadawin thierry -> riggs + +timur -> kbowling tmclaugh -> itetcu tmclaugh -> xride Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Wed Sep 5 01:33:30 2018 (r338464) +++ head/usr.bin/calendar/calendars/calendar.freebsd Wed Sep 5 01:46:27 2018 (r338465) @@ -87,6 +87,7 @@ 02/23 Mathieu Arnold born in Champigny sur Marne, Val de Marne, France, 1978 02/24 Johan Karlsson born in Mariannelund, Sweden, 1974 02/24 Colin Percival born in Burnaby, Canada, 1981 +02/24 Kevin Bowling born in Scottsdale, Arizona, United States, 1989 02/26 Pietro Cerutti born in Faido, Switzerland, 1984 02/28 Daichi GOTO born in Shimizu Suntou, Shizuoka, Japan, 1980 02/28 Ruslan Makhmatkhanov born in Rostov-on-Don, USSR, 1984 From owner-svn-src-head@freebsd.org Wed Sep 5 09:53: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 267BBFEAB2B; Wed, 5 Sep 2018 09:53:56 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CFD747A3AD; Wed, 5 Sep 2018 09:53:55 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA7CA244D2; Wed, 5 Sep 2018 09:53:55 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w859rteF024870; Wed, 5 Sep 2018 09:53:55 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w859rtne024869; Wed, 5 Sep 2018 09:53:55 GMT (envelope-from br@FreeBSD.org) Message-Id: <201809050953.w859rtne024869@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 5 Sep 2018 09:53:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338466 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 338466 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 05 Sep 2018 09:53:56 -0000 Author: br Date: Wed Sep 5 09:53:55 2018 New Revision: 338466 URL: https://svnweb.freebsd.org/changeset/base/338466 Log: Fix bug: compare uaddr to VM_MAXUSER_ADDRESS, not to a tmp value left by SET_FAULT_HANDLER(). Approved by: re (kib) Sponsored by: DARPA, AFRL Modified: head/sys/riscv/riscv/copyinout.S Modified: head/sys/riscv/riscv/copyinout.S ============================================================================== --- head/sys/riscv/riscv/copyinout.S Wed Sep 5 01:46:27 2018 (r338465) +++ head/sys/riscv/riscv/copyinout.S Wed Sep 5 09:53:55 2018 (r338466) @@ -111,12 +111,12 @@ END(copyin) ENTRY(copyinstr) mv a5, x0 /* count = 0 */ beqz a2, 3f /* If len == 0 then skip loop */ - li a7, VM_MAXUSER_ADDRESS la a6, copyio_fault /* Get the handler address */ SET_FAULT_HANDLER(a6, a7) /* Set the handler */ -1: bgt a7, a0, copyio_fault + li a7, VM_MAXUSER_ADDRESS +1: bgt a0, a7, copyio_fault lb a4, 0(a0) /* Load from uaddr */ addi a0, a0, 1 sb a4, 0(a1) /* Store in kaddr */ From owner-svn-src-head@freebsd.org Wed Sep 5 11:35: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 88966FECB04; Wed, 5 Sep 2018 11:35:00 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F6B17CE63; Wed, 5 Sep 2018 11:35:00 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 35BA625522; Wed, 5 Sep 2018 11:35:00 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w85BZ0gd076040; Wed, 5 Sep 2018 11:35:00 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w85BYxgR076020; Wed, 5 Sep 2018 11:34:59 GMT (envelope-from br@FreeBSD.org) Message-Id: <201809051134.w85BYxgR076020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 5 Sep 2018 11:34:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338467 - in head/sys/riscv: include riscv X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys/riscv: include riscv X-SVN-Commit-Revision: 338467 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 05 Sep 2018 11:35:00 -0000 Author: br Date: Wed Sep 5 11:34:58 2018 New Revision: 338467 URL: https://svnweb.freebsd.org/changeset/base/338467 Log: Permit supervisor to access user VA space for certain functions only. This is done by setting SUM (permit Supervisor User Memory access) bit in sstatus register. The functions we allow access for are routines in assembly that explicitly handle crossing the user kernel boundary. Approved by: re (kib) Sponsored by: DARPA, AFRL Modified: head/sys/riscv/include/asm.h head/sys/riscv/riscv/copyinout.S head/sys/riscv/riscv/exception.S head/sys/riscv/riscv/locore.S head/sys/riscv/riscv/support.S head/sys/riscv/riscv/vm_machdep.c Modified: head/sys/riscv/include/asm.h ============================================================================== --- head/sys/riscv/include/asm.h Wed Sep 5 09:53:55 2018 (r338466) +++ head/sys/riscv/include/asm.h Wed Sep 5 11:34:58 2018 (r338467) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015 Ruslan Bukin + * Copyright (c) 2015-2018 Ruslan Bukin * All rights reserved. * * Portions of this software were developed by SRI International and the @@ -62,5 +62,13 @@ ld tmp, PC_CURTHREAD(gp); \ ld tmp, TD_PCB(tmp); /* Load the pcb */ \ sd handler, PCB_ONFAULT(tmp) /* Set the handler */ + +#define ENTER_USER_ACCESS(tmp) \ + li tmp, SSTATUS_SUM; \ + csrs sstatus, tmp + +#define EXIT_USER_ACCESS(tmp) \ + li tmp, SSTATUS_SUM; \ + csrc sstatus, tmp #endif /* _MACHINE_ASM_H_ */ Modified: head/sys/riscv/riscv/copyinout.S ============================================================================== --- head/sys/riscv/riscv/copyinout.S Wed Sep 5 09:53:55 2018 (r338466) +++ head/sys/riscv/riscv/copyinout.S Wed Sep 5 11:34:58 2018 (r338467) @@ -35,6 +35,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include "assym.inc" @@ -44,6 +45,7 @@ __FBSDID("$FreeBSD$"); */ ENTRY(copyio_fault) SET_FAULT_HANDLER(x0, a1) /* Clear the handler */ + EXIT_USER_ACCESS(a1) copyio_fault_nopcb: li a0, EFAULT ret @@ -62,6 +64,7 @@ ENTRY(copyout) la a6, copyio_fault /* Get the handler address */ SET_FAULT_HANDLER(a6, a7) /* Set the handler */ + ENTER_USER_ACCESS(a7) 1: lb a4, 0(a0) /* Load from kaddr */ addi a0, a0, 1 @@ -70,6 +73,7 @@ ENTRY(copyout) addi a2, a2, -1 /* len-- */ bnez a2, 1b + EXIT_USER_ACCESS(a7) SET_FAULT_HANDLER(x0, a7) /* Clear the handler */ 2: li a0, 0 /* return 0 */ @@ -89,6 +93,7 @@ ENTRY(copyin) la a6, copyio_fault /* Get the handler address */ SET_FAULT_HANDLER(a6, a7) /* Set the handler */ + ENTER_USER_ACCESS(a7) 1: lb a4, 0(a0) /* Load from uaddr */ addi a0, a0, 1 @@ -97,6 +102,7 @@ ENTRY(copyin) addi a2, a2, -1 /* len-- */ bnez a2, 1b + EXIT_USER_ACCESS(a7) SET_FAULT_HANDLER(x0, a7) /* Clear the handler */ 2: li a0, 0 /* return 0 */ @@ -114,6 +120,7 @@ ENTRY(copyinstr) la a6, copyio_fault /* Get the handler address */ SET_FAULT_HANDLER(a6, a7) /* Set the handler */ + ENTER_USER_ACCESS(a7) li a7, VM_MAXUSER_ADDRESS 1: bgt a0, a7, copyio_fault @@ -125,8 +132,9 @@ ENTRY(copyinstr) addi a2, a2, -1 /* len-- */ addi a5, a5, 1 /* count++ */ bnez a2, 1b - -2: SET_FAULT_HANDLER(x0, a7) /* Clear the handler */ + +2: EXIT_USER_ACCESS(a7) + SET_FAULT_HANDLER(x0, a7) /* Clear the handler */ 3: beqz a3, 4f /* Check if done != NULL */ addi a5, a5, 1 /* count++ */ Modified: head/sys/riscv/riscv/exception.S ============================================================================== --- head/sys/riscv/riscv/exception.S Wed Sep 5 09:53:55 2018 (r338466) +++ head/sys/riscv/riscv/exception.S Wed Sep 5 11:34:58 2018 (r338467) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015-2017 Ruslan Bukin + * Copyright (c) 2015-2018 Ruslan Bukin * All rights reserved. * * Portions of this software were developed by SRI International and the @@ -116,11 +116,8 @@ __FBSDID("$FreeBSD$"); .macro load_registers el ld t0, (TF_SSTATUS)(sp) .if \el == 0 - /* - * Ensure user interrupts will be enabled on eret - * and supervisor mode can access userspace on trap. - */ - li t1, (SSTATUS_SPIE | SSTATUS_SUM) + /* Ensure user interrupts will be enabled on eret */ + li t1, SSTATUS_SPIE or t0, t0, t1 .else /* Modified: head/sys/riscv/riscv/locore.S ============================================================================== --- head/sys/riscv/riscv/locore.S Wed Sep 5 09:53:55 2018 (r338466) +++ head/sys/riscv/riscv/locore.S Wed Sep 5 11:34:58 2018 (r338467) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015-2017 Ruslan Bukin + * Copyright (c) 2015-2018 Ruslan Bukin * All rights reserved. * * Portions of this software were developed by SRI International and the @@ -61,9 +61,6 @@ _start: sub s9, t2, t1 /* s9 = physmem base */ mv s10, a0 /* s10 = hart id */ mv s11, a1 /* s11 = dtbp */ - - li t0, SSTATUS_SUM - csrs sstatus, t0 /* Direct secondary cores to mpentry */ bnez s10, mpentry Modified: head/sys/riscv/riscv/support.S ============================================================================== --- head/sys/riscv/riscv/support.S Wed Sep 5 09:53:55 2018 (r338466) +++ head/sys/riscv/riscv/support.S Wed Sep 5 11:34:58 2018 (r338467) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015 Ruslan Bukin + * Copyright (c) 2015-2018 Ruslan Bukin * All rights reserved. * * Portions of this software were developed by SRI International and the @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include "assym.inc" @@ -44,6 +45,7 @@ __FBSDID("$FreeBSD$"); */ ENTRY(fsu_fault) SET_FAULT_HANDLER(x0, a1) /* Reset the handler function */ + EXIT_USER_ACCESS(a1) fsu_fault_nopcb: li a0, -1 ret @@ -57,11 +59,13 @@ ENTRY(casueword32) bgt a0, a4, fsu_fault_nopcb la a6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(a6, a4) /* And set it */ + ENTER_USER_ACCESS(a4) 1: lr.w a4, 0(a0) /* Load-exclusive the data */ bne a4, a1, 2f /* If not equal then exit */ sc.w a5, a3, 0(a0) /* Store the new data */ bnez a5, 1b /* Retry on failure */ -2: SET_FAULT_HANDLER(x0, a5) /* Reset the fault handler */ +2: EXIT_USER_ACCESS(a5) + SET_FAULT_HANDLER(x0, a5) /* Reset the fault handler */ sw a4, 0(a2) /* Store the read data */ li a0, 0 /* Success */ ret /* Return */ @@ -75,11 +79,13 @@ ENTRY(casueword) bgt a0, a4, fsu_fault_nopcb la a6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(a6, a4) /* And set it */ + ENTER_USER_ACCESS(a4) 1: lr.d a4, 0(a0) /* Load-exclusive the data */ bne a4, a1, 2f /* If not equal then exit */ sc.d a5, a3, 0(a0) /* Store the new data */ bnez a5, 1b /* Retry on failure */ -2: SET_FAULT_HANDLER(x0, a5) /* Reset the fault handler */ +2: EXIT_USER_ACCESS(a5) + SET_FAULT_HANDLER(x0, a5) /* Reset the fault handler */ sd a4, 0(a2) /* Store the read data */ li a0, 0 /* Success */ ret /* Return */ @@ -93,7 +99,9 @@ ENTRY(fubyte) bgt a0, a1, fsu_fault_nopcb la a6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(a6, a1) /* And set it */ + ENTER_USER_ACCESS(a1) lb a0, 0(a0) /* Try loading the data */ + EXIT_USER_ACCESS(a1) SET_FAULT_HANDLER(x0, a1) /* Reset the fault handler */ ret /* Return */ END(fubyte) @@ -106,7 +114,9 @@ ENTRY(fuword16) bgt a0, a1, fsu_fault_nopcb la a6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(a6, a1) /* And set it */ + ENTER_USER_ACCESS(a1) lh a0, 0(a0) /* Try loading the data */ + EXIT_USER_ACCESS(a1) SET_FAULT_HANDLER(x0, a1) /* Reset the fault handler */ ret /* Return */ END(fuword16) @@ -119,7 +129,9 @@ ENTRY(fueword32) bgt a0, a2, fsu_fault_nopcb la a6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(a6, a2) /* And set it */ + ENTER_USER_ACCESS(a2) lw a0, 0(a0) /* Try loading the data */ + EXIT_USER_ACCESS(a2) SET_FAULT_HANDLER(x0, a2) /* Reset the fault handler */ sw a0, 0(a1) /* Save the data in kernel space */ li a0, 0 /* Success */ @@ -136,7 +148,9 @@ EENTRY(fueword64) bgt a0, a2, fsu_fault_nopcb la a6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(a6, a2) /* And set it */ + ENTER_USER_ACCESS(a2) ld a0, 0(a0) /* Try loading the data */ + EXIT_USER_ACCESS(a2) SET_FAULT_HANDLER(x0, a2) /* Reset the fault handler */ sd a0, 0(a1) /* Save the data in kernel space */ li a0, 0 /* Success */ @@ -152,7 +166,9 @@ ENTRY(subyte) bgt a0, a2, fsu_fault_nopcb la a6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(a6, a2) /* And set it */ + ENTER_USER_ACCESS(a2) sb a1, 0(a0) /* Try storing the data */ + EXIT_USER_ACCESS(a2) SET_FAULT_HANDLER(x0, a2) /* Reset the fault handler */ li a0, 0 /* Success */ ret /* Return */ @@ -166,7 +182,9 @@ ENTRY(suword16) bgt a0, a2, fsu_fault_nopcb la a6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(a6, a2) /* And set it */ + ENTER_USER_ACCESS(a2) sh a1, 0(a0) /* Try storing the data */ + EXIT_USER_ACCESS(a2) SET_FAULT_HANDLER(x0, a2) /* Reset the fault handler */ li a0, 0 /* Success */ ret /* Return */ @@ -180,7 +198,9 @@ ENTRY(suword32) bgt a0, a2, fsu_fault_nopcb la a6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(a6, a2) /* And set it */ + ENTER_USER_ACCESS(a2) sw a1, 0(a0) /* Try storing the data */ + EXIT_USER_ACCESS(a2) SET_FAULT_HANDLER(x0, a2) /* Reset the fault handler */ li a0, 0 /* Success */ ret /* Return */ @@ -195,7 +215,9 @@ EENTRY(suword64) bgt a0, a2, fsu_fault_nopcb la a6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(a6, a2) /* And set it */ + ENTER_USER_ACCESS(a2) sd a1, 0(a0) /* Try storing the data */ + EXIT_USER_ACCESS(a2) SET_FAULT_HANDLER(x0, a2) /* Reset the fault handler */ li a0, 0 /* Success */ ret /* Return */ Modified: head/sys/riscv/riscv/vm_machdep.c ============================================================================== --- head/sys/riscv/riscv/vm_machdep.c Wed Sep 5 09:53:55 2018 (r338466) +++ head/sys/riscv/riscv/vm_machdep.c Wed Sep 5 11:34:58 2018 (r338467) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015-2017 Ruslan Bukin + * Copyright (c) 2015-2018 Ruslan Bukin * All rights reserved. * * Portions of this software were developed by SRI International and the @@ -105,7 +105,6 @@ cpu_fork(struct thread *td1, struct proc *p2, struct t tf->tf_a[0] = 0; tf->tf_a[1] = 0; tf->tf_sstatus |= (SSTATUS_SPIE); /* Enable interrupts. */ - tf->tf_sstatus |= (SSTATUS_SUM); /* Supervisor can access userspace. */ tf->tf_sstatus &= ~(SSTATUS_SPP); /* User mode. */ td2->td_frame = tf; From owner-svn-src-head@freebsd.org Wed Sep 5 13:59: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 EFE9FFF0CCE; Wed, 5 Sep 2018 13:59:36 +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 A5D1B8200A; Wed, 5 Sep 2018 13:59:36 +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 9CCA326B7F; Wed, 5 Sep 2018 13:59:36 +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 w85Dxafa048391; Wed, 5 Sep 2018 13:59:36 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w85DxaPl048390; Wed, 5 Sep 2018 13:59:36 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201809051359.w85DxaPl048390@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Wed, 5 Sep 2018 13:59:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338468 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 338468 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 05 Sep 2018 13:59:37 -0000 Author: eugen Date: Wed Sep 5 13:59:36 2018 New Revision: 338468 URL: https://svnweb.freebsd.org/changeset/base/338468 Log: Fix "ipfw fwd" to work for incoming IPv4 packets when ip_tryforward() chooses fast forwarding path, as it already works for IPv6 and for both of them on old slow path. PR: 231143 Reviewed by: ae Approved by: re (gjb) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D17039 Modified: head/sys/netinet/ip_fastfwd.c Modified: head/sys/netinet/ip_fastfwd.c ============================================================================== --- head/sys/netinet/ip_fastfwd.c Wed Sep 5 11:34:58 2018 (r338467) +++ head/sys/netinet/ip_fastfwd.c Wed Sep 5 13:59:36 2018 (r338468) @@ -153,7 +153,7 @@ ip_tryforward(struct mbuf *m) struct mbuf *m0 = NULL; struct nhop4_basic nh; struct sockaddr_in dst; - struct in_addr odest, dest; + struct in_addr dest, odest, rtdest; uint16_t ip_len, ip_off; int error = 0; struct m_tag *fwd_tag = NULL; @@ -294,12 +294,31 @@ passin: #endif /* + * Next hop forced by pfil(9) hook? + */ + if ((m->m_flags & M_IP_NEXTHOP) && + ((fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL)) != NULL)) { + /* + * Now we will find route to forced destination. + */ + dest.s_addr = ((struct sockaddr_in *) + (fwd_tag + 1))->sin_addr.s_addr; + m_tag_delete(m, fwd_tag); + m->m_flags &= ~M_IP_NEXTHOP; + } + + /* * Find route to destination. */ if (ip_findroute(&nh, dest, m) != 0) return (NULL); /* icmp unreach already sent */ /* + * Avoid second route lookup by caching destination. + */ + rtdest.s_addr = dest.s_addr; + + /* * Step 5: outgoing firewall packet processing */ if (!PFIL_HOOKED(&V_inet_pfil_hook)) @@ -321,6 +340,8 @@ passin: */ if (m->m_flags & M_IP_NEXTHOP) fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL); + else + fwd_tag = NULL; if (odest.s_addr != dest.s_addr || fwd_tag != NULL) { /* * Is it now for a local address on this host? @@ -342,7 +363,8 @@ forwardlocal: m_tag_delete(m, fwd_tag); m->m_flags &= ~M_IP_NEXTHOP; } - if (ip_findroute(&nh, dest, m) != 0) + if (dest.s_addr != rtdest.s_addr && + ip_findroute(&nh, dest, m) != 0) return (NULL); /* icmp unreach already sent */ } From owner-svn-src-head@freebsd.org Wed Sep 5 15:04: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 9D978FF349D; Wed, 5 Sep 2018 15:04:12 +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 537FA85207; Wed, 5 Sep 2018 15:04:12 +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 4E533276B8; Wed, 5 Sep 2018 15:04:12 +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 w85F4CZk084251; Wed, 5 Sep 2018 15:04:12 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w85F4CN5084250; Wed, 5 Sep 2018 15:04:12 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201809051504.w85F4CN5084250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 5 Sep 2018 15:04:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338470 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 338470 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 05 Sep 2018 15:04:12 -0000 Author: markj Date: Wed Sep 5 15:04:11 2018 New Revision: 338470 URL: https://svnweb.freebsd.org/changeset/base/338470 Log: Fix style bugs in in_pcblookup_lbgroup(). No functional change intended. Reviewed by: bz, Johannes Lundberg Approved by: re (rgrimes) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17030 Modified: head/sys/netinet/in_pcb.c Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Wed Sep 5 14:49:26 2018 (r338469) +++ head/sys/netinet/in_pcb.c Wed Sep 5 15:04:11 2018 (r338470) @@ -1950,18 +1950,18 @@ in_pcblookup_local(struct inpcbinfo *pcbinfo, struct i static struct inpcb * in_pcblookup_lbgroup(const struct inpcbinfo *pcbinfo, - const struct in_addr *laddr, uint16_t lport, const struct in_addr *faddr, - uint16_t fport, int lookupflags) + const struct in_addr *laddr, uint16_t lport, const struct in_addr *faddr, + uint16_t fport, int lookupflags) { - struct inpcb *local_wild = NULL; + struct inpcb *local_wild; const struct inpcblbgrouphead *hdr; struct inpcblbgroup *grp; - struct inpcblbgroup *grp_local_wild; + uint32_t idx; INP_HASH_LOCK_ASSERT(pcbinfo); - hdr = &pcbinfo->ipi_lbgrouphashbase[ - INP_PCBLBGROUP_PORTHASH(lport, pcbinfo->ipi_lbgrouphashmask)]; + hdr = &pcbinfo->ipi_lbgrouphashbase[INP_PCBLBGROUP_PORTHASH(lport, + pcbinfo->ipi_lbgrouphashmask)]; /* * Order of socket selection: @@ -1972,35 +1972,24 @@ in_pcblookup_lbgroup(const struct inpcbinfo *pcbinfo, * - Load balanced group does not contain jailed sockets * - Load balanced group does not contain IPv4 mapped INET6 wild sockets */ + local_wild = NULL; LIST_FOREACH(grp, hdr, il_list) { #ifdef INET6 if (!(grp->il_vflag & INP_IPV4)) continue; #endif + if (grp->il_lport != lport) + continue; - if (grp->il_lport == lport) { - - uint32_t idx = 0; - int pkt_hash = INP_PCBLBGROUP_PKTHASH(faddr->s_addr, - lport, fport); - - idx = pkt_hash % grp->il_inpcnt; - - if (grp->il_laddr.s_addr == laddr->s_addr) { - return (grp->il_inp[idx]); - } else { - if (grp->il_laddr.s_addr == INADDR_ANY && - (lookupflags & INPLOOKUP_WILDCARD)) { - local_wild = grp->il_inp[idx]; - grp_local_wild = grp; - } - } - } + idx = INP_PCBLBGROUP_PKTHASH(faddr->s_addr, lport, fport) % + grp->il_inpcnt; + if (grp->il_laddr.s_addr == laddr->s_addr) + return (grp->il_inp[idx]); + if (grp->il_laddr.s_addr == INADDR_ANY && + (lookupflags & INPLOOKUP_WILDCARD) != 0) + local_wild = grp->il_inp[idx]; } - if (local_wild != NULL) { - return (local_wild); - } - return (NULL); + return (local_wild); } #ifdef PCBGROUP From owner-svn-src-head@freebsd.org Wed Sep 5 15:25: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 85941FF3AFA; Wed, 5 Sep 2018 15:25:24 +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 3B87E85CE6; Wed, 5 Sep 2018 15:25:24 +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 3212D279F8; Wed, 5 Sep 2018 15:25:24 +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 w85FPNBq094255; Wed, 5 Sep 2018 15:25:23 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w85FPNxE094252; Wed, 5 Sep 2018 15:25:23 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201809051525.w85FPNxE094252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Wed, 5 Sep 2018 15:25:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338471 - in head: etc libexec/getty X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: in head: etc libexec/getty X-SVN-Commit-Revision: 338471 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 05 Sep 2018 15:25:24 -0000 Author: brd Date: Wed Sep 5 15:25:23 2018 New Revision: 338471 URL: https://svnweb.freebsd.org/changeset/base/338471 Log: Move gettytab to libexec/getty/ Approved by: re (gjb), will (mentor) Differential Revision: https://reviews.freebsd.org/D16953 Added: head/libexec/getty/gettytab - copied unchanged from r338470, head/etc/gettytab Deleted: head/etc/gettytab Modified: head/etc/Makefile head/libexec/getty/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Wed Sep 5 15:04:11 2018 (r338470) +++ head/etc/Makefile Wed Sep 5 15:25:23 2018 (r338471) @@ -15,7 +15,6 @@ SUBDIR+=sendmail BIN1= crontab \ dhclient.conf \ disktab \ - gettytab \ group \ hosts \ hosts.allow \ Modified: head/libexec/getty/Makefile ============================================================================== --- head/libexec/getty/Makefile Wed Sep 5 15:04:11 2018 (r338470) +++ head/libexec/getty/Makefile Wed Sep 5 15:25:23 2018 (r338471) @@ -1,6 +1,7 @@ # from: @(#)Makefile 8.1 (Berkeley) 6/4/93 # $FreeBSD$ +CONFS= gettytab PROG= getty SRCS= main.c init.c subr.c chat.c LIBADD= util Copied: head/libexec/getty/gettytab (from r338470, head/etc/gettytab) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/getty/gettytab Wed Sep 5 15:25:23 2018 (r338471, copy of r338470, head/etc/gettytab) @@ -0,0 +1,239 @@ +# $FreeBSD$ +# from: @(#)gettytab 5.14 (Berkeley) 3/27/91 +# +# Most of the table entries here are just copies of the old getty table, +# it is by no means certain, or even likely, that any of them are optimal +# for any purpose whatever. Nor is it likely that more than a couple are +# even correct. +# +# The default gettytab entry, used to set defaults for all other +# entries, and in cases where getty is called with no table name. +# +# cb, ce and ck are desirable on most crt's. The non-crt entries need to +# be changed to turn them off (:cb@:ce@:ck@:). +# +# lc should always be on; it's a remainder of some stone age when there +# have been terminals around not being able of handling lower-case +# characters. Those terminals aren't supported any longer, but getty is +# `smart' about them by default. +# +# Parity defaults to even, but the Pc entry and all the `std' entries +# specify no parity. The different parities are: +# (none): same as ep for getty. login will use terminal as is. +# ep: getty will use raw mode (cs8 -parenb) (unless rw is set) and +# fake parity. login will use even parity (cs7 parenb -parodd). +# op: same as ep except odd parity (cs7 parenb parodd) for login. +# getty will fake odd parity as well. +# ap: same as ep except -inpck instead of inpck for login. +# ap overrides op and ep. +# np: 1. don't fake parity in getty. The fake parity garbles +# characters on non-terminals (like pccons) that don't +# support parity. It would probably better for getty not to +# try to fake parity. It could just use cbreak mode so as +# not to force cs8 and let the hardware handle the parity. +# login has to be rely on the hardware anyway. +# 2. set cs8 -parenb -istrip -inpck. +# ep:op: same as ap. +# +default:\ + :cb:ce:ck:lc:fd#1000:im=\r\n%s/%m (%h) (%t)\r\n\r\n:sp#1200:\ + :if=/etc/issue: + +# +# Fixed speed entries +# +# The "std.NNN" names are known to the special case +# portselector code in getty, however they can +# be assigned to any table desired. +# The "NNN-baud" names are known to the special case +# autobaud code in getty, and likewise can +# be assigned to any table desired (hopefully the same speed). +# +std:\ + :np:sp#0: +a|std.110|110-baud:\ + :np:nd#1:cd#1:uc:sp#110: +b|std.134|134.5-baud:\ + :np:nd#1:cd#2:ff#1:td#1:sp#134:ht:nl: +1|std.150|150-baud:\ + :np:nd#1:cd#2:td#1:fd#1:sp#150:ht:nl:lm=\E\72\6\6\17login\72 : +c|std.300|300-baud:\ + :np:nd#1:cd#1:sp#300: +d|std.600|600-baud:\ + :np:nd#1:cd#1:sp#600: +f|std.1200|1200-baud:\ + :np:fd#1:sp#1200: +6|std.2400|2400-baud:\ + :np:sp#2400: +7|std.4800|4800-baud:\ + :np:sp#4800: +2|std.9600|9600-baud:\ + :np:sp#9600: +g|std.19200|19200-baud:\ + :np:sp#19200: +std.38400|38400-baud:\ + :np:sp#38400: +std.57600|57600-baud:\ + :np:sp#57600: +std.115200|115200-baud:\ + :np:sp#115200: +std.230400|230400-baud:\ + :np:sp#230400: + +# +# Entry specifying explicit device settings. See termios(4) and +# /usr/include/termios.h, too. The entry forces the tty into +# CLOCAL mode (so no DCD is required), and uses Xon/Xoff flow control. +# +# cflags: CLOCAL | HUPCL | CREAD | CS8 +# oflags: OPOST | ONLCR | OXTABS +# iflags: IXOFF | IXON | ICRNL | IGNPAR +# lflags: IEXTEN | ICANON | ISIG | ECHOCTL | ECHO | ECHOK | ECHOE | ECHOKE +# +# The `0' flags don't have input enabled. The `1' flags don't echo. +# (Echoing is done inside getty itself.) +# +local.9600|CLOCAL tty @ 9600 Bd:\ + :c0#0x0000c300:c1#0x0000cb00:c2#0x0000cb00:\ + :o0#0x00000007:o1#0x00000002:o2#0x00000007:\ + :i0#0x00000704:i1#0x00000000:i2#0x00000704:\ + :l0#0x000005cf:l1#0x00000000:l2#0x000005cf:\ + :sp#9600:np: + +# +# Dial in rotary tables, speed selection via 'break' +# +0|d300|Dial-300:\ + :nx=d1200:cd#2:sp#300: +d1200|Dial-1200:\ + :nx=d150:fd#1:sp#1200: +d150|Dial-150:\ + :nx=d110:lm@:tc=150-baud: +d110|Dial-110:\ + :nx=d300:tc=300-baud: + +# +# Fast dialup terminals, 2400/1200/300 rotary (can start either way) +# +D2400|d2400|Fast-Dial-2400:\ + :nx=D1200:tc=2400-baud: +3|D1200|Fast-Dial-1200:\ + :nx=D300:tc=1200-baud: +5|D300|Fast-Dial-300:\ + :nx=D2400:tc=300-baud: + +# +#telebit (19200) +# +t19200:\ + :nx=t2400:tc=19200-baud: +t2400:\ + :nx=t1200:tc=2400-baud: +t1200:\ + :nx=t19200:tc=1200-baud: + +# +#telebit (9600) +# +t9600:\ + :nx=t2400a:tc=9600-baud: +t2400a:\ + :nx=t1200a:tc=2400-baud: +t1200a:\ + :nx=t9600:tc=1200-baud: + +# +# Odd special case terminals +# +-|tty33|asr33|Pity the poor user of this beast:\ + :tc=110-baud: + +4|Console|Console Decwriter II:\ + :nd@:cd@:rw:tc=300-baud: + +e|Console-1200|Console Decwriter III:\ + :fd@:nd@:cd@:rw:tc=1200-baud: + +i|Interdata console:\ + :uc:sp#0: + +l|lsi chess terminal:\ + :sp#300: + +X|Xwindow|X window system:\ + :fd@:nd@:cd@:rw:sp#9600: + +P|Pc|Pc console:\ + :ht:np:sp#9600: + +# +# Weirdo special case for fast crt's with hardcopy devices +# +8|T9600|CRT with hardcopy:\ + :nx=T300:tc=9600-baud: +9|T300|CRT with hardcopy (300):\ + :nx=T9600:tc=300-baud: + +# +# Plugboard, and misc other terminals +# +plug-9600|Plugboard-9600:\ + :pf#1:tc=9600-baud: +p|P9600|Plugboard-9600-rotary:\ + :pf#1:nx=P300:tc=9600-baud: +q|P300|Plugboard-300:\ + :pf#1:nx=P1200:tc=300-baud: +r|P1200|Plugboard-1200:\ + :pf#1:nx=P9600:tc=1200-baud: + +# +# XXXX Port selector +# +s|DSW|Port Selector:\ + :ps:sp#2400: + +# +# Auto-baud speed detect entry for Micom 600. +# Special code in getty will switch this out +# to one of the NNN-baud entries. +# +A|Auto-baud:\ + :ab:sp#2400:f0#040: + +# +# autologin - automatically log in as root +# + +autologin|al.9600:\ + :al=root:tc=std.9600: +al.19200:\ + :al=root:tc=std.19200: +al.38400:\ + :al=root:tc=std.38400: +al.57600:\ + :al=root:tc=std.57600: +al.115200:\ + :al=root:tc=std.115200: +al.230400:\ + :al=root:tc=std.230400: +al.Pc:\ + :al=root:tc=Pc + +# +# Entries for 3-wire serial terminals. These don't supply carrier, so +# clocal needs to be set, and crtscts needs to be unset. +# +3wire:\ + :np:nc:sp#0: +3wire.9600|9600-3wire:\ + :np:nc:sp#9600: +3wire.19200|19200-3wire:\ + :np:nc:sp#19200: +3wire.38400|38400-3wire:\ + :np:nc:sp#38400: +3wire.57600|57600-3wire:\ + :np:nc:sp#57600: +3wire.115200|115200-3wire:\ + :np:nc:sp#115200: +3wire.230400|230400-3wire:\ + :np:nc:sp#230400: From owner-svn-src-head@freebsd.org Wed Sep 5 19:05: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 CFB15FFA451; Wed, 5 Sep 2018 19:05:30 +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 84BBF8ED1B; Wed, 5 Sep 2018 19:05:30 +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 7B96A29D1B; Wed, 5 Sep 2018 19:05:30 +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 w85J5Uju007401; Wed, 5 Sep 2018 19:05:30 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w85J5UGH007400; Wed, 5 Sep 2018 19:05:30 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201809051905.w85J5UGH007400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 5 Sep 2018 19:05:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338472 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 338472 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 05 Sep 2018 19:05:31 -0000 Author: markj Date: Wed Sep 5 19:05:30 2018 New Revision: 338472 URL: https://svnweb.freebsd.org/changeset/base/338472 Log: Correct the condition under which we allocate a terminator node. We will have last_block < blocks if the block count is divisible by BLIST_BMAP_RADIX, but a terminator node is still needed if the tree isn't balanced. In this case we were overruning the blist array by 16 bytes during initialization. While here, add a check for the invalid blocks == 0 case. PR: 231116 Reviewed by: alc, kib (previous version), Doug Moore Approved by: re (gjb) MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17020 Modified: head/sys/kern/subr_blist.c Modified: head/sys/kern/subr_blist.c ============================================================================== --- head/sys/kern/subr_blist.c Wed Sep 5 15:25:23 2018 (r338471) +++ head/sys/kern/subr_blist.c Wed Sep 5 19:05:30 2018 (r338472) @@ -224,17 +224,19 @@ blist_create(daddr_t blocks, int flags) u_daddr_t nodes, radix, skip; int digit; + if (blocks == 0) + panic("invalid block count"); + /* - * Calculate the radix and node count used for scanning. Find the last - * block that is followed by a terminator. + * Calculate the radix and node count used for scanning. */ last_block = blocks - 1; radix = BLIST_BMAP_RADIX; while (radix < blocks) { if (((last_block / radix + 1) & BLIST_META_MASK) != 0) /* - * A terminator will be added. Update last_block to the - * position just before that terminator. + * We must widen the blist to avoid partially + * filled nodes. */ last_block |= radix - 1; radix *= BLIST_META_RADIX; @@ -244,7 +246,9 @@ blist_create(daddr_t blocks, int flags) * Count the meta-nodes in the expanded tree, including the final * terminator, from the bottom level up to the root. */ - nodes = (last_block >= blocks) ? 2 : 1; + nodes = 1; + if (radix - blocks >= BLIST_BMAP_RADIX) + nodes++; last_block /= BLIST_BMAP_RADIX; while (last_block > 0) { nodes += last_block + 1; From owner-svn-src-head@freebsd.org Wed Sep 5 19:16: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 7188FFFA811; Wed, 5 Sep 2018 19:16:10 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1E4238F46D; Wed, 5 Sep 2018 19:16:10 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 12E9629EB0; Wed, 5 Sep 2018 19:16:10 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w85JG9vb013100; Wed, 5 Sep 2018 19:16:09 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w85JG9cF013099; Wed, 5 Sep 2018 19:16:09 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201809051916.w85JG9cF013099@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Wed, 5 Sep 2018 19:16:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338473 - head/bin/sh X-SVN-Group: head X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: head/bin/sh X-SVN-Commit-Revision: 338473 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 05 Sep 2018 19:16:10 -0000 Author: jilles Date: Wed Sep 5 19:16:09 2018 New Revision: 338473 URL: https://svnweb.freebsd.org/changeset/base/338473 Log: sh: Fix formal overflow in pointer arithmetic The intention is to lower the value of the pointer, which according to ubsan cannot be done by adding an unsigned quantity. Reported by: kevans Approved by: re (kib) MFC after: 1 week Modified: head/bin/sh/expand.c Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Wed Sep 5 19:05:30 2018 (r338472) +++ head/bin/sh/expand.c Wed Sep 5 19:16:09 2018 (r338473) @@ -896,7 +896,7 @@ reprocess(int startloc, int flag, int subtype, int quo startp = stackblock() + startloc; len = expdest - startp; - if (len >= SIZE_MAX / 2) + if (len >= SIZE_MAX / 2 || len > PTRDIFF_MAX) abort(); INTOFF; if (len >= buflen) { @@ -912,7 +912,7 @@ reprocess(int startloc, int flag, int subtype, int quo INTON; memcpy(buf, startp, len); buf[len] = '\0'; - STADJUST(-len, expdest); + STADJUST(-(ptrdiff_t)len, expdest); for (zpos = 0;;) { zlen = strlen(buf + zpos); strtodest(buf + zpos, flag, subtype, quoted, dst); From owner-svn-src-head@freebsd.org Wed Sep 5 20:02:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16E01FFB625; Wed, 5 Sep 2018 20:02: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 C15A870E4B; Wed, 5 Sep 2018 20:02:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC58F2A6B9; Wed, 5 Sep 2018 20:02:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w85K2Not037766; Wed, 5 Sep 2018 20:02:23 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w85K2Npd037765; Wed, 5 Sep 2018 20:02:23 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201809052002.w85K2Npd037765@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 5 Sep 2018 20:02:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338474 - head/stand X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand X-SVN-Commit-Revision: 338474 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 05 Sep 2018 20:02:24 -0000 Author: imp Date: Wed Sep 5 20:02:23 2018 New Revision: 338474 URL: https://svnweb.freebsd.org/changeset/base/338474 Log: Be a little conservative about when to force size optimizations. Reports have come in that there's issue with powerpc and sparc64 since we've switched to using -Oz / -Os. We don't strictly need them for !x86, so be conservative about when we enable them. Approved by: re@ (gjb) Differential Revision: https://reviews.freebsd.org/D17016 Modified: head/stand/defs.mk Modified: head/stand/defs.mk ============================================================================== --- head/stand/defs.mk Wed Sep 5 19:16:09 2018 (r338473) +++ head/stand/defs.mk Wed Sep 5 20:02:23 2018 (r338474) @@ -53,12 +53,14 @@ CFLAGS+= -I${SASRC} -D_STANDALONE CFLAGS+= -I${SYSDIR} # Spike the floating point interfaces CFLAGS+= -Ddouble=jagged-little-pill -Dfloat=floaty-mcfloatface +.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" # Slim down the image. This saves about 15% in size with clang 6 on x86 # Our most constrained /boot/loader env is BIOS booting on x86, where # our text + data + BTX have to fit into 640k below the ISA hole. # Experience has shown that problems arise between ~520k to ~530k. CFLAGS.clang+= -Oz CFLAGS.gcc+= -Os +.endif # GELI Support, with backward compat hooks (mostly) .if defined(LOADER_NO_GELI_SUPPORT) From owner-svn-src-head@freebsd.org Wed Sep 5 20:51: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 CC7C0FFC86D; Wed, 5 Sep 2018 20:51:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 81ED372991; Wed, 5 Sep 2018 20:51:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7CC982AE83; Wed, 5 Sep 2018 20:51:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w85Kpt9d064071; Wed, 5 Sep 2018 20:51:55 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w85KpsCl064064; Wed, 5 Sep 2018 20:51:54 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201809052051.w85KpsCl064064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 5 Sep 2018 20:51:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338478 - in head: contrib/elftoolchain/elfcopy contrib/elftoolchain/libelf sys/sys X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: contrib/elftoolchain/elfcopy contrib/elftoolchain/libelf sys/sys X-SVN-Commit-Revision: 338478 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 05 Sep 2018 20:51:56 -0000 Author: jhb Date: Wed Sep 5 20:51:53 2018 New Revision: 338478 URL: https://svnweb.freebsd.org/changeset/base/338478 Log: Fix objcopy for little-endian MIPS64 objects. MIPS64 does not store the 'r_info' field of a relocation table entry as a 64-bit value consisting of a 32-bit symbol index in the high 32 bits and a 32-bit type in the low 32 bits as on other architectures. Instead, the 64-bit 'r_info' field is really a 32-bit symbol index followed by four individual byte type fields. For big-endian MIPS64, treating this as a 64-bit integer happens to be compatible with the layout expected by other architectures (symbol index in upper 32-bits of resulting "native" 64-bit integer). However, for little-endian MIPS64 the parsed 64-bit integer contains the symbol index in the low 32 bits and the 4 individual byte type fields in the upper 32-bits (but as if the upper 32-bits were byte-swapped). To cope, add two helper routines in gelf_getrel.c to translate between the correct native 'r_info' value and the value obtained after the normal byte-swap translation. Use these routines in gelf_getrel(), gelf_getrela(), gelf_update_rel(), and gelf_update_rela(). This fixes 'readelf -r' on little-endian MIPS64 objects which was previously decoding incorrect relocations as well as 'objcopy: invalid symbox index' warnings from objcopy when extracting debug symbols from kernel modules. Even with this fixed, objcopy was still crashing when trying to extract debug symbols from little-endian MIPS64 modules. The workaround in gelf_*rel*() depends on the current ELF object having a valid ELF header so that the 'e_machine' field can be compared against EM_MIPS. objcopy was parsing the relocation entries to possibly rewrite the 'r_info' fields in the update_relocs() function before writing the initial ELF header to the destination object file. Move the initial write of the ELF header earlier before copy_contents() so that update_relocs() uses the correct symbol index values. Note that this change should really go upstream. The binutils readelf source has a similar hack for MIPS64EL though I implemented this version from scratch using the MIPS64 ABI PDF as a reference. Discussed with: jkoshy Reviewed by: emaste, imp Approved by: re (gjb, kib) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D15734 Added: head/contrib/elftoolchain/libelf/gelf_mips64el.c (contents, props changed) Modified: head/contrib/elftoolchain/elfcopy/main.c head/contrib/elftoolchain/libelf/Makefile head/contrib/elftoolchain/libelf/_libelf.h head/contrib/elftoolchain/libelf/gelf_rel.c head/contrib/elftoolchain/libelf/gelf_rela.c head/sys/sys/param.h Modified: head/contrib/elftoolchain/elfcopy/main.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/main.c Wed Sep 5 20:47:51 2018 (r338477) +++ head/contrib/elftoolchain/elfcopy/main.c Wed Sep 5 20:51:53 2018 (r338478) @@ -372,6 +372,14 @@ create_elf(struct elfcopy *ecp) create_symtab(ecp); /* + * Write the underlying ehdr. Note that it should be called + * before elf_setshstrndx() since it will overwrite e->e_shstrndx. + */ + if (gelf_update_ehdr(ecp->eout, &oeh) == 0) + errx(EXIT_FAILURE, "gelf_update_ehdr() failed: %s", + elf_errmsg(-1)); + + /* * First processing of output sections: at this stage we copy the * content of each section from input to output object. Section * content will be modified and printed (mcs) if need. Also content of @@ -379,14 +387,6 @@ create_elf(struct elfcopy *ecp) * to symbol table changes. */ copy_content(ecp); - - /* - * Write the underlying ehdr. Note that it should be called - * before elf_setshstrndx() since it will overwrite e->e_shstrndx. - */ - if (gelf_update_ehdr(ecp->eout, &oeh) == 0) - errx(EXIT_FAILURE, "gelf_update_ehdr() failed: %s", - elf_errmsg(-1)); /* Generate section name string table (.shstrtab). */ set_shstrtab(ecp); Modified: head/contrib/elftoolchain/libelf/Makefile ============================================================================== --- head/contrib/elftoolchain/libelf/Makefile Wed Sep 5 20:47:51 2018 (r338477) +++ head/contrib/elftoolchain/libelf/Makefile Wed Sep 5 20:51:53 2018 (r338478) @@ -35,6 +35,7 @@ SRCS= elf.c \ gelf_ehdr.c \ gelf_getclass.c \ gelf_fsize.c \ + gelf_mips64el.c \ gelf_move.c \ gelf_phdr.c \ gelf_rel.c \ Modified: head/contrib/elftoolchain/libelf/_libelf.h ============================================================================== --- head/contrib/elftoolchain/libelf/_libelf.h Wed Sep 5 20:47:51 2018 (r338477) +++ head/contrib/elftoolchain/libelf/_libelf.h Wed Sep 5 20:51:53 2018 (r338478) @@ -216,12 +216,15 @@ int (*_libelf_get_translator(Elf_Type _t, int _directi void *_libelf_getphdr(Elf *_e, int _elfclass); void *_libelf_getshdr(Elf_Scn *_scn, int _elfclass); void _libelf_init_elf(Elf *_e, Elf_Kind _kind); +int _libelf_is_mips64el(Elf *e); int _libelf_load_section_headers(Elf *e, void *ehdr); unsigned int _libelf_malign(Elf_Type _t, int _elfclass); Elf *_libelf_memory(unsigned char *_image, size_t _sz, int _reporterror); size_t _libelf_msize(Elf_Type _t, int _elfclass, unsigned int _version); void *_libelf_newphdr(Elf *_e, int _elfclass, size_t _count); Elf *_libelf_open_object(int _fd, Elf_Cmd _c, int _reporterror); +Elf64_Xword _libelf_mips64el_r_info_tof(Elf64_Xword r_info); +Elf64_Xword _libelf_mips64el_r_info_tom(Elf64_Xword r_info); struct _Libelf_Data *_libelf_release_data(struct _Libelf_Data *_d); Elf *_libelf_release_elf(Elf *_e); Elf_Scn *_libelf_release_scn(Elf_Scn *_s); Added: head/contrib/elftoolchain/libelf/gelf_mips64el.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/elftoolchain/libelf/gelf_mips64el.c Wed Sep 5 20:51:53 2018 (r338478) @@ -0,0 +1,81 @@ +/*- + * Copyright (c) 2018 John Baldwin + * 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 + +#include "_libelf.h" + +ELFTC_VCSID("$Id$"); + +int +_libelf_is_mips64el(Elf *e) +{ + + return (e->e_kind == ELF_K_ELF && e->e_byteorder == ELFDATA2LSB && + e->e_u.e_elf.e_ehdr.e_ehdr64->e_machine == EM_MIPS); +} + +/* + * For MIPS64, the r_info field is actually stored as a 32-bit symbol + * index (r_sym) followed by four single-byte fields (r_ssym, r_type3, + * r_type2, and r_type). The byte-swap for the little-endian case + * jumbles this incorrectly so compensate. + */ +Elf64_Xword +_libelf_mips64el_r_info_tof(Elf64_Xword r_info) +{ + Elf64_Xword new_info; + uint8_t ssym, type3, type2, type; + + ssym = r_info >> 24; + type3 = r_info >> 16; + type2 = r_info >> 8; + type = r_info; + new_info = r_info >> 32; + new_info |= (Elf64_Xword)ssym << 32; + new_info |= (Elf64_Xword)type3 << 40; + new_info |= (Elf64_Xword)type2 << 48; + new_info |= (Elf64_Xword)type << 56; + return (new_info); +} + +Elf64_Xword +_libelf_mips64el_r_info_tom(Elf64_Xword r_info) +{ + Elf64_Xword new_info; + uint8_t ssym, type3, type2, type; + + ssym = r_info >> 32; + type3 = r_info >> 40; + type2 = r_info >> 48; + type = r_info >> 56; + new_info = (r_info & 0xffffffff) << 32; + new_info |= (Elf64_Xword)ssym << 24; + new_info |= (Elf64_Xword)type3 << 16; + new_info |= (Elf64_Xword)type2 << 8; + new_info |= (Elf64_Xword)type; + return (new_info); +} Modified: head/contrib/elftoolchain/libelf/gelf_rel.c ============================================================================== --- head/contrib/elftoolchain/libelf/gelf_rel.c Wed Sep 5 20:47:51 2018 (r338477) +++ head/contrib/elftoolchain/libelf/gelf_rel.c Wed Sep 5 20:51:53 2018 (r338478) @@ -90,6 +90,9 @@ gelf_getrel(Elf_Data *ed, int ndx, GElf_Rel *dst) rel64 = (Elf64_Rel *) d->d_data.d_buf + ndx; *dst = *rel64; + + if (_libelf_is_mips64el(e)) + dst->r_info = _libelf_mips64el_r_info_tom(rel64->r_info); } return (dst); @@ -156,6 +159,9 @@ gelf_update_rel(Elf_Data *ed, int ndx, GElf_Rel *dr) rel64 = (Elf64_Rel *) d->d_data.d_buf + ndx; *rel64 = *dr; + + if (_libelf_is_mips64el(e)) + rel64->r_info = _libelf_mips64el_r_info_tof(dr->r_info); } return (1); Modified: head/contrib/elftoolchain/libelf/gelf_rela.c ============================================================================== --- head/contrib/elftoolchain/libelf/gelf_rela.c Wed Sep 5 20:47:51 2018 (r338477) +++ head/contrib/elftoolchain/libelf/gelf_rela.c Wed Sep 5 20:51:53 2018 (r338478) @@ -91,6 +91,10 @@ gelf_getrela(Elf_Data *ed, int ndx, GElf_Rela *dst) rela64 = (Elf64_Rela *) d->d_data.d_buf + ndx; *dst = *rela64; + + if (_libelf_is_mips64el(e)) + dst->r_info = + _libelf_mips64el_r_info_tom(rela64->r_info); } return (dst); @@ -159,6 +163,9 @@ gelf_update_rela(Elf_Data *ed, int ndx, GElf_Rela *dr) rela64 = (Elf64_Rela *) d->d_data.d_buf + ndx; *rela64 = *dr; + + if (_libelf_is_mips64el(e)) + rela64->r_info = _libelf_mips64el_r_info_tof(dr->r_info); } return (1); Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Wed Sep 5 20:47:51 2018 (r338477) +++ head/sys/sys/param.h Wed Sep 5 20:51:53 2018 (r338478) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200083 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200084 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Wed Sep 5 21:09: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 A3422FFCFBC for ; Wed, 5 Sep 2018 21:09:41 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic305-4.consmr.mail.bf2.yahoo.com (sonic305-4.consmr.mail.bf2.yahoo.com [74.6.133.43]) (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 3A2297343E for ; Wed, 5 Sep 2018 21:09:41 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: U.xtLLwVM1nAWOmSoLwDs7.gnlH.Tf8DXmmAmcmQeKo3MJIHlgKPOgTHwzjfQj3 aeYOixfVqfIAirHvZ3bQHG6X6QuVH3hPGVbI1dU_R5165_sL_XlV7Ub4XxzM9I.qxigOsHFhBQO4 qKoIxlme2vTLnQXRTXAHZku9p6VpxHvadR8.ZyHI3vjdf8yTS9kx_R7_A8tY5vaLluQTc_fc0T9G loKhx_Jgl5UFrFB659ktIARN8Xp7XstlBTKdaArT1Alckzaw94JWjbJXMTeeVod9yKUeCC69P3ZN 4_Te9wB2hLQMXJtfxxP3AqZoc6UCQQ06YDBsvB8JtfgIVpKPNn.8esyJZCOa0zHoUzcscZ_Stczq V1t2_Ogqt6SaewkhZFU_E8oIP_kcNdbs3tE313BZp7xEJhhdJhgz4SpELRpkIt3AU2_uLMH.xI57 sE44_Vy6jJDIl3dLL6JTDrdUo7glD9OF2H7B4ZW4LIX05BjdvWDz3sioMqgEfmZBIdn7kRh.5Xrt .5FSWZ1nI9lhJthtLSbHvDW_2rM1XG1Bmp2Z2rGfG5OZcYHoqTGpMCcAbEMCUVkPLa4sXG3H7uWi TmYUj8YLNYGkm.a.iwrYKTGNbUNvaFE7ELTn7Hunrp5oi.YKPm0sMl3b9oo016YKstil_7Wrt4pc ZfkAKmq_mDJW6BIk.Wrh9qhxcZAoLRBFmEw1T3PlPwcffiEqENJ4s3.6gINRvbhvnupEdo0t.x2t _GJia5CVMpQsk9deiQZ3PSUl4dFzb_nCFGjlLseb3D7tQ6mlA7Dc0cyOcd7V4ZfCZt8006gnVOCp zqIEaBU_k_gquG70s7h4MemiOPMqljsrnOQZBu0vKd2gsrDBKWe8gRNPJVBPUcJ50xzsZPuWUmjK panCIpNQAglXm2tFdGZI.8kDaZJnTta7LNyKOy_NvL4JibOuVhSDOJyoVMfFXHTHVv_2seeUvw24 bns2lpx97HPptjvuWOkFwt.ZL5JH8z3oHxlUuiFsSiebcoFk5eThZy4sgiI7uNcc9wDUi38Q9ZLl Td50- Received: from sonic.gate.mail.ne1.yahoo.com by sonic305.consmr.mail.bf2.yahoo.com with HTTP; Wed, 5 Sep 2018 21:09:33 +0000 Received: from ip70-189-131-151.lv.lv.cox.net (EHLO [192.168.0.105]) ([70.189.131.151]) by smtp410.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 56a12db52c8e4fbd1f7e8038a99dc7b0; Wed, 05 Sep 2018 21:09:32 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r338478 - in head: contrib/elftoolchain/elfcopy contrib/elftoolchain/libelf sys/sys [breaks ci.freebsd.org builds for: FreeBSD-head-riscv64-build] Message-Id: <742D2E0D-E270-473A-8F21-67BDECFC32A7@yahoo.com> Date: Wed, 5 Sep 2018 14:09:30 -0700 To: John Baldwin , svn-src-head@freebsd.org X-Mailer: Apple Mail (2.3445.9.1) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 05 Sep 2018 21:09:42 -0000 https://ci.freebsd.org/job/FreeBSD-head-riscv64-build/10428/consoleText shows: --- objcopy.full --- cc -O2 -pipe -I/workspace/src/contrib/elftoolchain/libelftc = -I/workspace/src/contrib/elftoolchain/libpe = -I/workspace/src/contrib/elftoolchain/common -DWITH_PE=3D1 -I. -g = -std=3Dgnu99 -Qunused-arguments = -I/workspace/obj/workspace/src/riscv.riscv64/tmp/legacy/usr/include = -static -L/workspace/obj/workspace/src/riscv.riscv64/tmp/legacy/usr/lib = -o objcopy.full archive.o ascii.o binary.o main.o pe.o sections.o = segments.o symbols.o = -L/workspace/obj/workspace/src/riscv.riscv64/tmp/obj-tools/lib/libarchive = -larchive = -L/workspace/obj/workspace/src/riscv.riscv64/tmp/obj-tools/lib/libz -lz = -L/workspace/obj/workspace/src/riscv.riscv64/tmp/obj-tools/lib/libbz2 = -lbz2 = -L/workspace/obj/workspace/src/riscv.riscv64/tmp/obj-tools/lib/liblzma = -llzma = -L/workspace/obj/workspace/src/riscv.riscv64/tmp/obj-tools/lib/libthr = -L/workspace/obj/workspace/src/riscv.riscv64/tmp/obj-tools/lib/libexpat = -lbsdxml = -L/workspace/obj/workspace/src/riscv.riscv64/tmp/obj-tools/secure/lib/libc= rypto -lcrypto = -L/workspace/obj/workspace/src/riscv.riscv64/tmp/obj-tools/lib/libelftc = -lelftc = -L/workspace/obj/workspace/src/riscv.riscv64/tmp/obj-tools/lib/libelf = -lelf = -L/workspace/obj/workspace/src/riscv.riscv64/tmp/obj-tools/lib/libpe = -lpe -lpthread -legacy = /workspace/obj/workspace/src/riscv.riscv64/tmp/legacy/usr/lib/libelf.a(gel= f_rela.o): In function `gelf_getrela': /workspace/src/contrib/elftoolchain/libelf/gelf_rela.c:95: undefined = reference to `_libelf_is_mips64el' /workspace/src/contrib/elftoolchain/libelf/gelf_rela.c:97: undefined = reference to `_libelf_mips64el_r_info_tom' = /workspace/obj/workspace/src/riscv.riscv64/tmp/legacy/usr/lib/libelf.a(gel= f_rela.o): In function `gelf_update_rela': /workspace/src/contrib/elftoolchain/libelf/gelf_rela.c:167: undefined = reference to `_libelf_is_mips64el' /workspace/src/contrib/elftoolchain/libelf/gelf_rela.c:168: undefined = reference to `_libelf_mips64el_r_info_tof' = /workspace/obj/workspace/src/riscv.riscv64/tmp/legacy/usr/lib/libelf.a(gel= f_rel.o): In function `gelf_getrel': /workspace/src/contrib/elftoolchain/libelf/gelf_rel.c:94: undefined = reference to `_libelf_is_mips64el' /workspace/src/contrib/elftoolchain/libelf/gelf_rel.c:95: undefined = reference to `_libelf_mips64el_r_info_tom' = /workspace/obj/workspace/src/riscv.riscv64/tmp/legacy/usr/lib/libelf.a(gel= f_rel.o): In function `gelf_update_rel': /workspace/src/contrib/elftoolchain/libelf/gelf_rel.c:163: undefined = reference to `_libelf_is_mips64el' /workspace/src/contrib/elftoolchain/libelf/gelf_rel.c:164: undefined = reference to `_libelf_mips64el_r_info_tof' cc: error: linker command failed with exit code 1 (use -v to see = invocation) *** [objcopy.full] Error code 1 make[3]: stopped in /workspace/src/usr.bin/objcopy 1 error make[3]: stopped in /workspace/src/usr.bin/objcopy *** [cross-tools] Error code 2 =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Wed Sep 5 21:39: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 AD448FFDF35; Wed, 5 Sep 2018 21:39:26 +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 5C08174BAC; Wed, 5 Sep 2018 21:39:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 54DF510AFD2; Wed, 5 Sep 2018 17:39:25 -0400 (EDT) Subject: Re: svn commit: r338478 - in head: contrib/elftoolchain/elfcopy contrib/elftoolchain/libelf sys/sys From: John Baldwin To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201809052051.w85KpsCl064064@repo.freebsd.org> Message-ID: <147ea5a2-9652-b08e-5744-df748e3fea8d@FreeBSD.org> Date: Wed, 5 Sep 2018 14:39:24 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <201809052051.w85KpsCl064064@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 05 Sep 2018 17:39:25 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 05 Sep 2018 21:39:26 -0000 On 9/5/18 1:51 PM, John Baldwin wrote: > Author: jhb > Date: Wed Sep 5 20:51:53 2018 > New Revision: 338478 > URL: https://svnweb.freebsd.org/changeset/base/338478 > > Log: > Fix objcopy for little-endian MIPS64 objects. Bah, I forgot to include the hunk to add the new file to libelf's Makefile in the diff I sent to re@ and the diff I committed. I have the fix waiting for re@ approval, but in the meantime: Index: lib/libelf/Makefile =================================================================== --- lib/libelf/Makefile (revision 338478) +++ lib/libelf/Makefile (working copy) @@ -43,6 +43,7 @@ gelf_ehdr.c \ gelf_getclass.c \ gelf_fsize.c \ + gelf_mips64el.c \ gelf_move.c \ gelf_phdr.c \ gelf_rel.c \ -- John Baldwin                                                                              From owner-svn-src-head@freebsd.org Wed Sep 5 21:47: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 5083CFFE20A; Wed, 5 Sep 2018 21:47:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F1127750AB; Wed, 5 Sep 2018 21:47:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E205E2B6D5; Wed, 5 Sep 2018 21:47:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w85LlM0o090161; Wed, 5 Sep 2018 21:47:22 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w85LlMf8090160; Wed, 5 Sep 2018 21:47:22 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201809052147.w85LlMf8090160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 5 Sep 2018 21:47:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338485 - head/lib/libelf X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/lib/libelf X-SVN-Commit-Revision: 338485 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 05 Sep 2018 21:47:23 -0000 Author: jhb Date: Wed Sep 5 21:47:22 2018 New Revision: 338485 URL: https://svnweb.freebsd.org/changeset/base/338485 Log: Add gelf_mips64el.c to the list of files to include in libelf. Missed in r338478. Pointy hat to: jhb Approved by: re (rgrimes) MFC after: 1 month Modified: head/lib/libelf/Makefile Modified: head/lib/libelf/Makefile ============================================================================== --- head/lib/libelf/Makefile Wed Sep 5 21:28:33 2018 (r338484) +++ head/lib/libelf/Makefile Wed Sep 5 21:47:22 2018 (r338485) @@ -43,6 +43,7 @@ SRCS= elf.c \ gelf_ehdr.c \ gelf_getclass.c \ gelf_fsize.c \ + gelf_mips64el.c \ gelf_move.c \ gelf_phdr.c \ gelf_rel.c \ From owner-svn-src-head@freebsd.org Wed Sep 5 23:23: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 A4012FCCF51; Wed, 5 Sep 2018 23:23:18 +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 486AB7841E; Wed, 5 Sep 2018 23:23:18 +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 3DC7E2C6D7; Wed, 5 Sep 2018 23:23:18 +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 w85NNIBU044134; Wed, 5 Sep 2018 23:23:18 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w85NNGMZ044128; Wed, 5 Sep 2018 23:23:16 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201809052323.w85NNGMZ044128@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 5 Sep 2018 23:23:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338486 - in head/libexec/rtld-elf: . aarch64 arm mips powerpc powerpc64 riscv X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head/libexec/rtld-elf: . aarch64 arm mips powerpc powerpc64 riscv X-SVN-Commit-Revision: 338486 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 05 Sep 2018 23:23:18 -0000 Author: brooks Date: Wed Sep 5 23:23:16 2018 New Revision: 338486 URL: https://svnweb.freebsd.org/changeset/base/338486 Log: Rework rtld's TLS Variant I implementation to match r326794 The above commit fixed handling overaligned TLS segments in libc's TLS Variant I implementation, but rtld provides its own implementation for dynamically-linked executables which lacks these fixes. Thus, port these changes to rtld. This was previously commited as r337978 and reverted in r338149 due to exposing a bug the ARM rtld. This bug was fixed in r338317 by mmel. Submitted by: James Clarke Approved by: re (kib) Reviewed by: kbowling Testing by: kbowling (powerpc64), br (riscv), kevans (armv7) Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D16510 Modified: head/libexec/rtld-elf/aarch64/rtld_machdep.h head/libexec/rtld-elf/arm/rtld_machdep.h head/libexec/rtld-elf/mips/rtld_machdep.h head/libexec/rtld-elf/powerpc/rtld_machdep.h head/libexec/rtld-elf/powerpc64/rtld_machdep.h head/libexec/rtld-elf/riscv/rtld_machdep.h head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/aarch64/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/aarch64/rtld_machdep.h Wed Sep 5 21:47:22 2018 (r338485) +++ head/libexec/rtld-elf/aarch64/rtld_machdep.h Wed Sep 5 23:23:16 2018 (r338486) @@ -69,6 +69,8 @@ Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr targe #define calculate_tls_offset(prev_offset, prev_size, size, align) \ round(prev_offset + prev_size, align) #define calculate_tls_end(off, size) ((off) + (size)) +#define calculate_tls_post_size(align) \ + round(TLS_TCB_SIZE, align) - TLS_TCB_SIZE #define TLS_TCB_SIZE 16 typedef struct { Modified: head/libexec/rtld-elf/arm/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/arm/rtld_machdep.h Wed Sep 5 21:47:22 2018 (r338485) +++ head/libexec/rtld-elf/arm/rtld_machdep.h Wed Sep 5 23:23:16 2018 (r338486) @@ -69,6 +69,8 @@ typedef struct { #define calculate_tls_offset(prev_offset, prev_size, size, align) \ round(prev_offset + prev_size, align) #define calculate_tls_end(off, size) ((off) + (size)) +#define calculate_tls_post_size(align) \ + round(TLS_TCB_SIZE, align) - TLS_TCB_SIZE extern void *__tls_get_addr(tls_index *ti); Modified: head/libexec/rtld-elf/mips/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/mips/rtld_machdep.h Wed Sep 5 21:47:22 2018 (r338485) +++ head/libexec/rtld-elf/mips/rtld_machdep.h Wed Sep 5 23:23:16 2018 (r338486) @@ -64,10 +64,11 @@ typedef struct { #define round(size, align) \ (((size) + (align) - 1) & ~((align) - 1)) #define calculate_first_tls_offset(size, align) \ - round(TLS_TCB_SIZE, align) + TLS_TCB_SIZE #define calculate_tls_offset(prev_offset, prev_size, size, align) \ round(prev_offset + prev_size, align) #define calculate_tls_end(off, size) ((off) + (size)) +#define calculate_tls_post_size(align) 0 extern void *__tls_get_addr(tls_index *ti); Modified: head/libexec/rtld-elf/powerpc/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/powerpc/rtld_machdep.h Wed Sep 5 21:47:22 2018 (r338485) +++ head/libexec/rtld-elf/powerpc/rtld_machdep.h Wed Sep 5 23:23:16 2018 (r338486) @@ -74,10 +74,11 @@ void _rtld_powerpc_pltcall(void); #define round(size, align) \ (((size) + (align) - 1) & ~((align) - 1)) #define calculate_first_tls_offset(size, align) \ - round(8, align) + TLS_TCB_SIZE #define calculate_tls_offset(prev_offset, prev_size, size, align) \ round(prev_offset + prev_size, align) #define calculate_tls_end(off, size) ((off) + (size)) +#define calculate_tls_post_size(align) 0 typedef struct { unsigned long ti_module; Modified: head/libexec/rtld-elf/powerpc64/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/powerpc64/rtld_machdep.h Wed Sep 5 21:47:22 2018 (r338485) +++ head/libexec/rtld-elf/powerpc64/rtld_machdep.h Wed Sep 5 23:23:16 2018 (r338486) @@ -66,10 +66,11 @@ Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr targe #define round(size, align) \ (((size) + (align) - 1) & ~((align) - 1)) #define calculate_first_tls_offset(size, align) \ - round(16, align) + TLS_TCB_SIZE #define calculate_tls_offset(prev_offset, prev_size, size, align) \ round(prev_offset + prev_size, align) #define calculate_tls_end(off, size) ((off) + (size)) +#define calculate_tls_post_size(align) 0 typedef struct { unsigned long ti_module; Modified: head/libexec/rtld-elf/riscv/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/riscv/rtld_machdep.h Wed Sep 5 21:47:22 2018 (r338485) +++ head/libexec/rtld-elf/riscv/rtld_machdep.h Wed Sep 5 23:23:16 2018 (r338486) @@ -89,10 +89,11 @@ Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr targe #define round(size, align) \ (((size) + (align) - 1) & ~((align) - 1)) #define calculate_first_tls_offset(size, align) \ - round(16, align) + TLS_TCB_SIZE #define calculate_tls_offset(prev_offset, prev_size, size, align) \ round(prev_offset + prev_size, align) #define calculate_tls_end(off, size) ((off) + (size)) +#define calculate_tls_post_size(align) 0 typedef struct { unsigned long ti_module; Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Wed Sep 5 21:47:22 2018 (r338485) +++ head/libexec/rtld-elf/rtld.c Wed Sep 5 23:23:16 2018 (r338486) @@ -4693,47 +4693,87 @@ tls_get_addr_common(Elf_Addr **dtvp, int index, size_t defined(__powerpc__) || defined(__riscv) /* + * Return pointer to allocated TLS block + */ +static void * +get_tls_block_ptr(void *tcb, size_t tcbsize) +{ + size_t extra_size, post_size, pre_size, tls_block_size; + size_t tls_init_align; + + tls_init_align = MAX(obj_main->tlsalign, 1); + + /* Compute fragments sizes. */ + extra_size = tcbsize - TLS_TCB_SIZE; + post_size = calculate_tls_post_size(tls_init_align); + tls_block_size = tcbsize + post_size; + pre_size = roundup2(tls_block_size, tls_init_align) - tls_block_size; + + return ((char *)tcb - pre_size - extra_size); +} + +/* * Allocate Static TLS using the Variant I method. + * + * For details on the layout, see lib/libc/gen/tls.c. + * + * NB: rtld's tls_static_space variable includes TLS_TCB_SIZE and post_size as + * it is based on tls_last_offset, and TLS offsets here are really TCB + * offsets, whereas libc's tls_static_space is just the executable's static + * TLS segment. */ void * allocate_tls(Obj_Entry *objs, void *oldtcb, size_t tcbsize, size_t tcbalign) { Obj_Entry *obj; - char *tcb; - Elf_Addr **tls; - Elf_Addr *dtv; + char *tls_block; + Elf_Addr *dtv, **tcb; Elf_Addr addr; int i; + size_t extra_size, maxalign, post_size, pre_size, tls_block_size; + size_t tls_init_align; if (oldtcb != NULL && tcbsize == TLS_TCB_SIZE) return (oldtcb); assert(tcbsize >= TLS_TCB_SIZE); - tcb = xcalloc(1, tls_static_space - TLS_TCB_SIZE + tcbsize); - tls = (Elf_Addr **)(tcb + tcbsize - TLS_TCB_SIZE); + maxalign = MAX(tcbalign, tls_static_max_align); + tls_init_align = MAX(obj_main->tlsalign, 1); + /* Compute fragmets sizes. */ + extra_size = tcbsize - TLS_TCB_SIZE; + post_size = calculate_tls_post_size(tls_init_align); + tls_block_size = tcbsize + post_size; + pre_size = roundup2(tls_block_size, tls_init_align) - tls_block_size; + tls_block_size += pre_size + tls_static_space - TLS_TCB_SIZE - post_size; + + /* Allocate whole TLS block */ + tls_block = malloc_aligned(tls_block_size, maxalign); + tcb = (Elf_Addr **)(tls_block + pre_size + extra_size); + if (oldtcb != NULL) { - memcpy(tls, oldtcb, tls_static_space); - free(oldtcb); + memcpy(tls_block, get_tls_block_ptr(oldtcb, tcbsize), + tls_static_space); + free_aligned(get_tls_block_ptr(oldtcb, tcbsize)); /* Adjust the DTV. */ - dtv = tls[0]; + dtv = tcb[0]; for (i = 0; i < dtv[1]; i++) { if (dtv[i+2] >= (Elf_Addr)oldtcb && dtv[i+2] < (Elf_Addr)oldtcb + tls_static_space) { - dtv[i+2] = dtv[i+2] - (Elf_Addr)oldtcb + (Elf_Addr)tls; + dtv[i+2] = dtv[i+2] - (Elf_Addr)oldtcb + (Elf_Addr)tcb; } } } else { dtv = xcalloc(tls_max_index + 2, sizeof(Elf_Addr)); - tls[0] = dtv; + tcb[0] = dtv; dtv[0] = tls_dtv_generation; dtv[1] = tls_max_index; for (obj = globallist_curr(objs); obj != NULL; obj = globallist_next(obj)) { if (obj->tlsoffset > 0) { - addr = (Elf_Addr)tls + obj->tlsoffset; + addr = (Elf_Addr)tcb + obj->tlsoffset; if (obj->tlsinitsize > 0) memcpy((void*) addr, obj->tlsinit, obj->tlsinitsize); if (obj->tlssize > obj->tlsinitsize) @@ -4752,14 +4792,19 @@ free_tls(void *tcb, size_t tcbsize, size_t tcbalign) { Elf_Addr *dtv; Elf_Addr tlsstart, tlsend; - int dtvsize, i; + size_t post_size; + size_t dtvsize, i, tls_init_align; assert(tcbsize >= TLS_TCB_SIZE); + tls_init_align = MAX(obj_main->tlsalign, 1); - tlsstart = (Elf_Addr)tcb + tcbsize - TLS_TCB_SIZE; - tlsend = tlsstart + tls_static_space; + /* Compute fragments sizes. */ + post_size = calculate_tls_post_size(tls_init_align); - dtv = *(Elf_Addr **)tlsstart; + tlsstart = (Elf_Addr)tcb + TLS_TCB_SIZE + post_size; + tlsend = (Elf_Addr)tcb + tls_static_space; + + dtv = *(Elf_Addr **)tcb; dtvsize = dtv[1]; for (i = 0; i < dtvsize; i++) { if (dtv[i+2] && (dtv[i+2] < tlsstart || dtv[i+2] >= tlsend)) { @@ -4767,7 +4812,7 @@ free_tls(void *tcb, size_t tcbsize, size_t tcbalign) } } free(dtv); - free(tcb); + free_aligned(get_tls_block_ptr(tcb, tcbsize)); } #endif From owner-svn-src-head@freebsd.org Thu Sep 6 02:11: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 7C1A5FE368F; Thu, 6 Sep 2018 02:11:00 +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 30BA080996; Thu, 6 Sep 2018 02:11: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 2BBD92E343; Thu, 6 Sep 2018 02:11: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 w862B0MR031420; Thu, 6 Sep 2018 02:11:00 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w862AxxL031410; Thu, 6 Sep 2018 02:10:59 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201809060210.w862AxxL031410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 6 Sep 2018 02:10:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338487 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 338487 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 06 Sep 2018 02:11:00 -0000 Author: markj Date: Thu Sep 6 02:10:59 2018 New Revision: 338487 URL: https://svnweb.freebsd.org/changeset/base/338487 Log: Rename hardclock_cnt() to hardclock() and remove the old implementation. Also remove some related and unused subroutines. They have long been replaced by variants that handle multiple coalesced events with a single call. No functional change intended. Reviewed by: cem, kib Approved by: re (gjb) Differential Revision: https://reviews.freebsd.org/D17029 Modified: head/sys/kern/kern_clock.c head/sys/kern/kern_clocksource.c head/sys/sys/systm.h Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Wed Sep 5 23:23:16 2018 (r338486) +++ head/sys/kern/kern_clock.c Thu Sep 6 02:10:59 2018 (r338487) @@ -421,85 +421,12 @@ initclocks(void *dummy) #endif } -/* - * Each time the real-time timer fires, this function is called on all CPUs. - * Note that hardclock() calls hardclock_cpu() for the boot CPU, so only - * the other CPUs in the system need to call this function. - */ void -hardclock_cpu(int usermode) +hardclock(int cnt, int usermode) { struct pstats *pstats; struct thread *td = curthread; struct proc *p = td->td_proc; - int flags; - - /* - * Run current process's virtual and profile time, as needed. - */ - pstats = p->p_stats; - flags = 0; - if (usermode && - timevalisset(&pstats->p_timer[ITIMER_VIRTUAL].it_value)) { - PROC_ITIMLOCK(p); - if (itimerdecr(&pstats->p_timer[ITIMER_VIRTUAL], tick) == 0) - flags |= TDF_ALRMPEND | TDF_ASTPENDING; - PROC_ITIMUNLOCK(p); - } - if (timevalisset(&pstats->p_timer[ITIMER_PROF].it_value)) { - PROC_ITIMLOCK(p); - if (itimerdecr(&pstats->p_timer[ITIMER_PROF], tick) == 0) - flags |= TDF_PROFPEND | TDF_ASTPENDING; - PROC_ITIMUNLOCK(p); - } - thread_lock(td); - td->td_flags |= flags; - thread_unlock(td); - -#ifdef HWPMC_HOOKS - if (PMC_CPU_HAS_SAMPLES(PCPU_GET(cpuid))) - PMC_CALL_HOOK_UNLOCKED(curthread, PMC_FN_DO_SAMPLES, NULL); - if (td->td_intr_frame != NULL) - PMC_SOFT_CALL_TF( , , clock, hard, td->td_intr_frame); -#endif - callout_process(sbinuptime()); - if (__predict_false(DPCPU_GET(epoch_cb_count))) - GROUPTASK_ENQUEUE(DPCPU_PTR(epoch_cb_task)); -} - -/* - * The real-time timer, interrupting hz times per second. - */ -void -hardclock(int usermode, uintfptr_t pc) -{ - - atomic_add_int(&ticks, 1); - hardclock_cpu(usermode); - tc_ticktock(1); - cpu_tick_calibration(); - /* - * If no separate statistics clock is available, run it from here. - * - * XXX: this only works for UP - */ - if (stathz == 0) { - profclock(usermode, pc); - statclock(usermode); - } -#ifdef DEVICE_POLLING - hardclock_device_poll(); /* this is very short and quick */ -#endif /* DEVICE_POLLING */ - if (watchdog_enabled > 0 && --watchdog_ticks <= 0) - watchdog_fire(); -} - -void -hardclock_cnt(int cnt, int usermode) -{ - struct pstats *pstats; - struct thread *td = curthread; - struct proc *p = td->td_proc; int *t = DPCPU_PTR(pcputicks); int flags, global, newticks; int i; @@ -696,15 +623,8 @@ stopprofclock(struct proc *p) * This should be called by all active processors. */ void -statclock(int usermode) +statclock(int cnt, int usermode) { - - statclock_cnt(1, usermode); -} - -void -statclock_cnt(int cnt, int usermode) -{ struct rusage *ru; struct vmspace *vm; struct thread *td; @@ -776,14 +696,7 @@ statclock_cnt(int cnt, int usermode) } void -profclock(int usermode, uintfptr_t pc) -{ - - profclock_cnt(1, usermode, pc); -} - -void -profclock_cnt(int cnt, int usermode, uintfptr_t pc) +profclock(int cnt, int usermode, uintfptr_t pc) { struct thread *td; #ifdef GPROF Modified: head/sys/kern/kern_clocksource.c ============================================================================== --- head/sys/kern/kern_clocksource.c Wed Sep 5 23:23:16 2018 (r338486) +++ head/sys/kern/kern_clocksource.c Thu Sep 6 02:10:59 2018 (r338487) @@ -183,7 +183,7 @@ handleevents(sbintime_t now, int fake) hct = DPCPU_PTR(hardclocktime); *hct = state->nexthard - tick_sbt; if (fake < 2) { - hardclock_cnt(runs, usermode); + hardclock(runs, usermode); done = 1; } } @@ -193,7 +193,7 @@ handleevents(sbintime_t now, int fake) runs++; } if (runs && fake < 2) { - statclock_cnt(runs, usermode); + statclock(runs, usermode); done = 1; } if (profiling) { @@ -203,7 +203,7 @@ handleevents(sbintime_t now, int fake) runs++; } if (runs && !fake) { - profclock_cnt(runs, usermode, TRAPF_PC(frame)); + profclock(runs, usermode, TRAPF_PC(frame)); done = 1; } } else Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Wed Sep 5 23:23:16 2018 (r338486) +++ head/sys/sys/systm.h Thu Sep 6 02:10:59 2018 (r338487) @@ -363,15 +363,11 @@ void realitexpire(void *); int sysbeep(int hertz, int period); -void hardclock(int usermode, uintfptr_t pc); -void hardclock_cnt(int cnt, int usermode); -void hardclock_cpu(int usermode); +void hardclock(int cnt, int usermode); void hardclock_sync(int cpu); void softclock(void *); -void statclock(int usermode); -void statclock_cnt(int cnt, int usermode); -void profclock(int usermode, uintfptr_t pc); -void profclock_cnt(int cnt, int usermode, uintfptr_t pc); +void statclock(int cnt, int usermode); +void profclock(int cnt, int usermode, uintfptr_t pc); int hardclockintr(void); From owner-svn-src-head@freebsd.org Thu Sep 6 11:06: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 BC83EFF7515; Thu, 6 Sep 2018 11:06:07 +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 722B77168B; Thu, 6 Sep 2018 11:06:07 +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 6D1B73EC2; Thu, 6 Sep 2018 11:06:07 +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 w86B67Zj006372; Thu, 6 Sep 2018 11:06:07 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w86B67wx006371; Thu, 6 Sep 2018 11:06:07 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201809061106.w86B67wx006371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 6 Sep 2018 11:06:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338489 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 338489 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 06 Sep 2018 11:06:07 -0000 Author: hselasky Date: Thu Sep 6 11:06:07 2018 New Revision: 338489 URL: https://svnweb.freebsd.org/changeset/base/338489 Log: Maximum number of mbuf frags is off-by-one for worst case scenario in mlx5en(4). Inspecting the PRM no more than 0x3F data segments, DS, of size 16 bytes is allowed. Worst case scenario summary of DS usage: Header is fixed: 2 DS Maximum inlining: 98 => (98 - 2) / 16 = 6 DS Remainder: 0x3F - 2 - 6 = 55 DS (mbuf frags) Previously a value of 56 DS was used and this would work in the normal case because not all inline data area was used up. MFC after: 3 days Approved by: re (marius) Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/en.h Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Thu Sep 6 07:10:49 2018 (r338488) +++ head/sys/dev/mlx5/mlx5_en/en.h Thu Sep 6 11:06:07 2018 (r338489) @@ -123,7 +123,8 @@ #define MLX5E_MAX_TX_MBUF_SIZE 65536 /* bytes */ #define MLX5E_MAX_TX_MBUF_FRAGS \ ((MLX5_SEND_WQE_MAX_WQEBBS * MLX5_SEND_WQEBB_NUM_DS) - \ - (MLX5E_MAX_TX_HEADER / MLX5_SEND_WQE_DS)) /* units */ + (MLX5E_MAX_TX_HEADER / MLX5_SEND_WQE_DS) - \ + 1 /* the maximum value of the DS counter is 0x3F and not 0x40 */) /* units */ #define MLX5E_MAX_TX_INLINE \ (MLX5E_MAX_TX_HEADER - sizeof(struct mlx5e_tx_wqe) + \ sizeof(((struct mlx5e_tx_wqe *)0)->eth.inline_hdr_start)) /* bytes */ From owner-svn-src-head@freebsd.org Thu Sep 6 12:19:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D807FF9A76; Thu, 6 Sep 2018 12:19:37 +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 E62A873CEC; Thu, 6 Sep 2018 12:19: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 E14954A48; Thu, 6 Sep 2018 12:19: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 w86CJa4p041873; Thu, 6 Sep 2018 12:19:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w86CJagB041872; Thu, 6 Sep 2018 12:19:36 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201809061219.w86CJagB041872@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 6 Sep 2018 12:19:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338490 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 338490 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 06 Sep 2018 12:19:37 -0000 Author: hselasky Date: Thu Sep 6 12:19:36 2018 New Revision: 338490 URL: https://svnweb.freebsd.org/changeset/base/338490 Log: Don't stall transmit queue on drops in mlx5en(4). When a transmitted packet is dropped don't stall the transmit queue. MFC after: 3 days Approved by: re (marius) Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Sep 6 11:06:07 2018 (r338489) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Sep 6 12:19:36 2018 (r338490) @@ -528,13 +528,11 @@ mlx5e_xmit_locked(struct ifnet *ifp, struct mlx5e_sq * /* Process the queue */ while ((next = drbr_peek(ifp, sq->br)) != NULL) { if (mlx5e_sq_xmit(sq, &next) != 0) { - if (next == NULL) { - drbr_advance(ifp, sq->br); - } else { + if (next != NULL) { drbr_putback(ifp, sq->br, next); atomic_store_rel_int(&sq->queue_state, MLX5E_SQ_FULL); + break; } - break; } drbr_advance(ifp, sq->br); } From owner-svn-src-head@freebsd.org Thu Sep 6 12:26: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 408C1FF9E25; Thu, 6 Sep 2018 12:26:58 +0000 (UTC) (envelope-from slavash@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E84CF7497C; Thu, 6 Sep 2018 12:26:57 +0000 (UTC) (envelope-from slavash@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E31114FF2; Thu, 6 Sep 2018 12:26:57 +0000 (UTC) (envelope-from slavash@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w86CQvV8046898; Thu, 6 Sep 2018 12:26:57 GMT (envelope-from slavash@FreeBSD.org) Received: (from slavash@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w86CQvBn046897; Thu, 6 Sep 2018 12:26:57 GMT (envelope-from slavash@FreeBSD.org) Message-Id: <201809061226.w86CQvBn046897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: slavash set sender to slavash@FreeBSD.org using -f From: Slava Shwartsman Date: Thu, 6 Sep 2018 12:26:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338491 - head/sys/ofed/include/rdma X-SVN-Group: head X-SVN-Commit-Author: slavash X-SVN-Commit-Paths: head/sys/ofed/include/rdma X-SVN-Commit-Revision: 338491 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 06 Sep 2018 12:26:58 -0000 Author: slavash Date: Thu Sep 6 12:26:57 2018 New Revision: 338491 URL: https://svnweb.freebsd.org/changeset/base/338491 Log: ibcore: Fix endless loop in searching for matching VLAN device In r337943 ifnet's if_pcp was set to the PCP value in use instead of IFNET_PCP_NONE. Current ibcore code assumes that if_pcp is IFNET_PCP_NONE with VLAN interfaces so it can identify prio-tagged traffic. Fix that by explicitly verifying that that the if_type is IFT_ETHER and not IFT_L2VLAN. MFC after: 3 days Approved by: re (Marius), hselasky (mentor), kib (mentor) Sponsored by: Mellanox Technologies Modified: head/sys/ofed/include/rdma/ib_addr.h Modified: head/sys/ofed/include/rdma/ib_addr.h ============================================================================== --- head/sys/ofed/include/rdma/ib_addr.h Thu Sep 6 12:19:36 2018 (r338490) +++ head/sys/ofed/include/rdma/ib_addr.h Thu Sep 6 12:26:57 2018 (r338491) @@ -167,7 +167,7 @@ static inline u16 rdma_vlan_dev_vlan_id(const struct n { uint16_t tag; - if (dev->if_pcp != IFNET_PCP_NONE) + if (dev->if_type == IFT_ETHER && dev->if_pcp != IFNET_PCP_NONE) return 0x0000; /* prio-tagged traffic */ if (VLAN_TAG(__DECONST(struct ifnet *, dev), &tag) != 0) return 0xffff; @@ -350,7 +350,7 @@ static inline u16 rdma_get_vlan_id(union ib_gid *dgid) static inline struct net_device *rdma_vlan_dev_real_dev(struct net_device *dev) { - if (dev->if_pcp != IFNET_PCP_NONE) + if (dev->if_type == IFT_ETHER && dev->if_pcp != IFNET_PCP_NONE) return dev; /* prio-tagged traffic */ return VLAN_TRUNKDEV(__DECONST(struct ifnet *, dev)); } From owner-svn-src-head@freebsd.org Thu Sep 6 12: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 3ED9CFF9EB7; Thu, 6 Sep 2018 12:28:07 +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 E973A74AF2; Thu, 6 Sep 2018 12:28:06 +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 E43C14FF4; Thu, 6 Sep 2018 12:28:06 +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 w86CS6PK047001; Thu, 6 Sep 2018 12:28:06 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w86CS6Bo046998; Thu, 6 Sep 2018 12:28:06 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201809061228.w86CS6Bo046998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 6 Sep 2018 12:28:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338492 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 338492 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 06 Sep 2018 12:28:07 -0000 Author: hselasky Date: Thu Sep 6 12:28:06 2018 New Revision: 338492 URL: https://svnweb.freebsd.org/changeset/base/338492 Log: Add support for receive side scaling stride, RSSS, in mlx5en(4). The receive side scaling stride parameter is a value which define the interval between active receive side queues. The traffic for the inactive queues is redirected to the nearest active queue by use of modulus. The default value of this parameter is one, which means all receive side queues are used. The point of this feature is to redirect more traffic to fewer receive side queues in order to take more advantage of sorted large receive offload, sorted LRO. The sorted LRO works better when more packets are accumulated per service interval. MFC after: 3 days Approved by: re (marius) Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Thu Sep 6 12:26:57 2018 (r338491) +++ head/sys/dev/mlx5/mlx5_en/en.h Thu Sep 6 12:28:06 2018 (r338492) @@ -454,6 +454,7 @@ struct mlx5e_params { u32 rx_priority_flow_control __aligned(4); u16 tx_max_inline; u8 tx_min_inline_mode; + u8 channels_rsss; }; #define MLX5E_PARAMS(m) \ @@ -462,6 +463,7 @@ struct mlx5e_params { m(+1, u64 tx_queue_size, "tx_queue_size", "Default send queue size") \ m(+1, u64 rx_queue_size, "rx_queue_size", "Default receive queue size") \ m(+1, u64 channels, "channels", "Default number of channels") \ + m(+1, u64 channels_rsss, "channels_rsss", "Default channels receive side scaling stride") \ m(+1, u64 coalesce_usecs_max, "coalesce_usecs_max", "Maximum usecs for joining packets") \ m(+1, u64 coalesce_pkts_max, "coalesce_pkts_max", "Maximum packets to join") \ m(+1, u64 rx_coalesce_usecs, "rx_coalesce_usecs", "Limit in usec for joining rx packets") \ Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Thu Sep 6 12:26:57 2018 (r338491) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Thu Sep 6 12:28:06 2018 (r338492) @@ -493,6 +493,24 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) mlx5e_open_locked(priv->ifp); break; + case MLX5_PARAM_OFFSET(channels_rsss): + /* network interface must be down */ + if (was_opened) + mlx5e_close_locked(priv->ifp); + + /* import number of channels */ + if (priv->params_ethtool.channels_rsss < 1) + priv->params_ethtool.channels_rsss = 1; + else if (priv->params_ethtool.channels_rsss > 128) + priv->params_ethtool.channels_rsss = 128; + + priv->params.channels_rsss = priv->params_ethtool.channels_rsss; + + /* restart network interface, if any */ + if (was_opened) + mlx5e_open_locked(priv->ifp); + break; + case MLX5_PARAM_OFFSET(channels): /* network interface must be down */ if (was_opened) @@ -1041,6 +1059,7 @@ mlx5e_create_ethtool(struct mlx5e_priv *priv) priv->params_ethtool.tx_queue_size = 1 << priv->params.log_sq_size; priv->params_ethtool.rx_queue_size = 1 << priv->params.log_rq_size; priv->params_ethtool.channels = priv->params.num_channels; + priv->params_ethtool.channels_rsss = priv->params.channels_rsss; priv->params_ethtool.coalesce_pkts_max = MLX5E_FLD_MAX(cqc, cq_max_count); priv->params_ethtool.coalesce_usecs_max = MLX5E_FLD_MAX(cqc, cq_period); priv->params_ethtool.rx_coalesce_mode = priv->params.rx_cq_moderation_mode; Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Sep 6 12:26:57 2018 (r338491) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Sep 6 12:28:06 2018 (r338492) @@ -2204,14 +2204,16 @@ mlx5e_open_rqt(struct mlx5e_priv *priv) MLX5_SET(rqtc, rqtc, rqt_max_size, sz); for (i = 0; i < sz; i++) { - int ix; + int ix = i; #ifdef RSS - ix = rss_get_indirection_to_bucket(i); -#else - ix = i; + ix = rss_get_indirection_to_bucket(ix); #endif /* ensure we don't overflow */ ix %= priv->params.num_channels; + + /* apply receive side scaling stride, if any */ + ix -= ix % (int)priv->params.channels_rsss; + MLX5_SET(rqtc, rqtc, rq_num[i], priv->channel[ix]->rq.rqn); } @@ -3083,6 +3085,7 @@ mlx5e_build_ifp_priv(struct mlx5_core_dev *mdev, priv->mdev = mdev; priv->params.num_channels = num_comp_vectors; + priv->params.channels_rsss = 1; priv->order_base_2_num_channels = order_base_2(num_comp_vectors); priv->queue_mapping_channel_mask = roundup_pow_of_two(num_comp_vectors) - 1; From owner-svn-src-head@freebsd.org Thu Sep 6 12:36:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48C59FFA13F; Thu, 6 Sep 2018 12:36:00 +0000 (UTC) (envelope-from melounmichal@gmail.com) Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A3BA74FB6; Thu, 6 Sep 2018 12:35:59 +0000 (UTC) (envelope-from melounmichal@gmail.com) Received: by mail-wm0-x241.google.com with SMTP id y2-v6so11258390wma.1; Thu, 06 Sep 2018 05:35:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:reply-to:subject:to:cc:references:openpgp:autocrypt:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=9ARrNELqBOw6vrtopnpFNjJ3wfIs0mfRUgKC5fBDfW8=; b=oDZUihcUbt/rjK792gH7SkaZMOFdKR4Lb6zD1elxplF+MfdV+ioO8iTRQ75/y3OiHK 1nczrafGOUwIDAKK5XGq1YS2prUEUH6HxTYH5t75qUHVkN/JlAeomUzGJgYmIDOq27QX Sv7e2n2rvFRL1AcsddyEEgMEmQ3rTuIf6X01Vnf0rh9FLmsEAbzAbXzUHDA+eIZrWahU 9QCdw0U+3yRiOv0sUOl8LZfXxboIY2IRh1GRzS/BWWTXr41uw2Glqk2gWCoGv/ez0Sdt SldtWukRfbPJ+R3xmp1prbnzOm3qB9TanBz9XO6itFn9XLYk9jAGoMg8BTib2mYGr4Jn S1eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:reply-to:subject:to:cc:references:openpgp :autocrypt:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=9ARrNELqBOw6vrtopnpFNjJ3wfIs0mfRUgKC5fBDfW8=; b=rHC0iu0uGfT2VlFku8kV2tJynHuzFiZ46CFRW4pV1LwzmAHUUQg1lAqhESYRLgYDo5 p5hRo6jv7hwOOdCTs+PGxwc8bsA/32ZGwjydcta1k6koah2mjSZj66vQWyy0rloRITUi EeNMrCECjUhcp/pj3le2h0jACdQv09GkBz1qxPoWn08wev2upbaJPGHURiSHFuL0+Z7Y V+3Bmzy5ZO0N/UB+IXt5ps+rfxVT8aDQnaWUP5z3Qf8Tad0NTXpXkruoPlDc47sYxW1U 5avKLfOGa86QmJpwg9Qpe326TEDZCAeyRLrjHIPU9Wav7Pk82l4TLNI8RgmSykczO91W o0uA== X-Gm-Message-State: APzg51A0mL+oi5GHaFm273vDHc32CQoHQQVtW4cwnTYWCWdLLSpCdT+/ k7skL7nRfVtDe9MZPaQlc5UZ5N1Z X-Google-Smtp-Source: ANB0VdYN/AUBj2hDrIjZP+E7OeItP2uS1pFm3r7dNq7mJBCNn/iQT5kGkpJtFQBu3uGKZ9MDnDEjgA== X-Received: by 2002:a1c:85cb:: with SMTP id h194-v6mr2176522wmd.54.1536237358314; Thu, 06 Sep 2018 05:35:58 -0700 (PDT) Received: from [88.208.79.100] (halouny.humusoft.cz. [88.208.79.100]) by smtp.gmail.com with ESMTPSA id f6-v6sm5819654wrr.68.2018.09.06.05.35.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Sep 2018 05:35:57 -0700 (PDT) From: Michal Meloun X-Google-Original-From: Michal Meloun Reply-To: mmel@freebsd.org Subject: Re: svn commit: r324815 - in head: lib/libc/gen sys/sys To: Ian Lepore , Jan Beich Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201710211206.v9LC6INJ032680@repo.freebsd.org> <5zzo-vvbu-wny@FreeBSD.org> <1535906683.9486.20.camel@freebsd.org> Openpgp: preference=signencrypt Autocrypt: addr=mmel@freebsd.org; prefer-encrypt=mutual; keydata= xsBNBFYuVRkBCADZiwLCCne3wG9b9k+R2Neo5zVo2bLaZRfNNY/v9kg283i0sb1Da4EdEiNT 15El5UyozhphUIbIR/zrVpxF1TvvFdoCyzx6a68bNY2d9dBrDcNDZC+XnyDdHQoobN87DWT1 mRVkmbg9LHZ/SVUOkGYuWyE+8UYeDAcUizuXwSK5zFWmeTyIoWNa68ifrWLfQe0p4x5jC/AI VURCi17p360vU4fhgwoMvEEhrRBWCr4DYHToFjIt2WdBy3GR1qoO0+Xkd6G+OoBULo+XDfgu L2WdPvh0K69F9/LgHkMmG5Il7SCe62QGpG2vaCgRV7BQhLX+kxlvM+WrdRatWRml4Y/3ABEB AAHNIE1pY2hhbCBNZWxvdW4gPG1tZWxAZnJlZWJzZC5vcmc+wsCABBMBCgAqAhsDBQsJCAcD BRUKCQgLBRYDAgEAAh4BAheAAhkBBQJZjBHDBQkHICOqAAoJEGkesmtexaqqIKMIAJ9xTp1w ge86ns2ZYOac5++mAgpFatohSlxYUR3gwud3Y3Ej0eumavpv/C26N6dsLnspwRenKdLbIPKe 0N8lI7CcDBIJGiFyY3c4H79QjIkYpRgbWFyCM85zEyVJpB+U7BhsgXE2uwVjE9RNhEP0KBoj sp357uqq1B1+VUO4GJ+RjdmYSOcNrjR8tTfy02456qovGjJ4JcJBlhyK6GzBKvnZSoA0s+QP OMn3gd8gdomMLEJdS3kTsfhLh2rQPZa9EmzafIyjXrirWq4+4fVFgd8SiMZyyTM+Kz30ZSUe 6SmfaQTQ/WLRIl5jku2uYQWlrRIKT9xaQzRWtZO9UgtXFRHOwE0EVi5VGQEIALqgRkfS21D/ OqWE9mXfh2bIjrp9uC8T0MCuimbsrAdLKNNorGu2nE+rebgX8n5nYM377HOnalPGyOuXvCbQ 8MFVRdWOHxenJjXJialNdBsOf2wLva3vSSVsdoPzibWDIcJqhBOQ3EuhsILyWSPvYYKEiy95 mfhrDtuTTOAYVR9aNQBOENztB2TDJyMx/qZmtGroGV3N0Hqde/znHPtQO8RG5/FQGMfHMI5G FMuycr1ceHnLo/ovrqAl4TYV+UHSHJ+FDE9dt9wXHclWbWbC0yNugchZq6rho5Jjfv4a2v7P pyn3HoDinh1lWP7hYA0ZNExGHekLnXWVqO/lzGS6bMEAEQEAAcLAZQQYAQoADwIbDAUCWYwR wwUJByAjqgAKCRBpHrJrXsWqqrsrB/4g4ESK5TLxUxi8pLWcLPyvwtN4Fmf7VsCVefkhakaG rDPmfvfnG+OFwN60Xqoni7GBeakl01xwT4RINfvVfShDy6cHpLS7QL/M8pzfulVX38MkVkOD yGZhwjE+jyT/kZNA1Olaw3N3IefHq3brskQ7G4d9oPep2DDbw7C4Q76uOBjxy34JVB0WOsB6 NyMQB9h6LGljQtdEddyUqwnRZzzHiGvp0hPtdYQHQZlqbj4FV9lTRK7a8Ega+y7MgmeMiztG zeXyjNP02r3PRHCPagwa57bPxH2aAh4Q7UzBBZ0GTMm7DLKNtCP58WDxblrrhZ+7kHqGK8Fs bdeUpDdEYLVd Message-ID: <9b82bdaa-cc98-f53c-a0c0-d1e36239e947@freebsd.org> Date: Thu, 6 Sep 2018 14:36:00 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1535906683.9486.20.camel@freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 06 Sep 2018 12:36:00 -0000 On 02.09.2018 18:44, Ian Lepore wrote: > On Sun, 2018-09-02 at 16:16 +0200, Jan Beich wrote: >> Michal Meloun writes: >> >>> >>> Author: mmel >>> Date: Sat Oct 21 12:06:18 2017 >>> New Revision: 324815 >>> URL: https://svnweb.freebsd.org/changeset/base/324815 >>> >>> Log: >>>   Make elf_aux_info() as public libc function. >>>   - Teach elf aux vector functions about newly added AT_HWCAP and >>> AT_HWCAP2 >>>     vectors. >>>   - Export _elf_aux_info() as new public libc function >>> elf_aux_info(3) >>>    >>>   The elf_aux_info(3) should be considered as FreeBSD counterpart >>> of glibc >>>   getauxval() with more robust interface. >> Can you back it out? I've reported sys/auxv.h breaks existing >> consumers >> and the function is yet to be documented. 12.0-RELEASE is approaching >> but there's no fix in sight, and by the time it lands there maybe >> not enough time to test. >> >> http://docs.freebsd.org/cgi/mid.cgi?03a31eff-34e8-be4c-c008-528824fea >> 261 >> > > Are you seriously suggesting that freebsd is forbidden to add a system > header file of any name it chooses, just because some port's autotools > stuff mistakenly assumes the presence of that name implies something > linux-specific? If the port is broken, fix it. > > -- Ian > Jan, I apologize for the late reply but right now I noticed this thread in my spam folder. I don't know why gmail so classified it :( I agree with Ian, the port should test getauxval() presence, not a header file. Moreover, at this point elf_aux_info () is the only function with which we can implement FreeBSD specific version of the runtime hw feature detection for ARM cpus. So I think revert is the worst option. Do you know how many ports are affected? I only know about libvpx (for which I immediately sent a fix) and (from memory) mono is also affected. But, please remember, with or without the getauxval () emulation, majority of ports will still need a patch. Mainly because the cpu detection code is covered by #ifdef __linux__ and/or the port have hardcoded #AT_ values (we uses different numbers for it) or so. I ready to prepare patch for every single port affected by this problem, simple list of problematic ports is enough. Michal From owner-svn-src-head@freebsd.org Thu Sep 6 12:41: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 9880AFFA280; Thu, 6 Sep 2018 12:41:10 +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 4E6D275295; Thu, 6 Sep 2018 12:41:10 +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 2F7ED51CB; Thu, 6 Sep 2018 12:41:10 +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 w86CfA8h056755; Thu, 6 Sep 2018 12:41:10 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w86Cf9Ej056754; Thu, 6 Sep 2018 12:41:09 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201809061241.w86Cf9Ej056754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 6 Sep 2018 12:41:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338493 - in head/sys/dev/mlx5: . mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 338493 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 06 Sep 2018 12:41:10 -0000 Author: hselasky Date: Thu Sep 6 12:41:09 2018 New Revision: 338493 URL: https://svnweb.freebsd.org/changeset/base/338493 Log: Make the MSIX module parameter limit per device, in mlx5en(4). MFC after: 3 days Approved by: re (marius) Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/driver.h head/sys/dev/mlx5/mlx5_core/mlx5_main.c Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Thu Sep 6 12:28:06 2018 (r338492) +++ head/sys/dev/mlx5/driver.h Thu Sep 6 12:41:09 2018 (r338493) @@ -682,6 +682,9 @@ struct mlx5_core_dev { struct mlx5_flow_root_namespace *sniffer_tx_root_ns; u32 num_q_counter_allocated[MLX5_INTERFACE_NUMBER]; struct mlx5_dump_data *dump_data; + + struct sysctl_ctx_list sysctl_ctx; + int msix_eqvec; }; enum { Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Thu Sep 6 12:28:06 2018 (r338492) +++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Thu Sep 6 12:41:09 2018 (r338493) @@ -61,10 +61,6 @@ static int prof_sel = MLX5_DEFAULT_PROF; module_param_named(prof_sel, prof_sel, int, 0444); MODULE_PARM_DESC(prof_sel, "profile selector. Valid range 0 - 2"); -static int mlx5_core_msix_eqvec; -module_param_named(msix_eqvec, mlx5_core_msix_eqvec, int, 0644); -MODULE_PARM_DESC(msix_eqvec, "Maximum number of MSIX event queue vectors"); - #define NUMA_NO_NODE -1 static LIST_HEAD(intf_list); @@ -243,7 +239,7 @@ static int mlx5_enable_msix(struct mlx5_core_dev *dev) struct mlx5_priv *priv = &dev->priv; struct mlx5_eq_table *table = &priv->eq_table; int num_eqs = 1 << MLX5_CAP_GEN(dev, log_max_eq); - int limit = mlx5_core_msix_eqvec; + int limit = dev->msix_eqvec; int nvec = MLX5_EQ_VEC_COMP_BASE; int i; @@ -1206,6 +1202,7 @@ static int init_one(struct pci_dev *pdev, { struct mlx5_core_dev *dev; struct mlx5_priv *priv; + device_t bsddev = pdev->dev.bsddev; int err; dev = kzalloc(sizeof(*dev), GFP_KERNEL); @@ -1221,6 +1218,12 @@ static int init_one(struct pci_dev *pdev, dev->pdev = pdev; dev->event = mlx5_core_event; + sysctl_ctx_init(&dev->sysctl_ctx); + SYSCTL_ADD_INT(&dev->sysctl_ctx, + SYSCTL_CHILDREN(device_get_sysctl_tree(bsddev)), + OID_AUTO, "msix_eqvec", CTLFLAG_RDTUN, &dev->msix_eqvec, 0, + "Maximum number of MSIX event queue vectors, if set"); + INIT_LIST_HEAD(&priv->ctx_list); spin_lock_init(&priv->ctx_lock); mutex_init(&dev->pci_status_mutex); @@ -1256,6 +1259,7 @@ clean_health: close_pci: mlx5_pci_close(dev, priv); clean_dev: + sysctl_ctx_free(&dev->sysctl_ctx); kfree(dev); return err; } @@ -1276,6 +1280,7 @@ static void remove_one(struct pci_dev *pdev) mlx5_health_cleanup(dev); mlx5_pci_close(dev, priv); pci_set_drvdata(pdev, NULL); + sysctl_ctx_free(&dev->sysctl_ctx); kfree(dev); } From owner-svn-src-head@freebsd.org Thu Sep 6 13:56:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56D91FFC060; Thu, 6 Sep 2018 13:56:56 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 116EC78082; Thu, 6 Sep 2018 13:56:56 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 0A2A4E554; Thu, 6 Sep 2018 13:56:56 +0000 (UTC) Date: Thu, 6 Sep 2018 13:56:56 +0000 From: Alexey Dokuchaev To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337773 - in head/sys/amd64: amd64 include Message-ID: <20180906135656.GA28635@FreeBSD.org> References: <201808141637.w7EGbFpZ087559@repo.freebsd.org> <20180815084503.GA96451@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180815084503.GA96451@FreeBSD.org> User-Agent: Mutt/1.9.5 (2018-04-13) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 06 Sep 2018 13:56:56 -0000 On Wed, Aug 15, 2018 at 08:45:04AM +0000, Alexey Dokuchaev wrote: > On Tue, Aug 14, 2018 at 04:37:15PM +0000, Konstantin Belousov wrote: > > New Revision: 337773 > > URL: https://svnweb.freebsd.org/changeset/base/337773 > > > > Log: > > amd64: ensure that curproc->p_vmspace pmap always matches PCPU > > curpmap. > > > > When performing context switch on a machine without PCID, if current > > %cr3 equals to the new pmap %cr3, which is typical for kernel_pmap > > vs. kernel process, I overlooked to update PCPU curpmap value. Remove > > check for %cr3 not equal to pm_cr3 for doing the update. It is > > believed that this case cannot happen at all, due to other changes in > > this revision. > > ... > > - } else if (cr3 != pmap->pm_cr3) { > > + } else { > > load_cr3(pmap->pm_cr3); > > If this case cannot happen at all, would it make sense to assert it? Did I miss your reply on this one? ./danfe From owner-svn-src-head@freebsd.org Thu Sep 6 14:03:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5EF12FFC381; Thu, 6 Sep 2018 14:03:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0CBF4785AA; Thu, 6 Sep 2018 14:03:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 056F96099; Thu, 6 Sep 2018 14:03:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w86E3A7g097916; Thu, 6 Sep 2018 14:03:10 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w86E3AUm097915; Thu, 6 Sep 2018 14:03:10 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201809061403.w86E3AUm097915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 6 Sep 2018 14:03:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338494 - head/sys/cam/ctl X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cam/ctl X-SVN-Commit-Revision: 338494 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 06 Sep 2018 14:03:11 -0000 Author: mav Date: Thu Sep 6 14:03:10 2018 New Revision: 338494 URL: https://svnweb.freebsd.org/changeset/base/338494 Log: Add missing copyin() to access LUN and port ioctl arguments. Somehow this was working even after PTI in, at least on amd64, and got broken by something only very recently. Reviewed by: araujo Approved by: re (gjb) Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Thu Sep 6 12:41:09 2018 (r338493) +++ head/sys/cam/ctl/ctl.c Thu Sep 6 14:03:10 2018 (r338494) @@ -2943,8 +2943,17 @@ ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, } if (lun_req->args != NULL) { - lun_req->args_nvl = nvlist_unpack(lun_req->args, + packed = malloc(lun_req->args_len, M_CTL, M_WAITOK); + if (copyin(lun_req->args, packed, lun_req->args_len) != 0) { + free(packed, M_CTL); + lun_req->status = CTL_LUN_ERROR; + snprintf(lun_req->error_str, sizeof(lun_req->error_str), + "Cannot copyin args."); + break; + } + lun_req->args_nvl = nvlist_unpack(packed, lun_req->args_len, 0); + free(packed, M_CTL); if (lun_req->args_nvl == NULL) { lun_req->status = CTL_LUN_ERROR; @@ -3211,8 +3220,17 @@ ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, } if (req->args != NULL) { - req->args_nvl = nvlist_unpack(req->args, + packed = malloc(req->args_len, M_CTL, M_WAITOK); + if (copyin(req->args, packed, req->args_len) != 0) { + free(packed, M_CTL); + req->status = CTL_LUN_ERROR; + snprintf(req->error_str, sizeof(req->error_str), + "Cannot copyin args."); + break; + } + req->args_nvl = nvlist_unpack(packed, req->args_len, 0); + free(packed, M_CTL); if (req->args_nvl == NULL) { req->status = CTL_LUN_ERROR; From owner-svn-src-head@freebsd.org Thu Sep 6 14: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 B676CFFC387; Thu, 6 Sep 2018 14:03:12 +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 6BBEF785AD; Thu, 6 Sep 2018 14:03:12 +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 6626B609A; Thu, 6 Sep 2018 14:03:12 +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 w86E3CNA097960; Thu, 6 Sep 2018 14:03:12 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w86E3CZU097959; Thu, 6 Sep 2018 14:03:12 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201809061403.w86E3CZU097959@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 6 Sep 2018 14:03:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338495 - head/sys/contrib/rdma/krping X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/contrib/rdma/krping X-SVN-Commit-Revision: 338495 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 06 Sep 2018 14:03:12 -0000 Author: hselasky Date: Thu Sep 6 14:03:11 2018 New Revision: 338495 URL: https://svnweb.freebsd.org/changeset/base/338495 Log: Add proper support for VIMAGE to krping. Make sure we pass the correct VNET when allocating the RDMA ID. MFC after: 3 days Approved by: re (gjb) Sponsored by: Mellanox Technologies Modified: head/sys/contrib/rdma/krping/krping.c Modified: head/sys/contrib/rdma/krping/krping.c ============================================================================== --- head/sys/contrib/rdma/krping/krping.c Thu Sep 6 14:03:10 2018 (r338494) +++ head/sys/contrib/rdma/krping/krping.c Thu Sep 6 14:03:11 2018 (r338495) @@ -2156,7 +2156,7 @@ int krping_doit(char *cmd) goto out; } - cb->cm_id = rdma_create_id(&init_net, krping_cma_event_handler, cb, RDMA_PS_TCP, IB_QPT_RC); + cb->cm_id = rdma_create_id(TD_TO_VNET(curthread), krping_cma_event_handler, cb, RDMA_PS_TCP, IB_QPT_RC); if (IS_ERR(cb->cm_id)) { ret = PTR_ERR(cb->cm_id); printk(KERN_ERR PFX "rdma_create_id error %d\n", ret); From owner-svn-src-head@freebsd.org Thu Sep 6 14:15: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 9B8CAFFC91D; Thu, 6 Sep 2018 14:15: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 50740792AE; Thu, 6 Sep 2018 14:15: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 4B38E623A; Thu, 6 Sep 2018 14:15: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 w86EF4KE003657; Thu, 6 Sep 2018 14:15:04 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w86EF4Rs003656; Thu, 6 Sep 2018 14:15:04 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201809061415.w86EF4Rs003656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 6 Sep 2018 14:15:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338496 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 338496 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 06 Sep 2018 14:15:04 -0000 Author: markj Date: Thu Sep 6 14:15:03 2018 New Revision: 338496 URL: https://svnweb.freebsd.org/changeset/base/338496 Log: Define sctp probes only when SCTP is configured. Otherwise the "depends_on provider" guard in sctp.d does not work as intended. Reported by: mjg Reviewed by: tuexen Approved by: re (gjb) Differential Revision: https://reviews.freebsd.org/D17057 Modified: head/sys/netinet/in_kdtrace.c Modified: head/sys/netinet/in_kdtrace.c ============================================================================== --- head/sys/netinet/in_kdtrace.c Thu Sep 6 14:03:11 2018 (r338495) +++ head/sys/netinet/in_kdtrace.c Thu Sep 6 14:15:03 2018 (r338496) @@ -31,12 +31,16 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_sctp.h" + #include #include #include SDT_PROVIDER_DEFINE(ip); +#ifdef SCTP SDT_PROVIDER_DEFINE(sctp); +#endif SDT_PROVIDER_DEFINE(tcp); SDT_PROVIDER_DEFINE(udp); SDT_PROVIDER_DEFINE(udplite); @@ -57,6 +61,7 @@ SDT_PROBE_DEFINE6_XLATE(ip, , , send, "struct ip *", "ipv4info_t *", "struct ip6_hdr *", "ipv6info_t *"); +#ifdef SCTP SDT_PROBE_DEFINE5_XLATE(sctp, , , receive, "void *", "pktinfo_t *", "struct sctp_tcb *", "csinfo_t *", @@ -78,6 +83,7 @@ SDT_PROBE_DEFINE6_XLATE(sctp, , , state__change, "struct sctp_tcb *", "sctpsinfo_t *", "void *", "void *", "int", "sctplsinfo_t *"); +#endif SDT_PROBE_DEFINE5_XLATE(tcp, , , accept__established, "void *", "pktinfo_t *", From owner-svn-src-head@freebsd.org Thu Sep 6 14:55: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 0C916FFD5F4 for ; Thu, 6 Sep 2018 14:55:26 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 608117A52A for ; Thu, 6 Sep 2018 14:55:25 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-lf1-x142.google.com with SMTP id l26-v6so9326112lfc.8 for ; Thu, 06 Sep 2018 07:55:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=QdTEWGbchy/mfeoSEEKWWPuej0CvgD7mmzuJ1TvRn/w=; b=HBLVU4P2iJ5+Unlf3s5xqwDKM54WzWj7Q6kA9qdrUouG3cRR8VLs2YnG4QED1JXJRO a7gwbjTrsYgHnIaLfi99VexQ3ZyW35rZafPyW6g1Hm7mtc9MksWDGDVhcIvtMw2bzIzy YlmN9O+CSyuX8x+IB0nFrbM7zhI0h208Mhv/sjYXy3GphwdHI/PH/EtNI1kxy1U+HUol 3D43XYWEAaLNZDuB76mdVZ2XjObvs4CoSQgI39Y0Fo8wODTh3JbM1MBh46aBZ5BW69wo xm7nUk85v3Lta+z56RgVMqECTCg64IXo4zanN0d/pLkGCaOW1HYFhilqVj6a4zvYukuU Qv6g== 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=QdTEWGbchy/mfeoSEEKWWPuej0CvgD7mmzuJ1TvRn/w=; b=HiweXVGhsgztfMFFan+GhmgonRUkC68673Qcqnjo2wTlvztKQ68HWJQWaeERXtLFHf zdb1cQNk7ylb93PBDjKI0Je2mocqrB4pnmFvM9OQp1RXs8juZH5qOrLytMdbdCWCs7kr Fb9m9J70RaIMv5iqQURVDp2zeTQNCv/zXSoXQiZh3F/y0hqLUzSwtLLFuFseEsXyu9HZ c7DxE3IbdWqqlCNdqQA463P/KaGESoSUkdmhKp2OPCs1wXSP1TAJzwoI4815xLdLkqjN +tAOg4DfZwri7I2xziTjkv5JEzc6qlTY0mcvz6Q7FoBu09LpTswDjv/IGn2kqTyhhJMP PROg== X-Gm-Message-State: APzg51B/5FUr6qnhFIckhqLfnG2FqEw4Xf3ZNzypfr7rRjYEsVcIN04a 1eaSCZxIw1H9Cypeoy2muCKO+Q== X-Google-Smtp-Source: ANB0VdYJKPNhgpJl1XYO7rFJGUEJnwfnt0ZEU8d8Uql4Kf5Pz2kRWoixxy+g7fmDto35cQEnFCVHfg== X-Received: by 2002:a19:18d8:: with SMTP id 85-v6mr2325109lfy.133.1536245723504; Thu, 06 Sep 2018 07:55:23 -0700 (PDT) Received: from mutt-hbsd (tor-exit1.netnik.xyz. [176.31.208.193]) by smtp.gmail.com with ESMTPSA id 84-v6sm861043lje.48.2018.09.06.07.55.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Sep 2018 07:55:22 -0700 (PDT) Date: Thu, 6 Sep 2018 10:54:21 -0400 From: Shawn Webb To: Alexander Motin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r338494 - head/sys/cam/ctl Message-ID: <20180906145421.7mejwhcfezwtsk4k@mutt-hbsd> References: <201809061403.w86E3AUm097915@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mmrwseyezc5r226h" Content-Disposition: inline In-Reply-To: <201809061403.w86E3AUm097915@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hbsd 12.0-ALPHA4 FreeBSD 12.0-ALPHA4 X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20180622 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 06 Sep 2018 14:55:26 -0000 --mmrwseyezc5r226h Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 06, 2018 at 02:03:10PM +0000, Alexander Motin wrote: > Author: mav > Date: Thu Sep 6 14:03:10 2018 > New Revision: 338494 > URL: https://svnweb.freebsd.org/changeset/base/338494 >=20 > Log: > Add missing copyin() to access LUN and port ioctl arguments. > =20 > Somehow this was working even after PTI in, at least on amd64, and got > broken by something only very recently. Is anyone investigating why the direct access still worked? Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 Tor+XMPP+OTR: lattera@is.a.hacker.sx GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --mmrwseyezc5r226h Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAluRP5kACgkQaoRlj1JF bu4WxRAArUu5oRGA77mJ5JvrKRBJ8TPmN7kPhN/ydOnkat+Rde8JouNRg8RmUZ/Q Jb9doAQkEDReMatHuy7fOPYm/x3o3hMqF65tAFcPPK5iZPvc/+yQVOpx+ir4TdZC L5w7U/4z7s4pF4ikAZ16PZLfKibpQtgJWR1Vo/Tj5jfeB0ql8pu3shr0xz+tJb5g qGjTOifZ1NewLz5GkQBV90sldr3xvw5hqRLFc4Gw43mxtlHLgVV31DK1w+gDBuFe IVK9mT0y0wcBjwBVK8lnnP39+3taqTiXdBrrUCx98u4tbqSRkXnroz0rADPAt/Ls jRBg3Mzg8BRb8VeiSNBdT5ZwhPqu4WzPcbHqHT4gsk3fKoH8TJy9v8v915kQ45fo aU2GQVog+2Nay+rbN3LC7Arga/CYrj1bWDHVEccXtNQiEJBeVL6+gHOY7RatK21k Y2E7iPOWwoGLjR2rI39SCbqVELVnIFlTgc8WCyJOFSIqZSM9AU5fDOEH0BW2JpZa FDXqkEARU0h4sbfzQYNNd0V2T2qkIpOVX3BwSiV9Wgc2d/aaGaz9X99Q3Ja76pgD c/uQWkCIrI+/8MyQ2dnHrz5KgbVPUqQyAZPn3Dhy9hUDRG4BG6KaU6MKBKeIMdpj LJpT3bIWZK9oInU7sOPMKFOlgQHneKECksj1qBlPi8/sgyCLUNs= =A2SI -----END PGP SIGNATURE----- --mmrwseyezc5r226h-- From owner-svn-src-head@freebsd.org Thu Sep 6 14:55: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 3F849FFD634; Thu, 6 Sep 2018 14:55:55 +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 E9D327A668; Thu, 6 Sep 2018 14:55:54 +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 E09B568D7; Thu, 6 Sep 2018 14:55:54 +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 w86EtsTb023869; Thu, 6 Sep 2018 14:55:54 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w86Etsr2023866; Thu, 6 Sep 2018 14:55:54 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201809061455.w86Etsr2023866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Thu, 6 Sep 2018 14:55:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338497 - in head: etc usr.sbin/cron/cron X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: in head: etc usr.sbin/cron/cron X-SVN-Commit-Revision: 338497 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 06 Sep 2018 14:55:55 -0000 Author: brd Date: Thu Sep 6 14:55:54 2018 New Revision: 338497 URL: https://svnweb.freebsd.org/changeset/base/338497 Log: Move etc/crontab to usr.sbin/cron/cron/ Approved by: re (gjb), will (mentor) Differential Revision: https://reviews.freebsd.org/D16786 Added: head/usr.sbin/cron/cron/crontab - copied unchanged from r338496, head/etc/crontab Deleted: head/etc/crontab Modified: head/etc/Makefile head/usr.sbin/cron/cron/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Thu Sep 6 14:15:03 2018 (r338496) +++ head/etc/Makefile Thu Sep 6 14:55:54 2018 (r338497) @@ -12,7 +12,7 @@ UPDATE_DEPENDFILE= no SUBDIR+=sendmail .endif -BIN1= crontab \ +BIN1= \ dhclient.conf \ disktab \ group \ Modified: head/usr.sbin/cron/cron/Makefile ============================================================================== --- head/usr.sbin/cron/cron/Makefile Thu Sep 6 14:15:03 2018 (r338496) +++ head/usr.sbin/cron/cron/Makefile Thu Sep 6 14:55:54 2018 (r338497) @@ -1,5 +1,6 @@ # $FreeBSD$ +CONFS= crontab PROG= cron MAN= cron.8 SRCS= cron.c database.c do_command.c job.c user.c popen.c Copied: head/usr.sbin/cron/cron/crontab (from r338496, head/etc/crontab) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/cron/cron/crontab Thu Sep 6 14:55:54 2018 (r338497, copy of r338496, head/etc/crontab) @@ -0,0 +1,23 @@ +# /etc/crontab - root's crontab for FreeBSD +# +# $FreeBSD$ +# +SHELL=/bin/sh +PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin +# +#minute hour mday month wday who command +# +# Save some entropy so that /dev/random can re-seed on boot. +*/11 * * * * operator /usr/libexec/save-entropy +# +# Rotate log files every hour, if necessary. +0 * * * * root newsyslog +# +# Perform daily/weekly/monthly maintenance. +1 3 * * * root periodic daily +15 4 * * 6 root periodic weekly +30 5 1 * * root periodic monthly +# +# Adjust the time zone if the CMOS clock keeps local time, as opposed to +# UTC time. See adjkerntz(8) for details. +1,31 0-5 * * * root adjkerntz -a From owner-svn-src-head@freebsd.org Thu Sep 6 15:24: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 91F03FFE303; Thu, 6 Sep 2018 15:24:36 +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 3E68A7BB75; Thu, 6 Sep 2018 15:24:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id C4C8910A87D; Thu, 6 Sep 2018 11:24:34 -0400 (EDT) Subject: Re: svn commit: r338494 - head/sys/cam/ctl To: Shawn Webb , Alexander Motin References: <201809061403.w86E3AUm097915@repo.freebsd.org> <20180906145421.7mejwhcfezwtsk4k@mutt-hbsd> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: John Baldwin Message-ID: <51c27534-8cc2-cd30-dd53-77fd7ad5bdf7@FreeBSD.org> Date: Thu, 6 Sep 2018 08:24:32 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180906145421.7mejwhcfezwtsk4k@mutt-hbsd> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Thu, 06 Sep 2018 11:24:35 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 06 Sep 2018 15:24:36 -0000 On 9/6/18 7:54 AM, Shawn Webb wrote: > On Thu, Sep 06, 2018 at 02:03:10PM +0000, Alexander Motin wrote: >> Author: mav >> Date: Thu Sep 6 14:03:10 2018 >> New Revision: 338494 >> URL: https://svnweb.freebsd.org/changeset/base/338494 >> >> Log: >> Add missing copyin() to access LUN and port ioctl arguments. >> >> Somehow this was working even after PTI in, at least on amd64, and got >> broken by something only very recently. > > Is anyone investigating why the direct access still worked? PTI doesn't disable kernel access to user pages, it only disables translation of kernel virtual addresses while in user mode. The thing that catches this type of access is SMAP (which was only recently enabled on x86). -- John Baldwin                                                                              From owner-svn-src-head@freebsd.org Thu Sep 6 15:26:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D43FFFE497 for ; Thu, 6 Sep 2018 15:26:36 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 116D57BE3A for ; Thu, 6 Sep 2018 15:26:36 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-wr1-x442.google.com with SMTP id u12-v6so11839663wrr.4 for ; Thu, 06 Sep 2018 08:26:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=P9hFrAmsfTsiALyZGSEcg1DHaSgf383lbVH2v2Qp6xk=; b=gc9fRk7ne7x9em/8N8H59sDvUNWANITjKnAOw3j52pn/NDy752C6cqmSSBCHjYQWKn TYFmpUozmgfygJm9ynaWQCIX+oRlLwakO9A2apw2W8eYiw3ESnjPlk5sZAFH7cbLIHZ9 TW4VPHt7egDDYurTTontCfUBqoB7+woLXsdvgEf5eNm951lp+ArheyerlSpkNe8czy+C 4HBBgBFt9ZAz+ClNh2WTpae6ZYm32RtZNwZi8FXSUjIEJeaVVbdR/AJhlBON0IkScNpr ofcQwqoMVP7Zou426gv3qZLPBJWWMs2vprY6hGnrHdIdxC6Y/Q+tZ/QFlmj0smVhTB6B SFaA== 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=P9hFrAmsfTsiALyZGSEcg1DHaSgf383lbVH2v2Qp6xk=; b=YdzOPueAfM9oF2QR7aOX7FPABG2288jGSgPo3LKjBOw9pb+Gj+t4tB0nySTNAPxBaS 4gqS/TGaXAbC0jx+fYfwwyGYfM4cggIMVVOujt7dIblsaGOU0cZJT0YOJdQqCa9IqPFd 0dRM3R3raPhD5cc3V+f6lYS7K4iTwWPJMJb3xItEJqrFmhn4HzyrncAucue9dJMsTOxw yV+ngJRfP+jXA/7Ypj0LerIAHHluP0iC6+lXekee9yRGKLBgAgTIovW7CHYx3fxFKpp8 e6WQrmjBwAS3CpwZD4hhSaEazTRHkRMGR0CaWZmPySHND7aA9f7K4dNV/gYbsjUCrov8 sGNQ== X-Gm-Message-State: APzg51Bj2A4kcD9+T3L041q1t+o8Crl2uajJkkvLQR2fv61S0vbRO1RR 3cgbHiozsd+Vazv7ZTgb2D33pw== X-Google-Smtp-Source: ANB0VdYpsJ7bEjsm9p0PnORPV+q+ReM9AGyCVtOc69aO6mLMBnp0flpJFNhOFgpR2bITWb8VNjxr7A== X-Received: by 2002:adf:9d81:: with SMTP id p1-v6mr2707299wre.12.1536247594855; Thu, 06 Sep 2018 08:26:34 -0700 (PDT) Received: from mutt-hbsd (exit1.ipredator.se. [197.231.221.211]) by smtp.gmail.com with ESMTPSA id d10-v6sm9448610wrv.70.2018.09.06.08.26.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Sep 2018 08:26:34 -0700 (PDT) Date: Thu, 6 Sep 2018 11:25:33 -0400 From: Shawn Webb To: John Baldwin Cc: Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r338494 - head/sys/cam/ctl Message-ID: <20180906152533.ygsqei2jgod42ydt@mutt-hbsd> References: <201809061403.w86E3AUm097915@repo.freebsd.org> <20180906145421.7mejwhcfezwtsk4k@mutt-hbsd> <51c27534-8cc2-cd30-dd53-77fd7ad5bdf7@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="snqdvlofjpj57woe" Content-Disposition: inline In-Reply-To: <51c27534-8cc2-cd30-dd53-77fd7ad5bdf7@FreeBSD.org> X-Operating-System: FreeBSD mutt-hbsd 12.0-ALPHA4 FreeBSD 12.0-ALPHA4 X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20180622 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 06 Sep 2018 15:26:36 -0000 --snqdvlofjpj57woe Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 06, 2018 at 08:24:32AM -0700, John Baldwin wrote: > On 9/6/18 7:54 AM, Shawn Webb wrote: > > On Thu, Sep 06, 2018 at 02:03:10PM +0000, Alexander Motin wrote: > >> Author: mav > >> Date: Thu Sep 6 14:03:10 2018 > >> New Revision: 338494 > >> URL: https://svnweb.freebsd.org/changeset/base/338494 > >> > >> Log: > >> Add missing copyin() to access LUN and port ioctl arguments. > >> =20 > >> Somehow this was working even after PTI in, at least on amd64, and g= ot > >> broken by something only very recently. > >=20 > > Is anyone investigating why the direct access still worked? >=20 > PTI doesn't disable kernel access to user pages, it only disables > translation of kernel virtual addresses while in user mode. The thing th= at > catches this type of access is SMAP (which was only recently enabled on > x86). Whoops. Blonde moment. I blame the lack of caffeine in my body when I wrote the email. Too many acronyms to keep track of when tired. ;) Thanks for the clarification. --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 Tor+XMPP+OTR: lattera@is.a.hacker.sx GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --snqdvlofjpj57woe Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAluRRugACgkQaoRlj1JF bu7ULA/+I1hk2FVR+dUlyVvrzC27vUO24PZAX/Fh4Iih/whj+PEAkJoPPwBviPGR QVt8Ie+NThM0Su3mcR8RxXopzoB3Bac8g+qo2AeIilfeVDUjOBFuqaSwVYeLbk9t 3Kg0+dxZSSnJ7B/odkMv6WiodDdK8lVpKtgQrrkrXrRLHlbpVJHSdPttrcJbD41G rf7uW9L45k6QK3Q3+Rqk9efD3ifeGSsAPvTe7I3HTROoDc9Oyi9lKQm28C+yfxTN elQG/lu1RUksbIUhZ7x7sNYFnzUhY3VOScZ4tno6rui7RY411DvpB+PXATe2WgRP VdO6dvH6FEqymxF3QX32HrgSZjJdEU1tTyL8D8PpWdliPVcILZg77fxhV/mHLTRz rHBf6vk78MW1znanJDLAPHyN1xrxB9HX/TwnQOLWLIJGHhKkxYZqL8/VP5ZoVpsb kqjLwzBxPo5ibYAGDYlwdebVo4y5P6czmaZBHFqOKKRglrQWiUH8JEkEzaVWldIx AEfoGZzxHyXeur4yqTiwwmVvIxujbwM7vJdpzuBmtkHfoULymy1r+Uxdlvksf4Mw X7kRrfH4C9yBXe8AASfLWRC8HtkTmlfKekNt/vnXjoiGJ/GaMhEetlMyl0UFQSpv PT3vAqvPMlt2RxnuWOutYGslPUssI9fVm/3OLdMo37aHe5wR7FE= =Jfjr -----END PGP SIGNATURE----- --snqdvlofjpj57woe-- From owner-svn-src-head@freebsd.org Thu Sep 6 16:11:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3D4EFFF971; Thu, 6 Sep 2018 16:11:24 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7A94E7DEFF; Thu, 6 Sep 2018 16:11:24 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7592F74E8; Thu, 6 Sep 2018 16:11:24 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w86GBOuQ062574; Thu, 6 Sep 2018 16:11:24 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w86GBOaD062573; Thu, 6 Sep 2018 16:11:24 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201809061611.w86GBOaD062573@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 6 Sep 2018 16:11:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338498 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 338498 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 06 Sep 2018 16:11:24 -0000 Author: bz Date: Thu Sep 6 16:11:24 2018 New Revision: 338498 URL: https://svnweb.freebsd.org/changeset/base/338498 Log: Make tcp_hpts.c compile a LINT kernel with options RSS and PCBGROUPS added by adding the missing include files and changing a the type of cpuid which would otherwise cause a false comparison with NETISR_CPUID_NONE. Reviewed by: rrs Approved by: re (marius) Differential Revision: https://reviews.freebsd.org/D16891 Modified: head/sys/netinet/tcp_hpts.c Modified: head/sys/netinet/tcp_hpts.c ============================================================================== --- head/sys/netinet/tcp_hpts.c Thu Sep 6 14:55:54 2018 (r338497) +++ head/sys/netinet/tcp_hpts.c Thu Sep 6 16:11:24 2018 (r338498) @@ -167,6 +167,8 @@ __FBSDID("$FreeBSD$"); MALLOC_DEFINE(M_TCPHPTS, "tcp_hpts", "TCP hpts"); #ifdef RSS +#include +#include static int tcp_bind_threads = 1; #else static int tcp_bind_threads = 0; @@ -1076,7 +1078,7 @@ hpts_random_cpu(struct inpcb *inp){ static uint16_t hpts_cpuid(struct inpcb *inp){ - uint16_t cpuid; + u_int cpuid; /* From owner-svn-src-head@freebsd.org Thu Sep 6 16:17: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 C292CFFFBD1; Thu, 6 Sep 2018 16:17:46 +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 731E47E2BA; Thu, 6 Sep 2018 16:17:46 +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 6E0D07651; Thu, 6 Sep 2018 16:17:46 +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 w86GHko1065307; Thu, 6 Sep 2018 16:17:46 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w86GHjsW065304; Thu, 6 Sep 2018 16:17:45 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201809061617.w86GHjsW065304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 6 Sep 2018 16:17:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338499 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 338499 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 06 Sep 2018 16:17:47 -0000 Author: markj Date: Thu Sep 6 16:17:45 2018 New Revision: 338499 URL: https://svnweb.freebsd.org/changeset/base/338499 Log: Remove vm_page_remque(). Testing m->queue != PQ_NONE is not sufficient; see the commit log message for r338276. As of r332974 vm_page_dequeue() handles already-dequeued pages, so just replace vm_page_remque() calls with vm_page_dequeue() calls. Reviewed by: kib Tested by: pho Approved by: re (marius) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17025 Modified: head/sys/vm/vm_fault.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Thu Sep 6 16:11:24 2018 (r338498) +++ head/sys/vm/vm_fault.c Thu Sep 6 16:17:45 2018 (r338499) @@ -1124,7 +1124,7 @@ readrest: */ fs.object == fs.first_object->backing_object) { vm_page_lock(fs.m); - vm_page_remque(fs.m); + vm_page_dequeue(fs.m); vm_page_remove(fs.m); vm_page_unlock(fs.m); vm_page_lock(fs.first_m); Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Thu Sep 6 16:11:24 2018 (r338498) +++ head/sys/vm/vm_page.c Thu Sep 6 16:17:45 2018 (r338499) @@ -2627,7 +2627,7 @@ retry: m_new->dirty = m->dirty; m->flags &= ~PG_ZERO; vm_page_xbusy(m); - vm_page_remque(m); + vm_page_dequeue(m); vm_page_replace_checked(m_new, object, m->pindex, m); if (vm_page_free_prep(m)) @@ -2642,7 +2642,7 @@ retry: vm_page_deactivate(m_new); } else { m->flags &= ~PG_ZERO; - vm_page_remque(m); + vm_page_dequeue(m); vm_page_remove(m); if (vm_page_free_prep(m)) SLIST_INSERT_HEAD(&free, m, @@ -3404,7 +3404,7 @@ vm_page_activate(vm_page_t m) return; } - vm_page_remque(m); + vm_page_dequeue(m); if (m->act_count < ACT_INIT) m->act_count = ACT_INIT; vm_page_enqueue(m, PQ_ACTIVE); @@ -3676,7 +3676,7 @@ vm_page_deactivate(vm_page_t m) return; if (!vm_page_inactive(m)) { - vm_page_remque(m); + vm_page_dequeue(m); vm_page_enqueue(m, PQ_INACTIVE); } else vm_page_requeue(m); @@ -3699,9 +3699,10 @@ vm_page_deactivate_noreuse(vm_page_t m) if (m->wire_count > 0 || (m->oflags & VPO_UNMANAGED) != 0) return; - if (!vm_page_inactive(m)) - vm_page_remque(m); - m->queue = PQ_INACTIVE; + if (!vm_page_inactive(m)) { + vm_page_dequeue(m); + m->queue = PQ_INACTIVE; + } if ((m->aflags & PGA_REQUEUE_HEAD) == 0) vm_page_aflag_set(m, PGA_REQUEUE_HEAD); vm_pqbatch_submit_page(m, PQ_INACTIVE); @@ -3723,7 +3724,7 @@ vm_page_launder(vm_page_t m) if (vm_page_in_laundry(m)) vm_page_requeue(m); else { - vm_page_remque(m); + vm_page_dequeue(m); vm_page_enqueue(m, PQ_LAUNDRY); } } @@ -3741,7 +3742,7 @@ vm_page_unswappable(vm_page_t m) KASSERT(m->wire_count == 0 && (m->oflags & VPO_UNMANAGED) == 0, ("page %p already unswappable", m)); - vm_page_remque(m); + vm_page_dequeue(m); vm_page_enqueue(m, PQ_UNSWAPPABLE); } Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Thu Sep 6 16:11:24 2018 (r338498) +++ head/sys/vm/vm_page.h Thu Sep 6 16:17:45 2018 (r338499) @@ -740,22 +740,6 @@ vm_page_dirty(vm_page_t m) } /* - * vm_page_remque: - * - * If the given page is in a page queue, then remove it from that page - * queue. - * - * The page must be locked. - */ -static inline void -vm_page_remque(vm_page_t m) -{ - - if (m->queue != PQ_NONE) - vm_page_dequeue(m); -} - -/* * vm_page_undirty: * * Set page to not be dirty. Note: does not clear pmap modify bits From owner-svn-src-head@freebsd.org Thu Sep 6 17: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 85CC2FCD0C5; Thu, 6 Sep 2018 17:07:22 +0000 (UTC) (envelope-from leitao@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3C646802B0; Thu, 6 Sep 2018 17:07:22 +0000 (UTC) (envelope-from leitao@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 374537EB8; Thu, 6 Sep 2018 17:07:22 +0000 (UTC) (envelope-from leitao@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w86H7LFl090974; Thu, 6 Sep 2018 17:07:21 GMT (envelope-from leitao@FreeBSD.org) Received: (from leitao@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w86H7LwT090971; Thu, 6 Sep 2018 17:07:21 GMT (envelope-from leitao@FreeBSD.org) Message-Id: <201809061707.w86H7LwT090971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: leitao set sender to leitao@FreeBSD.org using -f From: Breno Leitao Date: Thu, 6 Sep 2018 17:07:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338500 - head/sys/powerpc/include X-SVN-Group: head X-SVN-Commit-Author: leitao X-SVN-Commit-Paths: head/sys/powerpc/include X-SVN-Commit-Revision: 338500 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 06 Sep 2018 17:07:22 -0000 Author: leitao Date: Thu Sep 6 17:07:21 2018 New Revision: 338500 URL: https://svnweb.freebsd.org/changeset/base/338500 Log: powerpc64: Add initial support for HTM (kABI) This patch adds the very initial support for HTM that might come at FreeBSD version 12.1. This basic support defines a new kABI, so, we do not need to change it later during 12.1 time frame, when the full implementation will come. Reviewed by: jhibbits Approved by: re(marius), jhibbits (mentor) Differential Revision: https://reviews.freebsd.org/D16889 Modified: head/sys/powerpc/include/pcb.h head/sys/powerpc/include/pcpu.h Modified: head/sys/powerpc/include/pcb.h ============================================================================== --- head/sys/powerpc/include/pcb.h Thu Sep 6 16:17:45 2018 (r338499) +++ head/sys/powerpc/include/pcb.h Thu Sep 6 17:07:21 2018 (r338500) @@ -56,6 +56,7 @@ struct pcb { #define PCB_VEC 0x4 /* Process had Altivec initialized */ #define PCB_VSX 0x8 /* Process had VSX initialized */ #define PCB_CDSCR 0x10 /* Process had Custom DSCR initialized */ +#define PCB_HTM 0x20 /* Process had HTM initialized */ struct fpu { union { double fpr; @@ -73,6 +74,11 @@ struct pcb { } pcb_vec __aligned(16); /* Vector processor */ unsigned int pcb_veccpu; /* which CPU had our vector stuff. */ + struct htm { + uint64_t tfhar; + uint64_t texasr; + uint64_t tfiar; + } pcb_htm; union { struct { Modified: head/sys/powerpc/include/pcpu.h ============================================================================== --- head/sys/powerpc/include/pcpu.h Thu Sep 6 16:17:45 2018 (r338499) +++ head/sys/powerpc/include/pcpu.h Thu Sep 6 17:07:21 2018 (r338500) @@ -45,6 +45,7 @@ struct pvo_entry; struct pmap *pc_curpmap; /* current pmap */ \ struct thread *pc_fputhread; /* current fpu user */ \ struct thread *pc_vecthread; /* current vec user */ \ + struct thread *pc_htmthread; /* current htm user */ \ uintptr_t pc_hwref; \ int pc_bsp; \ volatile int pc_awake; \ From owner-svn-src-head@freebsd.org Thu Sep 6 17:25: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 0453FFCDB0B; Thu, 6 Sep 2018 17:25:02 +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 A8FDB80ED1; Thu, 6 Sep 2018 17:25:01 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A2CAA101FF; Thu, 6 Sep 2018 17:25:01 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w86HP1Uq001075; Thu, 6 Sep 2018 17:25:01 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w86HP1QR001074; Thu, 6 Sep 2018 17:25:01 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201809061725.w86HP1QR001074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 6 Sep 2018 17:25:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338501 - head/sys/arm/arm X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm/arm X-SVN-Commit-Revision: 338501 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 06 Sep 2018 17:25:02 -0000 Author: andrew Date: Thu Sep 6 17:25:01 2018 New Revision: 338501 URL: https://svnweb.freebsd.org/changeset/base/338501 Log: Remove the check that the Arm generic interrupt controller variant is non-zero. This is the case on qemu, so remove it to allow us to boot there. This change is needed to boot on qemu with ACPI. Approved by: re (gjb) Modified: head/sys/arm/arm/gic.c Modified: head/sys/arm/arm/gic.c ============================================================================== --- head/sys/arm/arm/gic.c Thu Sep 6 17:07:21 2018 (r338500) +++ head/sys/arm/arm/gic.c Thu Sep 6 17:25:01 2018 (r338501) @@ -497,8 +497,7 @@ arm_gic_read_ivar(device_t dev, device_t child, int wh switch(which) { case GIC_IVAR_HW_REV: - KASSERT(GICD_IIDR_VAR(sc->gic_iidr) < 3 && - GICD_IIDR_VAR(sc->gic_iidr) != 0, + KASSERT(GICD_IIDR_VAR(sc->gic_iidr) < 3, ("arm_gic_read_ivar: Unknown IIDR revision %u (%.08x)", GICD_IIDR_VAR(sc->gic_iidr), sc->gic_iidr)); *result = GICD_IIDR_VAR(sc->gic_iidr); From owner-svn-src-head@freebsd.org Thu Sep 6 17:25: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 8185CFCDB63; Thu, 6 Sep 2018 17:25:51 +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 3855F81026; Thu, 6 Sep 2018 17:25:51 +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 331A410200; Thu, 6 Sep 2018 17:25:51 +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 w86HPoxL001157; Thu, 6 Sep 2018 17:25:50 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w86HPo8Y001156; Thu, 6 Sep 2018 17:25:50 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201809061725.w86HPo8Y001156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 6 Sep 2018 17:25:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338502 - head/sys/arm/arm X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm/arm X-SVN-Commit-Revision: 338502 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 06 Sep 2018 17:25:51 -0000 Author: andrew Date: Thu Sep 6 17:25:50 2018 New Revision: 338502 URL: https://svnweb.freebsd.org/changeset/base/338502 Log: Fix the GIC ACPI cross reference value. To support INTRNG with ACPI we need to set a non-zero cross reference value for the interrupt controller. The GICv3 driver already had this value set, however it was missed in the GICv2 driver. Fix this by setting xref to the correct value. Approved by: re (gjb) Modified: head/sys/arm/arm/gic_acpi.c Modified: head/sys/arm/arm/gic_acpi.c ============================================================================== --- head/sys/arm/arm/gic_acpi.c Thu Sep 6 17:25:01 2018 (r338501) +++ head/sys/arm/arm/gic_acpi.c Thu Sep 6 17:25:50 2018 (r338502) @@ -34,6 +34,7 @@ * SUCH DAMAGE. */ +#include "opt_acpi.h" #include "opt_platform.h" #include @@ -217,7 +218,7 @@ gic_acpi_attach(device_t dev) if (err != 0) return (err); - xref = 0; + xref = ACPI_INTR_XREF; /* * Now, when everything is initialized, it's right time to From owner-svn-src-head@freebsd.org Thu Sep 6 18:34: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 B11F9FCFB9A; Thu, 6 Sep 2018 18:34:12 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5D10884722; Thu, 6 Sep 2018 18:34:12 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5526F10E1C; Thu, 6 Sep 2018 18:34:12 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w86IYCvG039808; Thu, 6 Sep 2018 18:34:12 GMT (envelope-from obrien@FreeBSD.org) Received: (from obrien@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w86IYCYF039807; Thu, 6 Sep 2018 18:34:12 GMT (envelope-from obrien@FreeBSD.org) Message-Id: <201809061834.w86IYCYF039807@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: obrien set sender to obrien@FreeBSD.org using -f From: "David E. O'Brien" Date: Thu, 6 Sep 2018 18:34:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338503 - head/usr.sbin/services_mkdb X-SVN-Group: head X-SVN-Commit-Author: obrien X-SVN-Commit-Paths: head/usr.sbin/services_mkdb X-SVN-Commit-Revision: 338503 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 06 Sep 2018 18:34:12 -0000 Author: obrien Date: Thu Sep 6 18:34:11 2018 New Revision: 338503 URL: https://svnweb.freebsd.org/changeset/base/338503 Log: Add MPLS LSP-echo (RFC8029, March 2017) port. Reviewed by: stevek Approved by: re(gjb) Obtained from: Juniper Networks Modified: head/usr.sbin/services_mkdb/services Modified: head/usr.sbin/services_mkdb/services ============================================================================== --- head/usr.sbin/services_mkdb/services Thu Sep 6 17:25:50 2018 (r338502) +++ head/usr.sbin/services_mkdb/services Thu Sep 6 18:34:11 2018 (r338503) @@ -2238,6 +2238,8 @@ vat-control 3457/tcp #VAT default control vat-control 3457/udp #VAT default control nut 3493/tcp #Network UPS Tools nut 3493/udp #Network UPS Tools +lsp-ping 3503/tcp #MPLS LSP-echo (RFC8029) +lsp-ping 3503/udp #MPLS LSP-echo (RFC8029) m2pa 3565/sctp #M2PA m2pa 3565/tcp #M2PA tsp 3653/tcp #Tunnel Setup Protocol From owner-svn-src-head@freebsd.org Thu Sep 6 18:45: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 A7F20FDA322; Thu, 6 Sep 2018 18:45:32 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 504F084F7A; Thu, 6 Sep 2018 18:45:32 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4641F10FEF; Thu, 6 Sep 2018 18:45:32 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w86IjWCB044897; Thu, 6 Sep 2018 18:45:32 GMT (envelope-from bwidawsk@FreeBSD.org) Received: (from bwidawsk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w86IjWIJ044896; Thu, 6 Sep 2018 18:45:32 GMT (envelope-from bwidawsk@FreeBSD.org) Message-Id: <201809061845.w86IjWIJ044896@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bwidawsk set sender to bwidawsk@FreeBSD.org using -f From: Ben Widawsky Date: Thu, 6 Sep 2018 18:45:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338504 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: bwidawsk X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 338504 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 06 Sep 2018 18:45:32 -0000 Author: bwidawsk Date: Thu Sep 6 18:45:31 2018 New Revision: 338504 URL: https://svnweb.freebsd.org/changeset/base/338504 Log: Add device_attach and device_detach events to man page. Approved by: bcr, emaste (mentor), imp, jhb Approved by: re (gjb) Differential Revision: https://reviews.freebsd.org/D17052 Modified: head/share/man/man9/EVENTHANDLER.9 Modified: head/share/man/man9/EVENTHANDLER.9 ============================================================================== --- head/share/man/man9/EVENTHANDLER.9 Thu Sep 6 18:34:11 2018 (r338503) +++ head/share/man/man9/EVENTHANDLER.9 Thu Sep 6 18:45:31 2018 (r338504) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" $FreeBSD$ .\" -.Dd October 31, 2017 +.Dd September 6, 2018 .Dt EVENTHANDLER 9 .Os .Sh NAME @@ -283,6 +283,10 @@ Callback invoked after cpu frequency has changed. Callback invoked before cpu frequency has changed. .It Vt dcons_poll Callback invoked to poll for dcons changes. +.It Vt device_attach +Callback invoked after a device has attached. +.It Vt device_detach +Callbacks invoked before and after a device has detached. .It Vt dev_clone Callbacks invoked when a new entry is created under .Pa /dev . From owner-svn-src-head@freebsd.org Thu Sep 6 18:51:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6010CFDA605; Thu, 6 Sep 2018 18:51:53 +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 10C8C85347; Thu, 6 Sep 2018 18:51:53 +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 0BBD41105D; Thu, 6 Sep 2018 18:51:53 +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 w86IpqhR049842; Thu, 6 Sep 2018 18:51:52 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w86Ipqe3049841; Thu, 6 Sep 2018 18:51:52 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201809061851.w86Ipqe3049841@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Thu, 6 Sep 2018 18:51:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338505 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 338505 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 06 Sep 2018 18:51:53 -0000 Author: shurd Date: Thu Sep 6 18:51:52 2018 New Revision: 338505 URL: https://svnweb.freebsd.org/changeset/base/338505 Log: Clean up iflib sysctls Remove sysctls: txq_drain_encapfail - now a duplicate of encap_txd_encap_fail intr_link - was never incremented intr_msix - was never incremented rx_zero_len - was never incremented The following were not incremented in all code-paths that apply: m_pullups, mbuf_defrag, rxd_flush, tx_encap, rx_intr_enables, tx_frees, encap_txd_encap_fail. Fixes: Replace the broken collapse_pkthdr() implementation with an MPASS(). fl_refills and fl_refills_large were not incremented when using netmap. Reviewed by: gallatin Approved by: re (marius) Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D16733 Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Thu Sep 6 18:45:31 2018 (r338504) +++ head/sys/net/iflib.c Thu Sep 6 18:51:52 2018 (r338505) @@ -641,7 +641,6 @@ SYSCTL_INT(_net_iflib, OID_AUTO, fl_refills_large, CTL static int iflib_txq_drain_flushing; static int iflib_txq_drain_oactive; static int iflib_txq_drain_notready; -static int iflib_txq_drain_encapfail; SYSCTL_INT(_net_iflib, OID_AUTO, txq_drain_flushing, CTLFLAG_RD, &iflib_txq_drain_flushing, 0, "# drain flushes"); @@ -649,8 +648,6 @@ SYSCTL_INT(_net_iflib, OID_AUTO, txq_drain_oactive, CT &iflib_txq_drain_oactive, 0, "# drain oactives"); SYSCTL_INT(_net_iflib, OID_AUTO, txq_drain_notready, CTLFLAG_RD, &iflib_txq_drain_notready, 0, "# drain notready"); -SYSCTL_INT(_net_iflib, OID_AUTO, txq_drain_encapfail, CTLFLAG_RD, - &iflib_txq_drain_encapfail, 0, "# drain encap fails"); static int iflib_encap_load_mbuf_fail; @@ -670,21 +667,14 @@ SYSCTL_INT(_net_iflib, OID_AUTO, encap_txd_encap_fail, static int iflib_task_fn_rxs; static int iflib_rx_intr_enables; static int iflib_fast_intrs; -static int iflib_intr_link; -static int iflib_intr_msix; static int iflib_rx_unavail; static int iflib_rx_ctx_inactive; -static int iflib_rx_zero_len; static int iflib_rx_if_input; static int iflib_rx_mbuf_null; static int iflib_rxd_flush; static int iflib_verbose_debug; -SYSCTL_INT(_net_iflib, OID_AUTO, intr_link, CTLFLAG_RD, - &iflib_intr_link, 0, "# intr link calls"); -SYSCTL_INT(_net_iflib, OID_AUTO, intr_msix, CTLFLAG_RD, - &iflib_intr_msix, 0, "# intr msix calls"); SYSCTL_INT(_net_iflib, OID_AUTO, task_fn_rx, CTLFLAG_RD, &iflib_task_fn_rxs, 0, "# task_fn_rx calls"); SYSCTL_INT(_net_iflib, OID_AUTO, rx_intr_enables, CTLFLAG_RD, @@ -695,8 +685,6 @@ SYSCTL_INT(_net_iflib, OID_AUTO, rx_unavail, CTLFLAG_R &iflib_rx_unavail, 0, "# times rxeof called with no available data"); SYSCTL_INT(_net_iflib, OID_AUTO, rx_ctx_inactive, CTLFLAG_RD, &iflib_rx_ctx_inactive, 0, "# times rxeof called with inactive context"); -SYSCTL_INT(_net_iflib, OID_AUTO, rx_zero_len, CTLFLAG_RD, - &iflib_rx_zero_len, 0, "# times rxeof saw zero len mbuf"); SYSCTL_INT(_net_iflib, OID_AUTO, rx_if_input, CTLFLAG_RD, &iflib_rx_if_input, 0, "# times rxeof called if_input"); SYSCTL_INT(_net_iflib, OID_AUTO, rx_mbuf_null, CTLFLAG_RD, @@ -713,12 +701,12 @@ iflib_debug_reset(void) iflib_tx_seen = iflib_tx_sent = iflib_tx_encap = iflib_rx_allocs = iflib_fl_refills = iflib_fl_refills_large = iflib_tx_frees = iflib_txq_drain_flushing = iflib_txq_drain_oactive = - iflib_txq_drain_notready = iflib_txq_drain_encapfail = + iflib_txq_drain_notready = iflib_encap_load_mbuf_fail = iflib_encap_pad_mbuf_fail = iflib_encap_txq_avail_fail = iflib_encap_txd_encap_fail = iflib_task_fn_rxs = iflib_rx_intr_enables = iflib_fast_intrs = - iflib_intr_link = iflib_intr_msix = iflib_rx_unavail = - iflib_rx_ctx_inactive = iflib_rx_zero_len = iflib_rx_if_input = + iflib_rx_unavail = + iflib_rx_ctx_inactive = iflib_rx_if_input = iflib_rx_mbuf_null = iflib_rxd_flush = 0; } @@ -839,6 +827,9 @@ netmap_fl_refill(iflib_rxq_t rxq, struct netmap_kring if_ctx_t ctx = rxq->ifr_ctx; iflib_fl_t fl = &rxq->ifr_fl[0]; uint32_t refill_pidx, nic_i; +#if IFLIB_DEBUG_COUNTERS + int rf_count = 0; +#endif if (nm_i == head && __predict_true(!init)) return 0; @@ -851,7 +842,12 @@ netmap_fl_refill(iflib_rxq_t rxq, struct netmap_kring */ head = nm_prev(head, lim); nic_i = UINT_MAX; + DBG_COUNTER_INC(fl_refills); while (nm_i != head) { +#if IFLIB_DEBUG_COUNTERS + if (++rf_count == 9) + DBG_COUNTER_INC(fl_refills_large); +#endif for (int tmp_pidx = 0; tmp_pidx < IFLIB_MAX_RX_REFRESH && nm_i != head; tmp_pidx++) { struct netmap_slot *slot = &ring->slot[nm_i]; void *addr = PNMB(na, slot, &fl->ifl_bus_addrs[tmp_pidx]); @@ -898,8 +894,10 @@ netmap_fl_refill(iflib_rxq_t rxq, struct netmap_kring if (map) bus_dmamap_sync(fl->ifl_ifdi->idi_tag, fl->ifl_ifdi->idi_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); - if (__predict_true(nic_i != UINT_MAX)) + if (__predict_true(nic_i != UINT_MAX)) { ctx->isc_rxd_flush(ctx->ifc_softc, rxq->ifr_id, fl->ifl_id, nic_i); + DBG_COUNTER_INC(rxd_flush); + } return (0); } @@ -998,6 +996,7 @@ iflib_netmap_txsync(struct netmap_kring *kring, int fl /* Fill the slot in the NIC ring. */ ctx->isc_txd_encap(ctx->ifc_softc, &pi); + DBG_COUNTER_INC(tx_encap); /* prefetch for next round */ __builtin_prefetch(&ring->slot[nm_i + 1]); @@ -1524,8 +1523,10 @@ iflib_fast_intr_rxtx(void *arg) cidx = rxq->ifr_fl[0].ifl_cidx; if (iflib_rxd_avail(ctx, rxq, cidx, 1)) GROUPTASK_ENQUEUE(gtask); - else + else { IFDI_RX_QUEUE_INTR_ENABLE(ctx, rxq->ifr_id); + DBG_COUNTER_INC(rx_intr_enables); + } return (FILTER_HANDLED); } @@ -2887,6 +2888,7 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, return (ENOMEM); } else { m_freem(*mp); + DBG_COUNTER_INC(tx_frees); *mp = m; } } @@ -2994,6 +2996,7 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, pi->ipi_ip_hlen = sizeof(struct ip6_hdr); if (__predict_false(m->m_len < pi->ipi_ehdrlen + sizeof(struct ip6_hdr))) { + txq->ift_pullups++; if (__predict_false((m = m_pullup(m, pi->ipi_ehdrlen + sizeof(struct ip6_hdr))) == NULL)) return (ENOMEM); } @@ -3041,34 +3044,6 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, return (0); } -static __noinline struct mbuf * -collapse_pkthdr(struct mbuf *m0) -{ - struct mbuf *m, *m_next, *tmp; - - m = m0; - m_next = m->m_next; - while (m_next != NULL && m_next->m_len == 0) { - m = m_next; - m->m_next = NULL; - m_free(m); - m_next = m_next->m_next; - } - m = m0; - m->m_next = m_next; - if (m_next == NULL) - return (m); - if ((m_next->m_flags & M_EXT) == 0) { - m = m_defrag(m, M_NOWAIT); - } else { - tmp = m_next->m_next; - memcpy(m_next, m, MPKTHSIZE); - m = m_next; - m->m_next = tmp; - } - return (m); -} - /* * If dodgy hardware rejects the scatter gather chain we've handed it * we'll need to remove the mbuf chain from ifsg_m[] before we can add the @@ -3117,8 +3092,7 @@ iflib_busdma_load_mbuf_sg(iflib_txq_t txq, bus_dma_tag /* * Please don't ever do this */ - if (__predict_false(m->m_len == 0)) - *m0 = collapse_pkthdr(m); + MPASS(__predict_true(m->m_len > 0)); ctx = txq->ift_ctx; sctx = ctx->ifc_sctx; @@ -3259,6 +3233,7 @@ iflib_ether_pad(device_t dev, struct mbuf **m_head, ui m_freem(*m_head); device_printf(dev, "cannot pad short frame, m_dup() failed"); DBG_COUNTER_INC(encap_pad_mbuf_fail); + DBG_COUNTER_INC(tx_frees); return ENOMEM; } m_freem(*m_head); @@ -3274,6 +3249,7 @@ iflib_ether_pad(device_t dev, struct mbuf **m_head, ui m_freem(*m_head); device_printf(dev, "cannot pad short frame\n"); DBG_COUNTER_INC(encap_pad_mbuf_fail); + DBG_COUNTER_INC(tx_frees); return (ENOBUFS); } @@ -3337,8 +3313,10 @@ iflib_encap(iflib_txq_t txq, struct mbuf **m_headp) if ((sctx->isc_flags & IFLIB_NEED_ETHER_PAD) && __predict_false(m_head->m_pkthdr.len < scctx->isc_min_frame_size)) { err = iflib_ether_pad(ctx->ifc_dev, m_headp, scctx->isc_min_frame_size); - if (err) + if (err) { + DBG_COUNTER_INC(encap_txd_encap_fail); return err; + } } m_head = *m_headp; @@ -3352,8 +3330,10 @@ iflib_encap(iflib_txq_t txq, struct mbuf **m_headp) /* deliberate bitwise OR to make one condition */ if (__predict_true((pi.ipi_csum_flags | pi.ipi_vtag))) { - if (__predict_false((err = iflib_parse_header(txq, &pi, m_headp)) != 0)) + if (__predict_false((err = iflib_parse_header(txq, &pi, m_headp)) != 0)) { + DBG_COUNTER_INC(encap_txd_encap_fail); return (err); + } m_head = *m_headp; } @@ -3370,12 +3350,13 @@ defrag: if (m_head == NULL) remap++; } - if (remap == 1) + if (remap == 1) { + txq->ift_mbuf_defrag++; m_head = m_defrag(*m_headp, M_NOWAIT); + } remap++; if (__predict_false(m_head == NULL)) goto defrag_failed; - txq->ift_mbuf_defrag++; *m_headp = m_head; goto retry; break; @@ -3391,6 +3372,7 @@ defrag: } txq->ift_map_failed++; DBG_COUNTER_INC(encap_load_mbuf_fail); + DBG_COUNTER_INC(encap_txd_encap_fail); return (err); } @@ -3404,6 +3386,7 @@ defrag: if (map != NULL) bus_dmamap_unload(desc_tag, map); DBG_COUNTER_INC(encap_txq_avail_fail); + DBG_COUNTER_INC(encap_txd_encap_fail); if ((txq->ift_task.gt_task.ta_flags & TASK_ENQUEUED) == 0) GROUPTASK_ENQUEUE(&txq->ift_task); return (ENOBUFS); @@ -3466,9 +3449,12 @@ defrag: goto defrag; } } - DBG_COUNTER_INC(encap_txd_encap_fail); goto defrag_failed; } + /* + * err can't possibly be non-zero here, so we don't neet to test it + * to see if we need to DBG_COUNTER_INC(encap_txd_encap_fail). + */ return (err); defrag_failed: @@ -3477,6 +3463,7 @@ defrag_failed: m_freem(*m_headp); DBG_COUNTER_INC(tx_frees); *m_headp = NULL; + DBG_COUNTER_INC(encap_txd_encap_fail); return (ENOMEM); } @@ -3676,12 +3663,10 @@ iflib_txq_drain(struct ifmp_ring *r, uint32_t cidx, ui in_use_prev = txq->ift_in_use; err = iflib_encap(txq, mp); if (__predict_false(err)) { - DBG_COUNTER_INC(txq_drain_encapfail); /* no room - bail out */ if (err == ENOBUFS) break; consumed++; - DBG_COUNTER_INC(txq_drain_encapfail); /* we can't send this packet - skip it */ continue; } @@ -3741,6 +3726,7 @@ iflib_txq_drain_free(struct ifmp_ring *r, uint32_t cid if (__predict_false(*mp == (struct mbuf *)txq)) continue; m_freem(*mp); + DBG_COUNTER_INC(tx_frees); } MPASS(ifmp_ring_is_stalled(r) == 0); return (avail); @@ -3987,6 +3973,7 @@ iflib_if_transmit(if_t ifp, struct mbuf *m) next = m->m_nextpkt; m->m_nextpkt = NULL; m_freem(m); + DBG_COUNTER_INC(tx_frees); m = next; } return (ENOBUFS); @@ -4029,6 +4016,7 @@ iflib_if_transmit(if_t ifp, struct mbuf *m) #endif ifmp_ring_check_drainage(txq->ift_br, TX_BATCH_SIZE); m_freem(m); + DBG_COUNTER_INC(tx_frees); } return (err); From owner-svn-src-head@freebsd.org Thu Sep 6 19:21:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE197FE0776; Thu, 6 Sep 2018 19:21:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 63A7286E8C; Thu, 6 Sep 2018 19:21:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5EAA911664; Thu, 6 Sep 2018 19:21:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w86JLWJp063641; Thu, 6 Sep 2018 19:21:32 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w86JLW2h063639; Thu, 6 Sep 2018 19:21:32 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201809061921.w86JLW2h063639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 6 Sep 2018 19:21:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338506 - in head: . sys/mips/conf X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: . sys/mips/conf X-SVN-Commit-Revision: 338506 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 06 Sep 2018 19:21:32 -0000 Author: jhb Date: Thu Sep 6 19:21:31 2018 New Revision: 338506 URL: https://svnweb.freebsd.org/changeset/base/338506 Log: Re-enable kernel modules for the MALTA64EL kernel configuration. Update the BOOTSTRAPPING check for libelf to require the fix for mips64el object files committed in r338478 and re-enable kernel modules in the MALTA64EL config file. Reviewed by: emaste Approved by: re (gjb) Differential Revision: https://reviews.freebsd.org/D17054 Modified: head/Makefile.inc1 head/sys/mips/conf/MALTA64EL Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Sep 6 18:51:52 2018 (r338505) +++ head/Makefile.inc1 Thu Sep 6 19:21:31 2018 (r338506) @@ -1933,7 +1933,8 @@ update: .PHONY # r296685 fix cross-endian objcopy # r310724 fixed PR 215350, a crash in libdwarf with objects built by GCC 6.2. # r334881 added libdwarf constants used by ctfconvert. -.if ${BOOTSTRAPPING} < 1200067 +# r338478 fixed a crash in objcopy for mips64el objects +.if ${BOOTSTRAPPING} < 1200084 _elftoolchain_libs= lib/libelf lib/libdwarf .endif Modified: head/sys/mips/conf/MALTA64EL ============================================================================== --- head/sys/mips/conf/MALTA64EL Thu Sep 6 18:51:52 2018 (r338505) +++ head/sys/mips/conf/MALTA64EL Thu Sep 6 19:21:31 2018 (r338506) @@ -9,5 +9,4 @@ include "std.MALTA" machine mips mips64el makeoptions ARCH_FLAGS="-march=mips64 -mabi=64" -makeoptions MODULES_OVERRIDE="" makeoptions KERNLOADADDR=0xffffffff80100000 From owner-svn-src-head@freebsd.org Thu Sep 6 19:28: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 EFDA4FE0CFD; Thu, 6 Sep 2018 19:28:54 +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 98CA288077; Thu, 6 Sep 2018 19:28:54 +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 8FF17116D7; Thu, 6 Sep 2018 19:28:54 +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 w86JSspT067809; Thu, 6 Sep 2018 19:28:54 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w86JSrSb067799; Thu, 6 Sep 2018 19:28:53 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201809061928.w86JSrSb067799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 6 Sep 2018 19:28:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338507 - in head/sys: sys vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: sys vm X-SVN-Commit-Revision: 338507 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 06 Sep 2018 19:28:55 -0000 Author: markj Date: Thu Sep 6 19:28:52 2018 New Revision: 338507 URL: https://svnweb.freebsd.org/changeset/base/338507 Log: Avoid resource deadlocks when one domain has exhausted its memory. Attempt other allowed domains if the requested domain is below the minimum paging threshold. Block in fork only if all domains available to the forking thread are below the severe threshold rather than any. Submitted by: jeff Reported by: mjg Reviewed by: alc, kib, markj Approved by: re (rgrimes) Differential Revision: https://reviews.freebsd.org/D16191 Modified: head/sys/sys/vmmeter.h head/sys/vm/vm_domainset.c head/sys/vm/vm_domainset.h head/sys/vm/vm_fault.c head/sys/vm/vm_glue.c head/sys/vm/vm_page.c head/sys/vm/vm_pageout.h Modified: head/sys/sys/vmmeter.h ============================================================================== --- head/sys/sys/vmmeter.h Thu Sep 6 19:21:31 2018 (r338506) +++ head/sys/sys/vmmeter.h Thu Sep 6 19:28:52 2018 (r338507) @@ -187,6 +187,13 @@ vm_page_count_severe(void) return (!DOMAINSET_EMPTY(&vm_severe_domains)); } +static inline int +vm_page_count_severe_set(domainset_t *mask) +{ + + return (DOMAINSET_SUBSET(&vm_severe_domains, mask)); +} + /* * Return TRUE if we are under our minimum low-free-pages threshold. * Modified: head/sys/vm/vm_domainset.c ============================================================================== --- head/sys/vm/vm_domainset.c Thu Sep 6 19:21:31 2018 (r338506) +++ head/sys/vm/vm_domainset.c Thu Sep 6 19:28:52 2018 (r338507) @@ -100,6 +100,8 @@ vm_domainset_iter_init(struct vm_domainset_iter *di, s pindex += (((uintptr_t)obj) / sizeof(*obj)); di->di_offset = pindex; } + /* Skip zones below min on the first pass. */ + di->di_minskip = true; } static void @@ -213,6 +215,8 @@ vm_domainset_iter_page_init(struct vm_domainset_iter * *req = (di->di_flags & ~(VM_ALLOC_WAITOK | VM_ALLOC_WAITFAIL)) | VM_ALLOC_NOWAIT; vm_domainset_iter_first(di, domain); + if (DOMAINSET_ISSET(*domain, &vm_min_domains)) + vm_domainset_iter_page(di, domain, req); } int @@ -227,8 +231,15 @@ vm_domainset_iter_page(struct vm_domainset_iter *di, i return (ENOMEM); /* If there are more domains to visit we run the iterator. */ - if (--di->di_n != 0) { + while (--di->di_n != 0) { vm_domainset_iter_next(di, domain); + if (!di->di_minskip || + !DOMAINSET_ISSET(*domain, &vm_min_domains)) + return (0); + } + if (di->di_minskip) { + di->di_minskip = false; + vm_domainset_iter_first(di, domain); return (0); } @@ -258,6 +269,8 @@ vm_domainset_iter_malloc_init(struct vm_domainset_iter di->di_flags = *flags; *flags = (di->di_flags & ~M_WAITOK) | M_NOWAIT; vm_domainset_iter_first(di, domain); + if (DOMAINSET_ISSET(*domain, &vm_min_domains)) + vm_domainset_iter_malloc(di, domain, flags); } int @@ -265,8 +278,17 @@ vm_domainset_iter_malloc(struct vm_domainset_iter *di, { /* If there are more domains to visit we run the iterator. */ - if (--di->di_n != 0) { + while (--di->di_n != 0) { vm_domainset_iter_next(di, domain); + if (!di->di_minskip || + !DOMAINSET_ISSET(*domain, &vm_min_domains)) + return (0); + } + + /* If we skipped zones below min start the search from the beginning. */ + if (di->di_minskip) { + di->di_minskip = false; + vm_domainset_iter_first(di, domain); return (0); } Modified: head/sys/vm/vm_domainset.h ============================================================================== --- head/sys/vm/vm_domainset.h Thu Sep 6 19:21:31 2018 (r338506) +++ head/sys/vm/vm_domainset.h Thu Sep 6 19:28:52 2018 (r338507) @@ -34,9 +34,10 @@ struct vm_domainset_iter { struct domainset *di_domain; int *di_iter; vm_pindex_t di_offset; - int di_policy; int di_flags; - int di_n; + uint16_t di_policy; + domainid_t di_n; + bool di_minskip; }; int vm_domainset_iter_page(struct vm_domainset_iter *, int *, int *); @@ -45,5 +46,7 @@ void vm_domainset_iter_page_init(struct vm_domainset_i int vm_domainset_iter_malloc(struct vm_domainset_iter *, int *, int *); void vm_domainset_iter_malloc_init(struct vm_domainset_iter *, struct vm_object *, int *, int *); + +void vm_wait_doms(const domainset_t *); #endif /* __VM_DOMAINSET_H__ */ Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Thu Sep 6 19:21:31 2018 (r338506) +++ head/sys/vm/vm_fault.c Thu Sep 6 19:28:52 2018 (r338507) @@ -548,6 +548,7 @@ vm_fault_hold(vm_map_t map, vm_offset_t vaddr, vm_prot { struct faultstate fs; struct vnode *vp; + struct domainset *dset; vm_object_t next_object, retry_object; vm_offset_t e_end, e_start; vm_pindex_t retry_pindex; @@ -791,7 +792,11 @@ RetryFault:; * there, and allocation can fail, causing * restart and new reading of the p_flag. */ - if (!vm_page_count_severe() || P_KILLED(curproc)) { + dset = fs.object->domain.dr_policy; + if (dset == NULL) + dset = curthread->td_domain.dr_policy; + if (!vm_page_count_severe_set(&dset->ds_mask) || + P_KILLED(curproc)) { #if VM_NRESERVLEVEL > 0 vm_object_color(fs.object, atop(vaddr) - fs.pindex); @@ -806,7 +811,7 @@ RetryFault:; } if (fs.m == NULL) { unlock_and_deallocate(&fs); - vm_waitpfault(); + vm_waitpfault(dset); goto RetryFault; } } Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Thu Sep 6 19:21:31 2018 (r338506) +++ head/sys/vm/vm_glue.c Thu Sep 6 19:28:52 2018 (r338507) @@ -92,6 +92,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -534,6 +535,7 @@ vm_forkproc(struct thread *td, struct proc *p2, struct struct vmspace *vm2, int flags) { struct proc *p1 = td->td_proc; + struct domainset *dset; int error; if ((flags & RFPROC) == 0) { @@ -557,9 +559,9 @@ vm_forkproc(struct thread *td, struct proc *p2, struct p2->p_vmspace = p1->p_vmspace; atomic_add_int(&p1->p_vmspace->vm_refcnt, 1); } - - while (vm_page_count_severe()) { - vm_wait_severe(); + dset = td2->td_domain.dr_policy; + while (vm_page_count_severe_set(&dset->ds_mask)) { + vm_wait_doms(&dset->ds_mask); } if ((flags & RFMEM) == 0) { Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Thu Sep 6 19:21:31 2018 (r338506) +++ head/sys/vm/vm_page.c Thu Sep 6 19:28:52 2018 (r338507) @@ -2935,7 +2935,7 @@ vm_wait_count(void) return (vm_severe_waiters + vm_min_waiters + vm_pageproc_waiters); } -static void +void vm_wait_doms(const domainset_t *wdoms) { @@ -2961,10 +2961,10 @@ vm_wait_doms(const domainset_t *wdoms) mtx_lock(&vm_domainset_lock); if (DOMAINSET_SUBSET(&vm_min_domains, wdoms)) { vm_min_waiters++; - msleep(&vm_min_domains, &vm_domainset_lock, PVM, - "vmwait", 0); - } - mtx_unlock(&vm_domainset_lock); + msleep(&vm_min_domains, &vm_domainset_lock, + PVM | PDROP, "vmwait", 0); + } else + mtx_unlock(&vm_domainset_lock); } } @@ -3069,15 +3069,21 @@ vm_domain_alloc_fail(struct vm_domain *vmd, vm_object_ * this balance without careful testing first. */ void -vm_waitpfault(void) +vm_waitpfault(struct domainset *dset) { + /* + * XXX Ideally we would wait only until the allocation could + * be satisfied. This condition can cause new allocators to + * consume all freed pages while old allocators wait. + */ mtx_lock(&vm_domainset_lock); - if (vm_page_count_min()) { + if (DOMAINSET_SUBSET(&vm_min_domains, &dset->ds_mask)) { vm_min_waiters++; - msleep(&vm_min_domains, &vm_domainset_lock, PUSER, "pfault", 0); - } - mtx_unlock(&vm_domainset_lock); + msleep(&vm_min_domains, &vm_domainset_lock, PUSER | PDROP, + "pfault", 0); + } else + mtx_unlock(&vm_domainset_lock); } struct vm_pagequeue * Modified: head/sys/vm/vm_pageout.h ============================================================================== --- head/sys/vm/vm_pageout.h Thu Sep 6 19:21:31 2018 (r338506) +++ head/sys/vm/vm_pageout.h Thu Sep 6 19:28:52 2018 (r338507) @@ -96,7 +96,7 @@ extern int vm_pageout_page_count; */ void vm_wait(vm_object_t obj); -void vm_waitpfault(void); +void vm_waitpfault(struct domainset *); void vm_wait_domain(int domain); void vm_wait_min(void); void vm_wait_severe(void); From owner-svn-src-head@freebsd.org Thu Sep 6 19:42: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 E115FFE3580; Thu, 6 Sep 2018 19:42:40 +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 96C4088F2F; Thu, 6 Sep 2018 19:42:40 +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 9181D11A44; Thu, 6 Sep 2018 19:42:40 +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 w86Jgeix078623; Thu, 6 Sep 2018 19:42:40 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w86JgeCr078622; Thu, 6 Sep 2018 19:42:40 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201809061942.w86JgeCr078622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 6 Sep 2018 19:42:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338508 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 338508 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 06 Sep 2018 19:42:41 -0000 Author: mjg Date: Thu Sep 6 19:42:40 2018 New Revision: 338508 URL: https://svnweb.freebsd.org/changeset/base/338508 Log: amd64: depessimize copyinstr_smap The stac/clac combo around each byte copy is causing a measurable slowdown in benchmarks. Do it only before and after all data is copied. While here reorder the code to avoid a forward branch in the common case. Note the copying loop (originating from copyinstr) is avoidably slow and will be fixed later. Reviewed by: kib Approved by: re (gjb) Differential Revision: https://reviews.freebsd.org/D17063 Modified: head/sys/amd64/amd64/support.S Modified: head/sys/amd64/amd64/support.S ============================================================================== --- head/sys/amd64/amd64/support.S Thu Sep 6 19:28:52 2018 (r338507) +++ head/sys/amd64/amd64/support.S Thu Sep 6 19:42:40 2018 (r338508) @@ -914,6 +914,8 @@ ENTRY(copyinstr_smap) subq %rsi,%rax jbe cpystrflt + stac + /* restrict maxlen to <= VM_MAXUSER_ADDRESS-from */ cmpq %rdx,%rax jae 1f @@ -924,32 +926,20 @@ ENTRY(copyinstr_smap) 2: decq %rdx - jz copyinstr_toolong + jz copyinstr_toolong_smap - stac lodsb stosb - clac orb %al,%al jnz 2b + clac + copyinstr_succ: /* Success -- 0 byte reached */ decq %rdx xorl %eax,%eax - jmp cpystrflt_x -copyinstr_toolong: - /* rdx is zero - return ENAMETOOLONG or EFAULT */ - movq $VM_MAXUSER_ADDRESS,%rax - cmpq %rax,%rsi - jae cpystrflt - movq $ENAMETOOLONG,%rax - jmp cpystrflt_x - /* Fault entry clears PSL.AC */ -cpystrflt: - movq $EFAULT,%rax - cpystrflt_x: /* set *lencopied and return %eax */ movq PCPU(CURPCB),%rcx @@ -962,6 +952,21 @@ cpystrflt_x: 1: POP_FRAME_POINTER ret + /* Fault entry clears PSL.AC */ +cpystrflt: + movq $EFAULT,%rax + jmp cpystrflt_x + +copyinstr_toolong_smap: + clac +copyinstr_toolong: + /* rdx is zero - return ENAMETOOLONG or EFAULT */ + movq $VM_MAXUSER_ADDRESS,%rax + cmpq %rax,%rsi + jae cpystrflt + movq $ENAMETOOLONG,%rax + jmp cpystrflt_x + END(copyinstr_smap) /* From owner-svn-src-head@freebsd.org Thu Sep 6 19:55: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 BD076FE406D; Thu, 6 Sep 2018 19:55:40 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7227A89BB6; Thu, 6 Sep 2018 19:55:40 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D26D11C1C; Thu, 6 Sep 2018 19:55:40 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w86Jte4f084002; Thu, 6 Sep 2018 19:55:40 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w86JteY6084001; Thu, 6 Sep 2018 19:55:40 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201809061955.w86JteY6084001@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 6 Sep 2018 19:55:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338509 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 338509 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 06 Sep 2018 19:55:40 -0000 Author: bz Date: Thu Sep 6 19:55:40 2018 New Revision: 338509 URL: https://svnweb.freebsd.org/changeset/base/338509 Log: The inp_lle field to struct inpcb, along with two "valid" flags for the rt and lle cache were added in r191129 (2009). To my best knowledge they have never been used and route caching has converted the inp_rt field from that commit to inp_route rendering this field and these flags obsolete. Convert the pointer into a spare pointer to not change the size of the structure anymore (and to have a spare pointer) and mark the two fields as unused. Reviewed by: markj, karels Approved by: re (gjb) Differential Revision: https://reviews.freebsd.org/D17062 Modified: head/sys/netinet/in_pcb.h Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Thu Sep 6 19:42:40 2018 (r338508) +++ head/sys/netinet/in_pcb.h Thu Sep 6 19:55:40 2018 (r338509) @@ -320,7 +320,7 @@ struct inpcb { CK_LIST_ENTRY(inpcb) inp_portlist; /* (i/h) */ struct inpcbport *inp_phd; /* (i/h) head of this list */ inp_gen_t inp_gencnt; /* (c) generation count */ - struct llentry *inp_lle; /* cached L2 information */ + void *spare_ptr; /* Spare pointer. */ rt_gen_t inp_rt_cookie; /* generation for route entry */ union { /* cached L3 information */ struct route inp_route; @@ -744,8 +744,8 @@ int inp_so_options(const struct inpcb *inp); /* * Flags for inp_flags2. */ -#define INP_LLE_VALID 0x00000001 /* cached lle is valid */ -#define INP_RT_VALID 0x00000002 /* cached rtentry is valid */ +#define INP_2UNUSED1 0x00000001 +#define INP_2UNUSED2 0x00000002 #define INP_PCBGROUPWILD 0x00000004 /* in pcbgroup wildcard list */ #define INP_REUSEPORT 0x00000008 /* SO_REUSEPORT option is set */ #define INP_FREED 0x00000010 /* inp itself is not valid */ From owner-svn-src-head@freebsd.org Thu Sep 6 20:02: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 54373FE44C7; Thu, 6 Sep 2018 20:02:20 +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 0B2848A2C5; Thu, 6 Sep 2018 20:02:20 +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 060D011DCA; Thu, 6 Sep 2018 20:02:20 +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 w86K2JmC089249; Thu, 6 Sep 2018 20:02:19 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w86K2Jdm089248; Thu, 6 Sep 2018 20:02:19 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201809062002.w86K2Jdm089248@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 6 Sep 2018 20:02:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338510 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 338510 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 06 Sep 2018 20:02:20 -0000 Author: markj Date: Thu Sep 6 20:02:19 2018 New Revision: 338510 URL: https://svnweb.freebsd.org/changeset/base/338510 Log: Use the correct terminology. Reported by: kib Approved by: re (gjb) Differential revision: https://reviews.freebsd.org/D16191 Modified: head/sys/vm/vm_domainset.c Modified: head/sys/vm/vm_domainset.c ============================================================================== --- head/sys/vm/vm_domainset.c Thu Sep 6 19:55:40 2018 (r338509) +++ head/sys/vm/vm_domainset.c Thu Sep 6 20:02:19 2018 (r338510) @@ -100,7 +100,7 @@ vm_domainset_iter_init(struct vm_domainset_iter *di, s pindex += (((uintptr_t)obj) / sizeof(*obj)); di->di_offset = pindex; } - /* Skip zones below min on the first pass. */ + /* Skip domains below min on the first pass. */ di->di_minskip = true; } @@ -285,7 +285,7 @@ vm_domainset_iter_malloc(struct vm_domainset_iter *di, return (0); } - /* If we skipped zones below min start the search from the beginning. */ + /* If we skipped domains below min restart the search. */ if (di->di_minskip) { di->di_minskip = false; vm_domainset_iter_first(di, domain); From owner-svn-src-head@freebsd.org Thu Sep 6 20:29: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 9D657FE4F26; Thu, 6 Sep 2018 20:29:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 540898B086; Thu, 6 Sep 2018 20:29:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4EDCF12123; Thu, 6 Sep 2018 20:29:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w86KTfBB001411; Thu, 6 Sep 2018 20:29:41 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w86KTfxJ001410; Thu, 6 Sep 2018 20:29:41 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201809062029.w86KTfxJ001410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 6 Sep 2018 20:29:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338511 - head/lib/libvmmapi X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/lib/libvmmapi X-SVN-Commit-Revision: 338511 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 06 Sep 2018 20:29:41 -0000 Author: jhb Date: Thu Sep 6 20:29:40 2018 New Revision: 338511 URL: https://svnweb.freebsd.org/changeset/base/338511 Log: bhyve: Use MAP_GUARD when mapping guest memory ranges. Instead of relying on PROT_NONE mappings with MAP_ANON, use MAP_GUARD to reserve address space around guest memory ranges including the guard ranges of address space around mappings. Submitted by: Shawn Webb Reviewed by: araujo Approved by: re (rgrimes) MFC after: 1 month Sponsored by: HardendBSD and G2, Inc Differential Revision: https://reviews.freebsd.org/D16822 Modified: head/lib/libvmmapi/vmmapi.c Modified: head/lib/libvmmapi/vmmapi.c ============================================================================== --- head/lib/libvmmapi/vmmapi.c Thu Sep 6 20:02:19 2018 (r338510) +++ head/lib/libvmmapi/vmmapi.c Thu Sep 6 20:29:40 2018 (r338511) @@ -362,7 +362,7 @@ vm_setup_memory(struct vmctx *ctx, size_t memsize, enu size_t objsize, len; vm_paddr_t gpa; char *baseaddr, *ptr; - int error, flags; + int error; assert(vms == VM_MMAP_ALL); @@ -389,8 +389,7 @@ vm_setup_memory(struct vmctx *ctx, size_t memsize, enu * and the adjoining guard regions. */ len = VM_MMAP_GUARD_SIZE + objsize + VM_MMAP_GUARD_SIZE; - flags = MAP_PRIVATE | MAP_ANON | MAP_NOCORE | MAP_ALIGNED_SUPER; - ptr = mmap(NULL, len, PROT_NONE, flags, -1, 0); + ptr = mmap(NULL, len, PROT_NONE, MAP_GUARD | MAP_ALIGNED_SUPER, -1, 0); if (ptr == MAP_FAILED) return (-1); @@ -492,8 +491,8 @@ vm_create_devmem(struct vmctx *ctx, int segid, const c * adjoining guard regions. */ len2 = VM_MMAP_GUARD_SIZE + len + VM_MMAP_GUARD_SIZE; - flags = MAP_PRIVATE | MAP_ANON | MAP_NOCORE | MAP_ALIGNED_SUPER; - base = mmap(NULL, len2, PROT_NONE, flags, -1, 0); + base = mmap(NULL, len2, PROT_NONE, MAP_GUARD | MAP_ALIGNED_SUPER, -1, + 0); if (base == MAP_FAILED) goto done; From owner-svn-src-head@freebsd.org Thu Sep 6 21:09: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 95768FE5C70; Thu, 6 Sep 2018 21:09:55 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C7428C354; Thu, 6 Sep 2018 21:09:55 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4770A127DC; Thu, 6 Sep 2018 21:09:55 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w86L9tme026093; Thu, 6 Sep 2018 21:09:55 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w86L9taP026092; Thu, 6 Sep 2018 21:09:55 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201809062109.w86L9taP026092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Thu, 6 Sep 2018 21:09:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338512 - head/sys/dev/sdhci X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/dev/sdhci X-SVN-Commit-Revision: 338512 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 06 Sep 2018 21:09:55 -0000 Author: marius Date: Thu Sep 6 21:09:54 2018 New Revision: 338512 URL: https://svnweb.freebsd.org/changeset/base/338512 Log: - Explicitly compare a pointer to NULL. The __builtin_expect() of clang 3.4.1 otherwise isn't able to cope with the expression. - Fix a nearby whitespace bug. Approved by: re (gjb, kib) Modified: head/sys/dev/sdhci/sdhci.c Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Thu Sep 6 20:29:40 2018 (r338511) +++ head/sys/dev/sdhci/sdhci.c Thu Sep 6 21:09:54 2018 (r338512) @@ -1575,11 +1575,10 @@ sdhci_set_transfer_mode(struct sdhci_slot *slot, struc #ifdef MMCCAM slot->ccb->mmcio.stop.opcode == MMC_STOP_TRANSMISSION && #else - slot->req->stop && + slot->req->stop != NULL && #endif !(slot->quirks & SDHCI_QUIRK_BROKEN_AUTO_STOP))) mode |= SDHCI_TRNS_ACMD12; - } if (data->flags & MMC_DATA_READ) mode |= SDHCI_TRNS_READ; From owner-svn-src-head@freebsd.org Thu Sep 6 21:24: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 31EAAFE639B; Thu, 6 Sep 2018 21:24:15 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DC65F8CC7A; Thu, 6 Sep 2018 21:24:14 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D748212B15; Thu, 6 Sep 2018 21:24:14 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w86LOEPL036021; Thu, 6 Sep 2018 21:24:14 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w86LOEoX036020; Thu, 6 Sep 2018 21:24:14 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201809062124.w86LOEoX036020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Thu, 6 Sep 2018 21:24:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338513 - head/sys/dev/mmc X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/dev/mmc X-SVN-Commit-Revision: 338513 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 06 Sep 2018 21:24:15 -0000 Author: marius Date: Thu Sep 6 21:24:14 2018 New Revision: 338513 URL: https://svnweb.freebsd.org/changeset/base/338513 Log: Avoid uninitialized read of ext_csd. Reported by: Coverity CID: 1395275 Approved by: re (gjb, kib) Modified: head/sys/dev/mmc/mmc.c Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Thu Sep 6 21:09:54 2018 (r338512) +++ head/sys/dev/mmc/mmc.c Thu Sep 6 21:24:14 2018 (r338513) @@ -1591,6 +1591,7 @@ mmc_discover_cards(struct mmc_softc *sc) int err, host_caps, i, newcard; uint32_t resp, sec_count, status; uint16_t rca = 2; + int16_t rev; uint8_t card_type; host_caps = mmcbr_get_caps(sc->dev); @@ -1779,6 +1780,7 @@ mmc_discover_cards(struct mmc_softc *sc) goto free_ivar; } + rev = -1; /* Only MMC >= 4.x devices support EXT_CSD. */ if (ivar->csd.spec_vers >= 4) { err = mmc_send_ext_csd(sc->dev, sc->dev, @@ -1789,6 +1791,7 @@ mmc_discover_cards(struct mmc_softc *sc) goto free_ivar; } ext_csd = ivar->raw_ext_csd; + rev = ext_csd[EXT_CSD_REV]; /* Handle extended capacity from EXT_CSD */ sec_count = le32dec(&ext_csd[EXT_CSD_SEC_CNT]); if (sec_count != 0) { @@ -1859,7 +1862,7 @@ mmc_discover_cards(struct mmc_softc *sc) * units of 10 ms), defaulting to 500 ms. */ ivar->cmd6_time = 500 * 1000; - if (ext_csd[EXT_CSD_REV] >= 6) + if (rev >= 6) ivar->cmd6_time = 10 * ext_csd[EXT_CSD_GEN_CMD6_TIME]; /* Handle HC erase sector size. */ @@ -1880,8 +1883,7 @@ mmc_discover_cards(struct mmc_softc *sc) } } - mmc_decode_cid_mmc(ivar->raw_cid, &ivar->cid, - ext_csd[EXT_CSD_REV] >= 5); + mmc_decode_cid_mmc(ivar->raw_cid, &ivar->cid, rev >= 5); child_common: for (quirk = &mmc_quirks[0]; quirk->mid != 0x0; quirk++) { From owner-svn-src-head@freebsd.org Thu Sep 6 23:28: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 47430FE9031; Thu, 6 Sep 2018 23:28:36 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E0754710DA; Thu, 6 Sep 2018 23:28:35 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D40DA13ECE; Thu, 6 Sep 2018 23:28:35 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w86NSZd2098833; Thu, 6 Sep 2018 23:28:35 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w86NSZO4098832; Thu, 6 Sep 2018 23:28:35 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201809062328.w86NSZO4098832@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Thu, 6 Sep 2018 23:28:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338517 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 338517 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 06 Sep 2018 23:28:36 -0000 Author: mckusick Date: Thu Sep 6 23:28:35 2018 New Revision: 338517 URL: https://svnweb.freebsd.org/changeset/base/338517 Log: The Call For Testing had no reports of operational problems and found that performance was no worse and usually better when running with TRIM consolidation. Performance improvement was most noticable when multiple large files are released in a short period of time. Thus, TRIM consolidation is being enabled by default. Should operational problems be found, it can be disabled using the command `sysctl vfs.ffs.dotrimcons=0'. This variable can also be set as a tunable if early disabling is necessary. Approved by: re (gjb) Sponsored by: Netflix Modified: head/sys/ufs/ffs/ffs_alloc.c Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Thu Sep 6 22:32:59 2018 (r338516) +++ head/sys/ufs/ffs/ffs_alloc.c Thu Sep 6 23:28:35 2018 (r338517) @@ -484,8 +484,8 @@ static int doreallocblks = 1; SYSCTL_INT(_vfs_ffs, OID_AUTO, doreallocblks, CTLFLAG_RW, &doreallocblks, 0, "enable block reallocation"); -static int dotrimcons = 0; -SYSCTL_INT(_vfs_ffs, OID_AUTO, dotrimcons, CTLFLAG_RW, &dotrimcons, 0, +static int dotrimcons = 1; +SYSCTL_INT(_vfs_ffs, OID_AUTO, dotrimcons, CTLFLAG_RWTUN, &dotrimcons, 0, "enable BIO_DELETE / TRIM consolidation"); static int maxclustersearch = 10; From owner-svn-src-head@freebsd.org Fri Sep 7 00:00: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 35EE6FE9C1A; Fri, 7 Sep 2018 00:00:32 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E1E5871E44; Fri, 7 Sep 2018 00:00:31 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DCDB6143BA; Fri, 7 Sep 2018 00:00:31 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w8700VeE014404; Fri, 7 Sep 2018 00:00:31 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w8700VCZ014403; Fri, 7 Sep 2018 00:00:31 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201809070000.w8700VCZ014403@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 7 Sep 2018 00:00:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338518 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 338518 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 07 Sep 2018 00:00:32 -0000 Author: gjb Date: Fri Sep 7 00:00:31 2018 New Revision: 338518 URL: https://svnweb.freebsd.org/changeset/base/338518 Log: Update head from ALPHA4 to ALPHA5 as part of the 12.0-RELEASE cycle. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Thu Sep 6 23:28:35 2018 (r338517) +++ head/sys/conf/newvers.sh Fri Sep 7 00:00:31 2018 (r338518) @@ -46,7 +46,7 @@ TYPE="FreeBSD" REVISION="12.0" -BRANCH="ALPHA4" +BRANCH="ALPHA5" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-head@freebsd.org Fri Sep 7 07:50: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 47AD1FF347F; Fri, 7 Sep 2018 07:50:38 +0000 (UTC) (envelope-from Alexander@leidinger.net) Received: from mailgate.Leidinger.net (bastille.leidinger.net [89.238.82.207]) (using TLSv1.2 with cipher DHE-RSA-CAMELLIA128-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DCACE7E996; Fri, 7 Sep 2018 07:50:37 +0000 (UTC) (envelope-from Alexander@leidinger.net) Date: Fri, 07 Sep 2018 09:50:10 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=leidinger.net; s=outgoing-alex; t=1536306629; bh=K2e+YbsWwDcKBPKELISWQ8/QvaxulAc9gMz6aFSfgLI=; h=Date:From:To:Cc:Subject:In-Reply-To; b=caEygB2N4l3Ykf++wFvNdh0r5teG8U2BGVvYVyNfydIbhxzOj3O5eipqopikBsy52 d31R2F3f7AgGUNZ5KiHXHVTQoAk5ZKW4Rvcl1lLuu9v5PUI8jboJqLlU0yaC+v4sOJ UBOykl+KrR0a3FMo2b48yo1JlpSeluDhZaXpt5yFyqOq/VEfiBvQM94EVhnpxBVLxc Ry0LDgzRJKD0T5knkgFkX/5Xh1aI4jzyw1a2+BGx8wni5iNWFIRX2A5gd4EUdIyEOx ztqSEIne8+ZhkpDHKTZTUa3sA6CYS3NM8UD1lnpEK/j5WyHM2BRdS99Y5t0YKHORdH OPirB6hTb9HLg== Message-ID: <20180907095010.Horde.LHANrMIgb7RjrRNYbtaBqYT@webmail.leidinger.net> From: Alexander Leidinger To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r338507 - in head/sys: sys vm In-Reply-To: <201809061928.w86JSrSb067799@repo.freebsd.org> User-Agent: Horde Application Framework 5 Accept-Language: de,en Content-Type: text/plain; charset=utf-8; format=flowed; DelSp=Yes MIME-Version: 1.0 Content-Disposition: inline X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 07 Sep 2018 07:50:38 -0000 Quoting Mark Johnston (from Thu, 6 Sep 2018 19:28:53 +0000 (UTC)): > Author: markj > Date: Thu Sep 6 19:28:52 2018 > New Revision: 338507 > URL: https://svnweb.freebsd.org/changeset/base/338507 > > Log: > Avoid resource deadlocks when one domain has exhausted its memory. Attempt > other allowed domains if the requested domain is below the minimum paging > threshold. Block in fork only if all domains available to the forking > thread are below the severe threshold rather than any. Could the problem you fixed manifest itself in e.g. a hanging system due to not enough memory free despite top displaying a lot of memory free (let's assume 2 memory domains and several gigs in both)? I have a system which never went below a specific amount of memory (before the fix of the no-rebalancing bug in the scheduler) if NUMA was enabled. With NUMA disabled I see much less memory free. I haven't tried NUMA after the fix of the scheduler, but would give it a try again if you think this could be a manifestation of the problem. Bye, Alexander. -- http://www.Leidinger.net Alexander@Leidinger.net: PGP 0x8F31830F9F2772BF http://www.FreeBSD.org netchild@FreeBSD.org : PGP 0x8F31830F9F2772BF From owner-svn-src-head@freebsd.org Fri Sep 7 14:37: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 E11E9FFC888; Fri, 7 Sep 2018 14:37:44 +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 920398BE00; Fri, 7 Sep 2018 14:37:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8644F1D2CB; Fri, 7 Sep 2018 14:37:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w87EbiWW062599; Fri, 7 Sep 2018 14:37:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w87Ebi0C062598; Fri, 7 Sep 2018 14:37:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201809071437.w87Ebi0C062598@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 7 Sep 2018 14:37:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338522 - head/sbin/sysctl X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sbin/sysctl X-SVN-Commit-Revision: 338522 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 07 Sep 2018 14:37:45 -0000 Author: kib Date: Fri Sep 7 14:37:44 2018 New Revision: 338522 URL: https://svnweb.freebsd.org/changeset/base/338522 Log: Trim whitespace. Approved by: re (gjb) Modified: head/sbin/sysctl/sysctl.c Modified: head/sbin/sysctl/sysctl.c ============================================================================== --- head/sbin/sysctl/sysctl.c Fri Sep 7 10:34:27 2018 (r338521) +++ head/sbin/sysctl/sysctl.c Fri Sep 7 14:37:44 2018 (r338522) @@ -717,7 +717,7 @@ S_efi_map(size_t l2, void *p) } efihdr = p; efisz = (sizeof(struct efi_map_header) + 0xf) & ~0xf; - map = (struct efi_md *)((uint8_t *)efihdr + efisz); + map = (struct efi_md *)((uint8_t *)efihdr + efisz); if (efihdr->descriptor_size == 0) return (0); @@ -725,7 +725,7 @@ S_efi_map(size_t l2, void *p) warnx("S_efi_map length mismatch %zu vs %zu", l2, efisz + efihdr->memory_size); return (1); - } + } ndesc = efihdr->memory_size / efihdr->descriptor_size; printf("\n%23s %12s %12s %8s %4s", From owner-svn-src-head@freebsd.org Fri Sep 7 15:09: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 32CEEFFD590; Fri, 7 Sep 2018 15:09:57 +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 DD3EC8D12F; Fri, 7 Sep 2018 15:09:56 +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 D82ED1D7A5; Fri, 7 Sep 2018 15:09:56 +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 w87F9uSb078086; Fri, 7 Sep 2018 15:09:56 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w87F9uEO078085; Fri, 7 Sep 2018 15:09:56 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201809071509.w87F9uEO078085@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 7 Sep 2018 15:09:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338523 - head/sbin/sysctl X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sbin/sysctl X-SVN-Commit-Revision: 338523 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 07 Sep 2018 15:09:57 -0000 Author: kib Date: Fri Sep 7 15:09:56 2018 New Revision: 338523 URL: https://svnweb.freebsd.org/changeset/base/338523 Log: Teach sysctl(8) about the Persistent memory type. Add PersistentMemory to the list of sysctl's known memory types when decoding an EFI memory map. Submitted by: D Scott Phillips MFC after: 1 week Approved by: re (rgrimes) Modified: head/sbin/sysctl/sysctl.c Modified: head/sbin/sysctl/sysctl.c ============================================================================== --- head/sbin/sysctl/sysctl.c Fri Sep 7 14:37:44 2018 (r338522) +++ head/sbin/sysctl/sysctl.c Fri Sep 7 15:09:56 2018 (r338523) @@ -704,7 +704,8 @@ S_efi_map(size_t l2, void *p) "ACPIMemoryNVS", "MemoryMappedIO", "MemoryMappedIOPortSpace", - "PalCode" + "PalCode", + "PersistentMemory" }; /* @@ -733,7 +734,7 @@ S_efi_map(size_t l2, void *p) for (i = 0; i < ndesc; i++, map = efi_next_descriptor(map, efihdr->descriptor_size)) { - if (map->md_type <= EFI_MD_TYPE_PALCODE) + if (map->md_type <= EFI_MD_TYPE_PERSISTENT) type = types[map->md_type]; else type = ""; From owner-svn-src-head@freebsd.org Fri Sep 7 15:48: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 3BE5FFFE1BB; Fri, 7 Sep 2018 15:48:02 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E60F78E4D5; Fri, 7 Sep 2018 15:48:01 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DC6AD1DE3E; Fri, 7 Sep 2018 15:48:01 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w87Fm1hD098875; Fri, 7 Sep 2018 15:48:01 GMT (envelope-from rgrimes@FreeBSD.org) Received: (from rgrimes@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w87Fm1j8098874; Fri, 7 Sep 2018 15:48:01 GMT (envelope-from rgrimes@FreeBSD.org) Message-Id: <201809071548.w87Fm1j8098874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rgrimes set sender to rgrimes@FreeBSD.org using -f From: "Rodney W. Grimes" Date: Fri, 7 Sep 2018 15:48:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338524 - head/tools/tools/build_option_survey X-SVN-Group: head X-SVN-Commit-Author: rgrimes X-SVN-Commit-Paths: head/tools/tools/build_option_survey X-SVN-Commit-Revision: 338524 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 07 Sep 2018 15:48:02 -0000 Author: rgrimes Date: Fri Sep 7 15:48:01 2018 New Revision: 338524 URL: https://svnweb.freebsd.org/changeset/base/338524 Log: Remove rsync to phk's server Submitted by: dexter Approved by: re(gjb), phk (mentor) MFC after: 3 days Modified: head/tools/tools/build_option_survey/mkhtml.sh Modified: head/tools/tools/build_option_survey/mkhtml.sh ============================================================================== --- head/tools/tools/build_option_survey/mkhtml.sh Fri Sep 7 15:09:56 2018 (r338523) +++ head/tools/tools/build_option_survey/mkhtml.sh Fri Sep 7 15:48:01 2018 (r338524) @@ -219,6 +219,3 @@ echo ' ' >> $H echo "" >> $H - -echo "rsync phk" -rsync -r $HDIR/. phk@phk:www/misc/build_options From owner-svn-src-head@freebsd.org Fri Sep 7 15:52: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 2C2F7FFE441; Fri, 7 Sep 2018 15:52:21 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D33848E90C; Fri, 7 Sep 2018 15:52:20 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE0221DFD4; Fri, 7 Sep 2018 15:52:20 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w87FqKsh003625; Fri, 7 Sep 2018 15:52:20 GMT (envelope-from rgrimes@FreeBSD.org) Received: (from rgrimes@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w87FqKt0003624; Fri, 7 Sep 2018 15:52:20 GMT (envelope-from rgrimes@FreeBSD.org) Message-Id: <201809071552.w87FqKt0003624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rgrimes set sender to rgrimes@FreeBSD.org using -f From: "Rodney W. Grimes" Date: Fri, 7 Sep 2018 15:52:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338525 - head/tools/tools/build_option_survey X-SVN-Group: head X-SVN-Commit-Author: rgrimes X-SVN-Commit-Paths: head/tools/tools/build_option_survey X-SVN-Commit-Revision: 338525 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 07 Sep 2018 15:52:21 -0000 Author: rgrimes Date: Fri Sep 7 15:52:20 2018 New Revision: 338525 URL: https://svnweb.freebsd.org/changeset/base/338525 Log: Increase size of working imgfile from 250MB to 4GB Submitted by: dexter Approved by: re(gjb), phk (mentor) MFC after: 3 days Modified: head/tools/tools/build_option_survey/option_survey.sh Modified: head/tools/tools/build_option_survey/option_survey.sh ============================================================================== --- head/tools/tools/build_option_survey/option_survey.sh Fri Sep 7 15:48:01 2018 (r338524) +++ head/tools/tools/build_option_survey/option_survey.sh Fri Sep 7 15:52:20 2018 (r338525) @@ -118,7 +118,7 @@ trap "umount ${MNT} || true; mdconfig -d -u $MDUNIT" 1 umount $MNT || true mdconfig -d -u $MDUNIT || true -dd if=/dev/zero of=${ODIR}/imgfile bs=1m count=250 +dd if=/dev/zero of=${ODIR}/imgfile bs=1m count=4096 mdconfig -a -t vnode -f ${ODIR}/imgfile -u $MDUNIT # Build & install the reference world From owner-svn-src-head@freebsd.org Fri Sep 7 15:52: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 B2DDFFFE468; Fri, 7 Sep 2018 15:52:32 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DBC6C8EA1F; Fri, 7 Sep 2018 15:52:31 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pf1-x432.google.com with SMTP id j8-v6so7220029pff.6; Fri, 07 Sep 2018 08:52:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=DUggq7dELOtCB5Jdr44+73kgvTHUNyIZ+3kIuenALOU=; b=Idm4M/JQR6d3hFUwNwQj0+hVoDJctfS82ob7O1amreNv1jgo7jQyFVtWzQeqTjjbdP VOkKF1b2oS0lg7kj2PuUuT3/8ekSZJ02rcK6uu/Fkb7uikpHR8KEZClAA7zzRxUCTnp9 /Df4NpGN34YfBvQy/Ogsa5hU8tznMusxUm3i5NtjH/aI+GjSDdcqUQ+SNfNw0vAE8htK YiiO/vLd1Z90sMI0jSPxksFZhR5lFecrYbSxWEW8JEk3gOmuhxteMYMMzN1BMjs6aEKG txmhh4F8uTVQgU5G4AkMv++kuMpaiWV4J3405PC/8Mb+8E9xzed+vE16Dp4JyK3er0qw XSpw== 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=DUggq7dELOtCB5Jdr44+73kgvTHUNyIZ+3kIuenALOU=; b=txb7V5U/V99YZT30B1muvrmtlde/MMFIzkLKe+tcVhU4nR7mAvy9uTGQIF4c9BL728 4oeQhFntKp3xHTFWhosJVhOHQdiB9vs3gjnX0az/hnj0347RaFWWUFNj5hGRCjW+qpEB ug3SUYukXZwJkD/Pf80cvbACrmvG+ZrXIe61NkqT6QOVINwprWGPv6uFAZbJVGutu02F CT+Mj4ppoqpdyAiH++qe1FnUgVAY/8IA77an5jc9VoX9h77j+JwcPT1gDPVFmZap13l7 LEQODVKdQwfpKQjZ0ZBd863OGWORoDEf7t1nvUovCqI7Mik92biLBdrnVgNlaRg69LAV urQA== X-Gm-Message-State: APzg51B4e21Igq2KEJ3CHzoEqzXnWG1YOWYj8KtDQdLsS9eUxxx9oah9 6ek5nP19SbDZk0PdaZeN4vbi0Lkl X-Google-Smtp-Source: ANB0VdaNJ7PHRY+BkawTnr08HN1Z39+57X49xxLx0l4WZpMF0fzYtqAOFoWfcW0yMOeqCRNlun6m5A== X-Received: by 2002:a62:9bc9:: with SMTP id e70-v6mr9018464pfk.95.1536335550509; Fri, 07 Sep 2018 08:52:30 -0700 (PDT) Received: from raichu (toroon0560w-lp130-09-70-52-224-239.dsl.bell.ca. [70.52.224.239]) by smtp.gmail.com with ESMTPSA id g25-v6sm16850043pfd.23.2018.09.07.08.52.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Sep 2018 08:52:29 -0700 (PDT) Sender: Mark Johnston Date: Fri, 7 Sep 2018 11:52:24 -0400 From: Mark Johnston To: Alexander Leidinger Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r338507 - in head/sys: sys vm Message-ID: <20180907155224.GA63224@raichu> References: <201809061928.w86JSrSb067799@repo.freebsd.org> <20180907095010.Horde.LHANrMIgb7RjrRNYbtaBqYT@webmail.leidinger.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180907095010.Horde.LHANrMIgb7RjrRNYbtaBqYT@webmail.leidinger.net> User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 07 Sep 2018 15:52:32 -0000 On Fri, Sep 07, 2018 at 09:50:10AM +0200, Alexander Leidinger wrote: > Quoting Mark Johnston (from Thu, 6 Sep 2018 > 19:28:53 +0000 (UTC)): > > > Author: markj > > Date: Thu Sep 6 19:28:52 2018 > > New Revision: 338507 > > URL: https://svnweb.freebsd.org/changeset/base/338507 > > > > Log: > > Avoid resource deadlocks when one domain has exhausted its memory. Attempt > > other allowed domains if the requested domain is below the minimum paging > > threshold. Block in fork only if all domains available to the forking > > thread are below the severe threshold rather than any. > > Could the problem you fixed manifest itself in e.g. a hanging system > due to not enough memory free despite top displaying a lot of memory > free (let's assume 2 memory domains and several gigs in both)? Yes. > I have a system which never went below a specific amount of memory > (before the fix of the no-rebalancing bug in the scheduler) if NUMA > was enabled. With NUMA disabled I see much less memory free. I haven't > tried NUMA after the fix of the scheduler, but would give it a try > again if you think this could be a manifestation of the problem. I think it's worth trying again. From owner-svn-src-head@freebsd.org Fri Sep 7 16:00: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 B77D5FFE70F; Fri, 7 Sep 2018 16:00:25 +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 1DB4C8EDEC; Fri, 7 Sep 2018 16:00:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id D675410AFD2; Fri, 7 Sep 2018 12:00:21 -0400 (EDT) Subject: Re: svn commit: r338523 - head/sbin/sysctl To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201809071509.w87F9uEO078085@repo.freebsd.org> From: John Baldwin Message-ID: <8beb57f9-37dc-735c-fa85-78ecb67679ad@FreeBSD.org> Date: Fri, 7 Sep 2018 09:00:20 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <201809071509.w87F9uEO078085@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 07 Sep 2018 12:00:22 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 07 Sep 2018 16:00:25 -0000 On 9/7/18 8:09 AM, Konstantin Belousov wrote: > Author: kib > Date: Fri Sep 7 15:09:56 2018 > New Revision: 338523 > URL: https://svnweb.freebsd.org/changeset/base/338523 > > Log: > Teach sysctl(8) about the Persistent memory type. > > Add PersistentMemory to the list of sysctl's known memory types > when decoding an EFI memory map. > > Submitted by: D Scott Phillips > MFC after: 1 week > Approved by: re (rgrimes) > > Modified: > head/sbin/sysctl/sysctl.c > > Modified: head/sbin/sysctl/sysctl.c > ============================================================================== > --- head/sbin/sysctl/sysctl.c Fri Sep 7 14:37:44 2018 (r338522) > +++ head/sbin/sysctl/sysctl.c Fri Sep 7 15:09:56 2018 (r338523) > @@ -704,7 +704,8 @@ S_efi_map(size_t l2, void *p) > "ACPIMemoryNVS", > "MemoryMappedIO", > "MemoryMappedIOPortSpace", > - "PalCode" > + "PalCode", > + "PersistentMemory" > }; > > /* > @@ -733,7 +734,7 @@ S_efi_map(size_t l2, void *p) > > for (i = 0; i < ndesc; i++, > map = efi_next_descriptor(map, efihdr->descriptor_size)) { > - if (map->md_type <= EFI_MD_TYPE_PALCODE) > + if (map->md_type <= EFI_MD_TYPE_PERSISTENT) Perhaps this should use nitems(types) instead? (And I believe it's my fault it didn't originally.) -- John Baldwin                                                                              From owner-svn-src-head@freebsd.org Fri Sep 7 16:26: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 63552FFF151; Fri, 7 Sep 2018 16:26:20 +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 E20A98FE73; Fri, 7 Sep 2018 16:26:19 +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 w87GQ9Db057171 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 7 Sep 2018 19:26:12 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w87GQ9Db057171 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w87GQ8xt057170; Fri, 7 Sep 2018 19:26:08 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 7 Sep 2018 19:26:08 +0300 From: Konstantin Belousov To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r338523 - head/sbin/sysctl Message-ID: <20180907162608.GV3161@kib.kiev.ua> References: <201809071509.w87F9uEO078085@repo.freebsd.org> <8beb57f9-37dc-735c-fa85-78ecb67679ad@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8beb57f9-37dc-735c-fa85-78ecb67679ad@FreeBSD.org> User-Agent: Mutt/1.10.1 (2018-07-13) 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.27 Precedence: list List-Id: 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, 07 Sep 2018 16:26:20 -0000 On Fri, Sep 07, 2018 at 09:00:20AM -0700, John Baldwin wrote: > On 9/7/18 8:09 AM, Konstantin Belousov wrote: > > Author: kib > > Date: Fri Sep 7 15:09:56 2018 > > New Revision: 338523 > > URL: https://svnweb.freebsd.org/changeset/base/338523 > > > > Log: > > Teach sysctl(8) about the Persistent memory type. > > > > Add PersistentMemory to the list of sysctl's known memory types > > when decoding an EFI memory map. > > > > Submitted by: D Scott Phillips > > MFC after: 1 week > > Approved by: re (rgrimes) > > > > Modified: > > head/sbin/sysctl/sysctl.c > > > > Modified: head/sbin/sysctl/sysctl.c > > ============================================================================== > > --- head/sbin/sysctl/sysctl.c Fri Sep 7 14:37:44 2018 (r338522) > > +++ head/sbin/sysctl/sysctl.c Fri Sep 7 15:09:56 2018 (r338523) > > @@ -704,7 +704,8 @@ S_efi_map(size_t l2, void *p) > > "ACPIMemoryNVS", > > "MemoryMappedIO", > > "MemoryMappedIOPortSpace", > > - "PalCode" > > + "PalCode", > > + "PersistentMemory" > > }; > > > > /* > > @@ -733,7 +734,7 @@ S_efi_map(size_t l2, void *p) > > > > for (i = 0; i < ndesc; i++, > > map = efi_next_descriptor(map, efihdr->descriptor_size)) { > > - if (map->md_type <= EFI_MD_TYPE_PALCODE) > > + if (map->md_type <= EFI_MD_TYPE_PERSISTENT) > > Perhaps this should use nitems(types) instead? (And I believe it's my > fault it didn't originally.) For me, it was more an issue that the code assumes contiguous values for the EFI_MD_TYPEs constants. What about the following: diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index 427f3e2309b..3a7463ef411 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -691,21 +691,21 @@ S_efi_map(size_t l2, void *p) int ndesc, i; static const char *types[] = { - "Reserved", - "LoaderCode", - "LoaderData", - "BootServicesCode", - "BootServicesData", - "RuntimeServicesCode", - "RuntimeServicesData", - "ConventionalMemory", - "UnusableMemory", - "ACPIReclaimMemory", - "ACPIMemoryNVS", - "MemoryMappedIO", - "MemoryMappedIOPortSpace", - "PalCode", - "PersistentMemory" + [EFI_MD_TYPE_NULL] = "Reserved", + [EFI_MD_TYPE_CODE] = "LoaderCode", + [EFI_MD_TYPE_DATA] = "LoaderData", + [EFI_MD_TYPE_BS_CODE] = "BootServicesCode", + [EFI_MD_TYPE_BS_DATA] = "BootServicesData", + [EFI_MD_TYPE_RT_CODE] = "RuntimeServicesCode", + [EFI_MD_TYPE_RT_DATA] = "RuntimeServicesData", + [EFI_MD_TYPE_FREE] = "ConventionalMemory", + [EFI_MD_TYPE_BAD] = "UnusableMemory", + [EFI_MD_TYPE_RECLAIM] = "ACPIReclaimMemory", + [EFI_MD_TYPE_FIRMWARE] = "ACPIMemoryNVS", + [EFI_MD_TYPE_IOMEM] = "MemoryMappedIO", + [EFI_MD_TYPE_IOPORT] = "MemoryMappedIOPortSpace", + [EFI_MD_TYPE_PALCODE] = "PalCode", + [EFI_MD_TYPE_PERSISTENT] = "PersistentMemory", }; /* @@ -734,9 +734,10 @@ S_efi_map(size_t l2, void *p) for (i = 0; i < ndesc; i++, map = efi_next_descriptor(map, efihdr->descriptor_size)) { - if (map->md_type <= EFI_MD_TYPE_PERSISTENT) + type = NULL; + if (map->md_type < nitems(types)) type = types[map->md_type]; - else + if (type == NULL) type = ""; printf("\n%23s %012jx %12p %08jx ", type, (uintmax_t)map->md_phys, map->md_virt, From owner-svn-src-head@freebsd.org Fri Sep 7 18:05: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 1FE5F1007E1D; Fri, 7 Sep 2018 18:05:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C8F4572CBE; Fri, 7 Sep 2018 18:05:10 +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 BFCE91F569; Fri, 7 Sep 2018 18:05:10 +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 w87I5AT3071435; Fri, 7 Sep 2018 18:05:10 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w87I5AxD071432; Fri, 7 Sep 2018 18:05:10 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201809071805.w87I5AxD071432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 7 Sep 2018 18:05:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338526 - in head/sys/ofed/drivers/infiniband: core ulp/ipoib X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/ofed/drivers/infiniband: core ulp/ipoib X-SVN-Commit-Revision: 338526 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 07 Sep 2018 18:05:11 -0000 Author: hselasky Date: Fri Sep 7 18:05:09 2018 New Revision: 338526 URL: https://svnweb.freebsd.org/changeset/base/338526 Log: Implement get network interface by params function in ipoib. Also fix the validate_ipv4_net_dev() and validate_ipv6_net_dev() functions which had source and destination addresses swapped, and didn't set the scope ID for IPv6 link-local addresses. This allows applications like krping to work using IPoIB devices. MFC after: 3 days Approved by: re (gjb) Sponsored by: Mellanox Technologies Modified: head/sys/ofed/drivers/infiniband/core/ib_cma.c head/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Modified: head/sys/ofed/drivers/infiniband/core/ib_cma.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_cma.c Fri Sep 7 15:52:20 2018 (r338525) +++ head/sys/ofed/drivers/infiniband/core/ib_cma.c Fri Sep 7 18:05:09 2018 (r338526) @@ -1263,10 +1263,10 @@ static bool validate_ipv4_net_dev(struct net_device *n const struct sockaddr_in *src_addr) { #ifdef INET - struct sockaddr_in dst_tmp = *dst_addr; + struct sockaddr_in src_tmp = *src_addr; __be32 daddr = dst_addr->sin_addr.s_addr, saddr = src_addr->sin_addr.s_addr; - struct net_device *src_dev; + struct net_device *dst_dev; struct rtentry *rte; bool ret; @@ -1276,29 +1276,29 @@ static bool validate_ipv4_net_dev(struct net_device *n ipv4_is_loopback(saddr)) return false; - src_dev = ip_dev_find(net_dev->if_vnet, saddr); - if (src_dev != net_dev) { - if (src_dev != NULL) - dev_put(src_dev); + dst_dev = ip_dev_find(net_dev->if_vnet, daddr); + if (dst_dev != net_dev) { + if (dst_dev != NULL) + dev_put(dst_dev); return false; } - dev_put(src_dev); + dev_put(dst_dev); /* * Make sure the socket address length field * is set, else rtalloc1() will fail. */ - dst_tmp.sin_len = sizeof(dst_tmp); + src_tmp.sin_len = sizeof(src_tmp); CURVNET_SET(net_dev->if_vnet); - rte = rtalloc1((struct sockaddr *)&dst_tmp, 1, 0); - CURVNET_RESTORE(); + rte = rtalloc1((struct sockaddr *)&src_tmp, 1, 0); if (rte != NULL) { ret = (rte->rt_ifp == net_dev); RTFREE_LOCKED(rte); } else { ret = false; } + CURVNET_RESTORE(); return ret; #else return false; @@ -1310,31 +1310,42 @@ static bool validate_ipv6_net_dev(struct net_device *n const struct sockaddr_in6 *src_addr) { #ifdef INET6 - struct sockaddr_in6 dst_tmp = *dst_addr; - struct in6_addr in6_addr = src_addr->sin6_addr; - struct net_device *src_dev; + struct sockaddr_in6 src_tmp = *src_addr; + struct in6_addr in6_addr = dst_addr->sin6_addr; + struct net_device *dst_dev; struct rtentry *rte; bool ret; - src_dev = ip6_dev_find(net_dev->if_vnet, in6_addr); - if (src_dev != net_dev) + dst_dev = ip6_dev_find(net_dev->if_vnet, in6_addr); + if (dst_dev != net_dev) { + if (dst_dev != NULL) + dev_put(dst_dev); return false; + } + CURVNET_SET(net_dev->if_vnet); + /* * Make sure the socket address length field * is set, else rtalloc1() will fail. */ - dst_tmp.sin6_len = sizeof(dst_tmp); + src_tmp.sin6_len = sizeof(src_tmp); - CURVNET_SET(net_dev->if_vnet); - rte = rtalloc1((struct sockaddr *)&dst_tmp, 1, 0); - CURVNET_RESTORE(); + /* + * Make sure the scope ID gets embedded, else rtalloc1() will + * resolve to the loopback interface. + */ + src_tmp.sin6_scope_id = net_dev->if_index; + sa6_embedscope(&src_tmp, 0); + + rte = rtalloc1((struct sockaddr *)&src_tmp, 1, 0); if (rte != NULL) { ret = (rte->rt_ifp == net_dev); RTFREE_LOCKED(rte); } else { ret = false; } + CURVNET_RESTORE(); return ret; #else return false; Modified: head/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c Fri Sep 7 15:52:20 2018 (r338525) +++ head/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c Fri Sep 7 18:05:09 2018 (r338526) @@ -149,16 +149,6 @@ roce_gid_enum_netdev_default(struct ib_device *ib_dev, return (hweight_long(gid_type_mask)); } -#define ETH_IPOIB_DRV_NAME "ib" - -static inline int -is_eth_ipoib_intf(struct net_device *dev) -{ - if (strcmp(dev->if_dname, ETH_IPOIB_DRV_NAME)) - return 0; - return 1; -} - static void roce_gid_update_addr_callback(struct ib_device *device, u8 port, struct net_device *ndev, void *cookie) @@ -322,15 +312,15 @@ roce_gid_queue_scan_event(struct net_device *ndev) struct roce_netdev_event_work *work; retry: - if (is_eth_ipoib_intf(ndev)) - return; - - if (ndev->if_type != IFT_ETHER) { - if (ndev->if_type == IFT_L2VLAN) { - ndev = rdma_vlan_dev_real_dev(ndev); - if (ndev != NULL) - goto retry; - } + switch (ndev->if_type) { + case IFT_ETHER: + break; + case IFT_L2VLAN: + ndev = rdma_vlan_dev_real_dev(ndev); + if (ndev != NULL) + goto retry; + /* FALLTHROUGH */ + default: return; } Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Fri Sep 7 15:52:20 2018 (r338525) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Fri Sep 7 18:05:09 2018 (r338526) @@ -54,6 +54,8 @@ static int ipoib_resolvemulti(struct ifnet *, struct s #include #include +#include + MODULE_AUTHOR("Roland Dreier"); MODULE_DESCRIPTION("IP-over-InfiniBand net driver"); MODULE_LICENSE("Dual BSD/GPL"); @@ -90,6 +92,10 @@ struct ib_sa_client ipoib_sa_client; static void ipoib_add_one(struct ib_device *device); static void ipoib_remove_one(struct ib_device *device, void *client_data); +static struct net_device *ipoib_get_net_dev_by_params( + struct ib_device *dev, u8 port, u16 pkey, + const union ib_gid *gid, const struct sockaddr *addr, + void *client_data); static void ipoib_start(struct ifnet *dev); static int ipoib_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, struct route *ro); @@ -163,7 +169,8 @@ ipoib_mtap_proto(struct ifnet *ifp, struct mbuf *mb, u static struct ib_client ipoib_client = { .name = "ipoib", .add = ipoib_add_one, - .remove = ipoib_remove_one + .remove = ipoib_remove_one, + .get_net_dev_by_params = ipoib_get_net_dev_by_params, }; int @@ -1111,6 +1118,156 @@ ipoib_remove_one(struct ib_device *device, void *clien } kfree(dev_list); +} + +static int +ipoib_match_dev_addr(const struct sockaddr *addr, struct net_device *dev) +{ + struct ifaddr *ifa; + int retval = 0; + + CURVNET_SET(dev->if_vnet); + IF_ADDR_RLOCK(dev); + CK_STAILQ_FOREACH(ifa, &dev->if_addrhead, ifa_link) { + if (ifa->ifa_addr == NULL || + ifa->ifa_addr->sa_family != addr->sa_family || + ifa->ifa_addr->sa_len != addr->sa_len) { + continue; + } + if (memcmp(ifa->ifa_addr, addr, addr->sa_len) == 0) { + retval = 1; + break; + } + } + IF_ADDR_RUNLOCK(dev); + CURVNET_RESTORE(); + + return (retval); +} + +/* + * ipoib_match_gid_pkey_addr - returns the number of IPoIB netdevs on + * top a given ipoib device matching a pkey_index and address, if one + * exists. + * + * @found_net_dev: contains a matching net_device if the return value + * >= 1, with a reference held. + */ +static int +ipoib_match_gid_pkey_addr(struct ipoib_dev_priv *priv, + const union ib_gid *gid, u16 pkey_index, const struct sockaddr *addr, + struct net_device **found_net_dev) +{ + struct ipoib_dev_priv *child_priv; + int matches = 0; + + if (priv->pkey_index == pkey_index && + (!gid || !memcmp(gid, &priv->local_gid, sizeof(*gid)))) { + if (addr == NULL || ipoib_match_dev_addr(addr, priv->dev) != 0) { + if (*found_net_dev == NULL) { + struct net_device *net_dev; + + if (priv->parent != NULL) + net_dev = priv->parent; + else + net_dev = priv->dev; + *found_net_dev = net_dev; + dev_hold(net_dev); + } + matches++; + } + } + + /* Check child interfaces */ + mutex_lock(&priv->vlan_mutex); + list_for_each_entry(child_priv, &priv->child_intfs, list) { + matches += ipoib_match_gid_pkey_addr(child_priv, gid, + pkey_index, addr, found_net_dev); + if (matches > 1) + break; + } + mutex_unlock(&priv->vlan_mutex); + + return matches; +} + +/* + * __ipoib_get_net_dev_by_params - returns the number of matching + * net_devs found (between 0 and 2). Also return the matching + * net_device in the @net_dev parameter, holding a reference to the + * net_device, if the number of matches >= 1 + */ +static int +__ipoib_get_net_dev_by_params(struct list_head *dev_list, u8 port, + u16 pkey_index, const union ib_gid *gid, + const struct sockaddr *addr, struct net_device **net_dev) +{ + struct ipoib_dev_priv *priv; + int matches = 0; + + *net_dev = NULL; + + list_for_each_entry(priv, dev_list, list) { + if (priv->port != port) + continue; + + matches += ipoib_match_gid_pkey_addr(priv, gid, pkey_index, + addr, net_dev); + + if (matches > 1) + break; + } + + return matches; +} + +static struct net_device * +ipoib_get_net_dev_by_params(struct ib_device *dev, u8 port, u16 pkey, + const union ib_gid *gid, const struct sockaddr *addr, void *client_data) +{ + struct net_device *net_dev; + struct list_head *dev_list = client_data; + u16 pkey_index; + int matches; + int ret; + + if (!rdma_protocol_ib(dev, port)) + return NULL; + + ret = ib_find_cached_pkey(dev, port, pkey, &pkey_index); + if (ret) + return NULL; + + if (!dev_list) + return NULL; + + /* See if we can find a unique device matching the L2 parameters */ + matches = __ipoib_get_net_dev_by_params(dev_list, port, pkey_index, + gid, NULL, &net_dev); + + switch (matches) { + case 0: + return NULL; + case 1: + return net_dev; + } + + dev_put(net_dev); + + /* Couldn't find a unique device with L2 parameters only. Use L3 + * address to uniquely match the net device */ + matches = __ipoib_get_net_dev_by_params(dev_list, port, pkey_index, + gid, addr, &net_dev); + switch (matches) { + case 0: + return NULL; + default: + dev_warn_ratelimited(&dev->dev, + "duplicate IP address detected\n"); + /* Fall through */ + case 1: + return net_dev; + } } static void From owner-svn-src-head@freebsd.org Fri Sep 7 21:11: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 DE49D106C41B; Fri, 7 Sep 2018 21:11: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 94B3F778E0; Fri, 7 Sep 2018 21:11: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 8FA99213DB; Fri, 7 Sep 2018 21:11: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 w87LBfcu066420; Fri, 7 Sep 2018 21:11:41 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w87LBfpJ066419; Fri, 7 Sep 2018 21:11:41 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201809072111.w87LBfpJ066419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 7 Sep 2018 21:11:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338527 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 338527 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 07 Sep 2018 21:11:42 -0000 Author: markj Date: Fri Sep 7 21:11:41 2018 New Revision: 338527 URL: https://svnweb.freebsd.org/changeset/base/338527 Log: Use ratecheck(9) in in_pcbinslbgrouphash(). Reviewed by: bz, Johannes Lundberg Approved by: re (kib) Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D17065 Modified: head/sys/netinet/in_pcb.c Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Fri Sep 7 18:05:09 2018 (r338526) +++ head/sys/netinet/in_pcb.c Fri Sep 7 21:11:41 2018 (r338527) @@ -301,13 +301,14 @@ in_pcblbgroup_reorder(struct inpcblbgrouphead *hdr, st static int in_pcbinslbgrouphash(struct inpcb *inp) { + const static struct timeval interval = { 60, 0 }; + static struct timeval lastprint; struct inpcbinfo *pcbinfo; struct inpcblbgrouphead *hdr; struct inpcblbgroup *grp; uint16_t hashmask, lport; uint32_t group_index; struct ucred *cred; - static int limit_logged = 0; pcbinfo = inp->inp_pcbinfo; @@ -364,11 +365,9 @@ in_pcbinslbgrouphash(struct inpcb *inp) return (ENOBUFS); } else if (grp->il_inpcnt == grp->il_inpsiz) { if (grp->il_inpsiz >= INPCBLBGROUP_SIZMAX) { - if (!limit_logged) { - limit_logged = 1; + if (ratecheck(&lastprint, &interval)) printf("lb group port %d, limit reached\n", ntohs(grp->il_lport)); - } return (0); } From owner-svn-src-head@freebsd.org Fri Sep 7 21:12: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 556F6106C641; Fri, 7 Sep 2018 21:12:38 +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 0BB6C77C1B; Fri, 7 Sep 2018 21:12:38 +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 06B9821447; Fri, 7 Sep 2018 21:12:38 +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 w87LCbVq068323; Fri, 7 Sep 2018 21:12:37 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w87LCbZr068322; Fri, 7 Sep 2018 21:12:37 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201809072112.w87LCbZr068322@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 7 Sep 2018 21:12:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338528 - head/sys/dev/intel X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/intel X-SVN-Commit-Revision: 338528 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 07 Sep 2018 21:12:38 -0000 Author: markj Date: Fri Sep 7 21:12:37 2018 New Revision: 338528 URL: https://svnweb.freebsd.org/changeset/base/338528 Log: Specify the correct resource type in teardown paths. Submitted by: Yuri Pankov Approved by: re (kib) MFC after: 1 week Modified: head/sys/dev/intel/spi.c Modified: head/sys/dev/intel/spi.c ============================================================================== --- head/sys/dev/intel/spi.c Fri Sep 7 21:11:41 2018 (r338527) +++ head/sys/dev/intel/spi.c Fri Sep 7 21:12:37 2018 (r338528) @@ -480,7 +480,7 @@ error: sc->sc_mem_rid, sc->sc_mem_res); if (sc->sc_irq_res != NULL) - bus_release_resource(dev, SYS_RES_MEMORY, + bus_release_resource(dev, SYS_RES_IRQ, sc->sc_irq_rid, sc->sc_irq_res); return (ENXIO); @@ -503,7 +503,7 @@ intelspi_detach(device_t dev) sc->sc_mem_rid, sc->sc_mem_res); if (sc->sc_irq_res != NULL) - bus_release_resource(dev, SYS_RES_MEMORY, + bus_release_resource(dev, SYS_RES_IRQ, sc->sc_irq_rid, sc->sc_irq_res); return (0); From owner-svn-src-head@freebsd.org Fri Sep 7 23:12: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 32FA5FCCF6B; Fri, 7 Sep 2018 23:12:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D8E997B675; Fri, 7 Sep 2018 23:12:17 +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 D3DDA22785; Fri, 7 Sep 2018 23:12:17 +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 w87NCHdQ029179; Fri, 7 Sep 2018 23:12:17 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w87NCHDt029178; Fri, 7 Sep 2018 23:12:17 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201809072312.w87NCHDt029178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 7 Sep 2018 23:12:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338529 - head/tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/build/mk X-SVN-Commit-Revision: 338529 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 07 Sep 2018 23:12:18 -0000 Author: emaste Date: Fri Sep 7 23:12:17 2018 New Revision: 338529 URL: https://svnweb.freebsd.org/changeset/base/338529 Log: Remove strings from OptionalObsoleteFiles.inc Since r326030 strings is installed unconditionally so should not be removed when WITHOUT_TOOLCHAIN is set. Reported by: Dan McGregor Approved by: re (kib) Sponsored by: The FreeBSD Foundation Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Fri Sep 7 21:12:37 2018 (r338528) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Fri Sep 7 23:12:17 2018 (r338529) @@ -8512,7 +8512,6 @@ OLD_FILES+=usr/bin/nm OLD_FILES+=usr/bin/objcopy OLD_FILES+=usr/bin/readelf OLD_FILES+=usr/bin/size -OLD_FILES+=usr/bin/strings OLD_FILES+=usr/bin/strip OLD_FILES+=usr/bin/yacc OLD_FILES+=usr/share/man/man1/addr2line.1.gz @@ -8520,7 +8519,6 @@ OLD_FILES+=usr/share/man/man1/c++filt.1.gz OLD_FILES+=usr/share/man/man1/nm.1.gz OLD_FILES+=usr/share/man/man1/readelf.1.gz OLD_FILES+=usr/share/man/man1/size.1.gz -OLD_FILES+=usr/share/man/man1/strings.1.gz OLD_FILES+=usr/share/man/man1/strip.1.gz OLD_FILES+=usr/share/man/man1/objcopy.1.gz # lib/libelf From owner-svn-src-head@freebsd.org Sat Sep 8 00:42: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 C7076FCEBCE; Sat, 8 Sep 2018 00:42:37 +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 725F77E0D7; Sat, 8 Sep 2018 00:42:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 8CCA110A87D; Fri, 7 Sep 2018 20:42:29 -0400 (EDT) Subject: Re: svn commit: r338523 - head/sbin/sysctl To: Konstantin Belousov References: <201809071509.w87F9uEO078085@repo.freebsd.org> <8beb57f9-37dc-735c-fa85-78ecb67679ad@FreeBSD.org> <20180907162608.GV3161@kib.kiev.ua> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: John Baldwin Message-ID: <3748f268-f3fa-bd83-47a1-44fb41c28384@FreeBSD.org> Date: Fri, 7 Sep 2018 17:42:28 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180907162608.GV3161@kib.kiev.ua> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 07 Sep 2018 20:42:30 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 08 Sep 2018 00:42:37 -0000 On 9/7/18 9:26 AM, Konstantin Belousov wrote: > On Fri, Sep 07, 2018 at 09:00:20AM -0700, John Baldwin wrote: >> On 9/7/18 8:09 AM, Konstantin Belousov wrote: >>> Author: kib >>> Date: Fri Sep 7 15:09:56 2018 >>> New Revision: 338523 >>> URL: https://svnweb.freebsd.org/changeset/base/338523 >>> >>> Log: >>> Teach sysctl(8) about the Persistent memory type. >>> >>> Add PersistentMemory to the list of sysctl's known memory types >>> when decoding an EFI memory map. >>> >>> Submitted by: D Scott Phillips >>> MFC after: 1 week >>> Approved by: re (rgrimes) >>> >>> Modified: >>> head/sbin/sysctl/sysctl.c >>> >>> Modified: head/sbin/sysctl/sysctl.c >>> ============================================================================== >>> --- head/sbin/sysctl/sysctl.c Fri Sep 7 14:37:44 2018 (r338522) >>> +++ head/sbin/sysctl/sysctl.c Fri Sep 7 15:09:56 2018 (r338523) >>> @@ -704,7 +704,8 @@ S_efi_map(size_t l2, void *p) >>> "ACPIMemoryNVS", >>> "MemoryMappedIO", >>> "MemoryMappedIOPortSpace", >>> - "PalCode" >>> + "PalCode", >>> + "PersistentMemory" >>> }; >>> >>> /* >>> @@ -733,7 +734,7 @@ S_efi_map(size_t l2, void *p) >>> >>> for (i = 0; i < ndesc; i++, >>> map = efi_next_descriptor(map, efihdr->descriptor_size)) { >>> - if (map->md_type <= EFI_MD_TYPE_PALCODE) >>> + if (map->md_type <= EFI_MD_TYPE_PERSISTENT) >> >> Perhaps this should use nitems(types) instead? (And I believe it's my >> fault it didn't originally.) > > For me, it was more an issue that the code assumes contiguous values for > the EFI_MD_TYPEs constants. > > What about the following: Looks good to me. -- John Baldwin                                                                              From owner-svn-src-head@freebsd.org Sat Sep 8 18:57: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 338EEFFACED; Sat, 8 Sep 2018 18:57:06 +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 D786D74576; Sat, 8 Sep 2018 18:57:05 +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 C7E716F95; Sat, 8 Sep 2018 18:57:05 +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 w88Iv5O2035524; Sat, 8 Sep 2018 18:57:05 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w88Iv5XX035523; Sat, 8 Sep 2018 18:57:05 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201809081857.w88Iv5XX035523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 8 Sep 2018 18:57:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338533 - head/sbin/sysctl X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sbin/sysctl X-SVN-Commit-Revision: 338533 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 08 Sep 2018 18:57:06 -0000 Author: kib Date: Sat Sep 8 18:57:05 2018 New Revision: 338533 URL: https://svnweb.freebsd.org/changeset/base/338533 Log: Improve handling of the EFI map types[] array. Use nitems(), do not assume EFI_MD_TYPE_ contiguous allocation, in particular, switch to use designated array initializers. Reviewed by: jhb (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week Approved by: re (gjb) Modified: head/sbin/sysctl/sysctl.c Modified: head/sbin/sysctl/sysctl.c ============================================================================== --- head/sbin/sysctl/sysctl.c Sat Sep 8 08:52:52 2018 (r338532) +++ head/sbin/sysctl/sysctl.c Sat Sep 8 18:57:05 2018 (r338533) @@ -690,22 +690,22 @@ S_efi_map(size_t l2, void *p) size_t efisz; int ndesc, i; - static const char *types[] = { - "Reserved", - "LoaderCode", - "LoaderData", - "BootServicesCode", - "BootServicesData", - "RuntimeServicesCode", - "RuntimeServicesData", - "ConventionalMemory", - "UnusableMemory", - "ACPIReclaimMemory", - "ACPIMemoryNVS", - "MemoryMappedIO", - "MemoryMappedIOPortSpace", - "PalCode", - "PersistentMemory" + static const char * const types[] = { + [EFI_MD_TYPE_NULL] = "Reserved", + [EFI_MD_TYPE_CODE] = "LoaderCode", + [EFI_MD_TYPE_DATA] = "LoaderData", + [EFI_MD_TYPE_BS_CODE] = "BootServicesCode", + [EFI_MD_TYPE_BS_DATA] = "BootServicesData", + [EFI_MD_TYPE_RT_CODE] = "RuntimeServicesCode", + [EFI_MD_TYPE_RT_DATA] = "RuntimeServicesData", + [EFI_MD_TYPE_FREE] = "ConventionalMemory", + [EFI_MD_TYPE_BAD] = "UnusableMemory", + [EFI_MD_TYPE_RECLAIM] = "ACPIReclaimMemory", + [EFI_MD_TYPE_FIRMWARE] = "ACPIMemoryNVS", + [EFI_MD_TYPE_IOMEM] = "MemoryMappedIO", + [EFI_MD_TYPE_IOPORT] = "MemoryMappedIOPortSpace", + [EFI_MD_TYPE_PALCODE] = "PalCode", + [EFI_MD_TYPE_PERSISTENT] = "PersistentMemory", }; /* @@ -734,9 +734,10 @@ S_efi_map(size_t l2, void *p) for (i = 0; i < ndesc; i++, map = efi_next_descriptor(map, efihdr->descriptor_size)) { - if (map->md_type <= EFI_MD_TYPE_PERSISTENT) + type = NULL; + if (map->md_type < nitems(types)) type = types[map->md_type]; - else + if (type == NULL) type = ""; printf("\n%23s %012jx %12p %08jx ", type, (uintmax_t)map->md_phys, map->md_virt, From owner-svn-src-head@freebsd.org Sat Sep 8 18:57: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 D1658FFAD21; Sat, 8 Sep 2018 18:57: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 88CB274674; Sat, 8 Sep 2018 18:57:29 +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 839776F96; Sat, 8 Sep 2018 18:57:29 +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 w88IvTtC035587; Sat, 8 Sep 2018 18:57:29 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w88IvTPR035586; Sat, 8 Sep 2018 18:57:29 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201809081857.w88IvTPR035586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 8 Sep 2018 18:57:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338534 - head/sys/dev/intel X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/dev/intel X-SVN-Commit-Revision: 338534 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 08 Sep 2018 18:57:30 -0000 Author: kib Date: Sat Sep 8 18:57:29 2018 New Revision: 338534 URL: https://svnweb.freebsd.org/changeset/base/338534 Log: intelspi: don't leak spibus children on detach. Submitted by: Yuri Pankov MFC after: 1 week Approved by: re (gjb) Differential revision: https://reviews.freebsd.org/D17076 Modified: head/sys/dev/intel/spi.c Modified: head/sys/dev/intel/spi.c ============================================================================== --- head/sys/dev/intel/spi.c Sat Sep 8 18:57:05 2018 (r338533) +++ head/sys/dev/intel/spi.c Sat Sep 8 18:57:29 2018 (r338534) @@ -506,7 +506,7 @@ intelspi_detach(device_t dev) bus_release_resource(dev, SYS_RES_IRQ, sc->sc_irq_rid, sc->sc_irq_res); - return (0); + return (bus_generic_detach(dev)); } static device_method_t intelspi_methods[] = { From owner-svn-src-head@freebsd.org Sat Sep 8 19: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 D2E30FFB4C8; Sat, 8 Sep 2018 19:17:22 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 84EF174FE2; Sat, 8 Sep 2018 19:17:22 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E87C72D4; Sat, 8 Sep 2018 19:17:22 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w88JHMRg045989; Sat, 8 Sep 2018 19:17:22 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w88JHMii045988; Sat, 8 Sep 2018 19:17:22 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201809081917.w88JHMii045988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sat, 8 Sep 2018 19:17:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338535 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 338535 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 08 Sep 2018 19:17:23 -0000 Author: tsoome Date: Sat Sep 8 19:17:22 2018 New Revision: 338535 URL: https://svnweb.freebsd.org/changeset/base/338535 Log: libsa: memory leak in tftp_open() tftpfile is allocated just above and needs to be freed. Reviewed by: imp Approved by: re (kib) Differential Revision: https://reviews.freebsd.org/D17058 Modified: head/stand/libsa/tftp.c Modified: head/stand/libsa/tftp.c ============================================================================== --- head/stand/libsa/tftp.c Sat Sep 8 18:57:29 2018 (r338534) +++ head/stand/libsa/tftp.c Sat Sep 8 19:17:22 2018 (r338535) @@ -447,8 +447,10 @@ tftp_open(const char *path, struct open_file *f) memset(tftpfile, 0, sizeof(*tftpfile)); tftpfile->tftp_blksize = TFTP_REQUESTED_BLKSIZE; tftpfile->iodesc = io = socktodesc(*(int *) (f->f_devdata)); - if (io == NULL) + if (io == NULL) { + free(tftpfile); return (EINVAL); + } io->destip = servip; tftpfile->off = 0; From owner-svn-src-head@freebsd.org Sat Sep 8 21:49: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 C1959FFF3C6; Sat, 8 Sep 2018 21:49:44 +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 6E34079AB0; Sat, 8 Sep 2018 21:49:44 +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 65DD910B25; Sat, 8 Sep 2018 21:49:44 +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 w88LniSn022448; Sat, 8 Sep 2018 21:49:44 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w88Lniko022447; Sat, 8 Sep 2018 21:49:44 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201809082149.w88Lniko022447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 8 Sep 2018 21:49:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338536 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 338536 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 08 Sep 2018 21:49:45 -0000 Author: markj Date: Sat Sep 8 21:49:43 2018 New Revision: 338536 URL: https://svnweb.freebsd.org/changeset/base/338536 Log: Relax an assertion in vm_pqbatch_process_page(). While executing vm_pqbatch_process_page(m), m->queue may change to PQ_NONE if the page daemon is concurrently freeing the page. In this case m's queue state flags must be clear, so vm_pqbatch_process_page() will be a no-op, but the race could cause spurious assertion failures. Correct the assertion which assumed that m->queue's value does not change while the page queue lock is held. Reviewed by: alc, kib Reported and tested by: pho Approved by: re (gjb) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17027 Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sat Sep 8 19:17:22 2018 (r338535) +++ head/sys/vm/vm_page.c Sat Sep 8 21:49:43 2018 (r338536) @@ -3107,28 +3107,35 @@ static inline void vm_pqbatch_process_page(struct vm_pagequeue *pq, vm_page_t m) { struct vm_domain *vmd; - uint8_t aflags; + uint8_t qflags; CRITICAL_ASSERT(curthread); vm_pagequeue_assert_locked(pq); - KASSERT(pq == vm_page_pagequeue(m), - ("page %p doesn't belong to %p", m, pq)); - aflags = m->aflags; - if ((aflags & PGA_DEQUEUE) != 0) { - if (__predict_true((aflags & PGA_ENQUEUED) != 0)) { + /* + * The page daemon is allowed to set m->queue = PQ_NONE without + * the page queue lock held. In this case it is about to free the page, + * which must not have any queue state. + */ + qflags = atomic_load_8(&m->aflags) & PGA_QUEUE_STATE_MASK; + KASSERT(pq == vm_page_pagequeue(m) || qflags == 0, + ("page %p doesn't belong to queue %p but has queue state %#x", + m, pq, qflags)); + + if ((qflags & PGA_DEQUEUE) != 0) { + if (__predict_true((qflags & PGA_ENQUEUED) != 0)) { TAILQ_REMOVE(&pq->pq_pl, m, plinks.q); vm_pagequeue_cnt_dec(pq); } vm_page_dequeue_complete(m); - } else if ((aflags & (PGA_REQUEUE | PGA_REQUEUE_HEAD)) != 0) { - if ((aflags & PGA_ENQUEUED) != 0) + } else if ((qflags & (PGA_REQUEUE | PGA_REQUEUE_HEAD)) != 0) { + if ((qflags & PGA_ENQUEUED) != 0) TAILQ_REMOVE(&pq->pq_pl, m, plinks.q); else { vm_pagequeue_cnt_inc(pq); vm_page_aflag_set(m, PGA_ENQUEUED); } - if ((aflags & PGA_REQUEUE_HEAD) != 0) { + if ((qflags & PGA_REQUEUE_HEAD) != 0) { KASSERT(m->queue == PQ_INACTIVE, ("head enqueue not supported for page %p", m)); vmd = vm_pagequeue_domain(m); From owner-svn-src-head@freebsd.org Sat Sep 8 21:51: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 E58D7FFF584; Sat, 8 Sep 2018 21:51:47 +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 9C13A79E11; Sat, 8 Sep 2018 21:51:47 +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 96F1110C88; Sat, 8 Sep 2018 21:51:47 +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 w88LplkK026403; Sat, 8 Sep 2018 21:51:47 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w88LplmN026402; Sat, 8 Sep 2018 21:51:47 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201809082151.w88LplmN026402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 8 Sep 2018 21:51:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338537 - head/sys/arm/arm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/arm/arm X-SVN-Commit-Revision: 338537 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 08 Sep 2018 21:51:48 -0000 Author: markj Date: Sat Sep 8 21:51:47 2018 New Revision: 338537 URL: https://svnweb.freebsd.org/changeset/base/338537 Log: Bump MAX_HWCNT and MAX_EXCNT. These limits are hit on the ThunderX. Also make arm_physmem_exclude_region() panic rather than fail silently if the limit on excluded regions is reached. PR: 231064 Reviewed by: andrew Approved by: re (kib) MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17073 Modified: head/sys/arm/arm/physmem.c Modified: head/sys/arm/arm/physmem.c ============================================================================== --- head/sys/arm/arm/physmem.c Sat Sep 8 21:49:43 2018 (r338536) +++ head/sys/arm/arm/physmem.c Sat Sep 8 21:51:47 2018 (r338537) @@ -48,8 +48,8 @@ __FBSDID("$FreeBSD$"); * that can be allocated, or both, depending on the exclusion flags associated * with the region. */ -#define MAX_HWCNT 10 -#define MAX_EXCNT 10 +#define MAX_HWCNT 16 +#define MAX_EXCNT 16 #if defined(__arm__) #define MAX_PHYS_ADDR 0xFFFFFFFFull @@ -359,7 +359,8 @@ arm_physmem_hardware_region(uint64_t pa, uint64_t sz) /* * Add an exclusion region. */ -void arm_physmem_exclude_region(vm_paddr_t pa, vm_size_t sz, uint32_t exflags) +void +arm_physmem_exclude_region(vm_paddr_t pa, vm_size_t sz, uint32_t exflags) { vm_offset_t adj; @@ -371,8 +372,9 @@ void arm_physmem_exclude_region(vm_paddr_t pa, vm_size pa = trunc_page(pa); sz = round_page(sz + adj); - if (excnt < nitems(exregions)) - excnt = insert_region(exregions, excnt, pa, sz, exflags); + if (excnt >= nitems(exregions)) + panic("failed to exclude region %#lx-%#lx", pa, pa + sz); + excnt = insert_region(exregions, excnt, pa, sz, exflags); } size_t From owner-svn-src-head@freebsd.org Sat Sep 8 21:52: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 AC531FFF5E8; Sat, 8 Sep 2018 21:52:45 +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 6111079FEF; Sat, 8 Sep 2018 21:52:45 +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 5BABA10CD3; Sat, 8 Sep 2018 21:52:45 +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 w88Lqjr7027198; Sat, 8 Sep 2018 21:52:45 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w88LqjdB027197; Sat, 8 Sep 2018 21:52:45 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201809082152.w88LqjdB027197@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 8 Sep 2018 21:52:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338538 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 338538 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 08 Sep 2018 21:52:46 -0000 Author: markj Date: Sat Sep 8 21:52:44 2018 New Revision: 338538 URL: https://svnweb.freebsd.org/changeset/base/338538 Log: Exclude the EFI framebuffer from phys_avail[] on arm64. On the ThunderX the region occupied by the framebuffer is included in the EFI map, so explicitly add it to the set of regions that aren't managed by the physical memory allocator. PR: 231064 Reviewed by: andrew Approved by: re (gjb) MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17073 Modified: head/sys/arm64/arm64/machdep.c Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Sat Sep 8 21:51:47 2018 (r338537) +++ head/sys/arm64/arm64/machdep.c Sat Sep 8 21:52:44 2018 (r338538) @@ -982,6 +982,7 @@ cache_setup(void) void initarm(struct arm64_bootparams *abp) { + struct efi_fb *efifb; struct efi_map_header *efihdr; struct pcpu *pcpup; char *env; @@ -1030,6 +1031,13 @@ initarm(struct arm64_bootparams *abp) arm_physmem_exclude_regions(mem_regions, mem_regions_sz, EXFLAG_NODUMP | EXFLAG_NOALLOC); #endif + + /* Exclude the EFI framebuffer from our view of physical memory. */ + efifb = (struct efi_fb *)preload_search_info(kmdp, + MODINFO_METADATA | MODINFOMD_EFI_FB); + if (efifb != NULL) + arm_physmem_exclude_region(efifb->fb_addr, efifb->fb_size, + EXFLAG_NOALLOC); /* Set the pcpu data, this is needed by pmap_bootstrap */ pcpup = &__pcpu[0]; From owner-svn-src-head@freebsd.org Sat Sep 8 23:39: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 35F63106C137; Sat, 8 Sep 2018 23:39:27 +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 D0A2A7CAC5; Sat, 8 Sep 2018 23:39:26 +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 C5E2311D3D; Sat, 8 Sep 2018 23:39:26 +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 w88NdQg2078813; Sat, 8 Sep 2018 23:39:26 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w88NdQLJ078812; Sat, 8 Sep 2018 23:39:26 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201809082339.w88NdQLJ078812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 8 Sep 2018 23:39:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338539 - head/sys/arm/arm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/arm/arm X-SVN-Commit-Revision: 338539 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 08 Sep 2018 23:39:27 -0000 Author: markj Date: Sat Sep 8 23:39:26 2018 New Revision: 338539 URL: https://svnweb.freebsd.org/changeset/base/338539 Log: Fix the 32-bit arm build. X-MFC with: r338537 Approved by: re (rgrimes) Sponsored by: The FreeBSD Foundation Modified: head/sys/arm/arm/physmem.c Modified: head/sys/arm/arm/physmem.c ============================================================================== --- head/sys/arm/arm/physmem.c Sat Sep 8 21:52:44 2018 (r338538) +++ head/sys/arm/arm/physmem.c Sat Sep 8 23:39:26 2018 (r338539) @@ -373,7 +373,8 @@ arm_physmem_exclude_region(vm_paddr_t pa, vm_size_t sz sz = round_page(sz + adj); if (excnt >= nitems(exregions)) - panic("failed to exclude region %#lx-%#lx", pa, pa + sz); + panic("failed to exclude region %#jx-%#jx", (uintmax_t)pa, + (uintmax_t)(pa + sz)); excnt = insert_region(exregions, excnt, pa, sz, exflags); }