From owner-svn-src-head@freebsd.org Sun Nov 8 02:20:21 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D762B2E2DAD; Sun, 8 Nov 2020 02:20:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTHsK5s2Tz4cLG; Sun, 8 Nov 2020 02:20:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7F7818988; Sun, 8 Nov 2020 02:20:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A82KLjj040308; Sun, 8 Nov 2020 02:20:21 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A82KL9D040307; Sun, 8 Nov 2020 02:20:21 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202011080220.0A82KL9D040307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 8 Nov 2020 02:20:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367474 - head X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 367474 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 08 Nov 2020 02:20:21 -0000 Author: imp Date: Sun Nov 8 02:20:21 2020 New Revision: 367474 URL: https://svnweb.freebsd.org/changeset/base/367474 Log: Be explicit about recompiling all the modules... Add a note about always recompiling all modules on every new kernel change / update. In addition, suggest using /usr/local/sys/modules so this happens automatically. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Sun Nov 8 01:02:40 2020 (r367473) +++ head/UPDATING Sun Nov 8 02:20:21 2020 (r367474) @@ -2305,7 +2305,12 @@ COMMON ITEMS: [1] If you have third party modules, such as vmware, you should disable them at this point so they don't crash your - system on reboot. + system on reboot. Alternatively, you should rebuild all the + modules you have in your system and install them as well. If + you are running -current, you should seriously consider + placing all sources to all the modules for your system (or + symlinks to them) in /usr/local/sys/modules so this happens + automatically... [3] From the bootblocks, boot -s, and then do fsck -p From owner-svn-src-head@freebsd.org Sun Nov 8 02:46:04 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 902432E36A2; Sun, 8 Nov 2020 02:46:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTJR03cwGz4dgv; Sun, 8 Nov 2020 02:46:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F1CD18C74; Sun, 8 Nov 2020 02:46:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A82k4IW058427; Sun, 8 Nov 2020 02:46:04 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A82k4Fl058426; Sun, 8 Nov 2020 02:46:04 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202011080246.0A82k4Fl058426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 8 Nov 2020 02:46:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367475 - head X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 367475 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 08 Nov 2020 02:46:04 -0000 Author: imp Date: Sun Nov 8 02:46:04 2020 New Revision: 367475 URL: https://svnweb.freebsd.org/changeset/base/367475 Log: Also mention PORTS_MODULES PORTS_MODULES is also an effective way to update the tree. Also a minor rejustify on this an an adjacent paragraph. Suggested by: David Wolfskill Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Sun Nov 8 02:20:21 2020 (r367474) +++ head/UPDATING Sun Nov 8 02:46:04 2020 (r367475) @@ -2303,14 +2303,16 @@ COMMON ITEMS: messages there. If in doubt, please track -stable which has much fewer pitfalls. - [1] If you have third party modules, such as vmware, you - should disable them at this point so they don't crash your - system on reboot. Alternatively, you should rebuild all the - modules you have in your system and install them as well. If - you are running -current, you should seriously consider - placing all sources to all the modules for your system (or - symlinks to them) in /usr/local/sys/modules so this happens - automatically... + [1] If you have third party modules, such as vmware, you should disable + them at this point so they don't crash your system on + reboot. Alternatively, you should rebuild all the modules you have in + your system and install them as well. If you are running -current, you + should seriously consider placing all sources to all the modules for + your system (or symlinks to them) in /usr/local/sys/modules so this + happens automatically. If all your modules come from ports, then adding + the port origin directories to PORTS_MODULES instead is also automatic + and effective, eg: + PORTS_MODULES+=x11/nvidia-driver [3] From the bootblocks, boot -s, and then do fsck -p @@ -2319,8 +2321,8 @@ COMMON ITEMS: sh /etc/rc.d/zfs start # mount zfs filesystem, if needed cd src # full path to source adjkerntz -i # if CMOS is wall time - Also, when doing a major release upgrade, it is required that - you boot into single user mode to do the installworld. + Also, when doing a major release upgrade, it is required that you boot + into single user mode to do the installworld. [4] Note: This step is non-optional. Failure to do this step can result in a significant reduction in the functionality of the From owner-svn-src-head@freebsd.org Sun Nov 8 02:50:37 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D8BE62E34C7; Sun, 8 Nov 2020 02:50:37 +0000 (UTC) (envelope-from tmunro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTJXF5nl3z4f4l; Sun, 8 Nov 2020 02:50:37 +0000 (UTC) (envelope-from tmunro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AFA9F18E74; Sun, 8 Nov 2020 02:50:37 +0000 (UTC) (envelope-from tmunro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A82obSJ058714; Sun, 8 Nov 2020 02:50:37 GMT (envelope-from tmunro@FreeBSD.org) Received: (from tmunro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A82oYE4058700; Sun, 8 Nov 2020 02:50:34 GMT (envelope-from tmunro@FreeBSD.org) Message-Id: <202011080250.0A82oYE4058700@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tmunro set sender to tmunro@FreeBSD.org using -f From: Thomas Munro Date: Sun, 8 Nov 2020 02:50:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367476 - in head: include/xlocale lib/libc/locale share/colldef tools/tools/locale tools/tools/locale/tools usr.bin/localedef usr.bin/localedef/bootstrap X-SVN-Group: head X-SVN-Commit-Author: tmunro X-SVN-Commit-Paths: in head: include/xlocale lib/libc/locale share/colldef tools/tools/locale tools/tools/locale/tools usr.bin/localedef usr.bin/localedef/bootstrap X-SVN-Commit-Revision: 367476 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 08 Nov 2020 02:50:37 -0000 Author: tmunro Date: Sun Nov 8 02:50:34 2020 New Revision: 367476 URL: https://svnweb.freebsd.org/changeset/base/367476 Log: Add collation version support to querylocale(3). Provide a way to ask for an opaque version string for a locale_t, so that potential changes in sort order can be detected. Similar to ICU's ucol_getVersion() and Windows' GetNLSVersionEx(), this API is intended to allow databases to detect when text order-based indexes might need to be rebuilt. The CLDR version is extracted from CLDR source data by the Makefile under tools/tools/locale, written into the machine-generated Makefile under shared/colldef, passed to localedef -V, and then written into LC_COLLATE file headers. The initial version is 34.0. tools/tools/locale was recently updated to pull down 35.0, but the output hasn't been committed under share/colldef yet, so that will provide the first observable change when it happens. Other versioning schemes are possible in future, because the format is unspecified. Reviewed by: bapt, 0mp, kib, yuripv (albeit a long time ago) Differential Revision: https://reviews.freebsd.org/D17166 Modified: head/include/xlocale/_locale.h head/lib/libc/locale/collate.c head/lib/libc/locale/collate.h head/lib/libc/locale/querylocale.3 head/lib/libc/locale/xlocale.c head/lib/libc/locale/xlocale_private.h head/share/colldef/Makefile head/tools/tools/locale/Makefile head/tools/tools/locale/tools/cldr2def.pl head/usr.bin/localedef/bootstrap/bootstrap_xlocale_private.h head/usr.bin/localedef/collate.c head/usr.bin/localedef/localedef.1 head/usr.bin/localedef/localedef.c head/usr.bin/localedef/localedef.h Modified: head/include/xlocale/_locale.h ============================================================================== --- head/include/xlocale/_locale.h Sun Nov 8 02:46:04 2020 (r367475) +++ head/include/xlocale/_locale.h Sun Nov 8 02:50:34 2020 (r367476) @@ -43,6 +43,7 @@ #define LC_MESSAGES_MASK (1<<5) #define LC_ALL_MASK (LC_COLLATE_MASK | LC_CTYPE_MASK | LC_MESSAGES_MASK | \ LC_MONETARY_MASK | LC_NUMERIC_MASK | LC_TIME_MASK) +#define LC_VERSION_MASK (1<<6) #define LC_GLOBAL_LOCALE ((locale_t)-1) #ifndef _LOCALE_T_DEFINED Modified: head/lib/libc/locale/collate.c ============================================================================== --- head/lib/libc/locale/collate.c Sun Nov 8 02:46:04 2020 (r367475) +++ head/lib/libc/locale/collate.c Sun Nov 8 02:50:34 2020 (r367476) @@ -140,7 +140,9 @@ __collate_load_tables_l(const char *encoding, struct x (void) _close(fd); return (_LDP_ERROR); } - if (sbuf.st_size < (COLLATE_STR_LEN + sizeof (info))) { + if (sbuf.st_size < (COLLATE_FMT_VERSION_LEN + + XLOCALE_DEF_VERSION_LEN + + sizeof (info))) { (void) _close(fd); errno = EINVAL; return (_LDP_ERROR); @@ -151,12 +153,14 @@ __collate_load_tables_l(const char *encoding, struct x return (_LDP_ERROR); } - if (strncmp(TMP, COLLATE_VERSION, COLLATE_STR_LEN) != 0) { + if (strncmp(TMP, COLLATE_FMT_VERSION, COLLATE_FMT_VERSION_LEN) != 0) { (void) munmap(map, sbuf.st_size); errno = EINVAL; return (_LDP_ERROR); } - TMP += COLLATE_STR_LEN; + TMP += COLLATE_FMT_VERSION_LEN; + strlcat(table->header.version, TMP, sizeof (table->header.version)); + TMP += XLOCALE_DEF_VERSION_LEN; info = (void *)TMP; TMP += sizeof (*info); Modified: head/lib/libc/locale/collate.h ============================================================================== --- head/lib/libc/locale/collate.h Sun Nov 8 02:46:04 2020 (r367475) +++ head/lib/libc/locale/collate.h Sun Nov 8 02:50:34 2020 (r367476) @@ -53,8 +53,10 @@ #endif #define COLLATE_STR_LEN 24 /* should be 64-bit multiple */ -#define COLLATE_VERSION "BSD 1.0\n" +#define COLLATE_FMT_VERSION_LEN 12 +#define COLLATE_FMT_VERSION "BSD 1.0\n" + #define COLLATE_MAX_PRIORITY (0x7fffffff) /* max signed value */ #define COLLATE_SUBST_PRIORITY (0x40000000) /* bit indicates subst table */ @@ -69,7 +71,8 @@ /* * The collate file format is as follows: * - * char version[COLLATE_STR_LEN]; // must be COLLATE_VERSION + * char fmt_version[COLLATE_FMT_VERSION_LEN]; // must be COLLATE_FMT_VERSION + * char def_version[XLOCALE_DEF_VERSION_LEN]; // NUL-terminated, may be empty * collate_info_t info; // see below, includes padding * collate_char_pri_t char_data[256]; // 8 bit char values * collate_subst_t subst[*]; // 0 or more substitutions Modified: head/lib/libc/locale/querylocale.3 ============================================================================== --- head/lib/libc/locale/querylocale.3 Sun Nov 8 02:46:04 2020 (r367475) +++ head/lib/libc/locale/querylocale.3 Sun Nov 8 02:50:34 2020 (r367476) @@ -27,12 +27,12 @@ .\" .\" $FreeBSD$ .\" -.Dd May 3, 2013 +.Dd November 8, 2020 .Dt QUERYLOCALE 3 .Os .Sh NAME .Nm querylocale -.Nd Look up the locale name for a specified category +.Nd Look up the locale name or version for a specified category .Sh LIBRARY .Lb libc .Sh SYNOPSIS @@ -40,11 +40,22 @@ .Ft const char * .Fn querylocale "int mask" "locale_t locale" .Sh DESCRIPTION -Returns the name of the locale for the category specified by +Returns the name or version of the locale for the category specified by .Fa mask . -This possible values for the mask are the same as those in -.Xr newlocale 3 . -If more than one bit in the mask is set, the returned value is undefined. +The possible values for the mask are the same as those in +.Xr newlocale 3 , +when requesting the locale name. +Specify the bitwise OR of +.Fa LC_VERSION_MASK +and another mask value to request a version string. +Version strings can be compared to detect changes to the locale's definition. +The structure of the version string is unspecified. +Currently, version information is only available for +.Fa LC_COLLATE_MASK , +and an empty string is returned for other categories. +If more than one bit in the mask is set, not counting +.Fa LC_VERSION_MASK , +the returned value is undefined. .Sh SEE ALSO .Xr duplocale 3 , .Xr freelocale 3 , @@ -52,3 +63,12 @@ If more than one bit in the mask is set, the returned .Xr newlocale 3 , .Xr uselocale 3 , .Xr xlocale 3 +.Sh HISTORY +The +.Fn querylocale +function first appeared in +.Fx 9.1 , +and is based on the function of the same name in Darwin. +.Fa LC_VERSION_MASK +first appeared in +.Fx 13.0 . Modified: head/lib/libc/locale/xlocale.c ============================================================================== --- head/lib/libc/locale/xlocale.c Sun Nov 8 02:46:04 2020 (r367475) +++ head/lib/libc/locale/xlocale.c Sun Nov 8 02:50:34 2020 (r367476) @@ -231,6 +231,8 @@ static int dupcomponent(int type, locale_t base, local if (new->components[type]) { strncpy(new->components[type]->locale, src->locale, ENCODING_LEN); + strncpy(new->components[type]->version, src->version, + XLOCALE_DEF_VERSION_LEN); } } else if (base->components[type]) { new->components[type] = xlocale_retain(base->components[type]); @@ -346,17 +348,24 @@ freelocale(locale_t loc) } /* - * Returns the name of the locale for a particular component of a locale_t. + * Returns the name or version of the locale for a particular component of a + * locale_t. */ const char *querylocale(int mask, locale_t loc) { - int type = ffs(mask) - 1; + int type = ffs(mask & ~LC_VERSION_MASK) - 1; FIX_LOCALE(loc); if (type >= XLC_LAST) return (NULL); - if (loc->components[type]) - return (loc->components[type]->locale); - return ("C"); + if (mask & LC_VERSION_MASK) { + if (loc->components[type]) + return (loc->components[type]->version); + return (""); + } else { + if (loc->components[type]) + return (loc->components[type]->locale); + return ("C"); + } } /* Modified: head/lib/libc/locale/xlocale_private.h ============================================================================== --- head/lib/libc/locale/xlocale_private.h Sun Nov 8 02:46:04 2020 (r367475) +++ head/lib/libc/locale/xlocale_private.h Sun Nov 8 02:50:34 2020 (r367476) @@ -91,6 +91,9 @@ struct xlocale_refcounted { /** Function used to destroy this component, if one is required*/ void(*destructor)(void*); }; + +#define XLOCALE_DEF_VERSION_LEN 12 + /** * Header for a locale component. All locale components must begin with this * header. @@ -99,6 +102,8 @@ struct xlocale_component { struct xlocale_refcounted header; /** Name of the locale used for this component. */ char locale[ENCODING_LEN+1]; + /** Version of the definition for this component. */ + char version[XLOCALE_DEF_VERSION_LEN]; }; /** Modified: head/share/colldef/Makefile ============================================================================== --- head/share/colldef/Makefile Sun Nov 8 02:46:04 2020 (r367475) +++ head/share/colldef/Makefile Sun Nov 8 02:50:34 2020 (r367476) @@ -7,10 +7,13 @@ FILESNAME= LC_COLLATE .SUFFIXES: .src .LC_COLLATE MAPLOC= ${.CURDIR}/../../tools/tools/locale/etc/final-maps +CLDR_VERSION= "34.0" + .include .src.LC_COLLATE: localedef ${LOCALEDEF_ENDIAN} -D -U -i ${.IMPSRC} \ + -V ${CLDR_VERSION} \ -f ${MAPLOC}/map.${.TARGET:T:R:E:C/@.*//} ${.OBJDIR}/${.IMPSRC:T:R} LOCALES+= af_ZA.UTF-8 @@ -227,6 +230,7 @@ FILES+= $t.LC_COLLATE FILESDIR_$t.LC_COLLATE= ${LOCALEDIR}/$t $t.LC_COLLATE: ${.CURDIR}/$f.src localedef ${LOCALEDEF_ENDIAN} -D -U -i ${.ALLSRC} \ + -V ${CLDR_VERSION} \ -f ${MAPLOC}/map.${.TARGET:T:R:E:C/@.*//} \ ${.OBJDIR}/${.TARGET:T:R} .endfor Modified: head/tools/tools/locale/Makefile ============================================================================== --- head/tools/tools/locale/Makefile Sun Nov 8 02:46:04 2020 (r367475) +++ head/tools/tools/locale/Makefile Sun Nov 8 02:50:34 2020 (r367476) @@ -187,6 +187,8 @@ extract-${CLDRFILES_${N}:T}:: ${CLDRFILES_${N}:T} ${UN cd ${UNIDIR} && unzip -o ../${CLDRFILES_${N}:T} extract: extract-${CLDRFILES_${N}:T} .endfor + grep 'name="version"' ${UNIDIR}/tools/build.xml | \ + sed 's/.* value="//;s/".*//' > ${UNIDIR}/cldr-version patch:: .if exists(${PATCHDIR}) cd ${UNIDIR} && cat ${PATCHDIR}/patch-* | patch Modified: head/tools/tools/locale/tools/cldr2def.pl ============================================================================== --- head/tools/tools/locale/tools/cldr2def.pl Sun Nov 8 02:46:04 2020 (r367475) +++ head/tools/tools/locale/tools/cldr2def.pl Sun Nov 8 02:50:34 2020 (r367476) @@ -50,6 +50,8 @@ my $UNIDIR = undef; my $ETCDIR = undef; my $TYPE = undef; +my $CLDR_VERSION = undef; + my $result = GetOptions ( "unidir=s" => \$UNIDIR, "etc=s" => \$ETCDIR, @@ -500,6 +502,12 @@ EOF sub transform_collation { + # Read the CLDR version + open(FIN, "$UNIDIR/cldr-version") or die "Cannot open cldr-version"; + read FIN, $CLDR_VERSION, -s FIN; + close(FIN); + $CLDR_VERSION =~ s/\s*$//; + foreach my $l (sort keys(%languages)) { foreach my $f (sort keys(%{$languages{$l}})) { foreach my $c (sort keys(%{$languages{$l}{$f}{data}})) { @@ -861,8 +869,11 @@ sub make_makefile { my $SRCOUT4 = ""; my $MAPLOC; if ($TYPE eq "colldef") { + # In future, we might want to try to put the CLDR version into + # the .src files with some new syntax, instead of the makefile. $SRCOUT = "localedef \${LOCALEDEF_ENDIAN} -D -U " . "-i \${.IMPSRC} \\\n" . + "\t-V \${CLDR_VERSION} \\\n" . "\t-f \${MAPLOC}/map.\${.TARGET:T:R:E:C/@.*//} " . "\${.OBJDIR}/\${.IMPSRC:T:R}"; $MAPLOC = "MAPLOC=\t\t\${.CURDIR}/../../tools/tools/" . @@ -875,6 +886,7 @@ sub make_makefile { "\$t.LC_COLLATE: \${.CURDIR}/\$f.src\n" . "\tlocaledef \${LOCALEDEF_ENDIAN} -D -U " . "-i \${.ALLSRC} \\\n" . + "\t-V \${CLDR_VERSION} \\\n" . "\t\t-f \${MAPLOC}/map.\${.TARGET:T:R:E:C/@.*//} \\\n" . "\t\t\${.OBJDIR}/\${.TARGET:T:R}\n" . ".endfor\n\n"; @@ -916,6 +928,13 @@ FILESNAME= $FILESNAMES{$TYPE} .SUFFIXES: .src .${SRCOUT2} ${MAPLOC} EOF + + if ($TYPE eq "colldef") { + print FOUT < #include #include +#include "collate.h" #include "localedef.h" #include "parser.h" @@ -62,6 +63,7 @@ int undefok = 0; int warnok = 0; static char *locname = NULL; static char locpath[PATH_MAX]; +char *version = NULL; const char * category_name(void) @@ -253,6 +255,7 @@ usage(void) (void) fprintf(stderr, " -u encoding : assume encoding\n"); (void) fprintf(stderr, " -w widths : use screen widths file\n"); (void) fprintf(stderr, " -i locsrc : source file for locale\n"); + (void) fprintf(stderr, " -V version : version string for locale\n"); exit(4); } @@ -279,7 +282,7 @@ main(int argc, char **argv) (void) setlocale(LC_ALL, ""); - while ((c = getopt(argc, argv, "blw:i:cf:u:vUD")) != -1) { + while ((c = getopt(argc, argv, "blw:i:cf:u:vUDV:")) != -1) { switch (c) { case 'D': bsd = 1; @@ -314,6 +317,9 @@ main(int argc, char **argv) case '?': usage(); break; + case 'V': + version = optarg; + break; } } @@ -323,6 +329,11 @@ main(int argc, char **argv) locname = argv[argc - 1]; if (verbose) { (void) printf("Processing locale %s.\n", locname); + } + + if (version && strlen(version) >= XLOCALE_DEF_VERSION_LEN) { + (void) fprintf(stderr, "Version string too long.\n"); + exit(1); } if (cfname) { Modified: head/usr.bin/localedef/localedef.h ============================================================================== --- head/usr.bin/localedef/localedef.h Sun Nov 8 02:46:04 2020 (r367475) +++ head/usr.bin/localedef/localedef.h Sun Nov 8 02:50:34 2020 (r367476) @@ -55,6 +55,8 @@ extern int undefok; /* mostly ignore undefined symbols extern int warnok; extern int warnings; +extern char *version; + int yylex(void); void yyerror(const char *); _Noreturn void errf(const char *, ...) __printflike(1, 2); From owner-svn-src-head@freebsd.org Sun Nov 8 04:24:30 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B51BF2E53D2; Sun, 8 Nov 2020 04:24:30 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTLcZ4cvVz4kCh; Sun, 8 Nov 2020 04:24:30 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 86F011A28E; Sun, 8 Nov 2020 04:24:30 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A84OU98021097; Sun, 8 Nov 2020 04:24:30 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A84OUVm021095; Sun, 8 Nov 2020 04:24:30 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202011080424.0A84OUVm021095@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 8 Nov 2020 04:24:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367477 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 367477 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 08 Nov 2020 04:24:30 -0000 Author: kevans Date: Sun Nov 8 04:24:29 2020 New Revision: 367477 URL: https://svnweb.freebsd.org/changeset/base/367477 Log: imgact_binmisc: limit the extent of match on incoming entries imgact_binmisc matches magic/mask from imgp->image_header, which is only a single page in size mapped from the first page of an image. One can specify an interpreter that matches on, e.g., --offset 4096 --size 256 to read up to 256 bytes past the mapped first page. The limitation is that we cannot specify a magic string that exceeds a single page, and we can't allow offset + size to exceed a single page either. A static assert has been added in case someone finds it useful to try and expand the size, but it does seem a little unlikely. While this looks kind of exploitable at a sideways squinty-glance, there are a couple of mitigating factors: 1.) imgact_binmisc is not enabled by default, 2.) entries may only be added by the superuser, 3.) trying to exploit this information to read what's mapped past the end would be worse than a root canal or some other relatably painful experience, and 4.) there's no way one could pull this off without it being completely obvious. The first page is mapped out of an sf_buf, the implementation of which (or lack thereof) depends on your platform. MFC after: 1 week Modified: head/sys/kern/imgact_binmisc.c head/sys/sys/imgact_binmisc.h Modified: head/sys/kern/imgact_binmisc.c ============================================================================== --- head/sys/kern/imgact_binmisc.c Sun Nov 8 02:50:34 2020 (r367476) +++ head/sys/kern/imgact_binmisc.c Sun Nov 8 04:24:29 2020 (r367477) @@ -236,6 +236,8 @@ imgact_binmisc_add_entry(ximgact_binmisc_entry_t *xbe) if (xbe->xbe_msize > IBE_MAGIC_MAX) return (EINVAL); + if (xbe->xbe_moffset + xbe->xbe_msize > IBE_MATCH_MAX) + return (EINVAL); for(cnt = 0, p = xbe->xbe_name; *p != 0; cnt++, p++) if (cnt >= IBE_NAME_MAX || !isascii((int)*p)) Modified: head/sys/sys/imgact_binmisc.h ============================================================================== --- head/sys/sys/imgact_binmisc.h Sun Nov 8 02:50:34 2020 (r367476) +++ head/sys/sys/imgact_binmisc.h Sun Nov 8 04:24:29 2020 (r367477) @@ -47,6 +47,11 @@ #define IBE_INTERP_LEN_MAX (MAXPATHLEN + IBE_ARG_LEN_MAX) #define IBE_MAX_ENTRIES 64 /* Max number of interpreter entries. */ +/* We only map the first page for identification purposes. */ +#define IBE_MATCH_MAX PAGE_SIZE +_Static_assert(IBE_MAGIC_MAX <= IBE_MATCH_MAX, + "Cannot identify binaries past the first page."); + /* * Imgact bin misc interpreter entry flags. */ From owner-svn-src-head@freebsd.org Sun Nov 8 07:49:40 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 441892E92BF; Sun, 8 Nov 2020 07:49:40 +0000 (UTC) (envelope-from olivier@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTR9J1SlSz4sB6; Sun, 8 Nov 2020 07:49:40 +0000 (UTC) (envelope-from olivier@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 254731C886; Sun, 8 Nov 2020 07:49:40 +0000 (UTC) (envelope-from olivier@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A87nebF044149; Sun, 8 Nov 2020 07:49:40 GMT (envelope-from olivier@FreeBSD.org) Received: (from olivier@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A87ne9N044148; Sun, 8 Nov 2020 07:49:40 GMT (envelope-from olivier@FreeBSD.org) Message-Id: <202011080749.0A87ne9N044148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: olivier set sender to olivier@FreeBSD.org using -f From: Olivier Cochard Date: Sun, 8 Nov 2020 07:49:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367478 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: olivier X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 367478 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 08 Nov 2020 07:49:40 -0000 Author: olivier (ports committer) Date: Sun Nov 8 07:49:39 2020 New Revision: 367478 URL: https://svnweb.freebsd.org/changeset/base/367478 Log: Return the same value for smbios.chassis.maker as smbios.system.maker (and prevents returning a space character). Reviewed by: grehan Approved by: grehan Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D27123 Modified: head/usr.sbin/bhyve/smbiostbl.c Modified: head/usr.sbin/bhyve/smbiostbl.c ============================================================================== --- head/usr.sbin/bhyve/smbiostbl.c Sun Nov 8 04:24:29 2020 (r367477) +++ head/usr.sbin/bhyve/smbiostbl.c Sun Nov 8 07:49:39 2020 (r367478) @@ -374,7 +374,7 @@ struct smbios_table_type3 smbios_type3_template = { }; const char *smbios_type3_strings[] = { - " ", /* manufacturer string */ + "FreeBSD", /* manufacturer string */ "1.0", /* version string */ "None", /* serial number string */ "None", /* asset tag string */ From owner-svn-src-head@freebsd.org Sun Nov 8 09:35:42 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6AAA42EB575; Sun, 8 Nov 2020 09:35:42 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTTWf2ZWnz3DMd; Sun, 8 Nov 2020 09:35:42 +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 407DA1DC34; Sun, 8 Nov 2020 09:35:42 +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 0A89ZgD6011231; Sun, 8 Nov 2020 09:35:42 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A89Zgjv011230; Sun, 8 Nov 2020 09:35:42 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202011080935.0A89Zgjv011230@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 8 Nov 2020 09:35:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367479 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 367479 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 08 Nov 2020 09:35:42 -0000 Author: tsoome Date: Sun Nov 8 09:35:41 2020 New Revision: 367479 URL: https://svnweb.freebsd.org/changeset/base/367479 Log: loader: cstyle cleanup of bootstrap.h No functional changes intended. Modified: head/stand/common/bootstrap.h Modified: head/stand/common/bootstrap.h ============================================================================== --- head/stand/common/bootstrap.h Sun Nov 8 07:49:39 2020 (r367478) +++ head/stand/common/bootstrap.h Sun Nov 8 09:35:41 2020 (r367479) @@ -40,11 +40,11 @@ typedef int (bootblk_cmd_t)(int argc, char *argv[]); #define COMMAND_ERRBUFSZ (256) extern const char *command_errmsg; extern char command_errbuf[COMMAND_ERRBUFSZ]; -#define CMD_OK 0 -#define CMD_WARN 1 -#define CMD_ERROR 2 -#define CMD_CRIT 3 -#define CMD_FATAL 4 +#define CMD_OK 0 +#define CMD_WARN 1 +#define CMD_ERROR 2 +#define CMD_CRIT 3 +#define CMD_FATAL 4 /* interp.c */ void interact(void); @@ -52,9 +52,9 @@ void interp_emit_prompt(void); int interp_builtin_cmd(int argc, char *argv[]); /* Called by interp.c for interp_*.c embedded interpreters */ -int interp_include(const char *filename); /* Execute commands from filename */ -void interp_init(void); /* Initialize interpreater */ -int interp_run(const char *line); /* Run a single command */ +int interp_include(const char *); /* Execute commands from filename */ +void interp_init(void); /* Initialize interpreater */ +int interp_run(const char *); /* Run a single command */ /* interp_backslash.c */ char *backslash(const char *str); @@ -87,64 +87,70 @@ int bcache_strategy(void *devdata, int rw, daddr_t blk */ struct bcache_devdata { - int (*dv_strategy)(void *devdata, int rw, daddr_t blk, - size_t size, char *buf, size_t *rsize); - void *dv_devdata; - void *dv_cache; + int (*dv_strategy)(void *, int, daddr_t, size_t, char *, size_t *); + void *dv_devdata; + void *dv_cache; }; /* * Modular console support. */ -struct console +struct console { - const char *c_name; - const char *c_desc; - int c_flags; -#define C_PRESENTIN (1<<0) /* console can provide input */ -#define C_PRESENTOUT (1<<1) /* console can provide output */ -#define C_ACTIVEIN (1<<2) /* user wants input from console */ -#define C_ACTIVEOUT (1<<3) /* user wants output to console */ + const char *c_name; + const char *c_desc; + int c_flags; +#define C_PRESENTIN (1<<0) /* console can provide input */ +#define C_PRESENTOUT (1<<1) /* console can provide output */ +#define C_ACTIVEIN (1<<2) /* user wants input from console */ +#define C_ACTIVEOUT (1<<3) /* user wants output to console */ #define C_WIDEOUT (1<<4) /* c_out routine groks wide chars */ - void (* c_probe)(struct console *cp); /* set c_flags to match hardware */ - int (* c_init)(int arg); /* reinit XXX may need more args */ - void (* c_out)(int c); /* emit c */ - int (* c_in)(void); /* wait for and return input */ - int (* c_ready)(void); /* return nonzer if input waiting */ + + /* set c_flags to match hardware */ + void (* c_probe)(struct console *cp); + /* reinit XXX may need more args */ + int (* c_init)(int arg); + /* emit c */ + void (* c_out)(int c); + int (* c_in)(void); + /* wait for and return input */ + /* return nonzer if input waiting */ + int (* c_ready)(void); }; -extern struct console *consoles[]; -void cons_probe(void); +extern struct console *consoles[]; +void cons_probe(void); /* * Plug-and-play enumerator/configurator interface. */ -struct pnphandler +struct pnphandler { - const char *pp_name; /* handler/bus name */ - void (* pp_enumerate)(void); /* enumerate PnP devices, add to chain */ + const char *pp_name; /* handler/bus name */ + void (*pp_enumerate)(void); /* enumerate PnP devices, add to chain */ }; struct pnpident { - char *id_ident; /* ASCII identifier, actual format varies with bus/handler */ - STAILQ_ENTRY(pnpident) id_link; + /* ASCII identifier, actual format varies with bus/handler */ + char *id_ident; + STAILQ_ENTRY(pnpident) id_link; }; struct pnpinfo { - char *pi_desc; /* ASCII description, optional */ - int pi_revision; /* optional revision (or -1) if not supported */ - char *pi_module; /* module/args nominated to handle device */ - int pi_argc; /* module arguments */ - char **pi_argv; - struct pnphandler *pi_handler; /* handler which detected this device */ - STAILQ_HEAD(,pnpident) pi_ident; /* list of identifiers */ - STAILQ_ENTRY(pnpinfo) pi_link; + char *pi_desc; /* ASCII description, optional */ + int pi_revision; /* optional revision (or -1) if not supported */ + char *pi_module; /* module/args nominated to handle device */ + int pi_argc; /* module arguments */ + char **pi_argv; + struct pnphandler *pi_handler; /* handler which detected this device */ + STAILQ_HEAD(, pnpident) pi_ident; /* list of identifiers */ + STAILQ_ENTRY(pnpinfo) pi_link; }; STAILQ_HEAD(pnpinfo_stql, pnpinfo); -extern struct pnphandler *pnphandlers[]; /* provided by MD code */ +extern struct pnphandler *pnphandlers[]; /* provided by MD code */ void pnp_addident(struct pnpinfo *pi, char *ident); struct pnpinfo *pnp_allocinfo(void); @@ -157,7 +163,7 @@ char *pnp_eisaformat(uint8_t *data); * == 0 - Maybe ISA, search for read data port * > 0 - ISA in system, value is read data port address */ -extern int isapnp_readport; +extern int isapnp_readport; /* * Version information @@ -178,12 +184,12 @@ const char bootprog_interp[] = "$Interpreter:" interps * Metadata are allocated on our heap, and copied into kernel space * before executing the kernel. */ -struct file_metadata +struct file_metadata { - size_t md_size; - uint16_t md_type; - struct file_metadata *md_next; - char md_data[1]; /* data are immediately appended */ + size_t md_size; + uint16_t md_type; + struct file_metadata *md_next; + char md_data[1]; /* data are immediately appended */ }; struct preloaded_file; @@ -191,11 +197,11 @@ struct mod_depend; struct kernel_module { - char *m_name; /* module name */ - int m_version; /* module version */ -/* char *m_args;*/ /* arguments for the module */ - struct preloaded_file *m_fp; - struct kernel_module *m_next; + char *m_name; /* module name */ + int m_version; /* module version */ + /* char *m_args; */ /* arguments for the module */ + struct preloaded_file *m_fp; + struct kernel_module *m_next; }; /* @@ -209,47 +215,54 @@ struct kernel_module */ struct preloaded_file { - char *f_name; /* file name */ - char *f_type; /* verbose file type, eg 'ELF kernel', 'pnptable', etc. */ - char *f_args; /* arguments for the file */ - struct file_metadata *f_metadata; /* metadata that will be placed in the module directory */ - int f_loader; /* index of the loader that read the file */ - vm_offset_t f_addr; /* load address */ - size_t f_size; /* file size */ - struct kernel_module *f_modules; /* list of modules if any */ - struct preloaded_file *f_next; /* next file */ + char *f_name; /* file name */ + char *f_type; /* verbose file type, eg 'ELF kernel', 'pnptable', etc. */ + char *f_args; /* arguments for the file */ + /* metadata that will be placed in the module directory */ + struct file_metadata *f_metadata; + int f_loader; /* index of the loader that read the file */ + vm_offset_t f_addr; /* load address */ + size_t f_size; /* file size */ + struct kernel_module *f_modules; /* list of modules if any */ + struct preloaded_file *f_next; /* next file */ }; struct file_format { - /* Load function must return EFTYPE if it can't handle the module supplied */ - int (* l_load)(char *filename, uint64_t dest, struct preloaded_file **result); - /* Only a loader that will load a kernel (first module) should have an exec handler */ - int (* l_exec)(struct preloaded_file *mp); + /* + * Load function must return EFTYPE if it can't handle + * the module supplied + */ + int (*l_load)(char *, uint64_t, struct preloaded_file **); + /* + * Only a loader that will load a kernel (first module) + * should have an exec handler + */ + int (*l_exec)(struct preloaded_file *); }; -extern struct file_format *file_formats[]; /* supplied by consumer */ -extern struct preloaded_file *preloaded_files; +extern struct file_format *file_formats[]; /* supplied by consumer */ +extern struct preloaded_file *preloaded_files; -int mod_load(char *name, struct mod_depend *verinfo, int argc, char *argv[]); -int mod_loadkld(const char *name, int argc, char *argv[]); -void unload(void); +int mod_load(char *name, struct mod_depend *verinfo, int argc, char *argv[]); +int mod_loadkld(const char *name, int argc, char *argv[]); +void unload(void); struct preloaded_file *file_alloc(void); struct preloaded_file *file_findfile(const char *name, const char *type); struct file_metadata *file_findmetadata(struct preloaded_file *fp, int type); struct preloaded_file *file_loadraw(const char *name, char *type, int insert); void file_discard(struct preloaded_file *fp); -void file_addmetadata(struct preloaded_file *fp, int type, size_t size, void *p); -int file_addmodule(struct preloaded_file *fp, char *modname, int version, - struct kernel_module **newmp); +void file_addmetadata(struct preloaded_file *, int, size_t, void *); +int file_addmodule(struct preloaded_file *, char *, int, + struct kernel_module **); void file_removemetadata(struct preloaded_file *fp); /* MI module loaders */ #ifdef __elfN /* Relocation types. */ -#define ELF_RELOC_REL 1 -#define ELF_RELOC_RELA 2 +#define ELF_RELOC_REL 1 +#define ELF_RELOC_RELA 2 /* Relocation offset for some architectures */ extern uint64_t __elfN(relocation_offset); @@ -257,35 +270,33 @@ extern uint64_t __elfN(relocation_offset); struct elf_file; typedef Elf_Addr (symaddr_fn)(struct elf_file *ef, Elf_Size symidx); -int __elfN(loadfile)(char *filename, uint64_t dest, struct preloaded_file **result); -int __elfN(obj_loadfile)(char *filename, uint64_t dest, - struct preloaded_file **result); +int __elfN(loadfile)(char *, uint64_t, struct preloaded_file **); +int __elfN(obj_loadfile)(char *, uint64_t, struct preloaded_file **); int __elfN(reloc)(struct elf_file *ef, symaddr_fn *symaddr, const void *reldata, int reltype, Elf_Addr relbase, Elf_Addr dataaddr, void *data, size_t len); -int __elfN(loadfile_raw)(char *filename, uint64_t dest, - struct preloaded_file **result, int multiboot); -int __elfN(load_modmetadata)(struct preloaded_file *fp, uint64_t dest); +int __elfN(loadfile_raw)(char *, uint64_t, struct preloaded_file **, int); +int __elfN(load_modmetadata)(struct preloaded_file *, uint64_t); #endif /* - * Support for commands + * Support for commands */ -struct bootblk_command +struct bootblk_command { const char *c_name; const char *c_desc; bootblk_cmd_t *c_fn; }; -#define COMMAND_SET(tag, key, desc, func) \ +#define COMMAND_SET(tag, key, desc, func) \ static bootblk_cmd_t func; \ static struct bootblk_command _cmd_ ## tag = { key, desc, func }; \ DATA_SET(Xcommand_set, _cmd_ ## tag) SET_DECLARE(Xcommand_set, struct bootblk_command); -/* +/* * The intention of the architecture switch is to provide a convenient * encapsulation of the interface between the bootstrap MI and MD code. * MD code may selectively populate the switch at runtime based on the @@ -293,49 +304,52 @@ SET_DECLARE(Xcommand_set, struct bootblk_command); */ struct arch_switch { - /* Automatically load modules as required by detected hardware */ - int (*arch_autoload)(void); - /* Locate the device for (name), return pointer to tail in (*path) */ - int (*arch_getdev)(void **dev, const char *name, const char **path); - /* Copy from local address space to module address space, similar to bcopy() */ - ssize_t (*arch_copyin)(const void *src, vm_offset_t dest, - const size_t len); - /* Copy to local address space from module address space, similar to bcopy() */ - ssize_t (*arch_copyout)(const vm_offset_t src, void *dest, - const size_t len); - /* Read from file to module address space, same semantics as read() */ - ssize_t (*arch_readin)(readin_handle_t fd, vm_offset_t dest, - const size_t len); - /* Perform ISA byte port I/O (only for systems with ISA) */ - int (*arch_isainb)(int port); - void (*arch_isaoutb)(int port, int value); + /* Automatically load modules as required by detected hardware */ + int (*arch_autoload)(void); + /* Locate the device for (name), return pointer to tail in (*path) */ + int (*arch_getdev)(void **dev, const char *name, const char **path); + /* + * Copy from local address space to module address space, + * similar to bcopy() + */ + ssize_t (*arch_copyin)(const void *, vm_offset_t, const size_t); + /* + * Copy to local address space from module address space, + * similar to bcopy() + */ + ssize_t (*arch_copyout)(const vm_offset_t, void *, const size_t); + /* Read from file to module address space, same semantics as read() */ + ssize_t (*arch_readin)(readin_handle_t, vm_offset_t, const size_t); + /* Perform ISA byte port I/O (only for systems with ISA) */ + int (*arch_isainb)(int port); + void (*arch_isaoutb)(int port, int value); - /* - * Interface to adjust the load address according to the "object" - * being loaded. - */ - uint64_t (*arch_loadaddr)(u_int type, void *data, uint64_t addr); + /* + * Interface to adjust the load address according to the "object" + * being loaded. + */ + uint64_t (*arch_loadaddr)(u_int type, void *data, uint64_t addr); #define LOAD_ELF 1 /* data points to the ELF header. */ #define LOAD_RAW 2 /* data points to the file name. */ - /* - * Interface to inform MD code about a loaded (ELF) segment. This - * can be used to flush caches and/or set up translations. - */ + /* + * Interface to inform MD code about a loaded (ELF) segment. This + * can be used to flush caches and/or set up translations. + */ #ifdef __elfN - void (*arch_loadseg)(Elf_Ehdr *eh, Elf_Phdr *ph, uint64_t delta); + void (*arch_loadseg)(Elf_Ehdr *eh, Elf_Phdr *ph, uint64_t delta); #else - void (*arch_loadseg)(void *eh, void *ph, uint64_t delta); + void (*arch_loadseg)(void *eh, void *ph, uint64_t delta); #endif - /* Probe ZFS pool(s), if needed. */ - void (*arch_zfs_probe)(void); + /* Probe ZFS pool(s), if needed. */ + void (*arch_zfs_probe)(void); - /* Return the hypervisor name/type or NULL if not virtualized. */ - const char *(*arch_hypervisor)(void); + /* Return the hypervisor name/type or NULL if not virtualized. */ + const char *(*arch_hypervisor)(void); - /* For kexec-type loaders, get ksegment structure */ - void (*arch_kexec_kseg_get)(int *nseg, void **kseg); + /* For kexec-type loaders, get ksegment structure */ + void (*arch_kexec_kseg_get)(int *nseg, void **kseg); }; extern struct arch_switch archsw; From owner-svn-src-head@freebsd.org Sun Nov 8 09:49:52 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 141F32EBDF2; Sun, 8 Nov 2020 09:49:52 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTTr006fgz3F1v; Sun, 8 Nov 2020 09:49:52 +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 EB2C11DE21; Sun, 8 Nov 2020 09:49:51 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A89npsB017824; Sun, 8 Nov 2020 09:49:51 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A89nplr017823; Sun, 8 Nov 2020 09:49:51 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202011080949.0A89nplr017823@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 8 Nov 2020 09:49:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367480 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 367480 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 08 Nov 2020 09:49:52 -0000 Author: tsoome Date: Sun Nov 8 09:49:51 2020 New Revision: 367480 URL: https://svnweb.freebsd.org/changeset/base/367480 Log: loader: cstyle cleanup of bootstrap.h did miss a bit correct small issues - misplaced comment and typos. Modified: head/stand/common/bootstrap.h Modified: head/stand/common/bootstrap.h ============================================================================== --- head/stand/common/bootstrap.h Sun Nov 8 09:35:41 2020 (r367479) +++ head/stand/common/bootstrap.h Sun Nov 8 09:49:51 2020 (r367480) @@ -111,10 +111,10 @@ struct console /* reinit XXX may need more args */ int (* c_init)(int arg); /* emit c */ - void (* c_out)(int c); - int (* c_in)(void); + void (* c_out)(int c); /* wait for and return input */ - /* return nonzer if input waiting */ + int (* c_in)(void); + /* return nonzero if input waiting */ int (* c_ready)(void); }; extern struct console *consoles[]; From owner-svn-src-head@freebsd.org Sun Nov 8 09:51:00 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5FC3B2EBE79; Sun, 8 Nov 2020 09:51:00 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTTsJ1Wbkz3FTl; Sun, 8 Nov 2020 09:51:00 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C33A1DE9A; Sun, 8 Nov 2020 09:51:00 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A89p0DM017966; Sun, 8 Nov 2020 09:51:00 GMT (envelope-from netchild@FreeBSD.org) Received: (from netchild@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A89oxrZ017960; Sun, 8 Nov 2020 09:50:59 GMT (envelope-from netchild@FreeBSD.org) Message-Id: <202011080950.0A89oxrZ017960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: netchild set sender to netchild@FreeBSD.org using -f From: Alexander Leidinger Date: Sun, 8 Nov 2020 09:50:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367481 - in head: share/man/man4 sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: netchild X-SVN-Commit-Paths: in head: share/man/man4 sys/compat/linux X-SVN-Commit-Revision: 367481 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 08 Nov 2020 09:51:00 -0000 Author: netchild Date: Sun Nov 8 09:50:58 2020 New Revision: 367481 URL: https://svnweb.freebsd.org/changeset/base/367481 Log: - add more linux socket options (sorted by value) - map those IPv4 / IPv6 socket options which exist in FreeBSD + most of them visually verified to have the same type/layout of arguments + not tested with linux programs to behave as intended - be more human readable for known options which are not handled - be more verbose for unhandled socket message flags we know about - print the jail ID in linux_msg if run in a jail - add possibility to print debug message about known missing parts only once - add multiple levels of sysctl linux.debug: 1: print debug messages, tell about unimplemented stuff (only once) 2: like 1, but also print messages about implemented but not tested stuff (only once) 3+: like 2, but no rate limiting of messages - increase default linux debug level from 1 to 3 We are a lot more verbose in as we need to be (e.g. some of the IP socket options which are the same, and share the same memory layout, and are believed to work). The reason is that we have no good testsuite to test those linux-bits. The LTP or other test suites like the python one, are not fully up to the task we need. As such the excessive messages about emulated but not tested socket options. IMO any MFC (possible, but most probably not by me) should set the default debug level to 1. Discussed with: trasz Modified: head/share/man/man4/linux.4 head/sys/compat/linux/linux_mib.c head/sys/compat/linux/linux_socket.c head/sys/compat/linux/linux_socket.h head/sys/compat/linux/linux_util.c head/sys/compat/linux/linux_util.h Modified: head/share/man/man4/linux.4 ============================================================================== --- head/share/man/man4/linux.4 Sun Nov 8 09:49:51 2020 (r367480) +++ head/share/man/man4/linux.4 Sun Nov 8 09:50:58 2020 (r367481) @@ -98,7 +98,12 @@ tunables: .It Va compat.linux.debug Enable debugging messages. Set to 0 to silence them. -Defaults to 1. +Defaults to 3. +A setting of 1 prints debug messages, tells about unimplemented stuff (only +once). +Set to 2 is like 1, but also prints messages about implemented but not tested +stuff (only once). +Setting it to 3 or higher is like 2, but no rate limiting of messages. .It Va compat.linux.default_openfiles Default soft openfiles resource limit for Linux applications. Set to -1 to disable the limit. Modified: head/sys/compat/linux/linux_mib.c ============================================================================== --- head/sys/compat/linux/linux_mib.c Sun Nov 8 09:49:51 2020 (r367480) +++ head/sys/compat/linux/linux_mib.c Sun Nov 8 09:50:58 2020 (r367481) @@ -63,7 +63,7 @@ static unsigned linux_osd_jail_slot; SYSCTL_NODE(_compat, OID_AUTO, linux, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Linux mode"); -int linux_debug = 1; +int linux_debug = 3; SYSCTL_INT(_compat_linux, OID_AUTO, debug, CTLFLAG_RWTUN, &linux_debug, 0, "Log warnings from linux(4); or 0 to disable"); Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Sun Nov 8 09:49:51 2020 (r367480) +++ head/sys/compat/linux/linux_socket.c Sun Nov 8 09:50:58 2020 (r367481) @@ -112,12 +112,37 @@ linux_to_bsd_ip_sockopt(int opt) { switch (opt) { + /* known and translated sockopts */ case LINUX_IP_TOS: return (IP_TOS); case LINUX_IP_TTL: return (IP_TTL); + case LINUX_IP_HDRINCL: + return (IP_HDRINCL); case LINUX_IP_OPTIONS: return (IP_OPTIONS); + case LINUX_IP_RECVOPTS: + LINUX_RATELIMIT_MSG_NOTTESTED("IPv4 socket option IP_RECVOPTS"); + return (IP_RECVOPTS); + case LINUX_IP_RETOPTS: + LINUX_RATELIMIT_MSG_NOTTESTED("IPv4 socket option IP_REETOPTS"); + return (IP_RETOPTS); + case LINUX_IP_RECVTTL: + LINUX_RATELIMIT_MSG_NOTTESTED("IPv4 socket option IP_RECVTTL"); + return (IP_RECVTTL); + case LINUX_IP_RECVTOS: + LINUX_RATELIMIT_MSG_NOTTESTED("IPv4 socket option IP_RECVTOS"); + return (IP_RECVTOS); + case LINUX_IP_FREEBIND: + LINUX_RATELIMIT_MSG_NOTTESTED("IPv4 socket option IP_FREEBIND"); + return (IP_BINDANY); + case LINUX_IP_IPSEC_POLICY: + /* we have this option, but not documented in ip(4) manpage */ + LINUX_RATELIMIT_MSG_NOTTESTED("IPv4 socket option IP_IPSEC_POLICY"); + return (IP_IPSEC_POLICY); + case LINUX_IP_MINTTL: + LINUX_RATELIMIT_MSG_NOTTESTED("IPv4 socket option IP_MINTTL"); + return (IP_MINTTL); case LINUX_IP_MULTICAST_IF: return (IP_MULTICAST_IF); case LINUX_IP_MULTICAST_TTL: @@ -128,10 +153,120 @@ linux_to_bsd_ip_sockopt(int opt) return (IP_ADD_MEMBERSHIP); case LINUX_IP_DROP_MEMBERSHIP: return (IP_DROP_MEMBERSHIP); - case LINUX_IP_HDRINCL: - return (IP_HDRINCL); + case LINUX_IP_UNBLOCK_SOURCE: + LINUX_RATELIMIT_MSG_NOTTESTED("IPv4 socket option IP_UNBLOCK_SOURCE"); + return (IP_UNBLOCK_SOURCE); + case LINUX_IP_BLOCK_SOURCE: + LINUX_RATELIMIT_MSG_NOTTESTED("IPv4 socket option IP_BLOCK_SOURCE"); + return (IP_BLOCK_SOURCE); + case LINUX_IP_ADD_SOURCE_MEMBERSHIP: + LINUX_RATELIMIT_MSG_NOTTESTED("IPv4 socket option IP_ADD_SOURCE_MEMBERSHIP"); + return (IP_ADD_SOURCE_MEMBERSHIP); + case LINUX_IP_DROP_SOURCE_MEMBERSHIP: + LINUX_RATELIMIT_MSG_NOTTESTED("IPv4 socket option IP_DROP_SOURCE_MEMBERSHIP"); + return (IP_DROP_SOURCE_MEMBERSHIP); + case LINUX_MCAST_JOIN_GROUP: + LINUX_RATELIMIT_MSG_NOTTESTED("IPv4 socket option IP_MCAST_JOIN_GROUP"); + return (MCAST_JOIN_GROUP); + case LINUX_MCAST_LEAVE_GROUP: + LINUX_RATELIMIT_MSG_NOTTESTED("IPv4 socket option IP_MCAST_LEAVE_GROUP"); + return (MCAST_LEAVE_GROUP); + case LINUX_MCAST_JOIN_SOURCE_GROUP: + LINUX_RATELIMIT_MSG_NOTTESTED("IPv4 socket option IP_MCAST_JOIN_SOURCE_GROUP"); + return (MCAST_JOIN_SOURCE_GROUP); + case LINUX_MCAST_LEAVE_SOURCE_GROUP: + LINUX_RATELIMIT_MSG_NOTTESTED("IPv4 socket option IP_MCAST_LEAVE_SOURCE_GROUP"); + return (MCAST_LEAVE_SOURCE_GROUP); + + /* known but not implemented sockopts */ + case LINUX_IP_ROUTER_ALERT: + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv4 socket option IP_ROUTER_ALERT (%d), you can not do user-space routing from linux programs", + opt); + return (-2); + case LINUX_IP_PKTINFO: + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv4 socket option IP_PKTINFO (%d), you can not get extended packet info for datagram sockets in linux programs", + opt); + return (-2); + case LINUX_IP_PKTOPTIONS: + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv4 socket option IP_PKTOPTIONS (%d)", + opt); + return (-2); + case LINUX_IP_MTU_DISCOVER: + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv4 socket option IP_MTU_DISCOVER (%d), your linux program can not control path-MTU discovery", + opt); + return (-2); + case LINUX_IP_RECVERR: + /* needed by steam */ + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv4 socket option IP_RECVERR (%d), you can not get extended reliability info in linux programs", + opt); + return (-2); + case LINUX_IP_MTU: + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv4 socket option IP_MTU (%d), your linux program can not control the MTU on this socket", + opt); + return (-2); + case LINUX_IP_XFRM_POLICY: + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv4 socket option IP_XFRM_POLICY (%d)", + opt); + return (-2); + case LINUX_IP_PASSSEC: + /* needed by steam */ + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv4 socket option IP_PASSSEC (%d), you can not get IPSEC related credential information associated with this socket in linux programs -- if you do not use IPSEC, you can ignore this", + opt); + return (-2); + case LINUX_IP_TRANSPARENT: + /* IP_BINDANY or more? */ + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv4 socket option IP_TRANSPARENT (%d), you can not enable transparent proxying in linux programs -- note, IP_FREEBIND is supported, no idea if the FreeBSD IP_BINDANY is equivalent to the Linux IP_TRANSPARENT or not, any info is welcome", + opt); + return (-2); + case LINUX_IP_NODEFRAG: + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv4 socket option IP_NODEFRAG (%d)", + opt); + return (-2); + case LINUX_IP_CHECKSUM: + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv4 socket option IP_CHECKSUM (%d)", + opt); + return (-2); + case LINUX_IP_BIND_ADDRESS_NO_PORT: + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv4 socket option IP_BIND_ADDRESS_NO_PORT (%d)", + opt); + return (-2); + case LINUX_IP_RECVFRAGSIZE: + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv4 socket option IP_RECVFRAGSIZE (%d)", + opt); + return (-2); + case LINUX_MCAST_MSFILTER: + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv4 socket option IP_MCAST_MSFILTER (%d)", + opt); + return (-2); + case LINUX_IP_MULTICAST_ALL: + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv4 socket option IP_MULTICAST_ALL (%d), your linux program will not see all multicast groups joined by the entire system, only those the program joined itself on this socket", + opt); + return (-2); + case LINUX_IP_UNICAST_IF: + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv4 socket option IP_UNICAST_IF (%d)", + opt); + return (-2); + + /* unknown sockopts */ + default: + return (-1); } - return (-1); } static int @@ -139,6 +274,28 @@ linux_to_bsd_ip6_sockopt(int opt) { switch (opt) { + /* known and translated sockopts */ + case LINUX_IPV6_2292PKTINFO: + LINUX_RATELIMIT_MSG_NOTTESTED("IPv6 socket option IPV6_2292PKTINFO"); + return (IPV6_2292PKTINFO); + case LINUX_IPV6_2292HOPOPTS: + LINUX_RATELIMIT_MSG_NOTTESTED("IPv6 socket option IPV6_2292HOPOPTS"); + return (IPV6_2292HOPOPTS); + case LINUX_IPV6_2292DSTOPTS: + LINUX_RATELIMIT_MSG_NOTTESTED("IPv6 socket option IPV6_2292DSTOPTS"); + return (IPV6_2292DSTOPTS); + case LINUX_IPV6_2292RTHDR: + LINUX_RATELIMIT_MSG_NOTTESTED("IPv6 socket option IPV6_2292RTHDR"); + return (IPV6_2292RTHDR); + case LINUX_IPV6_2292PKTOPTIONS: + LINUX_RATELIMIT_MSG_NOTTESTED("IPv6 socket option IPV6_2292PKTOPTIONS"); + return (IPV6_2292PKTOPTIONS); + case LINUX_IPV6_CHECKSUM: + LINUX_RATELIMIT_MSG_NOTTESTED("IPv6 socket option IPV6_CHECKSUM"); + return (IPV6_CHECKSUM); + case LINUX_IPV6_2292HOPLIMIT: + LINUX_RATELIMIT_MSG_NOTTESTED("IPv6 socket option IPV6_2292HOPLIMIT"); + return (IPV6_2292HOPLIMIT); case LINUX_IPV6_NEXTHOP: return (IPV6_NEXTHOP); case LINUX_IPV6_UNICAST_HOPS: @@ -155,40 +312,194 @@ linux_to_bsd_ip6_sockopt(int opt) return (IPV6_LEAVE_GROUP); case LINUX_IPV6_V6ONLY: return (IPV6_V6ONLY); - case LINUX_IPV6_DONTFRAG: - return (IPV6_DONTFRAG); -#if 0 - case LINUX_IPV6_CHECKSUM: - return (IPV6_CHECKSUM); + case LINUX_IPV6_IPSEC_POLICY: + /* we have this option, but not documented in ip6(4) manpage */ + LINUX_RATELIMIT_MSG_NOTTESTED("IPv6 socket option IPV6_IPSEC_POLICY"); + return (IPV6_IPSEC_POLICY); + case LINUX_MCAST_JOIN_GROUP: + LINUX_RATELIMIT_MSG_NOTTESTED("IPv6 socket option IPV6_JOIN_GROUP"); + return (IPV6_JOIN_GROUP); + case LINUX_MCAST_LEAVE_GROUP: + LINUX_RATELIMIT_MSG_NOTTESTED("IPv6 socket option IPV6_LEAVE_GROUP"); + return (IPV6_LEAVE_GROUP); case LINUX_IPV6_RECVPKTINFO: + LINUX_RATELIMIT_MSG_NOTTESTED("IPv6 socket option IPV6_RECVPKTINFO"); return (IPV6_RECVPKTINFO); case LINUX_IPV6_PKTINFO: + LINUX_RATELIMIT_MSG_NOTTESTED("IPv6 socket option IPV6_PKTINFO"); return (IPV6_PKTINFO); case LINUX_IPV6_RECVHOPLIMIT: + LINUX_RATELIMIT_MSG_NOTTESTED("IPv6 socket option IPV6_RECVHOPLIMIT"); return (IPV6_RECVHOPLIMIT); case LINUX_IPV6_HOPLIMIT: + LINUX_RATELIMIT_MSG_NOTTESTED("IPv6 socket option IPV6_HOPLIMIT"); return (IPV6_HOPLIMIT); case LINUX_IPV6_RECVHOPOPTS: + LINUX_RATELIMIT_MSG_NOTTESTED("IPv6 socket option IPV6_RECVHOPOPTS"); return (IPV6_RECVHOPOPTS); case LINUX_IPV6_HOPOPTS: + LINUX_RATELIMIT_MSG_NOTTESTED("IPv6 socket option IPV6_HOPOPTS"); return (IPV6_HOPOPTS); case LINUX_IPV6_RTHDRDSTOPTS: + LINUX_RATELIMIT_MSG_NOTTESTED("IPv6 socket option IPV6_RTHDRDSTOPTS"); return (IPV6_RTHDRDSTOPTS); case LINUX_IPV6_RECVRTHDR: + LINUX_RATELIMIT_MSG_NOTTESTED("IPv6 socket option IPV6_RECVRTHDR"); return (IPV6_RECVRTHDR); case LINUX_IPV6_RTHDR: + LINUX_RATELIMIT_MSG_NOTTESTED("IPv6 socket option IPV6_RTHDR"); return (IPV6_RTHDR); case LINUX_IPV6_RECVDSTOPTS: + LINUX_RATELIMIT_MSG_NOTTESTED("IPv6 socket option IPV6_RECVDSTOPTS"); return (IPV6_RECVDSTOPTS); case LINUX_IPV6_DSTOPTS: + LINUX_RATELIMIT_MSG_NOTTESTED("IPv6 socket option IPV6_DSTOPTS"); return (IPV6_DSTOPTS); case LINUX_IPV6_RECVPATHMTU: + LINUX_RATELIMIT_MSG_NOTTESTED("IPv6 socket option IPV6_RECVPATHMTU"); return (IPV6_RECVPATHMTU); case LINUX_IPV6_PATHMTU: + LINUX_RATELIMIT_MSG_NOTTESTED("IPv6 socket option IPV6_PATHMTU"); return (IPV6_PATHMTU); -#endif + case LINUX_IPV6_DONTFRAG: + return (IPV6_DONTFRAG); + case LINUX_IPV6_AUTOFLOWLABEL: + LINUX_RATELIMIT_MSG_NOTTESTED("IPv6 socket option IPV6_AUTOFLOWLABEL"); + return (IPV6_AUTOFLOWLABEL); + case LINUX_IPV6_ORIGDSTADDR: + LINUX_RATELIMIT_MSG_NOTTESTED("IPv6 socket option IPV6_ORIGDSTADDR"); + return (IPV6_ORIGDSTADDR); + case LINUX_IPV6_FREEBIND: + LINUX_RATELIMIT_MSG_NOTTESTED("IPv6 socket option IPV6_FREEBIND"); + return (IPV6_BINDANY); + + /* known but not implemented sockopts */ + case LINUX_IPV6_ADDRFORM: + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv6 socket option IPV6_ADDRFORM (%d), you linux program can not convert the socket to IPv4", + opt); + return (-2); + case LINUX_IPV6_AUTHHDR: + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv6 socket option IPV6_AUTHHDR (%d), your linux program can not get the authentication header info of IPv6 packets", + opt); + return (-2); + case LINUX_IPV6_FLOWINFO: + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv6 socket option IPV6_FLOWINFO (%d), your linux program can not get the flowid of IPv6 packets", + opt); + return (-2); + case LINUX_IPV6_ROUTER_ALERT: + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv6 socket option IPV6_ROUTER_ALERT (%d), you can not do user-space routing from linux programs", + opt); + return (-2); + case LINUX_IPV6_MTU_DISCOVER: + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv6 socket option IPV6_MTU_DISCOVER (%d), your linux program can not control path-MTU discovery", + opt); + return (-2); + case LINUX_IPV6_MTU: + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv6 socket option IPV6_MTU (%d), your linux program can not control the MTU on this socket", + opt); + return (-2); + case LINUX_IPV6_JOIN_ANYCAST: + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv6 socket option IPV6_JOIN_ANYCAST (%d)", + opt); + return (-2); + case LINUX_IPV6_LEAVE_ANYCAST: + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv6 socket option IPV6_LEAVE_ANYCAST (%d)", + opt); + return (-2); + case LINUX_IPV6_MULTICAST_ALL: + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv6 socket option IPV6_MULTICAST_ALL (%d)", + opt); + return (-2); + case LINUX_IPV6_ROUTER_ALERT_ISOLATE: + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv6 socket option IPV6_ROUTER_ALERT_ISOLATE (%d)", + opt); + return (-2); + case LINUX_IPV6_FLOWLABEL_MGR: + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv6 socket option IPV6_FLOWLABEL_MGR (%d)", + opt); + return (-2); + case LINUX_IPV6_FLOWINFO_SEND: + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv6 socket option IPV6_FLOWINFO_SEND (%d)", + opt); + return (-2); + case LINUX_IPV6_XFRM_POLICY: + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv6 socket option IPV6_XFRM_POLICY (%d)", + opt); + return (-2); + case LINUX_IPV6_HDRINCL: + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv6 socket option IPV6_HDRINCL (%d)", + opt); + return (-2); + case LINUX_MCAST_BLOCK_SOURCE: + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv6 socket option MCAST_BLOCK_SOURCE (%d), your linux program may see more multicast stuff than it wants", + opt); + return (-2); + case LINUX_MCAST_UNBLOCK_SOURCE: + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv6 socket option MCAST_UNBLOCK_SOURCE (%d), your linux program may not see all the multicast stuff it wants", + opt); + return (-2); + case LINUX_MCAST_JOIN_SOURCE_GROUP: + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv6 socket option MCAST_JOIN_SOURCE_GROUP (%d), your linux program is not able to join a multicast source group", + opt); + return (-2); + case LINUX_MCAST_LEAVE_SOURCE_GROUP: + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv6 socket option MCAST_LEAVE_SOURCE_GROUP (%d), your linux program is not able to leave a multicast source group -- but it was also not able to join one, so no issue", + opt); + return (-2); + case LINUX_MCAST_MSFILTER: + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv6 socket option MCAST_MSFILTER (%d), your linux program can not manipulate the multicast filter, it may see more multicast data than it wants to see", + opt); + return (-2); + case LINUX_IPV6_ADDR_PREFERENCES: + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv6 socket option IPV6_ADDR_PREFERENCES (%d)", + opt); + return (-2); + case LINUX_IPV6_MINHOPCOUNT: + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv6 socket option IPV6_MINHOPCOUNT (%d)", + opt); + return (-2); + case LINUX_IPV6_TRANSPARENT: + /* IP_BINDANY or more? */ + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv6 socket option IPV6_TRANSPARENT (%d), you can not enable transparent proxying in linux programs -- note, IP_FREEBIND is supported, no idea if the FreeBSD IP_BINDANY is equivalent to the Linux IP_TRANSPARENT or not, any info is welcome", + opt); + return (-2); + case LINUX_IPV6_UNICAST_IF: + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv6 socket option IPV6_UNICAST_IF (%d)", + opt); + return (-2); + case LINUX_IPV6_RECVFRAGSIZE: + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv6 socket option IPV6_RECVFRAGSIZE (%d)", + opt); + return (-2); + + /* unknown sockopts */ + default: + return (-1); } - return (-1); } static int @@ -290,20 +601,24 @@ linux_to_bsd_msg_flags(int flags) ret_flags |= MSG_WAITALL; if (flags & LINUX_MSG_NOSIGNAL) ret_flags |= MSG_NOSIGNAL; -#if 0 /* not handled */ if (flags & LINUX_MSG_PROXY) - ; + LINUX_RATELIMIT_MSG_OPT1("socket message flag MSG_PROXY (%d) not handled", + LINUX_MSG_PROXY); if (flags & LINUX_MSG_FIN) - ; + LINUX_RATELIMIT_MSG_OPT1("socket message flag MSG_FIN (%d) not handled", + LINUX_MSG_FIN); if (flags & LINUX_MSG_SYN) - ; + LINUX_RATELIMIT_MSG_OPT1("socket message flag MSG_SYN (%d) not handled", + LINUX_MSG_SYN); if (flags & LINUX_MSG_CONFIRM) - ; + LINUX_RATELIMIT_MSG_OPT1("socket message flag MSG_CONFIRM (%d) not handled", + LINUX_MSG_CONFIRM); if (flags & LINUX_MSG_RST) - ; + LINUX_RATELIMIT_MSG_OPT1("socket message flag MSG_RST (%d) not handled", + LINUX_MSG_RST); if (flags & LINUX_MSG_ERRQUEUE) - ; -#endif + LINUX_RATELIMIT_MSG_OPT1("socket message flag MSG_ERRQUEUE (%d) not handled", + LINUX_MSG_ERRQUEUE); return (ret_flags); } @@ -1505,10 +1820,11 @@ linux_setsockopt(struct thread *td, struct linux_setso name = -1; break; } - if (name == -1) { - linux_msg(curthread, - "unsupported setsockopt level %d optname %d", - args->level, args->optname); + if (name < 0) { + if (name == -1) + linux_msg(curthread, + "unsupported setsockopt level %d optname %d", + args->level, args->optname); return (ENOPROTOOPT); } @@ -1605,10 +1921,11 @@ linux_getsockopt(struct thread *td, struct linux_getso name = -1; break; } - if (name == -1) { - linux_msg(curthread, - "unsupported getsockopt level %d optname %d", - args->level, args->optname); + if (name < 0) { + if (name == -1) + linux_msg(curthread, + "unsupported getsockopt level %d optname %d", + args->level, args->optname); return (EINVAL); } Modified: head/sys/compat/linux/linux_socket.h ============================================================================== --- head/sys/compat/linux/linux_socket.h Sun Nov 8 09:49:51 2020 (r367480) +++ head/sys/compat/linux/linux_socket.h Sun Nov 8 09:50:58 2020 (r367481) @@ -204,24 +204,84 @@ int linux_accept(struct thread *td, struct linux_accep #define LINUX_IP_TTL 2 #define LINUX_IP_HDRINCL 3 #define LINUX_IP_OPTIONS 4 +#define LINUX_IP_ROUTER_ALERT 5 +#define LINUX_IP_RECVOPTS 6 +#define LINUX_IP_RETOPTS 7 +#define LINUX_IP_PKTINFO 8 +#define LINUX_IP_PKTOPTIONS 9 +#define LINUX_IP_MTU_DISCOVER 10 #define LINUX_IP_RECVERR 11 +#define LINUX_IP_RECVTTL 12 +#define LINUX_IP_RECVTOS 13 +#define LINUX_IP_MTU 14 +#define LINUX_IP_FREEBIND 15 +#define LINUX_IP_IPSEC_POLICY 16 +#define LINUX_IP_XFRM_POLICY 17 +#define LINUX_IP_PASSSEC 18 +#define LINUX_IP_TRANSPARENT 19 +#define LINUX_IP_MINTTL 21 +#define LINUX_IP_NODEFRAG 22 +#define LINUX_IP_CHECKSUM 23 +#define LINUX_IP_BIND_ADDRESS_NO_PORT 24 +#define LINUX_IP_RECVFRAGSIZE 25 + #define LINUX_IP_MULTICAST_IF 32 #define LINUX_IP_MULTICAST_TTL 33 #define LINUX_IP_MULTICAST_LOOP 34 #define LINUX_IP_ADD_MEMBERSHIP 35 #define LINUX_IP_DROP_MEMBERSHIP 36 +#define LINUX_IP_UNBLOCK_SOURCE 37 +#define LINUX_IP_BLOCK_SOURCE 38 +#define LINUX_IP_ADD_SOURCE_MEMBERSHIP 39 +#define LINUX_IP_DROP_SOURCE_MEMBERSHIP 40 +#define LINUX_IP_MSFILTER 41 +#define LINUX_MCAST_JOIN_GROUP 42 +#define LINUX_MCAST_BLOCK_SOURCE 43 +#define LINUX_MCAST_UNBLOCK_SOURCE 44 +#define LINUX_MCAST_LEAVE_GROUP 45 +#define LINUX_MCAST_JOIN_SOURCE_GROUP 46 +#define LINUX_MCAST_LEAVE_SOURCE_GROUP 47 +#define LINUX_MCAST_MSFILTER 48 +#define LINUX_IP_MULTICAST_ALL 49 +#define LINUX_IP_UNICAST_IF 50 + +#define LINUX_IPV6_ADDRFORM 1 +#define LINUX_IPV6_2292PKTINFO 2 +#define LINUX_IPV6_2292HOPOPTS 3 +#define LINUX_IPV6_2292DSTOPTS 4 +#define LINUX_IPV6_2292RTHDR 5 +#define LINUX_IPV6_2292PKTOPTIONS 6 #define LINUX_IPV6_CHECKSUM 7 +#define LINUX_IPV6_2292HOPLIMIT 8 #define LINUX_IPV6_NEXTHOP 9 +#define LINUX_IPV6_AUTHHDR 10 +#define LINUX_IPV6_FLOWINFO 11 + #define LINUX_IPV6_UNICAST_HOPS 16 #define LINUX_IPV6_MULTICAST_IF 17 #define LINUX_IPV6_MULTICAST_HOPS 18 #define LINUX_IPV6_MULTICAST_LOOP 19 #define LINUX_IPV6_ADD_MEMBERSHIP 20 #define LINUX_IPV6_DROP_MEMBERSHIP 21 +#define LINUX_IPV6_ROUTER_ALERT 22 +#define LINUX_IPV6_MTU_DISCOVER 23 +#define LINUX_IPV6_MTU 24 +#define LINUX_IPV6_RECVERR 25 #define LINUX_IPV6_V6ONLY 26 +#define LINUX_IPV6_JOIN_ANYCAST 27 +#define LINUX_IPV6_LEAVE_ANYCAST 28 +#define LINUX_IPV6_MULTICAST_ALL 29 +#define LINUX_IPV6_ROUTER_ALERT_ISOLATE 30 +#define LINUX_IPV6_FLOWLABEL_MGR 32 +#define LINUX_IPV6_FLOWINFO_SEND 33 + +#define LINUX_IPV6_IPSEC_POLICY 34 +#define LINUX_IPV6_XFRM_POLICY 35 +#define LINUX_IPV6_HDRINCL 36 + #define LINUX_IPV6_RECVPKTINFO 49 #define LINUX_IPV6_PKTINFO 50 #define LINUX_IPV6_RECVHOPLIMIT 51 @@ -236,6 +296,15 @@ int linux_accept(struct thread *td, struct linux_accep #define LINUX_IPV6_RECVPATHMTU 60 #define LINUX_IPV6_PATHMTU 61 #define LINUX_IPV6_DONTFRAG 62 + +#define LINUX_IPV6_AUTOFLOWLABEL 70 +#define LINUX_IPV6_ADDR_PREFERENCES 72 +#define LINUX_IPV6_MINHOPCOUNT 73 +#define LINUX_IPV6_ORIGDSTADDR 74 +#define LINUX_IPV6_TRANSPARENT 75 +#define LINUX_IPV6_UNICAST_IF 76 +#define LINUX_IPV6_RECVFRAGSIZE 77 +#define LINUX_IPV6_FREEBIND 78 #define LINUX_TCP_NODELAY 1 #define LINUX_TCP_MAXSEG 2 Modified: head/sys/compat/linux/linux_util.c ============================================================================== --- head/sys/compat/linux/linux_util.c Sun Nov 8 09:49:51 2020 (r367480) +++ head/sys/compat/linux/linux_util.c Sun Nov 8 09:50:58 2020 (r367481) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -96,7 +97,8 @@ linux_msg(const struct thread *td, const char *fmt, .. return; p = td->td_proc; - printf("linux: pid %d (%s): ", (int)p->p_pid, p->p_comm); + printf("linux: jid %d pid %d (%s): ", p->p_ucred->cr_prison->pr_id, + (int)p->p_pid, p->p_comm); va_start(ap, fmt); vprintf(fmt, ap); va_end(ap); Modified: head/sys/compat/linux/linux_util.h ============================================================================== --- head/sys/compat/linux/linux_util.h Sun Nov 8 09:49:51 2020 (r367480) +++ head/sys/compat/linux/linux_util.h Sun Nov 8 09:50:58 2020 (r367481) @@ -155,4 +155,33 @@ void linux_free_get_char_devices(char *string); #define LINUX_CTR6(f, m, p1, p2, p3, p4, p5, p6) #endif -#endif /* !_LINUX_UTIL_H_ */ +/* + * Some macros for rate limiting messages: + * - noisy if compat.linux.debug = 1 + * - print only once if compat.linux.debug > 1 + */ +#define LINUX_RATELIMIT_MSG_NOTTESTED(_what) \ + do { \ + static int seen = 0; \ + \ + if (seen == 0 && linux_debug >= 2) { \ + linux_msg(curthread, "%s is not tested, please report on emulation@FreeBSD.org how it works", _what); \ + \ + if (linux_debug < 3) \ + seen = 1; \ + } \ + } while (0) + +#define LINUX_RATELIMIT_MSG_OPT1(_message, _opt1) \ + do { \ + static int seen = 0; \ + \ + if (seen == 0) { \ + linux_msg(curthread, _message, _opt1); \ + \ + if (linux_debug < 3) \ + seen = 1; \ + } \ + } while (0) + +#endif /* ! _LINUX_UTIL_H_ */ From owner-svn-src-head@freebsd.org Sun Nov 8 11:12:01 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 791492EDBBB; Sun, 8 Nov 2020 11:12:01 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTWfn33KHz3K7p; Sun, 8 Nov 2020 11:12:01 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B7D41F008; Sun, 8 Nov 2020 11:12:01 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A8BC1Sr072364; Sun, 8 Nov 2020 11:12:01 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A8BC019072361; Sun, 8 Nov 2020 11:12:00 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202011081112.0A8BC019072361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 8 Nov 2020 11:12:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367484 - in head/sys: conf net X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: in head/sys: conf net X-SVN-Commit-Revision: 367484 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 08 Nov 2020 11:12:01 -0000 Author: melifaro Date: Sun Nov 8 11:12:00 2020 New Revision: 367484 URL: https://svnweb.freebsd.org/changeset/base/367484 Log: Move all ifaddr route creation business logic to net/route/route_ifaddr.c Differential Revision: https://reviews.freebsd.org/D26318 Modified: head/sys/conf/files head/sys/net/if.c head/sys/net/route.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Nov 8 10:13:06 2020 (r367483) +++ head/sys/conf/files Sun Nov 8 11:12:00 2020 (r367484) @@ -4174,6 +4174,7 @@ net/route/nhop_utils.c standard net/route/route_ctl.c standard net/route/route_ddb.c optional ddb net/route/route_helpers.c standard +net/route/route_ifaddrs.c standard net/route/route_tables.c standard net/route/route_temporal.c standard net/rss_config.c optional inet rss | inet6 rss Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sun Nov 8 10:13:06 2020 (r367483) +++ head/sys/net/if.c Sun Nov 8 11:12:00 2020 (r367484) @@ -1842,76 +1842,6 @@ ifa_free(struct ifaddr *ifa) NET_EPOCH_CALL(ifa_destroy, &ifa->ifa_epoch_ctx); } -static int -ifa_maintain_loopback_route(int cmd, const char *otype, struct ifaddr *ifa, - struct sockaddr *ia) -{ - struct rib_cmd_info rc; - struct epoch_tracker et; - int error; - struct rt_addrinfo info; - struct sockaddr_dl null_sdl; - struct ifnet *ifp; - struct ifaddr *rti_ifa = NULL; - - ifp = ifa->ifa_ifp; - - NET_EPOCH_ENTER(et); - bzero(&info, sizeof(info)); - if (cmd != RTM_DELETE) - info.rti_ifp = V_loif; - if (cmd == RTM_ADD) { - /* explicitly specify (loopback) ifa */ - if (info.rti_ifp != NULL) { - rti_ifa = ifaof_ifpforaddr(ifa->ifa_addr, info.rti_ifp); - if (rti_ifa != NULL) - ifa_ref(rti_ifa); - info.rti_ifa = rti_ifa; - } - } - info.rti_flags = ifa->ifa_flags | RTF_HOST | RTF_STATIC | RTF_PINNED; - info.rti_info[RTAX_DST] = ia; - info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl; - link_init_sdl(ifp, (struct sockaddr *)&null_sdl, ifp->if_type); - - error = rib_action(ifp->if_fib, cmd, &info, &rc); - NET_EPOCH_EXIT(et); - - if (rti_ifa != NULL) - ifa_free(rti_ifa); - - if (error == 0 || - (cmd == RTM_ADD && error == EEXIST) || - (cmd == RTM_DELETE && (error == ENOENT || error == ESRCH))) - return (error); - - log(LOG_DEBUG, "%s: %s failed for interface %s: %u\n", - __func__, otype, if_name(ifp), error); - - return (error); -} - -int -ifa_add_loopback_route(struct ifaddr *ifa, struct sockaddr *ia) -{ - - return (ifa_maintain_loopback_route(RTM_ADD, "insertion", ifa, ia)); -} - -int -ifa_del_loopback_route(struct ifaddr *ifa, struct sockaddr *ia) -{ - - return (ifa_maintain_loopback_route(RTM_DELETE, "deletion", ifa, ia)); -} - -int -ifa_switch_loopback_route(struct ifaddr *ifa, struct sockaddr *ia) -{ - - return (ifa_maintain_loopback_route(RTM_CHANGE, "switch", ifa, ia)); -} - /* * XXX: Because sockaddr_dl has deeper structure than the sockaddr * structs used to represent other address families, it is necessary Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Sun Nov 8 10:13:06 2020 (r367483) +++ head/sys/net/route.c Sun Nov 8 11:12:00 2020 (r367484) @@ -72,20 +72,6 @@ #include #include -/* - * By default add routes to all fibs for new interfaces. - * Once this is set to 0 then only allocate routes on interface - * changes for the FIB of the caller when adding a new set of addresses - * to an interface. XXX this is a shotgun aproach to a problem that needs - * a more fine grained solution.. that will come. - * XXX also has the problems getting the FIB from curthread which will not - * always work given the fib can be overridden and prefixes can be added - * from the network stack context. - */ -VNET_DEFINE(u_int, rt_add_addr_allfibs) = 1; -SYSCTL_UINT(_net, OID_AUTO, add_addr_allfibs, CTLFLAG_RWTUN | CTLFLAG_VNET, - &VNET_NAME(rt_add_addr_allfibs), 0, ""); - VNET_PCPUSTAT_DEFINE(struct rtstat, rtstat); VNET_PCPUSTAT_SYSINIT(rtstat); @@ -864,196 +850,6 @@ rt_maskedcopy(struct sockaddr *src, struct sockaddr *d *cp2++ = *cp1++ & *cp3++; if (cp2 < cplim2) bzero((caddr_t)cp2, (unsigned)(cplim2 - cp2)); -} - -/* - * Set up a routing table entry, normally - * for an interface. - */ -static inline int -rtinit1(struct ifaddr *ifa, int cmd, int flags, int fibnum) -{ - RIB_RLOCK_TRACKER; - struct epoch_tracker et; - struct sockaddr *dst; - struct sockaddr *netmask; - struct rib_cmd_info rc; - struct rt_addrinfo info; - int error = 0; - int startfib, endfib; - struct sockaddr_storage ss; - int didwork = 0; - int a_failure = 0; - struct sockaddr_dl_short sdl; - struct rib_head *rnh; - - if (flags & RTF_HOST) { - dst = ifa->ifa_dstaddr; - netmask = NULL; - } else { - dst = ifa->ifa_addr; - netmask = ifa->ifa_netmask; - } - if (dst->sa_len == 0) - return(EINVAL); - switch (dst->sa_family) { - case AF_INET6: - case AF_INET: - /* We support multiple FIBs. */ - break; - default: - fibnum = RT_DEFAULT_FIB; - break; - } - if (fibnum == RT_ALL_FIBS) { - if (V_rt_add_addr_allfibs == 0 && cmd == (int)RTM_ADD) - startfib = endfib = ifa->ifa_ifp->if_fib; - else { - startfib = 0; - endfib = rt_numfibs - 1; - } - } else { - KASSERT((fibnum < rt_numfibs), ("rtinit1: bad fibnum")); - startfib = fibnum; - endfib = fibnum; - } - - /* - * If it's a delete, check that if it exists, - * it's on the correct interface or we might scrub - * a route to another ifa which would - * be confusing at best and possibly worse. - */ - if (cmd == RTM_DELETE) { - /* - * It's a delete, so it should already exist.. - * If it's a net, mask off the host bits - * (Assuming we have a mask) - * XXX this is kinda inet specific.. - */ - if (netmask != NULL) { - rt_maskedcopy(dst, (struct sockaddr *)&ss, netmask); - dst = (struct sockaddr *)&ss; - } - } - bzero(&sdl, sizeof(struct sockaddr_dl_short)); - sdl.sdl_family = AF_LINK; - sdl.sdl_len = sizeof(struct sockaddr_dl_short); - sdl.sdl_type = ifa->ifa_ifp->if_type; - sdl.sdl_index = ifa->ifa_ifp->if_index; - /* - * Now go through all the requested tables (fibs) and do the - * requested action. Realistically, this will either be fib 0 - * for protocols that don't do multiple tables or all the - * tables for those that do. - */ - for ( fibnum = startfib; fibnum <= endfib; fibnum++) { - if (cmd == RTM_DELETE) { - struct radix_node *rn; - /* - * Look up an rtentry that is in the routing tree and - * contains the correct info. - */ - rnh = rt_tables_get_rnh(fibnum, dst->sa_family); - if (rnh == NULL) - /* this table doesn't exist but others might */ - continue; - RIB_RLOCK(rnh); - rn = rnh->rnh_lookup(dst, netmask, &rnh->head); -#ifdef RADIX_MPATH - if (rt_mpath_capable(rnh)) { - if (rn == NULL) - error = ESRCH; - else { - struct rtentry *rt = RNTORT(rn); - /* - * for interface route the gateway - * gateway is sockaddr_dl, so - * rt_mpath_matchgate must use the - * interface address - */ - rt = rt_mpath_matchgate(rt, - ifa->ifa_addr); - if (rt == NULL) - error = ESRCH; - } - } -#endif - error = (rn == NULL || - (rn->rn_flags & RNF_ROOT) || - RNTORT(rn)->rt_nhop->nh_ifa != ifa); - RIB_RUNLOCK(rnh); - if (error) { - /* this is only an error if bad on ALL tables */ - continue; - } - } - /* - * Do the actual request - */ - bzero((caddr_t)&info, sizeof(info)); - info.rti_ifa = ifa; - info.rti_flags = flags | - (ifa->ifa_flags & ~IFA_RTSELF) | RTF_PINNED; - info.rti_info[RTAX_DST] = dst; - info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&sdl; - info.rti_info[RTAX_NETMASK] = netmask; - NET_EPOCH_ENTER(et); - error = rib_action(fibnum, cmd, &info, &rc); - if (error == 0 && rc.rc_rt != NULL) { - /* - * notify any listening routing agents of the change - */ - - /* TODO: interface routes/aliases */ - rt_newaddrmsg_fib(cmd, ifa, rc.rc_rt, fibnum); - didwork = 1; - } - NET_EPOCH_EXIT(et); - if (error) - a_failure = error; - } - if (cmd == RTM_DELETE) { - if (didwork) { - error = 0; - } else { - /* we only give an error if it wasn't in any table */ - error = ((flags & RTF_HOST) ? - EHOSTUNREACH : ENETUNREACH); - } - } else { - if (a_failure) { - /* return an error if any of them failed */ - error = a_failure; - } - } - return (error); -} - -/* - * Set up a routing table entry, normally - * for an interface. - */ -int -rtinit(struct ifaddr *ifa, int cmd, int flags) -{ - struct sockaddr *dst; - int fib = RT_DEFAULT_FIB; - - if (flags & RTF_HOST) { - dst = ifa->ifa_dstaddr; - } else { - dst = ifa->ifa_addr; - } - - switch (dst->sa_family) { - case AF_INET6: - case AF_INET: - /* We do support multiple FIBs. */ - fib = RT_ALL_FIBS; - break; - } - return (rtinit1(ifa, cmd, flags, fib)); } /* From owner-svn-src-head@freebsd.org Sun Nov 8 12:47:35 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ECCB7460F2B; Sun, 8 Nov 2020 12:47:35 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTYn35DyHz3Pkg; Sun, 8 Nov 2020 12:47:35 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A65F5200C2; Sun, 8 Nov 2020 12:47:35 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A8ClZjb027783; Sun, 8 Nov 2020 12:47:35 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A8ClZ0J027782; Sun, 8 Nov 2020 12:47:35 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202011081247.0A8ClZ0J027782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 8 Nov 2020 12:47:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367485 - head/contrib/llvm-project/llvm/lib/Target/PowerPC X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/llvm-project/llvm/lib/Target/PowerPC X-SVN-Commit-Revision: 367485 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 08 Nov 2020 12:47:36 -0000 Author: dim Date: Sun Nov 8 12:47:35 2020 New Revision: 367485 URL: https://svnweb.freebsd.org/changeset/base/367485 Log: Merge commit 354d3106c from llvm git (by Kai Luo): [PowerPC] Skip combining (uint_to_fp x) if x is not simple type Current powerpc64le backend hits ``` Combining: t7: f64 = uint_to_fp t6 llc: llvm-project/llvm/include/llvm/CodeGen/ValueTypes.h:291: llvm::MVT llvm::EVT::getSimpleVT() const: Assertion `isSimple() && "Expected a SimpleValueType!"' failed. ``` This patch fixes it by skipping combination if `t6` is not simple type. Fixed https://bugs.llvm.org/show_bug.cgi?id=47660. Reviewed By: #powerpc, steven.zhang Differential Revision: https://reviews.llvm.org/D88388 This should fix the llvm assertion mentioned above when building the following ports for powerpc64le: * audio/traverso * databases/percona57-pam-for-mysql * databases/percona57-server * emulators/citra * emulators/citra-qt5 * games/7kaa * graphics/dia * graphics/mandelbulber * graphics/pcl-pointclouds * net-p2p/libtorrent-rasterbar * textproc/htmldoc Requested by: pkubaj MFC after: 3 days Modified: head/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp Modified: head/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp ============================================================================== --- head/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp Sun Nov 8 11:12:00 2020 (r367484) +++ head/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp Sun Nov 8 12:47:35 2020 (r367485) @@ -14257,6 +14257,8 @@ SDValue PPCTargetLowering::combineFPToIntToFP(SDNode * // from the hardware. if (Op.getValueType() != MVT::f32 && Op.getValueType() != MVT::f64) return SDValue(); + if (!Op.getOperand(0).getValueType().isSimple()) + return SDValue(); if (Op.getOperand(0).getValueType().getSimpleVT() <= MVT(MVT::i1) || Op.getOperand(0).getValueType().getSimpleVT() > MVT(MVT::i64)) return SDValue(); From owner-svn-src-head@freebsd.org Sun Nov 8 13:30:44 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CA2C4461C44; Sun, 8 Nov 2020 13:30:44 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTZkr4xqMz3hf8; Sun, 8 Nov 2020 13:30:44 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9CEC32098F; Sun, 8 Nov 2020 13:30:44 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A8DUiIh052398; Sun, 8 Nov 2020 13:30:44 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A8DUio6052397; Sun, 8 Nov 2020 13:30:44 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202011081330.0A8DUio6052397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 8 Nov 2020 13:30:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367486 - head/sys/net/route X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: head/sys/net/route X-SVN-Commit-Revision: 367486 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 08 Nov 2020 13:30:44 -0000 Author: melifaro Date: Sun Nov 8 13:30:44 2020 New Revision: 367486 URL: https://svnweb.freebsd.org/changeset/base/367486 Log: Fix build broken by r367484: add route_ifaddrs.c. Pointy hat to: melifaro Reported by: jenkins Added: head/sys/net/route/route_ifaddrs.c (contents, props changed) Added: head/sys/net/route/route_ifaddrs.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/net/route/route_ifaddrs.c Sun Nov 8 13:30:44 2020 (r367486) @@ -0,0 +1,309 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 1980, 1986, 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)route.c 8.3.1.1 (Berkeley) 2/23/95 + * $FreeBSD$ + */ + +#include "opt_mpath.h" +#include "opt_route.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +/* + * Control interface address fib propagation. + * By default, interface address routes are added to the fib of the interface. + * Once set to non-zero, adds interface address route to all fibs. + */ +VNET_DEFINE(u_int, rt_add_addr_allfibs) = 0; +SYSCTL_UINT(_net, OID_AUTO, add_addr_allfibs, CTLFLAG_RWTUN | CTLFLAG_VNET, + &VNET_NAME(rt_add_addr_allfibs), 0, ""); + +/* + * Set up a routing table entry, normally + * for an interface. + */ +static inline int +rtinit1(struct ifaddr *ifa, int cmd, int flags, int fibnum) +{ + RIB_RLOCK_TRACKER; + struct epoch_tracker et; + struct sockaddr *dst; + struct sockaddr *netmask; + struct rib_cmd_info rc; + struct rt_addrinfo info; + int error = 0; + int startfib, endfib; + struct sockaddr_storage ss; + int didwork = 0; + int a_failure = 0; + struct sockaddr_dl_short sdl; + struct rib_head *rnh; + + if (flags & RTF_HOST) { + dst = ifa->ifa_dstaddr; + netmask = NULL; + } else { + dst = ifa->ifa_addr; + netmask = ifa->ifa_netmask; + } + if (dst->sa_len == 0) + return(EINVAL); + switch (dst->sa_family) { + case AF_INET6: + case AF_INET: + /* We support multiple FIBs. */ + break; + default: + fibnum = RT_DEFAULT_FIB; + break; + } + if (fibnum == RT_ALL_FIBS) { + if (V_rt_add_addr_allfibs == 0 && cmd == (int)RTM_ADD) + startfib = endfib = ifa->ifa_ifp->if_fib; + else { + startfib = 0; + endfib = rt_numfibs - 1; + } + } else { + KASSERT((fibnum < rt_numfibs), ("rtinit1: bad fibnum")); + startfib = fibnum; + endfib = fibnum; + } + + /* + * If it's a delete, check that if it exists, + * it's on the correct interface or we might scrub + * a route to another ifa which would + * be confusing at best and possibly worse. + */ + if (cmd == RTM_DELETE) { + /* + * It's a delete, so it should already exist.. + * If it's a net, mask off the host bits + * (Assuming we have a mask) + * XXX this is kinda inet specific.. + */ + if (netmask != NULL) { + rt_maskedcopy(dst, (struct sockaddr *)&ss, netmask); + dst = (struct sockaddr *)&ss; + } + } + bzero(&sdl, sizeof(struct sockaddr_dl_short)); + sdl.sdl_family = AF_LINK; + sdl.sdl_len = sizeof(struct sockaddr_dl_short); + sdl.sdl_type = ifa->ifa_ifp->if_type; + sdl.sdl_index = ifa->ifa_ifp->if_index; + /* + * Now go through all the requested tables (fibs) and do the + * requested action. Realistically, this will either be fib 0 + * for protocols that don't do multiple tables or all the + * tables for those that do. + */ + for ( fibnum = startfib; fibnum <= endfib; fibnum++) { + if (cmd == RTM_DELETE) { + struct radix_node *rn; + /* + * Look up an rtentry that is in the routing tree and + * contains the correct info. + */ + rnh = rt_tables_get_rnh(fibnum, dst->sa_family); + if (rnh == NULL) + /* this table doesn't exist but others might */ + continue; + RIB_RLOCK(rnh); + rn = rnh->rnh_lookup(dst, netmask, &rnh->head); + error = (rn == NULL || + (rn->rn_flags & RNF_ROOT) || + RNTORT(rn)->rt_nhop->nh_ifa != ifa); + RIB_RUNLOCK(rnh); + if (error) { + /* this is only an error if bad on ALL tables */ + continue; + } + } + /* + * Do the actual request + */ + bzero((caddr_t)&info, sizeof(info)); + info.rti_ifa = ifa; + info.rti_flags = flags | + (ifa->ifa_flags & ~IFA_RTSELF) | RTF_PINNED; + info.rti_info[RTAX_DST] = dst; + info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&sdl; + info.rti_info[RTAX_NETMASK] = netmask; + NET_EPOCH_ENTER(et); + error = rib_action(fibnum, cmd, &info, &rc); + if (error == 0 && rc.rc_rt != NULL) { + /* + * notify any listening routing agents of the change + */ + + /* TODO: interface routes/aliases */ + rt_newaddrmsg_fib(cmd, ifa, rc.rc_rt, fibnum); + didwork = 1; + } + NET_EPOCH_EXIT(et); + if (error) + a_failure = error; + } + if (cmd == RTM_DELETE) { + if (didwork) { + error = 0; + } else { + /* we only give an error if it wasn't in any table */ + error = ((flags & RTF_HOST) ? + EHOSTUNREACH : ENETUNREACH); + } + } else { + if (a_failure) { + /* return an error if any of them failed */ + error = a_failure; + } + } + return (error); +} + +/* + * Set up a routing table entry, normally + * for an interface. + */ +int +rtinit(struct ifaddr *ifa, int cmd, int flags) +{ + struct sockaddr *dst; + int fib = RT_DEFAULT_FIB; + + if (flags & RTF_HOST) { + dst = ifa->ifa_dstaddr; + } else { + dst = ifa->ifa_addr; + } + + switch (dst->sa_family) { + case AF_INET6: + case AF_INET: + /* We do support multiple FIBs. */ + fib = RT_ALL_FIBS; + break; + } + return (rtinit1(ifa, cmd, flags, fib)); +} + +static int +ifa_maintain_loopback_route(int cmd, const char *otype, struct ifaddr *ifa, + struct sockaddr *ia) +{ + struct rib_cmd_info rc; + struct epoch_tracker et; + int error; + struct rt_addrinfo info; + struct sockaddr_dl null_sdl; + struct ifnet *ifp; + struct ifaddr *rti_ifa = NULL; + + ifp = ifa->ifa_ifp; + + NET_EPOCH_ENTER(et); + bzero(&info, sizeof(info)); + if (cmd != RTM_DELETE) + info.rti_ifp = V_loif; + if (cmd == RTM_ADD) { + /* explicitly specify (loopback) ifa */ + if (info.rti_ifp != NULL) { + rti_ifa = ifaof_ifpforaddr(ifa->ifa_addr, info.rti_ifp); + if (rti_ifa != NULL) + ifa_ref(rti_ifa); + info.rti_ifa = rti_ifa; + } + } + info.rti_flags = ifa->ifa_flags | RTF_HOST | RTF_STATIC | RTF_PINNED; + info.rti_info[RTAX_DST] = ia; + info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl; + link_init_sdl(ifp, (struct sockaddr *)&null_sdl, ifp->if_type); + + error = rib_action(ifp->if_fib, cmd, &info, &rc); + NET_EPOCH_EXIT(et); + + if (rti_ifa != NULL) + ifa_free(rti_ifa); + + if (error == 0 || + (cmd == RTM_ADD && error == EEXIST) || + (cmd == RTM_DELETE && (error == ENOENT || error == ESRCH))) + return (error); + + log(LOG_DEBUG, "%s: %s failed for interface %s: %u\n", + __func__, otype, if_name(ifp), error); + + return (error); +} + +int +ifa_add_loopback_route(struct ifaddr *ifa, struct sockaddr *ia) +{ + + return (ifa_maintain_loopback_route(RTM_ADD, "insertion", ifa, ia)); +} + +int +ifa_del_loopback_route(struct ifaddr *ifa, struct sockaddr *ia) +{ + + return (ifa_maintain_loopback_route(RTM_DELETE, "deletion", ifa, ia)); +} + +int +ifa_switch_loopback_route(struct ifaddr *ifa, struct sockaddr *ia) +{ + + return (ifa_maintain_loopback_route(RTM_CHANGE, "switch", ifa, ia)); +} + + From owner-svn-src-head@freebsd.org Sun Nov 8 14:08:01 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 46269462CA3; Sun, 8 Nov 2020 14:08:01 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTbYs1V3Gz3kps; Sun, 8 Nov 2020 14:08:01 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 25B8120C6C; Sun, 8 Nov 2020 14:08:01 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A8E81If075806; Sun, 8 Nov 2020 14:08:01 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A8E8109075805; Sun, 8 Nov 2020 14:08:01 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <202011081408.0A8E8109075805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sun, 8 Nov 2020 14:08:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367487 - head/sys/contrib/openzfs/module/os/freebsd/zfs X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/sys/contrib/openzfs/module/os/freebsd/zfs X-SVN-Commit-Revision: 367487 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 08 Nov 2020 14:08:01 -0000 Author: oshogbo Date: Sun Nov 8 14:08:00 2020 New Revision: 367487 URL: https://svnweb.freebsd.org/changeset/base/367487 Log: Check if the ZVOL has been written before calling zil_async_to_sync. The ZIL will be opened on the first write, not earlier. Reviewed-by: Ryan Moeller Reviewed-by: Brian Behlendorf Signed-off-by: Mariusz Zaborski OpenZFS Pull Request: https://github.com/openzfs/zfs/pull/11152 PR: 250934 Modified: head/sys/contrib/openzfs/module/os/freebsd/zfs/zvol_os.c Modified: head/sys/contrib/openzfs/module/os/freebsd/zfs/zvol_os.c ============================================================================== --- head/sys/contrib/openzfs/module/os/freebsd/zfs/zvol_os.c Sun Nov 8 13:30:44 2020 (r367486) +++ head/sys/contrib/openzfs/module/os/freebsd/zfs/zvol_os.c Sun Nov 8 14:08:00 2020 (r367487) @@ -890,7 +890,8 @@ zvol_cdev_open(struct cdev *dev, int flags, int fmt, s if (flags & (FSYNC | FDSYNC)) { zsd = &zv->zv_zso->zso_dev; zsd->zsd_sync_cnt++; - if (zsd->zsd_sync_cnt == 1) + if (zsd->zsd_sync_cnt == 1 && + (zv->zv_flags & ZVOL_WRITTEN_TO) != 0) zil_async_to_sync(zv->zv_zilog, ZVOL_OBJ); } From owner-svn-src-head@freebsd.org Sun Nov 8 15:55:00 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 444CF464C75; Sun, 8 Nov 2020 15:55:00 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTdxJ1Lgrz3qLd; Sun, 8 Nov 2020 15:55:00 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2116922590; Sun, 8 Nov 2020 15:55:00 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A8Ft0Y4041946; Sun, 8 Nov 2020 15:55:00 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A8FsxtL041919; Sun, 8 Nov 2020 15:54:59 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202011081554.0A8FsxtL041919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 8 Nov 2020 15:54:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367488 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 367488 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 08 Nov 2020 15:55:00 -0000 Author: trasz Date: Sun Nov 8 15:54:59 2020 New Revision: 367488 URL: https://svnweb.freebsd.org/changeset/base/367488 Log: Move syscall_thread_{enter,exit}() into the slow path. This is only needed for syscalls from unloadable modules. Reviewed by: kib MFC after: 2 weeks Sponsored by: EPSRC Differential Revision: https://reviews.freebsd.org/D26988 Modified: head/sys/kern/kern_syscalls.c head/sys/kern/subr_syscall.c head/sys/sys/sysent.h Modified: head/sys/kern/kern_syscalls.c ============================================================================== --- head/sys/kern/kern_syscalls.c Sun Nov 8 14:08:00 2020 (r367487) +++ head/sys/kern/kern_syscalls.c Sun Nov 8 15:54:59 2020 (r367488) @@ -80,10 +80,13 @@ syscall_thread_drain(struct sysent *se) } int -_syscall_thread_enter(struct thread *td, struct sysent *se) +syscall_thread_enter(struct thread *td, struct sysent *se) { u_int32_t cnt, oldcnt; + KASSERT((se->sy_thrcnt & SY_THR_STATIC) == 0, + ("%s: not a static syscall", __func__)); + do { oldcnt = se->sy_thrcnt; if ((oldcnt & (SY_THR_DRAINING | SY_THR_ABSENT)) != 0) @@ -94,9 +97,12 @@ _syscall_thread_enter(struct thread *td, struct sysent } void -_syscall_thread_exit(struct thread *td, struct sysent *se) +syscall_thread_exit(struct thread *td, struct sysent *se) { u_int32_t cnt, oldcnt; + + KASSERT((se->sy_thrcnt & SY_THR_STATIC) == 0, + ("%s: not a static syscall", __func__)); do { oldcnt = se->sy_thrcnt; Modified: head/sys/kern/subr_syscall.c ============================================================================== --- head/sys/kern/subr_syscall.c Sun Nov 8 14:08:00 2020 (r367487) +++ head/sys/kern/subr_syscall.c Sun Nov 8 15:54:59 2020 (r367488) @@ -61,6 +61,7 @@ syscallenter(struct thread *td) struct syscall_args *sa; struct sysent *se; int error, traced; + bool sy_thr_static; VM_CNT_INC(v_syscall); p = td->td_proc; @@ -128,12 +129,6 @@ syscallenter(struct thread *td) } #endif - error = syscall_thread_enter(td, se); - if (error != 0) { - td->td_errno = error; - goto retval; - } - /* * Fetch fast sigblock value at the time of syscall entry to * handle sleepqueue primitives which might call cursig(). @@ -145,8 +140,19 @@ syscallenter(struct thread *td) KASSERT((td->td_pflags & TDP_NERRNO) == 0, ("%s: TDP_NERRNO set", __func__)); + sy_thr_static = (se->sy_thrcnt & SY_THR_STATIC) != 0; + if (__predict_false(SYSTRACE_ENABLED() || - AUDIT_SYSCALL_ENTER(sa->code, td))) { + AUDIT_SYSCALL_ENTER(sa->code, td) || + !sy_thr_static)) { + if (!sy_thr_static) { + error = syscall_thread_enter(td, se); + if (error != 0) { + td->td_errno = error; + goto retval; + } + } + #ifdef KDTRACE_HOOKS /* Give the syscall:::entry DTrace probe a chance to fire. */ if (__predict_false(se->sy_entry != 0)) @@ -176,6 +182,9 @@ syscallenter(struct thread *td) (*systrace_probe_func)(sa, SYSTRACE_RETURN, error ? -1 : td->td_retval[0]); #endif + + if (!sy_thr_static) + syscall_thread_exit(td, se); } else { error = (se->sy_call)(td, sa->args); /* Save the latest error return value. */ @@ -184,7 +193,6 @@ syscallenter(struct thread *td) else td->td_errno = error; } - syscall_thread_exit(td, se); retval: KTR_STOP4(KTR_SYSC, "syscall", syscallname(p, sa->code), Modified: head/sys/sys/sysent.h ============================================================================== --- head/sys/sys/sysent.h Sun Nov 8 14:08:00 2020 (r367487) +++ head/sys/sys/sysent.h Sun Nov 8 15:54:59 2020 (r367488) @@ -294,26 +294,8 @@ struct nosys_args; int lkmnosys(struct thread *, struct nosys_args *); int lkmressys(struct thread *, struct nosys_args *); -int _syscall_thread_enter(struct thread *td, struct sysent *se); -void _syscall_thread_exit(struct thread *td, struct sysent *se); - -static inline int -syscall_thread_enter(struct thread *td, struct sysent *se) -{ - - if (__predict_true((se->sy_thrcnt & SY_THR_STATIC) != 0)) - return (0); - return (_syscall_thread_enter(td, se)); -} - -static inline void -syscall_thread_exit(struct thread *td, struct sysent *se) -{ - - if (__predict_true((se->sy_thrcnt & SY_THR_STATIC) != 0)) - return; - _syscall_thread_exit(td, se); -} +int syscall_thread_enter(struct thread *td, struct sysent *se); +void syscall_thread_exit(struct thread *td, struct sysent *se); int shared_page_alloc(int size, int align); int shared_page_fill(int size, int align, const void *data); From owner-svn-src-head@freebsd.org Sun Nov 8 18:11:12 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 942112D16BC; Sun, 8 Nov 2020 18:11:12 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CThyS3hfJz4hn0; Sun, 8 Nov 2020 18:11:12 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7178D23DC7; Sun, 8 Nov 2020 18:11:12 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A8IBC80043693; Sun, 8 Nov 2020 18:11:12 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A8IBClQ043692; Sun, 8 Nov 2020 18:11:12 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202011081811.0A8IBClQ043692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 8 Nov 2020 18:11:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367490 - head/sys/net/route X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: head/sys/net/route X-SVN-Commit-Revision: 367490 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 08 Nov 2020 18:11:12 -0000 Author: melifaro Date: Sun Nov 8 18:11:12 2020 New Revision: 367490 URL: https://svnweb.freebsd.org/changeset/base/367490 Log: Temporarily revert setting net.add_addr_allfibs to 0. It accidentally sweeped in r367486. Revert to allow for proper commit message & warning. Modified: head/sys/net/route/route_ifaddrs.c Modified: head/sys/net/route/route_ifaddrs.c ============================================================================== --- head/sys/net/route/route_ifaddrs.c Sun Nov 8 17:10:12 2020 (r367489) +++ head/sys/net/route/route_ifaddrs.c Sun Nov 8 18:11:12 2020 (r367490) @@ -61,7 +61,7 @@ * By default, interface address routes are added to the fib of the interface. * Once set to non-zero, adds interface address route to all fibs. */ -VNET_DEFINE(u_int, rt_add_addr_allfibs) = 0; +VNET_DEFINE(u_int, rt_add_addr_allfibs) = 1; SYSCTL_UINT(_net, OID_AUTO, add_addr_allfibs, CTLFLAG_RWTUN | CTLFLAG_VNET, &VNET_NAME(rt_add_addr_allfibs), 0, ""); From owner-svn-src-head@freebsd.org Sun Nov 8 18:27:50 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EE2BE2D1F8A; Sun, 8 Nov 2020 18:27:50 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTjKf6T9vz4jQp; Sun, 8 Nov 2020 18:27:50 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CCA9B240D2; Sun, 8 Nov 2020 18:27:50 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A8IRopB055225; Sun, 8 Nov 2020 18:27:50 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A8IRoo6055223; Sun, 8 Nov 2020 18:27:50 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202011081827.0A8IRoo6055223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 8 Nov 2020 18:27:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367491 - in head: . sys/net/route X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: in head: . sys/net/route X-SVN-Commit-Revision: 367491 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 08 Nov 2020 18:27:51 -0000 Author: melifaro Date: Sun Nov 8 18:27:49 2020 New Revision: 367491 URL: https://svnweb.freebsd.org/changeset/base/367491 Log: Switch net.add_addr_allfibs default to 0. The goal of the fib support is to provide multiple independent routing tables, isolated from each other. net.add_addr_allfibs default tries to shift gears in the opposite direction, unconditionally inserting all addresses to all of the fibs. There are use cases when this is necessary, however this is not a default expected behaviour, especially compared to other implementations. Provide WARNING message for the setups with multiple fibs to notify potential users of the feature. Differential Revision: https://reviews.freebsd.org/D26076 Modified: head/UPDATING head/sys/net/route/route_ifaddrs.c head/sys/net/route/route_tables.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Sun Nov 8 18:11:12 2020 (r367490) +++ head/UPDATING Sun Nov 8 18:27:49 2020 (r367491) @@ -26,6 +26,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: world, or to merely disable the most expensive debugging functionality at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20201108: + Default value of net.add_addr_allfibs has been changed to 0. + If you have multi-fib configuration and rely on existence of all + interface routes in every fib, you need to set the above sysctl to 1. 20201030: The internal pre-processor in the calendar(1) program has been extended to support more C pre-processor commands (e.g. #ifdef, #else, Modified: head/sys/net/route/route_ifaddrs.c ============================================================================== --- head/sys/net/route/route_ifaddrs.c Sun Nov 8 18:11:12 2020 (r367490) +++ head/sys/net/route/route_ifaddrs.c Sun Nov 8 18:27:49 2020 (r367491) @@ -61,7 +61,7 @@ * By default, interface address routes are added to the fib of the interface. * Once set to non-zero, adds interface address route to all fibs. */ -VNET_DEFINE(u_int, rt_add_addr_allfibs) = 1; +VNET_DEFINE(u_int, rt_add_addr_allfibs) = 0; SYSCTL_UINT(_net, OID_AUTO, add_addr_allfibs, CTLFLAG_RWTUN | CTLFLAG_VNET, &VNET_NAME(rt_add_addr_allfibs), 0, ""); Modified: head/sys/net/route/route_tables.c ============================================================================== --- head/sys/net/route/route_tables.c Sun Nov 8 18:11:12 2020 (r367490) +++ head/sys/net/route/route_tables.c Sun Nov 8 18:27:49 2020 (r367491) @@ -183,6 +183,11 @@ grow_rtables(uint32_t num_tables) new_rt_tables = mallocarray(num_tables * (AF_MAX + 1), sizeof(void *), M_RTABLE, M_WAITOK | M_ZERO); + if ((num_tables > 1) && (V_rt_add_addr_allfibs == 0)) + printf("WARNING: Adding ifaddrs to all fibs has been turned off " + "by default. Consider tuning %s if needed\n", + "net.add_addr_allfibs"); + /* * Current rt_tables layout: * fib0[af0, af1, af2, .., AF_MAX]fib1[af0, af1, af2, .., Af_MAX].. From owner-svn-src-head@freebsd.org Sun Nov 8 18:47:07 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2A2A92D2513; Sun, 8 Nov 2020 18:47:07 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTjlv0mSfz4jty; Sun, 8 Nov 2020 18:47:07 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 03419241D1; Sun, 8 Nov 2020 18:47:07 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A8Il6Nq067478; Sun, 8 Nov 2020 18:47:06 GMT (envelope-from rscheff@FreeBSD.org) Received: (from rscheff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A8Il5OE067472; Sun, 8 Nov 2020 18:47:05 GMT (envelope-from rscheff@FreeBSD.org) Message-Id: <202011081847.0A8Il5OE067472@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rscheff set sender to rscheff@FreeBSD.org using -f From: Richard Scheffenegger Date: Sun, 8 Nov 2020 18:47:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367492 - in head/sys/netinet: . tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: rscheff X-SVN-Commit-Paths: in head/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 367492 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 08 Nov 2020 18:47:07 -0000 Author: rscheff Date: Sun Nov 8 18:47:05 2020 New Revision: 367492 URL: https://svnweb.freebsd.org/changeset/base/367492 Log: Prevent premature SACK block transmission during loss recovery Under specific conditions, a window update can be sent with outdated SACK information. Some clients react to this by subsequently delaying loss recovery, making TCP perform very poorly. Reported by: chengc_netapp.com Reviewed by: rrs, jtl MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D24237 Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_reass.c head/sys/netinet/tcp_stacks/bbr.c head/sys/netinet/tcp_stacks/rack.c head/sys/netinet/tcp_stacks/rack_bbr_common.c head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Sun Nov 8 18:27:49 2020 (r367491) +++ head/sys/netinet/tcp_input.c Sun Nov 8 18:47:05 2020 (r367492) @@ -1462,6 +1462,29 @@ tcp_autorcvbuf(struct mbuf *m, struct tcphdr *th, stru } void +tcp_handle_wakeup(struct tcpcb *tp, struct socket *so) +{ + /* + * Since tp might be gone if the session entered + * the TIME_WAIT state before coming here, we need + * to check if the socket is still connected. + */ + if ((so->so_state & SS_ISCONNECTED) == 0) + return; + INP_LOCK_ASSERT(tp->t_inpcb); + if (tp->t_flags & TF_WAKESOR) { + tp->t_flags &= ~TF_WAKESOR; + SOCKBUF_UNLOCK_ASSERT(&so->so_rcv); + sorwakeup(so); + } + if (tp->t_flags & TF_WAKESOW) { + tp->t_flags &= ~TF_WAKESOW; + SOCKBUF_UNLOCK_ASSERT(&so->so_snd); + sowwakeup(so); + } +} + +void tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, struct tcpcb *tp, int drop_hdrlen, int tlen, uint8_t iptos) { @@ -1811,7 +1834,7 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru else if (!tcp_timer_active(tp, TT_PERSIST)) tcp_timer_activate(tp, TT_REXMT, tp->t_rxtcur); - sowwakeup(so); + tp->t_flags |= TF_WAKESOW; if (sbavail(&so->so_snd)) (void) tp->t_fb->tfb_tcp_output(tp); goto check_delack; @@ -1876,8 +1899,8 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru m_adj(m, drop_hdrlen); /* delayed header drop */ sbappendstream_locked(&so->so_rcv, m, 0); } - /* NB: sorwakeup_locked() does an implicit unlock. */ - sorwakeup_locked(so); + SOCKBUF_UNLOCK(&so->so_rcv); + tp->t_flags |= TF_WAKESOR; if (DELAY_ACK(tp, tlen)) { tp->t_flags |= TF_DELACK; } else { @@ -2811,8 +2834,8 @@ process_ACK: tp->snd_wnd = 0; ourfinisacked = 0; } - /* NB: sowwakeup_locked() does an implicit unlock. */ - sowwakeup_locked(so); + SOCKBUF_UNLOCK(&so->so_snd); + tp->t_flags |= TF_WAKESOW; m_freem(mfree); /* Detect una wraparound. */ if (!IN_RECOVERY(tp->t_flags) && @@ -3033,8 +3056,8 @@ dodata: /* XXX */ m_freem(m); else sbappendstream_locked(&so->so_rcv, m, 0); - /* NB: sorwakeup_locked() does an implicit unlock. */ - sorwakeup_locked(so); + SOCKBUF_UNLOCK(&so->so_rcv); + tp->t_flags |= TF_WAKESOR; } else { /* * XXX: Due to the header drop above "th" is @@ -3101,6 +3124,8 @@ dodata: /* XXX */ if (thflags & TH_FIN) { if (TCPS_HAVERCVDFIN(tp->t_state) == 0) { socantrcvmore(so); + /* The socket upcall is handled by socantrcvmore. */ + tp->t_flags &= ~TF_WAKESOR; /* * If connection is half-synchronized * (ie NEEDSYN flag on) then delay ACK, @@ -3164,6 +3189,7 @@ check_delack: tp->t_flags &= ~TF_DELACK; tcp_timer_activate(tp, TT_DELACK, tcp_delacktime); } + tcp_handle_wakeup(tp, so); INP_WUNLOCK(tp->t_inpcb); return; @@ -3197,6 +3223,7 @@ dropafterack: TCP_PROBE3(debug__input, tp, th, m); tp->t_flags |= TF_ACKNOW; (void) tp->t_fb->tfb_tcp_output(tp); + tcp_handle_wakeup(tp, so); INP_WUNLOCK(tp->t_inpcb); m_freem(m); return; @@ -3204,6 +3231,7 @@ dropafterack: dropwithreset: if (tp != NULL) { tcp_dropwithreset(m, th, tp, tlen, rstreason); + tcp_handle_wakeup(tp, so); INP_WUNLOCK(tp->t_inpcb); } else tcp_dropwithreset(m, th, NULL, tlen, rstreason); @@ -3219,8 +3247,10 @@ drop: &tcp_savetcp, 0); #endif TCP_PROBE3(debug__input, tp, th, m); - if (tp != NULL) + if (tp != NULL) { + tcp_handle_wakeup(tp, so); INP_WUNLOCK(tp->t_inpcb); + } m_freem(m); } Modified: head/sys/netinet/tcp_reass.c ============================================================================== --- head/sys/netinet/tcp_reass.c Sun Nov 8 18:27:49 2020 (r367491) +++ head/sys/netinet/tcp_reass.c Sun Nov 8 18:47:05 2020 (r367492) @@ -959,7 +959,8 @@ new_entry: } else { sbappendstream_locked(&so->so_rcv, m, 0); } - sorwakeup_locked(so); + SOCKBUF_UNLOCK(&so->so_rcv); + tp->t_flags |= TF_WAKESOR; return (flags); } if (tcp_new_limits) { @@ -1107,6 +1108,7 @@ present: #ifdef TCP_REASS_LOGGING tcp_reass_log_dump(tp); #endif - sorwakeup_locked(so); + SOCKBUF_UNLOCK(&so->so_rcv); + tp->t_flags |= TF_WAKESOR; return (flags); } Modified: head/sys/netinet/tcp_stacks/bbr.c ============================================================================== --- head/sys/netinet/tcp_stacks/bbr.c Sun Nov 8 18:27:49 2020 (r367491) +++ head/sys/netinet/tcp_stacks/bbr.c Sun Nov 8 18:47:05 2020 (r367492) @@ -7876,8 +7876,8 @@ bbr_process_ack(struct mbuf *m, struct tcphdr *th, str acked_amount = min(acked, (int)sbavail(&so->so_snd)); tp->snd_wnd -= acked_amount; mfree = sbcut_locked(&so->so_snd, acked_amount); - /* NB: sowwakeup_locked() does an implicit unlock. */ - sowwakeup_locked(so); + SOCKBUF_UNLOCK(&so->so_snd); + tp->t_flags |= TF_WAKESOW; m_freem(mfree); if (SEQ_GT(th->th_ack, tp->snd_una)) { bbr_collapse_rtt(tp, bbr, TCP_REXMTVAL(tp)); @@ -8353,8 +8353,8 @@ bbr_process_data(struct mbuf *m, struct tcphdr *th, st appended = #endif sbappendstream_locked(&so->so_rcv, m, 0); - /* NB: sorwakeup_locked() does an implicit unlock. */ - sorwakeup_locked(so); + SOCKBUF_UNLOCK(&so->so_rcv); + tp->t_flags |= TF_WAKESOR; #ifdef NETFLIX_SB_LIMITS if (so->so_rcv.sb_shlim && appended != mcnt) counter_fo_release(so->so_rcv.sb_shlim, @@ -8414,6 +8414,8 @@ bbr_process_data(struct mbuf *m, struct tcphdr *th, st if (thflags & TH_FIN) { if (TCPS_HAVERCVDFIN(tp->t_state) == 0) { socantrcvmore(so); + /* The socket upcall is handled by socantrcvmore. */ + tp->t_flags &= ~TF_WAKESOR; /* * If connection is half-synchronized (ie NEEDSYN * flag on) then delay ACK, so it may be piggybacked @@ -8604,8 +8606,8 @@ bbr_do_fastnewdata(struct mbuf *m, struct tcphdr *th, sbappendstream_locked(&so->so_rcv, m, 0); ctf_calc_rwin(so, tp); } - /* NB: sorwakeup_locked() does an implicit unlock. */ - sorwakeup_locked(so); + SOCKBUF_UNLOCK(&so->so_rcv); + tp->t_flags |= TF_WAKESOR; #ifdef NETFLIX_SB_LIMITS if (so->so_rcv.sb_shlim && mcnt != appended) counter_fo_release(so->so_rcv.sb_shlim, mcnt - appended); @@ -8796,7 +8798,7 @@ bbr_fastack(struct mbuf *m, struct tcphdr *th, struct &tcp_savetcp, 0); #endif /* Wake up the socket if we have room to write more */ - sowwakeup(so); + tp->t_flags |= TF_WAKESOW; if (tp->snd_una == tp->snd_max) { /* Nothing left outstanding */ bbr_log_progress_event(bbr, tp, ticks, PROGRESS_CLEAR, __LINE__); @@ -11740,8 +11742,10 @@ bbr_do_segment(struct mbuf *m, struct tcphdr *th, stru } retval = bbr_do_segment_nounlock(m, th, so, tp, drop_hdrlen, tlen, iptos, 0, &tv); - if (retval == 0) + if (retval == 0) { + tcp_handle_wakeup(tp, so); INP_WUNLOCK(tp->t_inpcb); + } } /* Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Sun Nov 8 18:27:49 2020 (r367491) +++ head/sys/netinet/tcp_stacks/rack.c Sun Nov 8 18:47:05 2020 (r367492) @@ -8344,8 +8344,8 @@ rack_process_ack(struct mbuf *m, struct tcphdr *th, st */ ourfinisacked = 1; } - /* NB: sowwakeup_locked() does an implicit unlock. */ - sowwakeup_locked(so); + SOCKBUF_UNLOCK(&so->so_snd); + tp->t_flags |= TF_WAKESOW; m_freem(mfree); if (rack->r_ctl.rc_early_recovery == 0) { if (IN_RECOVERY(tp->t_flags)) { @@ -8665,8 +8665,8 @@ rack_process_data(struct mbuf *m, struct tcphdr *th, s appended = #endif sbappendstream_locked(&so->so_rcv, m, 0); - /* NB: sorwakeup_locked() does an implicit unlock. */ - sorwakeup_locked(so); + SOCKBUF_UNLOCK(&so->so_rcv); + tp->t_flags |= TF_WAKESOR; #ifdef NETFLIX_SB_LIMITS if (so->so_rcv.sb_shlim && appended != mcnt) counter_fo_release(so->so_rcv.sb_shlim, @@ -8731,6 +8731,8 @@ rack_process_data(struct mbuf *m, struct tcphdr *th, s if (thflags & TH_FIN) { if (TCPS_HAVERCVDFIN(tp->t_state) == 0) { socantrcvmore(so); + /* The socket upcall is handled by socantrcvmore. */ + tp->t_flags &= ~TF_WAKESOR; /* * If connection is half-synchronized (ie NEEDSYN * flag on) then delay ACK, so it may be piggybacked @@ -8922,8 +8924,8 @@ rack_do_fastnewdata(struct mbuf *m, struct tcphdr *th, sbappendstream_locked(&so->so_rcv, m, 0); ctf_calc_rwin(so, tp); } - /* NB: sorwakeup_locked() does an implicit unlock. */ - sorwakeup_locked(so); + SOCKBUF_UNLOCK(&so->so_rcv); + tp->t_flags |= TF_WAKESOR; #ifdef NETFLIX_SB_LIMITS if (so->so_rcv.sb_shlim && mcnt != appended) counter_fo_release(so->so_rcv.sb_shlim, mcnt - appended); @@ -9140,7 +9142,7 @@ rack_fastack(struct mbuf *m, struct tcphdr *th, struct rack_timer_cancel(tp, rack, rack->r_ctl.rc_rcvtime, __LINE__); } /* Wake up the socket if we have room to write more */ - sowwakeup(so); + tp->t_flags |= TF_WAKESOW; if (sbavail(&so->so_snd)) { rack->r_wanted_output = 1; } @@ -11188,8 +11190,10 @@ rack_do_segment(struct mbuf *m, struct tcphdr *th, str tcp_get_usecs(&tv); } if(rack_do_segment_nounlock(m, th, so, tp, - drop_hdrlen, tlen, iptos, 0, &tv) == 0) + drop_hdrlen, tlen, iptos, 0, &tv) == 0) { + tcp_handle_wakeup(tp, so); INP_WUNLOCK(tp->t_inpcb); + } } struct rack_sendmap * Modified: head/sys/netinet/tcp_stacks/rack_bbr_common.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack_bbr_common.c Sun Nov 8 18:27:49 2020 (r367491) +++ head/sys/netinet/tcp_stacks/rack_bbr_common.c Sun Nov 8 18:47:05 2020 (r367492) @@ -458,6 +458,7 @@ ctf_do_queued_segments(struct socket *so, struct tcpcb /* We lost the tcpcb (maybe a RST came in)? */ return(1); } + tcp_handle_wakeup(tp, so); } return (0); } Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Sun Nov 8 18:27:49 2020 (r367491) +++ head/sys/netinet/tcp_var.h Sun Nov 8 18:47:05 2020 (r367492) @@ -381,7 +381,7 @@ TAILQ_HEAD(tcp_funchead, tcp_function); #define TF_NEEDFIN 0x00000800 /* send FIN (implicit state) */ #define TF_NOPUSH 0x00001000 /* don't push */ #define TF_PREVVALID 0x00002000 /* saved values for bad rxmit valid */ -#define TF_UNUSED1 0x00004000 /* unused */ +#define TF_WAKESOR 0x00004000 /* wake up receive socket */ #define TF_GPUTINPROG 0x00008000 /* Goodput measurement in progress */ #define TF_MORETOCOME 0x00010000 /* More data to be appended to sock */ #define TF_LQ_OVERFLOW 0x00020000 /* listen queue overflow */ @@ -393,9 +393,9 @@ TAILQ_HEAD(tcp_funchead, tcp_function); #define TF_FORCEDATA 0x00800000 /* force out a byte */ #define TF_TSO 0x01000000 /* TSO enabled on this connection */ #define TF_TOE 0x02000000 /* this connection is offloaded */ -#define TF_UNUSED3 0x04000000 /* unused */ -#define TF_UNUSED4 0x08000000 /* unused */ -#define TF_UNUSED5 0x10000000 /* unused */ +#define TF_WAKESOW 0x04000000 /* wake up send socket */ +#define TF_UNUSED1 0x08000000 /* unused */ +#define TF_UNUSED2 0x10000000 /* unused */ #define TF_CONGRECOVERY 0x20000000 /* congestion recovery mode */ #define TF_WASCRECOVERY 0x40000000 /* was in congestion recovery */ #define TF_FASTOPEN 0x80000000 /* TCP Fast Open indication */ @@ -931,7 +931,8 @@ char *tcp_log_addrs(struct in_conninfo *, struct tcphd const void *); char *tcp_log_vain(struct in_conninfo *, struct tcphdr *, void *, const void *); -int tcp_reass(struct tcpcb *, struct tcphdr *, tcp_seq *, int *, struct mbuf *); +int tcp_reass(struct tcpcb *, struct tcphdr *, tcp_seq *, int *, + struct mbuf *); void tcp_reass_global_init(void); void tcp_reass_flush(struct tcpcb *); void tcp_dooptions(struct tcpopt *, u_char *, int, int); @@ -955,6 +956,7 @@ void hhook_run_tcp_est_in(struct tcpcb *tp, int tcp_input(struct mbuf **, int *, int); int tcp_autorcvbuf(struct mbuf *, struct tcphdr *, struct socket *, struct tcpcb *, int); +void tcp_handle_wakeup(struct tcpcb *, struct socket *); void tcp_do_segment(struct mbuf *, struct tcphdr *, struct socket *, struct tcpcb *, int, int, uint8_t); From owner-svn-src-head@freebsd.org Sun Nov 8 18:49:24 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 105D82D2624; Sun, 8 Nov 2020 18:49:24 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTjpW75PPz4kSQ; Sun, 8 Nov 2020 18:49:23 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E678124714; Sun, 8 Nov 2020 18:49:23 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A8InNKH067650; Sun, 8 Nov 2020 18:49:23 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A8InNCR067649; Sun, 8 Nov 2020 18:49:23 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202011081849.0A8InNCR067649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Sun, 8 Nov 2020 18:49:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367493 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 367493 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 08 Nov 2020 18:49:24 -0000 Author: mhorne Date: Sun Nov 8 18:49:23 2020 New Revision: 367493 URL: https://svnweb.freebsd.org/changeset/base/367493 Log: igmp: convert igmpstat to use PCPU counters Currently there is no locking done to protect this structure. It is likely okay due to the low-volume nature of IGMP, but allows for the possibility of underflow. This appears to be one of the only holdouts of the conversion to counter(9) which was done for most protocol stat structures around 2013. This also updates the visibility of this stats structure so that it can be consumed from elsewhere in the kernel, consistent with the vast majority of VNET_PCPUSTAT structures. Reviewed by: kp Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D27023 Modified: head/sys/netinet/igmp.c head/sys/netinet/igmp_var.h Modified: head/sys/netinet/igmp.c ============================================================================== --- head/sys/netinet/igmp.c Sun Nov 8 18:47:05 2020 (r367492) +++ head/sys/netinet/igmp.c Sun Nov 8 18:49:23 2020 (r367493) @@ -230,16 +230,15 @@ VNET_DEFINE_STATIC(int, current_state_timers_running); #define V_state_change_timers_running VNET(state_change_timers_running) #define V_current_state_timers_running VNET(current_state_timers_running) +VNET_PCPUSTAT_DEFINE(struct igmpstat, igmpstat); +VNET_PCPUSTAT_SYSINIT(igmpstat); +VNET_PCPUSTAT_SYSUNINIT(igmpstat); + VNET_DEFINE_STATIC(LIST_HEAD(, igmp_ifsoftc), igi_head) = LIST_HEAD_INITIALIZER(igi_head); -VNET_DEFINE_STATIC(struct igmpstat, igmpstat) = { - .igps_version = IGPS_VERSION_3, - .igps_len = sizeof(struct igmpstat), -}; VNET_DEFINE_STATIC(struct timeval, igmp_gsrdelay) = {10, 0}; #define V_igi_head VNET(igi_head) -#define V_igmpstat VNET(igmpstat) #define V_igmp_gsrdelay VNET(igmp_gsrdelay) VNET_DEFINE_STATIC(int, igmp_recvifkludge) = 1; @@ -263,7 +262,8 @@ VNET_DEFINE_STATIC(int, igmp_default_version) = IGMP_V */ SYSCTL_PROC(_net_inet_igmp, IGMPCTL_STATS, stats, CTLFLAG_VNET | CTLTYPE_STRUCT | CTLFLAG_RW | CTLFLAG_MPSAFE, - &VNET_NAME(igmpstat), 0, sysctl_igmp_stat, "S,igmpstat", ""); + &VNET_NAME(igmpstat), 0, sysctl_igmp_stat, "S,igmpstat", + "IGMP statistics (struct igmpstat, netinet/igmp_var.h)"); SYSCTL_INT(_net_inet_igmp, OID_AUTO, recvifkludge, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(igmp_recvifkludge), 0, "Rewrite IGMPv1/v2 reports from 0.0.0.0 to contain subnet address"); @@ -347,22 +347,31 @@ sysctl_igmp_stat(SYSCTL_HANDLER_ARGS) int error; char *p; - error = sysctl_wire_old_buffer(req, sizeof(V_igmpstat)); + error = sysctl_wire_old_buffer(req, sizeof(struct igmpstat)); if (error) return (error); if (req->oldptr != NULL) { - if (req->oldlen < sizeof(V_igmpstat)) + if (req->oldlen < sizeof(struct igmpstat)) error = ENOMEM; - else - error = SYSCTL_OUT(req, &V_igmpstat, - sizeof(V_igmpstat)); + else { + /* + * Copy the counters, and explicitly set the struct's + * version and length fields. + */ + COUNTER_ARRAY_COPY(VNET(igmpstat), &igps0, + sizeof(struct igmpstat) / sizeof(uint64_t)); + igps0.igps_version = IGPS_VERSION_3; + igps0.igps_len = IGPS_VERSION3_LEN; + error = SYSCTL_OUT(req, &igps0, + sizeof(struct igmpstat)); + } } else - req->validlen = sizeof(V_igmpstat); + req->validlen = sizeof(struct igmpstat); if (error) goto out; if (req->newptr != NULL) { - if (req->newlen < sizeof(V_igmpstat)) + if (req->newlen < sizeof(struct igmpstat)) error = ENOMEM; else error = SYSCTL_IN(req, &igps0, @@ -379,12 +388,8 @@ sysctl_igmp_stat(SYSCTL_HANDLER_ARGS) error = EINVAL; goto out; } - /* - * Avoid overwrite of the version and length field. - */ - igps0.igps_version = V_igmpstat.igps_version; - igps0.igps_len = V_igmpstat.igps_len; - bcopy(&igps0, &V_igmpstat, sizeof(V_igmpstat)); + COUNTER_ARRAY_ZERO(VNET(igmpstat), + sizeof(struct igmpstat) / sizeof(uint64_t)); } out: return (error); Modified: head/sys/netinet/igmp_var.h ============================================================================== --- head/sys/netinet/igmp_var.h Sun Nov 8 18:47:05 2020 (r367492) +++ head/sys/netinet/igmp_var.h Sun Nov 8 18:49:23 2020 (r367493) @@ -54,6 +54,7 @@ struct igmpstat { /* * Structure header (to insulate ABI changes). + * XXX: unset inside the kernel, exported via sysctl_igmp_stat(). */ uint32_t igps_version; /* version of this structure */ uint32_t igps_len; /* length of this structure */ @@ -184,8 +185,12 @@ struct igmp_ifinfo { }; #ifdef _KERNEL -#define IGMPSTAT_ADD(name, val) V_igmpstat.name += (val) -#define IGMPSTAT_INC(name) IGMPSTAT_ADD(name, 1) +#include + +VNET_PCPUSTAT_DECLARE(struct igmpstat, igmpstat); +#define IGMPSTAT_ADD(name, val) \ + VNET_PCPUSTAT_ADD(struct igmpstat, igmpstat, name, (val)) +#define IGMPSTAT_INC(name) IGMPSTAT_ADD(name, 1) /* * Subsystem lock macros. From owner-svn-src-head@freebsd.org Sun Nov 8 19:02:22 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B67A82D2A23; Sun, 8 Nov 2020 19:02:22 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTk5V4t0Xz4l1l; Sun, 8 Nov 2020 19:02:22 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A26924B8F; Sun, 8 Nov 2020 19:02:22 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A8J2MnF080279; Sun, 8 Nov 2020 19:02:22 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A8J2MJs080278; Sun, 8 Nov 2020 19:02:22 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202011081902.0A8J2MJs080278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Sun, 8 Nov 2020 19:02:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367494 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 367494 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 08 Nov 2020 19:02:22 -0000 Author: mhorne Date: Sun Nov 8 19:02:22 2020 New Revision: 367494 URL: https://svnweb.freebsd.org/changeset/base/367494 Log: Fix definition of rn_addmask() Add the missing static keyword present in the declaration. Reviewed by: melifaro Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D27024 Modified: head/sys/net/radix.c Modified: head/sys/net/radix.c ============================================================================== --- head/sys/net/radix.c Sun Nov 8 18:49:23 2020 (r367493) +++ head/sys/net/radix.c Sun Nov 8 19:02:22 2020 (r367494) @@ -483,7 +483,7 @@ on1: return (tt); } -struct radix_node * +static struct radix_node * rn_addmask(void *n_arg, struct radix_mask_head *maskhead, int search, int skip) { unsigned char *netmask = n_arg; From owner-svn-src-head@freebsd.org Sun Nov 8 22:30:14 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9C61B2D745E; Sun, 8 Nov 2020 22:30:14 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTpjL41cmz3BxW; Sun, 8 Nov 2020 22:30:14 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7CBDB26E50; Sun, 8 Nov 2020 22:30:14 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A8MUEBv005329; Sun, 8 Nov 2020 22:30:14 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A8MUEeT005328; Sun, 8 Nov 2020 22:30:14 GMT (envelope-from np@FreeBSD.org) Message-Id: <202011082230.0A8MUEeT005328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 8 Nov 2020 22:30:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367495 - head/sys/dev/cxgbe/firmware X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/firmware X-SVN-Commit-Revision: 367495 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 08 Nov 2020 22:30:14 -0000 Author: np Date: Sun Nov 8 22:30:13 2020 New Revision: 367495 URL: https://svnweb.freebsd.org/changeset/base/367495 Log: cxgbe(4): Add the firmware binaries missing in r367428. Obtained from: Chelsio Communications MFC after: 5 days Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/firmware/t4fw-1.25.0.40.bin (contents, props changed) head/sys/dev/cxgbe/firmware/t5fw-1.25.0.40.bin (contents, props changed) head/sys/dev/cxgbe/firmware/t6fw-1.25.0.40.bin (contents, props changed) Modified: head/sys/dev/cxgbe/firmware/t4fw-1.25.0.40.bin ============================================================================== Binary file (source and/or target). No diff available. Modified: head/sys/dev/cxgbe/firmware/t5fw-1.25.0.40.bin ============================================================================== Binary file (source and/or target). No diff available. Modified: head/sys/dev/cxgbe/firmware/t6fw-1.25.0.40.bin ============================================================================== Binary file (source and/or target). No diff available. From owner-svn-src-head@freebsd.org Sun Nov 8 23:34:07 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 30EAF2E109F; Sun, 8 Nov 2020 23:34:07 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTr730v7jz3Gjj; Sun, 8 Nov 2020 23:34:07 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0697F27BD1; Sun, 8 Nov 2020 23:34:07 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A8NY6XF048257; Sun, 8 Nov 2020 23:34:06 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A8NY6c8048256; Sun, 8 Nov 2020 23:34:06 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202011082334.0A8NY6c8048256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Sun, 8 Nov 2020 23:34:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367496 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 367496 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 08 Nov 2020 23:34:07 -0000 Author: bdragon Date: Sun Nov 8 23:34:06 2020 New Revision: 367496 URL: https://svnweb.freebsd.org/changeset/base/367496 Log: [PowerPC] Fix powerpc64le boot after HPT superpages addition The HPT is always stored in big-endian, as it is accessed directly by the hardware as well as the kernel. As such, it is necessary to convert values to and from native endian when running on LE. Some unconverted accesses snuck in accidentally with r367417. Apply the appropriate conversions to fix boot hanging on powerpc64le. Sponsored by: Tag1 Consulting, Inc. Modified: head/sys/powerpc/aim/moea64_native.c Modified: head/sys/powerpc/aim/moea64_native.c ============================================================================== --- head/sys/powerpc/aim/moea64_native.c Sun Nov 8 22:30:13 2020 (r367495) +++ head/sys/powerpc/aim/moea64_native.c Sun Nov 8 23:34:06 2020 (r367496) @@ -384,7 +384,7 @@ moea64_pte_clear_native(struct pvo_entry *pvo, uint64_ static __always_inline int64_t moea64_pte_unset_locked(volatile struct lpte *pt, uint64_t vpn) { - uint64_t ptelo; + uint64_t ptelo, ptehi; /* * Invalidate the pte, briefly locking it to collect RC bits. No @@ -392,9 +392,10 @@ moea64_pte_unset_locked(volatile struct lpte *pt, uint */ isync(); critical_enter(); - pt->pte_hi = htobe64((be64toh(pt->pte_hi) & ~LPTE_VALID) | LPTE_LOCKED); + ptehi = (be64toh(pt->pte_hi) & ~LPTE_VALID) | LPTE_LOCKED; + pt->pte_hi = htobe64(ptehi); PTESYNC(); - TLBIE(vpn, pt->pte_hi); + TLBIE(vpn, ptehi); ptelo = be64toh(pt->pte_lo); *((volatile int32_t *)(&pt->pte_hi) + 1) = 0; /* Release lock */ critical_exit(); @@ -416,7 +417,7 @@ moea64_pte_unset_native(struct pvo_entry *pvo) rw_rlock(&moea64_eviction_lock); - if ((be64toh(pt->pte_hi & LPTE_AVPN_MASK)) != pvo_ptevpn) { + if ((be64toh(pt->pte_hi) & LPTE_AVPN_MASK) != pvo_ptevpn) { /* Evicted */ STAT_MOEA64(moea64_pte_overflow--); ret = -1; @@ -433,7 +434,7 @@ moea64_pte_replace_inval_native(struct pvo_entry *pvo, volatile struct lpte *pt) { struct lpte properpt; - uint64_t ptelo; + uint64_t ptelo, ptehi; moea64_pte_from_pvo(pvo, &properpt); @@ -452,9 +453,10 @@ moea64_pte_replace_inval_native(struct pvo_entry *pvo, */ isync(); critical_enter(); - pt->pte_hi = htobe64((be64toh(pt->pte_hi) & ~LPTE_VALID) | LPTE_LOCKED); + ptehi = (be64toh(pt->pte_hi) & ~LPTE_VALID) | LPTE_LOCKED; + pt->pte_hi = htobe64(ptehi); PTESYNC(); - TLBIE(pvo->pvo_vpn, pt->pte_hi); + TLBIE(pvo->pvo_vpn, ptehi); ptelo = be64toh(pt->pte_lo); EIEIO(); pt->pte_lo = htobe64(properpt.pte_lo); From owner-svn-src-head@freebsd.org Mon Nov 9 00:01:14 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2CEA02E1C0F; Mon, 9 Nov 2020 00:01:14 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTrkL0YwCz3HgZ; Mon, 9 Nov 2020 00:01:14 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 048AE398; Mon, 9 Nov 2020 00:01:14 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A901DH9061856; Mon, 9 Nov 2020 00:01:13 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A901DcA061853; Mon, 9 Nov 2020 00:01:13 GMT (envelope-from np@FreeBSD.org) Message-Id: <202011090001.0A901DcA061853@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 9 Nov 2020 00:01:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367497 - in head/sys/dev/cxgbe: . common X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys/dev/cxgbe: . common X-SVN-Commit-Revision: 367497 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 09 Nov 2020 00:01:14 -0000 Author: np Date: Mon Nov 9 00:01:13 2020 New Revision: 367497 URL: https://svnweb.freebsd.org/changeset/base/367497 Log: cxgbev(4): Use the MAC address set by the the PF if there is one. Query the firmware for the MAC address set by the PF for the VF and use it instead of the firmware generated MAC if it's available. MFC after: 2 weeks Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/common/t4vf_hw.c head/sys/dev/cxgbe/t4_vf.c Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Sun Nov 8 23:34:06 2020 (r367496) +++ head/sys/dev/cxgbe/common/common.h Mon Nov 9 00:01:13 2020 (r367497) @@ -912,6 +912,8 @@ int t4vf_get_sge_params(struct adapter *adapter); int t4vf_get_rss_glb_config(struct adapter *adapter); int t4vf_get_vfres(struct adapter *adapter); int t4vf_prep_adapter(struct adapter *adapter); +int t4vf_get_vf_mac(struct adapter *adapter, unsigned int port, + unsigned int *naddr, u8 *addr); int t4_bar2_sge_qregs(struct adapter *adapter, unsigned int qid, enum t4_bar2_qtype qtype, int user, u64 *pbar2_qoffset, unsigned int *pbar2_qid); Modified: head/sys/dev/cxgbe/common/t4vf_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4vf_hw.c Sun Nov 8 23:34:06 2020 (r367496) +++ head/sys/dev/cxgbe/common/t4vf_hw.c Mon Nov 9 00:01:13 2020 (r367497) @@ -382,3 +382,49 @@ int t4vf_prep_adapter(struct adapter *adapter) return 0; } + +/* + * t4vf_get_vf_mac - Get the MAC address to be set to the VI of this VF. + * @adapter: The adapter + * @port: The port associated with vf + * @naddr: the number of ACL MAC addresses returned in addr + * @addr: Placeholder for MAC addresses + * + * Find the MAC address to be set to the VF's VI. The requested MAC address + * is from the host OS via callback in the PF driver. + */ +int t4vf_get_vf_mac(struct adapter *adapter, unsigned int port, + unsigned int *naddr, u8 *addr) +{ + struct fw_acl_mac_cmd cmd; + int ret; + + memset(&cmd, 0, sizeof(cmd)); + cmd.op_to_vfn = cpu_to_be32(V_FW_CMD_OP(FW_ACL_MAC_CMD) | + F_FW_CMD_REQUEST | + F_FW_CMD_READ); + cmd.en_to_len16 = cpu_to_be32((unsigned int)FW_LEN16(cmd)); + ret = t4vf_wr_mbox(adapter, &cmd, sizeof(cmd), &cmd); + if (ret) + return ret; + + if (cmd.nmac < *naddr) + *naddr = cmd.nmac; + + switch (port) { + case 3: + memcpy(addr, cmd.macaddr3, sizeof(cmd.macaddr3)); + break; + case 2: + memcpy(addr, cmd.macaddr2, sizeof(cmd.macaddr2)); + break; + case 1: + memcpy(addr, cmd.macaddr1, sizeof(cmd.macaddr1)); + break; + case 0: + memcpy(addr, cmd.macaddr0, sizeof(cmd.macaddr0)); + break; + } + + return ret; +} Modified: head/sys/dev/cxgbe/t4_vf.c ============================================================================== --- head/sys/dev/cxgbe/t4_vf.c Sun Nov 8 23:34:06 2020 (r367496) +++ head/sys/dev/cxgbe/t4_vf.c Mon Nov 9 00:01:13 2020 (r367497) @@ -481,7 +481,7 @@ static int t4vf_attach(device_t dev) { struct adapter *sc; - int rc = 0, i, j, rqidx, tqidx; + int rc = 0, i, j, rqidx, tqidx, n, p, pmask; struct make_dev_args mda; struct intrs_and_queues iaq; struct sge *s; @@ -618,8 +618,10 @@ t4vf_attach(device_t dev) * First pass over all the ports - allocate VIs and initialize some * basic parameters like mac address, port type, etc. */ + pmask = sc->params.vfres.pmask; for_each_port(sc, i) { struct port_info *pi; + uint8_t mac[ETHER_ADDR_LEN]; pi = malloc(sizeof(*pi), M_CXGBE, M_ZERO | M_WAITOK); sc->port[i] = pi; @@ -644,6 +646,15 @@ t4vf_attach(device_t dev) sc->port[i] = NULL; goto done; } + + /* Prefer the MAC address set by the PF, if there is one. */ + n = 1; + p = ffs(pmask) - 1; + MPASS(p >= 0); + rc = t4vf_get_vf_mac(sc, p, &n, mac); + if (rc == 0 && n == 1) + t4_os_set_hw_addr(pi, mac); + pmask &= ~(1 << p); /* No t4_link_start. */ From owner-svn-src-head@freebsd.org Mon Nov 9 00:04:37 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 35B812E231C; Mon, 9 Nov 2020 00:04:37 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTrpF16Mvz3JJH; Mon, 9 Nov 2020 00:04:37 +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 18EBE2C6; Mon, 9 Nov 2020 00:04:37 +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 0A904aj4066777; Mon, 9 Nov 2020 00:04:36 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A904Zxe066772; Mon, 9 Nov 2020 00:04:35 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011090004.0A904Zxe066772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 9 Nov 2020 00:04:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367498 - in head/sys: compat/linuxkpi/common/src dev/evdev kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: compat/linuxkpi/common/src dev/evdev kern sys X-SVN-Commit-Revision: 367498 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 09 Nov 2020 00:04:37 -0000 Author: mjg Date: Mon Nov 9 00:04:35 2020 New Revision: 367498 URL: https://svnweb.freebsd.org/changeset/base/367498 Log: kqueue: save space by using only one func pointer for assertions Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c head/sys/dev/evdev/uinput.c head/sys/kern/kern_event.c head/sys/kern/uipc_socket.c head/sys/kern/vfs_subr.c head/sys/sys/event.h Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Mon Nov 9 00:01:13 2020 (r367497) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Mon Nov 9 00:04:35 2020 (r367498) @@ -422,26 +422,19 @@ linux_kq_unlock(void *arg) } static void -linux_kq_lock_owned(void *arg) +linux_kq_assert_lock(void *arg, int what) { #ifdef INVARIANTS spinlock_t *s = arg; - mtx_assert(&s->m, MA_OWNED); + if (what == LA_LOCKED) + mtx_assert(&s->m, MA_OWNED); + else + mtx_assert(&s->m, MA_NOTOWNED); #endif } static void -linux_kq_lock_unowned(void *arg) -{ -#ifdef INVARIANTS - spinlock_t *s = arg; - - mtx_assert(&s->m, MA_NOTOWNED); -#endif -} - -static void linux_file_kqfilter_poll(struct linux_file *, int); struct linux_file * @@ -457,8 +450,7 @@ linux_file_alloc(void) /* setup fields needed by kqueue support */ spin_lock_init(&filp->f_kqlock); knlist_init(&filp->f_selinfo.si_note, &filp->f_kqlock, - linux_kq_lock, linux_kq_unlock, - linux_kq_lock_owned, linux_kq_lock_unowned); + linux_kq_lock, linux_kq_unlock, linux_kq_assert_lock); return (filp); } Modified: head/sys/dev/evdev/uinput.c ============================================================================== --- head/sys/dev/evdev/uinput.c Mon Nov 9 00:01:13 2020 (r367497) +++ head/sys/dev/evdev/uinput.c Mon Nov 9 00:04:35 2020 (r367498) @@ -145,20 +145,16 @@ uinput_knlunlock(void *arg) } static void -uinput_knl_assert_locked(void *arg) +uinput_knl_assert_lock(void *arg, int what) { - sx_assert((struct sx*)arg, SA_XLOCKED); + if (what == LA_LOCKED) + sx_assert((struct sx*)arg, SA_XLOCKED); + else + sx_assert((struct sx*)arg, SA_UNLOCKED); } static void -uinput_knl_assert_unlocked(void *arg) -{ - - sx_assert((struct sx*)arg, SA_UNLOCKED); -} - -static void uinput_ev_event(struct evdev_dev *evdev, uint16_t type, uint16_t code, int32_t value) { @@ -212,8 +208,7 @@ uinput_open(struct cdev *dev, int oflags, int devtype, sx_init(&state->ucs_lock, "uinput"); knlist_init(&state->ucs_selp.si_note, &state->ucs_lock, uinput_knllock, - uinput_knlunlock, uinput_knl_assert_locked, - uinput_knl_assert_unlocked); + uinput_knlunlock, uinput_knl_assert_lock); devfs_set_cdevpriv(state, uinput_dtor); return (0); Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Mon Nov 9 00:01:13 2020 (r367497) +++ head/sys/kern/kern_event.c Mon Nov 9 00:04:35 2020 (r367498) @@ -305,10 +305,10 @@ kn_leave_flux(struct knote *kn) } while (0) #ifdef INVARIANTS #define KNL_ASSERT_LOCKED(knl) do { \ - knl->kl_assert_locked((knl)->kl_lockarg); \ + knl->kl_assert_lock((knl)->kl_lockarg, LA_LOCKED); \ } while (0) #define KNL_ASSERT_UNLOCKED(knl) do { \ - knl->kl_assert_unlocked((knl)->kl_lockarg); \ + knl->kl_assert_lock((knl)->kl_lockarg, LA_UNLOCKED); \ } while (0) #else /* !INVARIANTS */ #define KNL_ASSERT_LOCKED(knl) do {} while(0) @@ -2375,20 +2375,16 @@ knlist_mtx_unlock(void *arg) } static void -knlist_mtx_assert_locked(void *arg) +knlist_mtx_assert_lock(void *arg, int what) { - mtx_assert((struct mtx *)arg, MA_OWNED); + if (what == LA_LOCKED) + mtx_assert((struct mtx *)arg, MA_OWNED); + else + mtx_assert((struct mtx *)arg, MA_NOTOWNED); } static void -knlist_mtx_assert_unlocked(void *arg) -{ - - mtx_assert((struct mtx *)arg, MA_NOTOWNED); -} - -static void knlist_rw_rlock(void *arg) { @@ -2403,23 +2399,19 @@ knlist_rw_runlock(void *arg) } static void -knlist_rw_assert_locked(void *arg) +knlist_rw_assert_lock(void *arg, int what) { - rw_assert((struct rwlock *)arg, RA_LOCKED); + if (what == LA_LOCKED) + rw_assert((struct rwlock *)arg, RA_LOCKED); + else + rw_assert((struct rwlock *)arg, RA_UNLOCKED); } -static void -knlist_rw_assert_unlocked(void *arg) -{ - - rw_assert((struct rwlock *)arg, RA_UNLOCKED); -} - void knlist_init(struct knlist *knl, void *lock, void (*kl_lock)(void *), void (*kl_unlock)(void *), - void (*kl_assert_locked)(void *), void (*kl_assert_unlocked)(void *)) + void (*kl_assert_lock)(void *, int)) { if (lock == NULL) @@ -2435,14 +2427,10 @@ knlist_init(struct knlist *knl, void *lock, void (*kl_ knl->kl_unlock = knlist_mtx_unlock; else knl->kl_unlock = kl_unlock; - if (kl_assert_locked == NULL) - knl->kl_assert_locked = knlist_mtx_assert_locked; + if (kl_assert_lock == NULL) + knl->kl_assert_lock = knlist_mtx_assert_lock; else - knl->kl_assert_locked = kl_assert_locked; - if (kl_assert_unlocked == NULL) - knl->kl_assert_unlocked = knlist_mtx_assert_unlocked; - else - knl->kl_assert_unlocked = kl_assert_unlocked; + knl->kl_assert_lock = kl_assert_lock; knl->kl_autodestroy = 0; SLIST_INIT(&knl->kl_list); @@ -2452,7 +2440,7 @@ void knlist_init_mtx(struct knlist *knl, struct mtx *lock) { - knlist_init(knl, lock, NULL, NULL, NULL, NULL); + knlist_init(knl, lock, NULL, NULL, NULL); } struct knlist * @@ -2470,7 +2458,7 @@ knlist_init_rw_reader(struct knlist *knl, struct rwloc { knlist_init(knl, lock, knlist_rw_rlock, knlist_rw_runlock, - knlist_rw_assert_locked, knlist_rw_assert_unlocked); + knlist_rw_assert_lock); } void Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Mon Nov 9 00:01:13 2020 (r367497) +++ head/sys/kern/uipc_socket.c Mon Nov 9 00:04:35 2020 (r367498) @@ -165,12 +165,10 @@ static int soreceive_rcvoob(struct socket *so, struct int flags); static void so_rdknl_lock(void *); static void so_rdknl_unlock(void *); -static void so_rdknl_assert_locked(void *); -static void so_rdknl_assert_unlocked(void *); +static void so_rdknl_assert_lock(void *, int); static void so_wrknl_lock(void *); static void so_wrknl_unlock(void *); -static void so_wrknl_assert_locked(void *); -static void so_wrknl_assert_unlocked(void *); +static void so_wrknl_assert_lock(void *, int); static void filt_sordetach(struct knote *kn); static int filt_soread(struct knote *kn, long hint); @@ -550,9 +548,9 @@ socreate(int dom, struct socket **aso, int type, int p mac_socket_create(cred, so); #endif knlist_init(&so->so_rdsel.si_note, so, so_rdknl_lock, so_rdknl_unlock, - so_rdknl_assert_locked, so_rdknl_assert_unlocked); + so_rdknl_assert_lock); knlist_init(&so->so_wrsel.si_note, so, so_wrknl_lock, so_wrknl_unlock, - so_wrknl_assert_locked, so_wrknl_assert_unlocked); + so_wrknl_assert_lock); /* * Auto-sizing of socket buffers is managed by the protocols and * the appropriate flags must be set in the pru_attach function. @@ -729,9 +727,9 @@ sonewconn(struct socket *head, int connstatus) mac_socket_newconn(head, so); #endif knlist_init(&so->so_rdsel.si_note, so, so_rdknl_lock, so_rdknl_unlock, - so_rdknl_assert_locked, so_rdknl_assert_unlocked); + so_rdknl_assert_lock); knlist_init(&so->so_wrsel.si_note, so, so_wrknl_lock, so_wrknl_unlock, - so_wrknl_assert_locked, so_wrknl_assert_unlocked); + so_wrknl_assert_lock); VNET_SO_ASSERT(head); if (soreserve(so, head->sol_sbsnd_hiwat, head->sol_sbrcv_hiwat)) { sodealloc(so); @@ -823,9 +821,9 @@ sopeeloff(struct socket *head) mac_socket_newconn(head, so); #endif knlist_init(&so->so_rdsel.si_note, so, so_rdknl_lock, so_rdknl_unlock, - so_rdknl_assert_locked, so_rdknl_assert_unlocked); + so_rdknl_assert_lock); knlist_init(&so->so_wrsel.si_note, so, so_wrknl_lock, so_wrknl_unlock, - so_wrknl_assert_locked, so_wrknl_assert_unlocked); + so_wrknl_assert_lock); VNET_SO_ASSERT(head); if (soreserve(so, head->so_snd.sb_hiwat, head->so_rcv.sb_hiwat)) { sodealloc(so); @@ -4189,28 +4187,24 @@ so_rdknl_unlock(void *arg) } static void -so_rdknl_assert_locked(void *arg) +so_rdknl_assert_lock(void *arg, int what) { struct socket *so = arg; - if (SOLISTENING(so)) - SOCK_LOCK_ASSERT(so); - else - SOCKBUF_LOCK_ASSERT(&so->so_rcv); + if (what == LA_LOCKED) { + if (SOLISTENING(so)) + SOCK_LOCK_ASSERT(so); + else + SOCKBUF_LOCK_ASSERT(&so->so_rcv); + } else { + if (SOLISTENING(so)) + SOCK_UNLOCK_ASSERT(so); + else + SOCKBUF_UNLOCK_ASSERT(&so->so_rcv); + } } static void -so_rdknl_assert_unlocked(void *arg) -{ - struct socket *so = arg; - - if (SOLISTENING(so)) - SOCK_UNLOCK_ASSERT(so); - else - SOCKBUF_UNLOCK_ASSERT(&so->so_rcv); -} - -static void so_wrknl_lock(void *arg) { struct socket *so = arg; @@ -4233,25 +4227,21 @@ so_wrknl_unlock(void *arg) } static void -so_wrknl_assert_locked(void *arg) +so_wrknl_assert_lock(void *arg, int what) { struct socket *so = arg; - if (SOLISTENING(so)) - SOCK_LOCK_ASSERT(so); - else - SOCKBUF_LOCK_ASSERT(&so->so_snd); -} - -static void -so_wrknl_assert_unlocked(void *arg) -{ - struct socket *so = arg; - - if (SOLISTENING(so)) - SOCK_UNLOCK_ASSERT(so); - else - SOCKBUF_UNLOCK_ASSERT(&so->so_snd); + if (what == LA_LOCKED) { + if (SOLISTENING(so)) + SOCK_LOCK_ASSERT(so); + else + SOCKBUF_LOCK_ASSERT(&so->so_snd); + } else { + if (SOLISTENING(so)) + SOCK_UNLOCK_ASSERT(so); + else + SOCKBUF_UNLOCK_ASSERT(&so->so_snd); + } } /* Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Mon Nov 9 00:01:13 2020 (r367497) +++ head/sys/kern/vfs_subr.c Mon Nov 9 00:04:35 2020 (r367498) @@ -112,8 +112,7 @@ static void vgonel(struct vnode *); static bool vhold_recycle_free(struct vnode *); static void vfs_knllock(void *arg); static void vfs_knlunlock(void *arg); -static void vfs_knl_assert_locked(void *arg); -static void vfs_knl_assert_unlocked(void *arg); +static void vfs_knl_assert_lock(void *arg, int what); static void destroy_vpollinfo(struct vpollinfo *vi); static int v_inval_buf_range_locked(struct vnode *vp, struct bufobj *bo, daddr_t startlbn, daddr_t endlbn); @@ -4811,7 +4810,7 @@ v_addpollinfo(struct vnode *vp) vi = malloc(sizeof(*vi), M_VNODEPOLL, M_WAITOK | M_ZERO); mtx_init(&vi->vpi_lock, "vnode pollinfo", NULL, MTX_DEF); knlist_init(&vi->vpi_selinfo.si_note, vp, vfs_knllock, - vfs_knlunlock, vfs_knl_assert_locked, vfs_knl_assert_unlocked); + vfs_knlunlock, vfs_knl_assert_lock); VI_LOCK(vp); if (vp->v_pollinfo != NULL) { VI_UNLOCK(vp); @@ -6060,22 +6059,15 @@ vfs_knlunlock(void *arg) } static void -vfs_knl_assert_locked(void *arg) +vfs_knl_assert_lock(void *arg, int what) { #ifdef DEBUG_VFS_LOCKS struct vnode *vp = arg; - ASSERT_VOP_LOCKED(vp, "vfs_knl_assert_locked"); -#endif -} - -static void -vfs_knl_assert_unlocked(void *arg) -{ -#ifdef DEBUG_VFS_LOCKS - struct vnode *vp = arg; - - ASSERT_VOP_UNLOCKED(vp, "vfs_knl_assert_unlocked"); + if (what == LA_LOCKED) + ASSERT_VOP_LOCKED(vp, "vfs_knl_assert_locked"); + else + ASSERT_VOP_UNLOCKED(vp, "vfs_knl_assert_unlocked"); #endif } Modified: head/sys/sys/event.h ============================================================================== --- head/sys/sys/event.h Mon Nov 9 00:01:13 2020 (r367497) +++ head/sys/sys/event.h Mon Nov 9 00:04:35 2020 (r367498) @@ -224,8 +224,7 @@ struct knlist { struct klist kl_list; void (*kl_lock)(void *); /* lock function */ void (*kl_unlock)(void *); - void (*kl_assert_locked)(void *); - void (*kl_assert_unlocked)(void *); + void (*kl_assert_lock)(void *, int); void *kl_lockarg; /* argument passed to lock functions */ int kl_autodestroy; }; @@ -334,8 +333,7 @@ void knlist_add(struct knlist *knl, struct knote *kn, void knlist_remove(struct knlist *knl, struct knote *kn, int islocked); int knlist_empty(struct knlist *knl); void knlist_init(struct knlist *knl, void *lock, void (*kl_lock)(void *), - void (*kl_unlock)(void *), void (*kl_assert_locked)(void *), - void (*kl_assert_unlocked)(void *)); + void (*kl_unlock)(void *), void (*kl_assert_lock)(void *, int)); void knlist_init_mtx(struct knlist *knl, struct mtx *lock); void knlist_init_rw_reader(struct knlist *knl, struct rwlock *lock); void knlist_destroy(struct knlist *knl); From owner-svn-src-head@freebsd.org Mon Nov 9 00:04:59 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 381142E1FD4; Mon, 9 Nov 2020 00:04:59 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTrpg15Pkz3JgF; Mon, 9 Nov 2020 00:04:59 +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 1820B22E; Mon, 9 Nov 2020 00:04:59 +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 0A904wIG066836; Mon, 9 Nov 2020 00:04:58 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A904wDw066835; Mon, 9 Nov 2020 00:04:58 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011090004.0A904wDw066835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 9 Nov 2020 00:04:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367499 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 367499 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 09 Nov 2020 00:04:59 -0000 Author: mjg Date: Mon Nov 9 00:04:58 2020 New Revision: 367499 URL: https://svnweb.freebsd.org/changeset/base/367499 Log: bufcache: convert bo_numoutput from long to int int is wide enough and it plugs a hole in struct vnode, taking it down from 496 to 488 bytes. Modified: head/sys/sys/bufobj.h Modified: head/sys/sys/bufobj.h ============================================================================== --- head/sys/sys/bufobj.h Mon Nov 9 00:04:35 2020 (r367498) +++ head/sys/sys/bufobj.h Mon Nov 9 00:04:58 2020 (r367499) @@ -104,7 +104,7 @@ struct bufobj { void *bo_private; /* private pointer */ struct bufv bo_clean; /* i Clean buffers */ struct bufv bo_dirty; /* i Dirty buffers */ - long bo_numoutput; /* i Writes in progress */ + int bo_numoutput; /* i Writes in progress */ u_int bo_flag; /* i Flags */ int bo_domain; /* - Clean queue affinity */ int bo_bsize; /* - Block size for i/o */ From owner-svn-src-head@freebsd.org Mon Nov 9 00:05:22 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2C4A22E24A5; Mon, 9 Nov 2020 00:05:22 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTrq60ZQbz3Jn7; Mon, 9 Nov 2020 00:05:22 +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 054273B4; Mon, 9 Nov 2020 00:05:22 +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 0A905Lpk066912; Mon, 9 Nov 2020 00:05:21 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A905Lqd066911; Mon, 9 Nov 2020 00:05:21 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011090005.0A905Lqd066911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 9 Nov 2020 00:05:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367500 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 367500 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 09 Nov 2020 00:05:22 -0000 Author: mjg Date: Mon Nov 9 00:05:21 2020 New Revision: 367500 URL: https://svnweb.freebsd.org/changeset/base/367500 Log: procdesc: convert the zone to a malloc type The object is 128 bytes in size. Modified: head/sys/kern/sys_procdesc.c Modified: head/sys/kern/sys_procdesc.c ============================================================================== --- head/sys/kern/sys_procdesc.c Mon Nov 9 00:04:58 2020 (r367499) +++ head/sys/kern/sys_procdesc.c Mon Nov 9 00:05:21 2020 (r367500) @@ -92,7 +92,7 @@ __FBSDID("$FreeBSD$"); FEATURE(process_descriptors, "Process Descriptors"); -static uma_zone_t procdesc_zone; +MALLOC_DEFINE(M_PROCDESC, "procdesc", "process descriptors"); static fo_poll_t procdesc_poll; static fo_kqfilter_t procdesc_kqfilter; @@ -117,22 +117,6 @@ static struct fileops procdesc_ops = { }; /* - * Initialize with VFS so that process descriptors are available along with - * other file descriptor types. As long as it runs before init(8) starts, - * there shouldn't be a problem. - */ -static void -procdesc_init(void *dummy __unused) -{ - - procdesc_zone = uma_zcreate("procdesc", sizeof(struct procdesc), - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - if (procdesc_zone == NULL) - panic("procdesc_init: procdesc_zone not initialized"); -} -SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_ANY, procdesc_init, NULL); - -/* * Return a locked process given a process descriptor, or ESRCH if it has * died. */ @@ -229,7 +213,7 @@ procdesc_new(struct proc *p, int flags) { struct procdesc *pd; - pd = uma_zalloc(procdesc_zone, M_WAITOK | M_ZERO); + pd = malloc(sizeof(*pd), M_PROCDESC, M_WAITOK | M_ZERO); pd->pd_proc = p; pd->pd_pid = p->p_pid; p->p_procdesc = pd; @@ -290,7 +274,7 @@ procdesc_free(struct procdesc *pd) knlist_destroy(&pd->pd_selinfo.si_note); PROCDESC_LOCK_DESTROY(pd); - uma_zfree(procdesc_zone, pd); + free(pd, M_PROCDESC); } } From owner-svn-src-head@freebsd.org Mon Nov 9 00:05:46 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 642032E2593; Mon, 9 Nov 2020 00:05:46 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTrqZ2KMDz3JtL; Mon, 9 Nov 2020 00:05:46 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 42E7F4B6; Mon, 9 Nov 2020 00:05:46 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A905kZ9066983; Mon, 9 Nov 2020 00:05:46 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A905ku9066982; Mon, 9 Nov 2020 00:05:46 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011090005.0A905ku9066982@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 9 Nov 2020 00:05:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367501 - head/usr.bin/vmstat X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/usr.bin/vmstat X-SVN-Commit-Revision: 367501 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 09 Nov 2020 00:05:46 -0000 Author: mjg Date: Mon Nov 9 00:05:45 2020 New Revision: 367501 URL: https://svnweb.freebsd.org/changeset/base/367501 Log: vmstat: remove spurious newlines when reporting zones Modified: head/usr.bin/vmstat/vmstat.c Modified: head/usr.bin/vmstat/vmstat.c ============================================================================== --- head/usr.bin/vmstat/vmstat.c Mon Nov 9 00:05:21 2020 (r367500) +++ head/usr.bin/vmstat/vmstat.c Mon Nov 9 00:05:45 2020 (r367501) @@ -1500,7 +1500,7 @@ domemstat_zone(void) } xo_open_container("memory-zone-statistics"); xo_emit("{T:/%-20s} {T:/%6s} {T:/%6s} {T:/%8s} {T:/%8s} {T:/%8s} {T:/%8s}" - "{T:/%4s} {T:/%4s}\n\n", "ITEM", "SIZE", + "{T:/%4s} {T:/%4s}\n", "ITEM", "SIZE", "LIMIT", "USED", "FREE", "REQ", "FAIL", "SLEEP", "XDOMAIN"); xo_open_list("zone"); for (mtp = memstat_mtl_first(mtlp); mtp != NULL; @@ -1526,7 +1526,6 @@ domemstat_zone(void) memstat_mtl_free(mtlp); xo_close_list("zone"); xo_close_container("memory-zone-statistics"); - xo_emit("\n"); } static void From owner-svn-src-head@freebsd.org Mon Nov 9 00:08:36 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 810082E2756; Mon, 9 Nov 2020 00:08:36 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTrtr3FX4z3KGF; Mon, 9 Nov 2020 00:08:36 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E06F27CDE; Mon, 9 Nov 2020 00:08:36 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A908aps067154; Mon, 9 Nov 2020 00:08:36 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A908ZwL067151; Mon, 9 Nov 2020 00:08:35 GMT (envelope-from np@FreeBSD.org) Message-Id: <202011090008.0A908ZwL067151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 9 Nov 2020 00:08:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367502 - in head/sys/dev/cxgbe: . common X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys/dev/cxgbe: . common X-SVN-Commit-Revision: 367502 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 09 Nov 2020 00:08:36 -0000 Author: np Date: Mon Nov 9 00:08:35 2020 New Revision: 367502 URL: https://svnweb.freebsd.org/changeset/base/367502 Log: cxgbe(4): Allow the PF driver to set a VF's MAC address. The MAC address can be set with the optional mac-addr property in the VF section of the iovctl.conf(5) used to instantiate the VFs. MFC after: 2 weeks Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/t4_iov.c Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Mon Nov 9 00:05:45 2020 (r367501) +++ head/sys/dev/cxgbe/common/common.h Mon Nov 9 00:08:35 2020 (r367502) @@ -691,6 +691,8 @@ void t4_idma_monitor_init(struct adapter *adapter, void t4_idma_monitor(struct adapter *adapter, struct sge_idma_monitor_state *idma, int hz, int ticks); +int t4_set_vf_mac(struct adapter *adapter, unsigned int pf, unsigned int vf, + unsigned int naddr, u8 *addr); unsigned int t4_get_regs_len(struct adapter *adapter); void t4_get_regs(struct adapter *adap, u8 *buf, size_t buf_size); Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Mon Nov 9 00:05:45 2020 (r367501) +++ head/sys/dev/cxgbe/common/t4_hw.c Mon Nov 9 00:08:35 2020 (r367502) @@ -10202,6 +10202,48 @@ void t4_idma_monitor(struct adapter *adapter, } /** + * t4_set_vf_mac - Set MAC address for the specified VF + * @adapter: The adapter + * @pf: the PF used to instantiate the VFs + * @vf: one of the VFs instantiated by the specified PF + * @naddr: the number of MAC addresses + * @addr: the MAC address(es) to be set to the specified VF + */ +int t4_set_vf_mac(struct adapter *adapter, unsigned int pf, unsigned int vf, + unsigned int naddr, u8 *addr) +{ + struct fw_acl_mac_cmd cmd; + + memset(&cmd, 0, sizeof(cmd)); + cmd.op_to_vfn = cpu_to_be32(V_FW_CMD_OP(FW_ACL_MAC_CMD) | + F_FW_CMD_REQUEST | + F_FW_CMD_WRITE | + V_FW_ACL_MAC_CMD_PFN(pf) | + V_FW_ACL_MAC_CMD_VFN(vf)); + + /* Note: Do not enable the ACL */ + cmd.en_to_len16 = cpu_to_be32((unsigned int)FW_LEN16(cmd)); + cmd.nmac = naddr; + + switch (pf) { + case 3: + memcpy(cmd.macaddr3, addr, sizeof(cmd.macaddr3)); + break; + case 2: + memcpy(cmd.macaddr2, addr, sizeof(cmd.macaddr2)); + break; + case 1: + memcpy(cmd.macaddr1, addr, sizeof(cmd.macaddr1)); + break; + case 0: + memcpy(cmd.macaddr0, addr, sizeof(cmd.macaddr0)); + break; + } + + return t4_wr_mbox(adapter, adapter->mbox, &cmd, sizeof(cmd), &cmd); +} + +/** * t4_read_pace_tbl - read the pace table * @adap: the adapter * @pace_vals: holds the returned values Modified: head/sys/dev/cxgbe/t4_iov.c ============================================================================== --- head/sys/dev/cxgbe/t4_iov.c Mon Nov 9 00:05:45 2020 (r367501) +++ head/sys/dev/cxgbe/t4_iov.c Mon Nov 9 00:08:35 2020 (r367502) @@ -42,12 +42,19 @@ __FBSDID("$FreeBSD$"); #endif #include "common/common.h" +#include "common/t4_regs.h" #include "t4_if.h" struct t4iov_softc { device_t sc_dev; device_t sc_main; bool sc_attached; + + int pf; + int regs_rid; + struct resource *regs_res; + bus_space_handle_t bh; + bus_space_tag_t bt; }; struct { @@ -113,6 +120,13 @@ struct { {0x6087, "Chelsio T6225-CR 87"}, }; +static inline uint32_t +t4iov_read_reg(struct t4iov_softc *sc, uint32_t reg) +{ + + return bus_space_read_4(sc->bt, sc->bh, reg); +} + static int t4iov_attach_child(device_t dev); static int @@ -179,10 +193,28 @@ static int t4iov_attach(device_t dev) { struct t4iov_softc *sc; + uint32_t pl_rev, whoami; sc = device_get_softc(dev); sc->sc_dev = dev; + sc->regs_rid = PCIR_BAR(0); + sc->regs_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->regs_rid, RF_ACTIVE); + if (sc->regs_res == NULL) { + device_printf(dev, "cannot map registers.\n"); + return (ENXIO); + } + sc->bt = rman_get_bustag(sc->regs_res); + sc->bh = rman_get_bushandle(sc->regs_res); + + pl_rev = t4iov_read_reg(sc, A_PL_REV); + whoami = t4iov_read_reg(sc, A_PL_WHOAMI); + if (G_CHIPID(pl_rev) <= CHELSIO_T5) + sc->pf = G_SOURCEPF(whoami); + else + sc->pf = G_T6_SOURCEPF(whoami); + sc->sc_main = pci_find_dbsf(pci_get_domain(dev), pci_get_bus(dev), pci_get_slot(dev), 4); if (sc->sc_main == NULL) @@ -218,6 +250,7 @@ t4iov_attach_child(device_t dev) #ifdef PCI_IOV pf_schema = pci_iov_schema_alloc_node(); vf_schema = pci_iov_schema_alloc_node(); + pci_iov_schema_add_unicast_mac(vf_schema, "mac-addr", 0, NULL); error = pci_iov_attach_name(dev, pf_schema, vf_schema, "%s", device_get_nameunit(pdev)); if (error) { @@ -266,6 +299,10 @@ t4iov_detach(device_t dev) if (error) return (error); } + if (sc->regs_res) { + bus_release_resource(dev, SYS_RES_MEMORY, sc->regs_rid, + sc->regs_res); + } return (0); } @@ -286,6 +323,34 @@ t4iov_iov_uninit(device_t dev) static int t4iov_add_vf(device_t dev, uint16_t vfnum, const struct nvlist *config) { + const void *mac; + struct t4iov_softc *sc; + struct adapter *adap; + uint8_t ma[ETHER_ADDR_LEN]; + size_t size; + int rc; + + if (nvlist_exists_binary(config, "mac-addr")) { + mac = nvlist_get_binary(config, "mac-addr", &size); + bcopy(mac, ma, ETHER_ADDR_LEN); + + sc = device_get_softc(dev); + MPASS(sc->sc_attached); + MPASS(sc->sc_main != NULL); + adap = device_get_softc(sc->sc_main); + if (begin_synchronized_op(adap, NULL, SLEEP_OK | INTR_OK, + "t4vfma") != 0) + return (ENXIO); + rc = -t4_set_vf_mac(adap, sc->pf, vfnum + 1, 1, ma); + end_synchronized_op(adap, 0); + if (rc != 0) { + device_printf(dev, + "Failed to set VF%d MAC address to " + "%02x:%02x:%02x:%02x:%02x:%02x, rc = %d\n", vfnum, + ma[0], ma[1], ma[2], ma[3], ma[4], ma[5], rc); + return (rc); + } + } return (0); } From owner-svn-src-head@freebsd.org Mon Nov 9 00:34:24 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 31A332E3113; Mon, 9 Nov 2020 00:34:24 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTsSc0nCqz3Ljd; Mon, 9 Nov 2020 00:34:24 +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 0D8749B2; Mon, 9 Nov 2020 00:34:24 +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 0A90YNN2085268; Mon, 9 Nov 2020 00:34:23 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A90YNbE085267; Mon, 9 Nov 2020 00:34:23 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011090034.0A90YNbE085267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 9 Nov 2020 00:34:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367503 - in head/sys: kern vm X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern vm X-SVN-Commit-Revision: 367503 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 09 Nov 2020 00:34:24 -0000 Author: mjg Date: Mon Nov 9 00:34:23 2020 New Revision: 367503 URL: https://svnweb.freebsd.org/changeset/base/367503 Log: Add more per-cpu zones. This covers powers of 2 up to 64. Example pending user is ZFS. Modified: head/sys/kern/subr_pcpu.c head/sys/vm/uma.h Modified: head/sys/kern/subr_pcpu.c ============================================================================== --- head/sys/kern/subr_pcpu.c Mon Nov 9 00:08:35 2020 (r367502) +++ head/sys/kern/subr_pcpu.c Mon Nov 9 00:34:23 2020 (r367503) @@ -133,17 +133,25 @@ SYSINIT(dpcpu, SI_SUB_KLD, SI_ORDER_FIRST, dpcpu_start /* * UMA_ZONE_PCPU zones for general kernel use. */ - uma_zone_t pcpu_zone_4; uma_zone_t pcpu_zone_8; +uma_zone_t pcpu_zone_16; +uma_zone_t pcpu_zone_32; +uma_zone_t pcpu_zone_64; static void pcpu_zones_startup(void) { - pcpu_zone_4 = uma_zcreate("pcpu-4", sizeof(uint32_t), + pcpu_zone_4 = uma_zcreate("pcpu-4", 4, NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_PCPU); - pcpu_zone_8 = uma_zcreate("pcpu-8", sizeof(uint64_t), + pcpu_zone_8 = uma_zcreate("pcpu-8", 8, + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_PCPU); + pcpu_zone_16 = uma_zcreate("pcpu-16", 16, + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_PCPU); + pcpu_zone_32 = uma_zcreate("pcpu-32", 32, + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_PCPU); + pcpu_zone_64 = uma_zcreate("pcpu-64", 64, NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_PCPU); } SYSINIT(pcpu_zones, SI_SUB_COUNTER, SI_ORDER_FIRST, pcpu_zones_startup, NULL); Modified: head/sys/vm/uma.h ============================================================================== --- head/sys/vm/uma.h Mon Nov 9 00:08:35 2020 (r367502) +++ head/sys/vm/uma.h Mon Nov 9 00:34:23 2020 (r367503) @@ -668,6 +668,9 @@ size_t uma_zone_memory(uma_zone_t zone); */ extern uma_zone_t pcpu_zone_4; extern uma_zone_t pcpu_zone_8; +extern uma_zone_t pcpu_zone_16; +extern uma_zone_t pcpu_zone_32; +extern uma_zone_t pcpu_zone_64; /* * Exported statistics structures to be used by user space monitoring tools. From owner-svn-src-head@freebsd.org Mon Nov 9 03:02:34 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CB47B2E5CA7; Mon, 9 Nov 2020 03:02:34 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTwlZ4qDQz3jMS; Mon, 9 Nov 2020 03:02:34 +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 98CD623E0; Mon, 9 Nov 2020 03:02:34 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A932YDP077853; Mon, 9 Nov 2020 03:02:34 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A932YdA077852; Mon, 9 Nov 2020 03:02:34 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202011090302.0A932YdA077852@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 9 Nov 2020 03:02:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367514 - head/sys/dev/bxe X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/bxe X-SVN-Commit-Revision: 367514 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 09 Nov 2020 03:02:34 -0000 Author: imp Date: Mon Nov 9 03:02:34 2020 New Revision: 367514 URL: https://svnweb.freebsd.org/changeset/base/367514 Log: Remove newline from bxe description, it's not done elsewhere. Modified: head/sys/dev/bxe/bxe.c Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Mon Nov 9 01:57:07 2020 (r367513) +++ head/sys/dev/bxe/bxe.c Mon Nov 9 03:02:34 2020 (r367514) @@ -2520,7 +2520,7 @@ bxe_probe(device_t dev) /* Print out the device identity. */ snprintf(descbuf, BXE_DEVDESC_MAX, - "%s (%c%d) BXE v:%s\n", t->bxe_name, + "%s (%c%d) BXE v:%s", t->bxe_name, (((pci_read_config(dev, PCIR_REVID, 4) & 0xf0) >> 4) + 'A'), (pci_read_config(dev, PCIR_REVID, 4) & 0xf), From owner-svn-src-head@freebsd.org Mon Nov 9 08:53:16 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 87E722EBFB5; Mon, 9 Nov 2020 08:53:16 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CV4XD3FrYz4VXK; Mon, 9 Nov 2020 08:53:16 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 62A8668C9; Mon, 9 Nov 2020 08:53:16 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A98rGnC086817; Mon, 9 Nov 2020 08:53:16 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A98rF4b086813; Mon, 9 Nov 2020 08:53:15 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202011090853.0A98rF4b086813@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 9 Nov 2020 08:53:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367517 - in head/sys: compat/linux fs/fuse X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head/sys: compat/linux fs/fuse X-SVN-Commit-Revision: 367517 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 09 Nov 2020 08:53:16 -0000 Author: trasz Date: Mon Nov 9 08:53:15 2020 New Revision: 367517 URL: https://svnweb.freebsd.org/changeset/base/367517 Log: Make it possible to mount a fuse filesystem, such as squashfuse, from a Linux binary. Should come handy for AppImages. Reviewed by: asomers MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26959 Modified: head/sys/compat/linux/linux_file.c head/sys/fs/fuse/fuse_device.c head/sys/fs/fuse/fuse_ipc.h head/sys/fs/fuse/fuse_vfsops.c Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Mon Nov 9 05:20:02 2020 (r367516) +++ head/sys/compat/linux/linux_file.c Mon Nov 9 08:53:15 2020 (r367517) @@ -1181,13 +1181,15 @@ linux_pwritev(struct thread *td, struct linux_pwritev_ int linux_mount(struct thread *td, struct linux_mount_args *args) { - char fstypename[MFSNAMELEN]; - char *mntonname, *mntfromname; + struct mntarg *ma = NULL; + char *fstypename, *mntonname, *mntfromname, *data; int error, fsflags; + fstypename = malloc(MNAMELEN, M_TEMP, M_WAITOK); mntonname = malloc(MNAMELEN, M_TEMP, M_WAITOK); mntfromname = malloc(MNAMELEN, M_TEMP, M_WAITOK); - error = copyinstr(args->filesystemtype, fstypename, MFSNAMELEN - 1, + data = NULL; + error = copyinstr(args->filesystemtype, fstypename, MNAMELEN - 1, NULL); if (error != 0) goto out; @@ -1208,6 +1210,31 @@ linux_mount(struct thread *td, struct linux_mount_args strcpy(fstypename, "linprocfs"); } else if (strcmp(fstypename, "vfat") == 0) { strcpy(fstypename, "msdosfs"); + } else if (strcmp(fstypename, "fuse") == 0) { + char *fuse_options, *fuse_option, *fuse_name; + + if (strcmp(mntfromname, "fuse") == 0) + strcpy(mntfromname, "/dev/fuse"); + + strcpy(fstypename, "fusefs"); + data = malloc(MNAMELEN, M_TEMP, M_WAITOK); + error = copyinstr(args->data, data, MNAMELEN - 1, NULL); + if (error != 0) + goto out; + + fuse_options = data; + while ((fuse_option = strsep(&fuse_options, ",")) != NULL) { + fuse_name = strsep(&fuse_option, "="); + if (fuse_name == NULL || fuse_option == NULL) + goto out; + ma = mount_arg(ma, fuse_name, fuse_option, -1); + } + + /* + * The FUSE server uses Linux errno values instead of FreeBSD + * ones; add a flag to tell fuse(4) to do errno translation. + */ + ma = mount_arg(ma, "linux_errnos", "1", -1); } fsflags = 0; @@ -1225,14 +1252,15 @@ linux_mount(struct thread *td, struct linux_mount_args if (args->rwflag & LINUX_MS_REMOUNT) fsflags |= MNT_UPDATE; - error = kernel_vmount(fsflags, - "fstype", fstypename, - "fspath", mntonname, - "from", mntfromname, - NULL); + ma = mount_arg(ma, "fstype", fstypename, -1); + ma = mount_arg(ma, "fspath", mntonname, -1); + ma = mount_arg(ma, "from", mntfromname, -1); + error = kernel_mount(ma, fsflags); out: + free(fstypename, M_TEMP); free(mntonname, M_TEMP); free(mntfromname, M_TEMP); + free(data, M_TEMP); return (error); } Modified: head/sys/fs/fuse/fuse_device.c ============================================================================== --- head/sys/fs/fuse/fuse_device.c Mon Nov 9 05:20:02 2020 (r367516) +++ head/sys/fs/fuse/fuse_device.c Mon Nov 9 08:53:15 2020 (r367517) @@ -89,6 +89,9 @@ __FBSDID("$FreeBSD$"); #include "fuse_internal.h" #include "fuse_ipc.h" +#include +#include + SDT_PROVIDER_DECLARE(fusefs); /* * Fuse trace probe: @@ -450,6 +453,15 @@ fuse_device_write(struct cdev *dev, struct uio *uio, i } if ((err = uiomove(&ohead, sizeof(struct fuse_out_header), uio)) != 0) return (err); + + if (data->linux_errnos != 0 && ohead.error != 0) { + err = -ohead.error; + if (err < 0 || err >= nitems(linux_to_bsd_errtbl)) + return (EINVAL); + + /* '-', because it will get flipped again below */ + ohead.error = -linux_to_bsd_errtbl[err]; + } /* * We check header information (which is redundant) and compare it Modified: head/sys/fs/fuse/fuse_ipc.h ============================================================================== --- head/sys/fs/fuse/fuse_ipc.h Mon Nov 9 05:20:02 2020 (r367516) +++ head/sys/fs/fuse/fuse_ipc.h Mon Nov 9 08:53:15 2020 (r367517) @@ -217,6 +217,7 @@ struct fuse_data { struct selinfo ks_rsel; int daemon_timeout; + int linux_errnos; unsigned time_gran; uint64_t notimpl; uint64_t mnt_flag; Modified: head/sys/fs/fuse/fuse_vfsops.c ============================================================================== --- head/sys/fs/fuse/fuse_vfsops.c Mon Nov 9 05:20:02 2020 (r367516) +++ head/sys/fs/fuse/fuse_vfsops.c Mon Nov 9 08:53:15 2020 (r367517) @@ -300,6 +300,7 @@ fuse_vfsop_mount(struct mount *mp) uint64_t mntopts, __mntopts; uint32_t max_read; + int linux_errnos; int daemon_timeout; int fd; @@ -312,6 +313,7 @@ fuse_vfsop_mount(struct mount *mp) subtype = NULL; max_read = ~0; + linux_errnos = 0; err = 0; mntopts = 0; __mntopts = 0; @@ -337,6 +339,7 @@ fuse_vfsop_mount(struct mount *mp) FUSE_FLAGOPT(intr, FSESS_INTR); (void)vfs_scanopt(opts, "max_read=", "%u", &max_read); + (void)vfs_scanopt(opts, "linux_errnos", "%d", &linux_errnos); if (vfs_scanopt(opts, "timeout=", "%u", &daemon_timeout) == 1) { if (daemon_timeout < FUSE_MIN_DAEMON_TIMEOUT) daemon_timeout = FUSE_MIN_DAEMON_TIMEOUT; @@ -411,6 +414,7 @@ fuse_vfsop_mount(struct mount *mp) data->dataflags |= mntopts; data->max_read = max_read; data->daemon_timeout = daemon_timeout; + data->linux_errnos = linux_errnos; data->mnt_flag = mp->mnt_flag & MNT_UPDATEMASK; FUSE_UNLOCK(); From owner-svn-src-head@freebsd.org Mon Nov 9 13:12:07 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DE4E94632C5; Mon, 9 Nov 2020 13:12:07 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVBGv60tZz4nc4; Mon, 9 Nov 2020 13:12:07 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C129611D41; Mon, 9 Nov 2020 13:12:07 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A9DC7dZ049691; Mon, 9 Nov 2020 13:12:07 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A9DC7vT049690; Mon, 9 Nov 2020 13:12:07 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202011091312.0A9DC7vT049690@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 9 Nov 2020 13:12:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367520 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 367520 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 09 Nov 2020 13:12:07 -0000 Author: tuexen Date: Mon Nov 9 13:12:07 2020 New Revision: 367520 URL: https://svnweb.freebsd.org/changeset/base/367520 Log: Fix a potential use-after-free bug introduced in https://svnweb.freebsd.org/changeset/base/363046 Thanks to Taylor Brandstetter for finding this issue using fuzz testing and reporting it in https://github.com/sctplab/usrsctp/issues/547 Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Mon Nov 9 09:31:21 2020 (r367519) +++ head/sys/netinet/sctp_indata.c Mon Nov 9 13:12:07 2020 (r367520) @@ -5494,7 +5494,7 @@ sctp_handle_forward_tsn(struct sctp_tcb *stcb, unsigned int i, fwd_sz, m_size; uint32_t str_seq; struct sctp_stream_in *strm; - struct sctp_queued_to_read *control, *sv; + struct sctp_queued_to_read *control, *ncontrol, *sv; asoc = &stcb->asoc; if ((fwd_sz = ntohs(fwd->ch.chunk_length)) < sizeof(struct sctp_forward_tsn_chunk)) { @@ -5654,14 +5654,14 @@ sctp_handle_forward_tsn(struct sctp_tcb *stcb, } strm = &asoc->strmin[sid]; if (ordered) { - TAILQ_FOREACH(control, &strm->inqueue, next_instrm) { + TAILQ_FOREACH_SAFE(control, &strm->inqueue, next_instrm, ncontrol) { if (SCTP_MID_GE(asoc->idata_supported, mid, control->mid)) { sctp_flush_reassm_for_str_seq(stcb, asoc, strm, control, ordered, new_cum_tsn); } } } else { if (asoc->idata_supported) { - TAILQ_FOREACH(control, &strm->uno_inqueue, next_instrm) { + TAILQ_FOREACH_SAFE(control, &strm->uno_inqueue, next_instrm, ncontrol) { if (SCTP_MID_GE(asoc->idata_supported, mid, control->mid)) { sctp_flush_reassm_for_str_seq(stcb, asoc, strm, control, ordered, new_cum_tsn); } From owner-svn-src-head@freebsd.org Mon Nov 9 13:20:16 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 23CAD463715; Mon, 9 Nov 2020 13:20:16 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVBSJ0TLCz4pBw; Mon, 9 Nov 2020 13:20:16 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC92211FA4; Mon, 9 Nov 2020 13:20:15 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A9DKFb5050233; Mon, 9 Nov 2020 13:20:15 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A9DKESu050223; Mon, 9 Nov 2020 13:20:14 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202011091320.0A9DKESu050223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 9 Nov 2020 13:20:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367521 - in head/sys: compat/linuxkpi/common/include/acpi compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf modules/linuxkpi X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: compat/linuxkpi/common/include/acpi compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf modules/linuxkpi X-SVN-Commit-Revision: 367521 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 09 Nov 2020 13:20:16 -0000 Author: manu Date: Mon Nov 9 13:20:14 2020 New Revision: 367521 URL: https://svnweb.freebsd.org/changeset/base/367521 Log: LinuxKPI: Implement ACPI bits required by drm-kmod in base system It includes: ACPI_HANDLE() implementation. AC and VIDEO ACPI events notification support. Replacement of hand-rolled GPLed _DSM method evaluation helpers with in-base ones. Submitted by: wulf Differential Revision: https://reviews.freebsd.org/D26603 Added: head/sys/compat/linuxkpi/common/include/acpi/ head/sys/compat/linuxkpi/common/include/acpi/acpi.h (contents, props changed) head/sys/compat/linuxkpi/common/include/acpi/acpi_bus.h (contents, props changed) head/sys/compat/linuxkpi/common/include/acpi/video.h (contents, props changed) head/sys/compat/linuxkpi/common/include/linux/acpi.h (contents, props changed) head/sys/compat/linuxkpi/common/src/linux_acpi.c (contents, props changed) Modified: head/sys/conf/files head/sys/modules/linuxkpi/Makefile Added: head/sys/compat/linuxkpi/common/include/acpi/acpi.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/acpi/acpi.h Mon Nov 9 13:20:14 2020 (r367521) @@ -0,0 +1,100 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2017 Mark Johnston + * Copyright (c) 2020 Vladimir Kondratyev + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _ACPI_ACPI_H_ +#define _ACPI_ACPI_H_ + +/* + * FreeBSD import of ACPICA has a typedef for BOOLEAN which conflicts with + * amdgpu driver. Workaround it on preprocessor level. + */ +#define ACPI_USE_SYSTEM_INTTYPES +#define BOOLEAN unsigned char +typedef unsigned char UINT8; +typedef unsigned short UINT16; +typedef short INT16; +typedef unsigned int UINT32; +typedef int INT32; +typedef uint64_t UINT64; +typedef int64_t INT64; +#include +#undef BOOLEAN + +typedef ACPI_HANDLE acpi_handle; +typedef ACPI_OBJECT acpi_object; +typedef ACPI_OBJECT_HANDLER acpi_object_handler; +typedef ACPI_OBJECT_TYPE acpi_object_type; +typedef ACPI_STATUS acpi_status; +typedef ACPI_STRING acpi_string; +typedef ACPI_SIZE acpi_size; +typedef ACPI_WALK_CALLBACK acpi_walk_callback; + +static inline ACPI_STATUS +acpi_evaluate_object(ACPI_HANDLE Object, ACPI_STRING Pathname, + ACPI_OBJECT_LIST *ParameterObjects, ACPI_BUFFER *ReturnObjectBuffer) +{ + return (AcpiEvaluateObject( + Object, Pathname, ParameterObjects, ReturnObjectBuffer)); +} + +static inline const char * +acpi_format_exception(ACPI_STATUS Exception) +{ + return (AcpiFormatException(Exception)); +} + +static inline ACPI_STATUS +acpi_get_handle(ACPI_HANDLE Parent, ACPI_STRING Pathname, + ACPI_HANDLE *RetHandle) +{ + return (AcpiGetHandle(Parent, Pathname, RetHandle)); +} + +static inline ACPI_STATUS +acpi_get_data(ACPI_HANDLE ObjHandle, ACPI_OBJECT_HANDLER Handler, void **Data) +{ + return (AcpiGetData(ObjHandle, Handler, Data)); +} + +static inline ACPI_STATUS +acpi_get_name(ACPI_HANDLE Object, UINT32 NameType, ACPI_BUFFER *RetPathPtr) +{ + return (AcpiGetName(Object, NameType, RetPathPtr)); +} + +static inline ACPI_STATUS +acpi_get_table(ACPI_STRING Signature, UINT32 Instance, + ACPI_TABLE_HEADER **OutTable) +{ + return (AcpiGetTable(Signature, Instance, OutTable)); +} + +#endif /* _ACPI_ACPI_H_ */ Added: head/sys/compat/linuxkpi/common/include/acpi/acpi_bus.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/acpi/acpi_bus.h Mon Nov 9 13:20:14 2020 (r367521) @@ -0,0 +1,52 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Vladimir Kondratyev + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _ACPI_ACPI_BUS_H_ +#define _ACPI_ACPI_BUS_H_ + +typedef char acpi_device_class[20]; + +struct acpi_bus_event { + acpi_device_class device_class; + uint32_t type; + uint32_t data; +}; + +ACPI_HANDLE bsd_acpi_get_handle(device_t bsddev); +bool acpi_check_dsm(ACPI_HANDLE handle, const char *uuid, int rev, + uint64_t funcs); +ACPI_OBJECT * acpi_evaluate_dsm_typed(ACPI_HANDLE handle, const char *uuid, + int rev, int func, ACPI_OBJECT *argv4, + ACPI_OBJECT_TYPE type); +int register_acpi_notifier(struct notifier_block *nb); +int unregister_acpi_notifier(struct notifier_block *nb); +uint32_t acpi_target_system_state(void); + +#endif /* !_ACPI_ACPI_BUS_H_ */ Added: head/sys/compat/linuxkpi/common/include/acpi/video.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/acpi/video.h Mon Nov 9 13:20:14 2020 (r367521) @@ -0,0 +1,38 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Vladimir Kondratyev + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _ACPI_VIDEO_H_ +#define _ACPI_VIDEO_H_ + +#define ACPI_VIDEO_CLASS "video" + +#define ACPI_VIDEO_NOTIFY_PROBE 0x81 + +#endif /* !_ACPI_VIDEO_H_ */ Added: head/sys/compat/linuxkpi/common/include/linux/acpi.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/linux/acpi.h Mon Nov 9 13:20:14 2020 (r367521) @@ -0,0 +1,42 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Vladimir Kondratyev + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LINUX_ACPI_H_ +#define _LINUX_ACPI_H_ + +#include + +#include +#include + +#define ACPI_HANDLE(dev) \ + ((dev)->bsddev != NULL ? bsd_acpi_get_handle((dev)->bsddev) : NULL) + +#endif /* _LINUX_ACPI_H_ */ Added: head/sys/compat/linuxkpi/common/src/linux_acpi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/src/linux_acpi.c Mon Nov 9 13:20:14 2020 (r367521) @@ -0,0 +1,243 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Johannes Lundberg + * Copyright (c) 2020 Vladimir Kondratyev + * + * 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 "opt_acpi.h" + +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include + +#define ACPI_AC_CLASS "ac_adapter" + +ACPI_MODULE_NAME("linux_acpi") + +enum { + LINUX_ACPI_ACAD, + LINUX_ACPI_VIDEO, + LINUX_ACPI_TAGS /* must be last */ +}; +_Static_assert(LINUX_ACPI_TAGS <= LINUX_NOTIFY_TAGS, + "Not enough space for tags in notifier_block structure"); + +#ifdef DEV_ACPI + +static uint32_t linux_acpi_target_sleep_state = ACPI_STATE_S0; + +static eventhandler_tag resume_tag; +static eventhandler_tag suspend_tag; + +ACPI_HANDLE +bsd_acpi_get_handle(device_t bsddev) +{ + return (acpi_get_handle(bsddev)); +} + +bool +acpi_check_dsm(ACPI_HANDLE handle, const char *uuid, int rev, uint64_t funcs) +{ + + if (funcs == 0) + return (false); + + /* + * From ACPI 6.3 spec 9.1.1: + * Bit 0 indicates whether there is support for any functions other + * than function 0 for the specified UUID and Revision ID. If set to + * zero, no functions are supported (other than function zero) for the + * specified UUID and Revision ID. + */ + funcs |= 1 << 0; + + return ((acpi_DSMQuery(handle, uuid, rev) & funcs) == funcs); +} + +ACPI_OBJECT * +acpi_evaluate_dsm_typed(ACPI_HANDLE handle, const char *uuid, int rev, + int func, ACPI_OBJECT *argv4, ACPI_OBJECT_TYPE type) +{ + ACPI_BUFFER buf; + + return (ACPI_SUCCESS(acpi_EvaluateDSMTyped(handle, uuid, rev, func, + argv4, &buf, type)) ? (ACPI_OBJECT *)buf.Pointer : NULL); +} + +static void +linux_handle_power_suspend_event(void *arg __unused) +{ + /* + * Only support S3 for now. + * acpi_sleep_event isn't always called so we use power_suspend_early + * instead which means we don't know what state we're switching to. + * TODO: Make acpi_sleep_event consistent + */ + linux_acpi_target_sleep_state = ACPI_STATE_S3; +} + +static void +linux_handle_power_resume_event(void *arg __unused) +{ + linux_acpi_target_sleep_state = ACPI_STATE_S0; +} + +static void +linux_handle_acpi_acad_event(void *arg, int data) +{ + struct notifier_block *nb = arg; + /* + * Event type information is lost ATM in FreeBSD ACPI event handler. + * Fortunately, drm-kmod do not distinct AC event types too, so we can + * use any type e.g. ACPI_NOTIFY_BUS_CHECK that suits notifier handler. + */ + struct acpi_bus_event abe = { + .device_class = ACPI_AC_CLASS, + .type = ACPI_NOTIFY_BUS_CHECK, + .data = data, + }; + + nb->notifier_call(nb, 0, &abe); +} + +static void +linux_handle_acpi_video_event(void *arg, int type) +{ + struct notifier_block *nb = arg; + struct acpi_bus_event abe = { + .device_class = ACPI_VIDEO_CLASS, + .type = type, + .data = 0, + }; + + nb->notifier_call(nb, 0, &abe); +} + +int +register_acpi_notifier(struct notifier_block *nb) +{ + nb->tags[LINUX_ACPI_ACAD] = EVENTHANDLER_REGISTER(acpi_acad_event, + linux_handle_acpi_acad_event, nb, EVENTHANDLER_PRI_FIRST); + nb->tags[LINUX_ACPI_VIDEO] = EVENTHANDLER_REGISTER(acpi_video_event, + linux_handle_acpi_video_event, nb, EVENTHANDLER_PRI_FIRST); + + return (0); +} + +int +unregister_acpi_notifier(struct notifier_block *nb) +{ + EVENTHANDLER_DEREGISTER(acpi_acad_event, nb->tags[LINUX_ACPI_ACAD]); + EVENTHANDLER_DEREGISTER(acpi_video_event, nb->tags[LINUX_ACPI_VIDEO]); + + return (0); +} + +uint32_t +acpi_target_system_state(void) +{ + return (linux_acpi_target_sleep_state); +} + +static void +linux_register_acpi_event_handlers(void *arg __unused) +{ + /* + * XXX johalun: acpi_{sleep,wakeup}_event can't be trusted, use + * power_{suspend_early,resume} 'acpiconf -s 3' or 'zzz' will not + * generate acpi_sleep_event... Lid open or wake on button generates + * acpi_wakeup_event on one of my Dell laptops but not the other + * (but it does power on)... is this a general thing? + */ + resume_tag = EVENTHANDLER_REGISTER(power_resume, + linux_handle_power_resume_event, NULL, EVENTHANDLER_PRI_FIRST); + suspend_tag = EVENTHANDLER_REGISTER(power_suspend_early, + linux_handle_power_suspend_event, NULL, EVENTHANDLER_PRI_FIRST); +} + +static void +linux_deregister_acpi_event_handlers(void *arg __unused) +{ + EVENTHANDLER_DEREGISTER(power_resume, resume_tag); + EVENTHANDLER_DEREGISTER(power_suspend_early, suspend_tag); +} + +SYSINIT(linux_acpi_events, SI_SUB_DRIVERS, SI_ORDER_ANY, + linux_register_acpi_event_handlers, NULL); +SYSUNINIT(linux_acpi_events, SI_SUB_DRIVERS, SI_ORDER_ANY, + linux_deregister_acpi_event_handlers, NULL); + +#else /* !DEV_ACPI */ + +ACPI_HANDLE +bsd_acpi_get_handle(device_t bsddev) +{ + return (NULL); +} + +bool +acpi_check_dsm(ACPI_HANDLE handle, const char *uuid, int rev, uint64_t funcs) +{ + return (false); +} + +ACPI_OBJECT * +acpi_evaluate_dsm_typed(ACPI_HANDLE handle, const char *uuid, int rev, + int func, ACPI_OBJECT *argv4, ACPI_OBJECT_TYPE type) +{ + return (NULL); +} + +int +register_acpi_notifier(struct notifier_block *nb) +{ + return (0); +} + +int +unregister_acpi_notifier(struct notifier_block *nb) +{ + return (0); +} + +uint32_t +acpi_target_system_state(void) +{ + return (ACPI_STATE_S0); +} + +#endif /* !DEV_ACPI */ Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Nov 9 13:12:07 2020 (r367520) +++ head/sys/conf/files Mon Nov 9 13:20:14 2020 (r367521) @@ -4528,6 +4528,8 @@ nlm/sm_inter_xdr.c optional nfslockd | nfsd # Linux Kernel Programming Interface compat/linuxkpi/common/src/linux_kmod.c optional compat_linuxkpi \ compile-with "${LINUXKPI_C}" +compat/linuxkpi/common/src/linux_acpi.c optional compat_linuxkpi acpi \ + compile-with "${LINUXKPI_C}" compat/linuxkpi/common/src/linux_compat.c optional compat_linuxkpi \ compile-with "${LINUXKPI_C}" compat/linuxkpi/common/src/linux_current.c optional compat_linuxkpi \ Modified: head/sys/modules/linuxkpi/Makefile ============================================================================== --- head/sys/modules/linuxkpi/Makefile Mon Nov 9 13:12:07 2020 (r367520) +++ head/sys/modules/linuxkpi/Makefile Mon Nov 9 13:20:14 2020 (r367521) @@ -23,6 +23,11 @@ SRCS= linux_compat.c \ linux_work.c \ linux_xarray.c +.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \ + ${MACHINE_CPUARCH} == "i386" +SRCS+= opt_acpi.h linux_acpi.c +.endif + SRCS+= ${LINUXKPI_GENSRCS} CFLAGS+= -I${SRCTOP}/sys/compat/linuxkpi/common/include From owner-svn-src-head@freebsd.org Mon Nov 9 13:20:45 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0F2F146371D; Mon, 9 Nov 2020 13:20:45 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVBSr6s28z4p4w; Mon, 9 Nov 2020 13:20:44 +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 DE64611A41; Mon, 9 Nov 2020 13:20:44 +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 0A9DKiMJ053374; Mon, 9 Nov 2020 13:20:44 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A9DKief053373; Mon, 9 Nov 2020 13:20:44 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202011091320.0A9DKief053373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 9 Nov 2020 13:20:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367522 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 367522 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 09 Nov 2020 13:20:45 -0000 Author: manu Date: Mon Nov 9 13:20:44 2020 New Revision: 367522 URL: https://svnweb.freebsd.org/changeset/base/367522 Log: Bump __FreeBSD_version after linuxkpi changes Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Nov 9 13:20:14 2020 (r367521) +++ head/sys/sys/param.h Mon Nov 9 13:20:44 2020 (r367522) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300127 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300128 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Mon Nov 9 20:16:13 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8197446C25B; Mon, 9 Nov 2020 20:16:13 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVMhF2kvSz3qZx; Mon, 9 Nov 2020 20:16:13 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1604952973; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=06RkWrsS4WMckY+c94xhe3c22piLJ6kOokFGuJ+PWO8=; b=xgExMqEfeTbUgoxNs3QTE10pt1bQ/U7IOt5sMxXgAXicRqoMvzNWTT75QcYr/xY+RGuFBC pR8xkaCHCe5Yd5QVYvp2peX0anM1NbS9Ix4tYvjcN1EAPf/ChHPNi+vFwI3ZHsOhtXGeWg nX3ONQmF2QSdrNQDr1fHcokM1YMTuY021UGHeTDt0Rgp30VKPQYxHz8miGB9xQjoucjhFX dj4WjuGRlXIew0yg+sIiFbadesb0MJSHKFxmDuRYCdCFSM0s66hvVgXfwqoSn2/PsEd4/k 47XQFtm6lYMkyK28As+8gCgzNNbvvzkgtZrDJdETNsm/3pFvRPBCiWnlOjNRzQ== Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 7F17C17805; Mon, 9 Nov 2020 20:16:12 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 84309DB2D; Mon, 9 Nov 2020 20:16:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id UF1f1igzQPiz; Mon, 9 Nov 2020 20:16:08 +0000 (UTC) Subject: Re: svn commit: r367459 - head/usr.sbin/syslogd DKIM-Filter: OpenDKIM Filter v2.10.3 mail.xzibition.com 6FB71DB20 To: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202011071917.0A7JHbUS079060@repo.freebsd.org> From: Bryan Drewery Organization: FreeBSD Message-ID: <4b605497-6dd1-72fe-fb05-b45c61ee6fa8@FreeBSD.org> Date: Mon, 9 Nov 2020 12:16:07 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.4.1 MIME-Version: 1.0 In-Reply-To: <202011071917.0A7JHbUS079060@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="DvEGZHRjSTag0u76mwejgpWCFKL1X8kJx" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1604952973; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=06RkWrsS4WMckY+c94xhe3c22piLJ6kOokFGuJ+PWO8=; b=pPmC1AMFkVaDDyUa3Z1hlKCaSjqBv7Uv8bmR6odidr23uY6wmk2ePJTUa3Vjric9eeLMN0 PGnyaQXB/gvX0q8YR2zpdSqnPle0tg9kfH8XIRaE38w5n3GHZAZYp9E44CpoUrNueHh2DF rGpN3Dqacf0JD+MbYyT1Eiv6Ni1WiGSwlq7SvjA2jbDvgjR/T0EbeReB+pggv4WfIsBD2b B0Ap9UL9KPHTTaZxRpjj2nxhV3WOHmrjoyFqiYflQDkLJJ0IDpaqFbSRrdYHhg3JQA6yaG MRc7pWWL7BLk+daeX7eZuX6VNqWT87VFTa6rM/m7THNPGsxrCRWY+b9LtHpiuQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1604952973; a=rsa-sha256; cv=none; b=AqSOOLabSZaKxfafskKDNKvlYMXj6rfET772LcQa2F856Y3nFkronWFHuHuFDtAk2Tbhd7 3C+hwloSCwnGkci4XuJk5fQ/3mhWVIl9lOr9lTKiQx3j1jV2ec2kBqgkC989pPXyqHQmXv W2DKfj//lJ68+YOQZwc8qrrjBw2m6wtA9/lCXbx7L/3uyZXjXYlYoJwnMXgwb7tbdc+IUl +Z5UJ79uEmnaY/gx8gLwdlFKCktNArIBZRr+pzbifJIULWPePs9geZ5ZsDCzPauEw+EwY8 mYMsZk8ri9FtIJWHQrTjVr0y7BYfcoSI5QL5ueGwllyjeh4nW4sHr8kaqbEVog== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 09 Nov 2020 20:16:13 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --DvEGZHRjSTag0u76mwejgpWCFKL1X8kJx Content-Type: multipart/mixed; boundary="xQRNdJYoXBOGEU9TCnYnmX8FWGVxUTnsh"; protected-headers="v1" From: Bryan Drewery To: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <4b605497-6dd1-72fe-fb05-b45c61ee6fa8@FreeBSD.org> Subject: Re: svn commit: r367459 - head/usr.sbin/syslogd References: <202011071917.0A7JHbUS079060@repo.freebsd.org> In-Reply-To: <202011071917.0A7JHbUS079060@repo.freebsd.org> --xQRNdJYoXBOGEU9TCnYnmX8FWGVxUTnsh Content-Type: multipart/mixed; boundary="------------9CBC57D81FB1CF44779F663A" Content-Language: en-US This is a multi-part message in MIME format. --------------9CBC57D81FB1CF44779F663A Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Thanks. I had the commit in a branch that had a debug commit after. The brace was rebased wrong. On 11/7/2020 11:17 AM, Cy Schubert wrote: > Author: cy > Date: Sat Nov 7 19:17:37 2020 > New Revision: 367459 > URL: https://svnweb.freebsd.org/changeset/base/367459 >=20 > Log: > Fix build post-r367455. > =20 > MFC after: 2 weeks > X-MFC with: r367455 >=20 > Modified: > head/usr.sbin/syslogd/syslogd.c >=20 > Modified: head/usr.sbin/syslogd/syslogd.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.sbin/syslogd/syslogd.c Sat Nov 7 18:15:29 2020 (r367458) > +++ head/usr.sbin/syslogd/syslogd.c Sat Nov 7 19:17:37 2020 (r367459) > @@ -1873,7 +1873,7 @@ fprintlog_write(struct filed *f, struct iovlist *= il, i > continue; > if (sl->sl_sa =3D=3D NULL || > sl->sl_family =3D=3D AF_UNSPEC || > - sl->sl_family =3D=3D AF_LOCAL) { > + sl->sl_family =3D=3D AF_LOCAL) > continue; > lsent =3D sendmsg(sl->sl_socket, &msghdr, 0); > if (lsent =3D=3D (ssize_t)il->totalsize) >=20 --=20 Regards, Bryan Drewery --------------9CBC57D81FB1CF44779F663A-- --xQRNdJYoXBOGEU9TCnYnmX8FWGVxUTnsh-- --DvEGZHRjSTag0u76mwejgpWCFKL1X8kJx Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsB5BAABCAAjFiEE+Rc8ssOq6npcih8JNddxu25Gl88FAl+po4cFAwAAAAAACgkQNddxu25Gl89b 1ggAues8XaQpTjYn+ujNLEomZaJVX7zCzvFzMAfdKE4ogwi0Bdaaj+43FnJm+aEf6YQV/d8+9A4x MhJW1CaIShmm4z7ZwwtREtGgMHZ0qW4uW7/gKhQZq+ARbKvUvY5nCNlUu2taA8h63YlCUkV59OXT RGx6Rw7SKvkbv6mXpDw+WUXbGrPcSAUdNhhfyHGWXegxmGRx5VcjzjxMVb7T7PHgFTqQqkXYeRKS WZORZ0GXq2TSCcq/JcWRyEOjLqFUmzZ26ZHICiGLtlhsqQMfNoajrvwa1w5v21aFYajXaztjI17j X+Q90XVoCWK3tBMrdH9UhIuqMpIqGMCEZm+T5T3fmQ== =GE65 -----END PGP SIGNATURE----- --DvEGZHRjSTag0u76mwejgpWCFKL1X8kJx-- From owner-svn-src-head@freebsd.org Mon Nov 9 21:49:42 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 37C7E46E718; Mon, 9 Nov 2020 21:49:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVPm619QNz3w58; Mon, 9 Nov 2020 21:49:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 16B1617F35; Mon, 9 Nov 2020 21:49:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A9Lnfox069054; Mon, 9 Nov 2020 21:49:41 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A9Lnfmh069050; Mon, 9 Nov 2020 21:49:41 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202011092149.0A9Lnfmh069050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 9 Nov 2020 21:49:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367530 - in head/sys/netinet: . tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in head/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 367530 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 09 Nov 2020 21:49:42 -0000 Author: tuexen Date: Mon Nov 9 21:49:40 2020 New Revision: 367530 URL: https://svnweb.freebsd.org/changeset/base/367530 Log: RFC 7323 specifies that: * TCP segments without timestamps should be dropped when support for the timestamp option has been negotiated. * TCP segments with timestamps should be processed normally if support for the timestamp option has not been negotiated. This patch enforces the above. PR: 250499 Reviewed by: gnn, rrs MFC after: 1 week Sponsored by: Netflix, Inc Differential Revision: https://reviews.freebsd.org/D27148 Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_stacks/bbr.c head/sys/netinet/tcp_stacks/rack.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_timewait.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Mon Nov 9 21:19:17 2020 (r367529) +++ head/sys/netinet/tcp_input.c Mon Nov 9 21:49:40 2020 (r367530) @@ -977,8 +977,8 @@ findpcb: * XXXRW: It may be time to rethink timewait locking. */ if (inp->inp_flags & INP_TIMEWAIT) { - if (thflags & TH_SYN) - tcp_dooptions(&to, optp, optlen, TO_SYN); + tcp_dooptions(&to, optp, optlen, + (thflags & TH_SYN) ? TO_SYN : 0); /* * NB: tcp_twcheck unlocks the INP and frees the mbuf. */ @@ -1680,20 +1680,29 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru } /* - * If timestamps were negotiated during SYN/ACK they should - * appear on every segment during this session and vice versa. + * If timestamps were negotiated during SYN/ACK and a + * segment without a timestamp is received, silently drop + * the segment. + * See section 3.2 of RFC 7323. */ if ((tp->t_flags & TF_RCVD_TSTMP) && !(to.to_flags & TOF_TS)) { if ((s = tcp_log_addrs(inc, th, NULL, NULL))) { log(LOG_DEBUG, "%s; %s: Timestamp missing, " - "no action\n", s, __func__); + "segment silently dropped\n", s, __func__); free(s, M_TCPLOG); } + goto drop; } + /* + * If timestamps were not negotiated during SYN/ACK and a + * segment without a timestamp is received, ignore the + * timestamp and process the packet normally. + * See section 3.2 of RFC 7323. + */ if (!(tp->t_flags & TF_RCVD_TSTMP) && (to.to_flags & TOF_TS)) { if ((s = tcp_log_addrs(inc, th, NULL, NULL))) { log(LOG_DEBUG, "%s; %s: Timestamp not expected, " - "no action\n", s, __func__); + "segment processed normally\n", s, __func__); free(s, M_TCPLOG); } } Modified: head/sys/netinet/tcp_stacks/bbr.c ============================================================================== --- head/sys/netinet/tcp_stacks/bbr.c Mon Nov 9 21:19:17 2020 (r367529) +++ head/sys/netinet/tcp_stacks/bbr.c Mon Nov 9 21:49:40 2020 (r367530) @@ -11430,12 +11430,6 @@ bbr_do_segment_nounlock(struct mbuf *m, struct tcphdr #ifdef STATS stats_voi_update_abs_ulong(tp->t_stats, VOI_TCP_FRWIN, tiwin); #endif - /* - * Parse options on any incoming segment. - */ - tcp_dooptions(&to, (u_char *)(th + 1), - (th->th_off << 2) - sizeof(struct tcphdr), - (thflags & TH_SYN) ? TO_SYN : 0); if (m->m_flags & M_TSTMP) { /* Prefer the hardware timestamp if present */ @@ -11458,6 +11452,23 @@ bbr_do_segment_nounlock(struct mbuf *m, struct tcphdr * Ok just get the current time. */ bbr->r_ctl.rc_rcvtime = lcts = cts = tcp_get_usecs(&bbr->rc_tv); + } + /* + * Parse options on any incoming segment. + */ + tcp_dooptions(&to, (u_char *)(th + 1), + (th->th_off << 2) - sizeof(struct tcphdr), + (thflags & TH_SYN) ? TO_SYN : 0); + + /* + * If timestamps were negotiated during SYN/ACK and a + * segment without a timestamp is received, silently drop + * the segment. + * See section 3.2 of RFC 7323. + */ + if ((tp->t_flags & TF_RCVD_TSTMP) && !(to.to_flags & TOF_TS)) { + retval = 0; + goto done_with_input; } /* * If echoed timestamp is later than the current time, fall back to Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Mon Nov 9 21:19:17 2020 (r367529) +++ head/sys/netinet/tcp_stacks/rack.c Mon Nov 9 21:49:40 2020 (r367530) @@ -10525,7 +10525,7 @@ rack_handoff_ok(struct tcpcb *tp) if ((tp->t_state == TCPS_SYN_SENT) || (tp->t_state == TCPS_SYN_RECEIVED)) { /* - * We really don't know if you support sack, + * We really don't know if you support sack, * you have to get to ESTAB or beyond to tell. */ return (EAGAIN); @@ -10868,7 +10868,27 @@ rack_do_segment_nounlock(struct mbuf *m, struct tcphdr ctf_do_dropwithreset(m, tp, th, BANDLIM_RST_OPENPORT, tlen); return(1); } + /* + * Parse options on any incoming segment. + */ + tcp_dooptions(&to, (u_char *)(th + 1), + (th->th_off << 2) - sizeof(struct tcphdr), + (thflags & TH_SYN) ? TO_SYN : 0); + + /* + * If timestamps were negotiated during SYN/ACK and a + * segment without a timestamp is received, silently drop + * the segment. + * See section 3.2 of RFC 7323. + */ + if ((tp->t_flags & TF_RCVD_TSTMP) && !(to.to_flags & TOF_TS)) { + way_out = 5; + retval = 0; + goto done_with_input; + } + + /* * Segment received on connection. Reset idle time and keep-alive * timer. XXX: This should be done after segment validation to * ignore broken/spoofed segs. @@ -10920,12 +10940,6 @@ rack_do_segment_nounlock(struct mbuf *m, struct tcphdr rack_cong_signal(tp, th, CC_ECN); } } - /* - * Parse options on any incoming segment. - */ - tcp_dooptions(&to, (u_char *)(th + 1), - (th->th_off << 2) - sizeof(struct tcphdr), - (thflags & TH_SYN) ? TO_SYN : 0); /* * If echoed timestamp is later than the current time, fall back to Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Mon Nov 9 21:19:17 2020 (r367529) +++ head/sys/netinet/tcp_syncache.c Mon Nov 9 21:49:40 2020 (r367530) @@ -1212,6 +1212,40 @@ syncache_expand(struct in_conninfo *inc, struct tcpopt } /* + * If timestamps were not negotiated during SYN/ACK and a + * segment without a timestamp is received, ignore the + * timestamp and process the packet normally. + * See section 3.2 of RFC 7323. + */ + if (!(sc->sc_flags & SCF_TIMESTAMP) && + (to->to_flags & TOF_TS)) { + if ((s = tcp_log_addrs(inc, th, NULL, NULL))) { + log(LOG_DEBUG, "%s; %s: Timestamp not " + "expected, segment processed normally\n", + s, __func__); + free(s, M_TCPLOG); + s = NULL; + } + } + + /* + * If timestamps were negotiated during SYN/ACK and a + * segment without a timestamp is received, silently drop + * the segment. + * See section 3.2 of RFC 7323. + */ + if ((sc->sc_flags & SCF_TIMESTAMP) && + !(to->to_flags & TOF_TS)) { + SCH_UNLOCK(sch); + if ((s = tcp_log_addrs(inc, th, NULL, NULL))) { + log(LOG_DEBUG, "%s; %s: Timestamp missing, " + "segment silently dropped\n", s, __func__); + free(s, M_TCPLOG); + } + return (-1); /* Do not send RST */ + } + + /* * Pull out the entry to unlock the bucket row. * * NOTE: We must decrease TCPS_SYN_RECEIVED count here, not @@ -1254,32 +1288,6 @@ syncache_expand(struct in_conninfo *inc, struct tcpopt log(LOG_DEBUG, "%s; %s: SEQ %u != IRS+1 %u, segment " "rejected\n", s, __func__, th->th_seq, sc->sc_irs); goto failed; - } - - /* - * If timestamps were not negotiated during SYN/ACK they - * must not appear on any segment during this session. - */ - if (!(sc->sc_flags & SCF_TIMESTAMP) && (to->to_flags & TOF_TS)) { - if ((s = tcp_log_addrs(inc, th, NULL, NULL))) - log(LOG_DEBUG, "%s; %s: Timestamp not expected, " - "segment rejected\n", s, __func__); - goto failed; - } - - /* - * If timestamps were negotiated during SYN/ACK they should - * appear on every segment during this session. - * XXXAO: This is only informal as there have been unverified - * reports of non-compliants stacks. - */ - if ((sc->sc_flags & SCF_TIMESTAMP) && !(to->to_flags & TOF_TS)) { - if ((s = tcp_log_addrs(inc, th, NULL, NULL))) { - log(LOG_DEBUG, "%s; %s: Timestamp missing, " - "no action\n", s, __func__); - free(s, M_TCPLOG); - s = NULL; - } } *lsop = syncache_socket(sc, *lsop, m); Modified: head/sys/netinet/tcp_timewait.c ============================================================================== --- head/sys/netinet/tcp_timewait.c Mon Nov 9 21:19:17 2020 (r367529) +++ head/sys/netinet/tcp_timewait.c Mon Nov 9 21:49:40 2020 (r367530) @@ -376,7 +376,7 @@ tcp_twstart(struct tcpcb *tp) * looking for a pcb in the listen state. Returns 0 otherwise. */ int -tcp_twcheck(struct inpcb *inp, struct tcpopt *to __unused, struct tcphdr *th, +tcp_twcheck(struct inpcb *inp, struct tcpopt *to, struct tcphdr *th, struct mbuf *m, int tlen) { struct tcptw *tw; @@ -410,6 +410,16 @@ tcp_twcheck(struct inpcb *inp, struct tcpopt *to __unu */ if (thflags & TH_RST) goto drop; + + /* + * If timestamps were negotiated during SYN/ACK and a + * segment without a timestamp is received, silently drop + * the segment. + * See section 3.2 of RFC 7323. + */ + if (((to->to_flags & TOF_TS) == 0) && (tw->t_recent != 0)) { + goto drop; + } #if 0 /* PAWS not needed at the moment */ From owner-svn-src-head@freebsd.org Mon Nov 9 22:58:29 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D66F446FA86; Mon, 9 Nov 2020 22:58:29 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVRHT5lrBz4T5l; Mon, 9 Nov 2020 22:58:29 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B386518B52; Mon, 9 Nov 2020 22:58:29 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A9MwTiX010176; Mon, 9 Nov 2020 22:58:29 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A9MwTP4010174; Mon, 9 Nov 2020 22:58:29 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011092258.0A9MwTP4010174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 9 Nov 2020 22:58:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367532 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 367532 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 09 Nov 2020 22:58:29 -0000 Author: mjg Date: Mon Nov 9 22:58:29 2020 New Revision: 367532 URL: https://svnweb.freebsd.org/changeset/base/367532 Log: malloc: retire mt_stats_zone in favor of pcpu_zone_64 Reviewed by: markj, imp Differential Revision: https://reviews.freebsd.org/D27142 Modified: head/sys/kern/kern_malloc.c head/sys/sys/malloc.h Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Mon Nov 9 22:23:25 2020 (r367531) +++ head/sys/kern/kern_malloc.c Mon Nov 9 22:58:29 2020 (r367532) @@ -174,11 +174,6 @@ struct { {0, NULL}, }; -/* - * Zone to allocate per-CPU storage for statistics. - */ -static uma_zone_t mt_stats_zone; - u_long vm_kmem_size; SYSCTL_ULONG(_vm, OID_AUTO, kmem_size, CTLFLAG_RDTUN, &vm_kmem_size, 0, "Size of kernel memory"); @@ -1184,9 +1179,6 @@ mallocinit(void *dummy) if (kmem_zmax < PAGE_SIZE || kmem_zmax > KMEM_ZMAX) kmem_zmax = KMEM_ZMAX; - mt_stats_zone = uma_zcreate("mt_stats_zone", - sizeof(struct malloc_type_stats), NULL, NULL, NULL, NULL, - UMA_ALIGN_PTR, UMA_ZONE_PCPU); for (i = 0, indx = 0; kmemzones[indx].kz_size != 0; indx++) { int size = kmemzones[indx].kz_size; const char *name = kmemzones[indx].kz_name; @@ -1222,7 +1214,7 @@ malloc_init(void *data) mtp->ks_shortdesc, mtp->ks_version); mtip = &mtp->ks_mti; - mtip->mti_stats = uma_zalloc_pcpu(mt_stats_zone, M_WAITOK | M_ZERO); + mtip->mti_stats = uma_zalloc_pcpu(pcpu_zone_64, M_WAITOK | M_ZERO); mtp_set_subzone(mtp); mtx_lock(&malloc_mtx); @@ -1279,7 +1271,7 @@ malloc_uninit(void *data) temp_allocs, temp_bytes); } - uma_zfree_pcpu(mt_stats_zone, mtip->mti_stats); + uma_zfree_pcpu(pcpu_zone_64, mtip->mti_stats); } struct malloc_type * Modified: head/sys/sys/malloc.h ============================================================================== --- head/sys/sys/malloc.h Mon Nov 9 22:23:25 2020 (r367531) +++ head/sys/sys/malloc.h Mon Nov 9 22:58:29 2020 (r367532) @@ -92,6 +92,9 @@ struct malloc_type_stats { uint64_t _mts_reserved3; /* Reserved field. */ }; +_Static_assert(sizeof(struct malloc_type_stats) == 64, + "allocations come from pcpu_zone_64"); + /* * Index definitions for the mti_probes[] array. */ From owner-svn-src-head@freebsd.org Mon Nov 9 22:59:42 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7C3F246F8F1; Mon, 9 Nov 2020 22:59:42 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVRJt39Jmz4TWq; Mon, 9 Nov 2020 22:59:42 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F5C818DDB; Mon, 9 Nov 2020 22:59:42 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A9MxgnS010233; Mon, 9 Nov 2020 22:59:42 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A9Mxg5j010232; Mon, 9 Nov 2020 22:59:42 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011092259.0A9Mxg5j010232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 9 Nov 2020 22:59:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367533 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 367533 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 09 Nov 2020 22:59:42 -0000 Author: mjg Date: Mon Nov 9 22:59:41 2020 New Revision: 367533 URL: https://svnweb.freebsd.org/changeset/base/367533 Log: malloc: provide 384 byte zone Total page count after buildworld on ZFS for 384 (if present) and 512 zones: before: 29713 after: 25946 per-zone page use: vm.uma.malloc_384.keg.domain.1.pages: 11621 vm.uma.malloc_384.keg.domain.0.pages: 11597 vm.uma.malloc_512.keg.domain.1.pages: 1280 vm.uma.malloc_512.keg.domain.0.pages: 1448 Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D27145 Modified: head/sys/kern/kern_malloc.c Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Mon Nov 9 22:58:29 2020 (r367532) +++ head/sys/kern/kern_malloc.c Mon Nov 9 22:59:41 2020 (r367533) @@ -163,6 +163,7 @@ struct { {64, "malloc-64", }, {128, "malloc-128", }, {256, "malloc-256", }, + {384, "malloc-384", }, {512, "malloc-512", }, {1024, "malloc-1024", }, {2048, "malloc-2048", }, From owner-svn-src-head@freebsd.org Mon Nov 9 23:00:30 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8775D46FAC7; Mon, 9 Nov 2020 23:00:30 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVRKp3RfYz4TZy; Mon, 9 Nov 2020 23:00:30 +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 682FA18AF5; Mon, 9 Nov 2020 23:00:30 +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 0A9N0URI010353; Mon, 9 Nov 2020 23:00:30 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A9N0UOg010352; Mon, 9 Nov 2020 23:00:30 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011092300.0A9N0UOg010352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 9 Nov 2020 23:00:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367534 - head/usr.bin/vmstat X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/usr.bin/vmstat X-SVN-Commit-Revision: 367534 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 09 Nov 2020 23:00:30 -0000 Author: mjg Date: Mon Nov 9 23:00:29 2020 New Revision: 367534 URL: https://svnweb.freebsd.org/changeset/base/367534 Log: vmstat: drop the HighUse field from malloc dump It is hardwired to "-" since its introduction in 2005. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D27141 Modified: head/usr.bin/vmstat/vmstat.c Modified: head/usr.bin/vmstat/vmstat.c ============================================================================== --- head/usr.bin/vmstat/vmstat.c Mon Nov 9 22:59:41 2020 (r367533) +++ head/usr.bin/vmstat/vmstat.c Mon Nov 9 23:00:29 2020 (r367534) @@ -1433,8 +1433,8 @@ domemstat_malloc(void) } } xo_open_container("malloc-statistics"); - xo_emit("{T:/%13s} {T:/%5s} {T:/%6s} {T:/%7s} {T:/%8s} {T:Size(s)}\n", - "Type", "InUse", "MemUse", "HighUse", "Requests"); + xo_emit("{T:/%13s} {T:/%5s} {T:/%6s} {T:/%8s} {T:Size(s)}\n", + "Type", "InUse", "MemUse", "Requests"); xo_open_list("memory"); zones = memstat_malloc_zone_get_count(); for (mtp = memstat_mtl_first(mtlp); mtp != NULL; @@ -1444,10 +1444,9 @@ domemstat_malloc(void) continue; xo_open_instance("memory"); xo_emit("{k:type/%13s/%s} {:in-use/%5ju} " - "{:memory-use/%5ju}{U:K} {:high-use/%7s} " - "{:requests/%8ju} ", + "{:memory-use/%5ju}{U:K} {:requests/%8ju} ", memstat_get_name(mtp), (uintmax_t)memstat_get_count(mtp), - ((uintmax_t)memstat_get_bytes(mtp) + 1023) / 1024, "-", + ((uintmax_t)memstat_get_bytes(mtp) + 1023) / 1024, (uintmax_t)memstat_get_numallocs(mtp)); first = 1; xo_open_list("size"); From owner-svn-src-head@freebsd.org Mon Nov 9 23:02:15 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2765146FE4E; Mon, 9 Nov 2020 23:02:15 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVRMq0YtMz4TqS; Mon, 9 Nov 2020 23:02:15 +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 0673C19195; Mon, 9 Nov 2020 23:02:15 +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 0A9N2FDJ015040; Mon, 9 Nov 2020 23:02:15 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A9N2D63015034; Mon, 9 Nov 2020 23:02:13 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011092302.0A9N2D63015034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 9 Nov 2020 23:02:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367535 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 367535 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 09 Nov 2020 23:02:15 -0000 Author: mjg Date: Mon Nov 9 23:02:13 2020 New Revision: 367535 URL: https://svnweb.freebsd.org/changeset/base/367535 Log: vfs: group mount per-cpu vars into one struct While here move frequently read stuff into the same cacheline. This shrinks struct mount by 64 bytes. Tested by: pho Modified: head/sys/kern/vfs_cache.c head/sys/kern/vfs_default.c head/sys/kern/vfs_mount.c head/sys/kern/vfs_subr.c head/sys/kern/vfs_vnops.c head/sys/sys/mount.h Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Mon Nov 9 23:00:29 2020 (r367534) +++ head/sys/kern/vfs_cache.c Mon Nov 9 23:02:13 2020 (r367535) @@ -4249,6 +4249,7 @@ static int __noinline cache_fplookup_climb_mount(struct cache_fpl *fpl) { struct mount *mp, *prev_mp; + struct mount_pcpu *mpcpu, *prev_mpcpu; struct vnode *vp; seqc_t vp_seqc; @@ -4262,38 +4263,39 @@ cache_fplookup_climb_mount(struct cache_fpl *fpl) prev_mp = NULL; for (;;) { - if (!vfs_op_thread_enter_crit(mp)) { + if (!vfs_op_thread_enter_crit(mp, mpcpu)) { if (prev_mp != NULL) - vfs_op_thread_exit_crit(prev_mp); + vfs_op_thread_exit_crit(prev_mp, prev_mpcpu); return (cache_fpl_partial(fpl)); } if (prev_mp != NULL) - vfs_op_thread_exit_crit(prev_mp); + vfs_op_thread_exit_crit(prev_mp, prev_mpcpu); if (!vn_seqc_consistent(vp, vp_seqc)) { - vfs_op_thread_exit_crit(mp); + vfs_op_thread_exit_crit(mp, mpcpu); return (cache_fpl_partial(fpl)); } if (!cache_fplookup_mp_supported(mp)) { - vfs_op_thread_exit_crit(mp); + vfs_op_thread_exit_crit(mp, mpcpu); return (cache_fpl_partial(fpl)); } vp = atomic_load_ptr(&mp->mnt_rootvnode); if (vp == NULL || VN_IS_DOOMED(vp)) { - vfs_op_thread_exit_crit(mp); + vfs_op_thread_exit_crit(mp, mpcpu); return (cache_fpl_partial(fpl)); } vp_seqc = vn_seqc_read_any(vp); if (seqc_in_modify(vp_seqc)) { - vfs_op_thread_exit_crit(mp); + vfs_op_thread_exit_crit(mp, mpcpu); return (cache_fpl_partial(fpl)); } prev_mp = mp; + prev_mpcpu = mpcpu; mp = atomic_load_ptr(&vp->v_mountedhere); if (mp == NULL) break; } - vfs_op_thread_exit_crit(prev_mp); + vfs_op_thread_exit_crit(prev_mp, prev_mpcpu); fpl->tvp = vp; fpl->tvp_seqc = vp_seqc; return (0); Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Mon Nov 9 23:00:29 2020 (r367534) +++ head/sys/kern/vfs_default.c Mon Nov 9 23:02:13 2020 (r367535) @@ -663,6 +663,7 @@ vop_stdgetwritemount(ap) } */ *ap; { struct mount *mp; + struct mount_pcpu *mpcpu; struct vnode *vp; /* @@ -680,12 +681,12 @@ vop_stdgetwritemount(ap) *(ap->a_mpp) = NULL; return (0); } - if (vfs_op_thread_enter(mp)) { + if (vfs_op_thread_enter(mp, mpcpu)) { if (mp == vp->v_mount) { - vfs_mp_count_add_pcpu(mp, ref, 1); - vfs_op_thread_exit(mp); + vfs_mp_count_add_pcpu(mpcpu, ref, 1); + vfs_op_thread_exit(mp, mpcpu); } else { - vfs_op_thread_exit(mp); + vfs_op_thread_exit(mp, mpcpu); mp = NULL; } } else { Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Mon Nov 9 23:00:29 2020 (r367534) +++ head/sys/kern/vfs_mount.c Mon Nov 9 23:02:13 2020 (r367535) @@ -127,14 +127,7 @@ mount_init(void *mem, int size, int flags) mtx_init(&mp->mnt_mtx, "struct mount mtx", NULL, MTX_DEF); mtx_init(&mp->mnt_listmtx, "struct mount vlist mtx", NULL, MTX_DEF); lockinit(&mp->mnt_explock, PVFS, "explock", 0, 0); - mp->mnt_thread_in_ops_pcpu = uma_zalloc_pcpu(pcpu_zone_4, - M_WAITOK | M_ZERO); - mp->mnt_ref_pcpu = uma_zalloc_pcpu(pcpu_zone_4, - M_WAITOK | M_ZERO); - mp->mnt_lockref_pcpu = uma_zalloc_pcpu(pcpu_zone_4, - M_WAITOK | M_ZERO); - mp->mnt_writeopcount_pcpu = uma_zalloc_pcpu(pcpu_zone_4, - M_WAITOK | M_ZERO); + mp->mnt_pcpu = uma_zalloc_pcpu(pcpu_zone_16, M_WAITOK | M_ZERO); mp->mnt_ref = 0; mp->mnt_vfs_ops = 1; mp->mnt_rootvnode = NULL; @@ -147,10 +140,7 @@ mount_fini(void *mem, int size) struct mount *mp; mp = (struct mount *)mem; - uma_zfree_pcpu(pcpu_zone_4, mp->mnt_writeopcount_pcpu); - uma_zfree_pcpu(pcpu_zone_4, mp->mnt_lockref_pcpu); - uma_zfree_pcpu(pcpu_zone_4, mp->mnt_ref_pcpu); - uma_zfree_pcpu(pcpu_zone_4, mp->mnt_thread_in_ops_pcpu); + uma_zfree_pcpu(pcpu_zone_16, mp->mnt_pcpu); lockdestroy(&mp->mnt_explock); mtx_destroy(&mp->mnt_listmtx); mtx_destroy(&mp->mnt_mtx); @@ -462,11 +452,12 @@ sys_nmount(struct thread *td, struct nmount_args *uap) void vfs_ref(struct mount *mp) { + struct mount_pcpu *mpcpu; CTR2(KTR_VFS, "%s: mp %p", __func__, mp); - if (vfs_op_thread_enter(mp)) { - vfs_mp_count_add_pcpu(mp, ref, 1); - vfs_op_thread_exit(mp); + if (vfs_op_thread_enter(mp, mpcpu)) { + vfs_mp_count_add_pcpu(mpcpu, ref, 1); + vfs_op_thread_exit(mp, mpcpu); return; } @@ -478,11 +469,12 @@ vfs_ref(struct mount *mp) void vfs_rel(struct mount *mp) { + struct mount_pcpu *mpcpu; CTR2(KTR_VFS, "%s: mp %p", __func__, mp); - if (vfs_op_thread_enter(mp)) { - vfs_mp_count_sub_pcpu(mp, ref, 1); - vfs_op_thread_exit(mp); + if (vfs_op_thread_enter(mp, mpcpu)) { + vfs_mp_count_sub_pcpu(mpcpu, ref, 1); + vfs_op_thread_exit(mp, mpcpu); return; } @@ -503,6 +495,12 @@ vfs_mount_alloc(struct vnode *vp, struct vfsconf *vfsp mp = uma_zalloc(mount_zone, M_WAITOK); bzero(&mp->mnt_startzero, __rangeof(struct mount, mnt_startzero, mnt_endzero)); + mp->mnt_kern_flag = 0; + mp->mnt_flag = 0; + mp->mnt_rootvnode = NULL; + mp->mnt_vnodecovered = NULL; + mp->mnt_op = NULL; + mp->mnt_vfc = NULL; TAILQ_INIT(&mp->mnt_nvnodelist); mp->mnt_nvnodelistsize = 0; TAILQ_INIT(&mp->mnt_lazyvnodelist); @@ -1513,6 +1511,7 @@ dounmount_cleanup(struct mount *mp, struct vnode *cove void vfs_op_enter(struct mount *mp) { + struct mount_pcpu *mpcpu; int cpu; MNT_ILOCK(mp); @@ -1523,12 +1522,16 @@ vfs_op_enter(struct mount *mp) } vfs_op_barrier_wait(mp); CPU_FOREACH(cpu) { - mp->mnt_ref += - zpcpu_replace_cpu(mp->mnt_ref_pcpu, 0, cpu); - mp->mnt_lockref += - zpcpu_replace_cpu(mp->mnt_lockref_pcpu, 0, cpu); - mp->mnt_writeopcount += - zpcpu_replace_cpu(mp->mnt_writeopcount_pcpu, 0, cpu); + mpcpu = vfs_mount_pcpu_remote(mp, cpu); + + mp->mnt_ref += mpcpu->mntp_ref; + mpcpu->mntp_ref = 0; + + mp->mnt_lockref += mpcpu->mntp_lockref; + mpcpu->mntp_lockref = 0; + + mp->mnt_writeopcount += mpcpu->mntp_writeopcount; + mpcpu->mntp_writeopcount = 0; } if (mp->mnt_ref <= 0 || mp->mnt_lockref < 0 || mp->mnt_writeopcount < 0) panic("%s: invalid count(s) on mp %p: ref %d lockref %d writeopcount %d\n", @@ -1581,13 +1584,13 @@ vfs_op_wait_func(void *arg, int cpu) { struct vfs_op_barrier_ipi *vfsopipi; struct mount *mp; - int *in_op; + struct mount_pcpu *mpcpu; vfsopipi = __containerof(arg, struct vfs_op_barrier_ipi, srcra); mp = vfsopipi->mp; - in_op = zpcpu_get_cpu(mp->mnt_thread_in_ops_pcpu, cpu); - while (atomic_load_int(in_op)) + mpcpu = vfs_mount_pcpu_remote(mp, cpu); + while (atomic_load_int(&mpcpu->mntp_thread_in_ops)) cpu_spinwait(); } @@ -1610,15 +1613,17 @@ vfs_op_barrier_wait(struct mount *mp) void vfs_assert_mount_counters(struct mount *mp) { + struct mount_pcpu *mpcpu; int cpu; if (mp->mnt_vfs_ops == 0) return; CPU_FOREACH(cpu) { - if (*zpcpu_get_cpu(mp->mnt_ref_pcpu, cpu) != 0 || - *zpcpu_get_cpu(mp->mnt_lockref_pcpu, cpu) != 0 || - *zpcpu_get_cpu(mp->mnt_writeopcount_pcpu, cpu) != 0) + mpcpu = vfs_mount_pcpu_remote(mp, cpu); + if (mpcpu->mntp_ref != 0 || + mpcpu->mntp_lockref != 0 || + mpcpu->mntp_writeopcount != 0) vfs_dump_mount_counters(mp); } } @@ -1626,33 +1631,34 @@ vfs_assert_mount_counters(struct mount *mp) void vfs_dump_mount_counters(struct mount *mp) { - int cpu, *count; + struct mount_pcpu *mpcpu; int ref, lockref, writeopcount; + int cpu; printf("%s: mp %p vfs_ops %d\n", __func__, mp, mp->mnt_vfs_ops); printf(" ref : "); ref = mp->mnt_ref; CPU_FOREACH(cpu) { - count = zpcpu_get_cpu(mp->mnt_ref_pcpu, cpu); - printf("%d ", *count); - ref += *count; + mpcpu = vfs_mount_pcpu_remote(mp, cpu); + printf("%d ", mpcpu->mntp_ref); + ref += mpcpu->mntp_ref; } printf("\n"); printf(" lockref : "); lockref = mp->mnt_lockref; CPU_FOREACH(cpu) { - count = zpcpu_get_cpu(mp->mnt_lockref_pcpu, cpu); - printf("%d ", *count); - lockref += *count; + mpcpu = vfs_mount_pcpu_remote(mp, cpu); + printf("%d ", mpcpu->mntp_lockref); + lockref += mpcpu->mntp_lockref; } printf("\n"); printf("writeopcount: "); writeopcount = mp->mnt_writeopcount; CPU_FOREACH(cpu) { - count = zpcpu_get_cpu(mp->mnt_writeopcount_pcpu, cpu); - printf("%d ", *count); - writeopcount += *count; + mpcpu = vfs_mount_pcpu_remote(mp, cpu); + printf("%d ", mpcpu->mntp_writeopcount); + writeopcount += mpcpu->mntp_writeopcount; } printf("\n"); @@ -1668,27 +1674,34 @@ vfs_dump_mount_counters(struct mount *mp) int vfs_mount_fetch_counter(struct mount *mp, enum mount_counter which) { - int *base, *pcpu; + struct mount_pcpu *mpcpu; int cpu, sum; switch (which) { case MNT_COUNT_REF: - base = &mp->mnt_ref; - pcpu = mp->mnt_ref_pcpu; + sum = mp->mnt_ref; break; case MNT_COUNT_LOCKREF: - base = &mp->mnt_lockref; - pcpu = mp->mnt_lockref_pcpu; + sum = mp->mnt_lockref; break; case MNT_COUNT_WRITEOPCOUNT: - base = &mp->mnt_writeopcount; - pcpu = mp->mnt_writeopcount_pcpu; + sum = mp->mnt_writeopcount; break; } - sum = *base; CPU_FOREACH(cpu) { - sum += *zpcpu_get_cpu(pcpu, cpu); + mpcpu = vfs_mount_pcpu_remote(mp, cpu); + switch (which) { + case MNT_COUNT_REF: + sum += mpcpu->mntp_ref; + break; + case MNT_COUNT_LOCKREF: + sum += mpcpu->mntp_lockref; + break; + case MNT_COUNT_WRITEOPCOUNT: + sum += mpcpu->mntp_writeopcount; + break; + } } return (sum); } Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Mon Nov 9 23:00:29 2020 (r367534) +++ head/sys/kern/vfs_subr.c Mon Nov 9 23:02:13 2020 (r367535) @@ -734,17 +734,18 @@ SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_FIRST, vntblinit, NU int vfs_busy(struct mount *mp, int flags) { + struct mount_pcpu *mpcpu; MPASS((flags & ~MBF_MASK) == 0); CTR3(KTR_VFS, "%s: mp %p with flags %d", __func__, mp, flags); - if (vfs_op_thread_enter(mp)) { + if (vfs_op_thread_enter(mp, mpcpu)) { MPASS((mp->mnt_kern_flag & MNTK_DRAINING) == 0); MPASS((mp->mnt_kern_flag & MNTK_UNMOUNT) == 0); MPASS((mp->mnt_kern_flag & MNTK_REFEXPIRE) == 0); - vfs_mp_count_add_pcpu(mp, ref, 1); - vfs_mp_count_add_pcpu(mp, lockref, 1); - vfs_op_thread_exit(mp); + vfs_mp_count_add_pcpu(mpcpu, ref, 1); + vfs_mp_count_add_pcpu(mpcpu, lockref, 1); + vfs_op_thread_exit(mp, mpcpu); if (flags & MBF_MNTLSTLOCK) mtx_unlock(&mountlist_mtx); return (0); @@ -794,15 +795,16 @@ vfs_busy(struct mount *mp, int flags) void vfs_unbusy(struct mount *mp) { + struct mount_pcpu *mpcpu; int c; CTR2(KTR_VFS, "%s: mp %p", __func__, mp); - if (vfs_op_thread_enter(mp)) { + if (vfs_op_thread_enter(mp, mpcpu)) { MPASS((mp->mnt_kern_flag & MNTK_DRAINING) == 0); - vfs_mp_count_sub_pcpu(mp, lockref, 1); - vfs_mp_count_sub_pcpu(mp, ref, 1); - vfs_op_thread_exit(mp); + vfs_mp_count_sub_pcpu(mpcpu, lockref, 1); + vfs_mp_count_sub_pcpu(mpcpu, ref, 1); + vfs_op_thread_exit(mp, mpcpu); return; } @@ -6399,18 +6401,19 @@ restart: int vfs_cache_root(struct mount *mp, int flags, struct vnode **vpp) { + struct mount_pcpu *mpcpu; struct vnode *vp; int error; - if (!vfs_op_thread_enter(mp)) + if (!vfs_op_thread_enter(mp, mpcpu)) return (vfs_cache_root_fallback(mp, flags, vpp)); vp = atomic_load_ptr(&mp->mnt_rootvnode); if (vp == NULL || VN_IS_DOOMED(vp)) { - vfs_op_thread_exit(mp); + vfs_op_thread_exit(mp, mpcpu); return (vfs_cache_root_fallback(mp, flags, vpp)); } vrefact(vp); - vfs_op_thread_exit(mp); + vfs_op_thread_exit(mp, mpcpu); error = vn_lock(vp, flags); if (error != 0) { vrele(vp); Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Mon Nov 9 23:00:29 2020 (r367534) +++ head/sys/kern/vfs_vnops.c Mon Nov 9 23:02:13 2020 (r367535) @@ -1761,13 +1761,14 @@ vn_closefile(struct file *fp, struct thread *td) static int vn_start_write_refed(struct mount *mp, int flags, bool mplocked) { + struct mount_pcpu *mpcpu; int error, mflags; if (__predict_true(!mplocked) && (flags & V_XSLEEP) == 0 && - vfs_op_thread_enter(mp)) { + vfs_op_thread_enter(mp, mpcpu)) { MPASS((mp->mnt_kern_flag & MNTK_SUSPEND) == 0); - vfs_mp_count_add_pcpu(mp, writeopcount, 1); - vfs_op_thread_exit(mp); + vfs_mp_count_add_pcpu(mpcpu, writeopcount, 1); + vfs_op_thread_exit(mp, mpcpu); return (0); } @@ -1917,15 +1918,16 @@ vn_start_secondary_write(struct vnode *vp, struct moun void vn_finished_write(struct mount *mp) { + struct mount_pcpu *mpcpu; int c; if (mp == NULL) return; - if (vfs_op_thread_enter(mp)) { - vfs_mp_count_sub_pcpu(mp, writeopcount, 1); - vfs_mp_count_sub_pcpu(mp, ref, 1); - vfs_op_thread_exit(mp); + if (vfs_op_thread_enter(mp, mpcpu)) { + vfs_mp_count_sub_pcpu(mpcpu, writeopcount, 1); + vfs_mp_count_sub_pcpu(mpcpu, ref, 1); + vfs_op_thread_exit(mp, mpcpu); return; } Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Mon Nov 9 23:00:29 2020 (r367534) +++ head/sys/sys/mount.h Mon Nov 9 23:02:13 2020 (r367535) @@ -177,6 +177,16 @@ struct vfsopt { int seen; }; +struct mount_pcpu { + int mntp_thread_in_ops; + int mntp_ref; + int mntp_lockref; + int mntp_writeopcount; +}; + +_Static_assert(sizeof(struct mount_pcpu) == 16, + "the struct is allocated from pcpu 16 zone"); + /* * Structure per mounted filesystem. Each mounted filesystem has an * array of operations and an instance record. The filesystems are @@ -192,20 +202,23 @@ struct vfsopt { * */ struct mount { - struct mtx mnt_mtx; /* mount structure interlock */ + int mnt_vfs_ops; /* (i) pending vfs ops */ + int mnt_kern_flag; /* (i) kernel only flags */ + uint64_t mnt_flag; /* (i) flags shared with user */ + struct mount_pcpu *mnt_pcpu; /* per-CPU data */ + struct vnode *mnt_rootvnode; + struct vnode *mnt_vnodecovered; /* vnode we mounted on */ + struct vfsops *mnt_op; /* operations on fs */ + struct vfsconf *mnt_vfc; /* configuration info */ + struct mtx __aligned(CACHE_LINE_SIZE) mnt_mtx; /* mount structure interlock */ int mnt_gen; /* struct mount generation */ #define mnt_startzero mnt_list TAILQ_ENTRY(mount) mnt_list; /* (m) mount list */ - struct vfsops *mnt_op; /* operations on fs */ - struct vfsconf *mnt_vfc; /* configuration info */ - struct vnode *mnt_vnodecovered; /* vnode we mounted on */ struct vnode *mnt_syncer; /* syncer vnode */ int mnt_ref; /* (i) Reference count */ struct vnodelst mnt_nvnodelist; /* (i) list of vnodes */ int mnt_nvnodelistsize; /* (i) # of vnodes */ int mnt_writeopcount; /* (i) write syscalls pending */ - int mnt_kern_flag; /* (i) kernel only flags */ - uint64_t mnt_flag; /* (i) flags shared with user */ struct vfsoptlist *mnt_opt; /* current mount options */ struct vfsoptlist *mnt_optnew; /* new options passed to fs */ int mnt_maxsymlinklen; /* max size of short symlink */ @@ -229,12 +242,6 @@ struct mount { struct lock mnt_explock; /* vfs_export walkers lock */ TAILQ_ENTRY(mount) mnt_upper_link; /* (m) we in the all uppers */ TAILQ_HEAD(, mount) mnt_uppers; /* (m) upper mounts over us*/ - int __aligned(CACHE_LINE_SIZE) mnt_vfs_ops;/* (i) pending vfs ops */ - int *mnt_thread_in_ops_pcpu; - int *mnt_ref_pcpu; - int *mnt_lockref_pcpu; - int *mnt_writeopcount_pcpu; - struct vnode *mnt_rootvnode; }; /* @@ -1054,7 +1061,7 @@ void resume_all_fs(void); /* * Code transitioning mnt_vfs_ops to > 0 issues IPIs until it observes - * all CPUs not executing code enclosed by mnt_thread_in_ops_pcpu. + * all CPUs not executing code enclosed by thread_in_ops_pcpu variable. * * This provides an invariant that by the time the last CPU is observed not * executing, everyone else entering will see the counter > 0 and exit. @@ -1064,52 +1071,58 @@ void resume_all_fs(void); * before making any changes or only make changes safe while the section is * executed. */ +#define vfs_mount_pcpu(mp) zpcpu_get(mp->mnt_pcpu) +#define vfs_mount_pcpu_remote(mp, cpu) zpcpu_get_cpu(mp->mnt_pcpu, cpu) + #define vfs_op_thread_entered(mp) ({ \ MPASS(curthread->td_critnest > 0); \ - *zpcpu_get(mp->mnt_thread_in_ops_pcpu) == 1; \ + struct mount_pcpu *_mpcpu = vfs_mount_pcpu(mp); \ + _mpcpu->mntp_thread_in_ops == 1; \ }) -#define vfs_op_thread_enter_crit(mp) ({ \ +#define vfs_op_thread_enter_crit(mp, _mpcpu) ({ \ bool _retval_crit = true; \ MPASS(curthread->td_critnest > 0); \ - MPASS(!vfs_op_thread_entered(mp)); \ - zpcpu_set_protected(mp->mnt_thread_in_ops_pcpu, 1); \ + _mpcpu = vfs_mount_pcpu(mp); \ + MPASS(mpcpu->mntp_thread_in_ops == 0); \ + _mpcpu->mntp_thread_in_ops = 1; \ __compiler_membar(); \ if (__predict_false(mp->mnt_vfs_ops > 0)) { \ - vfs_op_thread_exit_crit(mp); \ + vfs_op_thread_exit_crit(mp, _mpcpu); \ _retval_crit = false; \ } \ _retval_crit; \ }) -#define vfs_op_thread_enter(mp) ({ \ +#define vfs_op_thread_enter(mp, _mpcpu) ({ \ bool _retval; \ critical_enter(); \ - _retval = vfs_op_thread_enter_crit(mp); \ + _retval = vfs_op_thread_enter_crit(mp, _mpcpu); \ if (__predict_false(!_retval)) \ critical_exit(); \ _retval; \ }) -#define vfs_op_thread_exit_crit(mp) do { \ - MPASS(vfs_op_thread_entered(mp)); \ +#define vfs_op_thread_exit_crit(mp, _mpcpu) do { \ + MPASS(_mpcpu == vfs_mount_pcpu(mp)); \ + MPASS(_mpcpu->mntp_thread_in_ops == 1); \ __compiler_membar(); \ - zpcpu_set_protected(mp->mnt_thread_in_ops_pcpu, 0); \ + _mpcpu->mntp_thread_in_ops = 0; \ } while (0) -#define vfs_op_thread_exit(mp) do { \ - vfs_op_thread_exit_crit(mp); \ +#define vfs_op_thread_exit(mp, _mpcpu) do { \ + vfs_op_thread_exit_crit(mp, _mpcpu); \ critical_exit(); \ } while (0) -#define vfs_mp_count_add_pcpu(mp, count, val) do { \ - MPASS(vfs_op_thread_entered(mp)); \ - zpcpu_add_protected(mp->mnt_##count##_pcpu, val); \ +#define vfs_mp_count_add_pcpu(_mpcpu, count, val) do { \ + MPASS(_mpcpu->mntp_thread_in_ops == 1); \ + _mpcpu->mntp_##count += val; \ } while (0) -#define vfs_mp_count_sub_pcpu(mp, count, val) do { \ - MPASS(vfs_op_thread_entered(mp)); \ - zpcpu_sub_protected(mp->mnt_##count##_pcpu, val); \ +#define vfs_mp_count_sub_pcpu(_mpcpu, count, val) do { \ + MPASS(_mpcpu->mntp_thread_in_ops == 1); \ + _mpcpu->mntp_##count -= val; \ } while (0) #else /* !_KERNEL */ From owner-svn-src-head@freebsd.org Mon Nov 9 23:04:31 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4549746FEB1; Mon, 9 Nov 2020 23:04:31 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVRQR1VNzz4Twp; Mon, 9 Nov 2020 23:04:31 +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 2608119128; Mon, 9 Nov 2020 23:04:31 +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 0A9N4V6g015867; Mon, 9 Nov 2020 23:04:31 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A9N4UVO015865; Mon, 9 Nov 2020 23:04:30 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011092304.0A9N4UVO015865@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 9 Nov 2020 23:04:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367536 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 367536 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 09 Nov 2020 23:04:31 -0000 Author: mjg Date: Mon Nov 9 23:04:30 2020 New Revision: 367536 URL: https://svnweb.freebsd.org/changeset/base/367536 Log: threads: introduce a limit for total number The intent is to replace the current id allocation method and a known upper bound will be useful. Reviewed by: kib (previous version), markj (previous version) Tested by: pho Differential Revision: https://reviews.freebsd.org/D27100 Modified: head/sys/kern/kern_thr.c head/sys/kern/kern_thread.c Modified: head/sys/kern/kern_thr.c ============================================================================== --- head/sys/kern/kern_thr.c Mon Nov 9 23:02:13 2020 (r367535) +++ head/sys/kern/kern_thr.c Mon Nov 9 23:04:30 2020 (r367536) @@ -67,7 +67,7 @@ __FBSDID("$FreeBSD$"); static SYSCTL_NODE(_kern, OID_AUTO, threads, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "thread allocation"); -static int max_threads_per_proc = 1500; +int max_threads_per_proc = 1500; SYSCTL_INT(_kern_threads, OID_AUTO, max_threads_per_proc, CTLFLAG_RW, &max_threads_per_proc, 0, "Limit on threads per proc"); Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Mon Nov 9 23:02:13 2020 (r367535) +++ head/sys/kern/kern_thread.c Mon Nov 9 23:04:30 2020 (r367536) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #ifdef HWPMC_HOOKS #include #endif +#include #include @@ -142,6 +143,12 @@ static lwpid_t tid_buffer[TID_BUFFER_SIZE]; static int tid_head, tid_tail; static MALLOC_DEFINE(M_TIDHASH, "tidhash", "thread hash"); +static int maxthread; +SYSCTL_INT(_kern, OID_AUTO, maxthread, CTLFLAG_RDTUN, + &maxthread, 0, "Maximum number of threads"); + +static int nthreads; + struct tidhashhead *tidhashtbl; u_long tidhash; struct rwlock tidhash_lock; @@ -154,8 +161,25 @@ EVENTHANDLER_LIST_DEFINE(thread_fini); static lwpid_t tid_alloc(void) { - lwpid_t tid; + static struct timeval lastfail; + static int curfail; + int nthreads_new; + lwpid_t tid; + nthreads_new = atomic_fetchadd_int(&nthreads, 1) + 1; + if (nthreads_new >= maxthread - 100) { + if (priv_check_cred(curthread->td_ucred, PRIV_MAXPROC) != 0 || + nthreads_new >= maxthread) { + atomic_subtract_int(&nthreads, 1); + if (ppsratecheck(&lastfail, &curfail, 1)) { + printf("maxthread limit exceeded by uid %u " + "(pid %d); consider increasing kern.maxthread\n", + curthread->td_ucred->cr_ruid, curproc->p_pid); + } + return (-1); + } + } + tid = alloc_unr(tid_unrhdr); if (tid != -1) return (tid); @@ -185,6 +209,7 @@ tid_free(lwpid_t tid) mtx_unlock(&tid_lock); if (tmp_tid != -1) free_unr(tid_unrhdr, tmp_tid); + atomic_subtract_int(&nthreads, 1); } /* @@ -199,8 +224,6 @@ thread_ctor(void *mem, int size, void *arg, int flags) td->td_state = TDS_INACTIVE; td->td_lastcpu = td->td_oncpu = NOCPU; - td->td_tid = tid_alloc(); - /* * Note that td_critnest begins life as 1 because the thread is not * running and is thereby implicitly waiting to be on the receiving @@ -208,7 +231,6 @@ thread_ctor(void *mem, int size, void *arg, int flags) */ td->td_critnest = 1; td->td_lend_user_pri = PRI_MAX; - EVENTHANDLER_DIRECT_INVOKE(thread_ctor, td); #ifdef AUDIT audit_thread_alloc(td); #endif @@ -253,9 +275,6 @@ thread_dtor(void *mem, int size, void *arg) osd_thread_exit(td); td_softdep_cleanup(td); MPASS(td->td_su == NULL); - - EVENTHANDLER_DIRECT_INVOKE(thread_dtor, td); - tid_free(td->td_tid); } /* @@ -325,6 +344,8 @@ proc_linkup(struct proc *p, struct thread *td) thread_link(td, p); } +extern int max_threads_per_proc; + /* * Initialize global thread allocation resources. */ @@ -333,6 +354,22 @@ threadinit(void) { uint32_t flags; + /* + * Place an upper limit on threads which can be allocated. + * + * Note that other factors may make the de facto limit much lower. + * + * Platform limits are somewhat arbitrary but deemed "more than good + * enough" for the foreseable future. + */ + if (maxthread == 0) { +#ifdef _LP64 + maxthread = MIN(maxproc * max_threads_per_proc, 1000000); +#else + maxthread = MIN(maxproc * max_threads_per_proc, 100000); +#endif + } + mtx_init(&tid_lock, "TID lock", NULL, MTX_DEF); /* @@ -415,16 +452,25 @@ struct thread * thread_alloc(int pages) { struct thread *td; + lwpid_t tid; thread_reap(); /* check if any zombies to get */ - td = (struct thread *)uma_zalloc(thread_zone, M_WAITOK); + tid = tid_alloc(); + if (tid == -1) { + return (NULL); + } + + td = uma_zalloc(thread_zone, M_WAITOK); KASSERT(td->td_kstack == 0, ("thread_alloc got thread with kstack")); if (!vm_thread_new(td, pages)) { uma_zfree(thread_zone, td); + tid_free(tid); return (NULL); } + td->td_tid = tid; cpu_thread_alloc(td); + EVENTHANDLER_DIRECT_INVOKE(thread_ctor, td); return (td); } @@ -447,6 +493,7 @@ void thread_free(struct thread *td) { + EVENTHANDLER_DIRECT_INVOKE(thread_dtor, td); lock_profile_thread_exit(td); if (td->td_cpuset) cpuset_rel(td->td_cpuset); @@ -455,6 +502,8 @@ thread_free(struct thread *td) if (td->td_kstack != 0) vm_thread_dispose(td); callout_drain(&td->td_slpcallout); + tid_free(td->td_tid); + td->td_tid = -1; uma_zfree(thread_zone, td); } From owner-svn-src-head@freebsd.org Mon Nov 9 23:05:28 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 968C82D0010; Mon, 9 Nov 2020 23:05:28 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVRRX3skRz4VMG; Mon, 9 Nov 2020 23:05:28 +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 7783619197; Mon, 9 Nov 2020 23:05:28 +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 0A9N5Sit015930; Mon, 9 Nov 2020 23:05:28 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A9N5SYe015929; Mon, 9 Nov 2020 23:05:28 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011092305.0A9N5SYe015929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 9 Nov 2020 23:05:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367537 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 367537 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 09 Nov 2020 23:05:28 -0000 Author: mjg Date: Mon Nov 9 23:05:28 2020 New Revision: 367537 URL: https://svnweb.freebsd.org/changeset/base/367537 Log: threads: reimplement tid allocation on top of a bitmap There are workloads with very bursty tid allocation and since unr tries very hard to have small-sized bitmaps it keeps reallocating memory. Just doing buildkernel gives almost 150k calls to free coming from unr. This also gets rid of the hack which tried to postpone TID reuse. Reviewed by: kib, markj Tested by: pho Differential Revision: https://reviews.freebsd.org/D27101 Modified: head/sys/kern/kern_thread.c Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Mon Nov 9 23:04:30 2020 (r367536) +++ head/sys/kern/kern_thread.c Mon Nov 9 23:05:28 2020 (r367537) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -138,9 +139,8 @@ static int thread_unsuspend_one(struct thread *td, str #define TID_BUFFER_SIZE 1024 struct mtx tid_lock; -static struct unrhdr *tid_unrhdr; -static lwpid_t tid_buffer[TID_BUFFER_SIZE]; -static int tid_head, tid_tail; +bitstr_t *tid_bitmap; + static MALLOC_DEFINE(M_TIDHASH, "tidhash", "thread hash"); static int maxthread; @@ -163,14 +163,14 @@ tid_alloc(void) { static struct timeval lastfail; static int curfail; - int nthreads_new; + static lwpid_t trytid; lwpid_t tid; - nthreads_new = atomic_fetchadd_int(&nthreads, 1) + 1; - if (nthreads_new >= maxthread - 100) { + mtx_lock(&tid_lock); + if (nthreads + 1 >= maxthread - 100) { if (priv_check_cred(curthread->td_ucred, PRIV_MAXPROC) != 0 || - nthreads_new >= maxthread) { - atomic_subtract_int(&nthreads, 1); + nthreads + 1 >= maxthread) { + mtx_unlock(&tid_lock); if (ppsratecheck(&lastfail, &curfail, 1)) { printf("maxthread limit exceeded by uid %u " "(pid %d); consider increasing kern.maxthread\n", @@ -180,36 +180,40 @@ tid_alloc(void) } } - tid = alloc_unr(tid_unrhdr); - if (tid != -1) - return (tid); - mtx_lock(&tid_lock); - if (tid_head == tid_tail) { - mtx_unlock(&tid_lock); - return (-1); + nthreads++; + /* + * It is an invariant that the bitmap is big enough to hold maxthread + * IDs. If we got to this point there has to be at least one free. + */ + if (trytid >= maxthread) + trytid = 0; + bit_ffc_at(tid_bitmap, trytid, maxthread, &tid); + if (tid == -1) { + KASSERT(trytid != 0, ("unexpectedly ran out of IDs")); + trytid = 0; + bit_ffc_at(tid_bitmap, trytid, maxthread, &tid); + KASSERT(tid != -1, ("unexpectedly ran out of IDs")); } - tid = tid_buffer[tid_head]; - tid_head = (tid_head + 1) % TID_BUFFER_SIZE; + bit_set(tid_bitmap, tid); + trytid++; mtx_unlock(&tid_lock); - return (tid); + return (tid + NO_PID); } static void -tid_free(lwpid_t tid) +tid_free(lwpid_t rtid) { - lwpid_t tmp_tid = -1; + lwpid_t tid; + KASSERT(rtid >= NO_PID, + ("%s: invalid tid %d\n", __func__, rtid)); + tid = rtid - NO_PID; mtx_lock(&tid_lock); - if ((tid_tail + 1) % TID_BUFFER_SIZE == tid_head) { - tmp_tid = tid_buffer[tid_head]; - tid_head = (tid_head + 1) % TID_BUFFER_SIZE; - } - tid_buffer[tid_tail] = tid; - tid_tail = (tid_tail + 1) % TID_BUFFER_SIZE; + KASSERT(bit_test(tid_bitmap, tid) != 0, + ("thread ID %d not allocated\n", rtid)); + bit_clear(tid_bitmap, tid); + nthreads--; mtx_unlock(&tid_lock); - if (tmp_tid != -1) - free_unr(tid_unrhdr, tmp_tid); - atomic_subtract_int(&nthreads, 1); } /* @@ -371,12 +375,7 @@ threadinit(void) } mtx_init(&tid_lock, "TID lock", NULL, MTX_DEF); - - /* - * pid_max cannot be greater than PID_MAX. - * leave one number for thread0. - */ - tid_unrhdr = new_unrhdr(PID_MAX + 2, INT_MAX, &tid_lock); + tid_bitmap = bit_alloc(maxthread, M_TIDHASH, M_WAITOK); flags = UMA_ZONE_NOFREE; #ifdef __aarch64__ From owner-svn-src-head@freebsd.org Mon Nov 9 23:34:32 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D57522D02A4; Mon, 9 Nov 2020 23:34:32 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVS545XGbz4WTW; Mon, 9 Nov 2020 23:34:32 +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 ACC9719462; Mon, 9 Nov 2020 23:34:32 +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 0A9NYWNC033478; Mon, 9 Nov 2020 23:34:32 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A9NYWsw033477; Mon, 9 Nov 2020 23:34:32 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202011092334.0A9NYWsw033477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 9 Nov 2020 23:34:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367538 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 367538 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 09 Nov 2020 23:34:32 -0000 Author: bz Date: Mon Nov 9 23:34:32 2020 New Revision: 367538 URL: https://svnweb.freebsd.org/changeset/base/367538 Log: arm64: bs_sr_ take II In r367327 generic_bs_sr_ were derived from mips. Given we are calling generic_bs_w_ and no write directly, we do not have to do the address calculations ourselves as eneric_bs_w_ will do a str val [bsh, offset]. All we actually have to do is increment offset. MFC after: 3 days Modified: head/sys/arm64/arm64/bus_machdep.c Modified: head/sys/arm64/arm64/bus_machdep.c ============================================================================== --- head/sys/arm64/arm64/bus_machdep.c Mon Nov 9 23:05:28 2020 (r367537) +++ head/sys/arm64/arm64/bus_machdep.c Mon Nov 9 23:34:32 2020 (r367538) @@ -136,40 +136,36 @@ static void generic_bs_sr_1(void *t, bus_space_handle_t bsh, bus_size_t offset, uint8_t value, size_t count) { - bus_addr_t addr = bsh + offset; - for (; count != 0; count--, addr++) - generic_bs_w_1(t, bsh, addr, value); + for (; count != 0; count--, offset++) + generic_bs_w_1(t, bsh, offset, value); } static void generic_bs_sr_2(void *t, bus_space_handle_t bsh, bus_size_t offset, uint16_t value, size_t count) { - bus_addr_t addr = bsh + offset; - for (; count != 0; count--, addr += 2) - generic_bs_w_2(t, bsh, addr, value); + for (; count != 0; count--, offset += 2) + generic_bs_w_2(t, bsh, offset, value); } static void generic_bs_sr_4(void *t, bus_space_handle_t bsh, bus_size_t offset, uint32_t value, size_t count) { - bus_addr_t addr = bsh + offset; - for (; count != 0; count--, addr += 4) - generic_bs_w_4(t, bsh, addr, value); + for (; count != 0; count--, offset += 4) + generic_bs_w_4(t, bsh, offset, value); } static void generic_bs_sr_8(void *t, bus_space_handle_t bsh, bus_size_t offset, uint64_t value, size_t count) { - bus_addr_t addr = bsh + offset; - for (; count != 0; count--, addr += 8) - generic_bs_w_8(t, bsh, addr, value); + for (; count != 0; count--, offset += 8) + generic_bs_w_8(t, bsh, offset, value); } struct bus_space memmap_bus = { From owner-svn-src-head@freebsd.org Mon Nov 9 23:36:52 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 421492D03AE; Mon, 9 Nov 2020 23:36:52 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVS7m1L99z4WV8; Mon, 9 Nov 2020 23:36:52 +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 20BC6195A1; Mon, 9 Nov 2020 23:36:52 +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 0A9NaqZI033596; Mon, 9 Nov 2020 23:36:52 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A9NaqlS033595; Mon, 9 Nov 2020 23:36:52 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202011092336.0A9NaqlS033595@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 9 Nov 2020 23:36:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367539 - head/sys/dev/usb X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/dev/usb X-SVN-Commit-Revision: 367539 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 09 Nov 2020 23:36:52 -0000 Author: bz Date: Mon Nov 9 23:36:51 2020 New Revision: 367539 URL: https://svnweb.freebsd.org/changeset/base/367539 Log: usb_hub: fix whitespace Fix a whitespace "error" introduced in r367435 noticed when preparing the MFC. No functional changes. Modified: head/sys/dev/usb/usb_hub.c Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Mon Nov 9 23:34:32 2020 (r367538) +++ head/sys/dev/usb/usb_hub.c Mon Nov 9 23:36:51 2020 (r367539) @@ -720,7 +720,7 @@ repeat: if ((sc->sc_st.port_change & UPS_C_CONNECT_STATUS) || (!(sc->sc_st.port_status & UPS_CURRENT_CONNECT_STATUS))) { if (timeout) { - DPRINTFN(0, "giving up port %d reset - " + DPRINTFN(0, "giving up port %d reset - " "device vanished: change %#x status %#x\n", portno, sc->sc_st.port_change, sc->sc_st.port_status); From owner-svn-src-head@freebsd.org Tue Nov 10 01:13:58 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 99FA52D28D6; Tue, 10 Nov 2020 01:13:58 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVVHp3zZkz4cW8; Tue, 10 Nov 2020 01:13:58 +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 7935A1A759; Tue, 10 Nov 2020 01:13:58 +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 0AA1Dwtu092907; Tue, 10 Nov 2020 01:13:58 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AA1Dw93092906; Tue, 10 Nov 2020 01:13:58 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011100113.0AA1Dw93092906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 10 Nov 2020 01:13:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367541 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 367541 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 10 Nov 2020 01:13:58 -0000 Author: mjg Date: Tue Nov 10 01:13:58 2020 New Revision: 367541 URL: https://svnweb.freebsd.org/changeset/base/367541 Log: thread: adds newer bits for r367537 The committed patch was an older version. Modified: head/sys/kern/kern_thread.c Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Mon Nov 9 23:38:39 2020 (r367540) +++ head/sys/kern/kern_thread.c Tue Nov 10 01:13:58 2020 (r367541) @@ -138,8 +138,8 @@ static int thread_unsuspend_one(struct thread *td, str #define TID_BUFFER_SIZE 1024 -struct mtx tid_lock; -bitstr_t *tid_bitmap; +static struct mtx tid_lock; +static bitstr_t *tid_bitmap; static MALLOC_DEFINE(M_TIDHASH, "tidhash", "thread hash"); @@ -195,7 +195,7 @@ tid_alloc(void) KASSERT(tid != -1, ("unexpectedly ran out of IDs")); } bit_set(tid_bitmap, tid); - trytid++; + trytid = tid + 1; mtx_unlock(&tid_lock); return (tid + NO_PID); } From owner-svn-src-head@freebsd.org Tue Nov 10 01:31:07 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3A2BB2D405B; Tue, 10 Nov 2020 01:31:07 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVVgb1GG6z4fDX; Tue, 10 Nov 2020 01:31:07 +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 1E1DF1AB1D; Tue, 10 Nov 2020 01:31:07 +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 0AA1V6io003560; Tue, 10 Nov 2020 01:31:06 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AA1V6UL003559; Tue, 10 Nov 2020 01:31:06 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011100131.0AA1V6UL003559@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 10 Nov 2020 01:31:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367542 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 367542 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 10 Nov 2020 01:31:07 -0000 Author: mjg Date: Tue Nov 10 01:31:06 2020 New Revision: 367542 URL: https://svnweb.freebsd.org/changeset/base/367542 Log: threads: remove the unused TID_BUFFER_SIZE macro Modified: head/sys/kern/kern_thread.c Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Tue Nov 10 01:13:58 2020 (r367541) +++ head/sys/kern/kern_thread.c Tue Nov 10 01:31:06 2020 (r367542) @@ -136,8 +136,6 @@ static void thread_zombie(struct thread *); static int thread_unsuspend_one(struct thread *td, struct proc *p, bool boundary); -#define TID_BUFFER_SIZE 1024 - static struct mtx tid_lock; static bitstr_t *tid_bitmap; From owner-svn-src-head@freebsd.org Tue Nov 10 01:57:20 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3E6882D5AD2; Tue, 10 Nov 2020 01:57:20 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVWFr1MR5z4h1d; Tue, 10 Nov 2020 01:57:20 +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 21C731B38A; Tue, 10 Nov 2020 01:57:20 +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 0AA1vKPV016250; Tue, 10 Nov 2020 01:57:20 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AA1vKXA016249; Tue, 10 Nov 2020 01:57:20 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011100157.0AA1vKXA016249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 10 Nov 2020 01:57:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367543 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 367543 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 10 Nov 2020 01:57:20 -0000 Author: mjg Date: Tue Nov 10 01:57:19 2020 New Revision: 367543 URL: https://svnweb.freebsd.org/changeset/base/367543 Log: thread: use tdfind in sysctl_kern_proc_kstack This treads linear scans for locked lookup, but more importantly removes the only consumer of thread_find. Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Tue Nov 10 01:31:06 2020 (r367542) +++ head/sys/kern/kern_proc.c Tue Nov 10 01:57:19 2020 (r367543) @@ -2748,6 +2748,7 @@ sysctl_kern_proc_kstack(SYSCTL_HANDLER_ARGS) struct stack *st; struct sbuf sb; struct proc *p; + bool locked; name = (int *)arg1; error = pget((pid_t)name[0], PGET_NOTINEXEC | PGET_WANTREAD, &p); @@ -2787,12 +2788,15 @@ sysctl_kern_proc_kstack(SYSCTL_HANDLER_ARGS) lwpidarray[i] = td->td_tid; i++; } + PROC_UNLOCK(p); + locked = false; numthreads = i; for (i = 0; i < numthreads; i++) { - td = thread_find(p, lwpidarray[i]); + td = tdfind(lwpidarray[i], p->p_pid); if (td == NULL) { continue; } + locked = true; bzero(kkstp, sizeof(*kkstp)); (void)sbuf_new(&sb, kkstp->kkst_trace, sizeof(kkstp->kkst_trace), SBUF_FIXEDLEN); @@ -2806,14 +2810,16 @@ sysctl_kern_proc_kstack(SYSCTL_HANDLER_ARGS) kkstp->kkst_state = KKST_STATE_RUNNING; thread_unlock(td); PROC_UNLOCK(p); + locked = false; stack_sbuf_print(&sb, st); sbuf_finish(&sb); sbuf_delete(&sb); error = SYSCTL_OUT(req, kkstp, sizeof(*kkstp)); - PROC_LOCK(p); if (error) break; } + if (!locked) + PROC_LOCK(p); _PRELE(p); PROC_UNLOCK(p); if (lwpidarray != NULL) From owner-svn-src-head@freebsd.org Tue Nov 10 01:57:49 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 76B8A2D5BC0; Tue, 10 Nov 2020 01:57:49 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVWGP2xkBz4hB9; Tue, 10 Nov 2020 01:57:49 +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 57E841B13B; Tue, 10 Nov 2020 01:57:49 +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 0AA1vn71016304; Tue, 10 Nov 2020 01:57:49 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AA1vmtM016302; Tue, 10 Nov 2020 01:57:48 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011100157.0AA1vmtM016302@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 10 Nov 2020 01:57:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367544 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 367544 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 10 Nov 2020 01:57:49 -0000 Author: mjg Date: Tue Nov 10 01:57:48 2020 New Revision: 367544 URL: https://svnweb.freebsd.org/changeset/base/367544 Log: thread: retire thread_find tdfind should be used instead. Modified: head/sys/kern/kern_thread.c head/sys/sys/proc.h Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Tue Nov 10 01:57:19 2020 (r367543) +++ head/sys/kern/kern_thread.c Tue Nov 10 01:57:48 2020 (r367544) @@ -1325,19 +1325,6 @@ thread_single_end(struct proc *p, int mode) kick_proc0(); } -struct thread * -thread_find(struct proc *p, lwpid_t tid) -{ - struct thread *td; - - PROC_LOCK_ASSERT(p, MA_OWNED); - FOREACH_THREAD_IN_PROC(p, td) { - if (td->td_tid == tid) - break; - } - return (td); -} - /* Locate a thread by number; return with proc lock held. */ struct thread * tdfind(lwpid_t tid, pid_t pid) Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Tue Nov 10 01:57:19 2020 (r367543) +++ head/sys/sys/proc.h Tue Nov 10 01:57:48 2020 (r367544) @@ -1153,7 +1153,6 @@ void thread_suspend_one(struct thread *td); void thread_unlink(struct thread *td); void thread_unsuspend(struct proc *p); void thread_wait(struct proc *p); -struct thread *thread_find(struct proc *p, lwpid_t tid); void stop_all_proc(void); void resume_all_proc(void); From owner-svn-src-head@freebsd.org Tue Nov 10 02:26:45 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8453F2D6D4E; Tue, 10 Nov 2020 02:26:45 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVWvn3PRvz4jsR; Tue, 10 Nov 2020 02:26:45 +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 65DA61B7AF; Tue, 10 Nov 2020 02:26:45 +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 0AA2Qjvc034109; Tue, 10 Nov 2020 02:26:45 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AA2Qjle034108; Tue, 10 Nov 2020 02:26:45 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <202011100226.0AA2Qjle034108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Tue, 10 Nov 2020 02:26:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367545 - head/sys/netgraph X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/sys/netgraph X-SVN-Commit-Revision: 367545 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 10 Nov 2020 02:26:45 -0000 Author: eugen Date: Tue Nov 10 02:26:44 2020 New Revision: 367545 URL: https://svnweb.freebsd.org/changeset/base/367545 Log: ng_nat: unbreak ABI The revision r342168 broke ABI of ng_nat needlessly and the change was merged to stable branches breaking ABI there, too. Unbreak it. PR: 250722 MFC after: 1 week Modified: head/sys/netgraph/ng_nat.h Modified: head/sys/netgraph/ng_nat.h ============================================================================== --- head/sys/netgraph/ng_nat.h Tue Nov 10 01:57:48 2020 (r367544) +++ head/sys/netgraph/ng_nat.h Tue Nov 10 02:26:44 2020 (r367545) @@ -205,8 +205,6 @@ enum { NGM_NAT_SET_IPADDR = 1, NGM_NAT_SET_MODE, NGM_NAT_SET_TARGET, - NGM_NAT_SET_DLT, - NGM_NAT_GET_DLT, NGM_NAT_REDIRECT_PORT, NGM_NAT_REDIRECT_ADDR, NGM_NAT_REDIRECT_PROTO, @@ -216,4 +214,6 @@ enum { NGM_NAT_LIST_REDIRECTS, NGM_NAT_PROXY_RULE, NGM_NAT_LIBALIAS_INFO, + NGM_NAT_SET_DLT, + NGM_NAT_GET_DLT, }; From owner-svn-src-head@freebsd.org Tue Nov 10 04:50:47 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 609B62E1E26; Tue, 10 Nov 2020 04:50:47 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVb5x64y6z4q1f; Tue, 10 Nov 2020 04:50:45 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.229.168]) by shaw.ca with ESMTPA id cLc9kOKEg34axcLcAkPiuM; Mon, 09 Nov 2020 21:50:43 -0700 X-Authority-Analysis: v=2.4 cv=LvQsdlRc c=1 sm=1 tr=0 ts=5faa1c24 a=7AlCcx2GqMg+lh9P3BclKA==:117 a=7AlCcx2GqMg+lh9P3BclKA==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=nNwsprhYR40A:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=d60N8XTBATa_YG_cODIA:9 a=CjuIK1q_8ugA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTPS id C760B1531; Mon, 9 Nov 2020 20:50:39 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 0AA4od0U078230; Mon, 9 Nov 2020 20:50:39 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202011100450.0AA4od0U078230@slippy.cwsent.com> X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Bryan Drewery cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r367459 - head/usr.sbin/syslogd In-reply-to: <4b605497-6dd1-72fe-fb05-b45c61ee6fa8@FreeBSD.org> References: <202011071917.0A7JHbUS079060@repo.freebsd.org> <4b605497-6dd1-72fe-fb05-b45c61ee6fa8@FreeBSD.org> Comments: In-reply-to Bryan Drewery message dated "Mon, 09 Nov 2020 12:16:07 -0800." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 09 Nov 2020 20:50:39 -0800 X-CMAE-Envelope: MS4xfPDkpo3EU9K6hQlgDOHdlYUMTRkUwKQP+b+ictBXTSXPFzbY8fzjfT4SNnnqdpZ2wMlT5LTdV+Xx61rYZWbOupNLmRUI6wrnn3Qx37LJ8Rr4LtWb+Jly 03mxYtGAcHriMeeIBgZCJLY/p++g6Knb2kZ4IXh0hcRjB0eJQvFmdIY52qVqpluTgTPu3CZmC6Dh21wlEt4Y33d8lhmWXHJVaxAd3R0V2J43KSfAdUX9kEhH a7vcSL9WJwgCLEi0eupH6IcLX4+D6M2u8jcAT7g8JOLZix4mFkJwf6laKMMOCMk9bSy1/6+RzYwK/rhECmfh8C4CEaord8DeQt+w+DvhxuM= X-Rspamd-Queue-Id: 4CVb5x64y6z4q1f X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 64.59.134.13) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [-1.69 / 15.00]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[4]; NEURAL_HAM_SHORT(-0.99)[-0.993]; RECEIVED_SPAMHAUS_PBL(0.00)[70.67.229.168:received]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; MIME_TRACE(0.00)[0:+]; RCVD_IN_DNSWL_LOW(-0.10)[64.59.134.13:from]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[cschubert.com: no valid DMARC record]; AUTH_NA(1.00)[]; RCVD_TLS_LAST(0.00)[]; R_SPF_NA(0.00)[no SPF record]; RWL_MAILSPIKE_VERYGOOD(0.00)[64.59.134.13:from]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 10 Nov 2020 04:50:47 -0000 NP. That's happened to me a couple of times at $JOB. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. In message <4b605497-6dd1-72fe-fb05-b45c61ee6fa8@FreeBSD.org>, Bryan Drewery wr ites: > > Thanks. I had the commit in a branch that had a debug commit after. The > brace was rebased wrong. > > On 11/7/2020 11:17 AM, Cy Schubert wrote: > > Author: cy > > Date: Sat Nov 7 19:17:37 2020 > > New Revision: 367459 > > URL: https://svnweb.freebsd.org/changeset/base/367459 > >=20 > > Log: > > Fix build post-r367455. > > =20 > > MFC after: 2 weeks > > X-MFC with: r367455 > >=20 > > Modified: > > head/usr.sbin/syslogd/syslogd.c > >=20 > > Modified: head/usr.sbin/syslogd/syslogd.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= > =3D=3D=3D=3D > > --- head/usr.sbin/syslogd/syslogd.c Sat Nov 7 18:15:29 2020 (r36745 > 8) > > +++ head/usr.sbin/syslogd/syslogd.c Sat Nov 7 19:17:37 2020 (r36745 > 9) > > @@ -1873,7 +1873,7 @@ fprintlog_write(struct filed *f, struct iovlist *= > il, i > > continue; > > if (sl->sl_sa =3D=3D NULL || > > sl->sl_family =3D=3D AF_UNSPEC || > > - sl->sl_family =3D=3D AF_LOCAL) { > > + sl->sl_family =3D=3D AF_LOCAL) > > continue; > > lsent =3D sendmsg(sl->sl_socket, &msghdr, 0); > > if (lsent =3D=3D (ssize_t)il->totalsize) > >=20 > > > --=20 > Regards, > Bryan Drewery > > --------------9CBC57D81FB1CF44779F663A > Content-Type: application/pgp-keys; > name="OpenPGP_0x35D771BB6E4697CF_and_old_rev.asc" > Content-Transfer-Encoding: base64 > Content-Disposition: attachment; > filename="OpenPGP_0x35D771BB6E4697CF_and_old_rev.asc" > > LS0tLS1CRUdJTiBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0tDQoNCnhzQk5CRkpwaG1zQkNB > RGlGZ21TNGJJendaaWpyUzMxU2pFTXpnK241ek5lbGxnTStIa1Nod2VocHFDaXloWGRXcnZI > NmRUWmE2dTUNCjBwYlVJWDdkb1RSN1c3UFFIQ2pDVHF0cHd2Y2owZXVsWnZhK2lIRnArWHJi > Z1NGSG4rVlZYZ2tZUDJNRnlTeVpSRmFiRDJxcXpKQkUNCkpvZmhwdjRIdlk2dVFJNUs5OXBN > cUtyMVovbEhxc2lqWVl1NFJIMk9md0I1UGluSWQ3eGVsZHpXRW9uVm9DcityZnh6Ty9VcmdB > NnYNCi8zbGF5R1pjS05IRmptYzNOcW9OMURYdGRhRUhxdGpJb3p6Ym5kVmtINmxrRnZJcEly > STZpNW94OHB3cFZ4c3hMQ3IvNE11c2Q1Q1cNCmdIaWV0NWtTdzJTek5lQThGYnhkTFlDcFhO > VnUrdUJBQ0ViQ1VQK0NTTnkzTlZmRVV4c0JBQkVCQUFITkpFSnllV0Z1SUVSeVpYZGwNCmNu > a2dQR0prY21WM1pYSjVRRVp5WldWQ1UwUXViM0puUHNMQlhBUVFBUW9BQmdVQ1VtbUpsUUFL > Q1JCdWVDckFQSnNNK1RmZEQvOTMNCmlqVUlCOW94bU5EcEZqMERtQ0IyWlRZZTN0T0Y0WE9x > THJMTW9UaVpKbmNhU0xqRUhxcW8vaTYySFRtV2pSZjJoL0pwdGE4WmwzRCsNCmRpdlNkSjIr > RFdBb29aOU5hanQzRnhlckhVbXVFWldUR3lJSC9tQnZubUI2R2pCb0NDdE56SVQwL3FGeklT > R3RURFJQcHNwbHo5QXENCjczZHozczFadjUyWUt2a3d2MVp3d2svNGVmVGlqRTk0V3JOSXRv > QkRXaCtXbmU3WkpMMVVVK0tOTktJWUNCQ3Z4Mjk3bGsvby9ZbkcNCmxNdHpIL0ZxVVIzVHU0 > UWo4MTE2aWVpVno2eVJ3eWI0OGJWYUtjYzEya2F5SjhOOFVEamZZYjZ3Wjlvc3RQcjVaSEJ4 > N0tIY1hUTEENCm5vTGhObDdPdVVKNGROU2luY2lZYTB3d0xDRTJ2ZkhIcjNDN05BOEpUM2ZL > VElUVDZSekQ0VmtZN3BzUWN2blpBTC9ocGZsVXVldUUNCitnaWdZTmdSb00xZStrMENZRHow > QkZmY1BkKytNQTdEbnNjNUVXOUJnc210bUVuY0o4Z3htV2xtM3VrMEJZRjZ0clpheTR3eXJa > dkoNCm9vamNMVmkrYXAvbTUrYzRPbFZ0Uk9lVU9IUXVLdXQyZVk5bXkvU0lWcmZnUExBQ0hm > eTd4d3E5ZXgyNFpaQU1IUUdyeHJTYWVZMmwNClhGV0gzWmtVc3NES1pJd0V1dVkzc09lSlY2 > TnRDWklhV2JtVjhQRS9wbGw0eERBSmVFT0lUUGlIbU9wRUJBVDdVQndWMTZqZTNhUEYNCjhF > RDRhakc0RjAycXJpSC9YZWJncnR4eWZCSDFJMllFSlVNd1A4Z1R2VGxUOTJSd25PTTBmTEJj > aHI3OXAvR1pXRnp3QXRRaXhNSk0NCkJCTVJBZ0FNQlFKU2E5MmNCWU1IaGgrQUFBb0pFR0hZ > ZHNGRUNqUFN6aDhBblJkUXpFYlhFQVZ6dDJyV21GT1RVQUhGTHBvVUFKNDYNCkthNEYxcjBz > WC8zeWpJSmJVSDYxRlkxbWJjTEFYQVFRQVFJQUJnVUNVbXZwY0FBS0NSRDF6Mkt6SUhzYm9Y > MkVCLzR3NWxSUnM4ODINCjF3OXFHRkY5azJ2dWhxNEFKOWdNTHBJMEM5VFVOSk5RaU9sVEdh > Tmp2MVNXSEQ1bVlqZ3IxRHBiTVdSY05HbXlDbnNYZjZCdDF5NDENCm1VUUV5NUZ6YUxVYTVR > enFIdlIzWkd5NkNybFJDVmVqT01TMlZOQWxVOHI1YVh6MEVxTEhQNTVnb1FGYVE4aVEvY0Yv > R1laeFlOaW4NCk9vYmh5K3V5ZTJiWE16azI2MFhlSkZ0S1Z6RUFlNmpoNlE1KythMWRnNm1q > M0JROENEN3dhdERhY1k1WTZsb290UFRJQUN3cUdHb2YNCktCbHZNYW1MMVpWSXpKK0huamhs > S3NtVzRBV2hMRFQxUDFudzNzOUJ0TEIxNUtzc0Q0TE54TGF0ZGpsaWRodWxkYm9xUkRwdExu > NzMNCmlOM3dqVDdNQnJROGVGb0t5dlpNbFJONVBWNDl3c0JnQkJBQkNnQUtCUUpTYStkdUF3 > VUJlQUFLQ1JCU1R3dzNvTGxHb3dxNEIvb0MNCnFPeWRPL1E4bFRZY0M4K2t3b0VtMzBQekZ3 > Zk5BTzhvcHlHZjZuMGpwUzEwOW9vYkhSai9FOGlGSEd0VHROOFMyc0crMFp3Rk1lSUkNCnpY > QzJqdE5qRDIwSHRpd0k4TWh5YUdHck9kTVBFM042VTIrNzBodzRSdmZnS1pCTnJ5TXlKSkJx > UUptVXNkVEo4M09MZ1pGNldpdVYNCjVQYk1hSHd6U2NUL21zUyt5bmtVQjV6RzJmSVZ2SU5G > aU9oTm9wbGZSNlJJSjhMM1ZUUDF1RWNIb0V6Z1dtTDVWbTNkaHkxcWh4YlkNCnlVckxrTngr > ekJ5TEFsSi9TRTYxaHI5Sm9TcVJnUERzRWVWRDNQaW05eXl2cFp3cndFY2xUZ2dSdUNXYVYy > ZVpmN1dwK3ZFL0RzdDMNCmNBYk1FNVpOVm9jcVBVNzY3Mnl3dS9UNi9peVdneHZtZ1hrMXdz > RmNCQkFCQ2dBR0JRSlNib2c0QUFvSkVEZk4reWNsZGVTQVhmc1ENCkFLc0JpWUxnYWhkL1RV > d1JJVFNURS9xNUYwL0tjcFdqTGtYUlBBRHVwcHRkQThjaHZpbFhPNmFyZ3EvSzFFOGtsTzls > OFV6VU92TWoNCkNJTzhHS3lqNlBmdC9qSWoraE1vd1YySldKaU04cnpYL1VxbVdzZVVCK3ZE > N0d2L0lFb0VQYmNvNEoxUm1Md0ZrRHJncHN0azdhVXQNCmRnYVF2VUltb0s0Z2lwcDhaNHFM > VU9idlJLWTcrakdjR3dqZGk1bmdPTzV4aGtYUDh5Y21PRjdxeE8zdTFodkQ0K3VaWFJvbDI4 > bXYNCnJ1Tmdkd3djeU1YVzBDeDRYMEZrekpZN2lGUDNGNDRXUVlOR2QwL2hFRmowWVFxUUNj > dUNPSUoxd2t5Z0pyQkptTmNvZ2ZJSDlBemgNCkc3SE11eHdrYWRWZkQvMHJkTCtqU2Z3YVRI > YWZJYW9aNTRIbW9CWjVaSVkxL0ZXdmYxZ3NVTFNTd3RNVHlQU3REd0N5YXE3Tm1iNEQNCnZS > aUJTS1M3cUhZZ1lkaHlGaWxzeFM1N004M2w0bnF0QjVqcVJQN2gxaUY1T3NZR1ZNcDgxTWNT > cE93Sy9QQXByZ216MC9tZ3JHTXQNCi9VTUJaTjNTOHRSVHlLczVrM0xWK01tb2tFZzdOVG9M > NXJWa2ZtOWNsM2RRaFBlVFRFVjcyWjRHSXVtb2NjMFBTNzNJMGpxcGFteFMNCmxRTXNBUFJs > cXdkUUFINVJJR3VBMDBhYXUvMXlKb0hIdHgyK0ErUWx6WENXRnNXRVp6UkVzTEpJbjNDZ0F4 > a0NqV0drdVN6ZWFTS3ENClExeFFwZDVmblFybHlmYzkyeWx3TFFuZmNhR3N2cjZ0U0lDT0Nt > bFlHRVREK0NFQXBpNUVPTFpCV1RLdnR2RS9XeFRSd21lelZLVFENCndzQmNCQkFCQWdBR0JR > SlNjSWFiQUFvSkVOazNFSmVrYzhtUTBMOEgrd1JsL0Jpajg1YkNaVGJUQ0pWbGZTMjd6Vmsy > Z3RCMlRsMysNCjBSaUFLN3VNOU5mMXpvVUZRN2wyQlBESERuMk8vN3piYUxjbDNUcFhTRGdl > UndPZHpzZkZpbWJOaFVnTENpajV0TjF2V3hvQk42c0sNCi9Gdmd6ODFrR3gwUDZ4WnlSV2Rt > WlRhbHo1WU4rSFVWYmNjK3ltNmhHbkk5R2xidng5OGpjQklLcVJhMU5zOTRicHhOaTZ3ZXJ2 > enMNCkdqNzZyN3V3blBQNjVnOUNZNXluVjBlVVJWUGVHd25NVm9XSko3L3dwMEptNnJ6ZWtj > bUhTRmQ1U3JNRmFvdUpTQUhMQ3JWVWNlS2INCkovNzkxSjIrVXVJS1BwWWtiRmFjMVhGRHVF > dnFrS0dhdjc4dCtHVXpUNDdRTm1ML2Z4aWtvUDk3VzdrQUF2SWJzMEIzdFpNdHhEbEMNCllr > YkN3VndFRUFFQ0FBWUZBbEp5WURnQUNna1FKa25tS01YVFRRWDBGdy8vUkFnMGxMbjdkWE1K > RzhxMnUvSFVqbGRlNkxZM3ZuckcNCjU0TEVrSSswcHRtWmQwbWNFcXV6cFR1NlRsMmV1QUNq > S29JMG1BSkU1M0VGci9kcnFDRExnUHY3U0Y0ZzNkQnMzdk1oS2JqR3k3djANCkFGR0Nib2lE > K21pNlNqRlZWdExJd2hLVzBzT2F3dktxVVJzaDJQMElzcjZhY2k4cGRITmp4cENuR1JUVWE4 > ZEc3cGYzeVFlQ2RnRTQNCnFFR29OYk9oY0FvQ1J3dnFrYlpEUU1tYW84czF3UXFvRW9QSGgx > ZHV2ZENsT0dvZjZhYktnaTN5TDBRUTladFZURHBTaDlmWDJVZVgNCmI1cEM0bmxrSnpmL0li > eHhiWlBMR2xYSTZaa0owMEt5VksvUHNKV0J2RVpCOVo3MnV0WDkzdWlGeGliL0Uzb3llM1hR > RXBURU9nSjINClJUdWI5d1FkODZDN052dkd3bDRjN2d0dzZmVWNybDlkQ0JKWkpHRC9DSGxL > Qk5FRithWS9lQ2l2OE1tSktFMWhFeFdEbHpXREFyMTENCjRVVHNUZEI5VHc1YnFzdW5nOGtw > aTcyQlFIR0ZYM2RsOGtEQmR2YUV3RUJDQVZyL0pUcU5hZW83clBLRkttYmIwZXdraWN0UU9D > b20NClV6WUdybUFOZkRYVThYS3ZObTl2VWVGQzF6Vi9lb2N5VkxrRVByZ3lUL2tTY0FJRFlU > U1p0SzZXS1VreDZzUElVeCsyTy91bGgya1oNClZDSzF5czgwNkZZR0NHOUNrZGt1MmhtRHRn > WVdTclpEZDBpdjQ5NXNMMG9xMk5VcUM3bjdsWEMrVFh4YjVXRnV1SVV3NzA3azF6MnYNCkY0 > Q3JHSTEzem1ib1pXY1hjd3ZIMGlWMktTaXowcjRDRHlJQUt3NHlKeDNDd053RUVnRUNBQVlG > QWxRY1VBTUFDZ2tRanc3cnhIdEgNCkZzbVFIZ3YvV2Rld3FnSEdyUlRkVmsvMG1KZi96L3h0 > bko4TnZGV28yUHBXejROWkppV1BPQU9WUGRYaHVyUlFWaGYyaVlCS0dZUEsNClpEenlWV2l4 > QTRGZ2dtcjB5a2txUnJLSXluNXZMOU54ejgwdlFaRWpHVlR4Q1JuUjlGTVljSFlRSE85Y3VJ > OE5LVTZLRkZVVk1lRWkNCmVtemVtZkorOE9RZFQySkxyTWM1THluMXpjbGZQZGR1ZlQ3NWxq > MGJPMDd4M090SFVjOUNUOFNHcXFSVGwyRmlzdUJGdkRTTDZUYlcNCk8xZDkzUlpJZmdnMTFZ > VHhnMmx4MWtCYWxLQVZteVNnWjRvTnozMkZEWGtrbEtDZHdKa284VmJDRnVnUUJWalY2UUc5 > TmFTNHBEa1ENCjhBRm1vaE1aNDZwM3l3bTFseHUxbENmdTFFTTdjZHZZclRYY0FlUEMxakJi > U0NrcEdNM3BvcEhNOTZCN3Rnd3hVcjRnS2pHeTkzQ1oNCmVkUnA5MW14VGVHb1J0d1BscG1G > YWpoUk55VXQyVjBRbm9aUFdKTDJQeWQxYjM5ZkVLM3lWOHJMYmRFRFpwNEdFNjRSOEU2L2pN > M00NClZTWHE4L3Nwa2k4Y2xpWjlFeDFwSklTc2NadFJSSGxteUE4R0IvTDN5VWxReTgvUkVh > eG93SWk5amVOcE9qOVR3c0JjQkJBQkNBQUcNCkJRSlZlNXl0QUFvSkVEWFdsd25zZ0o0RWg1 > WUlBTU1id1VNeGlkSDdjWDNnYVo4WGNybFNkeGYxamJ3dDFYcU5oZGxaUE1abXVFUDcNCkdn > Njc2NnU2WTJZN3FjUTI3dkliT1IwZ2NlNEtZNXRSbXJyTkVWL3QvTXBHbmpVc240Q2NxMUs5 > aDloYm5FbVIzSTRiTGpXMVdvSU8NClY3bnNsbTN1UzZkTWthTGE2aDJNMFFTcmFsWmliRmlB > VkZNVFMyZmE1VVhEQjVFZ0tFTTliSUx5eEQyTm04SEJLZ3dJNlkvd0VvYnANCng4eGozSlhH > QTBuZFVJRXJxSUZxK3kvRnVRdTZQKzJWaTZSTUFWZG9HYnRBRU9LRXhlYjV6SWdXWHErVy8r > SEJJUjN0YTdHOUtkVnYNCm0zZEhPODI3dU1RVk52VHhuSndSS3Y1ZUluNGdKejZodTh2ZlQv > RDBkcmtpWEdEczRLV2ZmcXp5eDRiemx5QmUwY2pDd1Z3RUVBRUMNCkFBWUZBbFY3ZkpzQUNn > a1FUYUVVNWNTaTVYK1l5QS8vZU5Ody9mRFo2YkpZbE9RRzVsaFhsMy9qVEZucWJzWW84eGVz > UGU2M042bTANCmV1NWFOM1dYZE95bjV3TEpoR3BVai9qeEtpQzZGd2hyUjRUVW0va2lWTFYx > VnQyQzRQNTd6OWdENjBDbGViRFYxYUhzM3hERjJ1UVgNCldydUh0dDRlYWdzL1JURTN5bkRI > T2t6dS9ubXFhdGZVODlzWXA5OUwraEVhRExKZVA3WFVsclZHaWYvY0R0cnNCdThCL05VT1FU > b2cNCnlEaXRMbkJkZ3dYVStzSE5abW8xVTQ5N1VJT3lPclUxTW83RldoQk1FTHhSV2FaaFJW > T3B0dWQ5by9GWTMybCtrM0VpZDdualdmSzYNClpBcHFXRlh1SUFVOHJpb0xNNUtwQ2xGQkZC > YXNuajl3QUt5bDBkUFlNMHdOZTdyTEwwYkFJWmdNdUtOcU5JaGJzMklYNDQrUEl4bWsNCjdj > NDZMSTU2TWx5NFdLNjhqSFBVNU1LaW5NOTVKNWh0Z20zVHVsbDl6bCsyTityZXJKK05Tc3c1 > cWl2ZHJNRklMcDRSWkU5REZUMCsNCmpRazRsU0NodnRhVGxCM3kzOW41bEFiYlNyV2pBeTE3 > TklMaVdvV0VQQmFUR3JmTERpWlRyWmQwWFBBVTU3R3BXY0V4dDhoMXloVnQNClk5bm9UbXYw > eDNodllUdUk3N2lSRWNhMjBRWEYwTys1NjVhYnFselM2Mi92MURpcU5xK01WQy9Rd1k4bDFl > eVUvbkY0cEFHMDNwdUcNClFWemkxVXFQQWh6cWlGOWlzNUJudUJPSzJ1R1ZOOXpIVXpNM05I > d0tINmJudlNuVnpBQWxwdzF2eXlrM3pmZ05jSW1FYjh0V2NSb1YNClVpaTA5WTJ5eVowVGgy > VDU0QVN2WHlPMUo5cHRxTFBDd1Z3RUVBRUlBQVlGQWxWN2tsWUFDZ2tRMUQ5OEV4Qi82bThP > dFEvL2RYeDYNCkZZaUtaVmc5NTJtSTcyU3RsTm1QWm1FbE5aZ3V6Vm9yYlRvUktsZkpUc3Za > NmJBSEhTSFZnYVRmYzBIZngrNGdpMndtcUJac0lrRlINCm9DYlp0R01RR2tON0VBMUFkUHNs > Z3dtL2kvTUR4NkI5Rnh5ZEFGNjdaOGZmVUUvcnNacmNxbHB1TkJlMlBweElPM1hpL0s1M3Rt > TzENCjdRcFZBSDFZTWFHZmVjVTMyYU0xc2k3L25jY2JiK0NpNHlMY1RPMGMyRWVVOGJwNzRJ > MVdSQjM2azlmRVQrYkc1MkdCMnF0a3M1NmgNCnBpTkpzWDRWellDN2dtT1NkdFE4VnhaK3VE > ZWluQUxCemNEejNEVWw4L1ZGM3ZlbDhPRUQ1UVRCK2pRb0NXZ3V1NVlYQ1lCdFBHV3ENCm44 > dlpTMWVsK0VJZ0JLQTBhTC9UTzZjeTZJNjJoQ0UxNXhkU1o4cG81R0xOeFFVYTFYTDR6cGJs > TThob1ozTmJwYlVtandaSWxxdU4NCm84SzNUUFU0ZVg5YTEwclFXN0F6UFBSS0dKMmJkUUdF > Zmh5YTdMUHlhZCtuOVlxei9FSzhFc2RQUWVMeDMyMWpSZUFLV01SN3NpSUkNClU4a21qT290 > Y21KbmZjUFB2UDdHRzM5Q1FBUmZnaVhoQzY5UTJqVGRXYmhMTlp4WlJHV1ZWOHJyOXptMkJE > Q0ZKeDJTOWZTeEgwQ0INCjJjeDFvamlDSWN5d3pKSk5PQzlZUUozR0VveVVaOEhUV2Z2a25D > azFHREVLV0RjQ0pSeXE0d1NUTWROZlRvMDBrdHpTK1BpMVpoM3gNClh3bUU2SElkM2t1QVp2 > dWR5OFBiMW5tQWNwNWVyYmRncks0Q2RRZS96OHNCSXZsaTFUTXF6Nk85RXZlV0tsZ3RnWDFZ > SWtYQ3dWd0UNCkVBRUlBQVlGQWxWN2t2c0FDZ2tRMFQvNE4wN0xlMEtIcWcvL1lQZjh0WWdZ > N0dmVlhhcWUvWGtJV0x0L0krNnExNk42UWVDVkQ3cnMNCjNFMkFmUGd3SklTNWdtVjRyem5o > ZFl3WUtlY2pWUmNqVDNqUCtEN05lVEp4Q2QvZ0lpYjVDcmRnTFpib0VveUNQWnhrdFlibjh4 > RTENCkVsM0lQWTdDejRCejEvejFZZWM4dVRyQUhtRDRXMHVhWEYzSzdYZTVtVU5STzBWY3dn > TmwvTmgxR284YnQ1L282TFdHU3ZFZzJQcnoNCmVVZDFvK3YyWUxqRW0xZGxJaDNYNHpnV010 > eUdYWCtPbVlzRmtOdDBuMWEySzA1RUlJYVZmV1hNbzErUXc0d2ptN25mM0hMaXJKUlANCmF1 > UFduVldSNWg0aVZGQVRoNWNSSmxwU2VZbE51RlgyM2VjbzlMY25vVlFveTZ3L0dwU2U1VlRh > UnZGanFhbk9haHpvbDdyWVpkUkwNCnlCTkJIYnB0WE1FcjFTZGdUMklXSHZBS1l3RkVwbklH > SGl3VnhIQ3E1SGpDNVM2Y2g5ZkhndzVrR0IrMDI1S0picytWKzhhUGxDYWcNCnB4eEFCVU1E > MkM4cFdscEI2emZHMUFyMEFqRlI0WWZlNGQ0dlA2QlNGOHAxMEpxSkMyallQV3E3ZnRnTStK > SEFhanZJYjdrbWNXRVkNCjEvNS9yTHhQSGh5OFdmNnhRYzhyZ2NGY0lBMDcwMktWaklQeGZw > a3N1eFJIYnRHWlZlK215eUh2ZktBTk4xR1lhSmtIY0crOVN6bFoNCk9CaE9mYUlJY2VyWXJQ > SmlYQnY2dnc3ejh0SjhTdHlUREpsMzNJNnlMSjQ1VkI2YWZDYTNuZ202Y3VTWVo5dUJSc3Nn > MUNGZUNHc0MNCjNMNzU3Vzg3c1JtNDVDYUFKSXdTaWlYckMvWGRKeG5pQWlIQ3dXSUVFQUVJ > QUF3RkFsVjdrb29GZ3dlR0g0QUFDZ2tReUMzTFFGTS8NClN6dFlDaEFBdkE2emFZRnR0cEF0 > LzRmNEs2enZ4d2owOVVMdU5FdFJNanBRSzhIZ0pFUXdqZXY0NjFsTXRza0RwckF2OXBGdUE5 > NWsNCk1yK0Y3NytQNE8rbHRySlRPNDFVQ3JOckhnU3NsbEVUTXkzeFVkUWtrSWZCWUFQRXVl > a2pxZXZRWXVTcEZ2TFlXVDd1d0paMWs4aDgNCmVCMVRhMnkvYnVuUER2dkZBSXBwTkxDVG9Y > djhlTXRsOVl4bVBWMzdpYWFGTjlkUHdKTDg5L0hBcUo4OVpnVElJSDhVTmU3VjNGT1INClpC > WGxWUUZUT1ZDNTJrYThEWGZZbTI3Mnd6blhINzllcjl4RXFIOWhxMzNieTlTQ0dvcWNwNkFk > a0NpcU85WlNnelR6eW1OYjhidkoNCmxZVjVxcFZWRDVJTEJDV0xCTjZORXQrRzRRR2NnT0NF > eUloREs3TGRDQlZMTDBVM28wenZ6Sno4NUZ4M2NKSXY0U3FiMTlCU1phNVcNCnNTNldKb3F0 > aUdKRUhRc2xVUjFOdmUxZlhhSDlVNE50T1FBYjJnM3FkdHMvTTdlb2N1aEdyOUdGdEpmaXNP > bG5QS1cxeUZWMnpuYUENCkF2SHlVMlQ2QkFEOWtaNTBwUjFCMkFwNkVvZm1GR1hINTZJZlFO > Um1XSEJ6Z3ZaRmhSWVBvUDFvaFkxU29xMlFPL054MFpMZHBpb0kNCmk1TlRZdW1WcURGVzBw > MEZ0SVM5T1U1dm9hL1NWY1ZpVGJ0SGpYRWRYc2F6OG01U21aV3FyNTVKZ2lHYkNYbkpkemRZ > M21YMGJuZTENCis2cDllZDNTTnFGT00ydm1ONThQZ2gwQUpKTWx4S0JEcEpVU05YeUtlUmxj > VEJEUERDNnFyd2NOL1oyN3FWNHJmL3RHSi9Kams4Q24NCm9SaUxUcnZDWGdRUUVRb0FCZ1VD > VjF4SE5RQUtDUkJSaFFsb2JINWVnclBLQVA5RXhLMlFFa3h5dDhyYkhGRHcxN0liK1FIMXlk > ZXUNCm52NmVRdlE1aE1XMWpBRDlHdEtkSlJ4dVBnOFNTTmhhRUxscm5ZNFAvb0dYTFNkakVM > VEZRWmZtcDQvQ3dGd0VFQUVJQUFZRkFsZGYNCkxPd0FDZ2tRU2wrNGc1dVVnYkwyN3dmOUVr > RFRQc211UTQ5dXVvdFl6M0c5Y29kRm8vQWw5RXcyVzFCcm5ZVDRGdWd3K0s2SDM2bXkNCmVF > RGhYQnE1enNsOTlUUG5hanoxbEZJbmZZbzN5TU5vNFZWNzEzRzZDMWdET0VWckJ4SmpXZHgx > RkNNTXhLS1RZaHRjbUo0bVoxU0wNCkQraFhFN2RmYVo2ZFl5T0pBY0ZtQzQ1MGhQZHAzODN3 > RkdDZjB2b3RlTFQ2aU5qK1Z4cHlVM0Q4Z3MzTzFyWXlaS3NYTkFpZzRFRnQNCjRQY3NsUGho > SkdlYmxFN3hnTzMxbXdDNmNldEFoSnMyT2FRVHRyVzI5VVFMejkxV2N5dnFoNzg2cTcwK1pq > NVU2c3U5Y0JBRFVnTEkNCnJ3RTh5ZDMxT2Uwd2l2b3hreWhlN1ZScjAxMldOUmlFVWtpbHRa > ZG1IdkVUSWpITnY5U28rekh6d3EwdGQ4TEFsd1FUQVFvQVFRSWINCkF3VUxDUWdIQXdVVkNn > a0lDd1VXQXdJQkFBSWVBUUlYZ0FJWkFSWWhCUGtYUExMRHF1cDZYSW9mQ1RYWGNidHVScGZQ > QlFKZmhlV1cNCkJRa1Ezc1lyQUFvSkVEWFhjYnR1UnBmUGZla0gvUmZKWG9BU01VVkpGUyt4 > UDU2MVVqY3BnN3RlL1NBTHZnRTNDbWxhUG4zR3pOV0gNClFzT2ErbExxWlJVS3FIdkgvTnJS > eWdua1RRK29QWjRpNUY5VGtYSSs4Z2dBSjVSOUNySVFTU256aHMvSnB5MTA2cDluN2pvSVNH > cVQNCnFpQUNXanJuRUV5cHJWelFEc0pvTkhvT0o4S2NFQU1iOFZNZUNNSUNPOS8ycFE0K2Iw > TmNEM1NUNDd5NWZwQ1dQUlN5TjVmMzZJM1QNClpNeTdrSENYYUNXU3ZSVnU3V3Bnd3dxVi9Z > cExlNWxacHNsanl1b3VnS3laN2lmZ1V4TGxTbXFzWDdwcEg3RzNtLzB3cFVwMitKWVENCmYy > QkdwZzhBcDN0b3pFNHNSZ1lzeGZPUWRUaUQ2Z01jZUZZek51TlZ1TGF2NzFCcC9TZVVHbTdl > TW13cWlNU2h6eWZDd0pjRUV3RUsNCkFFRUNHd01GQ3drSUJ3TUZGUW9KQ0FzRkZnTUNBUUFD > SGdFQ0Y0QUNHUUVXSVFUNUZ6eXl3NnJxZWx5S0h3azExM0c3YmthWHp3VUMNClcrWVM3Z1VK > RFQ3emd3QUtDUkExMTNHN2JrYVh6L2F6Qi85MyszSDErYTg4aEZlVURYMWY4RXVJeGJwQzZE > MmVQcHdqUDB5c1I5NlINCkY5bXkyM2tHNUpPaTJ2SExua09TNmFJYmVWeFdkZkdPVTJ6SXJi > WjRKYmE1VGM2QXc5SWZXcTN0dURwQXhSb3B0Mm55Vk83Wkl5QmsNCkd0WW4vcTN2cnlPUVlj > Mk1FWVk5S0NsOHdZdC9UT2FIajNkeTlYVjM4Zk42NE5oVDhtUVhTSG83TStuMGUrRTl5VlpH > M2VwTnBlZjkNCjJaTnJvalRNdm5nWHcwWUdCTlJPZ2o5dkpGZEp3bmhpbVlFbGJLTkpCbEZC > N25lNzZDcWhsYVRMMjNkSmhPS2FlRHhPV0NXaFQ0NjUNClpmWm9tZ3dMM1ZQQ3hpS3VaK3Zt > bHp5eXFFUDBEWmVwb09vbjRDT2hYeWlDenBFNHN5MXZCT1R3VWpad3BqV3FVT2VjbzV0ZHdz > QjkNCkJCTUJDZ0FuQlFKU2FZWnJBaHNEQlFrSlpnR0FCUXNKQ0FjREJSVUtDUWdMQlJZREFn > RUFBaDRCQWhlQUFBb0pFRFhYY2J0dVJwZlANCmRWa0gvakhCWERCZE5GbFlUWlR0Z2ZDQXAr > Rm1YSmZxQ2FMcE1yVlZ1bUhKNmozeW5nOUxhWGt4R042STFaVUplTmxPa3pCSDFCcXYNCnJi > YnR1S3JYNVpxSlltdU9ocmc3cHRSQy9JcCtTY1drOHRRZTJzN1ZZMWhIVW5FeDFtVFQrcDgw > OCtxMDBGbHFOK2QzWXQxVXZkckQNCm5rcVYvMTJDMVhHalA0Z3dMRC83WmlSb25zWGlmUkJK > a3dVWGtmdzBkdkcvaVRHM2g4RXdzbEVxMWc5Tm5neGF3NGxHSHNGZXpNU2YNCmJhNS9aODFY > Tzg2djBtdTlITHY4NkpYZlN6cVd3OHRxei9aTXcxQmNRc1Y1NFd0dDc5WnpHWHRVZStKSU1l > QWVodFV6ZlZKMkpmaWsNCjZGMEpCOFNpeXVBK1I3V0oxQzYyaFlRTkZOR1VHSmR3L3RGNmFt > U0E3dHJDd0Z3RUVBRUtBQVlGQWxkY1VVSUFDZ2tRNWZlOHk2TzkNCjNmZ0VrQWYvY1pSWU9R > ZE1FUDVPbzdmbjVUb3BvdzcyaVNOekFMV3E5VTFVNDdMa25DNmRZaW1vbXhYQUpsY1QrV1ZD > cHgzeTlreFoNCklJVHdIdDFkU1cwN1FJVE9CaUZJZHB5clZsQkRtUUZERWVkcHpQaW4wL0lq > SnBxRzRZMy9BekhFRTdDL3hjU1JCUDRhbVhoUjdQOEgNCnJGQjdLWnl6cXEvRWp3RGhRWHM1 > VDk2dnF4SmNMREhaMjVkWUQ5WVpSeG8zbmY4V253UUp2VUtSQ3ZOSGw0azJSSUI4R0xUY3pV > SFUNCm1HOGxTUjA1dGw1amc1RUJaRk9nTFZ6am1ZZGx6dU1NWEZNNk1VYngvYlVrbFNKb1px > Nm5TeHBqdWFlc3RTY3RQZVM5OU1EbURWREMNCkFTNHhEL2RrZ1RiNzdLVENYQ1V4WXBROTZ2 > T2xuQmdFektpK3R6clVDRlJ6YjhMQVhBUVNBUW9BQmdVQ1YxekQ5d0FLQ1JEY1pTTlUNCm1V > YkdPcXN5Qi8wZlU1MlVTWmkycmF2VldobzQyWVhFUkpWaHFWdkNadi91V3JHOU4wZzRmU2Qx > eFpid0pSRjdGZnB2S0VhcE5oZlgNCitkWHA3d2lwN1UxTG1yVnBySEUydmZTWG1vajIyRm1n > bWlJMTV3cWFJc0xKUVVRVkJSaVNFaDJORFVUTmZxT1pjZ2c3SGc1V1dvMFoNCjJXYTFsUkVU > TWZjZjZGVW8vREh4Y2ZmVXpNZysxTFpQTDZRL0lmMStTWDNsZSsyOWZBSmhHUEVGWG5SbWpU > bXJERldTbDlSNGxpbVgNCnZCRUFDSXJWaGJpeldXeW9oclEzL3plYnAyZVJFRmpQQjJXMEUr > eEFCallmbkhPK1RMUk5TOTE4SmVmaFlETDNqQXd6cFRqMHJmclMNCkFrR2VCQitqZUt2YTE4 > UjhBTjY3dmhCZDY5bWRiZ0dyR2hraG9LWkxSaGNTZWEwRXdzRmNCQkFCQ0FBR0JRSlhYRzY4 > QUFvSkVGRFoNCmkvMTR0WFVjVTdNUC8xclM4WmNZSW1uNTZnV1Zva2VkQnVoQ1drcmRyVHNx > YS9WbWFXaldMNEhXWS9NRWk0STR6VWhBVGJ4VHdoazANCkJveDRCZzkrWVRZWmZkT3hvMjZx > N0lFa0VLdFhpOGhLd1I3N21OMkFQNEYrQ0hTcXM2c1VtNjFmSGVRdUtXR0dTejhNSVhrT1g4 > M0sNCnFJZnpSdjZGMkQ1dldWVDFZdEpjOGtvWTh6OWhGeXcyajBqODJiNVpkR04xUlRmZnZr > Sk1aN08xdjhLaElCRnNHazZkU214MzB5cGwNCkEwSGJ0NUxLWHJiZ0ZyNFVqMTNWamdKL0JC > MC9yWStSa2dFSXBYRzVxWDNvZTZLTXlDYVdtOVJOYzJkUHZoT0UxSnhuZlN6L0gxVHUNClgz > QW1ZazVaQjBBcDRUKzQyOTZGRzE3QWo5dmJjT2FzR2R0WTJFUFNuWXdHTWpUVXpsL0RTZ3ZH > UDdMeFoxb0tDN2hXUEtIVUl1dEQNCjNXR21sNEJVL01sSlJQRjNHd1hIck15VDF4R0s1bytz > ZG9uMUI4NEVkclk5bXBFTFJvREg5TzRoWTBRVXZ2QmVDM0ZTbG1RYlZJSWQNCk5FSHNPT3dQ > UWVDSTBqSmNNOVBXUXY4eVFNekhVUGIxdmJTeG5tRlIrMnh2aElFTmROMWszNnhUV1YwNXpY > M295Y05EdnpIR3h6TnENCm51dVVNZk9EZWVYZUpKMDcrRHkwSk1iVWVTS2Y1S2tWNkk0YUZy > V0dOMHRkRTNETENsK0ZxTkRYMGhrVU5maURxTkc1ZHJDU0w3ZlMNCk1NNGZ0eGZnd3N3MU9s > d0lqdlV5c1dRZ2xLTlk1em9SeXpSVzRUTlJCaVZyM0luRy9qdjJRcFg2bnJVZHFsT1hHYXdx > L1F3b3YrOFUNCmU5TXhhbDlBdUQvRndzRmNCQkFCQ2dBR0JRSlhYRTk0QUFvSkVBY1RJcG1T > ZVM1K3JBTVArZ0tqNVdyRDNvVEVUVlhNZWpidkt4ZTQNCkNKdWNpbVRSUTJ4TnYwR2FDNDQv > ckwrWHF2d1UrTVR2dG9CcXFOZ2liMnQ2b0M1NDZ3cUlwZVJPV2hZcUFsYXNHSHVPRXlMd0c5 > c2oNCm40R0E4RnA4ZHBOM0JLaHN3eXd5UmhxVk4rdWx1OGpiN2VLOCt5T2VOK0dvYWR0TnFl > T3VndXdGMnVDSGRmV1hrRjA2WXhrNFVVQnQNCm9sTkhBcmkxVkJUbVlwYWUyT1YzWUtPeWlt > MkJvd3phdk1WZVZqZW9hdUdZenJ1WkVNUFV0bTRyb0xWM25aVEk4TGN1UVV3VlN3M0kNCnpu > K2hJOFphY1AxK0k5K2xwTnlYaG9KM2VFY2tST0xVSU4wdCt1T05oNE9qTWZ1b2VoQ2tINkZu > eCsrSnVnSy9iUkZqbEZOL2dIc0ENClozb3lxWFd5ODAyMlhXa1ZWak9zU2ZjUHc2TUpiRXhi > TkdFWDFEM3A2U0J6cVNva2lMV3hreFd2amIya1FsZUJ5RzduWEhWSC9KbncNCkFkWStMazly > ek1TTG9rNkJwaG53WXlRcnNmMitZU2lyM29nSWcxSCt4T1c1V055RWdzRWZMdzVyQ3N0U0Uy > bS9vUEM5UXc0RHNyVGoNClQ3cHJxbWxtRms0Q1Qrc3hhSEdRVWFja1A3cnRocGVXaEcybE5L > SGVIdytJNzVVS1J5cldxQXZFK0FvWkJKRkJnZmxZNFgvRFZnQ3gNClJSQTZqNmVlMTBQWDdT > ZWYwckQrWDB4NkVYQnpkK1p5WTBRSzg2bUs4YUIyRkFXOTErZExiVzlxd3pSVHc2Z0NnSWtz > TWJLZjdzbUYNClhjL1RtT2psZkJuK0FxYUg0ZWg3TXVrV3h2YW9pcWwwcTJjdEE3dSswWGFp > RXE0UktxN2N3c0ZjQkJNQkNBQUdCUUpYWEdaMEFBb0oNCkVJU0VhdTlrbmxRc3Vrd1Ard1Jt > RERCNGxUbnlEaitNcHgxbTdZbzExc2VIOGFVTmEvMlgyZnF5STEzanpZNmgrTVpESWxNLzZT > aFANCklHa0dDN1YwK29wS3ZIUXYxVXJ5UlBZMkQvZzdoOFFRbzRwVFpodWtNMjFVeGdGNTVS > dWkxK1lMcGJRK0o3VjNZclNLUVRIcEZRL3QNCkRpRXF2TWpCV2xmS3dvdkVld0VkSnR4Q1Mw > OG1nVnVnbVRYbFRGMXF6UTBHWTR0MnJrSzg2enBhaThtWTJuczRJc09RaDJ1TVBzenUNCm5L > bVpSSVhFSURDV1c2OWdqaDdqNmxmZm5CKzBNbGFGYk5aSVI3dTVEeitYczFkTFhsTjRQSlVq > NVdTcDhtb05rUVV0d0dBc0xjeS8NCkxsVVhJbld6d0hLUU9OdW5RTks3VDMwMWk4VjJCd1Jz > eGhWVW9KWmU4TkNlSFVhYmZoZisrNFNWb0NoR0lqSE9TTFBESURFOGJqNFgNCmQrWEFzTWJn > MHVOS1ZHakhqU3dyQ1ZRa0YzcXJWS01qQnRhV2hjRU5aNjNiMlRRbkFuWndLTkRBZzg4S1BY > aXRlUDhIbFFheXBRVVcNCm1WZ3ltTkVOTFpxTTdycEpEU0tvMGlXbFlxNGswQ1g1Q01aRkk5 > bTJyQ0NlOHlzRmd1RE5YUE5TRjVPdkU4RmN3M1BhMTF1ZjdSN2INCmJJM1J4aXZmcEtQcDBU > NU5BeVZhVEg1MkVSMklqcWFqUU1iL0RpQStseEpyd1RvS0hRSHVMZEtVTTZidTg2QW9pTk85 > QndJckhyOSsNCmhkVFFnUlEwRWluREdQcW42N253Z1pDQXNSUDEvcklwNWJWcFFJeXRseEk0 > c0xOZ3RsaHByZkJsTHdsMzRWcFJYcFlkU0llUkx5aFENCm5TR0VXdm5kRXhiZkdSMVh3bDRF > RUJFSUFBWUZBbGRwU3ZzQUNna1FURGZ5N3g0QThVeEx6QUQrTmRqOGZBdU1zSC9RVG4rYk9r > N1ANCmVUTW9WK01KTUNFODR2eWg2d2ZHY0NFQS8xNGpNT0JzQ2hRSTdldTZNMm1EblF5SVBr > QWhBQmVwbE1EekxrNitFVWx4d3NGY0JCQUINCkNBQUdCUUpYWnl4RUFBb0pFUEIydHY4K21D > Uk5FT29QL1JZaGtzSWJnMUdpellxWGsxNEZVSy80OEdybkJoOGZHU2NPWlJBUGJ2dGUNCkRX > R3d5T3RMZWF4b3FpaGhpeGN6SDQ5dmwvWVBCM2VNQzlsdUZvSFZzWUtzNXZrRk1iN1dUd3Ra > MWwwK29kS3hua2JhZVl5dlhmRTYNCkdBTFAzMmhrYmJDQjhZT0F6N0ROMTVlcWpGbG0xWDRO > ZWFoMmV5YmNYc0F3bVphRWVySTcyMXNpcy81STJaRWREMm5yWUxVdE92QWgNCmNRYTMvTE1m > ei81QjRHM3p2NnIvOWh4QlBWUUhla1lDVWFmUU1EeDFud1ovMHB6RWhlZFZkb1B4c1FqWTNT > V1FzTUNiamVFbEVVNTkNCkZVbDBQM2hEVWpzM1dLOStoWFV2bFJkZFc1YVVXTlN0TksyWjdS > R0lxRlFFWVg1T2IwU2U4TTRJSFphWWpDVlJ5bVpVc3V1dmtpak4NCmNkRmkyb09STDJSTUxu > M0dwVTN6NExPcmhEUGI2VTNSbWw0dXhmUVBnK0hGMmZGZDJTaGNwTnY1bEh6K1dNeEw4M2ZQ > Y2xpSTNyMWYNCjJKSWkvSXVpVEphVFBEOTJxaDU4Q3JxUm5RVld4a0EzdnpRMkllVE1hRWxJ > WE92NllrSW9od3daNkxHKzZPMVJiT0hHSGR3ZTd3T3ANCk5WWWF0L2ZMTkp0bi9UUlBIbFBr > RVdhNXAwRmlqZmt5djBLOHgrUGIzN0ltdmZaMVZ3M2FYMEwrVERxQjBxcnUzcDFKQUNoMnlM > bisNCmZoeEVucC9NSG9BNlZxOWowdlRkT1RVb2lxTzREUXJQUEV0NEZpV2JVV2tVeDArcys3 > TFpiTmpFNHZwS2ZtVEc0RmZXcE5UQlNTN0sNCk9mT0xLbjB5UmJOeXZLU0VxVDc1QkpmRUJw > YkYyanY4d3NDQUJCTUJDZ0FxQWhzREJRa0paZ0dBQlFzSkNBY0RCUlVLQ1FnTEJSWUQNCkFn > RUFBaDRCQWhlQUJRSlNhWXVvQWhrQkFBb0pFRFhYY2J0dVJwZlBYQ2dILzJPOW5hWFVFeHJ3 > cEhuTy9kMlQzbEhOVnJqTDNobFUNCmUvbjMreVo2WUs1bDBGMXZWbjh1SzNjMDNPRVRNUjlP > Lzc3bUJrMkhUdlAzOGIzbXVrT0gyQUpRQmpjamliZ21qUGlTR0syZ0piUHINClR4dG4rMGNk > dEx0MmJObmVJVGVTWHlCRk52MlNFVURCN3lUQ1VOMk54MldxYlVVT2pHSjFHc3I2MjRXTzRp > U3M1VHFkSXVUOEZZMnMNClJBMWhIR2lxdXBFZXNKdjExM0FpSHhPSG9KNEdOZ3hpQnNxNllW > Q0hFM3R4M2VaODI0ZTU2Sm51anViMnVkK1dWWEZvKzZRZU0yMXcNCkZ0em5XMll2aHRNT3hx > U2dISGpRdEFDRnhEcjc3VlBJVHU3MGt1QU83TzI3OFNTM0MrdHRLUlhYUW9FOExpVWdhYjZu > R3h0L0F6MEoNCmRkM1BycVRDd1Z3RUVBRUNBQVlGQWxkZllRc0FDZ2tRcU54aEtNT2c0UkFW > a3cvNUFUU01VMTR3cFFMVE1IWnEyR01BQUVDeG1FMnANCk1rMGpIQ0s1RXlXUWFlaGo1ZzB4 > dldjTmFiZENBYmhBNHpFb0xsNmpQeFQ4ZmRmbzg1eXgzYW4xU2JvbCtraVF2UFIzV3k5MVdI > Ty8NCm8yRVJ2TG00WVc4RE1QbXBrdWlpY3FWRHJvcEdxS1ZoZGQ1OEZnT1lYTzNOanY4OG9k > bDB5WWp1RWt2ZmlGSXJpeFB4WU50SDJ5T0kNCk95cnZoZURHenRyR3V6S2NYTkNpVHhBYUps > U1l2b0w1SEpwd28zWFFRakdMcmcyeWNjaElkVXZRNUtrZHVrcU9vYzAwRDJac04rTlYNCjFP > b1Bkc0hZYTI4OXFUMkpORU02SDZmQnRnOUFkb3FRU0ZmOHZwaVU4V0FBYmtoSjVXeFBaU2E2 > R1Q4NENRZWwyN2hCUGprU1hZVXMNCkJhZGhKVzlrMmhMMUhibGp0Ym5CM245RlRyMlg0Rzgv > Ti9BTDg0Q2IxQjhSc1RXNzRXVFpkU2VEQmhjanNqVTZSTnZHanUxNjliOHoNCjBEV0ZScVlm > bFVIZHp3MEM4eHJXaE5rODRzWGliV2IxeVd3RlcrSnVpd2NUZ0M0eE1PQ0o5N21QSHVFU09D > WlRDNXY2TklOU0g2RWQNCjNsK2tpYTJsN2hWYkZ5UnA1Zk9mY1VvcnJ4SmRETTRuOFU5akM4 > b2lZL3dFSzg1Tk1YNEZ5bGpUYVpYVXRsRzMwd2kxOWJXa0RRWE4NCnZPUkIwclB3Rytmd01Q > Nk9CQTM5aXV5S1RHR29OM3gxc0tnSkJzdk50YTF5SVlrb0NCUklmOFppLzc0djNNZjgxclNz > YUtXYXpPZkENCng5WS9LSXVwaS9QU3dKNnYzbkg1T2krWXhwb2M3dVhFZFlSY3pFNjRkQVBF > cWFYQ3dJQUVFd0VLQUNvQ0d3TUZDd2tJQndNRkZRb0oNCkNBc0ZGZ01DQVFBQ0hnRUNGNEFD > R1FFRkFscm96aUlGQ1FwZ2V6Y0FDZ2tRTmRkeHUyNUdsOC84YVFmL1cvMUZpRDI0bm1OU0hp > TGgNCnhkcWNtRHhPeDhyWklkeDFiTVRBTkJlVEd0Z0dFTEYyV1hpalNscXhlMFQ4ZzhnOEZK > SlN4eVpJWnBOeEh3cFFXeDhYOVBKRENKdGINCjFnaVViWU1ZblBaSjJQMjgyQm9saktSNDRO > M0VuZFYzNjJCOVdycldLazJRSXc4Q0pJRG8xSFVmLzAyNStGZCtyR084dG84L3BIVEYNClZy > eXVkMU45bW1hb3NBV3dwK0F6M3RjRW1YRkxOZTVsZjlMbVhTS0JuWSsrQWRhS3pRUDlLY3Vi > eDJLT2gzR3dUYUdrZktTa1MzK1YNCldUVWJNYWhpRElVN25NZUVpVm5CNmJrUVZtTXJ5VWhj > OEw4WFN1R1ErR0txSEpCUmoxYlRsNUxWVEdvdlhzYXk3ejl4dSszeWpMdkENCnlPbytFRVZP > TUFuckp4N2lIMFR4YnMwZ1FuSjVZVzRnUkhKbGQyVnllU0E4WW5KNVlXNUFjMmhoZEc5M0xt > NWxkRDdDVEFRVEVRSUENCkRBVUNVbXZkblFXREI0WWZnQUFLQ1JCaDJIYkJSQW96MHIxOUFK > OXpMeURVeUtBSjdIOXJRNVRiZ1laVGkxak9CUUNjQ1ZuTTVvdjkNCnMvSnE4ZzJjNzZGZTBz > bnVkQnZDd0Z3RUVBRUNBQVlGQWxKcjZYSUFDZ2tROWM5aXN5QjdHNkVVdEFmK0lBTnhpa25X > ZWZZYUpJQ0wNCi9yZjVDOXVRRnhPUnBGMkJITjlZWXdjdlRDMjgxdUNsV3pqcUovakhWU2lT > bjUyK245MzlDNXdtSmhkdzBOc2pVTzFJYTRSWm02UW4NClRVK0tCbmtubExtSWxIUVZvSnIx > aVJaWDlrb3NMOFEwTjJwU2k1VDdhNzNXVER3VVcxZE93K29vMms4WVh1Q0xselEzQjJOVlYv > dngNCnYvU2lSNGp3RUxNWHVMV3FEbmZyWDZWdXNhNm1rVEc0K0d6R1ExNEpwK1FmbE1HMlNt > djg1N3hiQUpoREdJYzZLU2pBa3VGaFVUUWUNCmRYc2dMbWNVRUo3ZStZSXNlMGFXSHBVWUkr > Yk96S2dqRTE2eUhIZTlzcmVnSVRSWEFjYkVBSkNnSDJPaXhmOEpJYklNV28zTklsYnkNClZw > OEUvUVdLMDlBcFFkbjZmbk93bThMQVlBUVFBUW9BQ2dVQ1Vtdm5kQU1GQVhnQUNna1FVazhN > TjZDNVJxTkNGZ2YvVU9NSFZJdjUNCmg5UkJzMFJNZUUrdmNGZERGeEdhcjVHaUtSM3FoQ0ha > Mms3VzNIY3J3cW15SVlKbk1EcXZYK3ZDSlVLOUI3YjlNekJXRExYTUhWVTcNClNvYU9XalJT > aWVTVVVuRTZrWDFkYnArdGtZZmsyUnlwMlZxNno1K3cwL2hZVStQWWU2TWwvYmNKNml4bkV6 > Uk9hNmFEL0lNc2JOZXINCjFYVzNrdjNtQ3NDL2tQRjkyeUdyVGlqMHRXcGd5YmZvbVNDMWwz > Z3p4enU0QklXRFBXTUVQZjBRKzQ3ZWttVUN3Q2N5STZlNm1sRTgNClM4QVI1VEJPUHRETVZP > SDg3TUh1NU1rZjlwMmJzUEgzeHgrL2ZsVkMybFJQK1BsTkU4MXhmTC9GM0tYQXkxSVRSNGNp > N1ZRMCtQQngNCjFTZExLWU5Rak0yZ0xlbHJkcTVCdDNIWHBMMXFjTUxCWEFRUUFRb0FCZ1VD > VW02SU9BQUtDUkEzemZzbkpYWGtnRjRFRC80cytoMFYNCldoQ3VWV2xyc2hMOWNWdEJJUjMw > bk1mdmVNQkM4RkVJOE5wM2VDd2svQ1l2NjdCTVJ2YTl3eGVzWmlDRWhiL01qcXg1VUt0T1J5 > STENCnc3RmdSZURCZEQwZzJmdmFUYXY5Ny9sMDB5NkpRUnVRL2duQUpaUU1qMkFaU1BVY29K > dWg4U00xdmd5dmNpdDVmb0ZNdDZUampBTEMNCnRoQmxXNkJKeVc5M2ZlbnY0Vkw3cUlNMmZo > TDFVaG5lZ09UUHF2bXpOb3BhTHE4MC9pRHBhbjg3K1B0c0VwMDRyemY1c0Y4NCtFbWgNCitI > enQzSEorYTVhNkRGZDMxVS9Cc2h0cUp1cnZ4MGtXd3huMCtDOE1qdHFZZFhnS1pYNnliYzVO > RUhOcmFpMDgvcmp2dFVrMEhhS20NClc4alZJWGNsaUI5R3Mva1MrQityRnBPc2QrVUpkeksr > Z09OeHRobzZlRWsyV3lBbmc4NlZMV3RSN0p6NHhiQUFQemt0alB4VmYxOHINCnZMd2Jpd0pp > bERlVjlXYTQwWXdRQ3BZZlE1QXlFdXNQZXlnK2YxVjRQcVpGN0ZibG9yaDRnRVJXT1A0dS83 > RERkbzM0NzdnQmVvY0sNCnhlZU5rNzBiTGFLQWlXcDI5bVBGdUFBWjJuNkI4UjcrZzVTUU91 > dy85MUNNc1I1OXZtU2xmWDYxRUI5c2QzOFdmNGw3azNRRHZISDENCmtrc3pnZytDT3I3bnBm > VnphWlR3eFFNNkcvTWRNWHZrSnJJQW84eHNOczVtSlp0U3RXTFBPVFZlcnJ6UC82RHZ1b0Mw > YmFUUFhOTUUNClhRekliNDVDNWN4bXNaZC9vb0tIa3VUU2FzbjIzNkMzRE03akxkNmNUZ2Nn > OTlYbk12Qm5XZHdORmZmUWdid1hOM1g5UmNMQVhBUVENCkFRSUFCZ1VDVW5DR3F3QUtDUkRa > TnhDWHBIUEprR0hKQ0FDbTArY1U2R0IrZExjUDZlRVRmeHBrcmxsU3dFbGNJNGxxekxZSUNq > ODENCkpOUkFXTlcwcVJQYzJHejBQVytFUVVDMzZIOXlhZWxqd2pRUHRIZ1p0ZU15TkdEYXVB > R0lJVFdWdmFuKzNWQmkxa2tXbm9NSWtRUTcNCllxSWJMY2NlVGxKT0krUVZ3WnhHMWpTbTU0 > UEJZTkZGaGF5K3poQ1JpMUNoWUVHMStrMG5wV3ZkWW9RV2ZoZ2xIOW9vWlp5TmI1UngNCkU2 > M0dGRHZBVUJKbjVnN2paREpPdmdMZndIS2hVNEpsKzhzRHFKejhNQXhnYzJRZGM3cXByQ2xj > Vm5abUhERDh4MXd5YTZWUVB5NXgNCms4eW9CMDV5bENyNEh3bENWVmI2SmJnQng5QnB2YzVI > ZDAwd3ZJM2kzZGljRmpmRko2TDJGQlJqVWtraWphSzdLR09RSVZUTndzRGMNCkJCSUJBZ0FH > QlFKVUhGQVBBQW9KRUk4TzY4UjdSeGJKRlZRTUFMNEFNWjZ5d0o4cEMzdFFhc3pmTHcvM1lZ > RUVJcjRSWmYzQXVpMncNCkJsQjdqUitLOGJFc1BIdmJ5WTBYWnRVQ1RLcHN0UVB3WURtelBE > RHhPcHEwRHgrZkNhbEUyT1VlWEdSajJCeG4wNVRDZ0VmbFk3aXANCmdWN0poTXRVQkw2WGdZ > cGJ4aUtBK3JPbTV4YVZPQUVwSjdxaEhuSENaSkFCS3QxcC9xWXNPV1lGOEdCM1p4M0pFMjVB > NGl6TkVvQlcNCmdpYTl0OWlhVXhXUmRieDdHTll5cFhaNFZQV1I4ZWV4K3ViNU5oajAzenRK > WlVzc0czdjNsYWN1SVJucDFCVGdTVnVZbjdDa04zcnYNCm92N3RaZHhSYjUyVEhPZ014TG5l > V0tXdHQydW44ZlV0bWhCVVJuMjZnbk14SWY1MGlaaWNlOEhyRk96VnBiSks0dURYZi9tNUN4 > VFgNClA1T2JxcWNPWWdNcmxjL1M2bjFEelYyNWZBdXRFUGh0azFqRWU3dlJjdldwM2U3S3lH > eFJVa2JFZ1owNUVTZzNwcW51ZUVmb3ZwYloNClRObnltcWdwOG10NlB3ZWU0dTcyVnpoNGJJ > WTJleWkrdy9ERTlUUmhDWWtQOFNCVmpMTGF5cGtpUnVQWm56V1hLUlRqTFVPajdzeVkNCnha > WUNNcjd5MGNZZFZraUs1Y0xBWEFRUUFRZ0FCZ1VDVlh1Y3JRQUtDUkExMXBjSjdJQ2VCSXUw > Qi8wZjVPVGNQZXZGcDVjV3lJYkINCkYrcXVwdFdiRkhJbjgxVUZRL0lHTytFajF1dDZ2NXNP > M1VkUDF1ZGJXUmNTOXR2QXJBYzB5bFBBWW05NTVhcENtSUU1TytUbUR5M1QNCjZZSWRyRjRD > VHdzNG1BYmV2WHIxSlNmQ0k4V3VhT1dmMk53U0p1VkNPYmVlQ2w4d1NFaUl5Vm1tRGI5UjRN > eXRYSUFqVGtmZWxUZ3YNClAwNE1SSU13dUg5NjM5TVlIYWQ2RW5pQmlYeUxNbURmazE0QS9U > QVZwd1JGaEM3Y2owZy9VU1BTMnVYa3VqZkFWV3YvL0t6eE9POGQNCm9DUnRiV3cwa2VGNkY4 > MWFTVVF5RDNWbmI4VWVGeGlEZGhYcHBxMVZ5YkRINVl1NThYQ0M3YTNKa2RhTzBHV1ROMmxL > WXo1WlM2emMNClJWQm1yTk5DQXRSTU5zNVlqa1lud3NGY0JCQUJDQUFHQlFKVmU1SlhBQW9K > RU5RL2ZCTVFmK3B2dURBUC9SUUNxL2tNVWVEUWxjTEUNCjNpTFBOdFYwQ1N3a0EvRlp0aDZl > enRvMXRpQUZ2OEQ4cFNqMDQ2TGZPZTFlUmVDMjNlRU10bVJXa0tmMVlKQ20vS1REUFNwWDkx > eDANCjNsNU5jUzFFN2ZsaCtRZmRlOGlRdW1SNmFuSW9GN3BjNG5ZQUVxM2Fwcm91WmJOS0FG > QlpkNDFBajdQZTN5dDR2OGJSVG9SZWdudEgNCnMvWkljTURwbzFZQlprVkNkM1c0MEhMM3Az > SXNhR09zS05vMFhkaVB1K1lhVXd2OVZLSUJoZWdvS2o3RXlvWjUzRVBBVjJRN0tCcXANClZE > NmxqMUJ5VDBjdERTWnFrKzRUaVBrUkVXTXVCcDZhd0RMNFdZRVozVndDeEFYbWI2bUZ6Nm1S > ZU5sWExjMWpOUDJmN0xQc3dsTk8NClUxbUpITENqU0JEdkdXMGxVYXRhYnRCZ0pMRnp2MDI0 > UGo3eDhvTlY2YTBnSVRqWE5teWhCUUZoWFl6QjB4d0ZYMWNzWE0zbm1tU3INCjQ1ZDBxelVL > UXdOQlk5VmVYRXpQazN3VVlQaHRMSkIzTkpkcXhxbk1sSnlaU2JZRUhndzkvdk1YK1dGNFpt > V09PaVdoOVEwTVJKV0ENCnFyWXMzdm5mdGtLbS9VUFhna0xUYWN2c0FGeENSWmh6bG50UkRE > b3B2T2J1SUhvdWdwZCt1TkhTL1A4NHJGTmVMQUttYUROeE1TRVgNCkRYdzNKaEpETXJBMTJa > cllzc3BTbkYvUnRwMlc4UlE5c3k4RUpHaXBaTEtROG85TGdBRnpKQkhVaTFzMFV2cjlzT0k4 > TG5ibS9lUEENCkYzSGVwK3d4bHpFWjdBdEU1bGcvVDhRWi9CNUlNUVRZVDBBaUJqMUFlZHZw > RkZSa1M1RGhGUXFGNFRhQ3dzRmNCQkFCQ0FBR0JRSlYNCmU1TUFBQW9KRU5FLytEZE95M3RD > TzJFUC8xRnlRcDV6Y0JrZFNKUkE3NHhOVEw1Z1B5WVZXdjhEeE1MNi9oVS9IMUp2QXZZL2xE > SGsNCnpaK0hrVWJYRUcwZ3FJNW9GdXZPaUNYcFVobGJNbG5HcXJXbDRQQW5kMXFLVTN0bmlK > UDRRaHh4VldEOW03VlBwaUJoYjZ3R2RBT3ANCjJmMU5uKzYrZUxTN3YvSU1BMjlDRWRXMit3 > SHNxeG5WTEo5S1lNZ0N4NTl2YjJxRVMrcU9TZ2grS1hYN0ZpYTJGWHlwanBrejg3UnkNCnlN > dFBGcnd5LzhzdWZ4QWhZODlxSW1QWi9aQVg2Q0FaR2piNFVBbnVlWTdVTG1xdStHVDRIRjdx > SHg1RUU0b3c1TURTb2NPZGE0RmYNCmZDTFd3VDZja0lhRStRUEtEMVB0b3g2c1RhZ1AyaWxo > V2ZRdWJTMDQrbTJiZkFCUkhHUUVSUkhyUnhmTUdZY2pwZzNQNUVaSlp5eWoNCkVEcWdsaVRp > aFdMUDVTRUg5QXl2Nmw5OFpRL2ljSUd1ek1mTVlvdFIvQ0VUK3lRRDVUVGUrYU1aOEdyVUly > ZXNCMkxjaEk4cDJ4cFkNCmhlVC94dXd1cnN6c2RrS3pROVE5ZTMrYURDbG5lZjlNUFZzTFIz > cXFPcG1DbDdQb1dQcHNlTTVneFRPWDBLRER6NVdYRmNURmRFKzYNClFaQVBWZ0hwQmY3KzAz > R0pRYUhMZjFaVVJHUGZ1RjFnWWNWeXVndGQ0MndMTm5zUGxUemJqVkl2aENJVEt0aE80NXU5 > ZjdLajRwc2INCnhPUXYwZjUwc09aZnVoWGZHd1l1bElXeVQ5dHdYdFZWV2VhdkpjSnF3d0Nm > K2ZNUVdvbW5aemtGZndPYjFLb2NiU1RnaEYreTNTbXoNCjF6L0h5YVBxR2ZqZklLV2k1eHJG > SjlWYXdzRmlCQkFCQ0FBTUJRSlZlNUtLQllNSGhoK0FBQW9KRU1ndHkwQlRQMHM3d2NZUC8y > RkwNCjBRM1JRdXVZT3VUQXg1NlJWd0FlS3lBeldBMGNIc1ZZcExmekY3VWRRUkFLNFM3RGt3 > enZDbmpPbjFCZnA0bUFyNTdSNkM0WnNubGkNCjBJTmpHNXY5T2V4bEUzeFk0eGZqQ0tJbmE3 > SXVqN0ZXQmp3OFlTODVlc1kxd3N5VmgyZGN0UUVpWWMvUUFZUE5zSnlTUkZpMGJleEcNClgv > cDgxV0V6empLVXpCOUMrODhKNHVkaWQwRFFTOVVLeGFCTG5ScmlnbkFOSC9HTjc1S3kydTN2 > ZGJiZnFTb1RpS3E0dUtTYVRuSTcNCk1Kd3VuVUtqWWtjSnkwSlhiK0owVjhxaElyL1hWb0NT > MDA2dlI5b0RvOUZRTXlPZ1VYbFltbTRZS3ZTL1U1aWREb2VxdkZXRTMyYnQNCmZHZGdoYjcr > ZnEvOHZObVBDcFkyTUlSNUtFbGtmRmQ1SzVxTmNqbHZGZmtNVkd0R3RxbDlhQkdVb3hOQnVM > WVhQc2M4cmpFOXh1VHcNCmF2VWFaU0RhNk5vTXFBNXU0TnhVNlV4Yld0bnUxeWgzR1lMcUQ4 > SVBxK3hsOExqbkl2eWUvNndJQS9zeUdLV3ZXSk1DeDA3YUtTRGoNClkxR1htRnh5VWNrRDRy > NG5ZSUt5SWJlVTh4ZDNSYSt1OXMvNUM3N3lhOWpudEw0Nk9SU25laW51OE1mTDVZQjh2c0tz > TmNETlhCSjANCk05SHBJT2lVM29DSVplMkp1U1o0VFZaTFJCOThDRk1sTjRYRmF4QSt4V2dS > ZG9QWGdnZHVtK3NHSXFiWmZmTFI4bk15TWZjU005ZXINCmE2cWY5cUhLMVBadUJVN1pSbWJh > S3pMMk1WbTZLaE5VTXptQ1N0U1FiOWVNS2FNZGVVYmk4ZmhMenlQdUNaVGxucFE0cGo5WXdz > Q1UNCkJCTUJDZ0ErQWhzREJRc0pDQWNEQlJVS0NRZ0xCUllEQWdFQUFoNEJBaGVBRmlFRStS > Yzhzc09xNm5wY2loOEpOZGR4dTI1R2w4OEYNCkFsK0Y1Wm9GQ1JEZXhpc0FDZ2tRTmRkeHUy > NUdsOCt4WHdmK0tkSHFnZjh3S3doa1lYR1FTbFZhazJHTlVhQ2E1ZWM2Y0xRUzM0VWgNCnVp > blY4Q1hyNytCenV5THp4UThadDFJeUNqRUphMVM4d0JZR0dRL2RDNGpIRXFpdE5iTVVkc3RG > dllGcEVmM0pycnUwTVJGNVRuK1INCmxnSisxVWZaSE81endreUFyUVhGVEJCeURsdGJRaGl1 > N3J1OHNTQllScHhhaDFocjlwcG9PM09ZanIxQ296L1pYMVAxL29hMlIzanUNClhvZnl6UzB1 > emRKczRUL3Jzdi9EbElvcjJwd2JvVE5ucHhsU0RtcURNeHhEZFd5RVFTa2kwZ0JuT3ZYSjEy > MytmMDFOVjlFUXVXTzYNCkg0eGhLOXFvOG9jNWV0bW02R3dVVmxKeVhJeHdGY0ZIR0phZVA1 > dFMxSlVWS0cxcnFONTNEZjE3MzVFNUptMmVITWh4eWV4SXBzTEENCmxBUVRBUW9BUGdJYkF3 > VUxDUWdIQXdVVkNna0lDd1VXQXdJQkFBSWVBUUlYZ0JZaEJQa1hQTExEcXVwNlhJb2ZDVFhY > Y2J0dVJwZlANCkJRSmI1aEw0QlFrTlB2T0RBQW9KRURYWGNidHVScGZQUExZSC8wbzZZZHV3 > SEZVamZHVi84bWhsYW8vVEtwaTYwSUF2M1VjOFhONTkNCkQ2dkdyVEl1N0VEK0hDd01jQncw > MFZZc3MwSGZpUDVxQU1RQmFmbTFQUlRkOGtyODA4YXVmeFljNkNoTHRDWldyYitDZjZWTGhS > ZWcNCjhYcG9aa2h4ZzRudE1OVWFsSFBMOXZHWjNTTUNQMTIxNlFJTUY4SWM5RXRrUENBdzJK > SXphdTl1V0NWdVIvZVhCZ3NWVS93ZjlTMVANCmdiN0tnMTZoM2NjeGwxMU9QbzhkNVFLSmhl > czRXbUxhR25pM1JqTkVIU2FWRGtEZHgydDQ1Wk52ZXVFaVBYaDFxY3JtSXB4bkh1L0YNCjJt > UUs2SnRZSXdzYjhlNzB6cVZZaVd1bFZZa09ycWVMeWF5NDZZNGRONis5Vk53cStndXlpK0VP > WlNqbWJEanBDR1g4WVp6RFh4YkMNCndGd0VFQUVLQUFZRkFsZGNVVUlBQ2drUTVmZTh5Nk85 > M2ZpUGZnZi9jL1VHOWNCMmNvMW54UnhBK2NBYzdybmRLRklZdElNb3lsbjUNCllYclZTdklQ > aTQ0MnNzTkxCeDF6WmhucXZOaXVxemZiRncvUFdHdTg5VmdNamJVbTc2cFdIVnprK2trbVVw > WDlNTGJDa3lyY0p2R1UNCmNVZTEzSnJsajFNWk9mT2lsQmhFVng5WmFBL3d3WkdzTGhkbFNT > blc1ODhYMnVmVzNUWmV5cG0vU2tkSW9ibmI4dGFiTm1OZVdvVmcNCktLWW0vK1Z1d3Q3ZjFX > RnBoVi85RFpJOGhDM0ZOSFp1a0EwVksrZmUzL1Z3ZVpEVlZyQTk0V0NKUlh3R2pDcXU5VGRU > N0lhQ0duQTcNCnM1YVVWdXFJU21ENGpjYkczaDZmUm1WaW91dlpWUjR3bE9sVFBzTk5BVmh1 > VkZzM3ZCYzVxRFRRLzdoQ1JWZk4zRXBiK0xiTmVoMXANCmdjTEJYQVFUQVFnQUJnVUNWMXht > ZFFBS0NSQ0VoR3J2Wko1VUxLUVpFQUNhbm5qZGRIeGlUYzE3QVRQREJYd1pzTXpmdU9icXpK > OUUNCjRmNkYwWUVIR1ZQQ2Z0bVlXMmpqZVd4SE82QXc1ZStBTm0wN2kySHdkNEVqbkg4YUdL > RFEwemtsV3dWUjNkY1kxMGM4N3RrWHJuRkwNCjJpZFV1WllyK2NJeUZGVEZrUE4wRjAxSmY4 > VTFYeTNrcllNRVJzMWx4bWY3U0h5anltMWlEVjhNcGlzRE4rL2Nvdk41SXdJVS9iaWYNClRy > WkRJbkxNM2QrTmlmU0VLYnFOK2JVQzJESHM5TE9DdDJUMGJxNjMyTG9SMU9URWZyTzZ6WXh5 > Qmdha3lMUmFjZkYyUXN4NWdOelYNCmhESEZaU2RHdWwySnVyN1RzZFVaREdIcStRY09mTVlq > RUxtMUpFZ3dvaFVMaXBCZUdMaXdyVnd4QnhBVFdFM2p6MVdDWGJzRldXN0ENCjVrcU01eGM4 > QmRsdy9rLy9pNUNUQTFvWGF6Q2VWUTcwT242bnI4WlZrMkhPTXl6bFJGVC9uaForOEdHSCty > a0tkRG9ETkRzWTJWMkQNCk5kWVc4aXZUQkFrczZERC9ycEMyaEpoNlZETTgwMDYzTzdHcGJS > QXF5OGpZZ1gzaGgvaDlaZ01VZ3dGTmt2b28zeFdodVdiV0lwQTINClBUT2x6VUZValA4Nldh > WURLblZCWm10ZWovUzhuSDdML3hSUVc5OUsrSjNkUjMvNGlqQjIzRGlsNVZmOG1KMXR2Vno1 > V0Z1UFE3RlANCnJIZDBTWUdDdno2b2NmSVVBd1RZZWozMXdXbWRaNHE1SUxPcXY2RXE0K0dN > UE1acW1vK1VyMEdiWkVtVzhpOW90bFF1T292TXZjUHMNCjJBbEhxUW9uWlJ1dGRMazc1dmxm > S0dXbXpYQmpGVkpBMURXSy9zMHJTY0plQkJBUkNBQUdCUUpYYVVyN0FBb0pFRXczOHU4ZUFQ > Rk0NCmxiSUJBSm95SzBSRFlIQWhjVXBQMUhsMEFJbW9vR2FKeUIzSWw2RWxVWEIxUzgyVUFR > Q2k4ZkdtSWxrSmJVSDNVWHRBYXBMWEFIQ3ANCllEd3pXWnF2SDM1eHlUVFVoc0xCWEFRUUFR > Z0FCZ1VDVjJjc1JBQUtDUkR3ZHJiL1BwZ2tUVm5LRC85bmVvM0x6cWJ0Z0JXbDl2U2QNClJ1 > dFdkUjNsbVBocC8zaksyYXpsU0hJMys5NTBqclRRVmd4SWFiQ1RiWmlKYzYxdE9mdXBVZmow > UllWTUJSdHZTUCtZSUJCUmJhTzcNCmdXekh2Qzg5UUEvdmhBdlErakMxTXM3ZzhaNEN0NFBC > MXNDdXJjMC95KzRZOHhUcldlSmVNaHpvMXhuNHJjVjJYRE1wcllOWm1vV1kNCmZibjhJWWlr > Sm1CalhRRHlUTjIxb1IrUHRpZ1VhR3QxTGpUZDZyQU8weWg3VFJLSDYySUViZ3Y2QkFCNHBP > MWpDY1RXWUNxUk44aXgNCnZTaGF0eWZaUU9qWk85U2UvQmtkRHdVUENxeWtYT2lvVElPV2lN > K3I5eU5FWWI4bVVReUtFb2thTWVkR09pQU00UFhjYmRwdHRXYzkNCjJOVnExa3lRNWZOSUZE > SjJQOEQ1cGUyRSt6ZmJVeHNUOGlyVWxHTlF1b0ZxTVNiYjZKTWl4ZnBJeW1vQ1BMcWVDdkl2 > dzJtbXdjeWgNCkJLZGZRbnV1RkxrZ3g5ZTVKWExVQ0czTzk5RTlzMXJseDl0WGw4QTVkc1pP > UWloU1BJSVRkd3ZGRUVYZEZmVFB4K2M3Y2VEcEZDcFoNCnFQdDJBVWp4TmxtTHUvbTFlTWZZ > NkkvV0czanovVmtwQXdNOGIrZFgxVXEvSmJZQXlPdjl0OFJvZ2pnSmtITmt0dnZMZHNKN3lm > K0INCjVqSXRBL21EcnVpaTN1dk8wYmRBM2JrU3pxTjRpTEk5QmU3YjUwSTZlNHRJN1hjOWl0 > b0daRkRmaG9Hc3lsUko5VWFtQUd4dWNGdCsNCmlZMnREQXJMR2lQMlEvUWFuY09mdjVTSytC > YnZtVmNyMlRNMDIrbUsyYzZlVEwxNGxGRmZRdmVVaXNMQWZRUVRBUW9BSndVQ1VtbUwNCkF3 > SWJBd1VKQ1dZQmdBVUxDUWdIQXdVVkNna0lDd1VXQXdJQkFBSWVBUUlYZ0FBS0NSQTExM0c3 > YmthWHp4QVVCLzR3K01YZUxTakwNClVESmxNam9jOWpUWmVJOGhBWTlDWklnTFZyb0l0anMy > Q2dVRUZzeGVVWVJ1WkVkM3JUdzNXblNzcS9acTIrUHo5OC8wS0IvRkNleGoNCktrcWd2emxX > Yk15dVQ3Z1VscmJNUGdscU5ISFprQlQ3OW1iSXhTdkR3OWRwUEFma1o4Y2xUVGpwSVY4VGpP > V0lMM3hFZmJ4QkdJY2UNClBBWW42ZzUrS0FkUjk3V0hHQVRuUldrU3BJZVpoeG1RNmY3RytZ > NWlTWlFzVXNwdWxtcDk5UlhsNERTRDhOdFdmM2VIRUpiWmhkU00NCktDbjluRGx6UVIrS2JN > bDBMc0FrdUdvbm1EOXFZWGx1REtmWVJFK3pSdkgvdUNrNGNZVUlVY0ZlcGhOWlpiR0d2M2Mw > RytDTEJlSFENCk1XOWN4dEoxRTI2Uk9DVEorczdoa25PalJWc2l3c0I5QkJNQkNnQW5BaHNE > QlFzSkNBY0RCUlVLQ1FnTEJSWURBZ0VBQWg0QkFoZUENCkJRSmE2TTRuQlFrS1lIczNBQW9K > RURYWGNidHVScGZQYTRRSC8zOTVZL3JRbnlBS2VwV1plaXQxYTk2OEgwOFRtSXlLOXhrVml6 > UDkNCnVBRXpQK2JBcEY1QytUSlZ4UmJjcEM1c3NSSEkwaGpKYkhXeXlYeStXYkZTQWlaMUV4 > cWJ6UkpNVFQxWTJRVjRoR1lFN1Vwc1NqcEoNClRIdnFnODNhWFpJV3lRWCtDZHhjQ0dDYlNV > VHZBdWE0S05kMmVIeU5WSUpFb3hYZDJzVnJmU3dmM0ZodGo3Q1gvMHB4NFdldk02VHkNCmp6 > WHIvWnIrOFNSbGRkd0lWTGVSNC9DMU9IRFZGTnV5cm0vaGR2ZGg5eUJqR3NENm9xbkx0MkE0 > Tm1ybDkrRjgwR2hkM2MvOFRUUEUNCkpReCtObVJWNVRRQ2MxcUR1TG5kSXpWbkpmR1lxN21U > VjR2U1ZnUzNhbFdnMUFGZHZZdWp4MVpubFlianNFUzF2MWFGMzRPVk5Qek8NCndFMEVVbW1H > YXdFSUFLSlVVOStRMTlvVzFSSzVqVGYzbTU2aitzekljOFk5RGFMQzhSRVVLbDRVWkpCS0Jx > Q2w2YzBjdWtWQXBPRDkNCjJYb1U2aEpQbTJyTEV5cC9JY1ljUFBOVG5WdThEOGg5b2FnMkw4 > RWlGTjcrMmhrMHhHK2x3amM4dU9JWnljbWU3QUlKc0JVNEFaMXYNCjYzbHhtMmsxMDRod3Bp > YXRnYmU3MUdJR2w3cDFNWDZvdXNQL3dHelhDT0YyNUR4OXcwMkNlUmU3ekVNZmhuRmpTVWh6 > ZENDOWhhbjINCitLYVZCN3FJcU5SM2I4TmZid1JObHdQbUhxbGhYZmZVb3c5T3NRalNuVEs4 > V0tOUmx4N3h6VmNjWEl2V1Ayd0VDRnJtcW16TW1YcFMNCnJtSXVpV0VwRndaOXgyYTBQdmE4 > ZENOUmlDVlRLNTFJbFJYS2phQXhpTjF1SVVyTW02VUFFUUVBQWNMQWZBUVlBUW9BSmdJYkRC > WWgNCkJQa1hQTExEcXVwNlhJb2ZDVFhYY2J0dVJwZlBCUUpmaWVNSEJRa1E0c09jQUFvSkVE > WFhjYnR1UnBmUExKMEgvM3lPK2VPZFN2eWcNCi9HNkd2U2NHN3R1RGMrZEhKdGdqakIyRjVD > OUsxc0NsVld1eUVmdWwzZ2RBM2NTUUM1WnBZUDl2YmxDZ1p1Q1ZVSlc5cHg5SVF2cTgNCjJ3 > SWcwNTFvR1AzODB1ZDh1Skk4R2NDck5aNWM1TjNNUFNpWVhpVjhUUEtNcmlXSzAvZ3RYNllG > RUs5QzRoMEhDaHd3djl3MHF2NzANCm0zbUk2YjNpbW14RFVmUVJud2R6bGJ5emxhQm44S3Nv > SUhoUmhPK1psZzZuYnMyS1VqNmw5STJIMndhdDByK2dlbEVqbDY4VVlRdEMNClhKL3VtdS90 > REZxTno4b0tkdy85d21IK0JBOFBTQnRQbEZ5R20vdkdMNUtQU1NmRzFiRkFSUk5nNFBKM0k1 > RzB2aWw1UWd5VFFDZ28NClBYN1RUUUNjNWRITlg5SmpCYWYzamFOUTZCUEN3SHdFR0FFS0FD > WUNHd3dXSVFUNUZ6eXl3NnJxZWx5S0h3azExM0c3YmthWHp3VUMNClcrWVMrQVVKRFQ3empR > QUtDUkExMTNHN2JrYVh6d28zQi80cndiRHFYYVhtNllDNHMwalZPZjErTWxqZVFJc2JIUFZR > WjBJUmlnQ3ANCnpDRFNVRlRLUU9lYkE5aVVqOEphRjJEUHdkNnNqeVVVdi9YTUNMbCtTd3pT > aWptVk4wS2ZrODVYc3B6TmVmOFhtdGVLSzFtRVJrWW4NCkxXQndUTndwNnFlemcvQ3VrTmJv > Yk5IMDhjaVQrejJmeHRQdXdxSzVYOVE1UjRRN2VndGg1WFVUeGJ3THdJSmVyRWZWczRIRys2 > ODcNCm05aDFiV3lZSmVtQjI0TWdCdThmVGFWeGFzOGRTU3dESGFiZGd5R01LSXZxREhVVUpR > U01EYmlvMEl3aHM3bHgycDNYZDVCcndRTE0NCmlhVVBuS0JIcWZWTThBRFdsZHZIRjZ4YTlr > ZUJVam5FZWRLd1FOallmNzZsR0g2Ykx3YnlaY0xpZ0tGZFhZMVIyb29UWGkrUnhzRk4NCkJF > OS9LMlVCRUFDOWpjSnpEdHQ3TGloL2Njd3Y3MUZIeVZMOFgyM0Zzb2Ewb01IS2h3N281UDJQ > cVJmengzT0tWeWp6R1VUN3d6cm0NCldvWVBielhyUE1RbEhVTXEzSTM3RjJxMVhyQjYwZ2Er > aDhKcHpyeWRQd005b3BESUhhR21sY1lpdFRGaWdqa28vR3EraW9XK1lTTXINCjAzbEt1eHRz > UGdiMEdjRFBrcmhxNHNOTUhNWFZ3M2ZXQ0lpV3RTSHpocjVwNkFUamgrZ3F4VFFRN2htclJD > SVVJY2grUVFvYUJkc1oNCkk5bGVFV3djdk0xck0rQlN0Rmh5dTV2bmJkSlZwVEd1RS83ZmhB > eVYvTmNmMWlOMVVIRGk3T3cwS3B0TXpWZTBFTmtNOVFMdnBESzMNCkFyeXg1UFlVcHRTeGd0 > blJETHVSd3NvOHJzSFpOV09CUUFqUjlqS3B6WDlucWhyNGJWVU1sNjI5S0JMcXdzWnA3ZTk0 > Z0NPMytFWHINCjRMbitrL2FYRVoxM2o2Ky9OWmNtc0o5bnVOSHdrYTI1eUVWQ3dCbDRGSSs4 > UW1KRmMwVk1IQ2JaMytweW9XRFJpNFdXSmlNMi9FTXUNCnIvcXl4eDY3aDJEdXZxTVZDNXhy > b2hWbzN4emJmT3k4WW4wUCt0S2pMbXdseWtnSXlGUE4wU3JrVm13R3A2RzhZa2xnSDZYaE9K > SloNClhLaHpUaWN0NnQyNkpteEhrMnBibjEzMGF3dlJXTnVCVUhoUHRrY01uK0ZSZ3pwOTcw > aE0zNENKV3QrckxnOGkzTW9ibGhLMENhMTANCmUzL2szOUd1RnZpV2tkT1hsOWl5cFNSVXlp > MlNLZ0NWNlNkbmN0T2pLWWtiR2JRdHpQVDBZdFBva29EVHJQZmp3OWlSQndJaUdTMmQNCmhQ > ZE5wV1hKU3dBUkFRQUJ3c0ZmQkNBQkFnQUpCUUpWYmh1d0FoMEFBQW9KRUc1NEtzQThtd3o1 > VHI4UC9pa01HV1F4eE1YTXZ3VE0NCm5LNG5SbW5TSzMxUHR6b0JxY2lCU2dsc09RNFhjY0Uw > SEVIMVpMUDMxYmt1R3BFVW5oaXU4VTl2Nm43M1gvRTc2WjV5ampTclI0YWcNCll2bjJQM3h4 > elEzUXluV2dmVktKNlV0R2UxSTFKcEZQM29aYTEyU0lGbTR4WGU1RmpiREFhMDU0azlzVDZK > Vm1wK1c3bjdzWkgyVmENCk9ZNHZWcENLWHlnT25UQitTSGhSVFRoUzlVLzh3UUxuSy82bFI5 > N2VqYU02ZXJIN1lkRDVDYW5abmpJYUhuMjJxY3R2TWlFS243Z20NClh1eG84RW5KRkwwUENU > cUNFVWxZU1pOcUlqZ3Q1YlJFK1RSaURYS1hocGlHN0FNOGJKa1hQSXdKMGY3RlVUaWs3aHMy > dE0yaE5aWWkNCjVHR2s0cTZGZHFWUUhCQkJIYXpyVUJwOHRCMlFubnBsYnBFeUtiSUlMNHVJ > dEIwNmYwSW9selVTMEJlTmV6czkxT051ZW5NUTAyVUcNClZORmxjWTdDSE8xQmEydVVNaTdk > VkVhYXpGd0FBVWExVXRkNTFQaFdkUjM4dksxM3EyYzdOR1VCaEhKdklPbDR6eXVnQ05JUDRy > NW4NCnJLSGtleFczZnlNMGxqT1ZVLzlRdVFjbkRUSHlHUUJ3ZzVFOGZpa1p5K2pXWCszUURr > ZVorMitPWGtZbmQ2ajl2MDIwekgvYmJORW0NCmZ5VzFjNXA1K0ozUnlyYTU5UGNoTWhoMDh0 > VGc2cmlucHRRciszalJLc0txMEZYOTM3MTdRN09XWFFXMEE5dUVBbEYydFRyblROb1kNCmww > NzJ0cGVqN3M5Qlh2QXA3ZERVMVMwejR4SXlmaElOVVU2cUdzWlRUMGswYkQraDB5MlNleFMy > TENPYXpTQkNjbmxoYmlCRWNtVjMNClpYSjVJRHhpY25saGJrQnphR0YwYjNjdWJtVjBQc0pG > QkJNUkNBQUdCUUpQMEJ6bEFBb0pFRmk3bGh2UUt3RjVlNm9BbDBxcm9EWU8NCit3TStNWGtv > NWU3YStCckpIbE1BbjIrazNkUFhGN0ZnbTUrMnc1NlFQeTB2VVNMSHdrWUVFQkVDQUFZRkFr > K0RTU1lBQ2drUVdsTWUNCndLUGRzVlVKWUFDZEc2bkE4MXROMWM1NE5vdHdORzZtbks5K09M > TUFuMmJhaVBSenVrditiUS9FRGVuRHVPcnZ1MmF4d2tZRUVoRUMNCkFBWUZBbEdYemlJQUNn > a1FrMTN2UktDVEppc0VPd0NmZEoyRk5ST1hRcXVmdWlmblMrSyt3aUdycTdrQW4xMHdkZ2Fn > Zlhuak9lUEoNClZZRStWWlJvUEppdHdrWUVFeEVJQUFZRkFrL1FHZjBBQ2drUU5oeGZjS2wz > TGRNbWVnQ2ZSbEpWVE9LVkkxR0pWSHp6MUFmS0hnRFQNCktXZ0FvSmJxRHkyY0xrbnpzRHYr > eThYdlhjeDJqbWc1d2tZRUV4RUlBQVlGQWsvUUhVUUFDZ2tRWkpQWGowSkYxL1ZOandDZUtY > ZUENCnNPK2g2ZEs3WnQ0aW9tUkp4aHhVMzBvQW9NQXJZa0t3N0dXTUdYWENtemlWRllYdGRu > cXZ3c0JjQkJBQkFnQUdCUUpTT25YZUFBb0oNCkVOazNFSmVrYzhtUU1uVUgvMlBOTW5ISnh5 > eXlhN3JLd2dVOFNLc1NidkdDc2NyM0FuNkh2bU4vc3kxai9xTUxsVEdoNGptMyt6bmUNCm5o > TytwQkxLNUoxcjc1VngwSTlFNXdncnN0ZmxRdXhoa1lvanNnWHhrSXNhdUVRdDc0aWw2eEVq > S1BmWmVaNWhvVTdad1RwSWtpYVINCnpmKzdFOUhhc2dzZ1UzMyszTTh1OTFDMExGZzZDTXp5 > YnhydDlBU2RrR1RwTHloTkdqNW56dm9aSktqVHNvdFArK3QyMkZSdTB0Q08NCnVKVktBS0E2 > UzEvV3VtSm9NNldtbFFzdC9aS0Y2SjRoT0V0eGZSV1NRblY4aHBHY0RTRzhhZFAwOFdobElF > bjBmd0M0LzlWdXA2WjcNCmk3OC9UeURvMDZrckZRNEprdTY0RytlZW5QWkFsaFJ4UE1Xa0VN > MTA0YURDR21MVjVBMWg1MzNDd0Z3RUVBRUtBQVlGQWxKcGk4OEENCkNna1FOZGR4dTI1R2w4 > OUdJUWYrTUsvQnVhbFFBdGlEQXRwckdmNG5ieEptd1VxLzFHM1pMQnZoOEhPbzFOL290N25W > RGViMGZVS1kNCmNmdy9TYi9WRzZFVkMyTmJBNlY2QzF6TDV0N3c5OFNRbVo3TldkK2RCQ1BE > ZGhkNFN0TjNUVm1qaHJTWStybzROVWNCQis2TlRDU0wNCkhBd21kRnI4bG1LWHZ6ZC9VQmpO > M1JwcFZEckJEYmdTOXF1UWNVbmg2SGhvdHh2ODZDSnc2K29WL2IyelNtaHoyOFdIK2piY0k2 > ZjMNCnVYYnptRDFyelA1MmluTjZocXZQVlk0TlpvcEpSMFRBanRkUDFVNXpNVUFOcks2MU5i > UTQremlBTXFxQUx2bW9YU21PS0p2WUo3dGgNCmJ1M3NnZDY3UnRoTE5KMWwzdE02NDNFTDlP > cGdkek55VG04TDk2eFBUVzdKSFM2S0pmVE5PQTN2QmNMQVhBUVRBUUlBQmdVQ1QzOHMNCmNn > QUtDUkJmSUc2UHBPdFFoZWM2Qi8wVEFLbS9EbGNOeFFMYVlwRnJxK05xUUZBZGVYNG95NXly > WTdmb2FuQzA0STYvN1R0K3FQbHINCkNyeE5GR3NEUS8waFVnZkFTb1o5S1lEMUFYQ3htZTh0 > YnQ0bWtYbTRSdGFiWEw4cHFUcTc1allLNGRGelMvZ3hkZUNnditkeUp4SHUNCmpvL1lGRU9K > VFlZZzBmZUtGVG1aQ0VVSVpMNzNQODR4b1VyVEwwRlZKZm9rNk5qYmtocHZtSUU2bmRIVDVy > blE1VTlDNzdLSDF4UGINClczeU1iMW1qZW51U2RWdTlSRFRKUWRkZXRmOTJPa21BZE5MOHBS > ejN4TWY0dzdud284UVdza0ZXM3RaNVM3ZnBRcnJDbVJVc1lBT3kNCk1INFF5Y3k5Ri9rbHZo > L3V4amlEUmlFeCtJcy9SWU9FVnA5S3Blc0hwR1RrSERXbjJFaThqdWs5WHU5UHdzQmNCQk1C > QWdBR0JRSlANCnM2SnFBQW9KRUNybCt0QUdTa3ZxNWx3SC9peXgvR1kzaUg4NFJLYkdmMERE > eVNlWVRCSGZoTTVNMHA3bGRYRmN4R2JkUjlteHFYZHoNCjN2UEdPNG5wNGthUnkzQmVrWGdI > T2Y4cjE3VkROUHEzSGV2YnpJWDY0T1lieXBPcmNmN0FXWFVoUW5FL0lpZDgrMVM1cHNDTW1k > dm4NCjFaUGdYZXdUV0dWYk5mVkZlNjVpcHNhTlNjR08zOElOMGU2YUJaVTBaSFZ1dUd4NWtV > bldJUFpZZVUyM2lyMERGby83ZnBrYm5TMXYNCjRKSTJ2SGt3Qm81VlVjNS91cVlCNEZLck9E > b3lPUTV0Y2tSNGZndHM0RkM5WXNaNWFwc0FDN1g5QUJiT3VZVk4yQ3FDYTZUZHFXclgNClBS > ell1cXZBcW16T21wVURVRkJtRFpTa1BhRjluNWJieWdDYXBXeGVEaUZsZnNxMGxMNkhTNTRi > a0M3NGlWTEN3VndFRUFFQ0FBWUYNCkFrOS9MeTBBQ2drUTloNHAyTzBEVVJmVU1oQUFtUG1Q > YlFUU3pDYmxGR09GR3hSeUhzSXBTRGRQb2VHZVNqeTVYWm95MW43ODlQem8NCmU1aXJuQXhS > a0w2b0JrTXQxSDZTUjNXd09wZGx3eTRqT1l4RFJSM3c0NnVPY0F1azJKaXlFRjllZUsrc3VW > RnNjV0RJTWZ4c3I4WmMNCmlndVRzZDdNUDBZa3NXcWFRdWhZM0pybTdPZ0hGK2VqMTNsUDYv > MlBKeTR4dTN4bEI0a1hlYklhaUJTejkwcEtFRTRSQXFDM1VrLzUNCis0SEp5dXFCNjRDaFZa > RXNubW0veWt2RGJ4RmxueE5OcEF4bFpnQmdobi9GOWdBVlhMOWF4Sk5uMlM1ZUxUQVJpWVhN > L211Q3pUTmYNCnBJMEJXWjBxTnk2SlJVWTJydWx1aVMvT0NQT0NxV0tVeWFYVCtNV1VTQ3VD > Z2lnQlVON3YxaXVOeFFycHNrT1pTQUlRdjFCMms5YzINClNQQXVEcHlCZnRlT0RHOXhDdWFz > NGJpUWVEYnJ1TnZUWkhFRDRBVzdnNWx1YTRVTmYzQitTQ0E0RGlRUnRoWEU1RXNzL3V0bm5H > VHENCnR2aEtsWDZaVjVSM040NS8xUmFVRnFOeFVVaTlLRTMyMkQ4S0s5aUo2SUZBMHVvbnFp > YjFMREZyZXFtVVJpQzFEOUxhK1QrTm41VSsNCnJJekhMOTFrMUtPdW95bUhJOW5ZVWtqTWVh > Nm1oRXp4bWpsaXYvTHhsaDhHSjdGblFsZEFKNnZiQ2VNZ3BjbFUwTGJjQzJJQnpmb0UNCnMw > R29kN2U2cWh0RG42dGZIRkx5MFdCU2JFcFRlbyt4Y2N0OC8wYkJ5OFdSSXNvY0tXU3JjQlEw > a2RnVUNwbFZKOFNhWTNkOGJETXENClFnOWY2eXVmVkF1OXZRSWdKQkhSUHA0UDRCakN3VndF > RUFFS0FBWUZBbEp1Z0pzQUNna1FOODM3SnlWMTVJQVQvaEFBcGNwWjgzc00NCmp4SzBLVnNU > Z3o3ZE9ZekVFR09yc3Z1bFp5WERwbjNtNFNmczkxRXd6QlZxYU53QnJXUys4Q3FNMFR4c2pU > NU42MHRMdnBXRlF5SHQNCjRMemVvTndTWXRRd2JtVy8xSWduc29tMm15eUZucGJHRm1tRzhC > c0xoR1hWTzNQSnQ1RUdBOS9rR2pmb09kanFOcXFuNXQ0OFZ4SzMNCjFMUjY1NWVVc1B6MllB > SmxkL05VTDFDVkNVbXdXVnVucTZvT25oYUYyMUN4REkxaXNlVUJndEI3UC9DMHdYNCtDRXdh > TnA3SVExZXINCnBwOFkwd3k2MkMzUmFWRXhhMTFZSGg3UnZ4ZVFnZW0rM0hYbUJ6NXVNYjBq > bGdDQ1ViRHJ3Q05HVGhaVzdjbzRUa0VCMDlKZmpHS3MNCnBScnNLRk12SnV2K2t6NWRVYVlj > bG5UWEVCbG5oYkgvcHMvZGRycThPZ1gwNFVmWldyWTM2aS9UMUZKbE5lTTZCWXRiMkhoTjIx > UGgNClVEL1o5b2FzaHJFOUNhekpucmRVaDFPQVd5Wm1xTkhkMGRVSkQ3ai9JNEZmYWJuS1Rw > WVdreUR5ZHBXc1JuYlhQWGtBUldxeEU2ZSsNClRtci92VHF3dEFmSTZkbnpmdTNrNCtGWkhz > NnppZkcyeUF5R1U1UXFFdHREUUpkWmk4TXhxRFM1dTI4NTlrajlkN3NhL3VtVFJDOEcNCm5W > ZTVGU0JIdnozTHZ1RnAzVHM4M1UvZXV2dlg3Mk5jQ2ltdVA3WHFPNEJHNnA5eUZpMGJHV3FC > UWFaMExKenRCdTY2TDh4bUVmSHQNCkNsQk15ME1BRDVNVDQxbnpXWUJLSTFxK2pNMHBXVUw3 > ZTZRUUhEeDFveFRMR0NQaURyM2tJT2Z3ZXhVRUx2SjdEOG5Dd1g0RUV3RUMNCkFDZ0NHeU1G > Q1FsbUFZQUdDd2tJQndNQ0JoVUlBZ2tLQ3dRV0FnTUJBaDRCQWhlQUJRSlNRWlhWQUFvSkVH > NTRLc0E4bXd6NWVtd1ANCi9qMGJ5WW9KVkdhZ00xT2N0UGNzMENtTXNEMVR0WWhScHF2ajNX > NytxSEpTbnpqZlhFV2lodXdGREtkdzByUmlHclZuMzQ2dGJNWW0NCmRLV3VId0NVMVF3SzdR > dTVJMnVTa3EvRUZxN081U1JtS1FES2FRZUwvd3ZUcWNhQ2lNMjllZVdnTGFqQ3JwVUE2WWlM > TXlIQXV6bXINCjFTNXc5Y2pobmY2SGIwTEJRTThVL0pBYkxzZ1BTWkhSemNhenp3NmZzZEFj > TEtCVkZGSFhiaUd3NjFta2lzWlYrN1RIWFJ1dWZtS3MNCnpwNnVieUxHdUxYUWJZeVI2Q21l > dlB6dkU5aHNhaDlFc3FQRUdQK0dwcXlzZnIxVXl2M0UvdmE2eGxLbXRUVHJXZGwrMUhqQk9N > WmQNCks4am5yK0NWR3ltOGhla2paL2RVSE5DWjMxakJnNVhDd1IzeGtHVXZhWFZ4NVF6U0h6 > aXFuSmZhenV5b2FmNGQyM2VSclArcFdGdmQNCjZGWldTSVd5M0o4RjdEQXVjeXJCYlV2WmMr > QmQ5SWNyanR1QTZPdGUybWZiK0xGd0xhWkUxYXpiN3JLcEhFRFdMRjdWcHBVbmx5TE8NCldF > Nyt4OFZZMTMxeG9zTEVDOEVwOHFGQlFaMkgva0U4ZUNuenVmd2Z0a1VRYTU3VVcrdlN1WVZm > c21DOXpnYnZPUHZEbUVBRndVc2cNCmNZc1RNc0tGbVBwSkppMFA0MUhmQ3hZUzlmUDA5cW1C > eW54Zld5VEw0TVJkWUVzVklFaXdKeGZrd1lOUWYySU1sUVlLU0J1aE5FcXENCmJ4YlE4L05F > bVFSTlZvWEtad3IrMmduYk1QZFRPeU40TTk4UHFxaHVTdjF6V1RwT3I2cjk2aWNraXc1ZDFw > bmZKODlqRU5ITGR5Z2kNCndzRitCQk1CQWdBb0JRSlBmeXRsQWhzakJRa0paZ0dBQmdzSkNB > Y0RBZ1lWQ0FJSkNnc0VGZ0lEQVFJZUFRSVhnQUFLQ1JCdWVDckENClBKc00rVENTRUFDYjlS > Vk4va1Fjc0pmNzQ5SnNObHp0M3dyNUpyUmxsRDU4T295MkNqRjk3cEFaYzNTN0RBcFJWL2sy > bmFMakJIV1UNCkphYnVwb0VCQVFpNmpCMFVJVVFHMmtBVE15bjZaZFpoNkp2dFN6ajZ0K1FC > RDF2eGE3M1NQUlNqMTlyZ0N0NDBFS1o0SHRZOVFCeXINCk1vSUdqcTlETWFWbmQrbTNqem9Z > S1RUa1c4UnBHTUg0S2NZV0EydUdDYitFbUlXemtTZHlmNHFVK2hMb1VLbCtrQUpCVm9jc2RN > NjgNCk14Unpqd3lIZlpoc2pTZkxDZEs0QkdXVXR4MlR2TWowQkp0eVFHZXNXQ0VuZnA2VStB > L0FDZ00rNnYvbW9sLzBIUmt5TCtwdlQrOGENCnMveTA5M1QyL3ZRVnRjeEtkVFVpeENVaHFi > VTNaWEZiODkwM2k5YnpnSjgvWm5jczQydkczVENuTWJ2a3FEb05SREpKemdkZERuWFANCjZK > UW5ZOWJVaGpvbHAvYklkYVlrTk1ISkg5UUVMekxQSU1IMER4KytSRk1jMHowMzJ1NnVob01H > azJkMk1EbTkwNHBHOXdyVFNDQlkNCmpJQUZvVkIyYXJFdkRZK2FJRHFKWEY3Nm9RVGVUYlBH > dFRUM0ZoWWlUSjVJdXVwR0V2YXZuNzk5eE5qYm9IOFdlTXRlNzdQcmxjWkYNCnF1eHdnQk9E > WktJcmJjR0tPdzJBSHZZZCtwRjl2NFlIYU8wNHFPOHByM2FGU1R1OUdHOVRzMXh1WklsMWFn > WERINEFSTFBEaTgwODMNCmkrMW1yOFJ0L3JTMFhSQ2phUy9RWTJIYXYzYmNMaDU4M2hjcW52 > SUZQaDZGZEs0a2xQZXRjSURrTEdKbXJUdHpFT093cnNMWG5PM2YNCkRpRkYwQkFlNXNMQmdB > UVRBUUlBS3dJYkl3VUpDV1lCZ0FZTENRZ0hBd0lHRlFnQ0NRb0xCQllDQXdFQ0hnRUNGNEFG > QWs5L0xRQUMNCkdRRUFDZ2tRYm5ncXdEeWJEUG1zbEEvM1JHQ0VhU0dUcVovL2lua2Zkd1pE > eWpBNXdjZzgyQTRURVp1eHh0UEhlcmx2VVBJbEJobUENClFCYlVVWlYySVowOHludm5jbGtC > YnJYc254L3gwVWpicTFoTm5FU1JBRUx5MUhFcEt3MUtocUhYQ1pCS0p0elRUS2tXd1dKZGEy > ODINCnZVVVJON1NNUGgyZnFqTmIwVUtMRVNsdEpDS2hLTWtHM0JUNWVRc3FkbUtMVjlwU0Nq > M29TY1VXYVRiRHlYK0ptbkMraUtkdmd0cUYNCkxlODZjUXB6dkpIa29GT0hHN3hrWEg4R0lM > cm5CSW5vUGE0UjNjRzl0eU1xenlWWHhYWXA0T0lyQWZPandOdjg5cWIwUXpXSEdweDANCkg1 > V3ROWTlpZnNzRXlvNHI0SlMwQkpaeDNnQ1EyOEdmZFZicVNJSWNLRGxTaWJYc3pOd3B5amhy > RmJ0OGMwSlJuei9wUlp1T0ZWUm0NCjMyTCtpQXJDMGQ2ajBkUERMOStXOEx3Q1pqTUxXV0s5 > Vng4M1hsaFI3UnhQdEJhZlVaQlh5UzJzNE5pdXJ6dmFjK1B6Y3l1NUdDOEMNCm1MTXRJdDFM > c0pZRTYwQ0ljaGRuN1plVkNKaDIrcHhDaXZScW5jUUVUREZYL2o1K3d4TnZQS0FzcklCLzM4 > MUJ5WXEwMGNTYnpYRjANCk5LVFRyeVhqUmJXTzg4aEMrT1htdTR1eHhBM2Q4a0Q2Wm83ZVRm > UTMveG9wa1dEZG01a2t4alhsUXdpRHZJZ0RyWFY2NlJqc1p2RnANCkxxakxUUmo5U2VFNXhq > TnFMQ0F5RDlFRCtGZXFoT0tkOXpPV1V6aXpKOGJHS3U5bm84bGUwSlFTQXhyZDdTbXJhdUM2 > OFZVUmRQbGMNCmdVeFppMUhPbDNIMjJQL2lYaXcwbzhMQVhBUVFBUUlBQmdVQ1Q1WUoyQUFL > Q1JDZ3RlYWI2UHZPRVZHREIvMGJYL1FKT1ZEQUF1eWcNCm5rbTkySjFLS2plbTBTQnVkQUI0 > cSt1MGRDUC92SzJIa2Z4QUl5a1BqOGk0V0d4STNuZlI4a3g2ZnhTM2Nla1ZVTFFzNWtmN01u > c0UNCk9SekxOaFRqakJIdU5id3V2V3Y0ZzdzRnBqUTlGNFBqSkthdHZheWJVRVZDVjdmM2Vz > WWpSTDIzZXdJR1pwTE5wd0lhcnQ3WUhYdGENCnhRZFZHZllMTGRSaFdoU0U2YTBkblAvVjFL > blBYUGliY01hUk9qbmhRR3h1M1RjdU0rVHJpaXhJd3BReHVOOTVVSnlDcGF1SlF1N0UNCkJn > RklTRS9vZEdVTkhkQ2MrSFdGZlJESk4rVllaU3N0NXZYcjFGOWFVSWt0cGZTbXpTcjBIMXgr > YWZWYnUrZmU5WVFpM1lzcVEzZUcNCkNzL1U0dzgzMXJjR1NTY0tzLzdmYzBSSnpTSkNjbmxo > YmlCRWNtVjNaWEo1SUR4aVpISmxkMlZ5ZVVCbmJXRnBiQzVqYjIwK3dzRisNCkJCTUJBZ0Fv > QlFKUGZ5enpBaHNqQlFrSlpnR0FCZ3NKQ0FjREFnWVZDQUlKQ2dzRUZnSURBUUllQVFJWGdB > QUtDUkJ1ZUNyQVBKc00NCitiaDBFQUMxSHd2Z1ZlT2x0dm4xdm52bDVxREtyT0hJdDhSWFoz > bkdFZHdRNVVRR3pBM3MwcFMwTFFsdmZJazQ2OWpQTWFPdytXblgNCmVxemZaZFYyc1B6NHdF > dmQ2em1xbWVSSEtKKzBJcUh2ZlJjMyt1Z09BeGsxdWdpWkpLclRCQktNVVRnTXhzT2I3aHBo > aGpTU1RmbkMNCndKUU5qcXpvZE40UFR3ZFNmcUJDd2Y4M1UrbFUzVUZJSUlvdWl1ZU9jRzZ3 > TFhxTHlaY3N1ZlMvNmFEY01LLzBwZy9wKzRGZnVtemQNCjU5K2hhZnlGK0srYWhJVXZlR3lB > WkVTdWFRMmtOU3JnN2hMT3AycXVJa2dxa1dIOG53NlhxUm9VNGtvYVJkV3BpTE54Y2hXNDc2 > UUkNCkJVWWd1MDk0RWY2OFFmOFlySnBCZUhVYW5qUng4N0VpNmRpRGlOMW9CemRlbzBmS2xH > ODVRTDZwdEljSkd3cnl2TU5WWm8wUWV2MG0NCjZOV2NEanBWK2JKR2VxQzNEdHp5NjgzWnNs > cnU4QVprVTd3TnB2YmtNV01YNDg2cS9tNGhYcmQ4UGJWS0EzcFhLTFFYWmIrMk5RMXQNClpJ > WFk0c1ZPREZjb2swSWY5aWhQNUQ1eTgxdEwvMDlsNjhuR3VZRXRZc0ZDd252b011L3pyTVRo > U0UrTlJKVElSc0Nza1hTTjhLN1oNCnJScjVzY1dwakpPQjVsSDBab3dZY2k1ZHYrQXZ5UkFh > OC9VbEp0d3N5VG5YeG5hUHd6cGEwZkw4TEJUYXF3aEY5SExaZVpVbmQ3Y0INCnpwOUFJRjRr > RW5ZU0pVQnZ0TEpJdUxIbHRrK1A5VlJUTU8ydkJJY012YnNXS21ON2FNb21sSHQyU0RuVSt0 > aGFkZmpnNW11RTJMaHUNCkNtNzMrTUpHQkJBUkFnQUdCUUpQZzBrbUFBb0pFRnBUSHNDajNi > RlYrWFFBbjBVREplMEl5NFRFTU5MbjhlV290TGNPNldnc0FKOVINCjY0Q3ppaU5BTmlLeExt > YnJSN1ZESGo3VU84SkdCQklSQWdBR0JRSlJsODRwQUFvSkVKTmQ3MFNna3lZcldXTUFvSmZI > NW9iUHI3TTENClFpRVRzRW9xaGZmNGgrUDlBSjQ4TVJzNWxvclV3VW1VdjkyN2ZvWU9mdGx1 > dmNMQVhBUVFBUUlBQmdVQ1VqcDE1Z0FLQ1JEWk54Q1gNCnBIUEprRmlPQ0FDSitpMklpZk5P > SkRpaWtNMkhSMlNpNGk3ZjR2d3VHZnhhVDVwd0NWUlMvaEZjNXliVUNXRDQ4cnJ3Zy9PYmZJ > eHENCmhzOGkwYnBPelN6bnZuOXN5NjY5Vm9UaWFoSGgvUlhDOWsxYzRaOEhkUmJlYVNJYlNN > VExhTWQ5ZW9xcHB6a3BkZENVR3VCeVJ2TmUNCkQ4SmNqRGtQbE0wcEJNb1NsNW5ZVW9pd2l3 > R0VOaTRyT1pXMXJHb2h0d3N3TkZqeGtqZzdhUjF6R3M1cjdTUWRDcjNPanFBV0h1cTMNClFu > aENEUzgxT0pjUXh6NEpIOUdJZFgrVDJpNFRVbDRoYWZwMnVWL3BnL2dTU2VwRkhqTnVUUCtI > T0t2SU1KNm5ySkRLNzJLKzdJMlgNClNuV3hIN3NaT3UzdERLQXAxUWFMVDNxSjdqbGxGcHcv > M0pCRzBLeG9raFBaL0lEZ3dzQmNCQk1CQWdBR0JRSlBzNkpxQUFvSkVDcmwNCit0QUdTa3Zx > TGF3SC8xcWpEdFk4NVgxaXl4T08rUHFDMnBLY3c4ZlA1WU9EQitibjFKNU5qZjE3RVh0Rnhs > dXU3ZXZFaWRPbmVFZXANCkcxc29zZERWNXhNOTdaLzJ6clo5bnE0OTNhcGpsSXArU2xJNHFm > ZWJCTDR0aDkzTUlRWGJVUGZPQlZ5elVxQkZndXJnNWdWaXF1MzkNCkJFRkhmc3VvTzJaWWJq > QWNHOXVUd2NEV0lXU1Y3eGdta1RUS2djYmNRUHFBaitURVNvME96aDhqblc3T0RwdHRaa2JX > RDZuY3dBaEsNCjlnbWxkOFR4WlRhV1doby9zQ0txZThpN3ROUVM4a0lLWlVUbFRDaHQyM2tH > Rm5IalZ0eEVzTVdoYnZqODBwOTNUeSsyT0g1bjQxTzYNCjhUdUFLTVV3OEZDMEJUWVEydnRj > eW45ajFpSUpNWkhoaUdiZVBKNjdSQWE1YytPMktySEN3VndFRUFFQ0FBWUZBazkvTHkwQUNn > a1ENCjloNHAyTzBEVVJmS2F3LzdCQW5ndXpSRHV0eGJ0STNYbU9sVzFjenliNmVVYVJqSEJN > VE9ZbG5pQkpoSytxck5mNlEvZlo5NkJDZzkNCkdZTGErMUhJNEl0dE9lNEhXUlI4bWNvV0NX > L0NHeXhrM2d6M09CNVFGRFlxbFNuby9qZXE2L3FlRVhjMnBPeTVRQjVVQUNBc3dFREcNCjN5 > TnUwYU9oVis2ZnRKaXk4T25mcy81Z1l5NGhvRFNlcFdQUG1MQ0lsL2xCc1JUODNQQU8zaVQy > cWtGcGtuNFdUTEtGdnd0cXpzV0QNCjZldk5WNzNVcmpKOTRpSERaS1BVOXhvVFZZS255NFdj > SmlkVm50RktRV0VyUTczSzNYQ2x5SmFJUmNxTS8xdnJtais4SXhQTTFYU0wNCm1IR3ZBWEkx > bWl2YnlGZXRKa1plWGtHR0I2RUlBcFdHaEMwcFNvc1dGcmZuaE00cTdoTDNvSFhTU1RKNFNL > N1QzZkQ2aGp2ZXdkRi8NCnZkZDJBcWhsZy85RkVaOC9QeUFrc0NXcldqTm91a3BOS3JPb3Vq > WUk1Q0tDUlRwMmIxK21BaHBLMGxUTU1jQWpGTzN5L0F6T0NiTXMNCkpEaW04TVBTdE9FM05W > ZUhOTHdEYWRtUVg5QlJDcHVJdlBTMit5QkVDLzRKQWhxTlhCaW9qblNvcEZ2blNwU2w4Y2lj > ZWVlbk1oZ2sNCk5IU2s0Qld6T2NORnJYNlJpakVYaWtoZnJYejI3YUJpMFJuaDluVDhkMERp > WHhPVnY1UzREb1Z2aEZvY0MrRzV1UXY2c3FoRkVKV3ENClFjWDNESjdFeG5BQUF5WG5nVGJp > WkY2RnFlaUV0WVk5SWxnVklyazB4MnJPRVI5MzJRV3h6M0RwbjhqNEdxZUsvdkNIeTJUQi9E > czENCnJFdTlxT25RaWNRanp3SEN3VndFRUFFS0FBWUZBbEp1Z0pzQUNna1FOODM3SnlWMTVJ > RDM2US8vUk9YSHlUYkxPSG1UR2lTZlVia0cNCk96RVFSWDNWNWJ2QWcxc0lTNDJBakV2NEhy > UlNScUk4NTBmTDQxNGNYbjhSTXlpZHE3MkpTSGRiN0N2MWhyRTNDNmVFbTRHYXRYY20NCmdX > cnkwenhEemVmc3Z3aWxWR3l4dmc3NXluMVo1TGdVa21zeWRYYlJhYnYwNFhmaWIyOGc1OG9L > am0zVGdyRGY3UE9iUEd2WnVIcmoNCjRnTUU1RTZSZDdBQlVINjhydmF0Yi90UnRaUXVWc1Ex > dVZnNXNVOXZZejFiV2tFRGhLT1RBVW1PaWFHSmN4UWdHeEN2M1laVHZweEcNCkFNT21FeGow > cGJNSU1XMFlKTHQzSWtpdVJUR09yYUwyK0RGZmFNSlFMR3NlUTZVT2l2cERKVWpaZnJOREda > NnhFcURhK3BnVWxNL1YNCjM3VUhVbnc1ZVd5Y0ZHS21walpJRkkrUVBWM3N6ZXYwSW5TWTJ6 > UDl2NTBXdGFFOGcvRXUzVlZ3MEhNUkU2eEMzWGU4UnpwSlVnM1ANCnZrNnFES0s0b1lTeXBG > alBuS2sxaFZRM09xREYzRVhEUGx6cXEwczcvNE1EVmtpZG5aWkJPV2pzK3JqYTJBY2VqdGJ5 > elcvcmVHbHoNClhJVzhqSk9QNDhJMzNpT25KSEhYSGtHbUVOMTg0Q2dXRjBiL1VnNGh5RFVL > ZHdXT203V1lUdzVnSkg5S1lWZzA4RjJnK1JudHMxU20NClFFVlpMeGZ5RWltUzBsQ2t0TWV0 > RmprakdaakxRRTJCOTQ5azcyVHJsM3FtMW9pUStjamZhSHZJVDlJMjFvbFg3UTYrME9hTG0x > RlgNCm0vcWpxMDhldGdSTFowWWJGYjBHbHpjWGM2UjdtTHFzUVpWRnB4WWhpRzd0OTZ0MWcx > N1dqRHJDd0Z3RUVBRUNBQVlGQWsrV0NoUUENCkNna1FvTFhtbStqN3poSExPZ2Y5Ris2MXNO > T01zZjlFSG5IV0oxeGcwQWRrU3FqUDJxUjdaL29HNjQxUXpXWkc0S1dRQTBrY2dMOFYNCjRt > YUlrOTNFWWFCVURjLys5V2JPUk03eURtOWVyckloclcwSU1lNVE4d3A3cEtHbWdQdFM0QzBG > dGZDa3g5NllPTmZzR3RFbUFBZUYNCm9iR0hBb010R1N3b2N4eEZQcjF2c1k2UXJKTmdXRmdl > WDhvTHdrVlNaQ2FpMno1ZklyT2RzZ1Z4OUFHYmhpZ2RUQ3h2akRiQzRCY0YNCjdmMUZydEFl > K0pyalZHbmoxRVJENFdRNXdvR1NUNjVtM29jUEVDNXk0dWkwMTJ1SlZKWkpWanY5L2gzazBZ > OWxmZmRvNTFjSDIvbk4NCnVzS01JZXJLR2hZOXlHQ3ByNk9CYkVGUWxLZjhReTVGc1g4YkRh > SXlQay9KdnQwU0dOU0pvczU5RU0walFuSjVZVzRnUkhKbGQyVnkNCmVTQThZbko1WVc1QWVI > cHBZbWwwYVc5dUxtTnZiVDdDd1g0RUV3RUNBQ2dGQWs5L0xRY0NHeU1GQ1FsbUFZQUdDd2tJ > QndNQ0JoVUkNCkFna0tDd1FXQWdNQkFoNEJBaGVBQUFvSkVHNTRLc0E4bXd6NVhNc1FBS3dG > WFQyMTdRUCtOZC80aWg5Q2NwZSszd29ZQkJiZnNGL3MNCjJMbW5iK251WDl1MmE3a3lrNmRm > dUM1eDFtbVQ2KzFBVXBkM0VZNnd6N3g1c0RDTFZJTzhIU3BTdnZ1WU1zakkxZHlCcjBwTWJ5 > WE0NCkxxeExrclB3RnROSGs5dm83R240ckRhUkVhblE2Q1l3UStLRXZjL01xT3l3R0JuZUY1 > Z2NLRjhMUWNvVlR3cEZDN203QUNGdjJLUXgNCllKK3pSNTR6emk5Ty9OYjFhamx3OGJTVSsv > ZWdZT0NDdG8wWEQxQnFSVEwvWVp3a1V1UjMxZEVvejdNSjcyOUtUQVhGM1gyZ01VMDgNClpD > VEtSK0s2UnMxdUc4L2liZVBBYlpXSHRPeVplWTVUTUJKSXQzMlp2RmRJNmtEWEFpWk5XeTQw > eG90L2pTVFhsSXBsZkR5V24vU1ENCnQ0VjBSdmJ3ZFZiMlJVc3loOVI2c2hFcDAvaFU4M3ZH > eVdNZDNlSUswdEJLbjVzYXE1eGlJbkxGeGNlOERhWVBxUTNaL0NHZFRlb1gNCjhKQU1laklt > cUhkeDhKWFIreEZIemJtM2R3QlE0TGltdmJEQ1RxYVdNbzhoM003ay9rVDlZMEE1am1la3RB > WXNCU3gxd1dCQXMxb0oNCmxtS2VuWndMSEVjN0JGVVZPOVR2OG9uWmRHOXg2K2t4ZVluWWs5 > MWVkVVVUcmFMOHRwd2R4cWt3UjhsalJBTnJseWVFdEY3YkhrSVoNCkF4TERJc1gzbXovQjJ4 > RTZlOEl0RlJZa002eSthV3UrcEsyakJ0WUZOenlocjl6VFRzczZnQWlvMXdYNFNoNjhGUWNm > aFJKbmpxQVANClBIME9LOUFibHNKbEtNbG5lejl2L0dLRlhVQWdySDVIU21ocnN6WU13a1lF > RUJFQ0FBWUZBaytEU1NZQUNna1FXbE1ld0tQZHNWVkoNCjB3Q2ZTelc0RkczYTI0NnJVV2hJ > Q3ozS2VUdXRHUGtBb0ovWmNaZXdJOHpVTmF2Y1Z0cE1rRFRvYkRqM3drWUVFaEVDQUFZRkFs > R1gNCnppa0FDZ2tRazEzdlJLQ1RKaXR0YWdDZlVFbG5SZ20wUmlaRTFHbFgxcDM3UEdQeEZJ > NEFvSTZtTGRaa010cmhsWWxjUGFBZWl2OVgNCmtHOHF3c0JjQkJBQkFnQUdCUUpTT25YbkFB > b0pFTmszRUpla2M4bVE5ZFFILzI3Mi9sOGUzbnJ5L1VMMnBZSjJ5Rm9DSEUwQVpCK1YNClc3 > Zjd3cSsvZ2hzMXpBSzZrQ1M0bUV0a0FDYVV4S2JpcS93RTlGR1RpZ2g4a2c0TEdxdDdvbnFn > UExHcXplZzVpR1RYK0kyeHFwVGsNCjhyVTdDMzlXdU90T3FKQTNsdDdhd2hRWkRDQzVsMnJJ > UEM2RkFkY1g4ZEFDNzBaRFBZbXRwdkVHbVp3TjNLaGZWdzBGY21IQ09mSGgNCm5jdURyYkJX > WkRkN2xac20vMFB5L3lYUWNPYjBKbkRGNlY5ZCt0Z25yU2JvcmpidnRQQ1ZsSEFjQ0kxVktN > MUI2WmsvUnJxYWtGSksNCmd3QmxHRGRFSnE5V1QyMU12L2hEdVR4V2RWeER2YnNyWE5RbDQv > TXg5dSttSVpURkNNQXVwUmJEMEpma2ZIZGtxbzR4NFBpZktnT2gNCmFXN2Z2YmZDd0Z3RUV3 > RUNBQVlGQWsrem9tb0FDZ2tRS3VYNjBBWktTK3FFb1FmL2FhcDU2UmZSQWl3ek5FOFhCOGJ3 > bE9zOUZHNFkNCmo0U2YzYXYzbXBJV0d0WUQ2eDZDY0VTZE56aWh3VUVWaDBKb0labG5hekNs > alJlWGE4bHg4U1dMSW5pM2cyNGQwdHFxek5IbEpMY3INCktEQ2MzUStoWDZwWlQrTlZzUk02 > S2FOeHBCbzFPRUdBdFlMQU9teGt2L2tYUERINXZ0a09UZWd4Z09WRFptVmQ4YkZVQTNIY0Ft > L1cNClpXN2ZUQVNVTEI1RnBhcDgwUDNkZFpvcjZTZGRYV1Vyam0zM1d3Ykx0UWxhRVNlN3c3 > MDBQQWtTVDM0OGQxNjJqN1dyYWxrS2hRL1gNCkZqVXlqcGZtc0k3ckJVRW5RVXVxTFFPRFpE > TjlHZWJJZjZmckI4Z1JoZkVQTEFXUWphaEhCeDlOcUg5U3MzVURwd2pKaTVJM2JMWm4NCnZ2 > Zm5HZWhVL2NMQlhBUVFBUUlBQmdVQ1QzOHZMUUFLQ1JEMkhpblk3UU5SRitQd0QvOW1ibVBT > ZDdQVDlPOGdJTTVvZE1LeVNtM20NCnJXVnovNTBwU0NaNXZXa3BXeDJCa1MrdTEvNUJ0alJM > M1oxY3ByRW1YNlBxTmFwa3ZUNlRoQ05tRHVHTjEyVUNHZ05acWZkWEF4b1ANCkZMeGpsU3RQ > a1JjYTJLY3hXRXpVeWFIcEh3Q2dMeU5lL20zSjZiVUpoOG5mSkN6eFJkMnB4V25ZTTZHVVp6 > ZTZIekV6ekZzeDZZTG8NCkRLak5JeGRDdVpYMWVPbGNWZjRKTEJDbVFUMXNiWEdOUWE2RU1Z > bGVmWi9acU5XNUlHR2llR2ZkdFJNWmRWOGxZK0twb202NjdyWXUNCk9LL1F2N3I5cm93Wnc2 > b2ttZ3dVR2hFTW45L2p5UTBGQ0svOTVoNFc4VjA5bFQrS1ZlSjQvaVYyVEcvc1ZEaTJzaFpV > SDRmSFArMWENCnJIYitkWFhWRTh4MGx0ZFNKQ2pRMjBJYm1mSkJNWjB1UXhvR0ZDLzFCVjha > Ymx5MC9YMXF3a3Uvc2YxRndHNnVXb2Z6bm9QbUZZWWYNCkN2bThGSEQwM3BLaVpQaSs5NTV3 > bUtyaTRUNHVjUk1WVWlaZzhtWk1idnd4Mk9tditHZkJTTXo3di9lWkU2eXk1dHZPWlNkbllj > eHQNCi9lT1k4WmkxNHB6VlF2UkdyMU9GcytmY0VqczB1eUxlakFIS3c0cXpOeVZhQ1Zmcjly > WS9BZldaTUNwQytDenZ3eVRjZnNvbHdjUmwNCmc3V1FzcVBKVXhWdFMvWlFxZmZYZ05QRFlI > TVdLNXpUa25kaWVPVC8xS2ZUaVIxb0krRC9yd0xIbFQ0N3hxRTdadXJEL2w4OFd5d2ENCjNP > MEtxa3plYnV5T1VWdHRYRUpKM21uVmo2UmFBOWR3bVJNdjN3cWJvaEVrVllUMmdzTEJYQVFR > QVFvQUJnVUNVbTZBbXdBS0NSQTMNCnpmc25KWFhrZ0hTSUQvOXVEMFdEK3Y2emFTVGtjT1RM > dDkrU3l3TmlKY29LQjI5bWhMMkozcmxiUGJpakhCbkloNSsvbnd6aFZYajUNCjVBeVFjNTFF > UE9nQ3orQWdEZWNwZmM0TGowUVFYTHkxOHpTZll4WnVybXBQQ3VFRlpZa3BhenRJQVlJMHZG > UDllR0UyUDlUMWROVmQNCkxLQVUxblBleVljQ0xQSEZyYjdTWGFNRE1qd1UzblVSQkNMaFJp > S3lOVDVwWDE4SkliV2RULy9rNytSTEh3SVZadzlFclRLOElucEENCjZ5dDhkTUlZZU51NWVW > RmE3Nm5ZNnBSdzdaV0lrRVlveFFZeFE5K3ZLcllEVSs4QUFMWXRmMDBVVWdLVHRXeWlPcnF5 > ajIxZk5lSnoNCjk1bUR5VTFiS2pUWGswamRvaGZ6QXllMVk1VTh1OVFRZjE4dHhMdFN4anBK > Nmw0aFZGK2ZNaThFNDhxSFRmUU5wUWk2U1lhMk9SWjcNCm9LdE84Q3J1Q1BjOFpwb0drNFli > MWw2SHRWN2duTFJrM3gySk1RTmNYT3V3dStUU0NJczI0OUE2WGt4azdPeU1HSG9kZjlxUEx4 > akkNCjkxSWZBTEJqVzdtVFpraWNMUFpnK2dCeHFwUUYvTm9ySGZZVFkyb0U5b0szNDl1dVJ2 > TCtvU2RMa3ZMMDlIOGc2eFg1LzdGbzI4eTMNCkZFZWlQa3JJbkpIUjgwcklMV0ViaEFwY0JH > ZDBGUFREc0hQVWRiV0RtQTl2dHQvaUcvdnhBdTJuelVwejlYNjVIcjl4RmJ0MlY2azUNCkZC > UEs5YlBoMUNibkJIRVUvVmxjM1puK05pL1VkdmpNYjNkbzZPWUpwdUUzZHFWb21uclFZV0E3 > bEY4amllUGJDbTI5Y2FDejZ0dVENCitNUXdEYkJraXoyODRNTEFYQVFRQVFJQUJnVUNUNVlL > RkFBS0NSQ2d0ZWFiNlB2T0VhUWVCLzk0S0FUaUZ5VklzeUdBWVd6a05CRHkNCmQyelh1L0FE > Y0hCQ2xZRUlRdTFtODh1MktFTzFaS1pGT05VMk5EU0FLYW1RNFl2VFJJMm5UUThpbS9leVkz > TzVVMzMvVWdnV0NqNTgNCitzN3hIbVlDaXlEcTdlMElkbWQzVW1NRmNHbW9DTWRzczg0SDE5 > Y1NnTW9FMkFiazE2clJBYkx1YUJkQk52YmpmMGFBdDJZc0lDdGQNCndkRjBkWVFLbFFlTlZ2 > N3psSWt3SDN2MjBIMC83MkNvbUlacHpFdzgyN0tTTXFBY3BZRC9rbWlWUFJrQzgvYUJoSDd1 > dDhWbjQwZnkNCkxhRHpPak1SUlRuWHBWcE4vT2ZZZGVZS0FtYk85MkhYeFpXZW1HdzczSTl3 > TmtpbjI3eFhabmdXanE3bndLUXZGb05ZbnlsREVCaHgNCk1vWldxZ25LbHRUVnVIMGZ6U1JD > Y25saGJpQkVjbVYzWlhKNUlEeGlaSEpsZDJWeWVVQkdjbVZsUWxORUxtOXlaejdDUmdRU0VR > SUENCkJnVUNVWmZPS1FBS0NSQ1RYZTlFb0pNbUs4RitBS0NQZ2JNUWo0ZldIa1J5bElqNDlD > U25Pc0FDTUFDZ296NTIvVzhteEg3NitiTVgNCkdTNDJmaGFYYVluQ3dGd0VFQUVDQUFZRkFs > STZkZWNBQ2drUTJUY1FsNlJ6eVpDelFnZi9jcHhNUmRiaUtKMnZvLzFUTzJPWTdEbEENCklF > RDVCWjBoUzJkZVpTbVRYZk9ibGV0dnNTRWZ4eWNjVWp5NlRhMUFtMnh3Y1FoMnRJSTZmNisw > ZFlYSDNsd1RWOFR6STFSWDdHY3cNCnZNdlFOOWUvYm4rMkt6aDRvdEEvU2dSN0xNYVQ0YnlD > bUNmcDQ0N0JMV0poUVo3Qm1RRWYzMEo4Mm9uZ1VyMXF6S0VmZUxmL1RaVysNCjVFMWZBL0VN > N3RFZDFuMm1yMWgxVmpXaXdkVW9LSVJFWGk0a1JhU1hvdWVNRVlEdXNDUG9MZVFiU2NqUmFK > MXRVb1NlVTZsUlpOaXUNCmd5VURBbGF0c1NmelVUVzVEN0JjUjdPellBd1JoNnRGMmVGb1l3 > dEw4M0RGa1ZPRU4rSHdBVzB5ZStCT1pGWWIrLzd1Q1VvUUt3NDcNCkVtazhRZE10MEtFei9z > TEFYQVFRQVFvQUJnVUNVbW1MdVFBS0NSQTExM0c3YmthWHo5Z1VDQUNPaFpmd1Fla2hJVlcx > TmtVNFFDTU0NCmdiWEZrTGpaRzZGeitMYmhhOWRwbmltQTBZUTFod0pmYjZVTlRONG9CYXJi > dGllOXNRWWhzOUNRNGhubkRxVXlONjUwUm8waXAvdUUNCmhQOXNKeUh2MmpuUENTdXdzTGdI > MzVWN2dVQ0Fwc1ZCdXYwV3hWYUFOc0dFeUtSc3hDWU5oUkhvZjV0L2pkY2F6bmtPNWZyc0tD > cVoNCkNSMTB0SjQ3Q1N1QU5ldjJxeWp6Y3g2RVNDOGFlZTBKMWorVzVIbGVxTlM0UkZXOFNC > dThqNE9CRGZpQ0FzZGQ3WmFwcjQ2WEJjQ2QNCjRPVHhjcUpDZ00yaC9LemJ4R0F1a1loUW9Z > Yk10bnA1VFRleUNERE1LRnI2a2JKTHV0L0I4V2VmRFBqTFhPaGtYWXVxZXJwOUZaZy8NCkQv > cGUzcXVaUEplMHVCcXJ3c0ZjQkJBQkFnQUdCUUpSbDgvdUFBb0pFQ1pKNWlqRjAwMEZKOUVQ > L1I2U2wxdFNjRUhsNjNTU3JucHQNCkVSWElNc0hsVEk3KzlaaWxjL1pyaXlDYjViUDVZMG53 > UzRwc3RBelZoWlcrRVEzSjBwSjI0MUo4OHh5bkFWamYvM3dka01ha2hmeCsNCm9wZ2VXa1BB > WC9IdjhyUDgvZDhsUHRMcUViQlhVb1p1Y3c0ZTBaV2RQbTJQNkxZc2U1UlQyWHc5eDlCVTZt > RzVzQWdVdFlMaVNleDANCmhMZmI1ck1HMGI5ckpVbFlZcFlBeGdYOS9rYStseWhVQjlzNDFz > d2hwWi9JcEN4SDRBdEdGSkR1a25KVklCRXlWWDV0NGgyaDZmU1MNCjdGeHlORURoT2tyaGpB > cENibWZhMjBaYTYwenNSOGRMdDFQQlVyVU9IWW1hQzlrZ0FlaXpkVmkvWmgwUlRrWHoreGly > NnIwcXVMYWkNCmZxQ2VTRXlUb0NTY1hNMXRPdi95VlZsTTNHazNIUFNjUGZxNzFkbHp0a2Vm > UWtqVWNCWmlJMDh0ZTAyYWM5eWdmSWVCcVlzV2taTEQNClpXMU1KMTA0YTA4M2lWQ0dieVVl > Ym5jUXF1UEpVdDNVY1VSSUJVKzN3VlFZODM3RUxOYzJVQlJrK0VqV01EWGkra2JndHE2VFFX > M1YNCjE4NVQzNFQ3TmxHbUdJUnB4U21xcnFmcEIxUjF4NHNIZXpGRE55NlVwMU1CZDhuN2Ra > d0dIOWVPTDlMeHV4YVFGK0dRMkF2ZUVMOEsNCk9wTlBNbW1ob1QvWERiYysvU0w5bU9vZk9u > WUQzS1hwcEd4SDk3ZU43dEhZM0NBZXNTbXgwZTJ0SzFJblAvZHkyNDN3U2RRUHpCZ1ANCmFr > NUtjVmgzNExmQWJsZ28yZ2xIYU5VYmEyVVBjSjVtaFBvWm9NUmdJZ0N1TFZObE9CZWNNbXEz > d3NGY0JCQUJDZ0FHQlFKU2JvQ2INCkFBb0pFRGZOK3ljbGRlU0Flc0FQLzF6VEZjNmNvMnho > R3dseWxWU21ZakJ6VGlGUjNDbGt5b1JTcFpVS2dkYzNHTHJJY1VBOHgzMlENCjhpbzJoNFVv > Y0ZjMzVNaGV0UE1VRHJjSjBBVzdnck8xVjhaT3pZRkgramFkNkFMOTVyK0Q1NEtIWlJST3ZL > SzdTdHNab3ZObEdEY2MNCjJYby91elFMUnBhelh1cnlPTTNrRXRmT3BQUFdEQTFwOTN1N0pP > cjhaWVExNkNKK3FNZ3krN2lTUGZIZ3YzWWdTd1pnYlFMM3pmaFgNCmRtUWZDMmhxYU9HYmsv > SUw2TDlpWlRabno4cm0xdmdCdmYwSkNDSEd0dXlmdzQzZUViQTJYMFBJMzIreVVQQkdRa2U5 > czBXM2hjUnUNCjR4U0RKQWMyRjlIWnEweHRRaEZwYU1EMkNZOVZCTTlwaG05bmtTdUVITnM4 > ajRKVkdaL1JLVjUvWHlYcjA5QjA1VVJ6YVMxbnV0Tk0NCkRFUmZSYkE1QWNFN1NrdkJSTEpk > K21YTzcwYTBmcGJERlNjMU1BU2x5bmgzVXdVQ1o0RGpGU2U5bUhobHU3SEt3SmFNd2ZxRmhG > SnMNCjQ4dmFiTnJoWFV4MHdPRXJOSitCZ3ZlVFg3SVIyejdlS1JuT0dUUFZLNTBqbjJPZVUz > SlMvS3BPbHdLU21zeGhVcjN5NDlyZitsUmsNCnJsWkQyaDd5NE93b3BMYlBmclgyS01IM2NP > dFNlZUVHQWx4M29FN1RnUGM1b2l1dTJZS3BDTVBIYUNIbXoxVGs2clk0VHIyNUNPY24NCkNY > QjZGenVxLysyMnFGTlpEWlFqMSs0SVpEN0tIbkl3cm1kb2NsWldYZ1RUY1dpRWFGWUVPa2x3 > MlZKcTJkQWM3M2huUWsvUzBSdnINCmthRE1vb0ZYcS9vV3ZPQUJVUDc2d3NGL0JCTUJBZ0Fw > QWhzakJRa0paZ0dBQmdzSkNBY0RBZ1FWQWdnREJCWUNBd0VDSGdFQ0Y0QUYNCkFsSkJsZGtD > R1FFQUNna1Fibmdxd0R5YkRQbG1PaEFBcFc2WUl6bXhRTndOMTNMOEcvSisxMjB2aVZIaGVS > SFc1eGhVSlh6Y1JrRnANCmI0QXJHT2ZxMEpFeXZ0Ui9MQk9aZUYrVzZiZ0Zob1ZoUTYvRk41 > Smh2Y0gxUjFMa3p4WFh4Yko3WDFKWHRkd1dQcUZKV1Y5K25hUFINCjVZZEd2Y0NvajFpTUxj > L1MxT1lJNkFlM0NRWlpZUjkwWTdISGlKVzQ4b1dlNklNby85RHZaSGF2KzMrMmNTTlNNVGF0 > ZVVlcHBrTWgNCjdVeUovejhHbEE5WjZqN0xITVRUZUZ5NmdWUUtUS08zTllPaUY2K1dTU2VL > d3pMR01MdWhJeG1DcUt4YXlWdWVKL3hFOVM2U0hBTkENCm16VktjSHd6aWwvUGpBWWg4ZDBk > WHdKMkhFRmlKNzI0NDRWZGVKSjU1YkUyZ0Z5elpEdytuT01pYllxcXN1OWlJUVZDdGVXdnd0 > V3gNCk83bG1PWTJBek5qZ29YekExZzI2YWFGQnRTZ1NscXJDc3FicDFIYzNHWDVBakNSR0Z5 > SkRkSlplc1IvS3BBWDdTSU15aGVZK3JUMjENCm5iV3JHTm5IY2Y5SUJmWDNBZjRGWnJUc1Uv > U2hHRFI2eXZuZVZLM0Rra0NWODBqTlRhYXNRUDJJeFFpY1VpaEl1WWpGR3kzaWdZTXYNCkta > aGhMZ1BYREMwVURqYmJIUkF0M25PV2ZKa0I0VVFTWkxxUmtBQkxLbGJPUzdrV29WbkhEM3Zw > ck9nc1VpMlJxbjR5SDNIWFU2QncNCjJ3eElhcjNRcEs0OExXTHRwdFpoTXpPcXM3dFZ4RFhE > T0dhN2xseDBScFJwQ0pRWlRuQXFoOCtvTHBQaCtPQ2tqT01MWGs5UDdoajENCmN6cHNreDNO > UDBwRUhBOFJjM2xQRmpKMzdRTWlSNGpDd1h3RUV3RUNBQ1lGQWxBWlR4TUNHeU1GQ1FsbUFZ > QUdDd2tJQndNQ0JCVUMNCkNBTUVGZ0lEQVFJZUFRSVhnQUFLQ1JCdWVDckFQSnNNK2ZFYkVB > Q3ZFc0RzeUZZZEZXcVBvbXQ3SXU1WExsRFNpYk9qK2Y0R0pCcEINCkliOFAwUUFWYWg0Q2c2 > RGlJK0hRbGl3Z28xZEVPTko4YmkxTjZ0R01RV1dSRzlMQ3cxZWF6WnAyR1J5U0wwZVRkcExM > ZlNackprV0UNCkhpUE5XOUVLUHA4Y0pOQ254VE5KOTQ3TUUzaWNBaUErQzZmdGw2NURhUnZn > OFJqaVFQNHFtUHQ4bm5iYWI2VURNSVlWTyt1ekVnSlENCjRLN254VGsxdUw5TDdwbStYZ1lI > c2xGcmZvMlQyK2MzdUt4a0krWVVFTkxzMmVucHhoRUVaL3l2MkE3OENrRDJRSkZ0WHIyeUp0 > Q3oNCmtqeit0WkZzbDBBTjFJWkRyT1dVRTZXOFEyM00zMGxiMEEwcHRQdWpNS0k3UHZVa0NT > STFhMGpKRXBXQkVJZTJBR3doSTVielNrYkkNCmlYbkNHaU5zRE9LaXhtNURwQVBsR3BVelhC > K0VRS2xtbnFET2NVeWZrYWdrdHBUZy9mZHZwWDV3NFBPc0JnOTJGWEwyWmpZMFRCUTYNClVD > R2NMcjdKdGNNZWtDTDVhL2xsLzVONVBna3pPa3RwaHhqdEZGM3VsNE5hanMwUUpyT0poV2Nv > aVVYMXVIZmJudEwwc3d3TENlcTcNCkFnOUtYbXpBTVFHVlVUeWxuVGp1RWx2alJoUWluSW1l > cVFrcHJzb0YrbTNGazZzNlh0RmZHWDFKbjgxbkY5U29UUmVWb1d1c0ZPS2oNCllVd254anVX > TnRBcDRIMWthR3NMRGlxLzJwSVRmTW82RzlBQnJ6RUlCWGY0K1grUVppR3ZrbVg3Tnl6S3Ur > ODBCUnNkN2wxR0hQaUoNCkt5amUxK3hMdFV1eDQxYlVZdndRRSt4a290eE9HRGJLYVBhK2lN > N0JUUVJQZnl0bEFSQUF4R1pubUNkS05FbExqRjl5TnFEcFNIMWENCmU1VmF5Szk2K1hqSnhj > Z2JtTGsweVg0akMvMWFUeERzenVyWmw2U28rOGM3KytqbDBvSGpzR0FWZ0tHdUphZ1R5R3pW > UFlqTWRNbjANCjNTbkptZ2FCZzRpaHEwVk8wZWhBY1ErZ1Vta1F1b2dycUwrNlNDUXZOUlp2 > MmFsU0Y3S0JKTWFoTkdrdmlxYjJoY0NaMCtFR0g4VysNCmpENDQvYkhDckZKT25TcFBlNGZI > WEZrQUNVTXgwSWthMDBPWFVBQlQ3UmQvZjBqSzlZTUlPdTZjZTRtNCtMOUl1N01DT0pjQ3hY > OFcNCm1xRklOdG9JWGFvVk0zakpTNWVrS21md2t1K2FvVFhDUlY2M1Z1T25UaGl0bkE4Z1I3 > Z0lIemRiNzQwVmU4bTNtWWxkdGprZHA4MlgNCjRiNzBsd3h3SG9FZzZVTUszQ1hYWGRuMlN0 > azlXeGk5eDltSDloNDZSOXYxNUVwZ3h5bThKNWloNkJYUTdWU1FEbEpQVzM1anAzdUQNClNk > b3JmRnpuM083d2ZyOHpwUkRaOG9UeTk3VGxBQTh4dkNCM2tVUDB4MTVza0s2ck5VR0ZrbmNi > NFd6RnI1dXRvZU1JZmpmdGRvMUQNCkVwZVdDcmZ3YVJKRzZzZ0ZsdlFHNWlDLzhLZTd2S1dE > VmpVSlBmVkU2TE02UTd1SlY2S0pwa0RTN1VLS1RkT3B3ZXptN0Q5Zi94Q24NCi92Y2dDWm00 > NCsxdWczd2p2dElIUjRkQnlQQWJoWUpTYjQ0MFlRWkhOWjhHU1VLLzQ1cVM5Qy9CMkgwM3J4 > VUNIc1QrMEx5R09EKzQNCjBkUVRhaGNNTUp3TEtGeDM3K3hWdnZTY0xBTUNBWk9rK3pJOU40 > SmZMYXl2Y1pvZFhsOEFFUUVBQWNMQlpRUVlBUUlBRHdVQ1QzOHINClpRSWJEQVVKQ1dZQmdB > QUtDUkJ1ZUNyQVBKc00rVXpVRC80Ni9UWnNWTDRIK3ZNTmd1VHZDbXVsM3p0SytONW94d1hM > WkZNM2dDWVINCkV5Lzc4M0lLcG9IN1VTT2FyWlhhbjVYVitPdUpxS3B6bkpKSnVVV096TVNB > cnFZZHBPYmJ4anU5UE5NTEZjNnlIWkZLemtnZGJMOTANCmZOc1hqczQyR0V1VmdrOHZxbzVh > SHFkZW9ablZIV2l1N0RKdTBVN3J5dllPM2hwYUlRd1dTU0Juck5hdnoyNm0rYlIzWEVhNCtv > RXYNCm16TUVQOURHLzR5bUtGaE9nQnZqd0RHOXhrbjFwN05veXcrMTdjRVRZcC9rRTBDcEti > dGFzaFYvUU81K0Qxc0UwakoyUXkrVG1YaWwNCjUyTm5taGdOWlltKzZxM1VZVm04SjNqNHNZ > ektHTEFVUnBQa0puZmpTejZPbE1Kc2NCYWtRWi9vdWwvZWI2REN0dnFXZ1pUeU1MOTINCmsz > WnZRUGJrMFpNMTU5b3NDS2JrcFlFKzllcGdMYkxJUStIYWVORHg4VWtRY1dCUkg5cU0rUm5q > YlFFQldjNnFJaWhnV0s1VjhOYUINCmZBTW5VUDZNQlNrM1E3OXlWdlRCSjJ5b3lMbVFxT3c1 > YnRPamhiTzBibWJ5eEhPN1dQNmZGOVR1c3hEN281anB6aUpCY1RERmc2ZTANCjkrZWw0c2U4 > Tkhta3lLNG54RGRsSWFaa0hrNEFHTXYyOFkwdE1NMWZ2QnVJelRDZS82c0V5ajNTcWsvZ2hk > UmNDMEp0SGN0UUY0L3gNCmp3TEZsV0hqUXRiVGpPMkVsd1AvRmtKQ2xPUy85VmEyZDBDWGIz > bXYvK0d1YmtuR0FuWkpjNk9tbU1SOXRaQ2Iycm9MZmJVeHJXcTENCjNPL01TbU5rOUszMFhY > SHVlNkRLMmtoUWlMNmEwajRVbGNiQlRnUlRueWU0QVJBQXJlak1oOVN4TitiTFdXckxqMUll > OWFDa3NHYU4NCnJvKytMeE1nR0xmZzh2MW5nVHBPVEdRT3h4N25hcjI4bk1VMm45YjZhTGpi > bTFKT1hFM2luNVVvdHU4YmI3amh6a0xSeDN6TWx4UisNCkZJSisrMVN1RkQyMkdXZGV2ZEVa > SFlGZU52cVhNTjZHeTduSHRhY1VMTHRRTmNjcHRYNldTN1g3Mk01cVVZM2I5dld6alIvc2Vp > dG0NCkFLS2U4ZGZ2OW9uYjdLWFNkTTJxR2piQ29EMEhUZGxtbTc3VUliZVVHbGNCd05yTWpz > a2NndXFTczMzb2k3L1Z1WnR3UEg2WGxSN0MNCldNMHZOaWtrRFROODdUV2FZanJtMHZHZUJQ > bmE2NGloVUxCVE96cjN4QS9QQVlMbjJZNTB3RmNxdktYVVpzSGVBTzkxaTJpb2w5d1gNCkk2 > T2M4dEkyU01XTGlvd3JoVTBLK0JXS09YYU0wWXRDSXFyejBjN05FYmxpWEpUYlZFN0hKLzRn > WlJmZkRBRDV3eFZCQkFiTWJYUloNCjhnNGVoQjZYZkc3S1NlM1hITCtRZ0ZkOGVaNWFqOU9m > K2d6ZnF3YWxvc1JKMFRPV2JuaUxPR2tZcm9HTk1DSWVkbHJ2bXl2YXFkUEENCmwyRGlCNkNi > dmsxY0JMeVU0RUIvSWluRVIzcXpVSXZwczFkamt0TmtMM1dMSVQ0QUxrMmZ3ZEdRc0JzbVFI > OEMveDB6R0JHYXZhUFoNClJTT3BEdHJZYlA5QzlXcnNHdit5Rkc0TnByOFBIb0tKa3g1MlZD > RDJRNTEyY3l5UDVSUUZvSERQQytCREtXRVpmbFdBbkNLOVozOTkNCmhYdU52MjExdlcvdnV4 > TFRreVIwQnR2aEd6L0N4SFlCWVN5Z1RGb0h4T2xOUHVVQUlNRXRieWZDd2ZjRUlBRUNBS0VG > QWxleW9GeWENCkhRSlVhR2x6SUd0bGVTQjNZWE1nWjJWdVpYSmhkR1ZrSUdGeklIQmhjblFn > YjJZZ2RHaGxJRVYyYVd3ek1pQndjbTlxWldOMExncEoNCmRDQnBjeUJ1YjNRZ2IzZHVaV1Fn > WW5rZ2RHaGxJSFZ6WlhJZ1pHVnpZM0pwWW1Wa0lHbHVJSFJvWlNCVlNVUXVDbE5sWlNCb2RI > UncNCmN6b3ZMMlYyYVd3ek1pNWpiMjB2Y21WMmIydGxaQ0JtYjNJZ2JXOXlaU0JrWlhSaGFX > eHpMZ0FLQ1JCOXB1ZVJQSnNNK2VhbEQvNHMNCkVMc0ZIa0dZVmp0S3pNOWJIbU81M0VjbVZ4 > ejVRTldmTWRyZE4zcHVkYS96SzlCYTU0VGErRFBNWXNWeXF6TDcwUmI1djIxU1hvVjANCjBH > U2lSY2pjMnpMU2RDS2xldW5FWGdvWXNCaGtickFibWRsZFVOeXB6cWhpYmlDbEhXM0kyWGgv > S2tsdW43UlBlM2ZtU2xORUV4b0INCnRmUld5d2t2MkFMMG1jVHNMc1VhdFVMQWZpL1paT3hV > SWczMC9NNElycWY3dlE1TDBlV3BiR1Q5Y3V5OGV5N1lScHhhRVUyb05yaVgNCjVSaXFnRm4x > b1Q2aWVNMUtxOHA2aTJCaDF0NnlxbFBTS2ZDOGFYcGl1V1pQVTZ0OXZNRGlibzlMck1FMEtL > cXNoU3IyQ013UUZ3UjcNClNUUWI3TjFUTE5QdlQwTXduZVUwMEdyKzJCTGJQVmNEbGJ6ck0z > UzlPcmd6emFEcENpRzVPRUZTakQvMC9XYUZSZ0lrWGNFUjVHOHANCnZFY1VqbjRpbzNmOHJY > dWZEQklhK29XN2NuWmVzM1dmano4bUVMQmNuaVBISWlUSTloU3dWb1RxeTRxeHc5dTEvelRm > WllSdnRFSlINCktNK3ZaZlViRlQrRkNkVS9ESlNqNXN4MzRWT1hwUW1NWnpYekYvU1FMTk8y > M3lUdWpjc3dVbUFEdkpBQ2ltRWNoKzhyeFVFWk1nM0sNCmxaWGRQK0FuYTU1MFp1L2YwSFVI > RXBhb1dZdVN2c1JWNnBPak5POEE0M0VSMVZ6ZXdJS0lzVVY2cDYyMFdHMVo0UEJwWUlIL1B5 > Yi8NCmxub2pENThOWXBtOFdBOHVvdjg3ZTlMd0R6MU1OWWdjN1l0VE1RbGRNQitnMGdFUGVp > Vm50MHIxdWhZNExMc05XaUR6K2MyVng4MGsNClFuSjVZVzRnUkhKbGQyVnllU0E4WW1SeVpY > ZGxjbmxBUm5KbFpVSlRSQzV2Y21jK3dzRitCQk1CQWdBb0Foc3ZCZ3NKQ0FjREFnWVYNCkNB > SUpDZ3NFRmdJREFRSWVBUUlYZ0FVQ1UrQWNHQVVKQlVVSllBQUtDUkI5cHVlUlBKc00rZnlI > RUFDVjhGU0Q1Q2RSWUQ0dFBweUMNCmF0NTlUeUkwajhWTUd2N2NjWGcrTzJwN1czUjZWYWlL > dTBNNi9BbjcwYmJCdWVjMXJkeXUrUTFmM2dXL3c1LysrdmZMZG41MTg1cXYNClNrYjgvM0p0 > TEhmQktPYThJYTJYd0NPRUI2cDJ0TFg3VTZQdzUydFdlclhjdjdjUlA2SUY5K1g1S0xpd1FE > cmNnbzFKaEUwMk5LeVMNCmxnam85WFZFN3FQUTVpbnhiT1ptRW8waDlXNjFKb0dwSUlIcitq > RzJwNGFvK0daVlhiZDNPc05sWVA4ZHlTS0tQSXZWdlRzeVMvM0kNCk5kRjg1dUE4cDNEL0lQ > NHQrYzNsOUM2MVJPQkp0cmQ0cnR2YmZqT0NJK2lWOE4rT3ArZjJpN01DeVhZUmY5TWlET0My > SWFwZ1BMR1kNCktEa1RURFMzK2NTbUg3WE8zSS94TEIydjJXWlVFa0wxYktQT1NodWlNWk55 > MkUzRmpVS29FZXhWRFBhZEdHMHBsTTM3a3l0amZEa2wNCmoyVnNDY1h1UFl0UjF0V29mcE14 > MU1xWDFteGhuNjRkZ0FJN3RMbGcwOUJPYUIxY0prZE10UDZYMEJYMEdVczJBK0trc2F1YnZz > ZHoNCjNONDN4Z1c4RmQ1MzFBZWU1d0ZUd1VEMkcyT1NWOWhkSFhoSkhUTVFHdDhIU3lzRDBS > Z2R5OUNLazk2bEFVQk11QzVGNy9na085M1kNCmVRVW5iTVIzVkJlc3BraEgzSmtoMnNNZHNB > MkZpQllSZVBac1dMdEdMOGlxQXlHNUtMU2Yva2RyY210M3RDNUxKMndKa2lzOGtRYVoNCmdK > VW5Vc291MUpjaU1mWlBsZEpMVEtBUHhtelBuM0RLa3RQUUdxUnhQWW1HR2Jma1FYYWNpMXYv > LzhiQVRnUlRucFd4QVFnQW01OXoNCjRzVk1JeU84Lzl6WVpWTVlWZDZlVVNvMUxWbktVbmdR > M2h0ZGxPWjZncHZBMnc5VEhBUmUxam40dEcycFpCMkVqV0puSkJoa0NVNisNCmpXRFNyaTNP > S2xmVmh4Ym40dm1zV2ZwZmh0OVU3L3dCSkliejZ4elFOZnJlT2tXWlU0VHpBTTMrSUhwS2ZU > cDB4MEpCbVpZdURCUEoNCmJNKzlBSVgvYThIcTFqZGF0OHUrcFZqWXVJOUtvQVJFUnczZE1V > eEdlbGphQkNYREZDMmVKa0YrcDJpckp0Vnh4MUk2OU5sdnh2c2YNCkk2enRDQ1VxM3paZGUy > K0V4K0IvTkF5bWxaMzd2RE1oWFozMldsai9BQlFYQk5QQUp1QTRLdEprdzZRcGdkSXl0L05C > K0kxVC83bWQNCk02Vzhwb2ptTTAzb1Zkcmg0Tm9NWnIyaHBGNDdIUzZjQVFBZzZVS0RxOExB > OXdRZ0FRSUFvUVVDVjdLZ2o1b2RBbFJvYVhNZ2EyVjUNCklIZGhjeUJuWlc1bGNtRjBaV1Fn > WVhNZ2NHRnlkQ0J2WmlCMGFHVWdSWFpwYkRNeUlIQnliMnBsWTNRdUNrbDBJR2x6SUc1dmRD > QnYNCmQyNWxaQ0JpZVNCMGFHVWdkWE5sY2lCa1pYTmpjbWxpWldRZ2FXNGdkR2hsSUZWSlJD > NEtVMlZsSUdoMGRIQnpPaTh2WlhacGJETXkNCkxtTnZiUzl5WlhadmEyVmtJR1p2Y2lCdGIz > SmxJR1JsZEdGcGJITXVBQW9KRU1EeS9ldHVScGZQOTFjSC8yYjdzYk54MEpwUlZSQkQNCkIr > VDdMK0Evbml1dnlKcFRoZ3pmK3JJK1ZjdVBiSkdmdDJUNzM4NzQzY0V1VzMxM3dmanpTL1My > RlczV0hJUFI5TG9RTG11VitsVk8NCm0xY0cxZlhLRGoxdGdBOW8yTkhEUkpjajk4cDVYK2NG > eGg5Q1U3SlQ2T2ZrZ2JROGhpQWd2N2hWYkNwQVplK3hyNFlFeHlMNHo4WmoNCmhRM3drWURE > Z3FyMWhleFlWVWEzenVVK1FGQXJ4eEhld0V0cVF1bC9VLzlIamNpRmY1dmUzTnFvSUF5c2ZD > YXE5dmdBelNzRzVUSkQNCmY5akZtNnE1ek5kOER3Y0hHSG5oRTRheitXOUg4MWxHckR5S1VH > ZVRXZ2ZyN0dnSkpyQkFjTEh5Y3B4WHlzdDU3a2hUUDhPUEZOdmgNCmlKNUtiWi9LNXMvQWVP > YjlHNVpVcmVyTkpFSnllV0Z1SUVSeVpYZGxjbmtnUEdKa2NtVjNaWEo1UUVaeVpXVkNVMFF1 > YjNKblBzTEENCmZnUVRBUUlBS0FJYkx3WUxDUWdIQXdJR0ZRZ0NDUW9MQkJZQ0F3RUNIZ0VD > RjRBRkFsUGdMWGtGQ1FndjNjZ0FDZ2tRd1BMOTYyNUcNCmw4OGFCUWYvWEhxbCtXY0U1QTA2 > Vnlpc2ZTSnhYVEM1cUxSSjl4Ti9vOHNrKzdXVnFUK0ptSHB5Q3VrbWo5SXd0UElTVEgycjZx > bnkNCjExcTViT3RJZUxUNFFZSklhKzdVcVNyZ1VVZHVKcHhGTzN5ZWVwYkJxdWhEbmZzNnBq > NzNPMFpIM3RpdlZxVytiaGg1RDkrZlFwRGkNCmNRTlZwWDk0TmpsTys5anVCd0wzc2JZTUVu > YTAvTFg4UUF1ZGtRZDMyczdUK2ZHOVd3WDhWVm1mRTZBeUZLM1I2eXFhQjVyajMyWVkNCkdv > SmNLcXRsQitVNThLK3h2a0N2N1lDc1Z1TWRJc0E0Y25yRDNuWDdMZENkTUtKemhnam5USmty > Mlh5QkFGQWs4dVhEdTdPTEtYMnINCjBKb1BsVnEzdytVZWZqeDdrMTZvSlZRZUtRT3NDbm1r > QXl2c3JFZW04QWVMaGc9PQ0KPWtySU8NCi0tLS0tRU5EIFBHUCBQVUJMSUMgS0VZIEJMT0NL > LS0tLS0NCg== > --------------9CBC57D81FB1CF44779F663A-- > > --xQRNdJYoXBOGEU9TCnYnmX8FWGVxUTnsh-- > > --DvEGZHRjSTag0u76mwejgpWCFKL1X8kJx > Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" > Content-Description: OpenPGP digital signature > Content-Disposition: attachment; filename="OpenPGP_signature" > > -----BEGIN PGP SIGNATURE----- > > wsB5BAABCAAjFiEE+Rc8ssOq6npcih8JNddxu25Gl88FAl+po4cFAwAAAAAACgkQNddxu25Gl89b > 1ggAues8XaQpTjYn+ujNLEomZaJVX7zCzvFzMAfdKE4ogwi0Bdaaj+43FnJm+aEf6YQV/d8+9A4x > MhJW1CaIShmm4z7ZwwtREtGgMHZ0qW4uW7/gKhQZq+ARbKvUvY5nCNlUu2taA8h63YlCUkV59OXT > RGx6Rw7SKvkbv6mXpDw+WUXbGrPcSAUdNhhfyHGWXegxmGRx5VcjzjxMVb7T7PHgFTqQqkXYeRKS > WZORZ0GXq2TSCcq/JcWRyEOjLqFUmzZ26ZHICiGLtlhsqQMfNoajrvwa1w5v21aFYajXaztjI17j > X+Q90XVoCWK3tBMrdH9UhIuqMpIqGMCEZm+T5T3fmQ== > =GE65 > -----END PGP SIGNATURE----- > > --DvEGZHRjSTag0u76mwejgpWCFKL1X8kJx-- From owner-svn-src-head@freebsd.org Tue Nov 10 10:17:12 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 03C2C2EA3C7; Tue, 10 Nov 2020 10:17:12 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVkLb6bKkz3Qbp; Tue, 10 Nov 2020 10:17:11 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D5110211D7; Tue, 10 Nov 2020 10:17:11 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AAAHBZc027275; Tue, 10 Nov 2020 10:17:11 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AAAHBjE027274; Tue, 10 Nov 2020 10:17:11 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202011101017.0AAAHBjE027274@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Tue, 10 Nov 2020 10:17:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367549 - head X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 367549 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 10 Nov 2020 10:17:12 -0000 Author: 0mp (doc,ports committer) Date: Tue Nov 10 10:17:11 2020 New Revision: 367549 URL: https://svnweb.freebsd.org/changeset/base/367549 Log: Add an entry to RELNOTES about renaming ACPI_DMAR to IOMMU Reviewed by: br (earlier version) Differential Revision: https://reviews.freebsd.org/D26813 Modified: head/RELNOTES Modified: head/RELNOTES ============================================================================== --- head/RELNOTES Tue Nov 10 08:59:55 2020 (r367548) +++ head/RELNOTES Tue Nov 10 10:17:11 2020 (r367549) @@ -10,6 +10,11 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +r366267: + Kernel option ACPI_DMAR was renamed to IOMMU. amd64's IOMMU subsystem + was split out from amd64 DMAR support and is now generic, i.e., it can + be used by all architectures. + r364896: A series of commits ending with r364896 added NFS over TLS to the kernel. This is believed to be compatible with From owner-svn-src-head@freebsd.org Tue Nov 10 10:40:45 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8088E2EAEC2; Tue, 10 Nov 2020 10:40:45 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVksn3DDNz3hkZ; Tue, 10 Nov 2020 10:40:45 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 61AEA216A8; Tue, 10 Nov 2020 10:40:45 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AAAejXa040101; Tue, 10 Nov 2020 10:40:45 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AAAejw6040085; Tue, 10 Nov 2020 10:40:45 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202011101040.0AAAejw6040085@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Tue, 10 Nov 2020 10:40:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367551 - head X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 367551 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 10 Nov 2020 10:40:45 -0000 Author: 0mp (doc,ports committer) Date: Tue Nov 10 10:40:44 2020 New Revision: 367551 URL: https://svnweb.freebsd.org/changeset/base/367551 Log: Add an entry for r351863 (honoring ${name}_env in rc(8) scripts) PR: 239692 Requested by: koobs Modified: head/RELNOTES Modified: head/RELNOTES ============================================================================== --- head/RELNOTES Tue Nov 10 10:19:55 2020 (r367550) +++ head/RELNOTES Tue Nov 10 10:40:44 2020 (r367551) @@ -157,6 +157,13 @@ r352304: ntpd is no longer by default locked in memory. rlimit memlock 32 or rlimit memlock 0 can be used to restore this behaviour. +r351863: + rc.subr(8) now honors ${name}_env in all rc(8) scripts. Previously, + environment variables set by a user via ${name}_env were ignored + if the service defined a custom *_cmd variable to control the behavior + of the run_rc_command function, e.g., start_cmd, instead of relying on + the variables like command and command_args, + r351770,r352920,r352922,r352923: dd(1) now supports conv=fsync, conv=fdatasync, oflag=fsync, oflag=sync, and iflag=fullblock flags, compatible with illumos and GNU. From owner-svn-src-head@freebsd.org Tue Nov 10 11:32:02 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9E2842EC786; Tue, 10 Nov 2020 11:32:02 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVm0y48W4z3ls6; Tue, 10 Nov 2020 11:32:02 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 818CC2239F; Tue, 10 Nov 2020 11:32:02 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AABW2bo074754; Tue, 10 Nov 2020 11:32:02 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AABW2Em074753; Tue, 10 Nov 2020 11:32:02 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202011101132.0AABW2Em074753@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Tue, 10 Nov 2020 11:32:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367552 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 367552 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 10 Nov 2020 11:32:02 -0000 Author: 0mp (doc,ports committer) Date: Tue Nov 10 11:32:01 2020 New Revision: 367552 URL: https://svnweb.freebsd.org/changeset/base/367552 Log: Do not document MOTIFLIB in ports(7) Perhaps it made sense in 1998 (r32836), but now it feels a bit out of place. We tend to avoid documenting non-essential ports variables in the manual page (we try to document them in the Porter's Handbook instead). MFC after: 1 week Modified: head/share/man/man7/ports.7 Modified: head/share/man/man7/ports.7 ============================================================================== --- head/share/man/man7/ports.7 Tue Nov 10 10:40:44 2020 (r367551) +++ head/share/man/man7/ports.7 Tue Nov 10 11:32:01 2020 (r367552) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 3, 2020 +.Dd November 10, 2020 .Dt PORTS 7 .Os .Sh NAME @@ -509,9 +509,6 @@ Normally .Xr fetch 1 . .It Va FORCE_PKG_REGISTER If set, overwrite any existing package registration on the system. -.It Va MOTIFLIB -Location of -.Pa "libXm\&." Ns Brq Pa a , Ns Pa so . .It Va INTERACTIVE If defined, only operate on a port if it requires interaction. .It Va BATCH From owner-svn-src-head@freebsd.org Tue Nov 10 12:58:26 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5F04D2EF771; Tue, 10 Nov 2020 12:58:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVnwf2JGxz3sPr; Tue, 10 Nov 2020 12:58:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 41F2E2305F; Tue, 10 Nov 2020 12:58:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AACwQY5026424; Tue, 10 Nov 2020 12:58:26 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AACwQFV026423; Tue, 10 Nov 2020 12:58:26 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202011101258.0AACwQFV026423@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 10 Nov 2020 12:58:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367555 - head/sys/dev/mlx4/mlx4_ib X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx4/mlx4_ib X-SVN-Commit-Revision: 367555 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 10 Nov 2020 12:58:26 -0000 Author: hselasky Date: Tue Nov 10 12:58:25 2020 New Revision: 367555 URL: https://svnweb.freebsd.org/changeset/base/367555 Log: Include GID type when deleting GIDs from HW table under RoCE in mlx4ib. Refer to the Linux commit mentioned below for a more detailed description. Linux commit: a18177925c252da7801149abe217c05b80884798 Requested by: Isilon MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c Modified: head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c ============================================================================== --- head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c Tue Nov 10 12:45:59 2020 (r367554) +++ head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c Tue Nov 10 12:58:25 2020 (r367555) @@ -371,8 +371,13 @@ static int mlx4_ib_del_gid(struct ib_device *device, if (!gids) { ret = -ENOMEM; } else { - for (i = 0; i < MLX4_MAX_PORT_GIDS; i++) - memcpy(&gids[i].gid, &port_gid_table->gids[i].gid, sizeof(union ib_gid)); + for (i = 0; i < MLX4_MAX_PORT_GIDS; i++) { + memcpy(&gids[i].gid, + &port_gid_table->gids[i].gid, + sizeof(union ib_gid)); + gids[i].gid_type = + port_gid_table->gids[i].gid_type; + } } } spin_unlock_bh(&iboe->lock); From owner-svn-src-head@freebsd.org Tue Nov 10 14:17:05 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D194D432112; Tue, 10 Nov 2020 14:17:05 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVqgP5cdqz4Sh4; Tue, 10 Nov 2020 14:17:05 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF0AC241A4; Tue, 10 Nov 2020 14:17:05 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AAEH53L075050; Tue, 10 Nov 2020 14:17:05 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AAEH5W6075049; Tue, 10 Nov 2020 14:17:05 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202011101417.0AAEH5W6075049@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Tue, 10 Nov 2020 14:17:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367567 - head/sbin/reboot X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/sbin/reboot X-SVN-Commit-Revision: 367567 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 10 Nov 2020 14:17:05 -0000 Author: 0mp (doc,ports committer) Date: Tue Nov 10 14:17:05 2020 New Revision: 367567 URL: https://svnweb.freebsd.org/changeset/base/367567 Log: Address a mandoc warning MFC after: 3 days Modified: head/sbin/reboot/boot_i386.8 Modified: head/sbin/reboot/boot_i386.8 ============================================================================== --- head/sbin/reboot/boot_i386.8 Tue Nov 10 13:36:07 2020 (r367566) +++ head/sbin/reboot/boot_i386.8 Tue Nov 10 14:17:05 2020 (r367567) @@ -89,7 +89,7 @@ from partition of either the floppy or the hard disk. This boot may be aborted by typing any character on the keyboard at the -.Ql boot: +.Ql boot\&: prompt. At this time, the following input will be accepted: .Bl -tag -width indent From owner-svn-src-head@freebsd.org Tue Nov 10 14:21:23 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 97ED3431F60; Tue, 10 Nov 2020 14:21:23 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVqmM3qJbz4T7g; Tue, 10 Nov 2020 14:21:23 +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 7692823FC4; Tue, 10 Nov 2020 14:21:23 +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 0AAELNth076775; Tue, 10 Nov 2020 14:21:23 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AAELNtk076774; Tue, 10 Nov 2020 14:21:23 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011101421.0AAELNtk076774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 10 Nov 2020 14:21:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367568 - head/sys/contrib/openzfs/module/zfs X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/contrib/openzfs/module/zfs X-SVN-Commit-Revision: 367568 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 10 Nov 2020 14:21:23 -0000 Author: mjg Date: Tue Nov 10 14:21:23 2020 New Revision: 367568 URL: https://svnweb.freebsd.org/changeset/base/367568 Log: zfs: g/c unused data_alloc_arena Modified: head/sys/contrib/openzfs/module/zfs/zio.c Modified: head/sys/contrib/openzfs/module/zfs/zio.c ============================================================================== --- head/sys/contrib/openzfs/module/zfs/zio.c Tue Nov 10 14:17:05 2020 (r367567) +++ head/sys/contrib/openzfs/module/zfs/zio.c Tue Nov 10 14:21:23 2020 (r367568) @@ -144,7 +144,6 @@ void zio_init(void) { size_t c; - vmem_t *data_alloc_arena = NULL; zio_cache = kmem_cache_create("zio_cache", sizeof (zio_t), 0, NULL, NULL, NULL, NULL, NULL, 0); @@ -213,8 +212,7 @@ zio_init(void) (void) snprintf(name, sizeof (name), "zio_data_buf_%lu", (ulong_t)size); zio_data_buf_cache[c] = kmem_cache_create(name, size, - align, NULL, NULL, NULL, NULL, - data_alloc_arena, data_cflags); + align, NULL, NULL, NULL, NULL, NULL, data_cflags); } } From owner-svn-src-head@freebsd.org Tue Nov 10 14:23:47 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9DA9B432612; Tue, 10 Nov 2020 14:23:47 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVqq7477jz4TCK; Tue, 10 Nov 2020 14:23:47 +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 8095823FCA; Tue, 10 Nov 2020 14:23:47 +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 0AAENl0j080608; Tue, 10 Nov 2020 14:23:47 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AAENlZH080607; Tue, 10 Nov 2020 14:23:47 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011101423.0AAENlZH080607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 10 Nov 2020 14:23:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367569 - head/sys/contrib/openzfs/module/zfs X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/contrib/openzfs/module/zfs X-SVN-Commit-Revision: 367569 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 10 Nov 2020 14:23:47 -0000 Author: mjg Date: Tue Nov 10 14:23:46 2020 New Revision: 367569 URL: https://svnweb.freebsd.org/changeset/base/367569 Log: zfs: combine zio caches if possible This deduplicates 2 sets of caches using the same sizes. Memory savings fluctuate a lot, one sample result is buildworld on zfs saving ~180MB RAM in reduced page count associated with zio caches. Modified: head/sys/contrib/openzfs/module/zfs/zio.c Modified: head/sys/contrib/openzfs/module/zfs/zio.c ============================================================================== --- head/sys/contrib/openzfs/module/zfs/zio.c Tue Nov 10 14:21:23 2020 (r367568) +++ head/sys/contrib/openzfs/module/zfs/zio.c Tue Nov 10 14:23:46 2020 (r367569) @@ -204,6 +204,19 @@ zio_init(void) if (align != 0) { char name[36]; + if (cflags == data_cflags) { + /* + * Resulting kmem caches would be identical. + * Save memory by creating only one. + */ + (void) snprintf(name, sizeof (name), + "zio_buf_comb_%lu", (ulong_t)size); + zio_buf_cache[c] = kmem_cache_create(name, + size, align, NULL, NULL, NULL, NULL, NULL, + cflags); + zio_data_buf_cache[c] = zio_buf_cache[c]; + continue; + } (void) snprintf(name, sizeof (name), "zio_buf_%lu", (ulong_t)size); zio_buf_cache[c] = kmem_cache_create(name, size, @@ -234,37 +247,55 @@ zio_init(void) void zio_fini(void) { - size_t c; - kmem_cache_t *last_cache = NULL; - kmem_cache_t *last_data_cache = NULL; + size_t i, j, n; + kmem_cache_t *cache; - for (c = 0; c < SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT; c++) { -#ifdef _ILP32 - /* - * Cache size limited to 1M on 32-bit platforms until ARC - * buffers no longer require virtual address space. - */ - if (((c + 1) << SPA_MINBLOCKSHIFT) > zfs_max_recordsize) - break; -#endif + n = SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT; + #if defined(ZFS_DEBUG) && !defined(_KERNEL) - if (zio_buf_cache_allocs[c] != zio_buf_cache_frees[c]) + for (i = 0; i < n; i++) { + if (zio_buf_cache_allocs[i] != zio_buf_cache_frees[i]) (void) printf("zio_fini: [%d] %llu != %llu\n", - (int)((c + 1) << SPA_MINBLOCKSHIFT), - (long long unsigned)zio_buf_cache_allocs[c], - (long long unsigned)zio_buf_cache_frees[c]); + (int)((i + 1) << SPA_MINBLOCKSHIFT), + (long long unsigned)zio_buf_cache_allocs[i], + (long long unsigned)zio_buf_cache_frees[i]); + } #endif - if (zio_buf_cache[c] != last_cache) { - last_cache = zio_buf_cache[c]; - kmem_cache_destroy(zio_buf_cache[c]); + + /* + * The same kmem cache can show up multiple times in both zio_buf_cache + * and zio_data_buf_cache. Do a wasteful but trivially correct scan to + * sort it out. + */ + for (i = 0; i < n; i++) { + cache = zio_buf_cache[i]; + if (cache == NULL) + continue; + for (j = i; j < n; j++) { + if (cache == zio_buf_cache[j]) + zio_buf_cache[j] = NULL; + if (cache == zio_data_buf_cache[j]) + zio_data_buf_cache[j] = NULL; } - zio_buf_cache[c] = NULL; + kmem_cache_destroy(cache); + } - if (zio_data_buf_cache[c] != last_data_cache) { - last_data_cache = zio_data_buf_cache[c]; - kmem_cache_destroy(zio_data_buf_cache[c]); + for (i = 0; i < n; i++) { + cache = zio_data_buf_cache[i]; + if (cache == NULL) + continue; + for (j = i; j < n; j++) { + if (cache == zio_data_buf_cache[j]) + zio_data_buf_cache[j] = NULL; } - zio_data_buf_cache[c] = NULL; + kmem_cache_destroy(cache); + } + + for (i = 0; i < n; i++) { + if (zio_buf_cache[i] != NULL) + panic("zio_fini: zio_buf_cache[%d] != NULL", (int)i); + if (zio_data_buf_cache[i] != NULL) + panic("zio_fini: zio_data_buf_cache[%d] != NULL", (int)i); } kmem_cache_destroy(zio_link_cache); From owner-svn-src-head@freebsd.org Tue Nov 10 18:05:18 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2A11D437AEE; Tue, 10 Nov 2020 18:05:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVwkk0jKtz4jB3; Tue, 10 Nov 2020 18:05:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B2F426B74; Tue, 10 Nov 2020 18:05:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AAI5H5I015965; Tue, 10 Nov 2020 18:05:17 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AAI5HHT015964; Tue, 10 Nov 2020 18:05:17 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <202011101805.0AAI5HHT015964@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 10 Nov 2020 18:05:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367570 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 367570 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 10 Nov 2020 18:05:18 -0000 Author: bdrewery Date: Tue Nov 10 18:05:17 2020 New Revision: 367570 URL: https://svnweb.freebsd.org/changeset/base/367570 Log: makeman: Don't require filemon with MK_DIRDEPS_BUILD. MFC after: 2 weeks Reviewed by: sjg, dim (tested earlier version) Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D27134 Modified: head/share/mk/local.meta.sys.mk Modified: head/share/mk/local.meta.sys.mk ============================================================================== --- head/share/mk/local.meta.sys.mk Tue Nov 10 14:23:46 2020 (r367569) +++ head/share/mk/local.meta.sys.mk Tue Nov 10 18:05:17 2020 (r367570) @@ -178,6 +178,10 @@ LDFLAGS_LAST+= -L${STAGE_LIBDIR} # we can use this but should not update it. UPDATE_DEPENDFILE= NO .endif +# Don't require filemon for makeman. +.if make(showconfig) +UPDATE_DEPENDFILE= NO +.endif # define the list of places that contain files we are responsible for .MAKE.META.BAILIWICK = ${SB} ${OBJROOT} ${STAGE_ROOT} From owner-svn-src-head@freebsd.org Tue Nov 10 18:10:51 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 66B59460B53; Tue, 10 Nov 2020 18:10:51 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVws72Wq4z4jWq; Tue, 10 Nov 2020 18:10:51 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4892427074; Tue, 10 Nov 2020 18:10:51 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AAIApSx017212; Tue, 10 Nov 2020 18:10:51 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AAIApms017211; Tue, 10 Nov 2020 18:10:51 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011101810.0AAIApms017211@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 10 Nov 2020 18:10:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367572 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 367572 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 10 Nov 2020 18:10:51 -0000 Author: mjg Date: Tue Nov 10 18:10:50 2020 New Revision: 367572 URL: https://svnweb.freebsd.org/changeset/base/367572 Log: Allow rtprio_thread to operate on threads of any process This in particular unbreaks rtkit. The limitation was a leftover of previous state, to quote a comment: /* * Though lwpid is unique, only current process is supported * since there is no efficient way to look up a LWP yet. */ Long since then a global tid hash was introduced to remedy the problem. Permission checks still apply. Submitted by: greg_unrelenting.technology (Greg V) Differential Revision: https://reviews.freebsd.org/D27158 Modified: head/sys/kern/kern_resource.c Modified: head/sys/kern/kern_resource.c ============================================================================== --- head/sys/kern/kern_resource.c Tue Nov 10 18:07:13 2020 (r367571) +++ head/sys/kern/kern_resource.c Tue Nov 10 18:10:50 2020 (r367572) @@ -315,8 +315,7 @@ sys_rtprio_thread(struct thread *td, struct rtprio_thr td1 = td; PROC_LOCK(p); } else { - /* Only look up thread in current process */ - td1 = tdfind(uap->lwpid, curproc->p_pid); + td1 = tdfind(uap->lwpid, -1); if (td1 == NULL) return (ESRCH); p = td1->td_proc; From owner-svn-src-head@freebsd.org Tue Nov 10 18:12:09 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BA652460C22; Tue, 10 Nov 2020 18:12:09 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVwtd4xjCz4jYK; Tue, 10 Nov 2020 18:12:09 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9CEB2271ED; Tue, 10 Nov 2020 18:12:09 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AAIC9r3022069; Tue, 10 Nov 2020 18:12:09 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AAIC9WO022068; Tue, 10 Nov 2020 18:12:09 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <202011101812.0AAIC9WO022068@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Tue, 10 Nov 2020 18:12:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367573 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 367573 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 10 Nov 2020 18:12:09 -0000 Author: jtl Date: Tue Nov 10 18:12:09 2020 New Revision: 367573 URL: https://svnweb.freebsd.org/changeset/base/367573 Log: When destroying a UMA zone which has a reserve (set with uma_zone_reserve()), messages like the following appear on the console: "Freed UMA keg (Test zone) was not empty (0 items). Lost 528 pages of memory." When keg_drain_domain() is draining the zone, it tries to keep the number of items specified in the reservation. However, when we are destroying the UMA zone, we do not need to keep those items. Therefore, when destroying a non-secondary and non-cache zone, we should reset the keg reservation to 0 prior to draining the zone. Reviewed by: markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D27129 Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Nov 10 18:10:50 2020 (r367572) +++ head/sys/vm/uma_core.c Tue Nov 10 18:12:09 2020 (r367573) @@ -2791,6 +2791,10 @@ zone_dtor(void *arg, int size, void *udata) rw_wlock(&uma_rwlock); LIST_REMOVE(zone, uz_link); rw_wunlock(&uma_rwlock); + if ((zone->uz_flags & (UMA_ZONE_SECONDARY | UMA_ZFLAG_CACHE)) == 0) { + keg = zone->uz_keg; + keg->uk_reserve = 0; + } zone_reclaim(zone, M_WAITOK, true); /* From owner-svn-src-head@freebsd.org Tue Nov 10 19:04:55 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 22E264619E9; Tue, 10 Nov 2020 19:04: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVy3W0Vsbz4lvP; Tue, 10 Nov 2020 19:04: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 03FE027B14; Tue, 10 Nov 2020 19:04: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 0AAJ4sXv053301; Tue, 10 Nov 2020 19:04:54 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AAJ4sc5053300; Tue, 10 Nov 2020 19:04:54 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202011101904.0AAJ4sc5053300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 10 Nov 2020 19:04:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367574 - head/lib/csu/common X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/lib/csu/common X-SVN-Commit-Revision: 367574 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 10 Nov 2020 19:04:55 -0000 Author: jhb Date: Tue Nov 10 19:04:54 2020 New Revision: 367574 URL: https://svnweb.freebsd.org/changeset/base/367574 Log: Rename __JCR_LIST__ to __JCR_END__ in crtend.c. This is more consistent with the names used for .ctor and .dtor symbols and better reflects __JCR_END__'s role. Reviewed by: andrew Obtained from: CheriBSD MFC after: 2 weeks Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D27125 Modified: head/lib/csu/common/crtend.c Modified: head/lib/csu/common/crtend.c ============================================================================== --- head/lib/csu/common/crtend.c Tue Nov 10 18:12:09 2020 (r367573) +++ head/lib/csu/common/crtend.c Tue Nov 10 19:04:54 2020 (r367574) @@ -28,7 +28,7 @@ __FBSDID("$FreeBSD$"); typedef void (*crt_func)(void); -static crt_func __JCR_LIST__[] __section(".jcr") __used = { +static crt_func __JCR_END__[] __section(".jcr") __used = { (crt_func)0 }; From owner-svn-src-head@freebsd.org Tue Nov 10 19:07:31 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1412F461BE6; Tue, 10 Nov 2020 19:07:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVy6W05kzz4mQj; Tue, 10 Nov 2020 19:07:31 +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 E667827D01; Tue, 10 Nov 2020 19:07:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AAJ7UX9053482; Tue, 10 Nov 2020 19:07:30 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AAJ7Us9053481; Tue, 10 Nov 2020 19:07:30 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202011101907.0AAJ7Us9053481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 10 Nov 2020 19:07:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367575 - head/lib/csu/tests X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/lib/csu/tests X-SVN-Commit-Revision: 367575 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 10 Nov 2020 19:07:31 -0000 Author: jhb Date: Tue Nov 10 19:07:30 2020 New Revision: 367575 URL: https://svnweb.freebsd.org/changeset/base/367575 Log: Fix dso_handle_check for PIE executables. PIE executables use crtbeginS.o and have a non-NULL dso_handle as a result. Reviewed by: andrew, emaste MFC after: 2 weeks Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D27126 Modified: head/lib/csu/tests/fini_test.c Modified: head/lib/csu/tests/fini_test.c ============================================================================== --- head/lib/csu/tests/fini_test.c Tue Nov 10 19:04:54 2020 (r367574) +++ head/lib/csu/tests/fini_test.c Tue Nov 10 19:07:30 2020 (r367575) @@ -141,9 +141,9 @@ dso_handle_check(void) { void *dso = __dso_handle; -#ifdef DSO_LIB +#if defined(DSO_LIB) || defined(__PIE__) ATF_REQUIRE_MSG(dso != NULL, - "Null __dso_handle in DSO"); + "Null __dso_handle in DSO/PIE"); #else ATF_REQUIRE_MSG(dso == NULL, "Invalid __dso_handle in non-DSO"); From owner-svn-src-head@freebsd.org Tue Nov 10 19:09:36 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 73822461D3A; Tue, 10 Nov 2020 19:09:36 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVy8w2vKJz4mRc; Tue, 10 Nov 2020 19:09:36 +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 565492756F; Tue, 10 Nov 2020 19:09:36 +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 0AAJ9ac8053615; Tue, 10 Nov 2020 19:09:36 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AAJ9ZoX053612; Tue, 10 Nov 2020 19:09:35 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202011101909.0AAJ9ZoX053612@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 10 Nov 2020 19:09:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367576 - in head/lib/csu/tests: . dynamic dynamicpie X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/lib/csu/tests: . dynamic dynamicpie X-SVN-Commit-Revision: 367576 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 10 Nov 2020 19:09:36 -0000 Author: jhb Date: Tue Nov 10 19:09:35 2020 New Revision: 367576 URL: https://svnweb.freebsd.org/changeset/base/367576 Log: Add C startup code tests for PIE binaries. - Force dynamic to be a non-PIE binary. - Add a dynamicpie test which uses a PIE binary. Reviewed by: andrew Obtained from: CheriBSD MFC after: 2 weeks Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D27127 Added: head/lib/csu/tests/dynamicpie/ head/lib/csu/tests/dynamicpie/Makefile - copied, changed from r367573, head/lib/csu/tests/dynamic/Makefile Modified: head/lib/csu/tests/Makefile head/lib/csu/tests/dynamic/Makefile Modified: head/lib/csu/tests/Makefile ============================================================================== --- head/lib/csu/tests/Makefile Tue Nov 10 19:07:30 2020 (r367575) +++ head/lib/csu/tests/Makefile Tue Nov 10 19:09:35 2020 (r367576) @@ -3,6 +3,7 @@ SUBDIR= dso TESTS_SUBDIRS= dynamic TESTS_SUBDIRS+= dynamiclib +TESTS_SUBDIRS+= dynamicpie TESTS_SUBDIRS+= static SUBDIR_DEPEND_dynamiclib=dso Modified: head/lib/csu/tests/dynamic/Makefile ============================================================================== --- head/lib/csu/tests/dynamic/Makefile Tue Nov 10 19:07:30 2020 (r367575) +++ head/lib/csu/tests/dynamic/Makefile Tue Nov 10 19:09:35 2020 (r367576) @@ -2,5 +2,8 @@ .PATH: ${.CURDIR:H} +.include +MK_PIE= no + .include "../Makefile.tests" .include Copied and modified: head/lib/csu/tests/dynamicpie/Makefile (from r367573, head/lib/csu/tests/dynamic/Makefile) ============================================================================== --- head/lib/csu/tests/dynamic/Makefile Tue Nov 10 18:12:09 2020 (r367573, copy source) +++ head/lib/csu/tests/dynamicpie/Makefile Tue Nov 10 19:09:35 2020 (r367576) @@ -2,5 +2,8 @@ .PATH: ${.CURDIR:H} +.include +MK_PIE= yes + .include "../Makefile.tests" .include From owner-svn-src-head@freebsd.org Tue Nov 10 19:15:15 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C4C5B461E6B; Tue, 10 Nov 2020 19:15:15 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVyHR5DF0z4n2X; Tue, 10 Nov 2020 19:15:15 +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 A63D727BB4; Tue, 10 Nov 2020 19:15:15 +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 0AAJFFKO059415; Tue, 10 Nov 2020 19:15:15 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AAJFEWf059408; Tue, 10 Nov 2020 19:15:14 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <202011101915.0AAJFEWf059408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 10 Nov 2020 19:15:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367577 - in head: share/mk sys/conf tools/build/options X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: share/mk sys/conf tools/build/options X-SVN-Commit-Revision: 367577 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 10 Nov 2020 19:15:15 -0000 Author: brooks Date: Tue Nov 10 19:15:13 2020 New Revision: 367577 URL: https://svnweb.freebsd.org/changeset/base/367577 Log: Support initializing stack variables on function entry There are two options: - WITH_INIT_ALL_ZERO: Zero all variables on the stack. - WITH_INIT_ALL_PATTERN: Initialize variables with well-defined patterns. The exact pattern are a compiler implementation detail and vary by type. They are somewhat documented in the LLVM commit message: https://reviews.llvm.org/rL349442 I've used WITH_INIT_ALL_* to match Microsoft's InitAll feature rather than naming them after the LLVM specific compiler flags. In a range of consumer products, options like these are used in both debug and production builds with debugs builds using patterns (intended to provoke crashes on use of uninitialized values) and production using zeros (deemed more likely to lead to harmless misbehavior or NULL-pointer dereferences). Reviewed by: emaste Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D27131 Added: head/tools/build/options/WITH_INIT_ALL_PATTERN (contents, props changed) head/tools/build/options/WITH_INIT_ALL_ZERO (contents, props changed) Modified: head/share/mk/bsd.compiler.mk head/share/mk/bsd.lib.mk head/share/mk/bsd.opts.mk head/share/mk/bsd.prog.mk head/sys/conf/kern.mk Modified: head/share/mk/bsd.compiler.mk ============================================================================== --- head/share/mk/bsd.compiler.mk Tue Nov 10 19:09:35 2020 (r367576) +++ head/share/mk/bsd.compiler.mk Tue Nov 10 19:15:13 2020 (r367577) @@ -24,6 +24,7 @@ # - c++11: supports full (or nearly full) C++11 programming environment. # - retpoline: supports the retpoline speculative execution vulnerability # mitigation. +# - init-all: supports stack variable initialization. # # These variables with an X_ prefix will also be provided if XCC is set. # @@ -214,7 +215,7 @@ ${X_}COMPILER_FEATURES= c++11 c++14 ${X_}COMPILER_FEATURES+= c++17 .endif .if ${${X_}COMPILER_TYPE} == "clang" -${X_}COMPILER_FEATURES+= retpoline +${X_}COMPILER_FEATURES+= retpoline init-all .endif .else Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Tue Nov 10 19:09:35 2020 (r367576) +++ head/share/mk/bsd.lib.mk Tue Nov 10 19:15:13 2020 (r367577) @@ -85,6 +85,25 @@ LDFLAGS+= -Wl,-zretpolineplt .endif .endif +# Initialize stack variables on function entry +.if ${MK_INIT_ALL_ZERO} == "yes" +.if ${COMPILER_FEATURES:Minit-all} +CFLAGS+= -ftrivial-auto-var-init=zero \ + -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang +CXXFLAGS+= -ftrivial-auto-var-init=zero \ + -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang +.else +.warning InitAll (zeros) requested but not support by compiler +.endif +.elif ${MK_INIT_ALL_PATTERN} == "yes" +.if ${COMPILER_FEATURES:Minit-all} +CFLAGS+= -ftrivial-auto-var-init=pattern +CXXFLAGS+= -ftrivial-auto-var-init=pattern +.else +.warning InitAll (pattern) requested but not support by compiler +.endif +.endif + .if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \ empty(DEBUG_FLAGS:M-gdwarf*) CFLAGS+= ${DEBUG_FILES_CFLAGS} Modified: head/share/mk/bsd.opts.mk ============================================================================== --- head/share/mk/bsd.opts.mk Tue Nov 10 19:09:35 2020 (r367576) +++ head/share/mk/bsd.opts.mk Tue Nov 10 19:15:13 2020 (r367577) @@ -71,6 +71,8 @@ __DEFAULT_NO_OPTIONS = \ BIND_NOW \ CCACHE_BUILD \ CTF \ + INIT_ALL_PATTERN \ + INIT_ALL_ZERO \ INSTALL_AS_USER \ PIE \ RETPOLINE \ @@ -84,6 +86,10 @@ __DEFAULT_DEPENDENT_OPTIONS = \ .include + +.if ${MK_INIT_ALL_PATTERN} == "yes" && ${MK_INIT_ALL_ZERO} == "yes" +.error WITH_INIT_ALL_PATTERN and WITH_INIT_ALL_ZERO are mutually exclusive. +.endif # # Supported NO_* options (if defined, MK_* will be forced to "no", Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Tue Nov 10 19:09:35 2020 (r367576) +++ head/share/mk/bsd.prog.mk Tue Nov 10 19:15:13 2020 (r367577) @@ -60,6 +60,25 @@ LDFLAGS+= -Wl,-zretpolineplt .endif .endif +# Initialize stack variables on function entry +.if ${MK_INIT_ALL_ZERO} == "yes" +.if ${COMPILER_FEATURES:Minit-all} +CFLAGS+= -ftrivial-auto-var-init=zero \ + -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang +CXXFLAGS+= -ftrivial-auto-var-init=zero \ + -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang +.else +.warning InitAll (zeros) requested but not support by compiler +.endif +.elif ${MK_INIT_ALL_PATTERN} == "yes" +.if ${COMPILER_FEATURES:Minit-all} +CFLAGS+= -ftrivial-auto-var-init=pattern +CXXFLAGS+= -ftrivial-auto-var-init=pattern +.else +.warning InitAll (pattern) requested but not support by compiler +.endif +.endif + .if ${MACHINE_CPUARCH} == "riscv" && ${LINKER_FEATURES:Mriscv-relaxations} == "" CFLAGS += -mno-relax .endif Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Tue Nov 10 19:09:35 2020 (r367576) +++ head/sys/conf/kern.mk Tue Nov 10 19:15:13 2020 (r367577) @@ -228,6 +228,24 @@ CFLAGS+= -mretpoline .endif # +# Initialize stack variables on function entry +# +.if ${MK_INIT_ALL_ZERO} == "yes" +.if ${COMPILER_FEATURES:Minit-all} +CFLAGS+= -ftrivial-auto-var-init=zero \ + -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang +.else +.warning InitAll (zeros) requested but not support by compiler +.endif +.elif ${MK_INIT_ALL_PATTERN} == "yes" +.if ${COMPILER_FEATURES:Minit-all} +CFLAGS+= -ftrivial-auto-var-init=pattern +.else +.warning InitAll (pattern) requested but not support by compiler +.endif +.endif + +# # Add -gdwarf-2 when compiling -g. The default starting in clang v3.4 # and gcc 4.8 is to generate DWARF version 4. However, our tools don't # cope well with DWARF 4, so force it to genereate DWARF2, which they Added: head/tools/build/options/WITH_INIT_ALL_PATTERN ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_INIT_ALL_PATTERN Tue Nov 10 19:15:13 2020 (r367577) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Set to build the base system or kernel with stack variables initialized to +.Pq compiler defined +debugging patterns on function entry. +This option requires the clang compiler. Added: head/tools/build/options/WITH_INIT_ALL_ZERO ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_INIT_ALL_ZERO Tue Nov 10 19:15:13 2020 (r367577) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to build the base system or kernel with stack variables initialized +to zero on function entry. +This option requires that the clang compiler be used. From owner-svn-src-head@freebsd.org Tue Nov 10 19:17:36 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9595C46240F; Tue, 10 Nov 2020 19:17:36 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVyL83vQcz4nJX; Tue, 10 Nov 2020 19:17:36 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id C81193C0199; Tue, 10 Nov 2020 19:17:29 +0000 (UTC) Date: Tue, 10 Nov 2020 19:17:29 +0000 From: Brooks Davis To: Brooks Davis Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r367577 - in head: share/mk sys/conf tools/build/options Message-ID: <20201110191729.GC1959@spindle.one-eyed-alien.net> References: <202011101915.0AAJFEWf059408@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="98e8jtXdkpgskNou" Content-Disposition: inline In-Reply-To: <202011101915.0AAJFEWf059408@repo.freebsd.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 4CVyL83vQcz4nJX X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 10 Nov 2020 19:17:36 -0000 --98e8jtXdkpgskNou Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 10, 2020 at 07:15:14PM +0000, Brooks Davis wrote: > Author: brooks > Date: Tue Nov 10 19:15:13 2020 > New Revision: 367577 > URL: https://svnweb.freebsd.org/changeset/base/367577 >=20 > Log: > Support initializing stack variables on function entry > =20 > There are two options: > - WITH_INIT_ALL_ZERO: Zero all variables on the stack. > - WITH_INIT_ALL_PATTERN: Initialize variables with well-defined patter= ns. > =20 > The exact pattern are a compiler implementation detail and vary by type. > They are somewhat documented in the LLVM commit message: > https://reviews.llvm.org/rL349442 > I've used WITH_INIT_ALL_* to match Microsoft's InitAll feature rather > than naming them after the LLVM specific compiler flags. > =20 > In a range of consumer products, options like these are used in > both debug and production builds with debugs builds using patterns > (intended to provoke crashes on use of uninitialized values) and > production using zeros (deemed more likely to lead to harmless > misbehavior or NULL-pointer dereferences). We've tested this extensively in CheriBSD on RISC-V, in the wild it's probably most tested on Arm64 and x86. Despite the silly compiler flag you'll spot in the code, the zeroing option isn't going away in practice as Apple, Google, and Microsoft all ship with this feature in some of their products. -- Brooks --98e8jtXdkpgskNou Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJfqudIAAoJEKzQXbSebgfAZ0sH/iQCtyUtdmDHgMiLUzFvYXtO jdpgwX2AjFMdXB7seJtGjhPthfwIb57byFp5AJ85vQ3MLMxw8Om+Fsi0MVuZwzeq t59+fiaxE2vmusYI3882duQw/0MHuPzxE54R7Euxo1tIaBk8rPQ1mP2r3j+p6cyk dlLjT8hJBM/k0Hx35FTTis3PRJQwS36atpS5csduL/yRi7rq8vExeNtyJwGVZdRe lQ0WDgZBhIgFyOpaZ+/iK2IhnOZjHKgmXYXfrfRVHfCQ7yRi+Xrrk+6HfcXW3yxa hjO3PhhDng0z8dlqDWmvMLUm49Hu9fmlzrjJ9ALK55C99F39ds9vIZW4p2jRuVw= =t2cp -----END PGP SIGNATURE----- --98e8jtXdkpgskNou-- From owner-svn-src-head@freebsd.org Tue Nov 10 19:44:48 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 611AD462C3F for ; Tue, 10 Nov 2020 19:44:48 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVyxX22lsz4pkv for ; Tue, 10 Nov 2020 19:44:48 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt1-x829.google.com with SMTP id t5so9495520qtp.2 for ; Tue, 10 Nov 2020 11:44:48 -0800 (PST) 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; bh=TgsRsgtiZodzuo3EyIy74NAg6z7fJQb7KaLegRltPVI=; b=LtzrefZBYVaCBMnaDX46gf+Il4S6ZSMoCg89Zq3NBQO4M8ZMkElnwLB2tl6JkObt1Y EP4DXw7UEYCFSxNIxsubbkU/0fdi0YC1uLr+ZcEatdHxEQ6AGwa8yTqrjGDlp3vFy52Y zed9N6txhlxmb4lXGPjmBJ4cRo94ptVQewn+rR0OVrU7K0yK59qIafKxFR4MULsq09HE sDV0KOHLpvCpoPYC2vm5AGKrguW9WvMmZgqOYM0k2IZp2DqKFhpdhgjw6XKt80K/nNZe l612j2NQp1T83UKr0EiskpNcUfneqEKv7yAky1HA5xmSciFvUdxCntH4XtVuWPLctrqV WvNg== 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; bh=TgsRsgtiZodzuo3EyIy74NAg6z7fJQb7KaLegRltPVI=; b=d0fxZsD8TO2Kq2d9pLE6MLU4gamIYZ1Az0mQQZafa61hLi2xVYCQ7OinLdQDjVAcLG 91z/1mYvnw5sR3cOmj7h3bCHLLcb6logl/4D/KBXfiDKiy5/1KDurTbqafs+xM+REfkl mBV+3ePOCx0ZHj+JjrSedtxhagrjlgHzx8W+9QTF9oUp60ExpDEz7btYHX9/4chEyyvS 9RhP+g0cDVWh/EEINjDcBoeD/MHIzw5rLjGEcJpxIYADrwnZ+8h8AK9TK3uu90weBjZi wGIUMgMIWWm+gb+oxZ4Rqg1BoB2e4FeSuZYxAWzIhf//6TabReCQjNwvH76ok7+Szqvz 5LHg== X-Gm-Message-State: AOAM531nz2EB06d+36c+t2hotL1XlCht3JqlejbnG2wBo7OQ8O+vMRpr CLAnLv56/TsN+NBxMhuUjZWeihEUGwoyG+UH X-Google-Smtp-Source: ABdhPJxa12lTtv1eYmwqQkMlxO3rUEp1UqN0uNRO7HHp6K7futuwBTOs43Nx1Qs8cvEKJ9PU2wEhmQ== X-Received: by 2002:aed:3325:: with SMTP id u34mr20346601qtd.263.1605037487240; Tue, 10 Nov 2020 11:44:47 -0800 (PST) Received: from mutt-hbsd (pool-100-16-222-53.bltmmd.fios.verizon.net. [100.16.222.53]) by smtp.gmail.com with ESMTPSA id j63sm5264248qke.67.2020.11.10.11.44.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Nov 2020 11:44:46 -0800 (PST) Date: Tue, 10 Nov 2020 14:44:45 -0500 From: Shawn Webb To: Brooks Davis Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r367577 - in head: share/mk sys/conf tools/build/options Message-ID: <20201110194445.wf5v63trwcv7fmzs@mutt-hbsd> X-Operating-System: FreeBSD mutt-hbsd 13.0-CURRENT-HBSD FreeBSD 13.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0xFF2E67A277F8E1FA References: <202011101915.0AAJFEWf059408@repo.freebsd.org> <20201110191729.GC1959@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="nfmjjteyn4azmpyh" Content-Disposition: inline In-Reply-To: <20201110191729.GC1959@spindle.one-eyed-alien.net> X-Rspamd-Queue-Id: 4CVyxX22lsz4pkv X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 10 Nov 2020 19:44:48 -0000 --nfmjjteyn4azmpyh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 10, 2020 at 07:17:29PM +0000, Brooks Davis wrote: > On Tue, Nov 10, 2020 at 07:15:14PM +0000, Brooks Davis wrote: > > Author: brooks > > Date: Tue Nov 10 19:15:13 2020 > > New Revision: 367577 > > URL: https://svnweb.freebsd.org/changeset/base/367577 > >=20 > > Log: > > Support initializing stack variables on function entry > > =20 > > There are two options: > > - WITH_INIT_ALL_ZERO: Zero all variables on the stack. > > - WITH_INIT_ALL_PATTERN: Initialize variables with well-defined patt= erns. > > =20 > > The exact pattern are a compiler implementation detail and vary by ty= pe. > > They are somewhat documented in the LLVM commit message: > > https://reviews.llvm.org/rL349442 > > I've used WITH_INIT_ALL_* to match Microsoft's InitAll feature rather > > than naming them after the LLVM specific compiler flags. > > =20 > > In a range of consumer products, options like these are used in > > both debug and production builds with debugs builds using patterns > > (intended to provoke crashes on use of uninitialized values) and > > production using zeros (deemed more likely to lead to harmless > > misbehavior or NULL-pointer dereferences). >=20 > We've tested this extensively in CheriBSD on RISC-V, in the wild it's > probably most tested on Arm64 and x86. >=20 > Despite the silly compiler flag you'll spot in the code, the zeroing > option isn't going away in practice as Apple, Google, and Microsoft all > ship with this feature in some of their products. HardenedBSD's testing of this last year on amd64 have (privately) shown the feature to really hinder performance on more complex applications (like when applied to clang/lld). A build of base without init all zero applied to clang/lld would take around 1.5 hours on my system. A build with it applied to clang/lld took around four hours, if my memory serves correctly. I would probably advise against applying it system-wide. But YMMV. Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD GPG Key ID: 0xFF2E67A277F8E1FA GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9 3633 C85B 0AF8 AB23 0FB2 https://git-01.md.hardenedbsd.org/HardenedBSD/pubkeys/src/branch/master/Sha= wn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --nfmjjteyn4azmpyh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAl+q7aoACgkQ/y5nonf4 4frTbBAAlm1FhCeENfnR8wP7eEF6ZN5zJ9OKgIdg4KuNJdjqk63h19XaOknMMd3Z CIDP4Lnmc7Uou8vhU6GBhlTrzf+D5CHWi4v9HbJSpF++jLbWn+p6r1eYMvH/jIok Sj4WyzPqBRyHyrp+1A2b9+UhpsiAZPdCccJRHuT8IPVWGUhP6W89xVNw2JFipc/t mmXKmxoQ61d2xQk5mx9vPxceDOxLTcZZDaF2O9MT9n91DeS1KheAfddler4z03zb lhbi+wzLRghI5ErQruonEdeleoIxQzDauwk0mGluzo/UMugOy+rab3SVf2+ogCgx Af5gMpXyHGfNJ7HCWyNzNnZ2GRUVecgSmNXnoSiGibBicvn1aXi2UkvaAKl4wwM+ JJrbJCctypDlGQcu8AoDTRHAdoAGWItFx+R8xDcz2sOxdn1crKJJE5ZzXsnrt4pO xad+IkwX9sHsInMGkIdsredIhzkZqNNJauEQ4tkQzt25cdhnngd55wK/Q61nxNEp /d+P61RjCn+4IO87Djrq6BPNKyG5p2lUgrA7Uu/2hgun0sskxtGvsZftZMlywZQq 7n/a0pvedQv0sxFsWSxZEqdA9aYFFHVYxB0hVRg9ank/3zOxwx+DO1NOe1+bd4bZ TVFecJX3rVKnZqfH+otPVK2V8qc5LjjeIxRj+9SaCSRtgQkF2+0= =AEdV -----END PGP SIGNATURE----- --nfmjjteyn4azmpyh-- From owner-svn-src-head@freebsd.org Tue Nov 10 19:54:39 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DC519462F33; Tue, 10 Nov 2020 19:54:39 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVz8v5wKgz4q4Y; Tue, 10 Nov 2020 19:54:39 +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 BE0371F5; Tue, 10 Nov 2020 19:54:39 +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 0AAJsdE5083974; Tue, 10 Nov 2020 19:54:39 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AAJsd1P083973; Tue, 10 Nov 2020 19:54:39 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202011101954.0AAJsd1P083973@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 10 Nov 2020 19:54:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367578 - head/sys/dev/cxgbe/tom X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 367578 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 10 Nov 2020 19:54:39 -0000 Author: jhb Date: Tue Nov 10 19:54:39 2020 New Revision: 367578 URL: https://svnweb.freebsd.org/changeset/base/367578 Log: Clear tp->tod in t4_pcb_detach(). Otherwise, a socket can have a non-NULL tp->tod while TF_TOE is clear. In particular, if a newly accepted socket falls back to non-TOE due to an active open failure, the non-TOE socket will still have tp->tod set even though TF_TOE is clear. Reviewed by: np MFC after: 2 weeks Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D27028 Modified: head/sys/dev/cxgbe/tom/t4_tom.c Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Tue Nov 10 19:15:13 2020 (r367577) +++ head/sys/dev/cxgbe/tom/t4_tom.c Tue Nov 10 19:54:39 2020 (r367578) @@ -382,6 +382,7 @@ t4_pcb_detach(struct toedev *tod __unused, struct tcpc } #endif + tp->tod = NULL; tp->t_toe = NULL; tp->t_flags &= ~TF_TOE; toep->flags &= ~TPF_ATTACHED; From owner-svn-src-head@freebsd.org Tue Nov 10 20:47:00 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 38D2A463FA6; Tue, 10 Nov 2020 20:47:00 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CW0KJ11NWz4sxj; Tue, 10 Nov 2020 20:46:59 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: by mail-lf1-x131.google.com with SMTP id i6so64621lfd.1; Tue, 10 Nov 2020 12:46:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XjlgMnAgIWSg2rW6SWasKv25DHoYOjI22UdS9U7fW/k=; b=lxGYWuzOvchJMjLjAZOrjD7pBk9KEQoxuW3Z/BNJd4/jD96SoNX1MMBcqOkKWFGhDI m2iRWxRjvps5ZlM8Vnl8nuX0KCbefT6op3FMWy1nuSEOVvzQwe3/An7+D/4fFV3uyu8W VDsRrFV8iAP0o0ljgYCqbYubQ+gQFQs1URXEga+28NUP1LZtCNugtMTG18TvbAPze7Ev NmBaGGsYBxBt+U/8dnSwu1ueYCoQ2d9aDx5o3GaMSvuc1utqvEn5NB7omI9mGrInhAjQ ZSOOm/13Cx3nO0SLFHb5cGfQxL0eR2NVg5NRygDEwrxvgF5CpvKqtdrTKHXjBE0UaGhu BobA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XjlgMnAgIWSg2rW6SWasKv25DHoYOjI22UdS9U7fW/k=; b=osAcxWbtoEd21tm44JFsT+wwx3WAqckGhBaZZhdtC9R4IqjN9HSc9pl9PH/Wu8chZH ySyoSz6JnHaHKjLo/CQkFjdXL+FSsZAthGbKVT6nCXKy5yjTbpVdZ2lKTJE/a0xNcPzB CSr7K+1UIQoANU144slukBQ6gD2R4aWeTH1IsXJWMDbdAmBiBXsCzRciHfP4uYhdZ2Zd 0gSLQhbl70BflWjrm11iC2GCntH5gOCks8tJ54qPu8/gDDd0MgBAIhCADLvYpPd6FuMc rsrXe+FaUPLsJxslWqohl1751xyH/ZNloTk5HI1vBFU6qQwj8uqqa3wdC2/ZiHZ41a3S 2APA== X-Gm-Message-State: AOAM531TKKrlk+g9Xa0TvZXRiSbuzG1z7PQiJd4mz8IO400AjVa3+mSZ KYNxUOIMxS4Brm6PO3OSz07TB0qu+p9AV47qCDl0A4jX3QDBxA== X-Google-Smtp-Source: ABdhPJwf/POXAd8XS9GGzxxDwUsa81ejXzkXfrMJKfoHbmDsbFLn7b1o0no4zHXmPO/92p4YIQDOo7tEsVeS7ZD1YYs= X-Received: by 2002:a05:6512:3496:: with SMTP id v22mr7613928lfr.230.1605041217124; Tue, 10 Nov 2020 12:46:57 -0800 (PST) MIME-Version: 1.0 References: <202011101915.0AAJFEWf059408@repo.freebsd.org> In-Reply-To: <202011101915.0AAJFEWf059408@repo.freebsd.org> From: Matthew Macy Date: Tue, 10 Nov 2020 12:46:45 -0800 Message-ID: Subject: Re: svn commit: r367577 - in head: share/mk sys/conf tools/build/options To: Brooks Davis Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4CW0KJ11NWz4sxj X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 10 Nov 2020 20:47:00 -0000 These flags aren't defined by default when building external kernel modules: gmake[2]: Entering directory '/usr/home/matt/devel/ZoF/module' env -u MAKEFLAGS make -C /home/matt/devel/ZoF/module -f Makefile.bsd -w make[3]: Entering directory `/home/matt/devel/ZoF/module' make[3]: "/usr/home/matt/devel/freebsd/sys/conf/kern.mk" line 233: Malformed conditional (${MK_INIT_ALL_ZERO} == "yes") make[3]: Fatal errors encountered -- cannot continue make[3]: stopped in /home/matt/devel/ZoF/module gmake[2]: *** [Makefile:53: modules-FreeBSD] Error 1 gmake[2]: Leaving directory '/usr/home/matt/devel/ZoF/module' On Tue, Nov 10, 2020 at 11:15 AM Brooks Davis wrote: > > Author: brooks > Date: Tue Nov 10 19:15:13 2020 > New Revision: 367577 > URL: https://svnweb.freebsd.org/changeset/base/367577 > > Log: > Support initializing stack variables on function entry > > There are two options: > - WITH_INIT_ALL_ZERO: Zero all variables on the stack. > - WITH_INIT_ALL_PATTERN: Initialize variables with well-defined patterns. > > The exact pattern are a compiler implementation detail and vary by type. > They are somewhat documented in the LLVM commit message: > https://reviews.llvm.org/rL349442 > I've used WITH_INIT_ALL_* to match Microsoft's InitAll feature rather > than naming them after the LLVM specific compiler flags. > > In a range of consumer products, options like these are used in > both debug and production builds with debugs builds using patterns > (intended to provoke crashes on use of uninitialized values) and > production using zeros (deemed more likely to lead to harmless > misbehavior or NULL-pointer dereferences). > > Reviewed by: emaste > Obtained from: CheriBSD > Sponsored by: DARPA > Differential Revision: https://reviews.freebsd.org/D27131 > > Added: > head/tools/build/options/WITH_INIT_ALL_PATTERN (contents, props changed) > head/tools/build/options/WITH_INIT_ALL_ZERO (contents, props changed) > Modified: > head/share/mk/bsd.compiler.mk > head/share/mk/bsd.lib.mk > head/share/mk/bsd.opts.mk > head/share/mk/bsd.prog.mk > head/sys/conf/kern.mk > > Modified: head/share/mk/bsd.compiler.mk > ============================================================================== > --- head/share/mk/bsd.compiler.mk Tue Nov 10 19:09:35 2020 (r367576) > +++ head/share/mk/bsd.compiler.mk Tue Nov 10 19:15:13 2020 (r367577) > @@ -24,6 +24,7 @@ > # - c++11: supports full (or nearly full) C++11 programming environment. > # - retpoline: supports the retpoline speculative execution vulnerability > # mitigation. > +# - init-all: supports stack variable initialization. > # > # These variables with an X_ prefix will also be provided if XCC is set. > # > @@ -214,7 +215,7 @@ ${X_}COMPILER_FEATURES= c++11 c++14 > ${X_}COMPILER_FEATURES+= c++17 > .endif > .if ${${X_}COMPILER_TYPE} == "clang" > -${X_}COMPILER_FEATURES+= retpoline > +${X_}COMPILER_FEATURES+= retpoline init-all > .endif > > .else > > Modified: head/share/mk/bsd.lib.mk > ============================================================================== > --- head/share/mk/bsd.lib.mk Tue Nov 10 19:09:35 2020 (r367576) > +++ head/share/mk/bsd.lib.mk Tue Nov 10 19:15:13 2020 (r367577) > @@ -85,6 +85,25 @@ LDFLAGS+= -Wl,-zretpolineplt > .endif > .endif > > +# Initialize stack variables on function entry > +.if ${MK_INIT_ALL_ZERO} == "yes" > +.if ${COMPILER_FEATURES:Minit-all} > +CFLAGS+= -ftrivial-auto-var-init=zero \ > + -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang > +CXXFLAGS+= -ftrivial-auto-var-init=zero \ > + -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang > +.else > +.warning InitAll (zeros) requested but not support by compiler > +.endif > +.elif ${MK_INIT_ALL_PATTERN} == "yes" > +.if ${COMPILER_FEATURES:Minit-all} > +CFLAGS+= -ftrivial-auto-var-init=pattern > +CXXFLAGS+= -ftrivial-auto-var-init=pattern > +.else > +.warning InitAll (pattern) requested but not support by compiler > +.endif > +.endif > + > .if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \ > empty(DEBUG_FLAGS:M-gdwarf*) > CFLAGS+= ${DEBUG_FILES_CFLAGS} > > Modified: head/share/mk/bsd.opts.mk > ============================================================================== > --- head/share/mk/bsd.opts.mk Tue Nov 10 19:09:35 2020 (r367576) > +++ head/share/mk/bsd.opts.mk Tue Nov 10 19:15:13 2020 (r367577) > @@ -71,6 +71,8 @@ __DEFAULT_NO_OPTIONS = \ > BIND_NOW \ > CCACHE_BUILD \ > CTF \ > + INIT_ALL_PATTERN \ > + INIT_ALL_ZERO \ > INSTALL_AS_USER \ > PIE \ > RETPOLINE \ > @@ -84,6 +86,10 @@ __DEFAULT_DEPENDENT_OPTIONS = \ > > > .include > + > +.if ${MK_INIT_ALL_PATTERN} == "yes" && ${MK_INIT_ALL_ZERO} == "yes" > +.error WITH_INIT_ALL_PATTERN and WITH_INIT_ALL_ZERO are mutually exclusive. > +.endif > > # > # Supported NO_* options (if defined, MK_* will be forced to "no", > > Modified: head/share/mk/bsd.prog.mk > ============================================================================== > --- head/share/mk/bsd.prog.mk Tue Nov 10 19:09:35 2020 (r367576) > +++ head/share/mk/bsd.prog.mk Tue Nov 10 19:15:13 2020 (r367577) > @@ -60,6 +60,25 @@ LDFLAGS+= -Wl,-zretpolineplt > .endif > .endif > > +# Initialize stack variables on function entry > +.if ${MK_INIT_ALL_ZERO} == "yes" > +.if ${COMPILER_FEATURES:Minit-all} > +CFLAGS+= -ftrivial-auto-var-init=zero \ > + -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang > +CXXFLAGS+= -ftrivial-auto-var-init=zero \ > + -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang > +.else > +.warning InitAll (zeros) requested but not support by compiler > +.endif > +.elif ${MK_INIT_ALL_PATTERN} == "yes" > +.if ${COMPILER_FEATURES:Minit-all} > +CFLAGS+= -ftrivial-auto-var-init=pattern > +CXXFLAGS+= -ftrivial-auto-var-init=pattern > +.else > +.warning InitAll (pattern) requested but not support by compiler > +.endif > +.endif > + > .if ${MACHINE_CPUARCH} == "riscv" && ${LINKER_FEATURES:Mriscv-relaxations} == "" > CFLAGS += -mno-relax > .endif > > Modified: head/sys/conf/kern.mk > ============================================================================== > --- head/sys/conf/kern.mk Tue Nov 10 19:09:35 2020 (r367576) > +++ head/sys/conf/kern.mk Tue Nov 10 19:15:13 2020 (r367577) > @@ -228,6 +228,24 @@ CFLAGS+= -mretpoline > .endif > > # > +# Initialize stack variables on function entry > +# > +.if ${MK_INIT_ALL_ZERO} == "yes" > +.if ${COMPILER_FEATURES:Minit-all} > +CFLAGS+= -ftrivial-auto-var-init=zero \ > + -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang > +.else > +.warning InitAll (zeros) requested but not support by compiler > +.endif > +.elif ${MK_INIT_ALL_PATTERN} == "yes" > +.if ${COMPILER_FEATURES:Minit-all} > +CFLAGS+= -ftrivial-auto-var-init=pattern > +.else > +.warning InitAll (pattern) requested but not support by compiler > +.endif > +.endif > + > +# > # Add -gdwarf-2 when compiling -g. The default starting in clang v3.4 > # and gcc 4.8 is to generate DWARF version 4. However, our tools don't > # cope well with DWARF 4, so force it to genereate DWARF2, which they > > Added: head/tools/build/options/WITH_INIT_ALL_PATTERN > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/tools/build/options/WITH_INIT_ALL_PATTERN Tue Nov 10 19:15:13 2020 (r367577) > @@ -0,0 +1,5 @@ > +.\" $FreeBSD$ > +Set to build the base system or kernel with stack variables initialized to > +.Pq compiler defined > +debugging patterns on function entry. > +This option requires the clang compiler. > > Added: head/tools/build/options/WITH_INIT_ALL_ZERO > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/tools/build/options/WITH_INIT_ALL_ZERO Tue Nov 10 19:15:13 2020 (r367577) > @@ -0,0 +1,4 @@ > +.\" $FreeBSD$ > +Set to build the base system or kernel with stack variables initialized > +to zero on function entry. > +This option requires that the clang compiler be used. From owner-svn-src-head@freebsd.org Tue Nov 10 21:12:33 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 18438464A57; Tue, 10 Nov 2020 21:12:33 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CW0tn0Fs5z4vLM; Tue, 10 Nov 2020 21:12:33 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EFF26FC8; Tue, 10 Nov 2020 21:12:32 +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 0AALCW0G033208; Tue, 10 Nov 2020 21:12:32 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AALCWgK033207; Tue, 10 Nov 2020 21:12:32 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <202011102112.0AALCWgK033207@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 10 Nov 2020 21:12:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367579 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 367579 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 10 Nov 2020 21:12:33 -0000 Author: brooks Date: Tue Nov 10 21:12:32 2020 New Revision: 367579 URL: https://svnweb.freebsd.org/changeset/base/367579 Log: Be more tolerant of share/mk and kern.mk mismatch When building out-of-tree modules, it appears that the system share/mk is used, but sys/conf/kern.mk is used. That results in MK_INIT_ALL_ZERO being undefined. In the interest of maximum compatability, check that MK_INIT_ALL_* and COMPILER_FEATURES are defined before comparing their values. Reported by: mmacy Sponsored by: DARPA Modified: head/sys/conf/kern.mk Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Tue Nov 10 19:54:39 2020 (r367578) +++ head/sys/conf/kern.mk Tue Nov 10 21:12:32 2020 (r367579) @@ -230,15 +230,15 @@ CFLAGS+= -mretpoline # # Initialize stack variables on function entry # -.if ${MK_INIT_ALL_ZERO} == "yes" -.if ${COMPILER_FEATURES:Minit-all} +.if defined(MK_INIT_ALL_ZERO) && ${MK_INIT_ALL_ZERO} == "yes" +.if defined(COMPILER_FEATURES) && ${COMPILER_FEATURES:Minit-all} CFLAGS+= -ftrivial-auto-var-init=zero \ -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang .else .warning InitAll (zeros) requested but not support by compiler .endif -.elif ${MK_INIT_ALL_PATTERN} == "yes" -.if ${COMPILER_FEATURES:Minit-all} +.elif defined(MK_INIT_ALL_PATTERN) && ${MK_INIT_ALL_PATTERN} == "yes" +.if defined(COMPILER_FEATURES) && ${COMPILER_FEATURES:Minit-all} CFLAGS+= -ftrivial-auto-var-init=pattern .else .warning InitAll (pattern) requested but not support by compiler From owner-svn-src-head@freebsd.org Tue Nov 10 21:29:11 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6B1B9465254; Tue, 10 Nov 2020 21:29:11 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CW1Fz2fNSz3C7F; Tue, 10 Nov 2020 21:29:11 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4E1151623; Tue, 10 Nov 2020 21:29:11 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AALTBpF039939; Tue, 10 Nov 2020 21:29:11 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AALTB4q039938; Tue, 10 Nov 2020 21:29:11 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011102129.0AALTB4q039938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 10 Nov 2020 21:29:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367580 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 367580 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 10 Nov 2020 21:29:11 -0000 Author: mjg Date: Tue Nov 10 21:29:10 2020 New Revision: 367580 URL: https://svnweb.freebsd.org/changeset/base/367580 Log: thread: tidy up r367543 "locked" variable is spurious in the committed version. Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Tue Nov 10 21:12:32 2020 (r367579) +++ head/sys/kern/kern_proc.c Tue Nov 10 21:29:10 2020 (r367580) @@ -2748,7 +2748,6 @@ sysctl_kern_proc_kstack(SYSCTL_HANDLER_ARGS) struct stack *st; struct sbuf sb; struct proc *p; - bool locked; name = (int *)arg1; error = pget((pid_t)name[0], PGET_NOTINEXEC | PGET_WANTREAD, &p); @@ -2789,14 +2788,12 @@ sysctl_kern_proc_kstack(SYSCTL_HANDLER_ARGS) i++; } PROC_UNLOCK(p); - locked = false; numthreads = i; for (i = 0; i < numthreads; i++) { td = tdfind(lwpidarray[i], p->p_pid); if (td == NULL) { continue; } - locked = true; bzero(kkstp, sizeof(*kkstp)); (void)sbuf_new(&sb, kkstp->kkst_trace, sizeof(kkstp->kkst_trace), SBUF_FIXEDLEN); @@ -2810,7 +2807,6 @@ sysctl_kern_proc_kstack(SYSCTL_HANDLER_ARGS) kkstp->kkst_state = KKST_STATE_RUNNING; thread_unlock(td); PROC_UNLOCK(p); - locked = false; stack_sbuf_print(&sb, st); sbuf_finish(&sb); sbuf_delete(&sb); @@ -2818,10 +2814,7 @@ sysctl_kern_proc_kstack(SYSCTL_HANDLER_ARGS) if (error) break; } - if (!locked) - PROC_LOCK(p); - _PRELE(p); - PROC_UNLOCK(p); + PRELE(p); if (lwpidarray != NULL) free(lwpidarray, M_TEMP); stack_destroy(st); From owner-svn-src-head@freebsd.org Tue Nov 10 21:50:09 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 34A724653E8; Tue, 10 Nov 2020 21:50:09 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CW1k83Qlfz3Cjx; Tue, 10 Nov 2020 21:50:08 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id B9CE13C0199; Tue, 10 Nov 2020 21:50:07 +0000 (UTC) Date: Tue, 10 Nov 2020 21:50:07 +0000 From: Brooks Davis To: Matthew Macy Cc: src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r367577 - in head: share/mk sys/conf tools/build/options Message-ID: <20201110215007.GD1959@spindle.one-eyed-alien.net> References: <202011101915.0AAJFEWf059408@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="V88s5gaDVPzZ0KCq" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 4CW1k83Qlfz3Cjx X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of brooks@spindle.one-eyed-alien.net has no SPF policy when checking 199.48.129.229) smtp.mailfrom=brooks@spindle.one-eyed-alien.net X-Spamd-Result: default: False [0.10 / 15.00]; ARC_NA(0.00)[]; FORGED_SENDER(0.30)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; FREEFALL_USER(0.00)[brooks]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_SPAM_SHORT(1.00)[0.997]; NEURAL_HAM_LONG(-1.00)[-1.000]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; DMARC_NA(0.00)[freebsd.org]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(1.00)[1.000]; SPAMHAUS_ZRD(0.00)[199.48.129.229:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; SIGNED_PGP(-2.00)[]; FREEMAIL_TO(0.00)[gmail.com]; RCVD_COUNT_ZERO(0.00)[0]; R_SPF_NA(0.00)[no SPF record]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US]; FROM_NEQ_ENVFROM(0.00)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head]; RBL_DBL_DONT_QUERY_IPS(0.00)[199.48.129.229:from] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 10 Nov 2020 21:50:09 -0000 --V88s5gaDVPzZ0KCq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Sorry about that. I've fixed it in r367579. -- Brooks On Tue, Nov 10, 2020 at 12:46:45PM -0800, Matthew Macy wrote: > These flags aren't defined by default when building external kernel modul= es: >=20 > gmake[2]: Entering directory '/usr/home/matt/devel/ZoF/module' > env -u MAKEFLAGS make -C /home/matt/devel/ZoF/module -f Makefile.bsd -w > make[3]: Entering directory `/home/matt/devel/ZoF/module' > make[3]: "/usr/home/matt/devel/freebsd/sys/conf/kern.mk" line 233: > Malformed conditional (${MK_INIT_ALL_ZERO} =3D=3D "yes") > make[3]: Fatal errors encountered -- cannot continue > make[3]: stopped in /home/matt/devel/ZoF/module > gmake[2]: *** [Makefile:53: modules-FreeBSD] Error 1 > gmake[2]: Leaving directory '/usr/home/matt/devel/ZoF/module' >=20 > On Tue, Nov 10, 2020 at 11:15 AM Brooks Davis wrote: > > > > Author: brooks > > Date: Tue Nov 10 19:15:13 2020 > > New Revision: 367577 > > URL: https://svnweb.freebsd.org/changeset/base/367577 > > > > Log: > > Support initializing stack variables on function entry > > > > There are two options: > > - WITH_INIT_ALL_ZERO: Zero all variables on the stack. > > - WITH_INIT_ALL_PATTERN: Initialize variables with well-defined patt= erns. > > > > The exact pattern are a compiler implementation detail and vary by ty= pe. > > They are somewhat documented in the LLVM commit message: > > https://reviews.llvm.org/rL349442 > > I've used WITH_INIT_ALL_* to match Microsoft's InitAll feature rather > > than naming them after the LLVM specific compiler flags. > > > > In a range of consumer products, options like these are used in > > both debug and production builds with debugs builds using patterns > > (intended to provoke crashes on use of uninitialized values) and > > production using zeros (deemed more likely to lead to harmless > > misbehavior or NULL-pointer dereferences). > > > > Reviewed by: emaste > > Obtained from: CheriBSD > > Sponsored by: DARPA > > Differential Revision: https://reviews.freebsd.org/D27131 > > > > Added: > > head/tools/build/options/WITH_INIT_ALL_PATTERN (contents, props cha= nged) > > head/tools/build/options/WITH_INIT_ALL_ZERO (contents, props change= d) > > Modified: > > head/share/mk/bsd.compiler.mk > > head/share/mk/bsd.lib.mk > > head/share/mk/bsd.opts.mk > > head/share/mk/bsd.prog.mk > > head/sys/conf/kern.mk > > > > Modified: head/share/mk/bsd.compiler.mk > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/share/mk/bsd.compiler.mk Tue Nov 10 19:09:35 2020 = (r367576) > > +++ head/share/mk/bsd.compiler.mk Tue Nov 10 19:15:13 2020 = (r367577) > > @@ -24,6 +24,7 @@ > > # - c++11: supports full (or nearly full) C++11 programming enviro= nment. > > # - retpoline: supports the retpoline speculative execution vulnerabil= ity > > # mitigation. > > +# - init-all: supports stack variable initialization. > > # > > # These variables with an X_ prefix will also be provided if XCC is se= t. > > # > > @@ -214,7 +215,7 @@ ${X_}COMPILER_FEATURES=3D c++11 c++14 > > ${X_}COMPILER_FEATURES+=3D c++17 > > .endif > > .if ${${X_}COMPILER_TYPE} =3D=3D "clang" > > -${X_}COMPILER_FEATURES+=3D retpoline > > +${X_}COMPILER_FEATURES+=3D retpoline init-all > > .endif > > > > .else > > > > Modified: head/share/mk/bsd.lib.mk > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/share/mk/bsd.lib.mk Tue Nov 10 19:09:35 2020 (r36757= 6) > > +++ head/share/mk/bsd.lib.mk Tue Nov 10 19:15:13 2020 (r36757= 7) > > @@ -85,6 +85,25 @@ LDFLAGS+=3D -Wl,-zretpolineplt > > .endif > > .endif > > > > +# Initialize stack variables on function entry > > +.if ${MK_INIT_ALL_ZERO} =3D=3D "yes" > > +.if ${COMPILER_FEATURES:Minit-all} > > +CFLAGS+=3D -ftrivial-auto-var-init=3Dzero \ > > + -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from= -clang > > +CXXFLAGS+=3D -ftrivial-auto-var-init=3Dzero \ > > + -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from= -clang > > +.else > > +.warning InitAll (zeros) requested but not support by compiler > > +.endif > > +.elif ${MK_INIT_ALL_PATTERN} =3D=3D "yes" > > +.if ${COMPILER_FEATURES:Minit-all} > > +CFLAGS+=3D -ftrivial-auto-var-init=3Dpattern > > +CXXFLAGS+=3D -ftrivial-auto-var-init=3Dpattern > > +.else > > +.warning InitAll (pattern) requested but not support by compiler > > +.endif > > +.endif > > + > > .if ${MK_DEBUG_FILES} !=3D "no" && empty(DEBUG_FLAGS:M-g) && \ > > empty(DEBUG_FLAGS:M-gdwarf*) > > CFLAGS+=3D ${DEBUG_FILES_CFLAGS} > > > > Modified: head/share/mk/bsd.opts.mk > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/share/mk/bsd.opts.mk Tue Nov 10 19:09:35 2020 (r36757= 6) > > +++ head/share/mk/bsd.opts.mk Tue Nov 10 19:15:13 2020 (r36757= 7) > > @@ -71,6 +71,8 @@ __DEFAULT_NO_OPTIONS =3D \ > > BIND_NOW \ > > CCACHE_BUILD \ > > CTF \ > > + INIT_ALL_PATTERN \ > > + INIT_ALL_ZERO \ > > INSTALL_AS_USER \ > > PIE \ > > RETPOLINE \ > > @@ -84,6 +86,10 @@ __DEFAULT_DEPENDENT_OPTIONS =3D \ > > > > > > .include > > + > > +.if ${MK_INIT_ALL_PATTERN} =3D=3D "yes" && ${MK_INIT_ALL_ZERO} =3D=3D = "yes" > > +.error WITH_INIT_ALL_PATTERN and WITH_INIT_ALL_ZERO are mutually exclu= sive. > > +.endif > > > > # > > # Supported NO_* options (if defined, MK_* will be forced to "no", > > > > Modified: head/share/mk/bsd.prog.mk > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/share/mk/bsd.prog.mk Tue Nov 10 19:09:35 2020 (r36757= 6) > > +++ head/share/mk/bsd.prog.mk Tue Nov 10 19:15:13 2020 (r36757= 7) > > @@ -60,6 +60,25 @@ LDFLAGS+=3D -Wl,-zretpolineplt > > .endif > > .endif > > > > +# Initialize stack variables on function entry > > +.if ${MK_INIT_ALL_ZERO} =3D=3D "yes" > > +.if ${COMPILER_FEATURES:Minit-all} > > +CFLAGS+=3D -ftrivial-auto-var-init=3Dzero \ > > + -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from= -clang > > +CXXFLAGS+=3D -ftrivial-auto-var-init=3Dzero \ > > + -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from= -clang > > +.else > > +.warning InitAll (zeros) requested but not support by compiler > > +.endif > > +.elif ${MK_INIT_ALL_PATTERN} =3D=3D "yes" > > +.if ${COMPILER_FEATURES:Minit-all} > > +CFLAGS+=3D -ftrivial-auto-var-init=3Dpattern > > +CXXFLAGS+=3D -ftrivial-auto-var-init=3Dpattern > > +.else > > +.warning InitAll (pattern) requested but not support by compiler > > +.endif > > +.endif > > + > > .if ${MACHINE_CPUARCH} =3D=3D "riscv" && ${LINKER_FEATURES:Mriscv-rela= xations} =3D=3D "" > > CFLAGS +=3D -mno-relax > > .endif > > > > Modified: head/sys/conf/kern.mk > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/conf/kern.mk Tue Nov 10 19:09:35 2020 (r36757= 6) > > +++ head/sys/conf/kern.mk Tue Nov 10 19:15:13 2020 (r36757= 7) > > @@ -228,6 +228,24 @@ CFLAGS+=3D -mretpoline > > .endif > > > > # > > +# Initialize stack variables on function entry > > +# > > +.if ${MK_INIT_ALL_ZERO} =3D=3D "yes" > > +.if ${COMPILER_FEATURES:Minit-all} > > +CFLAGS+=3D -ftrivial-auto-var-init=3Dzero \ > > + -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from= -clang > > +.else > > +.warning InitAll (zeros) requested but not support by compiler > > +.endif > > +.elif ${MK_INIT_ALL_PATTERN} =3D=3D "yes" > > +.if ${COMPILER_FEATURES:Minit-all} > > +CFLAGS+=3D -ftrivial-auto-var-init=3Dpattern > > +.else > > +.warning InitAll (pattern) requested but not support by compiler > > +.endif > > +.endif > > + > > +# > > # Add -gdwarf-2 when compiling -g. The default starting in clang v3.4 > > # and gcc 4.8 is to generate DWARF version 4. However, our tools don't > > # cope well with DWARF 4, so force it to genereate DWARF2, which they > > > > Added: head/tools/build/options/WITH_INIT_ALL_PATTERN > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > +++ head/tools/build/options/WITH_INIT_ALL_PATTERN Tue Nov 10 19:1= 5:13 2020 (r367577) > > @@ -0,0 +1,5 @@ > > +.\" $FreeBSD$ > > +Set to build the base system or kernel with stack variables initialize= d to > > +.Pq compiler defined > > +debugging patterns on function entry. > > +This option requires the clang compiler. > > > > Added: head/tools/build/options/WITH_INIT_ALL_ZERO > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > +++ head/tools/build/options/WITH_INIT_ALL_ZERO Tue Nov 10 19:15:13 202= 0 (r367577) > > @@ -0,0 +1,4 @@ > > +.\" $FreeBSD$ > > +Set to build the base system or kernel with stack variables initialized > > +to zero on function entry. > > +This option requires that the clang compiler be used. >=20 --V88s5gaDVPzZ0KCq Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJfqwsOAAoJEKzQXbSebgfAwj0H/3WkVjGcexHVNAzAmxyvjJ0+ A75eGFyYwA2Lqbuykq/zGeenKjboOvuM292r363w6Gc9Qz87nHvf1tCXWNlR9qrk PE5uMOKzyEwP/oJgpToI04gt/cYvsD634+EiNRiOaSzkLti3JdEQQU8W7NBf+JqO CdrNx9/yt1gIkep3dlyLt6S/JHRW7CUqOZx2gTYwdzWDLvuKzHBDZqDSx0Wk+svk LqYfHaeLeNo7pY2xVoTek2aYACfewjhD9TOApG/hzWv0HYCO2USLCqeIUO2bjpU0 DXdsMJFl6VCuIa2ag7NFXdvLiV5jmbl1gOIER8hSi6ieQUXDucOq2YALA02Ahco= =uDFQ -----END PGP SIGNATURE----- --V88s5gaDVPzZ0KCq-- From owner-svn-src-head@freebsd.org Tue Nov 10 22:57:12 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6A5A2466960; Tue, 10 Nov 2020 22:57:12 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CW3CX2dDDz3JKJ; Tue, 10 Nov 2020 22:57:12 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 9C5173C0199; Tue, 10 Nov 2020 22:57:11 +0000 (UTC) Date: Tue, 10 Nov 2020 22:57:11 +0000 From: Brooks Davis To: Shawn Webb Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r367577 - in head: share/mk sys/conf tools/build/options Message-ID: <20201110225711.GE1959@spindle.one-eyed-alien.net> References: <202011101915.0AAJFEWf059408@repo.freebsd.org> <20201110191729.GC1959@spindle.one-eyed-alien.net> <20201110194445.wf5v63trwcv7fmzs@mutt-hbsd> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="UfEAyuTBtIjiZzX6" Content-Disposition: inline In-Reply-To: <20201110194445.wf5v63trwcv7fmzs@mutt-hbsd> User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 4CW3CX2dDDz3JKJ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 10 Nov 2020 22:57:12 -0000 --UfEAyuTBtIjiZzX6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 10, 2020 at 02:44:45PM -0500, Shawn Webb wrote: > On Tue, Nov 10, 2020 at 07:17:29PM +0000, Brooks Davis wrote: > > On Tue, Nov 10, 2020 at 07:15:14PM +0000, Brooks Davis wrote: > > > Author: brooks > > > Date: Tue Nov 10 19:15:13 2020 > > > New Revision: 367577 > > > URL: https://svnweb.freebsd.org/changeset/base/367577 > > >=20 > > > Log: > > > Support initializing stack variables on function entry > > > =20 > > > There are two options: > > > - WITH_INIT_ALL_ZERO: Zero all variables on the stack. > > > - WITH_INIT_ALL_PATTERN: Initialize variables with well-defined pa= tterns. > > > =20 > > > The exact pattern are a compiler implementation detail and vary by = type. > > > They are somewhat documented in the LLVM commit message: > > > https://reviews.llvm.org/rL349442 > > > I've used WITH_INIT_ALL_* to match Microsoft's InitAll feature rath= er > > > than naming them after the LLVM specific compiler flags. > > > =20 > > > In a range of consumer products, options like these are used in > > > both debug and production builds with debugs builds using patterns > > > (intended to provoke crashes on use of uninitialized values) and > > > production using zeros (deemed more likely to lead to harmless > > > misbehavior or NULL-pointer dereferences). > >=20 > > We've tested this extensively in CheriBSD on RISC-V, in the wild it's > > probably most tested on Arm64 and x86. > >=20 > > Despite the silly compiler flag you'll spot in the code, the zeroing > > option isn't going away in practice as Apple, Google, and Microsoft all > > ship with this feature in some of their products. >=20 > HardenedBSD's testing of this last year on amd64 have (privately) > shown the feature to really hinder performance on more complex > applications (like when applied to clang/lld). A build of base > without init all zero applied to clang/lld would take around 1.5 > hours on my system. A build with it applied to clang/lld took around > four hours, if my memory serves correctly. I would probably advise > against applying it system-wide. But YMMV. I agree a more nuanced approach is likely useful in practice, but this does work and is part of the configuration we shipped for DARPA's FETT bug bounty. Hopefully this provides a starting point for further exploration. -- Brooks --UfEAyuTBtIjiZzX6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJfqxrHAAoJEKzQXbSebgfAtNYIAJCpuSTOYukQKyc6+56Xvn9G ht5hEAAjfqcmaVtu3pYnVsdlp/VjMmCMPkiWje5VSSpzQg5BHETX+/LW3GCR6ICo DKeMvtWBxz/pB0jAfIKMcjdfEzz4JC6FprNhmOwEdW7lj27YVf2qFHvzhppjCX4N 4G8wsWS/ENKkzAadPoPPPMzjz0oqaRaugBK9Z/20/pMtQ6akWlmeW+nZGq/CLUbl qTjp1AkTn2O5IzqQX2tytzE7R5e3azc7u/li5mVj/gb1NBn/8GgGAoZdBZhw2i3G DaALOM8lSybubDUS+yURs43chwn8D/qUBXUWAuaqeO78hg+FHBrd0Lsa9cGXOrw= =cDR1 -----END PGP SIGNATURE----- --UfEAyuTBtIjiZzX6-- From owner-svn-src-head@freebsd.org Tue Nov 10 23:25:17 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B912C46728F; Tue, 10 Nov 2020 23:25:17 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CW3qx4tHvz3KLS; Tue, 10 Nov 2020 23:25:17 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A2762CA2; Tue, 10 Nov 2020 23:25:17 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AANPH6v013776; Tue, 10 Nov 2020 23:25:17 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AANPH7T013774; Tue, 10 Nov 2020 23:25:17 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202011102325.0AANPH7T013774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 10 Nov 2020 23:25:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367581 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 367581 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 10 Nov 2020 23:25:17 -0000 Author: imp Date: Tue Nov 10 23:25:16 2020 New Revision: 367581 URL: https://svnweb.freebsd.org/changeset/base/367581 Log: Add INIT_ALL_ZERO and INIT_ALL_PATTERN to kern.opts.mk These options need to be in the kern.opts.mk file to be alive for kernel and module builds. This also reverts r367579 since that's not needed with this fix: the host's bsd.opts.mk is irrelevant. Reviewed by: brooks@ Differential Revision: https://reviews.freebsd.org/D27170 Modified: head/sys/conf/kern.mk head/sys/conf/kern.opts.mk Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Tue Nov 10 21:29:10 2020 (r367580) +++ head/sys/conf/kern.mk Tue Nov 10 23:25:16 2020 (r367581) @@ -230,15 +230,15 @@ CFLAGS+= -mretpoline # # Initialize stack variables on function entry # -.if defined(MK_INIT_ALL_ZERO) && ${MK_INIT_ALL_ZERO} == "yes" -.if defined(COMPILER_FEATURES) && ${COMPILER_FEATURES:Minit-all} +.if ${MK_INIT_ALL_ZERO} == "yes" +.if ${COMPILER_FEATURES:Minit-all} CFLAGS+= -ftrivial-auto-var-init=zero \ -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang .else .warning InitAll (zeros) requested but not support by compiler .endif -.elif defined(MK_INIT_ALL_PATTERN) && ${MK_INIT_ALL_PATTERN} == "yes" -.if defined(COMPILER_FEATURES) && ${COMPILER_FEATURES:Minit-all} +.elif ${MK_INIT_ALL_PATTERN} == "yes" +.if ${COMPILER_FEATURES:Minit-all} CFLAGS+= -ftrivial-auto-var-init=pattern .else .warning InitAll (pattern) requested but not support by compiler Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Tue Nov 10 21:29:10 2020 (r367580) +++ head/sys/conf/kern.opts.mk Tue Nov 10 23:25:16 2020 (r367581) @@ -52,6 +52,8 @@ __DEFAULT_YES_OPTIONS = \ __DEFAULT_NO_OPTIONS = \ BHYVE_SNAPSHOT \ EXTRA_TCP_STACKS \ + INIT_ALL_PATTERN \ + INIT_ALL_ZERO \ KERNEL_RETPOLINE \ OFED \ RATELIMIT \ From owner-svn-src-head@freebsd.org Wed Nov 11 08:48:44 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 161992E1A1D; Wed, 11 Nov 2020 08:48:44 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CWJL409n4z4VXl; Wed, 11 Nov 2020 08:48:44 +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 ED3F511CD3; Wed, 11 Nov 2020 08:48:43 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AB8mhFP062128; Wed, 11 Nov 2020 08:48:43 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AB8mhug062126; Wed, 11 Nov 2020 08:48:43 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011110848.0AB8mhug062126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 11 Nov 2020 08:48:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367583 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 367583 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 11 Nov 2020 08:48:44 -0000 Author: mjg Date: Wed Nov 11 08:48:43 2020 New Revision: 367583 URL: https://svnweb.freebsd.org/changeset/base/367583 Log: thread: fix thread0 tid allocation Startup code hardcodes the value instead of allocating it. The first spawned thread would then be a duplicate. Pointy hat: mjg Modified: head/sys/kern/init_main.c head/sys/kern/kern_thread.c head/sys/sys/proc.h Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Wed Nov 11 00:43:13 2020 (r367582) +++ head/sys/kern/init_main.c Wed Nov 11 08:48:43 2020 (r367583) @@ -496,8 +496,7 @@ proc0_init(void *dummy __unused) p->p_klist = knlist_alloc(&p->p_mtx); STAILQ_INIT(&p->p_ktr); p->p_nice = NZERO; - /* pid_max cannot be greater than PID_MAX */ - td->td_tid = PID_MAX + 1; + td->td_tid = THREAD0_TID; LIST_INSERT_HEAD(TIDHASH(td->td_tid), td, td_hash); td->td_state = TDS_RUNNING; td->td_pri_class = PRI_TIMESHARE; Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Wed Nov 11 00:43:13 2020 (r367582) +++ head/sys/kern/kern_thread.c Wed Nov 11 08:48:43 2020 (r367583) @@ -354,6 +354,7 @@ extern int max_threads_per_proc; void threadinit(void) { + lwpid_t tid0; uint32_t flags; /* @@ -374,6 +375,9 @@ threadinit(void) mtx_init(&tid_lock, "TID lock", NULL, MTX_DEF); tid_bitmap = bit_alloc(maxthread, M_TIDHASH, M_WAITOK); + tid0 = tid_alloc(); + if (tid0 != THREAD0_TID) + panic("tid0 %d != %d\n", tid0, THREAD0_TID); flags = UMA_ZONE_NOFREE; #ifdef __aarch64__ Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Wed Nov 11 00:43:13 2020 (r367582) +++ head/sys/sys/proc.h Wed Nov 11 08:48:43 2020 (r367583) @@ -855,6 +855,7 @@ MALLOC_DECLARE(M_SUBPROC); */ #define PID_MAX 99999 #define NO_PID 100000 +#define THREAD0_TID NO_PID extern pid_t pid_max; #define SESS_LEADER(p) ((p)->p_session->s_leader == (p)) From owner-svn-src-head@freebsd.org Wed Nov 11 08:50:05 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B77532E1770; Wed, 11 Nov 2020 08:50:05 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CWJMd4r2rz4VNk; Wed, 11 Nov 2020 08:50:05 +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 98F5C11F93; Wed, 11 Nov 2020 08:50:05 +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 0AB8o5oA062279; Wed, 11 Nov 2020 08:50:05 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AB8o4VA062275; Wed, 11 Nov 2020 08:50:04 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011110850.0AB8o4VA062275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 11 Nov 2020 08:50:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367584 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 367584 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 11 Nov 2020 08:50:05 -0000 Author: mjg Date: Wed Nov 11 08:50:04 2020 New Revision: 367584 URL: https://svnweb.freebsd.org/changeset/base/367584 Log: thread: rework tidhash vs proc lock interaction Apart from minor clean up this gets rid of proc unlock/lock cycle on thread exit to work around LOR against tidhash lock. Modified: head/sys/kern/init_main.c head/sys/kern/kern_kthread.c head/sys/kern/kern_thr.c head/sys/kern/kern_thread.c head/sys/sys/proc.h Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Wed Nov 11 08:48:43 2020 (r367583) +++ head/sys/kern/init_main.c Wed Nov 11 08:50:04 2020 (r367584) @@ -497,7 +497,7 @@ proc0_init(void *dummy __unused) STAILQ_INIT(&p->p_ktr); p->p_nice = NZERO; td->td_tid = THREAD0_TID; - LIST_INSERT_HEAD(TIDHASH(td->td_tid), td, td_hash); + tidhash_add(td); td->td_state = TDS_RUNNING; td->td_pri_class = PRI_TIMESHARE; td->td_user_pri = PUSER; Modified: head/sys/kern/kern_kthread.c ============================================================================== --- head/sys/kern/kern_kthread.c Wed Nov 11 08:48:43 2020 (r367583) +++ head/sys/kern/kern_kthread.c Wed Nov 11 08:50:04 2020 (r367584) @@ -350,15 +350,12 @@ kthread_exit(void) * The last exiting thread in a kernel process must tear down * the whole process. */ - rw_wlock(&tidhash_lock); PROC_LOCK(p); if (p->p_numthreads == 1) { PROC_UNLOCK(p); - rw_wunlock(&tidhash_lock); kproc_exit(0); } - LIST_REMOVE(td, td_hash); - rw_wunlock(&tidhash_lock); + tidhash_remove(td); umtx_thread_exit(td); tdsigcleanup(td); PROC_SLOCK(p); Modified: head/sys/kern/kern_thr.c ============================================================================== --- head/sys/kern/kern_thr.c Wed Nov 11 08:48:43 2020 (r367583) +++ head/sys/kern/kern_thr.c Wed Nov 11 08:50:04 2020 (r367584) @@ -353,14 +353,13 @@ kern_thr_exit(struct thread *td) return (0); } - p->p_pendingexits++; td->td_dbgflags |= TDB_EXIT; - if (p->p_ptevents & PTRACE_LWP) + if (p->p_ptevents & PTRACE_LWP) { + p->p_pendingexits++; ptracestop(td, SIGTRAP, NULL); - PROC_UNLOCK(p); + p->p_pendingexits--; + } tidhash_remove(td); - PROC_LOCK(p); - p->p_pendingexits--; /* * The check above should prevent all other threads from this Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Wed Nov 11 08:48:43 2020 (r367583) +++ head/sys/kern/kern_thread.c Wed Nov 11 08:50:04 2020 (r367584) @@ -147,9 +147,10 @@ SYSCTL_INT(_kern, OID_AUTO, maxthread, CTLFLAG_RDTUN, static int nthreads; -struct tidhashhead *tidhashtbl; -u_long tidhash; -struct rwlock tidhash_lock; +static LIST_HEAD(tidhashhead, thread) *tidhashtbl; +static u_long tidhash; +static struct rwlock tidhash_lock; +#define TIDHASH(tid) (&tidhashtbl[(tid) & tidhash]) EVENTHANDLER_LIST_DEFINE(thread_ctor); EVENTHANDLER_LIST_DEFINE(thread_dtor); @@ -1329,13 +1330,65 @@ thread_single_end(struct proc *p, int mode) kick_proc0(); } -/* Locate a thread by number; return with proc lock held. */ +/* + * Locate a thread by number and return with proc lock held. + * + * thread exit establishes proc -> tidhash lock ordering, but lookup + * takes tidhash first and needs to return locked proc. + * + * The problem is worked around by relying on type-safety of both + * structures and doing the work in 2 steps: + * - tidhash-locked lookup which saves both thread and proc pointers + * - proc-locked verification that the found thread still matches + */ +static bool +tdfind_hash(lwpid_t tid, pid_t pid, struct proc **pp, struct thread **tdp) +{ +#define RUN_THRESH 16 + struct proc *p; + struct thread *td; + int run; + bool locked; + + run = 0; + rw_rlock(&tidhash_lock); + locked = true; + LIST_FOREACH(td, TIDHASH(tid), td_hash) { + if (td->td_tid != tid) { + run++; + continue; + } + p = td->td_proc; + if (pid != -1 && p->p_pid != pid) { + td = NULL; + break; + } + if (run > RUN_THRESH) { + if (rw_try_upgrade(&tidhash_lock)) { + LIST_REMOVE(td, td_hash); + LIST_INSERT_HEAD(TIDHASH(td->td_tid), + td, td_hash); + rw_wunlock(&tidhash_lock); + locked = false; + break; + } + } + break; + } + if (locked) + rw_runlock(&tidhash_lock); + if (td == NULL) + return (false); + *pp = p; + *tdp = td; + return (true); +} + struct thread * tdfind(lwpid_t tid, pid_t pid) { -#define RUN_THRESH 16 + struct proc *p; struct thread *td; - int run = 0; td = curthread; if (td->td_tid == tid) { @@ -1345,34 +1398,24 @@ tdfind(lwpid_t tid, pid_t pid) return (td); } - rw_rlock(&tidhash_lock); - LIST_FOREACH(td, TIDHASH(tid), td_hash) { - if (td->td_tid == tid) { - if (pid != -1 && td->td_proc->p_pid != pid) { - td = NULL; - break; - } - PROC_LOCK(td->td_proc); - if (td->td_proc->p_state == PRS_NEW) { - PROC_UNLOCK(td->td_proc); - td = NULL; - break; - } - if (run > RUN_THRESH) { - if (rw_try_upgrade(&tidhash_lock)) { - LIST_REMOVE(td, td_hash); - LIST_INSERT_HEAD(TIDHASH(td->td_tid), - td, td_hash); - rw_wunlock(&tidhash_lock); - return (td); - } - } - break; + for (;;) { + if (!tdfind_hash(tid, pid, &p, &td)) + return (NULL); + PROC_LOCK(p); + if (td->td_tid != tid) { + PROC_UNLOCK(p); + continue; } - run++; + if (td->td_proc != p) { + PROC_UNLOCK(p); + continue; + } + if (p->p_state == PRS_NEW) { + PROC_UNLOCK(p); + return (NULL); + } + return (td); } - rw_runlock(&tidhash_lock); - return (td); } void Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Wed Nov 11 08:48:43 2020 (r367583) +++ head/sys/sys/proc.h Wed Nov 11 08:50:04 2020 (r367584) @@ -968,10 +968,6 @@ extern LIST_HEAD(pidhashhead, proc) *pidhashtbl; extern struct sx *pidhashtbl_lock; extern u_long pidhash; extern u_long pidhashlock; -#define TIDHASH(tid) (&tidhashtbl[(tid) & tidhash]) -extern LIST_HEAD(tidhashhead, thread) *tidhashtbl; -extern u_long tidhash; -extern struct rwlock tidhash_lock; #define PGRPHASH(pgid) (&pgrphashtbl[(pgid) & pgrphash]) extern LIST_HEAD(pgrphashhead, pgrp) *pgrphashtbl; From owner-svn-src-head@freebsd.org Wed Nov 11 08:51:04 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EFABD2E1A5D; Wed, 11 Nov 2020 08:51:04 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CWJNm6X1Fz4Vrc; Wed, 11 Nov 2020 08:51:04 +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 C8B5711D59; Wed, 11 Nov 2020 08:51:04 +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 0AB8p47V066193; Wed, 11 Nov 2020 08:51:04 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AB8p4aG066192; Wed, 11 Nov 2020 08:51:04 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011110851.0AB8p4aG066192@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 11 Nov 2020 08:51:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367585 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 367585 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 11 Nov 2020 08:51:05 -0000 Author: mjg Date: Wed Nov 11 08:51:04 2020 New Revision: 367585 URL: https://svnweb.freebsd.org/changeset/base/367585 Log: thread: add more fine-grained tidhash locking Note this still does not scale but is enough to move it out of the way for the foreseable future. In particular a trivial benchmark spawning/killing threads stops contesting on tidhash. Modified: head/sys/kern/kern_thread.c Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Wed Nov 11 08:50:04 2020 (r367584) +++ head/sys/kern/kern_thread.c Wed Nov 11 08:51:04 2020 (r367585) @@ -149,8 +149,10 @@ static int nthreads; static LIST_HEAD(tidhashhead, thread) *tidhashtbl; static u_long tidhash; -static struct rwlock tidhash_lock; -#define TIDHASH(tid) (&tidhashtbl[(tid) & tidhash]) +static u_long tidhashlock; +static struct rwlock *tidhashtbl_lock; +#define TIDHASH(tid) (&tidhashtbl[(tid) & tidhash]) +#define TIDHASHLOCK(tid) (&tidhashtbl_lock[(tid) & tidhashlock]) EVENTHANDLER_LIST_DEFINE(thread_ctor); EVENTHANDLER_LIST_DEFINE(thread_dtor); @@ -355,6 +357,7 @@ extern int max_threads_per_proc; void threadinit(void) { + u_long i; lwpid_t tid0; uint32_t flags; @@ -395,7 +398,13 @@ threadinit(void) thread_ctor, thread_dtor, thread_init, thread_fini, 32 - 1, flags); tidhashtbl = hashinit(maxproc / 2, M_TIDHASH, &tidhash); - rw_init(&tidhash_lock, "tidhash"); + tidhashlock = (tidhash + 1) / 64; + if (tidhashlock > 0) + tidhashlock--; + tidhashtbl_lock = malloc(sizeof(*tidhashtbl_lock) * (tidhashlock + 1), + M_TIDHASH, M_WAITOK | M_ZERO); + for (i = 0; i < tidhashlock + 1; i++) + rw_init(&tidhashtbl_lock[i], "tidhash"); } /* @@ -1351,7 +1360,7 @@ tdfind_hash(lwpid_t tid, pid_t pid, struct proc **pp, bool locked; run = 0; - rw_rlock(&tidhash_lock); + rw_rlock(TIDHASHLOCK(tid)); locked = true; LIST_FOREACH(td, TIDHASH(tid), td_hash) { if (td->td_tid != tid) { @@ -1364,11 +1373,11 @@ tdfind_hash(lwpid_t tid, pid_t pid, struct proc **pp, break; } if (run > RUN_THRESH) { - if (rw_try_upgrade(&tidhash_lock)) { + if (rw_try_upgrade(TIDHASHLOCK(tid))) { LIST_REMOVE(td, td_hash); LIST_INSERT_HEAD(TIDHASH(td->td_tid), td, td_hash); - rw_wunlock(&tidhash_lock); + rw_wunlock(TIDHASHLOCK(tid)); locked = false; break; } @@ -1376,7 +1385,7 @@ tdfind_hash(lwpid_t tid, pid_t pid, struct proc **pp, break; } if (locked) - rw_runlock(&tidhash_lock); + rw_runlock(TIDHASHLOCK(tid)); if (td == NULL) return (false); *pp = p; @@ -1421,15 +1430,16 @@ tdfind(lwpid_t tid, pid_t pid) void tidhash_add(struct thread *td) { - rw_wlock(&tidhash_lock); + rw_wlock(TIDHASHLOCK(td->td_tid)); LIST_INSERT_HEAD(TIDHASH(td->td_tid), td, td_hash); - rw_wunlock(&tidhash_lock); + rw_wunlock(TIDHASHLOCK(td->td_tid)); } void tidhash_remove(struct thread *td) { - rw_wlock(&tidhash_lock); + + rw_wlock(TIDHASHLOCK(td->td_tid)); LIST_REMOVE(td, td_hash); - rw_wunlock(&tidhash_lock); + rw_wunlock(TIDHASHLOCK(td->td_tid)); } From owner-svn-src-head@freebsd.org Wed Nov 11 13:44:28 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BD0332EA441; Wed, 11 Nov 2020 13:44:28 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CWQvJ4p5sz4nBd; Wed, 11 Nov 2020 13:44:28 +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 9782F155EC; Wed, 11 Nov 2020 13:44:28 +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 0ABDiSeP048135; Wed, 11 Nov 2020 13:44:28 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ABDiR78048131; Wed, 11 Nov 2020 13:44:27 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202011111344.0ABDiR78048131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 11 Nov 2020 13:44:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367588 - 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: 367588 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 11 Nov 2020 13:44:28 -0000 Author: markj Date: Wed Nov 11 13:44:27 2020 New Revision: 367588 URL: https://svnweb.freebsd.org/changeset/base/367588 Log: Fix a pair of races in SIGIO registration First, funsetownlst() list looks at the first element of the list to see whether it's processing a process or a process group list. Then it acquires the global sigio lock and processes the list. However, nothing prevents the first sigio tracker from being freed by a concurrent funsetown() before the sigio lock is acquired. Fix this by acquiring the global sigio lock immediately after checking whether the list is empty. Callers of funsetownlst() ensure that new sigio trackers cannot be added concurrently. Second, fsetown() uses funsetown() to remove an existing sigio structure from a file object. However, funsetown() uses a racy check to avoid the sigio lock, so two threads may call fsetown() on the same file object, both observe that no sigio tracker is present, and enqueue two sigio trackers for the same file object. However, if the file object is destroyed, funsetown() will only remove one sigio tracker, and funsetownlst() may later trigger a use-after-free when it clears the file object reference for each entry in the list. Fix this by introducing funsetown_locked(), which avoids the racy check. Reviewed by: kib Reported by: pho Tested by: pho MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27157 Modified: head/sys/kern/kern_descrip.c head/sys/kern/kern_exit.c head/sys/kern/kern_proc.c head/sys/sys/signalvar.h Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Wed Nov 11 11:26:36 2020 (r367587) +++ head/sys/kern/kern_descrip.c Wed Nov 11 13:44:27 2020 (r367588) @@ -1001,6 +1001,40 @@ unlock: return (error); } +static void +sigiofree(struct sigio *sigio) +{ + crfree(sigio->sio_ucred); + free(sigio, M_SIGIO); +} + +static struct sigio * +funsetown_locked(struct sigio *sigio) +{ + struct proc *p; + struct pgrp *pg; + + SIGIO_ASSERT_LOCKED(); + + if (sigio == NULL) + return (NULL); + *(sigio->sio_myref) = NULL; + if (sigio->sio_pgid < 0) { + pg = sigio->sio_pgrp; + PGRP_LOCK(pg); + SLIST_REMOVE(&sigio->sio_pgrp->pg_sigiolst, sigio, + sigio, sio_pgsigio); + PGRP_UNLOCK(pg); + } else { + p = sigio->sio_proc; + PROC_LOCK(p); + SLIST_REMOVE(&sigio->sio_proc->p_sigiolst, sigio, + sigio, sio_pgsigio); + PROC_UNLOCK(p); + } + return (sigio); +} + /* * If sigio is on the list associated with a process or process group, * disable signalling from the device, remove sigio from the list and @@ -1011,92 +1045,82 @@ funsetown(struct sigio **sigiop) { struct sigio *sigio; + /* Racy check, consumers must provide synchronization. */ if (*sigiop == NULL) return; + SIGIO_LOCK(); - sigio = *sigiop; - if (sigio == NULL) { - SIGIO_UNLOCK(); - return; - } - *(sigio->sio_myref) = NULL; - if ((sigio)->sio_pgid < 0) { - struct pgrp *pg = (sigio)->sio_pgrp; - PGRP_LOCK(pg); - SLIST_REMOVE(&sigio->sio_pgrp->pg_sigiolst, sigio, - sigio, sio_pgsigio); - PGRP_UNLOCK(pg); - } else { - struct proc *p = (sigio)->sio_proc; - PROC_LOCK(p); - SLIST_REMOVE(&sigio->sio_proc->p_sigiolst, sigio, - sigio, sio_pgsigio); - PROC_UNLOCK(p); - } + sigio = funsetown_locked(*sigiop); SIGIO_UNLOCK(); - crfree(sigio->sio_ucred); - free(sigio, M_SIGIO); + if (sigio != NULL) + sigiofree(sigio); } /* - * Free a list of sigio structures. - * We only need to lock the SIGIO_LOCK because we have made ourselves - * inaccessible to callers of fsetown and therefore do not need to lock - * the proc or pgrp struct for the list manipulation. + * Free a list of sigio structures. The caller must ensure that new sigio + * structures cannot be added after this point. For process groups this is + * guaranteed using the proctree lock; for processes, the P_WEXIT flag serves + * as an interlock. */ void funsetownlst(struct sigiolst *sigiolst) { struct proc *p; struct pgrp *pg; - struct sigio *sigio; + struct sigio *sigio, *tmp; + /* Racy check. */ sigio = SLIST_FIRST(sigiolst); if (sigio == NULL) return; + p = NULL; pg = NULL; + SIGIO_LOCK(); + sigio = SLIST_FIRST(sigiolst); + if (sigio == NULL) { + SIGIO_UNLOCK(); + return; + } + /* - * Every entry of the list should belong - * to a single proc or pgrp. + * Every entry of the list should belong to a single proc or pgrp. */ if (sigio->sio_pgid < 0) { pg = sigio->sio_pgrp; - PGRP_LOCK_ASSERT(pg, MA_NOTOWNED); + sx_assert(&proctree_lock, SX_XLOCKED); + PGRP_LOCK(pg); } else /* if (sigio->sio_pgid > 0) */ { p = sigio->sio_proc; - PROC_LOCK_ASSERT(p, MA_NOTOWNED); + PROC_LOCK(p); + KASSERT((p->p_flag & P_WEXIT) != 0, + ("%s: process %p is not exiting", __func__, p)); } - SIGIO_LOCK(); - while ((sigio = SLIST_FIRST(sigiolst)) != NULL) { - *(sigio->sio_myref) = NULL; + SLIST_FOREACH(sigio, sigiolst, sio_pgsigio) { + *sigio->sio_myref = NULL; if (pg != NULL) { KASSERT(sigio->sio_pgid < 0, ("Proc sigio in pgrp sigio list")); KASSERT(sigio->sio_pgrp == pg, ("Bogus pgrp in sigio list")); - PGRP_LOCK(pg); - SLIST_REMOVE(&pg->pg_sigiolst, sigio, sigio, - sio_pgsigio); - PGRP_UNLOCK(pg); } else /* if (p != NULL) */ { KASSERT(sigio->sio_pgid > 0, ("Pgrp sigio in proc sigio list")); KASSERT(sigio->sio_proc == p, ("Bogus proc in sigio list")); - PROC_LOCK(p); - SLIST_REMOVE(&p->p_sigiolst, sigio, sigio, - sio_pgsigio); - PROC_UNLOCK(p); } - SIGIO_UNLOCK(); - crfree(sigio->sio_ucred); - free(sigio, M_SIGIO); - SIGIO_LOCK(); } + + if (pg != NULL) + PGRP_UNLOCK(pg); + else + PROC_UNLOCK(p); SIGIO_UNLOCK(); + + SLIST_FOREACH_SAFE(sigio, sigiolst, sio_pgsigio, tmp) + sigiofree(sigio); } /* @@ -1110,7 +1134,7 @@ fsetown(pid_t pgid, struct sigio **sigiop) { struct proc *proc; struct pgrp *pgrp; - struct sigio *sigio; + struct sigio *osigio, *sigio; int ret; if (pgid == 0) { @@ -1120,13 +1144,14 @@ fsetown(pid_t pgid, struct sigio **sigiop) ret = 0; - /* Allocate and fill in the new sigio out of locks. */ sigio = malloc(sizeof(struct sigio), M_SIGIO, M_WAITOK); sigio->sio_pgid = pgid; sigio->sio_ucred = crhold(curthread->td_ucred); sigio->sio_myref = sigiop; sx_slock(&proctree_lock); + SIGIO_LOCK(); + osigio = funsetown_locked(*sigiop); if (pgid > 0) { proc = pfind(pgid); if (proc == NULL) { @@ -1142,20 +1167,21 @@ fsetown(pid_t pgid, struct sigio **sigiop) * restrict FSETOWN to the current process or process * group for maximum safety. */ - PROC_UNLOCK(proc); if (proc->p_session != curthread->td_proc->p_session) { + PROC_UNLOCK(proc); ret = EPERM; goto fail; } - pgrp = NULL; + sigio->sio_proc = proc; + SLIST_INSERT_HEAD(&proc->p_sigiolst, sigio, sio_pgsigio); + PROC_UNLOCK(proc); } else /* if (pgid < 0) */ { pgrp = pgfind(-pgid); if (pgrp == NULL) { ret = ESRCH; goto fail; } - PGRP_UNLOCK(pgrp); /* * Policy - Don't allow a process to FSETOWN a process @@ -1166,44 +1192,28 @@ fsetown(pid_t pgid, struct sigio **sigiop) * group for maximum safety. */ if (pgrp->pg_session != curthread->td_proc->p_session) { + PGRP_UNLOCK(pgrp); ret = EPERM; goto fail; } - proc = NULL; - } - funsetown(sigiop); - if (pgid > 0) { - PROC_LOCK(proc); - /* - * Since funsetownlst() is called without the proctree - * locked, we need to check for P_WEXIT. - * XXX: is ESRCH correct? - */ - if ((proc->p_flag & P_WEXIT) != 0) { - PROC_UNLOCK(proc); - ret = ESRCH; - goto fail; - } - SLIST_INSERT_HEAD(&proc->p_sigiolst, sigio, sio_pgsigio); - sigio->sio_proc = proc; - PROC_UNLOCK(proc); - } else { - PGRP_LOCK(pgrp); SLIST_INSERT_HEAD(&pgrp->pg_sigiolst, sigio, sio_pgsigio); sigio->sio_pgrp = pgrp; PGRP_UNLOCK(pgrp); } sx_sunlock(&proctree_lock); - SIGIO_LOCK(); *sigiop = sigio; SIGIO_UNLOCK(); + if (osigio != NULL) + sigiofree(osigio); return (0); fail: + SIGIO_UNLOCK(); sx_sunlock(&proctree_lock); - crfree(sigio->sio_ucred); - free(sigio, M_SIGIO); + sigiofree(sigio); + if (osigio != NULL) + sigiofree(osigio); return (ret); } Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Wed Nov 11 11:26:36 2020 (r367587) +++ head/sys/kern/kern_exit.c Wed Nov 11 13:44:27 2020 (r367588) @@ -358,7 +358,7 @@ exit1(struct thread *td, int rval, int signo) /* * Reset any sigio structures pointing to us as a result of - * F_SETOWN with our pid. + * F_SETOWN with our pid. The P_WEXIT flag interlocks with fsetown(). */ funsetownlst(&p->p_sigiolst); Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Wed Nov 11 11:26:36 2020 (r367587) +++ head/sys/kern/kern_proc.c Wed Nov 11 13:44:27 2020 (r367588) @@ -774,7 +774,8 @@ pgdelete(struct pgrp *pgrp) /* * Reset any sigio structures pointing to us as a result of - * F_SETOWN with our pgid. + * F_SETOWN with our pgid. The proctree lock ensures that + * new sigio structures will not be added after this point. */ funsetownlst(&pgrp->pg_sigiolst); Modified: head/sys/sys/signalvar.h ============================================================================== --- head/sys/sys/signalvar.h Wed Nov 11 11:26:36 2020 (r367587) +++ head/sys/sys/signalvar.h Wed Nov 11 13:44:27 2020 (r367588) @@ -337,7 +337,7 @@ struct thread; #define SIGIO_TRYLOCK() mtx_trylock(&sigio_lock) #define SIGIO_UNLOCK() mtx_unlock(&sigio_lock) #define SIGIO_LOCKED() mtx_owned(&sigio_lock) -#define SIGIO_ASSERT(type) mtx_assert(&sigio_lock, type) +#define SIGIO_ASSERT_LOCKED(type) mtx_assert(&sigio_lock, MA_OWNED) extern struct mtx sigio_lock; From owner-svn-src-head@freebsd.org Wed Nov 11 13:48:08 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CD20C2EA898; Wed, 11 Nov 2020 13:48:08 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CWQzX5SF2z4nLj; Wed, 11 Nov 2020 13:48:08 +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 A9F38159F6; Wed, 11 Nov 2020 13:48:08 +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 0ABDm8OU048338; Wed, 11 Nov 2020 13:48:08 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ABDm84Y048336; Wed, 11 Nov 2020 13:48:08 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202011111348.0ABDm84Y048336@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 11 Nov 2020 13:48:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367589 - in head/sys: geom ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: geom ufs/ffs X-SVN-Commit-Revision: 367589 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 11 Nov 2020 13:48:08 -0000 Author: markj Date: Wed Nov 11 13:48:07 2020 New Revision: 367589 URL: https://svnweb.freebsd.org/changeset/base/367589 Log: ffs: Clamp BIO_SPEEDUP length On 32-bit platforms, the computed size of the BIO_SPEEDUP requested by softdep_request_cleanup() may be negative when assigned to bp->b_bcount, which has type "long". Clamp the size to LONG_MAX. Also convert the unused g_io_speedup() to use an off_t for the magnitude of the shortage for consistency with softdep_send_speedup(). Reviewed by: chs, kib Reported by: pho Tested by: pho Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27081 Modified: head/sys/geom/geom.h head/sys/geom/geom_io.c head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/geom/geom.h ============================================================================== --- head/sys/geom/geom.h Wed Nov 11 13:44:27 2020 (r367588) +++ head/sys/geom/geom.h Wed Nov 11 13:48:07 2020 (r367589) @@ -334,7 +334,8 @@ void g_io_deliver(struct bio *bp, int error); int g_io_getattr(const char *attr, struct g_consumer *cp, int *len, void *ptr); int g_io_zonecmd(struct disk_zone_args *zone_args, struct g_consumer *cp); int g_io_flush(struct g_consumer *cp); -int g_io_speedup(size_t shortage, u_int flags, size_t *resid, struct g_consumer *cp); +int g_io_speedup(off_t shortage, u_int flags, size_t *resid, + struct g_consumer *cp); void g_io_request(struct bio *bp, struct g_consumer *cp); struct bio *g_new_bio(void); struct bio *g_alloc_bio(void); Modified: head/sys/geom/geom_io.c ============================================================================== --- head/sys/geom/geom_io.c Wed Nov 11 13:44:27 2020 (r367588) +++ head/sys/geom/geom_io.c Wed Nov 11 13:48:07 2020 (r367589) @@ -341,15 +341,15 @@ g_io_zonecmd(struct disk_zone_args *zone_args, struct * operation should be done. */ int -g_io_speedup(size_t shortage, u_int flags, size_t *resid, struct g_consumer *cp) +g_io_speedup(off_t shortage, u_int flags, size_t *resid, struct g_consumer *cp) { struct bio *bp; int error; KASSERT((flags & (BIO_SPEEDUP_TRIM | BIO_SPEEDUP_WRITE)) != 0, ("Invalid flags passed to g_io_speedup: %#x", flags)); - g_trace(G_T_BIO, "bio_speedup(%s, %zu, %#x)", cp->provider->name, - shortage, flags); + g_trace(G_T_BIO, "bio_speedup(%s, %jd, %#x)", cp->provider->name, + (intmax_t)shortage, flags); bp = g_new_bio(); if (bp == NULL) return (ENOMEM); Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Wed Nov 11 13:44:27 2020 (r367588) +++ head/sys/ufs/ffs/ffs_softdep.c Wed Nov 11 13:48:07 2020 (r367589) @@ -1464,7 +1464,7 @@ worklist_speedup(mp) } static void -softdep_send_speedup(struct ufsmount *ump, size_t shortage, u_int flags) +softdep_send_speedup(struct ufsmount *ump, off_t shortage, u_int flags) { struct buf *bp; @@ -1474,7 +1474,7 @@ softdep_send_speedup(struct ufsmount *ump, size_t shor bp = malloc(sizeof(*bp), M_TRIM, M_WAITOK | M_ZERO); bp->b_iocmd = BIO_SPEEDUP; bp->b_ioflags = flags; - bp->b_bcount = shortage; + bp->b_bcount = omin(shortage, LONG_MAX); g_vfs_strategy(ump->um_bo, bp); bufwait(bp); free(bp, M_TRIM); From owner-svn-src-head@freebsd.org Wed Nov 11 13:58:44 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E3BFD2EACF4; Wed, 11 Nov 2020 13:58:44 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CWRCm5dhrz4pNy; Wed, 11 Nov 2020 13:58:44 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 73CE926020D; Wed, 11 Nov 2020 14:58:36 +0100 (CET) Subject: Re: svn commit: r367588 - in head/sys: kern sys To: Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202011111344.0ABDiR78048131@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <447c18d6-8543-9cc9-83a2-cb053d999d86@selasky.org> Date: Wed, 11 Nov 2020 14:58:32 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.4.1 MIME-Version: 1.0 In-Reply-To: <202011111344.0ABDiR78048131@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4CWRCm5dhrz4pNy X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 11 Nov 2020 13:58:44 -0000 On 11/11/20 2:44 PM, Mark Johnston wrote: > +#define SIGIO_ASSERT_LOCKED(type) mtx_assert(&sigio_lock, MA_OWNED) > Minor nit: "type" argument can be removed from macro. --HPS From owner-svn-src-head@freebsd.org Wed Nov 11 14:03:50 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7D2A92EAD2C; Wed, 11 Nov 2020 14:03:50 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CWRKf31FDz4pyp; Wed, 11 Nov 2020 14:03:50 +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 5A66E15ED3; Wed, 11 Nov 2020 14:03:50 +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 0ABE3oU2060472; Wed, 11 Nov 2020 14:03:50 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ABE3o8N060471; Wed, 11 Nov 2020 14:03:50 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202011111403.0ABE3o8N060471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 11 Nov 2020 14:03:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367590 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 367590 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 11 Nov 2020 14:03:50 -0000 Author: markj Date: Wed Nov 11 14:03:49 2020 New Revision: 367590 URL: https://svnweb.freebsd.org/changeset/base/367590 Log: Remove an extraneous parameter from SIGIO_ASSERT_LOCKED() Reported by: hselasky MFC with: r367588 Modified: head/sys/sys/signalvar.h Modified: head/sys/sys/signalvar.h ============================================================================== --- head/sys/sys/signalvar.h Wed Nov 11 13:48:07 2020 (r367589) +++ head/sys/sys/signalvar.h Wed Nov 11 14:03:49 2020 (r367590) @@ -337,7 +337,7 @@ struct thread; #define SIGIO_TRYLOCK() mtx_trylock(&sigio_lock) #define SIGIO_UNLOCK() mtx_unlock(&sigio_lock) #define SIGIO_LOCKED() mtx_owned(&sigio_lock) -#define SIGIO_ASSERT_LOCKED(type) mtx_assert(&sigio_lock, MA_OWNED) +#define SIGIO_ASSERT_LOCKED() mtx_assert(&sigio_lock, MA_OWNED) extern struct mtx sigio_lock; From owner-svn-src-head@freebsd.org Wed Nov 11 14:04:07 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D0DC52EAE30; Wed, 11 Nov 2020 14:04:07 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com [IPv6:2607:f8b0:4864:20::72d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CWRKz5P1Rz4q0S; Wed, 11 Nov 2020 14:04:07 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk1-x72d.google.com with SMTP id n132so1720722qke.1; Wed, 11 Nov 2020 06:04:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=IapRCPef0q0SsjShoqPdFYnhzyGsT3TUjLGeNwZ4Dqk=; b=pz3nVLPPJv2pLX4EcpzO1vw9N0X501iQOR4QWkD8nOBkSuZM+TdnHDLmUbSsRJehGq m90zWVi++EtIE4tQ/nrT/ffnVOMQYglin+w00ADhUhRNdcuAA06elLgJW1VtC/UIC3ji GeK7lq6l9KcGlGgIgB3QGdXxew3BnMRVE4eZZ4byPhahBFcQssdr193KhO729Yey6DcW YmF7WSoathrVbEbz78yh7V0R/ljz2uEoApi1urDhztlulKTYMGiBi5lw+B78jgFqg0YA MgdeIFkPeNw6n+P3FEPARPTkgIkapqPi2vZ1X1e5rXP5IUeS7b6nD0t5cs/TbVw4OhT2 dm/A== 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; bh=IapRCPef0q0SsjShoqPdFYnhzyGsT3TUjLGeNwZ4Dqk=; b=tayc4lA++5jgmbck65XuHuEPaliZ5GMuaiGGeqboM7FxOYTEX4NahkA89uh4o1WBvL GKUFZRHLVzDH+la/c/i6mC4RlQ2bp8ac/WPWZGJ4Vmegdz7Nhmz9Ub2+7exGMQdNTcGL N/Ng4MuEOZY/hvViooBeV2mr4lXGnp0vFau2c7Iv9TwLoJlKwx8c3PNtFU/FimQiHz0j BtXRNwMyz2mQtBjwomcULK59Z4k0QiOhHPTXfLo4taDA8b4awUXAR2owqomtO6OTTLIP B038TRfnSfkP4K9F3mzgx6jXDFioVbdqgDFd2cUCGtNVcTDPqHU/fyOqjXyRlpz2/u1f MBIg== X-Gm-Message-State: AOAM530A0trhu/OdInbCnsL1OuIKnI2LNj6jryFAaSCnXJ4STtopwRTu 76xptPYlyGKCxF16iqwDXxPW70C2sNE= X-Google-Smtp-Source: ABdhPJz6syg9cGp03qFIjPphvIKGqa/uAqIhRF+kkfXQXa6BDbS4uAboQi4NRzmHa1vl6GTOZ7Xpfw== X-Received: by 2002:a37:8cc1:: with SMTP id o184mr25734000qkd.205.1605103446821; Wed, 11 Nov 2020 06:04:06 -0800 (PST) Received: from raichu ([142.126.164.150]) by smtp.gmail.com with ESMTPSA id w54sm2333924qtb.0.2020.11.11.06.04.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Nov 2020 06:04:06 -0800 (PST) Sender: Mark Johnston Date: Wed, 11 Nov 2020 09:04:01 -0500 From: Mark Johnston To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r367588 - in head/sys: kern sys Message-ID: <20201111140401.GA89522@raichu> References: <202011111344.0ABDiR78048131@repo.freebsd.org> <447c18d6-8543-9cc9-83a2-cb053d999d86@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <447c18d6-8543-9cc9-83a2-cb053d999d86@selasky.org> X-Rspamd-Queue-Id: 4CWRKz5P1Rz4q0S X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 11 Nov 2020 14:04:07 -0000 On Wed, Nov 11, 2020 at 02:58:32PM +0100, Hans Petter Selasky wrote: > On 11/11/20 2:44 PM, Mark Johnston wrote: > > +#define SIGIO_ASSERT_LOCKED(type) mtx_assert(&sigio_lock, MA_OWNED) > > > > Minor nit: "type" argument can be removed from macro. Fixed, thanks. From owner-svn-src-head@freebsd.org Wed Nov 11 14:53:04 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C886F2EC51E; Wed, 11 Nov 2020 14:53:04 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CWSQS39Wzz4sM6; Wed, 11 Nov 2020 14:53:04 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D6BF16880; Wed, 11 Nov 2020 14:53:04 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ABEr3rc089572; Wed, 11 Nov 2020 14:53:03 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ABEr3jh089571; Wed, 11 Nov 2020 14:53:03 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202011111453.0ABEr3jh089571@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Wed, 11 Nov 2020 14:53:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367592 - head/usr.bin/env X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/usr.bin/env X-SVN-Commit-Revision: 367592 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 11 Nov 2020 14:53:04 -0000 Author: 0mp (doc,ports committer) Date: Wed Nov 11 14:53:03 2020 New Revision: 367592 URL: https://svnweb.freebsd.org/changeset/base/367592 Log: Document in the synopsis that -0 cannot be used with the utility argument Modified: head/usr.bin/env/env.1 Modified: head/usr.bin/env/env.1 ============================================================================== --- head/usr.bin/env/env.1 Wed Nov 11 14:06:45 2020 (r367591) +++ head/usr.bin/env/env.1 Wed Nov 11 14:53:03 2020 (r367592) @@ -31,7 +31,7 @@ .\" From FreeBSD: src/usr.bin/printenv/printenv.1,v 1.17 2002/11/26 17:33:35 ru Exp .\" $FreeBSD$ .\" -.Dd April 24, 2020 +.Dd November 11, 2020 .Dt ENV 1 .Os .Sh NAME @@ -41,11 +41,16 @@ .Nm .Op Fl 0iv .Op Fl L Ns | Ns Fl U Ar user Ns Op / Ns Ar class +.Op Fl u Ar name +.Op Ar name Ns = Ns Ar value ... +.Nm +.Op Fl iv +.Op Fl L Ns | Ns Fl U Ar user Ns Op / Ns Ar class .Op Fl P Ar altpath .Op Fl S Ar string .Op Fl u Ar name .Op Ar name Ns = Ns Ar value ... -.Op Ar utility Op Ar argument ... +.Ar utility Op Ar argument ... .Sh DESCRIPTION The .Nm From owner-svn-src-head@freebsd.org Wed Nov 11 15:01:18 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ED1F32EC6F8; Wed, 11 Nov 2020 15:01:18 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CWSby6Lxyz4t4t; Wed, 11 Nov 2020 15:01:18 +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 C24DB163CE; Wed, 11 Nov 2020 15:01:18 +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 0ABF1I4e093923; Wed, 11 Nov 2020 15:01:18 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ABF1IwK093919; Wed, 11 Nov 2020 15:01:18 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202011111501.0ABF1IwK093919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 11 Nov 2020 15:01:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367593 - in head/sys/amd64: amd64 include vmm/amd vmm/intel X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys/amd64: amd64 include vmm/amd vmm/intel X-SVN-Commit-Revision: 367593 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 11 Nov 2020 15:01:19 -0000 Author: markj Date: Wed Nov 11 15:01:17 2020 New Revision: 367593 URL: https://svnweb.freebsd.org/changeset/base/367593 Log: vmm: Make pmap_invalidate_ept() wait synchronously for guest exits Currently EPT TLB invalidation is done by incrementing a generation counter and issuing an IPI to all CPUs currently running vCPU threads. The VMM inner loop caches the most recently observed generation on each host CPU and invalidates TLB entries before executing the VM if the cached generation number is not the most recent value. pmap_invalidate_ept() issues IPIs to force each vCPU to stop executing guest instructions and reload the generation number. However, it does not actually wait for vCPUs to exit, potentially creating a window where guests may continue to reference stale TLB entries. Fix the problem by bracketing guest execution with an SMR read section which is entered before loading the invalidation generation. Then, pmap_invalidate_ept() increments the current write sequence before loading pm_active and sending IPIs, and polls readers to ensure that all vCPUs potentially operating with stale TLB entries have exited before pmap_invalidate_ept() returns. Also ensure that unsynchronized loads of the generation counter are wrapped with atomic(9), and stop (inconsistently) updating the invalidation counter and pm_active bitmask with acquire semantics. Reviewed by: grehan, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26910 Modified: head/sys/amd64/amd64/pmap.c head/sys/amd64/include/pmap.h head/sys/amd64/vmm/amd/svm.c head/sys/amd64/vmm/intel/vmx.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Wed Nov 11 14:53:03 2020 (r367592) +++ head/sys/amd64/amd64/pmap.c Wed Nov 11 15:01:17 2020 (r367593) @@ -125,6 +125,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -2647,7 +2648,7 @@ pmap_update_pde_store(pmap_t pmap, pd_entry_t *pde, pd * "all" host cpus and force any vcpu context to exit as a * side-effect. */ - atomic_add_acq_long(&pmap->pm_eptgen, 1); + atomic_add_long(&pmap->pm_eptgen, 1); break; default: panic("pmap_update_pde_store: bad pm_type %d", pmap->pm_type); @@ -2722,6 +2723,7 @@ pmap_update_pde_invalidate(pmap_t pmap, vm_offset_t va static __inline void pmap_invalidate_ept(pmap_t pmap) { + smr_seq_t goal; int ipinum; sched_pin(); @@ -2742,15 +2744,30 @@ pmap_invalidate_ept(pmap_t pmap) * Each vcpu keeps a cache of this counter and compares it * just before a vmresume. If the counter is out-of-date an * invept will be done to flush stale mappings from the TLB. + * + * To ensure that all vCPU threads have observed the new counter + * value before returning, we use SMR. Ordering is important here: + * the VMM enters an SMR read section before loading the counter + * and after updating the pm_active bit set. Thus, pm_active is + * a superset of active readers, and any reader that has observed + * the goal has observed the new counter value. */ - atomic_add_acq_long(&pmap->pm_eptgen, 1); + atomic_add_long(&pmap->pm_eptgen, 1); + goal = smr_advance(pmap->pm_eptsmr); + /* * Force the vcpu to exit and trap back into the hypervisor. */ ipinum = pmap->pm_flags & PMAP_NESTED_IPIMASK; ipi_selected(pmap->pm_active, ipinum); sched_unpin(); + + /* + * Ensure that all active vCPUs will observe the new generation counter + * value before executing any more guest instructions. + */ + smr_wait(pmap->pm_eptsmr, goal); } static cpuset_t @@ -4086,7 +4103,8 @@ pmap_pinit_type(pmap_t pmap, enum pmap_type pm_type, i * address space. * Install minimal kernel mappings in PTI case. */ - if (pm_type == PT_X86) { + switch (pm_type) { + case PT_X86: pmap->pm_cr3 = pmltop_phys; if (pmap_is_la57(pmap)) pmap_pinit_pml5(pmltop_pg); @@ -4107,6 +4125,11 @@ pmap_pinit_type(pmap_t pmap, enum pmap_type pm_type, i rangeset_init(&pmap->pm_pkru, pkru_dup_range, pkru_free_range, pmap, M_NOWAIT); } + break; + case PT_EPT: + case PT_RVI: + pmap->pm_eptsmr = smr_create("pmap", 0, 0); + break; } pmap->pm_root.rt_root = 0; Modified: head/sys/amd64/include/pmap.h ============================================================================== --- head/sys/amd64/include/pmap.h Wed Nov 11 14:53:03 2020 (r367592) +++ head/sys/amd64/include/pmap.h Wed Nov 11 15:01:17 2020 (r367593) @@ -270,6 +270,7 @@ #include #include #include +#include #include @@ -371,6 +372,7 @@ struct pmap { struct pmap_statistics pm_stats; /* pmap statistics */ struct vm_radix pm_root; /* spare page table pages */ long pm_eptgen; /* EPT pmap generation id */ + smr_t pm_eptsmr; int pm_flags; struct pmap_pcids pm_pcids[MAXCPU]; struct rangeset pm_pkru; Modified: head/sys/amd64/vmm/amd/svm.c ============================================================================== --- head/sys/amd64/vmm/amd/svm.c Wed Nov 11 14:53:03 2020 (r367592) +++ head/sys/amd64/vmm/amd/svm.c Wed Nov 11 15:01:17 2020 (r367593) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -1800,15 +1801,17 @@ restore_host_tss(void) } static void -check_asid(struct svm_softc *sc, int vcpuid, pmap_t pmap, u_int thiscpu) +svm_pmap_activate(struct svm_softc *sc, int vcpuid, pmap_t pmap) { struct svm_vcpu *vcpustate; struct vmcb_ctrl *ctrl; long eptgen; + int cpu; bool alloc_asid; - KASSERT(CPU_ISSET(thiscpu, &pmap->pm_active), ("%s: nested pmap not " - "active on cpu %u", __func__, thiscpu)); + cpu = curcpu; + CPU_SET_ATOMIC(cpu, &pmap->pm_active); + smr_enter(pmap->pm_eptsmr); vcpustate = svm_get_vcpu(sc, vcpuid); ctrl = svm_get_vmcb_ctrl(sc, vcpuid); @@ -1849,10 +1852,10 @@ check_asid(struct svm_softc *sc, int vcpuid, pmap_t pm */ alloc_asid = false; - eptgen = pmap->pm_eptgen; + eptgen = atomic_load_long(&pmap->pm_eptgen); ctrl->tlb_ctrl = VMCB_TLB_FLUSH_NOTHING; - if (vcpustate->asid.gen != asid[thiscpu].gen) { + if (vcpustate->asid.gen != asid[cpu].gen) { alloc_asid = true; /* (c) and (d) */ } else if (vcpustate->eptgen != eptgen) { if (flush_by_asid()) @@ -1869,10 +1872,10 @@ check_asid(struct svm_softc *sc, int vcpuid, pmap_t pm } if (alloc_asid) { - if (++asid[thiscpu].num >= nasid) { - asid[thiscpu].num = 1; - if (++asid[thiscpu].gen == 0) - asid[thiscpu].gen = 1; + if (++asid[cpu].num >= nasid) { + asid[cpu].num = 1; + if (++asid[cpu].gen == 0) + asid[cpu].gen = 1; /* * If this cpu does not support "flush-by-asid" * then flush the entire TLB on a generation @@ -1882,8 +1885,8 @@ check_asid(struct svm_softc *sc, int vcpuid, pmap_t pm if (!flush_by_asid()) ctrl->tlb_ctrl = VMCB_TLB_FLUSH_ALL; } - vcpustate->asid.gen = asid[thiscpu].gen; - vcpustate->asid.num = asid[thiscpu].num; + vcpustate->asid.gen = asid[cpu].gen; + vcpustate->asid.num = asid[cpu].num; ctrl->asid = vcpustate->asid.num; svm_set_dirty(sc, vcpuid, VMCB_CACHE_ASID); @@ -1902,6 +1905,13 @@ check_asid(struct svm_softc *sc, int vcpuid, pmap_t pm ("ASID mismatch: %u/%u", ctrl->asid, vcpustate->asid.num)); } +static void +svm_pmap_deactivate(pmap_t pmap) +{ + smr_exit(pmap->pm_eptsmr); + CPU_CLR_ATOMIC(curcpu, &pmap->pm_active); +} + static __inline void disable_gintr(void) { @@ -2083,14 +2093,11 @@ svm_vmrun(void *arg, int vcpu, register_t rip, pmap_t svm_inj_interrupts(svm_sc, vcpu, vlapic); - /* Activate the nested pmap on 'curcpu' */ - CPU_SET_ATOMIC_ACQ(curcpu, &pmap->pm_active); - /* * Check the pmap generation and the ASID generation to * ensure that the vcpu does not use stale TLB mappings. */ - check_asid(svm_sc, vcpu, pmap, curcpu); + svm_pmap_activate(svm_sc, vcpu, pmap); ctrl->vmcb_clean = vmcb_clean & ~vcpustate->dirty; vcpustate->dirty = 0; @@ -2102,7 +2109,7 @@ svm_vmrun(void *arg, int vcpu, register_t rip, pmap_t svm_launch(vmcb_pa, gctx, get_pcpu()); svm_dr_leave_guest(gctx); - CPU_CLR_ATOMIC(curcpu, &pmap->pm_active); + svm_pmap_deactivate(pmap); /* * The host GDTR and IDTR is saved by VMRUN and restored Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Wed Nov 11 14:53:03 2020 (r367592) +++ head/sys/amd64/vmm/intel/vmx.c Wed Nov 11 15:01:17 2020 (r367593) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -1273,7 +1274,7 @@ vmx_invvpid(struct vmx *vmx, int vcpu, pmap_t pmap, in * Note also that this will invalidate mappings tagged with 'vpid' * for "all" EP4TAs. */ - if (pmap->pm_eptgen == vmx->eptgen[curcpu]) { + if (atomic_load_long(&pmap->pm_eptgen) == vmx->eptgen[curcpu]) { invvpid_desc._res1 = 0; invvpid_desc._res2 = 0; invvpid_desc.vpid = vmxstate->vpid; @@ -2948,6 +2949,7 @@ vmx_pmap_activate(struct vmx *vmx, pmap_t pmap) cpu = curcpu; CPU_SET_ATOMIC(cpu, &pmap->pm_active); + smr_enter(pmap->pm_eptsmr); eptgen = atomic_load_long(&pmap->pm_eptgen); if (eptgen != vmx->eptgen[cpu]) { vmx->eptgen[cpu] = eptgen; @@ -2959,6 +2961,7 @@ vmx_pmap_activate(struct vmx *vmx, pmap_t pmap) static __inline void vmx_pmap_deactivate(struct vmx *vmx, pmap_t pmap) { + smr_exit(pmap->pm_eptsmr); CPU_CLR_ATOMIC(curcpu, &pmap->pm_active); } From owner-svn-src-head@freebsd.org Wed Nov 11 15:53:37 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 44F632EDE0B; Wed, 11 Nov 2020 15:53:37 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CWTmK08V7z3CQn; Wed, 11 Nov 2020 15:53:37 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC44216FF9; Wed, 11 Nov 2020 15:53:36 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ABFraN6024939; Wed, 11 Nov 2020 15:53:36 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ABFraMd024938; Wed, 11 Nov 2020 15:53:36 GMT (envelope-from ae@FreeBSD.org) Message-Id: <202011111553.0ABFraMd024938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 11 Nov 2020 15:53:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367594 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 367594 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 11 Nov 2020 15:53:37 -0000 Author: ae Date: Wed Nov 11 15:53:36 2020 New Revision: 367594 URL: https://svnweb.freebsd.org/changeset/base/367594 Log: Fix possible NULL pointer dereference. lagg(4) replaces if_output method of its child interfaces and expects that this method can be called only by child interfaces. But it is possible that lagg_port_output() could be called by children of child interfaces. In this case ifnet's if_lagg field is NULL. Add check that lp is not NULL. Obtained from: Yandex LLC MFC after: 1 week Sponsored by: Yandex LLC Modified: head/sys/net/if_lagg.c Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Wed Nov 11 15:01:17 2020 (r367593) +++ head/sys/net/if_lagg.c Wed Nov 11 15:53:36 2020 (r367594) @@ -1145,7 +1145,8 @@ lagg_port_output(struct ifnet *ifp, struct mbuf *m, switch (dst->sa_family) { case pseudo_AF_HDRCMPLT: case AF_UNSPEC: - return ((*lp->lp_output)(ifp, m, dst, ro)); + if (lp != NULL) + return ((*lp->lp_output)(ifp, m, dst, ro)); } /* drop any other frames */ From owner-svn-src-head@freebsd.org Wed Nov 11 17:16:40 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 399DA2EFACD; Wed, 11 Nov 2020 17:16:40 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CWWc8167Zz3H0K; Wed, 11 Nov 2020 17:16:40 +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 18FB6180CE; Wed, 11 Nov 2020 17:16:40 +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 0ABHGd7g071254; Wed, 11 Nov 2020 17:16:39 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ABHGd7X071252; Wed, 11 Nov 2020 17:16:39 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202011111716.0ABHGd7X071252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 11 Nov 2020 17:16:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367595 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 367595 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 11 Nov 2020 17:16:40 -0000 Author: markj Date: Wed Nov 11 17:16:39 2020 New Revision: 367595 URL: https://svnweb.freebsd.org/changeset/base/367595 Log: vm_map: Handle kernel map entry allocator recursion On platforms without a direct map[*], vm_map_insert() may in rare situations need to allocate a kernel map entry in order to allocate kernel map entries. This poses a problem similar to the one solved for vmem boundary tags by vmem_bt_alloc(). In fact the kernel map case is a bit more complicated since we must allocate entries with the kernel map locked, whereas vmem can recurse into itself because boundary tags are allocated up-front. The solution is to add a custom slab allocator for kmapentzone which allocates KVA directly from kernel_map, bypassing the kmem_* layer. This avoids mutual recursion with the vmem btag allocator. Then, when vm_map_insert() allocates a new kernel map entry, it avoids triggering allocation of a new slab with M_NOVM until after the insertion is complete. Instead, vm_map_insert() allocates from the reserve and sets a flag in kernel_map to trigger re-population of the reserve just before the map is unlocked. This places an implicit upper bound on the number of kernel map entries that may be allocated before the kernel map lock is released, but in general a bound of 1 suffices. [*] This also comes up on amd64 with UMA_MD_SMALL_ALLOC undefined, a configuration required by some kernel sanitizers. Discussed with: kib, rlibby Reported by: andrew Tested by: pho (i386 and amd64 with !UMA_MD_SMALL_ALLOC) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26851 Modified: head/sys/vm/vm_map.c head/sys/vm/vm_map.h Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Wed Nov 11 15:53:36 2020 (r367594) +++ head/sys/vm/vm_map.c Wed Nov 11 17:16:39 2020 (r367595) @@ -175,29 +175,106 @@ static void vm_map_wire_entry_failure(vm_map_t map, vm start = end; \ } +#ifndef UMA_MD_SMALL_ALLOC + /* + * Allocate a new slab for kernel map entries. The kernel map may be locked or + * unlocked, depending on whether the request is coming from the kernel map or a + * submap. This function allocates a virtual address range directly from the + * kernel map instead of the kmem_* layer to avoid recursion on the kernel map + * lock and also to avoid triggering allocator recursion in the vmem boundary + * tag allocator. + */ +static void * +kmapent_alloc(uma_zone_t zone, vm_size_t bytes, int domain, uint8_t *pflag, + int wait) +{ + vm_offset_t addr; + int error, locked; + + *pflag = UMA_SLAB_PRIV; + + if (!(locked = vm_map_locked(kernel_map))) + vm_map_lock(kernel_map); + addr = vm_map_findspace(kernel_map, vm_map_min(kernel_map), bytes); + if (addr + bytes < addr || addr + bytes > vm_map_max(kernel_map)) + panic("%s: kernel map is exhausted", __func__); + error = vm_map_insert(kernel_map, NULL, 0, addr, addr + bytes, + VM_PROT_RW, VM_PROT_RW, MAP_NOFAULT); + if (error != KERN_SUCCESS) + panic("%s: vm_map_insert() failed: %d", __func__, error); + if (!locked) + vm_map_unlock(kernel_map); + error = kmem_back_domain(domain, kernel_object, addr, bytes, M_NOWAIT | + M_USE_RESERVE | (wait & M_ZERO)); + if (error == KERN_SUCCESS) { + return ((void *)addr); + } else { + if (!locked) + vm_map_lock(kernel_map); + vm_map_delete(kernel_map, addr, bytes); + if (!locked) + vm_map_unlock(kernel_map); + return (NULL); + } +} + +static void +kmapent_free(void *item, vm_size_t size, uint8_t pflag) +{ + vm_offset_t addr; + int error; + + if ((pflag & UMA_SLAB_PRIV) == 0) + /* XXX leaked */ + return; + + addr = (vm_offset_t)item; + kmem_unback(kernel_object, addr, size); + error = vm_map_remove(kernel_map, addr, addr + size); + KASSERT(error == KERN_SUCCESS, + ("%s: vm_map_remove failed: %d", __func__, error)); +} + +/* + * The worst-case upper bound on the number of kernel map entries that may be + * created before the zone must be replenished in _vm_map_unlock(). + */ +#define KMAPENT_RESERVE 1 + +#endif /* !UMD_MD_SMALL_ALLOC */ + +/* * vm_map_startup: * - * Initialize the vm_map module. Must be called before - * any other vm_map routines. + * Initialize the vm_map module. Must be called before any other vm_map + * routines. * - * Map and entry structures are allocated from the general - * purpose memory pool with some exceptions: - * - * - The kernel map and kmem submap are allocated statically. - * - Kernel map entries are allocated out of a static pool. - * - * These restrictions are necessary since malloc() uses the - * maps and requires map entries. + * User map and entry structures are allocated from the general purpose + * memory pool. Kernel maps are statically defined. Kernel map entries + * require special handling to avoid recursion; see the comments above + * kmapent_alloc() and in vm_map_entry_create(). */ - void vm_map_startup(void) { mtx_init(&map_sleep_mtx, "vm map sleep mutex", NULL, MTX_DEF); + + /* + * Disable the use of per-CPU buckets: map entry allocation is + * serialized by the kernel map lock. + */ kmapentzone = uma_zcreate("KMAP ENTRY", sizeof(struct vm_map_entry), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, - UMA_ZONE_MTXCLASS | UMA_ZONE_VM); + UMA_ZONE_VM | UMA_ZONE_NOBUCKET); +#ifndef UMA_MD_SMALL_ALLOC + /* Reserve an extra map entry for use when replenishing the reserve. */ + uma_zone_reserve(kmapentzone, KMAPENT_RESERVE + 1); + uma_prealloc(kmapentzone, KMAPENT_RESERVE + 1); + uma_zone_set_allocf(kmapentzone, kmapent_alloc); + uma_zone_set_freef(kmapentzone, kmapent_free); +#endif + mapentzone = uma_zcreate("MAP ENTRY", sizeof(struct vm_map_entry), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); vmspace_zone = uma_zcreate("VMSPACE", sizeof(struct vmspace), NULL, @@ -616,9 +693,15 @@ _vm_map_unlock(vm_map_t map, const char *file, int lin { VM_MAP_UNLOCK_CONSISTENT(map); - if (map->system_map) + if (map->system_map) { +#ifndef UMA_MD_SMALL_ALLOC + if (map == kernel_map && (map->flags & MAP_REPLENISH) != 0) { + uma_prealloc(kmapentzone, 1); + map->flags &= ~MAP_REPLENISH; + } +#endif mtx_unlock_flags_(&map->system_mtx, 0, file, line); - else { + } else { sx_xunlock_(&map->lock, file, line); vm_map_process_deferred(); } @@ -638,9 +721,11 @@ void _vm_map_unlock_read(vm_map_t map, const char *file, int line) { - if (map->system_map) + if (map->system_map) { + KASSERT((map->flags & MAP_REPLENISH) == 0, + ("%s: MAP_REPLENISH leaked", __func__)); mtx_unlock_flags_(&map->system_mtx, 0, file, line); - else { + } else { sx_sunlock_(&map->lock, file, line); vm_map_process_deferred(); } @@ -712,6 +797,8 @@ _vm_map_lock_downgrade(vm_map_t map, const char *file, { if (map->system_map) { + KASSERT((map->flags & MAP_REPLENISH) == 0, + ("%s: MAP_REPLENISH leaked", __func__)); mtx_assert_(&map->system_mtx, MA_OWNED, file, line); } else { VM_MAP_UNLOCK_CONSISTENT(map); @@ -755,10 +842,13 @@ _vm_map_unlock_and_wait(vm_map_t map, int timo, const VM_MAP_UNLOCK_CONSISTENT(map); mtx_lock(&map_sleep_mtx); - if (map->system_map) + if (map->system_map) { + KASSERT((map->flags & MAP_REPLENISH) == 0, + ("%s: MAP_REPLENISH leaked", __func__)); mtx_unlock_flags_(&map->system_mtx, 0, file, line); - else + } else { sx_xunlock_(&map->lock, file, line); + } return (msleep(&map->root, &map_sleep_mtx, PDROP | PVM, "vmmaps", timo)); } @@ -881,12 +971,33 @@ vm_map_entry_create(vm_map_t map) { vm_map_entry_t new_entry; - if (map->system_map) +#ifndef UMA_MD_SMALL_ALLOC + if (map == kernel_map) { + VM_MAP_ASSERT_LOCKED(map); + + /* + * A new slab of kernel map entries cannot be allocated at this + * point because the kernel map has not yet been updated to + * reflect the caller's request. Therefore, we allocate a new + * map entry, dipping into the reserve if necessary, and set a + * flag indicating that the reserve must be replenished before + * the map is unlocked. + */ + new_entry = uma_zalloc(kmapentzone, M_NOWAIT | M_NOVM); + if (new_entry == NULL) { + new_entry = uma_zalloc(kmapentzone, + M_NOWAIT | M_NOVM | M_USE_RESERVE); + kernel_map->flags |= MAP_REPLENISH; + } + } else +#endif + if (map->system_map) { new_entry = uma_zalloc(kmapentzone, M_NOWAIT); - else + } else { new_entry = uma_zalloc(mapentzone, M_WAITOK); - if (new_entry == NULL) - panic("vm_map_entry_create: kernel resources exhausted"); + } + KASSERT(new_entry != NULL, + ("vm_map_entry_create: kernel resources exhausted")); return (new_entry); } @@ -1771,6 +1882,8 @@ vm_map_findspace(vm_map_t map, vm_offset_t start, vm_s vm_map_entry_t header, llist, rlist, root, y; vm_size_t left_length, max_free_left, max_free_right; vm_offset_t gap_end; + + VM_MAP_ASSERT_LOCKED(map); /* * Request must fit within min/max VM address and must avoid Modified: head/sys/vm/vm_map.h ============================================================================== --- head/sys/vm/vm_map.h Wed Nov 11 15:53:36 2020 (r367594) +++ head/sys/vm/vm_map.h Wed Nov 11 17:16:39 2020 (r367595) @@ -227,6 +227,7 @@ struct vm_map { #define MAP_IS_SUB_MAP 0x04 /* has parent */ #define MAP_ASLR 0x08 /* enabled ASLR */ #define MAP_ASLR_IGNSTART 0x10 +#define MAP_REPLENISH 0x20 #ifdef _KERNEL #if defined(KLD_MODULE) && !defined(KLD_TIED) From owner-svn-src-head@freebsd.org Wed Nov 11 18:00:06 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C337746162D; Wed, 11 Nov 2020 18:00:06 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CWXZG5DcGz3L9Q; Wed, 11 Nov 2020 18:00:06 +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 A6B4B18C0F; Wed, 11 Nov 2020 18:00:06 +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 0ABI06iv096133; Wed, 11 Nov 2020 18:00:06 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ABI064n096132; Wed, 11 Nov 2020 18:00:06 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202011111800.0ABI064n096132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 11 Nov 2020 18:00:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367596 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 367596 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 11 Nov 2020 18:00:06 -0000 Author: markj Date: Wed Nov 11 18:00:06 2020 New Revision: 367596 URL: https://svnweb.freebsd.org/changeset/base/367596 Log: iflib: Free full mbuf chains when draining transmit queues Submitted by: Sai Rajesh Tallamraju Reviewed by: gallatin, hselasky MFC after: 1 week Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D27179 Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Wed Nov 11 17:16:39 2020 (r367595) +++ head/sys/net/iflib.c Wed Nov 11 18:00:06 2020 (r367596) @@ -1781,7 +1781,7 @@ iflib_txsd_free(if_ctx_t ctx, iflib_txq_t txq, int i) bus_dmamap_unload(txq->ift_tso_buf_tag, txq->ift_sds.ifsd_tso_map[i]); } - m_free(*mp); + m_freem(*mp); DBG_COUNTER_INC(tx_frees); *mp = NULL; } @@ -3660,7 +3660,7 @@ iflib_txq_drain(struct ifmp_ring *r, uint32_t cidx, ui DBG_COUNTER_INC(txq_drain_flushing); for (i = 0; i < avail; i++) { if (__predict_true(r->items[(cidx + i) & (r->size-1)] != (void *)txq)) - m_free(r->items[(cidx + i) & (r->size-1)]); + m_freem(r->items[(cidx + i) & (r->size-1)]); r->items[(cidx + i) & (r->size-1)] = NULL; } return (avail); From owner-svn-src-head@freebsd.org Wed Nov 11 18:43:52 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 49D9C4627A1; Wed, 11 Nov 2020 18:43:52 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CWYXm1NZGz3NdY; Wed, 11 Nov 2020 18:43:52 +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 224E3190FD; Wed, 11 Nov 2020 18:43:52 +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 0ABIhqOU025779; Wed, 11 Nov 2020 18:43:52 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ABIhpFM025778; Wed, 11 Nov 2020 18:43:51 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011111843.0ABIhpFM025778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 11 Nov 2020 18:43:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367597 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 367597 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 11 Nov 2020 18:43:52 -0000 Author: mjg Date: Wed Nov 11 18:43:51 2020 New Revision: 367597 URL: https://svnweb.freebsd.org/changeset/base/367597 Log: thread: lockless zombie list manipulation This gets rid of the most contended spinlock seen when creating/destroying threads in a loop. (modulo kstack) Tested by: alfredo (ppc64), bdragon (ppc64) Modified: head/sys/kern/kern_thread.c head/sys/sys/proc.h Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Wed Nov 11 18:00:06 2020 (r367596) +++ head/sys/kern/kern_thread.c Wed Nov 11 18:43:51 2020 (r367597) @@ -128,9 +128,7 @@ SDT_PROBE_DEFINE(proc, , , lwp__exit); */ static uma_zone_t thread_zone; -TAILQ_HEAD(, thread) zombie_threads = TAILQ_HEAD_INITIALIZER(zombie_threads); -static struct mtx zombie_lock; -MTX_SYSINIT(zombie_lock, &zombie_lock, "zombie lock", MTX_SPIN); +static __exclusive_cache_line struct thread *thread_zombies; static void thread_zombie(struct thread *); static int thread_unsuspend_one(struct thread *td, struct proc *p, @@ -409,14 +407,20 @@ threadinit(void) /* * Place an unused thread on the zombie list. - * Use the slpq as that must be unused by now. */ void thread_zombie(struct thread *td) { - mtx_lock_spin(&zombie_lock); - TAILQ_INSERT_HEAD(&zombie_threads, td, td_slpq); - mtx_unlock_spin(&zombie_lock); + struct thread *ztd; + + ztd = atomic_load_ptr(&thread_zombies); + for (;;) { + td->td_zombie = ztd; + if (atomic_fcmpset_rel_ptr((uintptr_t *)&thread_zombies, + (uintptr_t *)&ztd, (uintptr_t)td)) + break; + continue; + } } /* @@ -430,29 +434,27 @@ thread_stash(struct thread *td) } /* - * Reap zombie resources. + * Reap zombie threads. */ void thread_reap(void) { - struct thread *td_first, *td_next; + struct thread *itd, *ntd; /* - * Don't even bother to lock if none at this instant, - * we really don't care about the next instant. + * Reading upfront is pessimal if followed by concurrent atomic_swap, + * but most of the time the list is empty. */ - if (!TAILQ_EMPTY(&zombie_threads)) { - mtx_lock_spin(&zombie_lock); - td_first = TAILQ_FIRST(&zombie_threads); - if (td_first) - TAILQ_INIT(&zombie_threads); - mtx_unlock_spin(&zombie_lock); - while (td_first) { - td_next = TAILQ_NEXT(td_first, td_slpq); - thread_cow_free(td_first); - thread_free(td_first); - td_first = td_next; - } + if (thread_zombies == NULL) + return; + + itd = (struct thread *)atomic_swap_ptr((uintptr_t *)&thread_zombies, + (uintptr_t)NULL); + while (itd != NULL) { + ntd = itd->td_zombie; + thread_cow_free(itd); + thread_free(itd); + itd = ntd; } } Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Wed Nov 11 18:00:06 2020 (r367596) +++ head/sys/sys/proc.h Wed Nov 11 18:43:51 2020 (r367597) @@ -229,7 +229,10 @@ struct thread { struct proc *td_proc; /* (*) Associated process. */ TAILQ_ENTRY(thread) td_plist; /* (*) All threads in this proc. */ TAILQ_ENTRY(thread) td_runq; /* (t) Run queue. */ - TAILQ_ENTRY(thread) td_slpq; /* (t) Sleep queue. */ + union { + TAILQ_ENTRY(thread) td_slpq; /* (t) Sleep queue. */ + struct thread *td_zombie; /* Zombie list linkage */ + }; TAILQ_ENTRY(thread) td_lockq; /* (t) Lock queue. */ LIST_ENTRY(thread) td_hash; /* (d) Hash chain. */ struct cpuset *td_cpuset; /* (t) CPU affinity mask. */ From owner-svn-src-head@freebsd.org Wed Nov 11 18:45:07 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1E99E462448; Wed, 11 Nov 2020 18:45:07 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CWYZC0Mp7z3Nw6; Wed, 11 Nov 2020 18:45:07 +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 E95AF1926D; Wed, 11 Nov 2020 18:45:06 +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 0ABIj6kf026016; Wed, 11 Nov 2020 18:45:06 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ABIj61D026015; Wed, 11 Nov 2020 18:45:06 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011111845.0ABIj61D026015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 11 Nov 2020 18:45:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367598 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 367598 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 11 Nov 2020 18:45:07 -0000 Author: mjg Date: Wed Nov 11 18:45:06 2020 New Revision: 367598 URL: https://svnweb.freebsd.org/changeset/base/367598 Log: thread: batch tid_free calls in thread_reap This eliminates the highly pessimal pattern of relocking from multiple CPUs in quick succession. Note this is still globally serialized. Modified: head/sys/kern/kern_thread.c Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Wed Nov 11 18:43:51 2020 (r367597) +++ head/sys/kern/kern_thread.c Wed Nov 11 18:45:06 2020 (r367598) @@ -133,6 +133,7 @@ static __exclusive_cache_line struct thread *thread_zo static void thread_zombie(struct thread *); static int thread_unsuspend_one(struct thread *td, struct proc *p, bool boundary); +static void thread_free_batched(struct thread *td); static struct mtx tid_lock; static bitstr_t *tid_bitmap; @@ -200,21 +201,41 @@ tid_alloc(void) } static void -tid_free(lwpid_t rtid) +tid_free_locked(lwpid_t rtid) { lwpid_t tid; + mtx_assert(&tid_lock, MA_OWNED); KASSERT(rtid >= NO_PID, ("%s: invalid tid %d\n", __func__, rtid)); tid = rtid - NO_PID; - mtx_lock(&tid_lock); KASSERT(bit_test(tid_bitmap, tid) != 0, ("thread ID %d not allocated\n", rtid)); bit_clear(tid_bitmap, tid); nthreads--; +} + +static void +tid_free(lwpid_t rtid) +{ + + mtx_lock(&tid_lock); + tid_free_locked(rtid); mtx_unlock(&tid_lock); } +static void +tid_free_batch(lwpid_t *batch, int n) +{ + int i; + + mtx_lock(&tid_lock); + for (i = 0; i < n; i++) { + tid_free_locked(batch[i]); + } + mtx_unlock(&tid_lock); +} + /* * Prepare a thread for use. */ @@ -440,6 +461,8 @@ void thread_reap(void) { struct thread *itd, *ntd; + lwpid_t tidbatch[16]; + int tidbatchn; /* * Reading upfront is pessimal if followed by concurrent atomic_swap, @@ -450,12 +473,23 @@ thread_reap(void) itd = (struct thread *)atomic_swap_ptr((uintptr_t *)&thread_zombies, (uintptr_t)NULL); + tidbatchn = 0; while (itd != NULL) { ntd = itd->td_zombie; + tidbatch[tidbatchn] = itd->td_tid; + tidbatchn++; thread_cow_free(itd); - thread_free(itd); + thread_free_batched(itd); + if (tidbatchn == nitems(tidbatch)) { + tid_free_batch(tidbatch, tidbatchn); + tidbatchn = 0; + } itd = ntd; } + + if (tidbatchn != 0) { + tid_free_batch(tidbatch, tidbatchn); + } } /* @@ -502,8 +536,8 @@ thread_alloc_stack(struct thread *td, int pages) /* * Deallocate a thread. */ -void -thread_free(struct thread *td) +static void +thread_free_batched(struct thread *td) { EVENTHANDLER_DIRECT_INVOKE(thread_dtor, td); @@ -515,9 +549,21 @@ thread_free(struct thread *td) if (td->td_kstack != 0) vm_thread_dispose(td); callout_drain(&td->td_slpcallout); - tid_free(td->td_tid); + /* + * Freeing handled by the caller. + */ td->td_tid = -1; uma_zfree(thread_zone, td); +} + +void +thread_free(struct thread *td) +{ + lwpid_t tid; + + tid = td->td_tid; + thread_free_batched(td); + tid_free(tid); } void From owner-svn-src-head@freebsd.org Wed Nov 11 21:59:40 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 51010467680; Wed, 11 Nov 2020 21:59:40 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CWdth1rJbz3rR5; Wed, 11 Nov 2020 21:59:40 +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 320A41B929; Wed, 11 Nov 2020 21:59:40 +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 0ABLxeKY043626; Wed, 11 Nov 2020 21:59:40 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ABLxeYV043625; Wed, 11 Nov 2020 21:59:40 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202011112159.0ABLxeYV043625@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 11 Nov 2020 21:59:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367600 - 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: 367600 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 11 Nov 2020 21:59:40 -0000 Author: mav Date: Wed Nov 11 21:59:39 2020 New Revision: 367600 URL: https://svnweb.freebsd.org/changeset/base/367600 Log: Make CTL nicer to increased MAXPHYS. Before this CTL always allocated MAXPHYS-sized buffers, even for 4KB I/O, that is even more overkill for MAXPHYS of 1MB. This change limits maximum allocation to 512KB if MAXPHYS is bigger, plus if one is above 128KB, adds new 128KB UMA zone for smaller I/Os. The patch factors out alloc/free, so later we could make it use more zones or malloc() if we'd like. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sys/cam/ctl/ctl_backend_block.c Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Wed Nov 11 21:27:16 2020 (r367599) +++ head/sys/cam/ctl/ctl_backend_block.c Wed Nov 11 21:59:39 2020 (r367600) @@ -102,7 +102,7 @@ __FBSDID("$FreeBSD$"); */ #define CTLBLK_HALF_IO_SIZE (512 * 1024) #define CTLBLK_MAX_IO_SIZE (CTLBLK_HALF_IO_SIZE * 2) -#define CTLBLK_MAX_SEG MAXPHYS +#define CTLBLK_MAX_SEG MIN(CTLBLK_HALF_IO_SIZE, MAXPHYS) #define CTLBLK_HALF_SEGS MAX(CTLBLK_HALF_IO_SIZE / CTLBLK_MAX_SEG, 1) #define CTLBLK_MAX_SEGS (CTLBLK_HALF_SEGS * 2) @@ -190,6 +190,9 @@ struct ctl_be_block_softc { SLIST_HEAD(, ctl_be_block_lun) lun_list; uma_zone_t beio_zone; uma_zone_t buf_zone; +#if (CTLBLK_MAX_SEG > 131072) + uma_zone_t buf128_zone; +#endif }; static struct ctl_be_block_softc backend_block_softc; @@ -299,6 +302,32 @@ static struct ctl_backend_driver ctl_be_block_driver = MALLOC_DEFINE(M_CTLBLK, "ctlblock", "Memory used for CTL block backend"); CTL_BACKEND_DECLARE(cbb, ctl_be_block_driver); +static void +ctl_alloc_seg(struct ctl_be_block_softc *softc, struct ctl_sg_entry *sg, + size_t len) +{ + +#if (CTLBLK_MAX_SEG > 131072) + if (len <= 131072) + sg->addr = uma_zalloc(softc->buf128_zone, M_WAITOK); + else +#endif + sg->addr = uma_zalloc(softc->buf_zone, M_WAITOK); + sg->len = len; +} + +static void +ctl_free_seg(struct ctl_be_block_softc *softc, struct ctl_sg_entry *sg) +{ + +#if (CTLBLK_MAX_SEG > 131072) + if (sg->len <= 131072) + uma_zfree(softc->buf128_zone, sg->addr); + else +#endif + uma_zfree(softc->buf_zone, sg->addr); +} + static struct ctl_be_block_io * ctl_alloc_beio(struct ctl_be_block_softc *softc) { @@ -317,12 +346,12 @@ ctl_real_free_beio(struct ctl_be_block_io *beio) int i; for (i = 0; i < beio->num_segs; i++) { - uma_zfree(softc->buf_zone, beio->sg_segs[i].addr); + ctl_free_seg(softc, &beio->sg_segs[i]); /* For compare we had two equal S/G lists. */ if (beio->two_sglists) { - uma_zfree(softc->buf_zone, - beio->sg_segs[i + CTLBLK_HALF_SEGS].addr); + ctl_free_seg(softc, + &beio->sg_segs[i + CTLBLK_HALF_SEGS]); } } @@ -1140,8 +1169,7 @@ ctl_be_block_dispatch_dev(struct ctl_be_block_lun *be_ /* * We have to limit our I/O size to the maximum supported by the - * backend device. Hopefully it is MAXPHYS. If the driver doesn't - * set it properly, use DFLTPHYS. + * backend device. */ if (csw) { max_iosize = dev->si_iosize_max; @@ -1330,8 +1358,7 @@ ctl_be_block_cw_dispatch_ws(struct ctl_be_block_lun *b seglen -= seglen % cbe_lun->blocksize; } else seglen -= seglen % cbe_lun->blocksize; - beio->sg_segs[i].len = seglen; - beio->sg_segs[i].addr = uma_zalloc(softc->buf_zone, M_WAITOK); + ctl_alloc_seg(softc, &beio->sg_segs[i], seglen); DPRINTF("segment %d addr %p len %zd\n", i, beio->sg_segs[i].addr, beio->sg_segs[i].len); @@ -1603,18 +1630,17 @@ ctl_be_block_dispatch(struct ctl_be_block_lun *be_lun, /* * Setup the S/G entry for this chunk. */ - beio->sg_segs[i].len = min(CTLBLK_MAX_SEG, len_left); - beio->sg_segs[i].addr = uma_zalloc(softc->buf_zone, M_WAITOK); + ctl_alloc_seg(softc, &beio->sg_segs[i], + min(CTLBLK_MAX_SEG, len_left)); DPRINTF("segment %d addr %p len %zd\n", i, beio->sg_segs[i].addr, beio->sg_segs[i].len); /* Set up second segment for compare operation. */ if (beio->two_sglists) { - beio->sg_segs[i + CTLBLK_HALF_SEGS].len = - beio->sg_segs[i].len; - beio->sg_segs[i + CTLBLK_HALF_SEGS].addr = - uma_zalloc(softc->buf_zone, M_WAITOK); + ctl_alloc_seg(softc, + &beio->sg_segs[i + CTLBLK_HALF_SEGS], + beio->sg_segs[i].len); } beio->num_segs++; @@ -1932,8 +1958,8 @@ ctl_be_block_open_dev(struct ctl_be_block_lun *be_lun, maxio = dev->si_iosize_max; if (maxio <= 0) maxio = DFLTPHYS; - if (maxio > CTLBLK_MAX_IO_SIZE) - maxio = CTLBLK_MAX_IO_SIZE; + if (maxio > CTLBLK_MAX_SEG) + maxio = CTLBLK_MAX_SEG; } be_lun->lun_flush = ctl_be_block_flush_dev; be_lun->getattr = ctl_be_block_getattr_dev; @@ -2778,6 +2804,10 @@ ctl_be_block_init(void) NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); softc->buf_zone = uma_zcreate("ctlblock", CTLBLK_MAX_SEG, NULL, NULL, NULL, NULL, /*align*/ 0, /*flags*/0); +#if (CTLBLK_MAX_SEG > 131072) + softc->buf128_zone = uma_zcreate("ctlblock128", 131072, + NULL, NULL, NULL, NULL, /*align*/ 0, /*flags*/0); +#endif SLIST_INIT(&softc->lun_list); return (0); } @@ -2803,6 +2833,9 @@ ctl_be_block_shutdown(void) } mtx_unlock(&softc->lock); uma_zdestroy(softc->buf_zone); +#if (CTLBLK_MAX_SEG > 131072) + uma_zdestroy(softc->buf128_zone); +#endif uma_zdestroy(softc->beio_zone); mtx_destroy(&softc->lock); sx_destroy(&softc->modify_lock); From owner-svn-src-head@freebsd.org Wed Nov 11 22:35:24 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 77283468295; Wed, 11 Nov 2020 22:35:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CWfgw31Y4z3v7V; Wed, 11 Nov 2020 22:35:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A8981BD5A; Wed, 11 Nov 2020 22:35:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ABMZOoq068581; Wed, 11 Nov 2020 22:35:24 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ABMZOH9068580; Wed, 11 Nov 2020 22:35:24 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202011112235.0ABMZOH9068580@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 11 Nov 2020 22:35:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367604 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 367604 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 11 Nov 2020 22:35:24 -0000 Author: kevans Date: Wed Nov 11 22:35:23 2020 New Revision: 367604 URL: https://svnweb.freebsd.org/changeset/base/367604 Log: umtx: drop incorrect timespec32 definition This works for amd64, but none others -- drop it, because we already have a proper definition in sys/compat/freebsd32/freebsd32.h that correctly uses time32_t. MFC after: 1 week Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Wed Nov 11 22:18:24 2020 (r367603) +++ head/sys/kern/kern_umtx.c Wed Nov 11 22:35:23 2020 (r367604) @@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$"); #include #ifdef COMPAT_FREEBSD32 +#include #include #endif @@ -4127,11 +4128,6 @@ sys__umtx_op(struct thread *td, struct _umtx_op_args * } #ifdef COMPAT_FREEBSD32 - -struct timespec32 { - int32_t tv_sec; - int32_t tv_nsec; -}; struct umtx_time32 { struct timespec32 timeout; From owner-svn-src-head@freebsd.org Thu Nov 12 00:29:23 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 95EEC46B125; Thu, 12 Nov 2020 00:29:23 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CWjCR3tfcz4Vcg; Thu, 12 Nov 2020 00:29:23 +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 77F6A1D453; Thu, 12 Nov 2020 00:29:23 +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 0AC0TN18037147; Thu, 12 Nov 2020 00:29:23 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AC0TN87037146; Thu, 12 Nov 2020 00:29:23 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011120029.0AC0TN87037146@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 12 Nov 2020 00:29:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367605 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 367605 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 12 Nov 2020 00:29:23 -0000 Author: mjg Date: Thu Nov 12 00:29:23 2020 New Revision: 367605 URL: https://svnweb.freebsd.org/changeset/base/367605 Log: thread: move nthread management out of tid_alloc While this adds more work single-threaded, it also enables SMP-related speed ups. Modified: head/sys/kern/kern_thread.c Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Wed Nov 11 22:35:23 2020 (r367604) +++ head/sys/kern/kern_thread.c Thu Nov 12 00:29:23 2020 (r367605) @@ -144,7 +144,7 @@ static int maxthread; SYSCTL_INT(_kern, OID_AUTO, maxthread, CTLFLAG_RDTUN, &maxthread, 0, "Maximum number of threads"); -static int nthreads; +static __exclusive_cache_line int nthreads; static LIST_HEAD(tidhashhead, thread) *tidhashtbl; static u_long tidhash; @@ -158,29 +158,52 @@ EVENTHANDLER_LIST_DEFINE(thread_dtor); EVENTHANDLER_LIST_DEFINE(thread_init); EVENTHANDLER_LIST_DEFINE(thread_fini); -static lwpid_t -tid_alloc(void) +static bool +thread_count_inc(void) { static struct timeval lastfail; static int curfail; - static lwpid_t trytid; - lwpid_t tid; + int nthreads_new; - mtx_lock(&tid_lock); - if (nthreads + 1 >= maxthread - 100) { + thread_reap(); + + nthreads_new = atomic_fetchadd_int(&nthreads, 1) + 1; + if (nthreads_new >= maxthread - 100) { if (priv_check_cred(curthread->td_ucred, PRIV_MAXPROC) != 0 || - nthreads + 1 >= maxthread) { - mtx_unlock(&tid_lock); + nthreads_new >= maxthread) { + atomic_subtract_int(&nthreads, 1); if (ppsratecheck(&lastfail, &curfail, 1)) { printf("maxthread limit exceeded by uid %u " "(pid %d); consider increasing kern.maxthread\n", curthread->td_ucred->cr_ruid, curproc->p_pid); } - return (-1); + return (false); } } + return (true); +} - nthreads++; +static void +thread_count_sub(int n) +{ + + atomic_subtract_int(&nthreads, n); +} + +static void +thread_count_dec(void) +{ + + thread_count_sub(1); +} + +static lwpid_t +tid_alloc(void) +{ + static lwpid_t trytid; + lwpid_t tid; + + mtx_lock(&tid_lock); /* * It is an invariant that the bitmap is big enough to hold maxthread * IDs. If we got to this point there has to be at least one free. @@ -212,7 +235,6 @@ tid_free_locked(lwpid_t rtid) KASSERT(bit_test(tid_bitmap, tid) != 0, ("thread ID %d not allocated\n", rtid)); bit_clear(tid_bitmap, tid); - nthreads--; } static void @@ -398,6 +420,10 @@ threadinit(void) mtx_init(&tid_lock, "TID lock", NULL, MTX_DEF); tid_bitmap = bit_alloc(maxthread, M_TIDHASH, M_WAITOK); + /* + * Handle thread0. + */ + thread_count_inc(); tid0 = tid_alloc(); if (tid0 != THREAD0_TID) panic("tid0 %d != %d\n", tid0, THREAD0_TID); @@ -482,6 +508,7 @@ thread_reap(void) thread_free_batched(itd); if (tidbatchn == nitems(tidbatch)) { tid_free_batch(tidbatch, tidbatchn); + thread_count_sub(tidbatchn); tidbatchn = 0; } itd = ntd; @@ -489,6 +516,7 @@ thread_reap(void) if (tidbatchn != 0) { tid_free_batch(tidbatch, tidbatchn); + thread_count_sub(tidbatchn); } } @@ -501,18 +529,17 @@ thread_alloc(int pages) struct thread *td; lwpid_t tid; - thread_reap(); /* check if any zombies to get */ - - tid = tid_alloc(); - if (tid == -1) { + if (!thread_count_inc()) { return (NULL); } + tid = tid_alloc(); td = uma_zalloc(thread_zone, M_WAITOK); KASSERT(td->td_kstack == 0, ("thread_alloc got thread with kstack")); if (!vm_thread_new(td, pages)) { uma_zfree(thread_zone, td); tid_free(tid); + thread_count_dec(); return (NULL); } td->td_tid = tid; @@ -564,6 +591,7 @@ thread_free(struct thread *td) tid = td->td_tid; thread_free_batched(td); tid_free(tid); + thread_count_dec(); } void From owner-svn-src-head@freebsd.org Thu Nov 12 00:46:53 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BABAB46B7C6; Thu, 12 Nov 2020 00:46:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CWjbd4yJ5z4WDX; Thu, 12 Nov 2020 00:46:53 +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 9D1B91DC76; Thu, 12 Nov 2020 00:46:53 +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 0AC0krJT049661; Thu, 12 Nov 2020 00:46:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AC0krBs049660; Thu, 12 Nov 2020 00:46:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011120046.0AC0krBs049660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 12 Nov 2020 00:46:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367606 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 367606 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 12 Nov 2020 00:46:53 -0000 Author: kib Date: Thu Nov 12 00:46:53 2020 New Revision: 367606 URL: https://svnweb.freebsd.org/changeset/base/367606 Log: bhyve: avoid allocating BARs above the end of supported physical addresses. Read CPUID leaf 0x8000008 to determine max supported phys address and create BAR region right below it, reserving 1/4 of the supported guest physical address space to the 64bit BARs mappings. PR: 250802 (although the issue from PR is not fixed by the change) Noted and reviewed by: grehan Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D27095 Modified: head/usr.sbin/bhyve/pci_emul.c Modified: head/usr.sbin/bhyve/pci_emul.c ============================================================================== --- head/usr.sbin/bhyve/pci_emul.c Thu Nov 12 00:29:23 2020 (r367605) +++ head/usr.sbin/bhyve/pci_emul.c Thu Nov 12 00:46:53 2020 (r367606) @@ -33,6 +33,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include #include #include @@ -46,6 +49,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include "acpi.h" @@ -98,6 +103,7 @@ SET_DECLARE(pci_devemu_set, struct pci_devemu); static uint64_t pci_emul_iobase; static uint64_t pci_emul_membase32; static uint64_t pci_emul_membase64; +static uint64_t pci_emul_memlim64; #define PCI_EMUL_IOBASE 0x2000 #define PCI_EMUL_IOLIMIT 0x10000 @@ -108,9 +114,6 @@ SYSRES_MEM(PCI_EMUL_ECFG_BASE, PCI_EMUL_ECFG_SIZE); #define PCI_EMUL_MEMLIMIT32 PCI_EMUL_ECFG_BASE -#define PCI_EMUL_MEMBASE64 0xD000000000UL -#define PCI_EMUL_MEMLIMIT64 0xFD00000000UL - static struct pci_devemu *pci_emul_finddev(char *name); static void pci_lintr_route(struct pci_devinst *pi); static void pci_lintr_update(struct pci_devinst *pi); @@ -632,7 +635,7 @@ pci_emul_alloc_pbar(struct pci_devinst *pdi, int idx, baseptr = &hostbase; else baseptr = &pci_emul_membase64; - limit = PCI_EMUL_MEMLIMIT64; + limit = pci_emul_memlim64; mask = PCIM_BAR_MEM_BASE; lobits = PCIM_BAR_MEM_SPACE | PCIM_BAR_MEM_64 | PCIM_BAR_MEM_PREFETCH; @@ -1101,12 +1104,25 @@ init_pci(struct vmctx *ctx) struct slotinfo *si; struct funcinfo *fi; size_t lowmem; - int bus, slot, func; - int error; + uint64_t cpu_maxphysaddr, pci_emul_memresv64; + u_int regs[4]; + int bus, slot, func, error; pci_emul_iobase = PCI_EMUL_IOBASE; pci_emul_membase32 = vm_get_lowmem_limit(ctx); - pci_emul_membase64 = PCI_EMUL_MEMBASE64; + + do_cpuid(0x80000008, regs); + cpu_maxphysaddr = 1ULL << (regs[0] & 0xff); + if (cpu_maxphysaddr > VM_MAXUSER_ADDRESS_LA48) + cpu_maxphysaddr = VM_MAXUSER_ADDRESS_LA48; + pci_emul_memresv64 = cpu_maxphysaddr / 4; + /* + * Max power of 2 that is less then + * cpu_maxphysaddr - pci_emul_memresv64. + */ + pci_emul_membase64 = 1ULL << (flsl(cpu_maxphysaddr - + pci_emul_memresv64) - 1); + pci_emul_memlim64 = cpu_maxphysaddr; for (bus = 0; bus < MAXBUSES; bus++) { if ((bi = pci_businfo[bus]) == NULL) From owner-svn-src-head@freebsd.org Thu Nov 12 00:51:53 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C563546BAB7; Thu, 12 Nov 2020 00:51:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CWjjP5H0Vz4Wwp; Thu, 12 Nov 2020 00:51:53 +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 A811A1DB7F; Thu, 12 Nov 2020 00:51:53 +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 0AC0prx5053152; Thu, 12 Nov 2020 00:51:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AC0prMQ053151; Thu, 12 Nov 2020 00:51:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011120051.0AC0prMQ053151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 12 Nov 2020 00:51:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367607 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 367607 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 12 Nov 2020 00:51:53 -0000 Author: kib Date: Thu Nov 12 00:51:53 2020 New Revision: 367607 URL: https://svnweb.freebsd.org/changeset/base/367607 Log: bhyve: increase allowed size for 64bit BAR allocation below 4G from 32 to 128 MB. Reviewed by: grehan Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D27095 Modified: head/usr.sbin/bhyve/pci_emul.c Modified: head/usr.sbin/bhyve/pci_emul.c ============================================================================== --- head/usr.sbin/bhyve/pci_emul.c Thu Nov 12 00:46:53 2020 (r367606) +++ head/usr.sbin/bhyve/pci_emul.c Thu Nov 12 00:51:53 2020 (r367607) @@ -625,9 +625,9 @@ pci_emul_alloc_pbar(struct pci_devinst *pdi, int idx, * Some drivers do not work well if the 64-bit BAR is allocated * above 4GB. Allow for this by allocating small requests under * 4GB unless then allocation size is larger than some arbitrary - * number (32MB currently). + * number (128MB currently). */ - if (size > 32 * 1024 * 1024) { + if (size > 128 * 1024 * 1024) { /* * XXX special case for device requiring peer-peer DMA */ From owner-svn-src-head@freebsd.org Thu Nov 12 01:18:06 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C801746D0A0; Thu, 12 Nov 2020 01:18:06 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CWkHf5KW3z4YZh; Thu, 12 Nov 2020 01:18:06 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A98931E1B9; Thu, 12 Nov 2020 01:18:06 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AC1I6vO068228; Thu, 12 Nov 2020 01:18:06 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AC1I6YV068226; Thu, 12 Nov 2020 01:18:06 GMT (envelope-from np@FreeBSD.org) Message-Id: <202011120118.0AC1I6YV068226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 12 Nov 2020 01:18:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367608 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 367608 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 12 Nov 2020 01:18:06 -0000 Author: np Date: Thu Nov 12 01:18:05 2020 New Revision: 367608 URL: https://svnweb.freebsd.org/changeset/base/367608 Log: cxgbev(4): Make sure that the iq/eq map sizes are correct for VFs. This should have been part of r366929. MFC after: 3 days Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_vf.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Nov 12 00:51:53 2020 (r367607) +++ head/sys/dev/cxgbe/t4_main.c Thu Nov 12 01:18:05 2020 (r367608) @@ -4467,9 +4467,9 @@ get_params__post_init(struct adapter *sc) "failed to query parameters (post_init2): %d.\n", rc); return (rc); } - MPASS(val[0] >= sc->sge.iq_start); + MPASS((int)val[0] >= sc->sge.iq_start); sc->sge.iqmap_sz = val[0] - sc->sge.iq_start + 1; - MPASS(val[1] >= sc->sge.eq_start); + MPASS((int)val[1] >= sc->sge.eq_start); sc->sge.eqmap_sz = val[1] - sc->sge.eq_start + 1; if (chip_id(sc) >= CHELSIO_T6) { Modified: head/sys/dev/cxgbe/t4_vf.c ============================================================================== --- head/sys/dev/cxgbe/t4_vf.c Thu Nov 12 00:51:53 2020 (r367607) +++ head/sys/dev/cxgbe/t4_vf.c Thu Nov 12 01:18:05 2020 (r367608) @@ -695,13 +695,16 @@ t4vf_attach(device_t dev) s->neq += sc->params.nports; /* ctrl queues: 1 per port */ s->niq = s->nrxq + 1; /* 1 extra for firmware event queue */ + s->iqmap_sz = s->niq; + s->eqmap_sz = s->neq; + s->rxq = malloc(s->nrxq * sizeof(struct sge_rxq), M_CXGBE, M_ZERO | M_WAITOK); s->txq = malloc(s->ntxq * sizeof(struct sge_txq), M_CXGBE, M_ZERO | M_WAITOK); - s->iqmap = malloc(s->niq * sizeof(struct sge_iq *), M_CXGBE, + s->iqmap = malloc(s->iqmap_sz * sizeof(struct sge_iq *), M_CXGBE, M_ZERO | M_WAITOK); - s->eqmap = malloc(s->neq * sizeof(struct sge_eq *), M_CXGBE, + s->eqmap = malloc(s->eqmap_sz * sizeof(struct sge_eq *), M_CXGBE, M_ZERO | M_WAITOK); sc->irq = malloc(sc->intr_count * sizeof(struct irq), M_CXGBE, From owner-svn-src-head@freebsd.org Thu Nov 12 02:21:14 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E94172D15B9; Thu, 12 Nov 2020 02:21:14 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CWlhV6MV6z4g2H; Thu, 12 Nov 2020 02:21:14 +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 CD9C61F096; Thu, 12 Nov 2020 02:21:14 +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 0AC2LE0f008536; Thu, 12 Nov 2020 02:21:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AC2LEBZ008535; Thu, 12 Nov 2020 02:21:14 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011120221.0AC2LEBZ008535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 12 Nov 2020 02:21:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367609 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 367609 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 12 Nov 2020 02:21:15 -0000 Author: kib Date: Thu Nov 12 02:21:14 2020 New Revision: 367609 URL: https://svnweb.freebsd.org/changeset/base/367609 Log: mlx5en: Refactor repeated code to register media type to mlx5e_ifm_add(). Sponsored by: Mellanox Technologies/NVidia Networking MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Nov 12 01:18:05 2020 (r367608) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Nov 12 02:21:14 2020 (r367609) @@ -4260,6 +4260,14 @@ mlx5e_snd_tag_free(struct m_snd_tag *pmt) } } +static void +mlx5e_ifm_add(struct mlx5e_priv *priv, int type) +{ + ifmedia_add(&priv->media, type | IFM_ETHER, 0, NULL); + ifmedia_add(&priv->media, type | IFM_ETHER | IFM_FDX | + IFM_ETH_RXPAUSE | IFM_ETH_TXPAUSE, 0, NULL); +} + static void * mlx5e_create_ifp(struct mlx5_core_dev *mdev) { @@ -4463,21 +4471,12 @@ mlx5e_create_ifp(struct mlx5_core_dev *mdev) mlx5e_mode_table[i][j]; if (media_entry.baudrate == 0) continue; - if (MLX5E_PROT_MASK(i) & eth_proto_cap) { - ifmedia_add(&priv->media, - media_entry.subtype | - IFM_ETHER, 0, NULL); - ifmedia_add(&priv->media, - media_entry.subtype | - IFM_ETHER | IFM_FDX | - IFM_ETH_RXPAUSE | IFM_ETH_TXPAUSE, 0, NULL); - } + if (MLX5E_PROT_MASK(i) & eth_proto_cap) + mlx5e_ifm_add(priv, media_entry.subtype); } } - ifmedia_add(&priv->media, IFM_ETHER | IFM_AUTO, 0, NULL); - ifmedia_add(&priv->media, IFM_ETHER | IFM_AUTO | IFM_FDX | - IFM_ETH_RXPAUSE | IFM_ETH_TXPAUSE, 0, NULL); + mlx5e_ifm_add(priv, IFM_AUTO); /* Set autoselect by default */ ifmedia_set(&priv->media, IFM_ETHER | IFM_AUTO | IFM_FDX | From owner-svn-src-head@freebsd.org Thu Nov 12 02:22:17 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 38C7F2D1764; Thu, 12 Nov 2020 02:22:17 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CWljj01fSz4gFP; Thu, 12 Nov 2020 02:22:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E76C31EEDA; Thu, 12 Nov 2020 02:22:16 +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 0AC2MGB0010983; Thu, 12 Nov 2020 02:22:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AC2MGwj010982; Thu, 12 Nov 2020 02:22:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011120222.0AC2MGwj010982@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 12 Nov 2020 02:22:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367610 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 367610 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 12 Nov 2020 02:22:17 -0000 Author: kib Date: Thu Nov 12 02:22:16 2020 New Revision: 367610 URL: https://svnweb.freebsd.org/changeset/base/367610 Log: mlx5en: Register all combinations of FDX/RXPAUSE/TXPAUSE as valid media types. Sponsored by: Mellanox Technologies/NVidia Networking MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Nov 12 02:21:14 2020 (r367609) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Nov 12 02:22:16 2020 (r367610) @@ -4264,6 +4264,15 @@ static void mlx5e_ifm_add(struct mlx5e_priv *priv, int type) { ifmedia_add(&priv->media, type | IFM_ETHER, 0, NULL); + ifmedia_add(&priv->media, type | IFM_ETHER | + IFM_ETH_RXPAUSE | IFM_ETH_TXPAUSE, 0, NULL); + ifmedia_add(&priv->media, type | IFM_ETHER | IFM_ETH_RXPAUSE, 0, NULL); + ifmedia_add(&priv->media, type | IFM_ETHER | IFM_ETH_TXPAUSE, 0, NULL); + ifmedia_add(&priv->media, type | IFM_ETHER | IFM_FDX, 0, NULL); + ifmedia_add(&priv->media, type | IFM_ETHER | IFM_FDX | + IFM_ETH_RXPAUSE, 0, NULL); + ifmedia_add(&priv->media, type | IFM_ETHER | IFM_FDX | + IFM_ETH_TXPAUSE, 0, NULL); ifmedia_add(&priv->media, type | IFM_ETHER | IFM_FDX | IFM_ETH_RXPAUSE | IFM_ETH_TXPAUSE, 0, NULL); } From owner-svn-src-head@freebsd.org Thu Nov 12 02:23:28 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 35DDC2D1C9D; Thu, 12 Nov 2020 02:23:28 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CWll413Xkz4gg1; Thu, 12 Nov 2020 02:23:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 174121F1F6; Thu, 12 Nov 2020 02:23:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AC2NRIM011083; Thu, 12 Nov 2020 02:23:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AC2NRW3011082; Thu, 12 Nov 2020 02:23:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011120223.0AC2NRW3011082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 12 Nov 2020 02:23:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367611 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 367611 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 12 Nov 2020 02:23:28 -0000 Author: kib Date: Thu Nov 12 02:23:27 2020 New Revision: 367611 URL: https://svnweb.freebsd.org/changeset/base/367611 Log: mlx5en: stop ignoring pauses and flow in the media reqs. Sponsored by: Mellanox Technologies/NVidia Networking MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Nov 12 02:22:16 2020 (r367610) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Nov 12 02:23:27 2020 (r367611) @@ -4449,8 +4449,7 @@ mlx5e_create_ifp(struct mlx5_core_dev *mdev) /* Set default media status */ priv->media_status_last = IFM_AVALID; - priv->media_active_last = IFM_ETHER | IFM_AUTO | - IFM_ETH_RXPAUSE | IFM_FDX; + priv->media_active_last = IFM_ETHER | IFM_AUTO | IFM_FDX; /* setup default pauseframes configuration */ mlx5e_setup_pauseframes(priv); @@ -4470,7 +4469,7 @@ mlx5e_create_ifp(struct mlx5_core_dev *mdev) mlx5_en_err(ifp, "Query port media capability failed, %d\n", err); } - ifmedia_init(&priv->media, IFM_IMASK | IFM_ETH_FMASK, + ifmedia_init(&priv->media, IFM_IMASK, mlx5e_media_change, mlx5e_media_status); speeds_num = ext ? MLX5E_EXT_LINK_SPEEDS_NUMBER : MLX5E_LINK_SPEEDS_NUMBER; From owner-svn-src-head@freebsd.org Thu Nov 12 02:25:11 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 479F32D1C29; Thu, 12 Nov 2020 02:25:11 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CWln31ZQbz4gxM; Thu, 12 Nov 2020 02:25:11 +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 298361ED54; Thu, 12 Nov 2020 02:25:11 +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 0AC2PBmD011212; Thu, 12 Nov 2020 02:25:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AC2PBgt011211; Thu, 12 Nov 2020 02:25:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011120225.0AC2PBgt011211@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 12 Nov 2020 02:25:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367612 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 367612 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 12 Nov 2020 02:25:11 -0000 Author: kib Date: Thu Nov 12 02:25:10 2020 New Revision: 367612 URL: https://svnweb.freebsd.org/changeset/base/367612 Log: mlx5en: Set ifmr_current same as ifmr_active. This both: - makes ifconfig media line similar to that of other drivers. - fixes ENXIO in case when paradoxical current media word is not registered. Now e.g. ifconfig mce0 -mediaopt txpause,rxpause works by disabling pauses if enabled. Sponsored by: Mellanox Technologies/NVidia Networking MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Nov 12 02:23:27 2020 (r367611) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Nov 12 02:25:10 2020 (r367612) @@ -499,7 +499,7 @@ mlx5e_media_status(struct ifnet *dev, struct ifmediare struct mlx5e_priv *priv = dev->if_softc; ifmr->ifm_status = priv->media_status_last; - ifmr->ifm_active = priv->media_active_last | + ifmr->ifm_current = ifmr->ifm_active = priv->media_active_last | (priv->params.rx_pauseframe_control ? IFM_ETH_RXPAUSE : 0) | (priv->params.tx_pauseframe_control ? IFM_ETH_TXPAUSE : 0); From owner-svn-src-head@freebsd.org Thu Nov 12 02:52:02 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 87F812D2F95; Thu, 12 Nov 2020 02:52:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CWmN23Vm7z4jLl; Thu, 12 Nov 2020 02:52:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B1CF1F26B; Thu, 12 Nov 2020 02:52:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AC2q2Ys028563; Thu, 12 Nov 2020 02:52:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AC2q1qU028560; Thu, 12 Nov 2020 02:52:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011120252.0AC2q1qU028560@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 12 Nov 2020 02:52:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367613 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 367613 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 12 Nov 2020 02:52:02 -0000 Author: kib Date: Thu Nov 12 02:52:01 2020 New Revision: 367613 URL: https://svnweb.freebsd.org/changeset/base/367613 Log: bhyve: remove a hack to map all 8G BARs 1:1 Suggested and reviewed by: grehan Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D27186 Modified: head/usr.sbin/bhyve/pci_emul.c head/usr.sbin/bhyve/pci_emul.h head/usr.sbin/bhyve/pci_passthru.c Modified: head/usr.sbin/bhyve/pci_emul.c ============================================================================== --- head/usr.sbin/bhyve/pci_emul.c Thu Nov 12 02:25:10 2020 (r367612) +++ head/usr.sbin/bhyve/pci_emul.c Thu Nov 12 02:52:01 2020 (r367613) @@ -454,14 +454,6 @@ pci_emul_alloc_resource(uint64_t *baseptr, uint64_t li return (-1); } -int -pci_emul_alloc_bar(struct pci_devinst *pdi, int idx, enum pcibar_type type, - uint64_t size) -{ - - return (pci_emul_alloc_pbar(pdi, idx, 0, type, size)); -} - /* * Register (or unregister) the MMIO or I/O region associated with the BAR * register 'idx' of an emulated pci device. @@ -586,8 +578,8 @@ update_bar_address(struct pci_devinst *pi, uint64_t ad } int -pci_emul_alloc_pbar(struct pci_devinst *pdi, int idx, uint64_t hostbase, - enum pcibar_type type, uint64_t size) +pci_emul_alloc_bar(struct pci_devinst *pdi, int idx, enum pcibar_type type, + uint64_t size) { int error; uint64_t *baseptr, limit, addr, mask, lobits, bar; @@ -628,13 +620,7 @@ pci_emul_alloc_pbar(struct pci_devinst *pdi, int idx, * number (128MB currently). */ if (size > 128 * 1024 * 1024) { - /* - * XXX special case for device requiring peer-peer DMA - */ - if (size == 0x100000000UL) - baseptr = &hostbase; - else - baseptr = &pci_emul_membase64; + baseptr = &pci_emul_membase64; limit = pci_emul_memlim64; mask = PCIM_BAR_MEM_BASE; lobits = PCIM_BAR_MEM_SPACE | PCIM_BAR_MEM_64 | Modified: head/usr.sbin/bhyve/pci_emul.h ============================================================================== --- head/usr.sbin/bhyve/pci_emul.h Thu Nov 12 02:25:10 2020 (r367612) +++ head/usr.sbin/bhyve/pci_emul.h Thu Nov 12 02:52:01 2020 (r367613) @@ -221,8 +221,6 @@ int init_pci(struct vmctx *ctx); void pci_callback(void); int pci_emul_alloc_bar(struct pci_devinst *pdi, int idx, enum pcibar_type type, uint64_t size); -int pci_emul_alloc_pbar(struct pci_devinst *pdi, int idx, - uint64_t hostbase, enum pcibar_type type, uint64_t size); int pci_emul_add_msicap(struct pci_devinst *pi, int msgnum); int pci_emul_add_pciecap(struct pci_devinst *pi, int pcie_device_type); void pci_emul_capwrite(struct pci_devinst *pi, int offset, int bytes, Modified: head/usr.sbin/bhyve/pci_passthru.c ============================================================================== --- head/usr.sbin/bhyve/pci_passthru.c Thu Nov 12 02:25:10 2020 (r367612) +++ head/usr.sbin/bhyve/pci_passthru.c Thu Nov 12 02:52:01 2020 (r367613) @@ -583,7 +583,7 @@ cfginitbar(struct vmctx *ctx, struct passthru_softc *s sc->psc_bar[i].addr = base; /* Allocate the BAR in the guest I/O or MMIO space */ - error = pci_emul_alloc_pbar(pi, i, base, bartype, size); + error = pci_emul_alloc_bar(pi, i, bartype, size); if (error) return (-1); From owner-svn-src-head@freebsd.org Thu Nov 12 09:15:08 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 502622E468E; Thu, 12 Nov 2020 09:15:08 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CWwt41mytz3KmN; Thu, 12 Nov 2020 09:15:08 +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 2FAC724404; Thu, 12 Nov 2020 09:15:08 +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 0AC9F7bM066273; Thu, 12 Nov 2020 09:15:07 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AC9F7Hk066272; Thu, 12 Nov 2020 09:15:07 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202011120915.0AC9F7Hk066272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 12 Nov 2020 09:15:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367614 - head/sys/dev/usb/controller X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/usb/controller X-SVN-Commit-Revision: 367614 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 12 Nov 2020 09:15:08 -0000 Author: hselasky Date: Thu Nov 12 09:15:07 2020 New Revision: 367614 URL: https://svnweb.freebsd.org/changeset/base/367614 Log: When doing a USB alternate setting on an USB interface we need to re-configure the XHCI endpoint context. Differential Revision: https://reviews.freebsd.org/D27174 MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: head/sys/dev/usb/controller/xhci.c Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Thu Nov 12 02:52:01 2020 (r367613) +++ head/sys/dev/usb/controller/xhci.c Thu Nov 12 09:15:07 2020 (r367614) @@ -4020,6 +4020,9 @@ xhci_ep_init(struct usb_device *udev, struct usb_endpo struct usb_endpoint *ep) { struct xhci_endpoint_ext *pepext; + struct xhci_softc *sc; + uint8_t index; + uint8_t epno; DPRINTFN(2, "endpoint=%p, addr=%d, endpt=%d, mode=%d\n", ep, udev->address, edesc->bEndpointAddress, udev->flags.usb_mode); @@ -4036,6 +4039,18 @@ xhci_ep_init(struct usb_device *udev, struct usb_endpo USB_BUS_LOCK(udev->bus); pepext->trb_halted = 1; pepext->trb_running = 0; + + /* + * When doing an alternate setting, except for control + * endpoints, we need to re-configure the XHCI endpoint + * context: + */ + if ((edesc->bEndpointAddress & UE_ADDR) != 0) { + sc = XHCI_BUS2SC(udev->bus); + index = udev->controller_slot_id; + epno = XHCI_EPNO2EPID(edesc->bEndpointAddress); + sc->sc_hw.devs[index].ep_configured &= ~(1U << epno); + } USB_BUS_UNLOCK(udev->bus); } From owner-svn-src-head@freebsd.org Thu Nov 12 09:26:01 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D1E6C2E4A0B; Thu, 12 Nov 2020 09:26:01 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CWx6d5cBbz3KwG; Thu, 12 Nov 2020 09:26:01 +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 B374E241D7; Thu, 12 Nov 2020 09:26:01 +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 0AC9Q14r072369; Thu, 12 Nov 2020 09:26:01 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AC9Q1VK072368; Thu, 12 Nov 2020 09:26:01 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202011120926.0AC9Q1VK072368@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 12 Nov 2020 09:26:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367615 - head/sys/dev/sound/usb X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/sound/usb X-SVN-Commit-Revision: 367615 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 12 Nov 2020 09:26:01 -0000 Author: hselasky Date: Thu Nov 12 09:26:01 2020 New Revision: 367615 URL: https://svnweb.freebsd.org/changeset/base/367615 Log: Add a tunable sysctl, hw.usb.uaudio.handle_hid, to allow disabling the the HID volume keys support in the USB audio driver. While at it re-organize the USB audio sysctls a bit. Differential Revision: https://reviews.freebsd.org/D27180 MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: head/sys/dev/sound/usb/uaudio.c Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Thu Nov 12 09:15:07 2020 (r367614) +++ head/sys/dev/sound/usb/uaudio.c Thu Nov 12 09:26:01 2020 (r367615) @@ -98,15 +98,12 @@ static int uaudio_default_rate = 0; /* use rate list static int uaudio_default_bits = 32; static int uaudio_default_channels = 0; /* use default */ static int uaudio_buffer_ms = 8; +static bool uaudio_handle_hid = true; -#ifdef USB_DEBUG -static int uaudio_debug; - static SYSCTL_NODE(_hw_usb, OID_AUTO, uaudio, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "USB uaudio"); - -SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, debug, CTLFLAG_RWTUN, - &uaudio_debug, 0, "uaudio debug level"); +SYSCTL_BOOL(_hw_usb_uaudio, OID_AUTO, handle_hid, CTLFLAG_RWTUN, + &uaudio_handle_hid, 0, "uaudio handles any HID volume/mute keys, if set"); SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, default_rate, CTLFLAG_RWTUN, &uaudio_default_rate, 0, "uaudio default sample rate"); SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, default_bits, CTLFLAG_RWTUN, @@ -138,6 +135,12 @@ SYSCTL_PROC(_hw_usb_uaudio, OID_AUTO, buffer_ms, CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, 0, sizeof(int), uaudio_buffer_ms_sysctl, "I", "uaudio buffering delay from 2ms to 8ms"); + +#ifdef USB_DEBUG +static int uaudio_debug; + +SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, debug, CTLFLAG_RWTUN, + &uaudio_debug, 0, "uaudio debug level"); #else #define uaudio_debug 0 #endif @@ -1116,10 +1119,12 @@ uaudio_attach(device_t dev) goto detach; } - if (uaudio_hid_probe(sc, uaa) == 0) { - device_printf(dev, "HID volume keys found.\n"); - } else { - device_printf(dev, "No HID volume keys found.\n"); + if (uaudio_handle_hid) { + if (uaudio_hid_probe(sc, uaa) == 0) { + device_printf(dev, "HID volume keys found.\n"); + } else { + device_printf(dev, "No HID volume keys found.\n"); + } } /* reload all mixer settings */ From owner-svn-src-head@freebsd.org Thu Nov 12 14:04:09 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2747B2EB488; Thu, 12 Nov 2020 14:04:09 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CX3HY0cjcz3r3C; Thu, 12 Nov 2020 14:04:09 +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 07D5F279A5; Thu, 12 Nov 2020 14:04:09 +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 0ACE481k052516; Thu, 12 Nov 2020 14:04:08 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ACE48gJ052515; Thu, 12 Nov 2020 14:04:08 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202011121404.0ACE48gJ052515@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 12 Nov 2020 14:04:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367616 - head/lib/libzstd X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/lib/libzstd X-SVN-Commit-Revision: 367616 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 12 Nov 2020 14:04:09 -0000 Author: manu Date: Thu Nov 12 14:04:08 2020 New Revision: 367616 URL: https://svnweb.freebsd.org/changeset/base/367616 Log: pkgbase: Move libprivatezstd from utilities to runtime libarchive depends on it by default and tar uses libarchive. So on a update : 1/ runtime contain tar 2/ runtime have libarchive in shlibs_required 3/ libarchive packages depends on utilities 4/ utilities depends on runtime 5/ kaboom All users of libprivatezstd (libarchive related stuff and objcopy/ar) are already in utilities. Discussed with: bapt Modified: head/lib/libzstd/Makefile Modified: head/lib/libzstd/Makefile ============================================================================== --- head/lib/libzstd/Makefile Thu Nov 12 09:26:01 2020 (r367615) +++ head/lib/libzstd/Makefile Thu Nov 12 14:04:08 2020 (r367616) @@ -40,6 +40,7 @@ CFLAGS+= -I${ZSTDDIR}/lib -I${ZSTDDIR}/lib/common -DXX LIBADD= pthread PRIVATELIB= yes +PACKAGE= runtime ZSTDDIR= ${SRCTOP}/sys/contrib/zstd .PATH: ${ZSTDDIR}/lib/common ${ZSTDDIR}/lib/compress \ From owner-svn-src-head@freebsd.org Thu Nov 12 15:00:50 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5EEE22EC175; Thu, 12 Nov 2020 15:00:50 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CX4Xx5NZ3z3tgf; Thu, 12 Nov 2020 15:00:49 +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 F26E849E; Thu, 12 Nov 2020 15:00:48 +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 0ACF0mxM090201; Thu, 12 Nov 2020 15:00:48 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ACF0mVn090198; Thu, 12 Nov 2020 15:00:48 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202011121500.0ACF0mVn090198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 12 Nov 2020 15:00:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367617 - head/sys/dev/qat X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/qat X-SVN-Commit-Revision: 367617 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 12 Nov 2020 15:00:50 -0000 Author: markj Date: Thu Nov 12 15:00:48 2020 New Revision: 367617 URL: https://svnweb.freebsd.org/changeset/base/367617 Log: qat: Fix nits reported by Coverity MFC after: 3 days Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/dev/qat/qat.c head/sys/dev/qat/qat_ae.c head/sys/dev/qat/qatvar.h Modified: head/sys/dev/qat/qat.c ============================================================================== --- head/sys/dev/qat/qat.c Thu Nov 12 14:04:08 2020 (r367616) +++ head/sys/dev/qat/qat.c Thu Nov 12 15:00:48 2020 (r367617) @@ -573,7 +573,8 @@ qat_detach(device_t dev) sc->sc_ih_cookie = NULL; } if (sc->sc_ih != NULL) { - (void)bus_release_resource(dev, SYS_RES_IRQ, i + 1, sc->sc_ih); + (void)bus_release_resource(dev, SYS_RES_IRQ, + sc->sc_hw.qhw_num_banks + 1, sc->sc_ih); sc->sc_ih = NULL; } pci_release_msi(dev); Modified: head/sys/dev/qat/qat_ae.c ============================================================================== --- head/sys/dev/qat/qat_ae.c Thu Nov 12 14:04:08 2020 (r367616) +++ head/sys/dev/qat/qat_ae.c Thu Nov 12 15:00:48 2020 (r367617) @@ -2616,7 +2616,7 @@ qat_aefw_suof_load(struct qat_softc *sc, struct qat_dm static int qat_aefw_suof_write(struct qat_softc *sc) { - struct qat_suof_image *qsi = NULL; + struct qat_suof_image *qsi; int i, error = 0; for (i = 0; i < sc->sc_aefw_suof.qafs_num_simgs; i++) { @@ -2626,21 +2626,20 @@ qat_aefw_suof_write(struct qat_softc *sc) if (error) return error; error = qat_aefw_auth(sc, &qsi->qsi_dma); - if (error) - goto fail; + if (error) { + qat_free_dmamem(sc, &qsi->qsi_dma); + return error; + } error = qat_aefw_suof_load(sc, &qsi->qsi_dma); - if (error) - goto fail; - + if (error) { + qat_free_dmamem(sc, &qsi->qsi_dma); + return error; + } qat_free_dmamem(sc, &qsi->qsi_dma); } qat_free_mem(sc->sc_aefw_suof.qafs_simg); return 0; -fail: - if (qsi != NULL) - qat_free_dmamem(sc, &qsi->qsi_dma); - return error; } static int Modified: head/sys/dev/qat/qatvar.h ============================================================================== --- head/sys/dev/qat/qatvar.h Thu Nov 12 14:04:08 2020 (r367616) +++ head/sys/dev/qat/qatvar.h Thu Nov 12 15:00:48 2020 (r367617) @@ -594,7 +594,7 @@ struct qat_crypto_desc { bus_addr_t qcd_desc_paddr; bus_addr_t qcd_hash_state_paddr; - enum fw_slice qcd_slices[MAX_FW_SLICE]; + enum fw_slice qcd_slices[MAX_FW_SLICE + 1]; enum fw_la_cmd_id qcd_cmd_id; enum hw_cipher_dir qcd_cipher_dir; From owner-svn-src-head@freebsd.org Thu Nov 12 15:50:19 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 295042ED261; Thu, 12 Nov 2020 15:50:19 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CX5f30SC4z4RbC; Thu, 12 Nov 2020 15:50:19 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 03181870; Thu, 12 Nov 2020 15:50:19 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ACFoIjk021208; Thu, 12 Nov 2020 15:50:18 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ACFoIDj021207; Thu, 12 Nov 2020 15:50:18 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202011121550.0ACFoIDj021207@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Thu, 12 Nov 2020 15:50:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367618 - head/sys/dev/md X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/sys/dev/md X-SVN-Commit-Revision: 367618 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 12 Nov 2020 15:50:19 -0000 Author: 0mp (doc,ports committer) Date: Thu Nov 12 15:50:18 2020 New Revision: 367618 URL: https://svnweb.freebsd.org/changeset/base/367618 Log: Fix a typo in a license comment Approved by: kaktus (src) Modified: head/sys/dev/md/md.c Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Thu Nov 12 15:00:48 2020 (r367617) +++ head/sys/dev/md/md.c Thu Nov 12 15:50:18 2020 (r367618) @@ -13,7 +13,7 @@ */ /*- - * The following functions are based in the vn(4) driver: mdstart_swap(), + * The following functions are based on the vn(4) driver: mdstart_swap(), * mdstart_vnode(), mdcreate_swap(), mdcreate_vnode() and mddestroy(), * and as such under the following copyright: * From owner-svn-src-head@freebsd.org Thu Nov 12 16:44:57 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1727E2EE6A6; Thu, 12 Nov 2020 16:44:57 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CX6s473WNz4VLQ; Thu, 12 Nov 2020 16:44:56 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E44591746; Thu, 12 Nov 2020 16:44:56 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ACGiuUQ058347; Thu, 12 Nov 2020 16:44:56 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ACGiu99058346; Thu, 12 Nov 2020 16:44:56 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202011121644.0ACGiu99058346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Thu, 12 Nov 2020 16:44:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367619 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 367619 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 12 Nov 2020 16:44:57 -0000 Author: 0mp (doc,ports committer) Date: Thu Nov 12 16:44:56 2020 New Revision: 367619 URL: https://svnweb.freebsd.org/changeset/base/367619 Log: Add a missing period and remove a macro from Bl's width argument MFC after: 3 days Modified: head/share/man/man9/VOP_RDWR.9 Modified: head/share/man/man9/VOP_RDWR.9 ============================================================================== --- head/share/man/man9/VOP_RDWR.9 Thu Nov 12 15:50:18 2020 (r367618) +++ head/share/man/man9/VOP_RDWR.9 Thu Nov 12 16:44:56 2020 (r367619) @@ -44,7 +44,7 @@ .Ft int .Fn VOP_WRITE "struct vnode *vp" "struct uio *uio" "int ioflag" "struct ucred *cred" .Sh DESCRIPTION -These entry points read or write the contents of a file +These entry points read or write the contents of a file. .Pp The arguments are: .Bl -tag -width ioflag @@ -66,7 +66,7 @@ read-ahead hint (in units of file system blocks) that should attempt. The low 16 bits are a bit mask which can contain the following flags: -.Bl -tag -width ".Dv IO_NODELOCKED" +.Bl -tag -width "IO_NODELOCKED" .It Dv IO_UNIT Do I/O as atomic unit. .It Dv IO_APPEND From owner-svn-src-head@freebsd.org Thu Nov 12 17:28:30 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 51FA72EF73B; Thu, 12 Nov 2020 17:28:30 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CX7qL1rgmz4XyJ; Thu, 12 Nov 2020 17:28:30 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 327D31E7A; Thu, 12 Nov 2020 17:28:30 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ACHSUif084946; Thu, 12 Nov 2020 17:28:30 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ACHSTEi084943; Thu, 12 Nov 2020 17:28:29 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202011121728.0ACHSTEi084943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Thu, 12 Nov 2020 17:28:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367621 - head/share/examples/mdoc X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/share/examples/mdoc X-SVN-Commit-Revision: 367621 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 12 Nov 2020 17:28:30 -0000 Author: 0mp (doc,ports committer) Date: Thu Nov 12 17:28:29 2020 New Revision: 367621 URL: https://svnweb.freebsd.org/changeset/base/367621 Log: Remove macros from the width arguments passed to Bl macros I've not removed the Er macro from one of the lists in example.9, however, because it seems to be doing some special kind of magic. Let's leave it there for now. Modified: head/share/examples/mdoc/example.1 head/share/examples/mdoc/example.3 head/share/examples/mdoc/example.4 head/share/examples/mdoc/example.9 Modified: head/share/examples/mdoc/example.1 ============================================================================== --- head/share/examples/mdoc/example.1 Thu Nov 12 17:26:19 2020 (r367620) +++ head/share/examples/mdoc/example.1 Thu Nov 12 17:28:29 2020 (r367621) @@ -47,7 +47,7 @@ It is intended that this example can be used as a temp when writing a new manual page. .Pp The options are as follows: -.Bl -tag -width ".Fl d Ar argument" +.Bl -tag -width "-d Ar argument" .It Fl a Example optional .Fl a @@ -76,7 +76,7 @@ command ignores the .Ev EXAMPLE environment variable. .Sh FILES -.Bl -tag -width ".Pa /dev/null" -compact +.Bl -tag -width "/dev/null" -compact .It Pa /dev/null Example of a file in the .Sx FILES Modified: head/share/examples/mdoc/example.3 ============================================================================== --- head/share/examples/mdoc/example.3 Thu Nov 12 17:26:19 2020 (r367620) +++ head/share/examples/mdoc/example.3 Thu Nov 12 17:28:29 2020 (r367621) @@ -57,7 +57,7 @@ and The argument .Fa mode may have one of the following values: -.Bl -tag -width ".Dv EXAMPLE_ONE" +.Bl -tag -width "EXAMPLE_ONE" .It Dv EXAMPLE_ONE First example of a defined variable. .Dv EXAMPLE_ONE @@ -86,7 +86,7 @@ library function ignores the .Ev EXAMPLE environment variable. .Sh FILES -.Bl -tag -width ".Pa /dev/null" -compact +.Bl -tag -width "/dev/null" -compact .It Pa /dev/null Example of a file in the .Sx FILES Modified: head/share/examples/mdoc/example.4 ============================================================================== --- head/share/examples/mdoc/example.4 Thu Nov 12 17:26:19 2020 (r367620) +++ head/share/examples/mdoc/example.4 Thu Nov 12 17:28:29 2020 (r367621) @@ -59,7 +59,7 @@ when writing a new manual page. The .Nm driver supports the following ioctls: -.Bl -tag -width ".Dv EIOCNULL" +.Bl -tag -width "EIOCNULL" .It Dv EIOCEX Example ioctl. .It Dv EIOCNULL Modified: head/share/examples/mdoc/example.9 ============================================================================== --- head/share/examples/mdoc/example.9 Thu Nov 12 17:26:19 2020 (r367620) +++ head/share/examples/mdoc/example.9 Thu Nov 12 17:28:29 2020 (r367621) @@ -54,7 +54,7 @@ and The argument .Fa mode may have one of the following values: -.Bl -tag -width ".Dv EXAMPLE_ONE" +.Bl -tag -width "EXAMPLE_ONE" .It Dv EXAMPLE_ONE First example of a defined variable. .Dv EXAMPLE_ONE From owner-svn-src-head@freebsd.org Thu Nov 12 18:24:38 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0BF67461776; Thu, 12 Nov 2020 18:24:38 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CX9456xLSz4cC5; Thu, 12 Nov 2020 18:24:37 +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 E0C372EB9; Thu, 12 Nov 2020 18:24:37 +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 0ACIObkZ022058; Thu, 12 Nov 2020 18:24:37 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ACIObtO022057; Thu, 12 Nov 2020 18:24:37 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202011121824.0ACIObtO022057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 12 Nov 2020 18:24:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367622 - in head/sys/dev/usb: . quirk X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/usb: . quirk X-SVN-Commit-Revision: 367622 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 12 Nov 2020 18:24:38 -0000 Author: hselasky Date: Thu Nov 12 18:24:37 2020 New Revision: 367622 URL: https://svnweb.freebsd.org/changeset/base/367622 Log: Add more USB quirks. PR: 230038 MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Thu Nov 12 17:28:29 2020 (r367621) +++ head/sys/dev/usb/quirk/usb_quirk.c Thu Nov 12 18:24:37 2020 (r367622) @@ -240,7 +240,9 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK USB_QUIRK(FREECOM, DVD, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_SCSI), USB_QUIRK(FUJIPHOTO, MASS0100, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI_I, UQ_MSC_FORCE_PROTO_ATAPI, UQ_MSC_NO_RS_CLEAR_UA, UQ_MSC_NO_SYNC_CACHE), + USB_QUIRK(GARMIN, DAKOTA20, 0x0000, 0xffff, UQ_MSC_NO_INQUIRY), USB_QUIRK(GARMIN, FORERUNNER230, 0x0000, 0xffff, UQ_MSC_NO_INQUIRY), + USB_QUIRK(GARMIN, GPSMAP62S, 0x0000, 0xffff, UQ_MSC_NO_INQUIRY), USB_QUIRK(GENESYS, GL641USB2IDE, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_FORCE_SHORT_INQ, UQ_MSC_NO_START_STOP, UQ_MSC_IGNORE_RESIDUE, UQ_MSC_NO_SYNC_CACHE), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Thu Nov 12 17:28:29 2020 (r367621) +++ head/sys/dev/usb/usbdevs Thu Nov 12 18:24:37 2020 (r367622) @@ -2253,7 +2253,9 @@ product FUJITSU AH_F401U 0x105b AH-F401U Air H device product FUJITSUSIEMENS SCR 0x0009 Fujitsu-Siemens SCR USB Reader /* Garmin products */ +product GARMIN DAKOTA20 0x23c0 Dakota 20 product GARMIN FORERUNNER230 0x086d ForeRunner 230 +product GARMIN GPSMAP62S 0x2459 GPSMAP 62s product GARMIN IQUE_3600 0x0004 iQue 3600 /* Gemalto products */ From owner-svn-src-head@freebsd.org Thu Nov 12 19:25:31 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8DE3D462E55; Thu, 12 Nov 2020 19:25:31 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXBQM3d1Kz4fsh; Thu, 12 Nov 2020 19:25:31 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F325393F; Thu, 12 Nov 2020 19:25:31 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ACJPVFq059104; Thu, 12 Nov 2020 19:25:31 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ACJPVvU059103; Thu, 12 Nov 2020 19:25:31 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202011121925.0ACJPVvU059103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 12 Nov 2020 19:25:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367623 - head/contrib/llvm-project/lld/ELF X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/llvm-project/lld/ELF X-SVN-Commit-Revision: 367623 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 12 Nov 2020 19:25:31 -0000 Author: dim Date: Thu Nov 12 19:25:31 2020 New Revision: 367623 URL: https://svnweb.freebsd.org/changeset/base/367623 Log: Merge commit 8df4e6094 from llvm git (by Fangrui Song): [ELF] Don't consider SHF_ALLOC ".debug*" sections debug sections Fixes PR48071 * The Rust compiler produces SHF_ALLOC `.debug_gdb_scripts` (which normally does not have the flag) * `.debug_gdb_scripts` sections are removed from `inputSections` due to --strip-debug/--strip-all * When processing --gc-sections, pieces of a SHF_MERGE section can be marked live separately `=>` segfault when marking liveness of a `.debug_gdb_scripts` which is not split into pieces (because it is not in `inputSections`) This patch circumvents the problem by not treating SHF_ALLOC ".debug*" as debug sections (to prevent --strip-debug's stripping) (which is still useful on its own). Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D91291 This should fix lld segfaulting when linking the rust-based parts of the devel/py-maturin port. Reported by: Nick Venenga PR: 250783 MFC after: 3 days Modified: head/contrib/llvm-project/lld/ELF/InputSection.h Modified: head/contrib/llvm-project/lld/ELF/InputSection.h ============================================================================== --- head/contrib/llvm-project/lld/ELF/InputSection.h Thu Nov 12 18:24:37 2020 (r367622) +++ head/contrib/llvm-project/lld/ELF/InputSection.h Thu Nov 12 19:25:31 2020 (r367623) @@ -391,7 +391,8 @@ class InputSection : public InputSectionBase { (privat }; inline bool isDebugSection(const InputSectionBase &sec) { - return sec.name.startswith(".debug") || sec.name.startswith(".zdebug"); + return (sec.flags & llvm::ELF::SHF_ALLOC) == 0 && + (sec.name.startswith(".debug") || sec.name.startswith(".zdebug")); } // The list of all input sections. From owner-svn-src-head@freebsd.org Thu Nov 12 20:02:48 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A9BA346393B; Thu, 12 Nov 2020 20:02:48 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXCFN3znqz4hPc; Thu, 12 Nov 2020 20:02:48 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 71B8E43B7; Thu, 12 Nov 2020 20:02:48 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ACK2mkB083556; Thu, 12 Nov 2020 20:02:48 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ACK2mWK083555; Thu, 12 Nov 2020 20:02:48 GMT (envelope-from np@FreeBSD.org) Message-Id: <202011122002.0ACK2mWK083555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 12 Nov 2020 20:02:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367624 - head/sys/dev/cxgbe/tom X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 367624 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 12 Nov 2020 20:02:48 -0000 Author: np Date: Thu Nov 12 20:02:48 2020 New Revision: 367624 URL: https://svnweb.freebsd.org/changeset/base/367624 Log: cxgbe/t4_tom: Handle VXLAN-encapsulated SYNs correctly. TCP SYNs in inner traffic will hit hardware listeners when VXLAN/NVGRE rx parsing is enabled in the chip. t4_tom should pass on these SYNs to the kernel and let it deal with them as if they arrived on the non-TOE path. Reported by: Sony at Chelsio MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/tom/t4_listen.c Modified: head/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_listen.c Thu Nov 12 19:25:31 2020 (r367623) +++ head/sys/dev/cxgbe/tom/t4_listen.c Thu Nov 12 20:02:48 2020 (r367624) @@ -1003,6 +1003,17 @@ t4opt_to_tcpopt(const struct tcp_options *t4opt, struc to->to_flags |= TOF_SACKPERM; } +static bool +encapsulated_syn(struct adapter *sc, const struct cpl_pass_accept_req *cpl) +{ + u_int hlen = be32toh(cpl->hdr_len); + + if (chip_id(sc) >= CHELSIO_T6) + return (G_T6_ETH_HDR_LEN(hlen) > sizeof(struct ether_vlan_header)); + else + return (G_ETH_HDR_LEN(hlen) > sizeof(struct ether_vlan_header)); +} + static void pass_accept_req_to_protohdrs(struct adapter *sc, const struct mbuf *m, struct in_conninfo *inc, struct tcphdr *th, uint8_t *iptos) @@ -1194,22 +1205,38 @@ do_pass_accept_req(struct sge_iq *iq, const struct rss CTR4(KTR_CXGBE, "%s: stid %u, tid %u, lctx %p", __func__, stid, tid, lctx); + /* + * Figure out the port the SYN arrived on. We'll look for an exact VI + * match in a bit but in case we don't find any we'll use the main VI as + * the incoming ifnet. + */ + l2info = be16toh(cpl->l2info); + pi = sc->port[G_SYN_INTF(l2info)]; + hw_ifp = pi->vi[0].ifp; + m->m_pkthdr.rcvif = hw_ifp; + CURVNET_SET(lctx->vnet); /* before any potential REJECT */ /* + * If VXLAN/NVGRE parsing is enabled then SYNs in the inner traffic will + * also hit the listener. We don't want to offload those. + */ + if (encapsulated_syn(sc, cpl)) { + REJECT_PASS_ACCEPT_REQ(true); + } + + /* * Use the MAC index to lookup the associated VI. If this SYN didn't * match a perfect MAC filter, punt. */ - l2info = be16toh(cpl->l2info); - pi = sc->port[G_SYN_INTF(l2info)]; if (!(l2info & F_SYN_XACT_MATCH)) { - REJECT_PASS_ACCEPT_REQ(false); + REJECT_PASS_ACCEPT_REQ(true); } for_each_vi(pi, v, vi) { if (vi->xact_addr_filt == G_SYN_MAC_IDX(l2info)) goto found; } - REJECT_PASS_ACCEPT_REQ(false); + REJECT_PASS_ACCEPT_REQ(true); found: hw_ifp = vi->ifp; /* the cxgbe ifnet */ m->m_pkthdr.rcvif = hw_ifp; From owner-svn-src-head@freebsd.org Thu Nov 12 20:20:44 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A5F0F46402D; Thu, 12 Nov 2020 20:20:44 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXCf44NMqz4hy6; Thu, 12 Nov 2020 20:20:44 +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 89BA84053; Thu, 12 Nov 2020 20:20:44 +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 0ACKKiGQ089905; Thu, 12 Nov 2020 20:20:44 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ACKKiXq089903; Thu, 12 Nov 2020 20:20:44 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202011122020.0ACKKiXq089903@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 12 Nov 2020 20:20:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367625 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 367625 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 12 Nov 2020 20:20:44 -0000 Author: mav Date: Thu Nov 12 20:20:43 2020 New Revision: 367625 URL: https://svnweb.freebsd.org/changeset/base/367625 Log: Fix panic if NVMe is detached before the intrhook call. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sys/dev/nvme/nvme.c head/sys/dev/nvme/nvme_ctrlr.c Modified: head/sys/dev/nvme/nvme.c ============================================================================== --- head/sys/dev/nvme/nvme.c Thu Nov 12 20:02:48 2020 (r367624) +++ head/sys/dev/nvme/nvme.c Thu Nov 12 20:20:43 2020 (r367625) @@ -139,9 +139,14 @@ nvme_attach(device_t dev) } int -nvme_detach (device_t dev) +nvme_detach(device_t dev) { struct nvme_controller *ctrlr = DEVICE2SOFTC(dev); + + if (ctrlr->config_hook.ich_arg != NULL) { + config_intrhook_disestablish(&ctrlr->config_hook); + ctrlr->config_hook.ich_arg = NULL; + } nvme_ctrlr_destruct(ctrlr, dev); return (0); Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Thu Nov 12 20:02:48 2020 (r367624) +++ head/sys/dev/nvme/nvme_ctrlr.c Thu Nov 12 20:20:43 2020 (r367625) @@ -1135,6 +1135,7 @@ nvme_ctrlr_start_config_hook(void *arg) fail: nvme_ctrlr_fail(ctrlr); config_intrhook_disestablish(&ctrlr->config_hook); + ctrlr->config_hook.ich_arg = NULL; return; } @@ -1152,6 +1153,7 @@ fail: nvme_sysctl_initialize_ctrlr(ctrlr); config_intrhook_disestablish(&ctrlr->config_hook); + ctrlr->config_hook.ich_arg = NULL; ctrlr->is_initialized = 1; nvme_notify_new_controller(ctrlr); From owner-svn-src-head@freebsd.org Thu Nov 12 20:20:57 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ECBB7463FA2; Thu, 12 Nov 2020 20:20:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXCfK6PZxz4jNw; Thu, 12 Nov 2020 20:20:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF0A543F2; Thu, 12 Nov 2020 20:20:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ACKKvCp090943; Thu, 12 Nov 2020 20:20:57 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ACKKvFa090942; Thu, 12 Nov 2020 20:20:57 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011122020.0ACKKvFa090942@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 12 Nov 2020 20:20:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367626 - head/sys/geom/bde X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/geom/bde X-SVN-Commit-Revision: 367626 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 12 Nov 2020 20:20:58 -0000 Author: mjg Date: Thu Nov 12 20:20:57 2020 New Revision: 367626 URL: https://svnweb.freebsd.org/changeset/base/367626 Log: gbde: replace malloc_last_fail with a kludge This facilitates removal of malloc_last_fail without really impacting anything. Modified: head/sys/geom/bde/g_bde_work.c Modified: head/sys/geom/bde/g_bde_work.c ============================================================================== --- head/sys/geom/bde/g_bde_work.c Thu Nov 12 20:20:43 2020 (r367625) +++ head/sys/geom/bde/g_bde_work.c Thu Nov 12 20:20:57 2020 (r367626) @@ -77,6 +77,20 @@ #include #include +/* + * FIXME: This used to call malloc_last_fail which in practice was almost + * guaranteed to return time_uptime even in face of severe memory shortage. + * As GBDE is the only consumer the kludge below was added to facilitate the + * removal with minimial changes. The code should be fixed to respond to memory + * pressure (e.g., by using lowmem eventhandler) instead. + */ +static int +g_bde_malloc_last_fail(void) +{ + + return (time_uptime); +} + static void g_bde_delete_sector(struct g_bde_softc *wp, struct g_bde_sector *sp); static struct g_bde_sector * g_bde_new_sector(struct g_bde_work *wp, u_int len); static void g_bde_release_keysector(struct g_bde_work *wp); @@ -210,7 +224,7 @@ g_bde_get_keysector(struct g_bde_work *wp) g_trace(G_T_TOPOLOGY, "g_bde_get_keysector(%p, %jd)", wp, (intmax_t)offset); sc = wp->softc; - if (malloc_last_fail() < g_bde_ncache) + if (g_bde_malloc_last_fail() < g_bde_ncache) g_bde_purge_sector(sc, -1); sp = TAILQ_FIRST(&sc->freelist); @@ -228,7 +242,7 @@ g_bde_get_keysector(struct g_bde_work *wp) if (sp->ref == 1) sp->owner = wp; } else { - if (malloc_last_fail() < g_bde_ncache) { + if (g_bde_malloc_last_fail() < g_bde_ncache) { TAILQ_FOREACH(sp, &sc->freelist, list) if (sp->ref == 0) break; @@ -311,7 +325,7 @@ g_bde_purge_sector(struct g_bde_softc *sc, int fractio if (fraction > 0) n = sc->ncache / fraction + 1; else - n = g_bde_ncache - malloc_last_fail(); + n = g_bde_ncache - g_bde_malloc_last_fail(); if (n < 0) return; if (n > sc->ncache) From owner-svn-src-head@freebsd.org Thu Nov 12 20:22:59 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AE022464055; Thu, 12 Nov 2020 20:22:59 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXChg4Xknz4jvM; Thu, 12 Nov 2020 20:22:59 +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 8EF3E490B; Thu, 12 Nov 2020 20:22:59 +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 0ACKMxrY096168; Thu, 12 Nov 2020 20:22:59 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ACKMxXx096165; Thu, 12 Nov 2020 20:22:59 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011122022.0ACKMxXx096165@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 12 Nov 2020 20:22:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367627 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 367627 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 12 Nov 2020 20:22:59 -0000 Author: mjg Date: Thu Nov 12 20:22:58 2020 New Revision: 367627 URL: https://svnweb.freebsd.org/changeset/base/367627 Log: malloc: retire malloc_last_fail The routine does not serve any practical purpose. Memory can be allocated in many other ways and most consumers pass the M_WAITOK flag, making malloc not fail in the first place. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D27143 Modified: head/sys/kern/kern_malloc.c head/sys/sys/malloc.h head/sys/sys/param.h Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Thu Nov 12 20:20:57 2020 (r367626) +++ head/sys/kern/kern_malloc.c Thu Nov 12 20:22:58 2020 (r367627) @@ -231,11 +231,6 @@ static int sysctl_kern_mprof(SYSCTL_HANDLER_ARGS); static int sysctl_kern_malloc_stats(SYSCTL_HANDLER_ARGS); -/* - * time_uptime of the last malloc(9) failure (induced or real). - */ -static time_t t_malloc_fail; - #if defined(MALLOC_MAKE_FAILURES) || (MALLOC_DEBUG_MAXZONES > 1) static SYSCTL_NODE(_debug, OID_AUTO, malloc, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "Kernel malloc debugging options"); @@ -373,13 +368,6 @@ mtp_get_subzone(struct malloc_type *mtp) } #endif /* MALLOC_DEBUG_MAXZONES > 1 */ -int -malloc_last_fail(void) -{ - - return (time_uptime - t_malloc_fail); -} - /* * An allocation has succeeded -- update malloc type statistics for the * amount of bucket size. Occurs within a critical section so that the @@ -535,7 +523,6 @@ malloc_dbg(caddr_t *vap, size_t *sizep, struct malloc_ atomic_add_int(&malloc_nowait_count, 1); if ((malloc_nowait_count % malloc_failure_rate) == 0) { atomic_add_int(&malloc_failure_count, 1); - t_malloc_fail = time_uptime; *vap = NULL; return (EJUSTRETURN); } @@ -662,7 +649,6 @@ void * if (__predict_false(va == NULL)) { KASSERT((flags & M_WAITOK) == 0, ("malloc(M_WAITOK) returned NULL")); - t_malloc_fail = time_uptime; } #ifdef DEBUG_REDZONE if (va != NULL) @@ -730,7 +716,6 @@ malloc_domainset(size_t size, struct malloc_type *mtp, if (__predict_false(va == NULL)) { KASSERT((flags & M_WAITOK) == 0, ("malloc(M_WAITOK) returned NULL")); - t_malloc_fail = time_uptime; } #ifdef DEBUG_REDZONE if (va != NULL) @@ -761,7 +746,6 @@ malloc_exec(size_t size, struct malloc_type *mtp, int if (__predict_false(va == NULL)) { KASSERT((flags & M_WAITOK) == 0, ("malloc(M_WAITOK) returned NULL")); - t_malloc_fail = time_uptime; } #ifdef DEBUG_REDZONE if (va != NULL) @@ -791,7 +775,6 @@ malloc_domainset_exec(size_t size, struct malloc_type if (__predict_false(va == NULL)) { KASSERT((flags & M_WAITOK) == 0, ("malloc(M_WAITOK) returned NULL")); - t_malloc_fail = time_uptime; } #ifdef DEBUG_REDZONE if (va != NULL) Modified: head/sys/sys/malloc.h ============================================================================== --- head/sys/sys/malloc.h Thu Nov 12 20:20:57 2020 (r367626) +++ head/sys/sys/malloc.h Thu Nov 12 20:22:58 2020 (r367627) @@ -252,7 +252,6 @@ void *malloc_domainset_exec(size_t size, struct malloc struct domainset *ds, int flags) __malloc_like __result_use_check __alloc_size(1); void malloc_init(void *); -int malloc_last_fail(void); void malloc_type_allocated(struct malloc_type *type, unsigned long size); void malloc_type_freed(struct malloc_type *type, unsigned long size); void malloc_type_list(malloc_type_list_func_t *, void *); Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu Nov 12 20:20:57 2020 (r367626) +++ head/sys/sys/param.h Thu Nov 12 20:22:58 2020 (r367627) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300128 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300129 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Thu Nov 12 21:58:48 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2D518466199; Thu, 12 Nov 2020 21:58:48 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXFqD0sNPz4p9P; Thu, 12 Nov 2020 21:58:48 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F3B65830; Thu, 12 Nov 2020 21:58:48 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ACLwlm8052145; Thu, 12 Nov 2020 21:58:47 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ACLwl0n052142; Thu, 12 Nov 2020 21:58:47 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <202011122158.0ACLwl0n052142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Thu, 12 Nov 2020 21:58:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367628 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: gnn X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 367628 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 12 Nov 2020 21:58:48 -0000 Author: gnn Date: Thu Nov 12 21:58:47 2020 New Revision: 367628 URL: https://svnweb.freebsd.org/changeset/base/367628 Log: An earlier commit effectively turned out the fast forwading path due to its lack of support for ICMP redirects. The following commit adds redirects to the fastforward path, again allowing for decent forwarding performance in the kernel. Reviewed by: ae, melifaro Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate") Modified: head/sys/netinet/ip_fastfwd.c head/sys/netinet/ip_input.c head/sys/netinet/ip_var.h Modified: head/sys/netinet/ip_fastfwd.c ============================================================================== --- head/sys/netinet/ip_fastfwd.c Thu Nov 12 20:22:58 2020 (r367627) +++ head/sys/netinet/ip_fastfwd.c Thu Nov 12 21:58:47 2020 (r367628) @@ -111,6 +111,43 @@ __FBSDID("$FreeBSD$"); #include +#define V_ipsendredirects VNET(ipsendredirects) + +static struct mbuf * +ip_redir_alloc(struct mbuf *m, struct nhop_object *nh, + struct ip *ip, in_addr_t *addr) +{ + struct mbuf *mcopy = m_gethdr(M_NOWAIT, m->m_type); + if (mcopy != NULL && !m_dup_pkthdr(mcopy, m, M_NOWAIT)) { + /* + * It's probably ok if the pkthdr dup fails (because + * the deep copy of the tag chain failed), but for now + * be conservative and just discard the copy since + * code below may some day want the tags. + */ + m_free(mcopy); + return (NULL); + } + mcopy->m_len = min(ntohs(ip->ip_len), M_TRAILINGSPACE(mcopy)); + mcopy->m_pkthdr.len = mcopy->m_len; + m_copydata(m, 0, mcopy->m_len, mtod(mcopy, caddr_t)); + + if (nh != NULL && + ((nh->nh_flags & (NHF_REDIRECT|NHF_DEFAULT)) == 0)) { + struct in_ifaddr *nh_ia = (struct in_ifaddr *)(nh->nh_ifa); + u_long src = ntohl(ip->ip_src.s_addr); + + if (nh_ia != NULL && (src & nh_ia->ia_subnetmask) == nh_ia->ia_subnet) { + if (nh->nh_flags & NHF_GATEWAY) + *addr = nh->gw4_sa.sin_addr.s_addr; + else + *addr = ip->ip_dst.s_addr; + } + } + return (mcopy); +} + + static int ip_findroute(struct nhop_object **pnh, struct in_addr dest, struct mbuf *m) { @@ -156,13 +193,14 @@ ip_tryforward(struct mbuf *m) { struct ip *ip; struct mbuf *m0 = NULL; - struct nhop_object *nh; + struct nhop_object *nh = NULL; struct sockaddr_in dst; struct in_addr dest, odest, rtdest; uint16_t ip_len, ip_off; int error = 0; struct m_tag *fwd_tag = NULL; - + struct mbuf *mcopy = NULL; + struct in_addr redest; /* * Are we active and forwarding packets? */ @@ -387,6 +425,13 @@ passout: dst.sin_addr = dest; /* + * Handle redirect case. + */ + redest.s_addr = 0; + if (V_ipsendredirects && (nh->nh_ifp == m->m_pkthdr.rcvif)) + mcopy = ip_redir_alloc(m, nh, ip, &redest.s_addr); + + /* * Check if packet fits MTU or if hardware will fragment for us */ if (ip_len <= nh->nh_mtu) { @@ -455,7 +500,16 @@ passout: IPSTAT_INC(ips_forward); IPSTAT_INC(ips_fastforward); } + + /* Send required redirect */ + if (mcopy != NULL) { + icmp_error(mcopy, ICMP_REDIRECT, ICMP_REDIRECT_HOST, redest.s_addr, 0); + mcopy = NULL; /* Freed by caller */ + } + consumed: + if (mcopy != NULL) + m_freem(mcopy); return NULL; drop: if (m) Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Thu Nov 12 20:22:58 2020 (r367627) +++ head/sys/netinet/ip_input.c Thu Nov 12 21:58:47 2020 (r367628) @@ -111,8 +111,11 @@ SYSCTL_INT(_net_inet_ip, IPCTL_FORWARDING, forwarding, &VNET_NAME(ipforwarding), 0, "Enable IP forwarding between interfaces"); -VNET_DEFINE_STATIC(int, ipsendredirects) = 1; /* XXX */ -#define V_ipsendredirects VNET(ipsendredirects) +/* + * Respond with an ICMP host redirect when we forward a packet out of + * the same interface on which it was received. See RFC 792. + */ +VNET_DEFINE(int, ipsendredirects) = 1; SYSCTL_INT(_net_inet_ip, IPCTL_SENDREDIRECTS, redirect, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ipsendredirects), 0, "Enable sending IP redirects"); @@ -571,7 +574,7 @@ tooshort: * case skip another inbound firewall processing and update * ip pointer. */ - if (V_ipforwarding != 0 && V_ipsendredirects == 0 + if (V_ipforwarding != 0 #if defined(IPSEC) || defined(IPSEC_SUPPORT) && (!IPSEC_ENABLED(ipv4) || IPSEC_CAPS(ipv4, m, IPSEC_CAP_OPERABLE) == 0) Modified: head/sys/netinet/ip_var.h ============================================================================== --- head/sys/netinet/ip_var.h Thu Nov 12 20:22:58 2020 (r367627) +++ head/sys/netinet/ip_var.h Thu Nov 12 21:58:47 2020 (r367628) @@ -182,6 +182,7 @@ struct inpcbinfo; VNET_DECLARE(int, ip_defttl); /* default IP ttl */ VNET_DECLARE(int, ipforwarding); /* ip forwarding */ +VNET_DECLARE(int, ipsendredirects); #ifdef IPSTEALTH VNET_DECLARE(int, ipstealth); /* stealth forwarding */ #endif @@ -197,6 +198,7 @@ extern struct pr_usrreqs rip_usrreqs; #define V_ip_id VNET(ip_id) #define V_ip_defttl VNET(ip_defttl) #define V_ipforwarding VNET(ipforwarding) +#define V_ipsendredirects VNET(ipsendredirects) #ifdef IPSTEALTH #define V_ipstealth VNET(ipstealth) #endif From owner-svn-src-head@freebsd.org Thu Nov 12 22:12:38 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0553D4661F0; Thu, 12 Nov 2020 22:12:38 +0000 (UTC) (envelope-from oliver.pntr@gmail.com) Received: from mail-oi1-x229.google.com (mail-oi1-x229.google.com [IPv6:2607:f8b0:4864:20::229]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXG796LyTz4pgX; Thu, 12 Nov 2020 22:12:37 +0000 (UTC) (envelope-from oliver.pntr@gmail.com) Received: by mail-oi1-x229.google.com with SMTP id j7so8164589oie.12; Thu, 12 Nov 2020 14:12:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=hZ44B0PGqFtPHTBcc9vPRRZ21qSno4Fe8YS1vFXzn8I=; b=fL+ktIOv9iwotnH/fqnvZwf1FpKxo9lP5rBRKmkFbEQw5zpijrZ8jkTJaGfn84tPFS wKOKOeHnLP743k+Up13fpG9wNVPMkRArmeFFxREdlNfB5UGp8HV+Az7PAkX0BzCXaLDe LA9oLqOzvjfn5x10tnd1ldTYccvXdM2TBIcgebyr2L566MQAW7XA+Vpg4wmR4jgGQUVI TEQR5SX2E8XyT1Ibouz4xuS7e5OuV0cPvjQnnNFvkBWYnrqDbOCZnNAKzqpLstMmmkKN 5CKfdrA1Wj5iHxoONjrLXWZWseo/NkGBizM1BaYUKhHz0x5TV08rt1FrSraCLXRw7lN9 uFZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=hZ44B0PGqFtPHTBcc9vPRRZ21qSno4Fe8YS1vFXzn8I=; b=LvNLYnfipLph6DWRPOzu5LXVQ7wiwpbKUQNMJwDf1kuBWuDa/STE+QG1AiEZmRvjtq IOhVbtaX8DWbU07JJXQ4IH/PZ5SoyXeC7O+uXFuWekOSA+uebg99IB3fRzm4LfKgSo/2 ezTLXiLScpcpPBLGKOlZGEhkBtKs4YxvwEKP5rLI9mjbrU1VU6pgQ2Ws1QBnS30+33+3 IUe4xznUwLlsIJixm7jPgdBUK8b2z1eskFs3wNIsG0CeyLCvfTK57dabwZwGS3MtXPyO 5TrxU4uM8dZ0kouRSELNqFl8UEyHPs2r+eYyIR4bJzsFfBdSGfXDPDnNVvyGj07MLznc VeXg== X-Gm-Message-State: AOAM53397hZrr66D9dNIRwzq+iUf3hgDHb//gw8WEJxXy+tAWattwZ0x GNCHvVbvKOZVJmOMplkk5V+pL/8S7xV67I08XfLaFndN X-Google-Smtp-Source: ABdhPJxQgvTKV9tbgZx/W6P1soOubuYDxGb1pBtI6wLmkNCKfzHzX6VVVpOZxLWvhTu5ZaajSt/C0t4vjkCgGBpnk/E= X-Received: by 2002:aca:ef06:: with SMTP id n6mr1186831oih.173.1605219156393; Thu, 12 Nov 2020 14:12:36 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a4a:c689:0:0:0:0:0 with HTTP; Thu, 12 Nov 2020 14:12:35 -0800 (PST) In-Reply-To: <202011122020.0ACKKvFa090942@repo.freebsd.org> References: <202011122020.0ACKKvFa090942@repo.freebsd.org> From: Oliver Pinter Date: Thu, 12 Nov 2020 23:12:35 +0100 Message-ID: Subject: Re: svn commit: r367626 - head/sys/geom/bde To: Mateusz Guzik Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" X-Rspamd-Queue-Id: 4CXG796LyTz4pgX X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; TAGGED_FROM(0.00)[]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 12 Nov 2020 22:12:38 -0000 On Thursday, November 12, 2020, Mateusz Guzik wrote: > Author: mjg > Date: Thu Nov 12 20:20:57 2020 > New Revision: 367626 > URL: https://svnweb.freebsd.org/changeset/base/367626 > > Log: > gbde: replace malloc_last_fail with a kludge > > This facilitates removal of malloc_last_fail without really impacting > anything. > > Modified: > head/sys/geom/bde/g_bde_work.c > > Modified: head/sys/geom/bde/g_bde_work.c > ============================================================ > ================== > --- head/sys/geom/bde/g_bde_work.c Thu Nov 12 20:20:43 2020 > (r367625) > +++ head/sys/geom/bde/g_bde_work.c Thu Nov 12 20:20:57 2020 > (r367626) > @@ -77,6 +77,20 @@ > #include > #include > > +/* > + * FIXME: This used to call malloc_last_fail which in practice was almost > + * guaranteed to return time_uptime even in face of severe memory > shortage. > + * As GBDE is the only consumer the kludge below was added to facilitate > the > + * removal with minimial changes. The code should be fixed to respond to > memory > + * pressure (e.g., by using lowmem eventhandler) instead. > + */ > +static int > +g_bde_malloc_last_fail(void) > +{ > + > + return (time_uptime); > +} > + Previously malloc_last_fail returned a relatively small number - if i read the code correctly: -int -malloc_last_fail(void) -{ - - return (time_uptime - t_malloc_fail); -} - > static void g_bde_delete_sector(struct g_bde_softc *wp, struct > g_bde_sector *sp); > static struct g_bde_sector * g_bde_new_sector(struct g_bde_work *wp, > u_int len); > static void g_bde_release_keysector(struct g_bde_work *wp); > @@ -210,7 +224,7 @@ g_bde_get_keysector(struct g_bde_work *wp) > g_trace(G_T_TOPOLOGY, "g_bde_get_keysector(%p, %jd)", wp, > (intmax_t)offset); > sc = wp->softc; > > - if (malloc_last_fail() < g_bde_ncache) > + if (g_bde_malloc_last_fail() < g_bde_ncache) > g_bde_purge_sector(sc, -1); And in this case, the semantic change renders all of these calls from alway true to always false expression. > > sp = TAILQ_FIRST(&sc->freelist); > @@ -228,7 +242,7 @@ g_bde_get_keysector(struct g_bde_work *wp) > if (sp->ref == 1) > sp->owner = wp; > } else { > - if (malloc_last_fail() < g_bde_ncache) { > + if (g_bde_malloc_last_fail() < g_bde_ncache) { > TAILQ_FOREACH(sp, &sc->freelist, list) > if (sp->ref == 0) > break; > @@ -311,7 +325,7 @@ g_bde_purge_sector(struct g_bde_softc *sc, int fractio > if (fraction > 0) > n = sc->ncache / fraction + 1; > else > - n = g_bde_ncache - malloc_last_fail(); > + n = g_bde_ncache - g_bde_malloc_last_fail(); > if (n < 0) > return; > if (n > sc->ncache) > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Thu Nov 12 22:14:52 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 95F2C46653F; Thu, 12 Nov 2020 22:14:52 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXG9l678Xz4q5T; Thu, 12 Nov 2020 22:14:51 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm1-x334.google.com with SMTP id 10so6550075wml.2; Thu, 12 Nov 2020 14:14:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Soosa3Kxfg5+F5WZhnp6wJJvvWgViW4M8k+Qk1OazP4=; b=XJyAizW+c/0iK13Ysn1noaXF5zjiCDTZNl0oIay0nw705iQRcVH40tBQu+BggOKD/R 5zcsy7V2L4DRk7BtWucpPyRR8mDDUs8diOJ9auDvs749KUsE8Dobs/AsLorB+NlXUgKI HZWKdsfwYOOZSUjtmXSVTkJPLrk7f6VzdSqqE7whZpr5j/mGiX7ecXPA+6VWSpxGu2p5 EbqFLpu1cAMVjxw5XB6hTeGeM1hcKcjjNDrf2mhR0f9VpzGiudXD3REiXMWVvq5NHnCV 9+zOgmlfanHzUOP0nP8keDp3B3s1D0w/sXhvecEbPq8BKTf+PPe12nUmF36aIVNPYEXW OUFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Soosa3Kxfg5+F5WZhnp6wJJvvWgViW4M8k+Qk1OazP4=; b=TOv5IljERDntUMm5/Y1Ro7VYk349fMognYTerPyuMtrtgnJBNkjblhR29eew8cZWms cn6UXDdNIZP5OIuUV69cSgNV0E4S6FKjyewsY4GqG04kNXesZ0IepmfQ8yjx6p5t6Wpa eZjKGEjTmc0CnPE9ZxRCEU7FNWOsxyyMi0PHGkaFCBypZvRI3zW1yVXXrT6k2MQAKsep /H0E2BgmMp9sGfCbkSOz2D9kXB9RPUhpPvhPEARNRyJ528t2AmhcZmf7L27VhruWEov+ S2DxoJEvqMh0N+RBaTMgeK+cCBto15TmtBu7PPlg1WdBlZ6XHtIAjjo+UKL7Yw+j6/c2 7Rrw== X-Gm-Message-State: AOAM532mngVd1BydogwrITxeGNsx1FdJmcIBuQon2wR7Y0I09tlqCia1 tUT5G0WAoTgNW28kvFEVKwLKBetdJ9MVXPoXFFw= X-Google-Smtp-Source: ABdhPJzZsP7DwKAbSxD1Qg1raIRG9kkQ61UjAgAwRhVNnxhHXfmR5r2UbAv41Yj79wlaktK7ZSFVx3zTO73fGZLNx7E= X-Received: by 2002:a1c:e442:: with SMTP id b63mr1878799wmh.10.1605219289770; Thu, 12 Nov 2020 14:14:49 -0800 (PST) MIME-Version: 1.0 Received: by 2002:adf:dec7:0:0:0:0:0 with HTTP; Thu, 12 Nov 2020 14:14:48 -0800 (PST) In-Reply-To: References: <202011122020.0ACKKvFa090942@repo.freebsd.org> From: Mateusz Guzik Date: Thu, 12 Nov 2020 23:14:48 +0100 Message-ID: Subject: Re: svn commit: r367626 - head/sys/geom/bde To: Oliver Pinter Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4CXG9l678Xz4q5T X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=XJyAizW+; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2a00:1450:4864:20::334 as permitted sender) smtp.mailfrom=mjguzik@gmail.com X-Spamd-Result: default: False [-4.00 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[2a00:1450:4864:20::334:from]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-1.00)[-1.000]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; SPAMHAUS_ZRD(0.00)[2a00:1450:4864:20::334:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::334:from]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 12 Nov 2020 22:14:52 -0000 On 11/12/20, Oliver Pinter wrote: > On Thursday, November 12, 2020, Mateusz Guzik wrote: > >> Author: mjg >> Date: Thu Nov 12 20:20:57 2020 >> New Revision: 367626 >> URL: https://svnweb.freebsd.org/changeset/base/367626 >> >> Log: >> gbde: replace malloc_last_fail with a kludge >> >> This facilitates removal of malloc_last_fail without really impacting >> anything. >> >> Modified: >> head/sys/geom/bde/g_bde_work.c >> >> Modified: head/sys/geom/bde/g_bde_work.c >> ============================================================ >> ================== >> --- head/sys/geom/bde/g_bde_work.c Thu Nov 12 20:20:43 2020 >> (r367625) >> +++ head/sys/geom/bde/g_bde_work.c Thu Nov 12 20:20:57 2020 >> (r367626) >> @@ -77,6 +77,20 @@ >> #include >> #include >> >> +/* >> + * FIXME: This used to call malloc_last_fail which in practice was >> almost >> + * guaranteed to return time_uptime even in face of severe memory >> shortage. >> + * As GBDE is the only consumer the kludge below was added to facilitate >> the >> + * removal with minimial changes. The code should be fixed to respond to >> memory >> + * pressure (e.g., by using lowmem eventhandler) instead. >> + */ >> +static int >> +g_bde_malloc_last_fail(void) >> +{ >> + >> + return (time_uptime); >> +} >> + > > > Previously malloc_last_fail returned a relatively small number - if i read > the code correctly: > > -int > -malloc_last_fail(void) > -{ > - > - return (time_uptime - t_malloc_fail); > -} > - > > >> static void g_bde_delete_sector(struct g_bde_softc *wp, struct >> g_bde_sector *sp); >> static struct g_bde_sector * g_bde_new_sector(struct g_bde_work *wp, >> u_int len); >> static void g_bde_release_keysector(struct g_bde_work *wp); >> @@ -210,7 +224,7 @@ g_bde_get_keysector(struct g_bde_work *wp) >> g_trace(G_T_TOPOLOGY, "g_bde_get_keysector(%p, %jd)", wp, >> (intmax_t)offset); >> sc = wp->softc; >> >> - if (malloc_last_fail() < g_bde_ncache) >> + if (g_bde_malloc_last_fail() < g_bde_ncache) >> g_bde_purge_sector(sc, -1); > > > And in this case, the semantic change renders all of these calls from alway > true to always false expression. > t_malloc_fail value was almost guaranteed to always be 0, so there is no actual change. The hack was put in place so that gbde does not stall work on malloc. gbde itself definitely needs love. > >> >> sp = TAILQ_FIRST(&sc->freelist); >> @@ -228,7 +242,7 @@ g_bde_get_keysector(struct g_bde_work *wp) >> if (sp->ref == 1) >> sp->owner = wp; >> } else { >> - if (malloc_last_fail() < g_bde_ncache) { >> + if (g_bde_malloc_last_fail() < g_bde_ncache) { >> TAILQ_FOREACH(sp, &sc->freelist, list) >> if (sp->ref == 0) >> break; >> @@ -311,7 +325,7 @@ g_bde_purge_sector(struct g_bde_softc *sc, int >> fractio >> if (fraction > 0) >> n = sc->ncache / fraction + 1; >> else >> - n = g_bde_ncache - malloc_last_fail(); >> + n = g_bde_ncache - g_bde_malloc_last_fail(); >> if (n < 0) >> return; >> if (n > sc->ncache) >> _______________________________________________ >> 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" >> > -- Mateusz Guzik From owner-svn-src-head@freebsd.org Fri Nov 13 01:53:59 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C807B46AD33; Fri, 13 Nov 2020 01:53:59 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXM2b5Hzwz51JN; Fri, 13 Nov 2020 01:53:59 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8343109EE; Fri, 13 Nov 2020 01:53:59 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AD1rxOj000152; Fri, 13 Nov 2020 01:53:59 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AD1rx7m000151; Fri, 13 Nov 2020 01:53:59 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202011130153.0AD1rx7m000151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 13 Nov 2020 01:53:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367629 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 367629 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 13 Nov 2020 01:53:59 -0000 Author: adrian Date: Fri Nov 13 01:53:59 2020 New Revision: 367629 URL: https://svnweb.freebsd.org/changeset/base/367629 Log: [malloc] quieten -Werror=missing-braces with malloc.h wth gcc-6.4 This sets off gcc-6.4 to spit out a 'error: missing braces around initializer' error when compiling this. Remove it as it isn't needed. Reviewed by: brooks Differential Revision: https://reviews.freebsd.org/D27183 Modified: head/sys/sys/malloc.h Modified: head/sys/sys/malloc.h ============================================================================== --- head/sys/sys/malloc.h Thu Nov 12 21:58:47 2020 (r367628) +++ head/sys/sys/malloc.h Fri Nov 13 01:53:59 2020 (r367629) @@ -147,7 +147,6 @@ struct malloc_type_header { .ks_next = NULL, \ .ks_version = M_VERSION, \ .ks_shortdesc = shortdesc, \ - .ks_mti = { 0 }, \ } \ }; \ SYSINIT(type##_init, SI_SUB_KMEM, SI_ORDER_THIRD, malloc_init, \ From owner-svn-src-head@freebsd.org Fri Nov 13 02:05:48 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C5CF146B685; Fri, 13 Nov 2020 02:05:48 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXMJD4vflz52B3; Fri, 13 Nov 2020 02:05:48 +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 9B362107D9; Fri, 13 Nov 2020 02:05:48 +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 0AD25mrV006660; Fri, 13 Nov 2020 02:05:48 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AD25kqZ006647; Fri, 13 Nov 2020 02:05:46 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202011130205.0AD25kqZ006647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2020 02:05:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367630 - in head/sbin/nvmecontrol: . modules/wdc X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head/sbin/nvmecontrol: . modules/wdc X-SVN-Commit-Revision: 367630 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 13 Nov 2020 02:05:48 -0000 Author: mav Date: Fri Nov 13 02:05:45 2020 New Revision: 367630 URL: https://svnweb.freebsd.org/changeset/base/367630 Log: Improve nvmecontrol error reporting. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sbin/nvmecontrol/comnd.c head/sbin/nvmecontrol/devlist.c head/sbin/nvmecontrol/firmware.c head/sbin/nvmecontrol/format.c head/sbin/nvmecontrol/identify.c head/sbin/nvmecontrol/logpage.c head/sbin/nvmecontrol/modules/wdc/wdc.c head/sbin/nvmecontrol/ns.c head/sbin/nvmecontrol/nvmecontrol.c head/sbin/nvmecontrol/nvmecontrol.h head/sbin/nvmecontrol/passthru.c head/sbin/nvmecontrol/perftest.c head/sbin/nvmecontrol/power.c head/sbin/nvmecontrol/reset.c head/sbin/nvmecontrol/resv.c head/sbin/nvmecontrol/sanitize.c Modified: head/sbin/nvmecontrol/comnd.c ============================================================================== --- head/sbin/nvmecontrol/comnd.c Fri Nov 13 01:53:59 2020 (r367629) +++ head/sbin/nvmecontrol/comnd.c Fri Nov 13 02:05:45 2020 (r367630) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "comnd.h" @@ -77,7 +78,7 @@ gen_usage(const struct cmd *t) SLIST_FOREACH(walker, &t->subcmd, link) { print_usage(walker); } - exit(1); + exit(EX_USAGE); } int @@ -158,7 +159,7 @@ arg_help(int argc __unused, char * const *argv, const fprintf(stderr, "%-30.30s - %s\n", buf, opts[i].descr); } } - exit(1); + exit(EX_USAGE); } static int @@ -188,10 +189,10 @@ arg_parse(int argc, char * const * argv, const struct n++; lopts = malloc((n + 2) * sizeof(struct option)); if (lopts == NULL) - err(1, "option memory"); + err(EX_OSERR, "option memory"); p = shortopts = malloc((2 * n + 3) * sizeof(char)); if (shortopts == NULL) - err(1, "shortopts memory"); + err(EX_OSERR, "shortopts memory"); idx = 0; for (i = 0; i < n; i++) { lopts[i].name = opts[i].long_arg; @@ -279,7 +280,7 @@ bad_arg: fprintf(stderr, "Bad value to --%s: %s\n", opts[idx].long_arg, optarg); free(lopts); free(shortopts); - exit(1); + exit(EX_USAGE); } /* @@ -301,7 +302,7 @@ cmd_load_dir(const char *dir __unused, cmd_load_cb_t c continue; asprintf(&path, "%s/%s", dir, dent->d_name); if (path == NULL) - err(1, "Can't malloc for path, giving up."); + err(EX_OSERR, "Can't malloc for path, giving up."); if ((h = dlopen(path, RTLD_NOW | RTLD_GLOBAL)) == NULL) warnx("Can't load %s: %s", path, dlerror()); else { Modified: head/sbin/nvmecontrol/devlist.c ============================================================================== --- head/sbin/nvmecontrol/devlist.c Fri Nov 13 01:53:59 2020 (r367629) +++ head/sbin/nvmecontrol/devlist.c Fri Nov 13 02:05:45 2020 (r367630) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "nvmecontrol.h" @@ -102,12 +103,14 @@ devlist(const struct cmd *f, int argc, char *argv[]) continue; found++; - read_controller_data(fd, &cdata); + if (read_controller_data(fd, &cdata)) + continue; nvme_strvis(mn, cdata.mn, sizeof(mn), NVME_MODEL_NUMBER_LENGTH); printf("%6s: %s\n", name, mn); for (i = 0; i < cdata.nn; i++) { - read_namespace_data(fd, i + 1, &nsdata); + if (read_namespace_data(fd, i + 1, &nsdata)) + continue; if (nsdata.nsze == 0) continue; sprintf(name, "%s%d%s%d", NVME_CTRLR_PREFIX, ctrlr, @@ -124,7 +127,7 @@ devlist(const struct cmd *f, int argc, char *argv[]) if (found == 0) { printf("No NVMe controllers found.\n"); - exit(1); + exit(EX_UNAVAILABLE); } exit(0); Modified: head/sbin/nvmecontrol/firmware.c ============================================================================== --- head/sbin/nvmecontrol/firmware.c Fri Nov 13 01:53:59 2020 (r367629) +++ head/sbin/nvmecontrol/firmware.c Fri Nov 13 02:05:45 2020 (r367630) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "nvmecontrol.h" @@ -123,9 +124,9 @@ read_image_file(const char *path, void **buf, int32_t *buf = NULL; if ((fd = open(path, O_RDONLY)) < 0) - err(1, "unable to open '%s'", path); + err(EX_NOINPUT, "unable to open '%s'", path); if (fstat(fd, &sb) < 0) - err(1, "unable to stat '%s'", path); + err(EX_NOINPUT, "unable to stat '%s'", path); /* * The NVMe spec does not explicitly state a maximum firmware image @@ -139,16 +140,16 @@ read_image_file(const char *path, void **buf, int32_t * a bit. */ if (sb.st_size > INT32_MAX) - errx(1, "size of file '%s' is too large (%jd bytes)", + errx(EX_USAGE, "size of file '%s' is too large (%jd bytes)", path, (intmax_t)sb.st_size); filesize = (int32_t)sb.st_size; if ((*buf = malloc(filesize)) == NULL) - errx(1, "unable to malloc %d bytes", filesize); + errx(EX_OSERR, "unable to malloc %d bytes", filesize); if ((*size = read(fd, *buf, filesize)) < 0) - err(1, "error reading '%s'", path); + err(EX_IOERR, "error reading '%s'", path); /* XXX assuming no short reads */ if (*size != filesize) - errx(1, + errx(EX_IOERR, "error reading '%s' (read %d bytes, requested %d bytes)", path, *size, filesize); close(fd); @@ -168,12 +169,12 @@ update_firmware(int fd, uint8_t *payload, int32_t payl if (fwug != 0 && fwug != 0xFF) max_xfer_size = ((uint64_t)fwug << 12); else if (ioctl(fd, NVME_GET_MAX_XFER_SIZE, &max_xfer_size) < 0) - err(1, "query max transfer size failed"); + err(EX_IOERR, "query max transfer size failed"); if (max_xfer_size > NVME_MAX_XFER_SIZE) max_xfer_size = NVME_MAX_XFER_SIZE; if ((chunk = aligned_alloc(PAGE_SIZE, max_xfer_size)) == NULL) - errx(1, "unable to malloc %zd bytes", (size_t)max_xfer_size); + errx(EX_OSERR, "unable to malloc %zd bytes", (size_t)max_xfer_size); while (resid > 0) { size = (resid >= (int32_t)max_xfer_size) ? @@ -189,10 +190,10 @@ update_firmware(int fd, uint8_t *payload, int32_t payl pt.is_read = 0; if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) - err(1, "firmware download request failed"); + err(EX_IOERR, "firmware download request failed"); if (nvme_completion_is_error(&pt.cpl)) - errx(1, "firmware download request returned error"); + errx(EX_IOERR, "firmware download request returned error"); resid -= size; off += size; @@ -212,7 +213,7 @@ activate_firmware(int fd, int slot, int activate_actio pt.is_read = 0; if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) - err(1, "firmware activate request failed"); + err(EX_IOERR, "firmware activate request failed"); sct = NVME_STATUS_GET_SCT(pt.cpl.status); sc = NVME_STATUS_GET_SC(pt.cpl.status); @@ -222,7 +223,7 @@ activate_firmware(int fd, int slot, int activate_actio return 1; if (nvme_completion_is_error(&pt.cpl)) - errx(1, "firmware activate request returned error"); + errx(EX_IOERR, "firmware activate request returned error"); return 0; } @@ -278,32 +279,33 @@ firmware(const struct cmd *f, int argc, char *argv[]) } free(path); - read_controller_data(fd, &cdata); + if (read_controller_data(fd, &cdata)) + errx(EX_IOERR, "Identify request failed"); oacs_fw = (cdata.oacs >> NVME_CTRLR_DATA_OACS_FIRMWARE_SHIFT) & NVME_CTRLR_DATA_OACS_FIRMWARE_MASK; if (oacs_fw == 0) - errx(1, + errx(EX_UNAVAILABLE, "controller does not support firmware activate/download"); fw_slot1_ro = (cdata.frmw >> NVME_CTRLR_DATA_FRMW_SLOT1_RO_SHIFT) & NVME_CTRLR_DATA_FRMW_SLOT1_RO_MASK; if (opt.fw_img && opt.slot == 1 && fw_slot1_ro) - errx(1, "slot %d is marked as read only", opt.slot); + errx(EX_UNAVAILABLE, "slot %d is marked as read only", opt.slot); fw_num_slots = (cdata.frmw >> NVME_CTRLR_DATA_FRMW_NUM_SLOTS_SHIFT) & NVME_CTRLR_DATA_FRMW_NUM_SLOTS_MASK; if (opt.slot > fw_num_slots) - errx(1, + errx(EX_UNAVAILABLE, "slot %d specified but controller only supports %d slots", opt.slot, fw_num_slots); if (opt.activate && opt.fw_img == NULL && !slot_has_valid_firmware(fd, opt.slot)) - errx(1, + errx(EX_UNAVAILABLE, "slot %d does not contain valid firmware,\n" "try 'nvmecontrol logpage -p 3 %s' to get a list " "of available images\n", @@ -336,7 +338,7 @@ firmware(const struct cmd *f, int argc, char *argv[]) if (strncasecmp(prompt, "yes", 3) == 0) break; if (strncasecmp(prompt, "no", 2) == 0) - exit(1); + exit(EX_DATAERR); printf("Please answer \"yes\" or \"no\". "); } Modified: head/sbin/nvmecontrol/format.c ============================================================================== --- head/sbin/nvmecontrol/format.c Fri Nov 13 01:53:59 2020 (r367629) +++ head/sbin/nvmecontrol/format.c Fri Nov 13 02:05:45 2020 (r367630) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "nvmecontrol.h" @@ -159,29 +160,31 @@ format(const struct cmd *f, int argc, char *argv[]) free(path); /* Check that controller can execute this command. */ - read_controller_data(fd, &cd); + if (read_controller_data(fd, &cd)) + errx(EX_IOERR, "Identify request failed"); if (((cd.oacs >> NVME_CTRLR_DATA_OACS_FORMAT_SHIFT) & NVME_CTRLR_DATA_OACS_FORMAT_MASK) == 0) - errx(1, "controller does not support format"); + errx(EX_UNAVAILABLE, "controller does not support format"); if (((cd.fna >> NVME_CTRLR_DATA_FNA_CRYPTO_ERASE_SHIFT) & NVME_CTRLR_DATA_FNA_CRYPTO_ERASE_MASK) == 0 && ses == SES_CRYPTO) - errx(1, "controller does not support cryptographic erase"); + errx(EX_UNAVAILABLE, "controller does not support cryptographic erase"); if (nsid != NVME_GLOBAL_NAMESPACE_TAG) { if (((cd.fna >> NVME_CTRLR_DATA_FNA_FORMAT_ALL_SHIFT) & NVME_CTRLR_DATA_FNA_FORMAT_ALL_MASK) && ses == SES_NONE) - errx(1, "controller does not support per-NS format"); + errx(EX_UNAVAILABLE, "controller does not support per-NS format"); if (((cd.fna >> NVME_CTRLR_DATA_FNA_ERASE_ALL_SHIFT) & NVME_CTRLR_DATA_FNA_ERASE_ALL_MASK) && ses != SES_NONE) - errx(1, "controller does not support per-NS erase"); + errx(EX_UNAVAILABLE, "controller does not support per-NS erase"); /* Try to keep previous namespace parameters. */ - read_namespace_data(fd, nsid, &nsd); + if (read_namespace_data(fd, nsid, &nsd)) + errx(EX_IOERR, "Identify request failed"); if (lbaf < 0) lbaf = (nsd.flbas >> NVME_NS_DATA_FLBAS_FORMAT_SHIFT) & NVME_NS_DATA_FLBAS_FORMAT_MASK; if (lbaf > nsd.nlbaf) - errx(1, "LBA format is out of range"); + errx(EX_USAGE, "LBA format is out of range"); if (ms < 0) ms = (nsd.flbas >> NVME_NS_DATA_FLBAS_EXTENDED_SHIFT) & NVME_NS_DATA_FLBAS_EXTENDED_MASK; @@ -211,10 +214,10 @@ format(const struct cmd *f, int argc, char *argv[]) (ms << 4) + lbaf); if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) - err(1, "format request failed"); + err(EX_IOERR, "format request failed"); if (nvme_completion_is_error(&pt.cpl)) - errx(1, "format request returned error"); + errx(EX_IOERR, "format request returned error"); close(fd); exit(0); } Modified: head/sbin/nvmecontrol/identify.c ============================================================================== --- head/sbin/nvmecontrol/identify.c Fri Nov 13 01:53:59 2020 (r367629) +++ head/sbin/nvmecontrol/identify.c Fri Nov 13 02:05:45 2020 (r367630) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "nvmecontrol.h" @@ -191,7 +192,8 @@ identify_ctrlr(int fd) struct nvme_controller_data cdata; int hexlength; - read_controller_data(fd, &cdata); + if (read_controller_data(fd, &cdata)) + errx(EX_IOERR, "Identify request failed"); close(fd); if (opt.hex) { @@ -214,7 +216,8 @@ identify_ns(int fd, uint32_t nsid) struct nvme_namespace_data nsdata; int hexlength; - read_namespace_data(fd, nsid, &nsdata); + if (read_namespace_data(fd, nsid, &nsdata)) + errx(EX_IOERR, "Identify request failed"); close(fd); if (opt.hex) { Modified: head/sbin/nvmecontrol/logpage.c ============================================================================== --- head/sbin/nvmecontrol/logpage.c Fri Nov 13 01:53:59 2020 (r367629) +++ head/sbin/nvmecontrol/logpage.c Fri Nov 13 02:05:45 2020 (r367630) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -183,7 +184,7 @@ get_log_buffer(uint32_t size) void *buf; if ((buf = malloc(size)) == NULL) - errx(1, "unable to malloc %u bytes", size); + errx(EX_OSERR, "unable to malloc %u bytes", size); memset(buf, 0, size); return (buf); @@ -217,7 +218,7 @@ read_logpage(int fd, uint8_t log_page, uint32_t nsid, pt.is_read = 1; if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) - err(1, "get log page request failed"); + err(EX_IOERR, "get log page request failed"); /* Convert data to host endian */ switch (log_page) { @@ -259,7 +260,7 @@ read_logpage(int fd, uint8_t log_page, uint32_t nsid, } if (nvme_completion_is_error(&pt.cpl)) - errx(1, "get log page request returned error"); + errx(EX_IOERR, "get log page request returned error"); } static void @@ -659,7 +660,7 @@ logpage_help(void) fprintf(stderr, "0x%02x %-10s %s\n", f->log_page, v, f->name); } - exit(1); + exit(EX_USAGE); } static void @@ -697,7 +698,8 @@ logpage(const struct cmd *f, int argc, char *argv[]) } free(path); - read_controller_data(fd, &cdata); + if (read_controller_data(fd, &cdata)) + errx(EX_IOERR, "Identify request failed"); ns_smart = (cdata.lpa >> NVME_CTRLR_DATA_LPA_NS_SMART_SHIFT) & NVME_CTRLR_DATA_LPA_NS_SMART_MASK; @@ -709,10 +711,10 @@ logpage(const struct cmd *f, int argc, char *argv[]) */ if (nsid != NVME_GLOBAL_NAMESPACE_TAG) { if (opt.page != NVME_LOG_HEALTH_INFORMATION) - errx(1, "log page %d valid only at controller level", + errx(EX_USAGE, "log page %d valid only at controller level", opt.page); if (ns_smart == 0) - errx(1, + errx(EX_UNAVAILABLE, "controller does not support per namespace " "smart/health information"); } Modified: head/sbin/nvmecontrol/modules/wdc/wdc.c ============================================================================== --- head/sbin/nvmecontrol/modules/wdc/wdc.c Fri Nov 13 01:53:59 2020 (r367629) +++ head/sbin/nvmecontrol/modules/wdc/wdc.c Fri Nov 13 02:05:45 2020 (r367630) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -123,7 +124,8 @@ wdc_append_serial_name(int fd, char *buf, size_t len, len -= strlen(buf); buf += strlen(buf); - read_controller_data(fd, &cdata); + if (read_controller_data(fd, &cdata)) + errx(EX_IOERR, "Identify request failed"); memcpy(sn, cdata.sn, NVME_SERIAL_NUMBER_LENGTH); walker = sn + NVME_SERIAL_NUMBER_LENGTH - 1; while (walker > sn && *walker == ' ') @@ -151,9 +153,9 @@ wdc_get_data(int fd, uint32_t opcode, uint32_t len, ui pt.is_read = 1; if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) - err(1, "wdc_get_data request failed"); + err(EX_IOERR, "wdc_get_data request failed"); if (nvme_completion_is_error(&pt.cpl)) - errx(1, "wdc_get_data request returned error"); + errx(EX_IOERR, "wdc_get_data request returned error"); } static void @@ -174,7 +176,7 @@ wdc_do_dump_e6(int fd, char *tmpl, const char *suffix, offset = 0; hdr = malloc(len); if (hdr == NULL) - errx(1, "Can't get buffer to read dump"); + errx(EX_OSERR, "Can't get buffer to read dump"); wdc_get_data(fd, opcode, len, offset, cmd, hdr, len, false); if (memcmp("E6LG", hdr, 4) == 0) { e6lg_flag = true; @@ -183,10 +185,10 @@ wdc_do_dump_e6(int fd, char *tmpl, const char *suffix, /* XXX overwrite protection? */ fd2 = open(tmpl, O_WRONLY | O_CREAT | O_TRUNC, 0644); if (fd2 < 0) - err(1, "open %s", tmpl); + err(EX_CANTCREAT, "open %s", tmpl); buf = aligned_alloc(PAGE_SIZE, NVME_MAX_XFER_SIZE); if (buf == NULL) - errx(1, "Can't get buffer to read dump"); + errx(EX_OSERR, "Can't get buffer to read dump"); offset = 0; len = NVME_MAX_XFER_SIZE; first = 1; @@ -198,7 +200,7 @@ wdc_do_dump_e6(int fd, char *tmpl, const char *suffix, if (first) { len = be32dec(buf + len_off); if (len == 0) - errx(1, "No data for %s", suffix); + errx(EX_PROTOCOL, "No data for %s", suffix); printf("Dumping %d bytes of version %d.%d log to %s\n", len, buf[8], buf[9], tmpl); @@ -212,7 +214,7 @@ wdc_do_dump_e6(int fd, char *tmpl, const char *suffix, first = 0; } if (write(fd2, buf, resid) != (ssize_t)resid) - err(1, "write"); + err(EX_IOERR, "write"); offset += resid; len -= resid; } while (len > 0); @@ -238,9 +240,9 @@ wdc_get_data_dui(int fd, uint32_t opcode, uint32_t len pt.is_read = 1; if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) - err(1, "wdc_get_data_dui request failed"); + err(EX_IOERR, "wdc_get_data_dui request failed"); if (nvme_completion_is_error(&pt.cpl)) - errx(1, "wdc_get_data_dui request returned error"); + errx(EX_IOERR, "wdc_get_data_dui request returned error"); } static uint8_t @@ -274,7 +276,7 @@ wdc_get_dui_log_size(int fd, uint32_t opcode, uint8_t len = 1024; hdr = (uint8_t*)malloc(len); if (hdr == NULL) - errx(1, "Can't get buffer to read header"); + errx(EX_OSERR, "Can't get buffer to read header"); wdc_get_data_dui(fd, opcode, len, 0, hdr, len); hdr += len_off; @@ -307,7 +309,7 @@ wdc_get_dui_log_size(int fd, uint32_t opcode, uint8_t } } else - errx(1, "ERROR : No valid header "); + errx(EX_PROTOCOL, "ERROR : No valid header "); *log_size = dui_size; free(hdr); @@ -326,13 +328,13 @@ wdc_do_dump_dui(int fd, char *tmpl, uint8_t data_area, wdc_append_serial_name(fd, tmpl, MAXPATHLEN, suffix); wdc_get_dui_log_size(fd, opcode, data_area, &log_len, len_off); if (log_len == 0) - errx(1, "No data for %s", suffix); + errx(EX_PROTOCOL, "No data for %s", suffix); fd2 = open(tmpl, O_WRONLY | O_CREAT | O_TRUNC, 0644); if (fd2 < 0) - err(1, "open %s", tmpl); + err(EX_CANTCREAT, "open %s", tmpl); buf = aligned_alloc(PAGE_SIZE, NVME_MAX_XFER_SIZE); if (buf == NULL) - errx(1, "Can't get buffer to read dump"); + errx(EX_OSERR, "Can't get buffer to read dump"); offset = 0; first = 1; @@ -347,7 +349,7 @@ wdc_do_dump_dui(int fd, char *tmpl, uint8_t data_area, first = 0; } if (write(fd2, buf, resid) != (ssize_t)resid) - err(1, "write"); + err(EX_IOERR, "write"); offset += resid; log_len -= resid; } @@ -376,7 +378,8 @@ wdc_cap_diag(const struct cmd *f, int argc, char *argv } strlcpy(tmpl, opt.template, sizeof(tmpl)); open_dev(opt.dev, &fd, 1, 1); - read_controller_data(fd, &cdata); + if (read_controller_data(fd, &cdata)) + errx(EX_IOERR, "Identify request failed"); vid = cdata.vid; switch (vid) { @@ -390,11 +393,10 @@ wdc_cap_diag(const struct cmd *f, int argc, char *argv WDC_NVME_CAP_DIAG_OPCODE_FA, 512); break; default: - errx(1, "ERROR : WDC: unsupported device (%#x) for this command", vid); + errx(EX_UNAVAILABLE, "ERROR : WDC: unsupported device (%#x) for this command", vid); } close(fd); - - exit(1); + exit(0); } static void Modified: head/sbin/nvmecontrol/ns.c ============================================================================== --- head/sbin/nvmecontrol/ns.c Fri Nov 13 01:53:59 2020 (r367629) +++ head/sbin/nvmecontrol/ns.c Fri Nov 13 02:05:45 2020 (r367630) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "nvmecontrol.h" @@ -414,12 +415,13 @@ nsactive(const struct cmd *f, int argc, char *argv[]) open_dev(path, &fd, 0, 1); } free(path); - read_controller_data(fd, &cd); + if (read_controller_data(fd, &cd)) + errx(EX_IOERR, "Identify request failed"); /* Check that controller can execute this command. */ if (((cd.oacs >> NVME_CTRLR_DATA_OACS_NSMGMT_SHIFT) & NVME_CTRLR_DATA_OACS_NSMGMT_MASK) == 0) - errx(1, "controller does not support namespace management"); + errx(EX_UNAVAILABLE, "controller does not support namespace management"); memset(&pt, 0, sizeof(pt)); pt.cmd.opc = NVME_OPC_IDENTIFY; @@ -429,9 +431,9 @@ nsactive(const struct cmd *f, int argc, char *argv[]) pt.len = sizeof(list); pt.is_read = 1; if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) - err(1, "identify request failed"); + err(EX_IOERR, "identify request failed"); if (nvme_completion_is_error(&pt.cpl)) - errx(1, "identify request returned error"); + errx(EX_IOERR, "identify request returned error"); printf("Active namespaces:\n"); for (i = 0; list[i] != 0; i++) @@ -459,12 +461,13 @@ nsallocated(const struct cmd *f, int argc, char *argv[ open_dev(path, &fd, 0, 1); } free(path); - read_controller_data(fd, &cd); + if (read_controller_data(fd, &cd)) + errx(EX_IOERR, "Identify request failed"); /* Check that controller can execute this command. */ if (((cd.oacs >> NVME_CTRLR_DATA_OACS_NSMGMT_SHIFT) & NVME_CTRLR_DATA_OACS_NSMGMT_MASK) == 0) - errx(1, "controller does not support namespace management"); + errx(EX_UNAVAILABLE, "controller does not support namespace management"); memset(&pt, 0, sizeof(pt)); pt.cmd.opc = NVME_OPC_IDENTIFY; @@ -474,9 +477,9 @@ nsallocated(const struct cmd *f, int argc, char *argv[ pt.len = sizeof(list); pt.is_read = 1; if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) - err(1, "identify request failed"); + err(EX_IOERR, "identify request failed"); if (nvme_completion_is_error(&pt.cpl)) - errx(1, "identify request returned error"); + errx(EX_IOERR, "identify request returned error"); printf("Allocated namespaces:\n"); for (i = 0; list[i] != 0; i++) @@ -504,12 +507,13 @@ nscontrollers(const struct cmd *f, int argc, char *arg open_dev(path, &fd, 0, 1); } free(path); - read_controller_data(fd, &cd); + if (read_controller_data(fd, &cd)) + errx(EX_IOERR, "Identify request failed"); /* Check that controller can execute this command. */ if (((cd.oacs >> NVME_CTRLR_DATA_OACS_NSMGMT_SHIFT) & NVME_CTRLR_DATA_OACS_NSMGMT_MASK) == 0) - errx(1, "controller does not support namespace management"); + errx(EX_UNAVAILABLE, "controller does not support namespace management"); memset(&pt, 0, sizeof(pt)); pt.cmd.opc = NVME_OPC_IDENTIFY; @@ -518,9 +522,9 @@ nscontrollers(const struct cmd *f, int argc, char *arg pt.len = sizeof(clist); pt.is_read = 1; if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) - err(1, "identify request failed"); + err(EX_IOERR, "identify request failed"); if (nvme_completion_is_error(&pt.cpl)) - errx(1, "identify request returned error"); + errx(EX_IOERR, "identify request returned error"); n = le16toh(clist[0]); printf("NVM subsystem includes %d controller(s):\n", n); @@ -565,12 +569,13 @@ nscreate(const struct cmd *f, int argc, char *argv[]) open_dev(path, &fd, 1, 1); } free(path); - read_controller_data(fd, &cd); + if (read_controller_data(fd, &cd)) + errx(EX_IOERR, "Identify request failed"); /* Check that controller can execute this command. */ if (((cd.oacs >> NVME_CTRLR_DATA_OACS_NSMGMT_SHIFT) & NVME_CTRLR_DATA_OACS_NSMGMT_MASK) == 0) - errx(1, "controller does not support namespace management"); + errx(EX_UNAVAILABLE, "controller does not support namespace management"); /* Allow namespaces sharing if Multi-Path I/O is supported. */ if (create_opt.nmic == NONE) { @@ -605,10 +610,10 @@ nscreate(const struct cmd *f, int argc, char *argv[]) pt.len = sizeof(struct nvme_namespace_data); pt.is_read = 0; /* passthrough writes data to ctrlr */ if ((result = ioctl(fd, NVME_PASSTHROUGH_CMD, &pt)) < 0) - errx(1, "ioctl request to %s failed: %d", create_opt.dev, result); + errx(EX_IOERR, "ioctl request to %s failed: %d", create_opt.dev, result); if (nvme_completion_is_error(&pt.cpl)) { - errx(1, "namespace creation failed: %s", + errx(EX_IOERR, "namespace creation failed: %s", get_res_str((pt.cpl.status >> NVME_STATUS_SC_SHIFT) & NVME_STATUS_SC_MASK)); } @@ -642,12 +647,13 @@ nsdelete(const struct cmd *f, int argc, char *argv[]) if (delete_opt.nsid != NONE) nsid = delete_opt.nsid; free(path); - read_controller_data(fd, &cd); + if (read_controller_data(fd, &cd)) + errx(EX_IOERR, "Identify request failed"); /* Check that controller can execute this command. */ if (((cd.oacs >> NVME_CTRLR_DATA_OACS_NSMGMT_SHIFT) & NVME_CTRLR_DATA_OACS_NSMGMT_MASK) == 0) - errx(1, "controller does not support namespace management"); + errx(EX_UNAVAILABLE, "controller does not support namespace management"); memset(&pt, 0, sizeof(pt)); pt.cmd.opc = NVME_OPC_NAMESPACE_MANAGEMENT; @@ -658,10 +664,10 @@ nsdelete(const struct cmd *f, int argc, char *argv[]) pt.cmd.nsid = nsid; if ((result = ioctl(fd, NVME_PASSTHROUGH_CMD, &pt)) < 0) - errx(1, "ioctl request to %s failed: %d", delete_opt.dev, result); + errx(EX_IOERR, "ioctl request to %s failed: %d", delete_opt.dev, result); if (nvme_completion_is_error(&pt.cpl)) { - errx(1, "namespace deletion failed: %s", + errx(EX_IOERR, "namespace deletion failed: %s", get_res_str((pt.cpl.status >> NVME_STATUS_SC_SHIFT) & NVME_STATUS_SC_MASK)); } @@ -708,12 +714,13 @@ nsattach(const struct cmd *f, int argc, char *argv[]) } if (attach_opt.nsid != NONE) nsid = attach_opt.nsid; - read_controller_data(fd, &cd); + if (read_controller_data(fd, &cd)) + errx(EX_IOERR, "Identify request failed"); /* Check that controller can execute this command. */ if (((cd.oacs >> NVME_CTRLR_DATA_OACS_NSMGMT_SHIFT) & NVME_CTRLR_DATA_OACS_NSMGMT_MASK) == 0) - errx(1, "controller does not support namespace management"); + errx(EX_UNAVAILABLE, "controller does not support namespace management"); if (attach_opt.ctrlrid == NONE) { /* Get full list of controllers to attach to. */ @@ -724,9 +731,9 @@ nsattach(const struct cmd *f, int argc, char *argv[]) pt.len = sizeof(clist); pt.is_read = 1; if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) - err(1, "identify request failed"); + err(EX_IOERR, "identify request failed"); if (nvme_completion_is_error(&pt.cpl)) - errx(1, "identify request returned error"); + errx(EX_IOERR, "identify request returned error"); } else { /* By default attach to this controller. */ if (attach_opt.ctrlrid == NONE - 1) @@ -744,10 +751,10 @@ nsattach(const struct cmd *f, int argc, char *argv[]) pt.len = sizeof(clist); if ((result = ioctl(fd, NVME_PASSTHROUGH_CMD, &pt)) < 0) - errx(1, "ioctl request to %s failed: %d", attach_opt.dev, result); + errx(EX_IOERR, "ioctl request to %s failed: %d", attach_opt.dev, result); if (nvme_completion_is_error(&pt.cpl)) { - errx(1, "namespace attach failed: %s", + errx(EX_IOERR, "namespace attach failed: %s", get_res_str((pt.cpl.status >> NVME_STATUS_SC_SHIFT) & NVME_STATUS_SC_MASK)); } @@ -779,12 +786,13 @@ nsdetach(const struct cmd *f, int argc, char *argv[]) } if (detach_opt.nsid != NONE) nsid = detach_opt.nsid; - read_controller_data(fd, &cd); + if (read_controller_data(fd, &cd)) + errx(EX_IOERR, "Identify request failed"); /* Check that controller can execute this command. */ if (((cd.oacs >> NVME_CTRLR_DATA_OACS_NSMGMT_SHIFT) & NVME_CTRLR_DATA_OACS_NSMGMT_MASK) == 0) - errx(1, "controller does not support namespace management"); + errx(EX_UNAVAILABLE, "controller does not support namespace management"); if (detach_opt.ctrlrid == NONE) { /* Get list of controllers this namespace attached to. */ @@ -796,9 +804,9 @@ nsdetach(const struct cmd *f, int argc, char *argv[]) pt.len = sizeof(clist); pt.is_read = 1; if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) - err(1, "identify request failed"); + err(EX_IOERR, "identify request failed"); if (nvme_completion_is_error(&pt.cpl)) - errx(1, "identify request returned error"); + errx(EX_IOERR, "identify request returned error"); if (clist[0] == 0) { detach_opt.ctrlrid = cd.ctrlr_id; memset(&clist, 0, sizeof(clist)); @@ -822,10 +830,10 @@ nsdetach(const struct cmd *f, int argc, char *argv[]) pt.len = sizeof(clist); if ((result = ioctl(fd, NVME_PASSTHROUGH_CMD, &pt)) < 0) - errx(1, "ioctl request to %s failed: %d", detach_opt.dev, result); + errx(EX_IOERR, "ioctl request to %s failed: %d", detach_opt.dev, result); if (nvme_completion_is_error(&pt.cpl)) { - errx(1, "namespace detach failed: %s", + errx(EX_IOERR, "namespace detach failed: %s", get_res_str((pt.cpl.status >> NVME_STATUS_SC_SHIFT) & NVME_STATUS_SC_MASK)); } @@ -857,12 +865,13 @@ nsattached(const struct cmd *f, int argc, char *argv[] } if (attached_opt.nsid != NONE) nsid = attached_opt.nsid; - read_controller_data(fd, &cd); + if (read_controller_data(fd, &cd)) + errx(EX_IOERR, "Identify request failed"); /* Check that controller can execute this command. */ if (((cd.oacs >> NVME_CTRLR_DATA_OACS_NSMGMT_SHIFT) & NVME_CTRLR_DATA_OACS_NSMGMT_MASK) == 0) - errx(1, "controller does not support namespace management"); + errx(EX_UNAVAILABLE, "controller does not support namespace management"); memset(&pt, 0, sizeof(pt)); pt.cmd.opc = NVME_OPC_IDENTIFY; @@ -872,9 +881,9 @@ nsattached(const struct cmd *f, int argc, char *argv[] pt.len = sizeof(clist); pt.is_read = 1; if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) - err(1, "identify request failed"); + err(EX_IOERR, "identify request failed"); if (nvme_completion_is_error(&pt.cpl)) - errx(1, "identify request returned error"); + errx(EX_IOERR, "identify request returned error"); n = le16toh(clist[0]); printf("Attached %d controller(s):\n", n); @@ -910,12 +919,13 @@ nsidentify(const struct cmd *f, int argc, char *argv[] } if (identify_opt.nsid != NONE) nsid = identify_opt.nsid; - read_controller_data(fd, &cd); + if (read_controller_data(fd, &cd)) + errx(EX_IOERR, "Identify request failed"); /* Check that controller can execute this command. */ if (((cd.oacs >> NVME_CTRLR_DATA_OACS_NSMGMT_SHIFT) & NVME_CTRLR_DATA_OACS_NSMGMT_MASK) == 0) - errx(1, "controller does not support namespace management"); + errx(EX_UNAVAILABLE, "controller does not support namespace management"); memset(&pt, 0, sizeof(pt)); pt.cmd.opc = NVME_OPC_IDENTIFY; @@ -926,10 +936,10 @@ nsidentify(const struct cmd *f, int argc, char *argv[] pt.is_read = 1; if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) - err(1, "identify request failed"); + err(EX_IOERR, "identify request failed"); if (nvme_completion_is_error(&pt.cpl)) - errx(1, "identify request returned error"); + errx(EX_IOERR, "identify request returned error"); close(fd); @@ -939,7 +949,7 @@ nsidentify(const struct cmd *f, int argc, char *argv[] break; } if (i == sizeof(nsdata)) - errx(1, "namespace %d is not allocated", nsid); + errx(EX_UNAVAILABLE, "namespace %d is not allocated", nsid); /* Convert data to host endian */ nvme_namespace_data_swapbytes(&nsdata); Modified: head/sbin/nvmecontrol/nvmecontrol.c ============================================================================== --- head/sbin/nvmecontrol/nvmecontrol.c Fri Nov 13 01:53:59 2020 (r367629) +++ head/sbin/nvmecontrol/nvmecontrol.c Fri Nov 13 02:05:45 2020 (r367630) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "nvmecontrol.h" @@ -96,7 +97,7 @@ print_hex(void *data, uint32_t length) print_bytes(data, length); } -void +int read_controller_data(int fd, struct nvme_controller_data *cdata) { struct nvme_pt_command pt; @@ -109,16 +110,17 @@ read_controller_data(int fd, struct nvme_controller_da pt.is_read = 1; if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) - err(1, "identify request failed"); + return (errno); /* Convert data to host endian */ nvme_controller_data_swapbytes(cdata); if (nvme_completion_is_error(&pt.cpl)) - errx(1, "identify request returned error"); + return (EIO); + return (0); } -void +int read_namespace_data(int fd, uint32_t nsid, struct nvme_namespace_data *nsdata) { struct nvme_pt_command pt; @@ -132,13 +134,14 @@ read_namespace_data(int fd, uint32_t nsid, struct nvme pt.is_read = 1; if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) - err(1, "identify request failed"); + return (errno); /* Convert data to host endian */ nvme_namespace_data_swapbytes(nsdata); if (nvme_completion_is_error(&pt.cpl)) - errx(1, "identify request returned error"); + return (EIO); + return (0); } int @@ -150,7 +153,7 @@ open_dev(const char *str, int *fd, int write, int exit *fd = open(full_path, write ? O_RDWR : O_RDONLY); if (*fd < 0) { if (exit_on_error) { - err(1, "could not open %s%s", full_path, + err(EX_OSFILE, "could not open %s%s", full_path, write ? " for write" : ""); } else return (errno); @@ -165,7 +168,7 @@ get_nsid(int fd, char **ctrlr_str, uint32_t *nsid) struct nvme_get_nsid gnsid; if (ioctl(fd, NVME_GET_NSID, &gnsid) < 0) - err(1, "NVME_GET_NSID ioctl failed"); + err(EX_OSERR, "NVME_GET_NSID ioctl failed"); if (ctrlr_str != NULL) *ctrlr_str = strndup(gnsid.cdev, sizeof(gnsid.cdev)); if (nsid != NULL) Modified: head/sbin/nvmecontrol/nvmecontrol.h ============================================================================== --- head/sbin/nvmecontrol/nvmecontrol.h Fri Nov 13 01:53:59 2020 (r367629) +++ head/sbin/nvmecontrol/nvmecontrol.h Fri Nov 13 02:05:45 2020 (r367630) @@ -70,8 +70,8 @@ void logpage_register(struct logpage_function *p); int open_dev(const char *str, int *fd, int write, int exit_on_error); void get_nsid(int fd, char **ctrlr_str, uint32_t *nsid); -void read_controller_data(int fd, struct nvme_controller_data *cdata); -void read_namespace_data(int fd, uint32_t nsid, struct nvme_namespace_data *nsdata); +int read_controller_data(int fd, struct nvme_controller_data *cdata); +int read_namespace_data(int fd, uint32_t nsid, struct nvme_namespace_data *nsdata); void print_hex(void *data, uint32_t length); void print_namespace(struct nvme_namespace_data *nsdata); void read_logpage(int fd, uint8_t log_page, uint32_t nsid, uint8_t lsp, Modified: head/sbin/nvmecontrol/passthru.c ============================================================================== --- head/sbin/nvmecontrol/passthru.c Fri Nov 13 01:53:59 2020 (r367629) +++ head/sbin/nvmecontrol/passthru.c Fri Nov 13 02:05:45 2020 (r367630) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "nvmecontrol.h" @@ -167,9 +168,9 @@ passthru(const struct cmd *f, int argc, char *argv[]) open_dev(opt.dev, &fd, 1, 1); if (opt.read && opt.write) - errx(1, "need exactly one of --read or --write"); + errx(EX_USAGE, "need exactly one of --read or --write"); if (opt.data_len != 0 && !opt.read && !opt.write) - errx(1, "need exactly one of --read or --write"); + errx(EX_USAGE, "need exactly one of --read or --write"); if (*opt.ifn && (ifd = open(opt.ifn, O_RDONLY)) == -1) { warn("open %s", opt.ifn); goto cleanup; @@ -183,7 +184,7 @@ passthru(const struct cmd *f, int argc, char *argv[]) } #else if (opt.metadata_len != 0) - errx(1, "metadata not supported on FreeBSD"); + errx(EX_UNAVAILABLE, "metadata not supported on FreeBSD"); #endif if (opt.data_len) { if (posix_memalign(&data, getpagesize(), opt.data_len)) { @@ -244,7 +245,7 @@ passthru(const struct cmd *f, int argc, char *argv[]) errno = 0; if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) - err(1, "passthrough request failed"); + err(EX_IOERR, "passthrough request failed"); /* XXX report status */ if (opt.read) { if (opt.binary) @@ -260,7 +261,7 @@ cleanup: if (ifd > -1) close(ifd); if (errno) - exit(1); + exit(EX_IOERR); } static void Modified: head/sbin/nvmecontrol/perftest.c ============================================================================== --- head/sbin/nvmecontrol/perftest.c Fri Nov 13 01:53:59 2020 (r367629) +++ head/sbin/nvmecontrol/perftest.c Fri Nov 13 02:05:45 2020 (r367630) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "nvmecontrol.h" @@ -180,7 +181,7 @@ perftest(const struct cmd *f, int argc, char *argv[]) io_test.size = opt.size; open_dev(opt.dev, &fd, 1, 1); if (ioctl(fd, ioctl_cmd, &io_test) < 0) - err(1, "ioctl NVME_IO_TEST failed"); + err(EX_IOERR, "ioctl NVME_IO_TEST failed"); close(fd); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Nov 13 09:31:58 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B9E1A2D3CB2; Fri, 13 Nov 2020 09:31:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXYC24qXTz3Q6H; Fri, 13 Nov 2020 09:31:58 +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 9872516319; Fri, 13 Nov 2020 09:31:58 +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 0AD9Vwb3082845; Fri, 13 Nov 2020 09:31:58 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AD9VwBL082843; Fri, 13 Nov 2020 09:31:58 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011130931.0AD9VwBL082843@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 13 Nov 2020 09:31:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367631 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 367631 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 13 Nov 2020 09:31:58 -0000 Author: kib Date: Fri Nov 13 09:31:57 2020 New Revision: 367631 URL: https://svnweb.freebsd.org/changeset/base/367631 Log: Implement vn_lock_pair(). In collaboration with: pho Reviewed by: mckusick (previous version), markj (previous version) Tested by: markj (syzkaller), pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D26136 Modified: head/sys/kern/vfs_vnops.c head/sys/sys/vnode.h Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Fri Nov 13 02:05:45 2020 (r367630) +++ head/sys/kern/vfs_vnops.c Fri Nov 13 09:31:57 2020 (r367631) @@ -70,6 +70,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -275,6 +276,10 @@ restart: vn_finished_write(mp); if (error) { NDFREE(ndp, NDF_ONLY_PNBUF); + if (error == ERELOOKUP) { + NDREINIT(ndp); + goto restart; + } return (error); } fmode &= ~O_TRUNC; @@ -1524,6 +1529,7 @@ vn_truncate(struct file *fp, off_t length, struct ucre vp = fp->f_vnode; +retry: /* * Lock the whole range for truncation. Otherwise split i/o * might happen partly before and partly after the truncation. @@ -1550,6 +1556,8 @@ out: vn_finished_write(mp); out1: vn_rangelock_unlock(vp, rl_cookie); + if (error == ERELOOKUP) + goto retry; return (error); } @@ -3317,4 +3325,92 @@ vn_fallocate(struct file *fp, off_t offset, off_t len, } return (error); +} + +static u_long vn_lock_pair_pause_cnt; +SYSCTL_ULONG(_debug, OID_AUTO, vn_lock_pair_pause, CTLFLAG_RD, + &vn_lock_pair_pause_cnt, 0, + "Count of vn_lock_pair deadlocks"); + +static void +vn_lock_pair_pause(const char *wmesg) +{ + atomic_add_long(&vn_lock_pair_pause_cnt, 1); + pause(wmesg, prng32_bounded(hz / 10)); +} + +/* + * Lock pair of vnodes vp1, vp2, avoiding lock order reversal. + * vp1_locked indicates whether vp1 is exclusively locked; if not, vp1 + * must be unlocked. Same for vp2 and vp2_locked. One of the vnodes + * can be NULL. + * + * The function returns with both vnodes exclusively locked, and + * guarantees that it does not create lock order reversal with other + * threads during its execution. Both vnodes could be unlocked + * temporary (and reclaimed). + */ +void +vn_lock_pair(struct vnode *vp1, bool vp1_locked, struct vnode *vp2, + bool vp2_locked) +{ + int error; + + if (vp1 == NULL && vp2 == NULL) + return; + if (vp1 != NULL) { + if (vp1_locked) + ASSERT_VOP_ELOCKED(vp1, "vp1"); + else + ASSERT_VOP_UNLOCKED(vp1, "vp1"); + } else { + vp1_locked = true; + } + if (vp2 != NULL) { + if (vp2_locked) + ASSERT_VOP_ELOCKED(vp2, "vp2"); + else + ASSERT_VOP_UNLOCKED(vp2, "vp2"); + } else { + vp2_locked = true; + } + if (!vp1_locked && !vp2_locked) { + vn_lock(vp1, LK_EXCLUSIVE | LK_RETRY); + vp1_locked = true; + } + + for (;;) { + if (vp1_locked && vp2_locked) + break; + if (vp1_locked && vp2 != NULL) { + if (vp1 != NULL) { + error = VOP_LOCK1(vp2, LK_EXCLUSIVE | LK_NOWAIT, + __FILE__, __LINE__); + if (error == 0) + break; + VOP_UNLOCK(vp1); + vp1_locked = false; + vn_lock_pair_pause("vlp1"); + } + vn_lock(vp2, LK_EXCLUSIVE | LK_RETRY); + vp2_locked = true; + } + if (vp2_locked && vp1 != NULL) { + if (vp2 != NULL) { + error = VOP_LOCK1(vp1, LK_EXCLUSIVE | LK_NOWAIT, + __FILE__, __LINE__); + if (error == 0) + break; + VOP_UNLOCK(vp2); + vp2_locked = false; + vn_lock_pair_pause("vlp2"); + } + vn_lock(vp1, LK_EXCLUSIVE | LK_RETRY); + vp1_locked = true; + } + } + if (vp1 != NULL) + ASSERT_VOP_ELOCKED(vp1, "vp1 ret"); + if (vp2 != NULL) + ASSERT_VOP_ELOCKED(vp2, "vp2 ret"); } Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Fri Nov 13 02:05:45 2020 (r367630) +++ head/sys/sys/vnode.h Fri Nov 13 09:31:57 2020 (r367631) @@ -729,6 +729,8 @@ bool vn_isdisk_error(struct vnode *vp, int *errp); bool vn_isdisk(struct vnode *vp); int _vn_lock(struct vnode *vp, int flags, const char *file, int line); #define vn_lock(vp, flags) _vn_lock(vp, flags, __FILE__, __LINE__) +void vn_lock_pair(struct vnode *vp1, bool vp1_locked, struct vnode *vp2, + bool vp2_locked); int vn_open(struct nameidata *ndp, int *flagp, int cmode, struct file *fp); int vn_open_cred(struct nameidata *ndp, int *flagp, int cmode, u_int vn_open_flags, struct ucred *cred, struct file *fp); From owner-svn-src-head@freebsd.org Fri Nov 13 09:42:33 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F12652D4F6F; Fri, 13 Nov 2020 09:42:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXYRF6Q39z3gyV; Fri, 13 Nov 2020 09:42:33 +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 CEFD2160D8; Fri, 13 Nov 2020 09:42:33 +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 0AD9gXCL090590; Fri, 13 Nov 2020 09:42:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AD9gWim090587; Fri, 13 Nov 2020 09:42:32 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011130942.0AD9gWim090587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 13 Nov 2020 09:42:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367632 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 367632 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 13 Nov 2020 09:42:34 -0000 Author: kib Date: Fri Nov 13 09:42:32 2020 New Revision: 367632 URL: https://svnweb.freebsd.org/changeset/base/367632 Log: Allow some VOPs to return ERELOOKUP to indicate VFS operation restart at top level. Restart syscalls and some sync operations when filesystem indicated ERELOOKUP condition, mostly for VOPs operating on metdata. In particular, lookup results cached in the inode/v_data is no longer valid and needs recalculating. Right now this should be nop. Assert that ERELOOKUP is catched everywhere and not returned to userspace, by asserting that td_errno != ERELOOKUP on syscall return path. In collaboration with: pho Reviewed by: mckusick (previous version), markj Tested by: markj (syzkaller), pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D26136 Modified: head/sys/kern/subr_syscall.c head/sys/kern/uipc_usrreq.c head/sys/kern/vfs_subr.c head/sys/kern/vfs_syscalls.c Modified: head/sys/kern/subr_syscall.c ============================================================================== --- head/sys/kern/subr_syscall.c Fri Nov 13 09:31:57 2020 (r367631) +++ head/sys/kern/subr_syscall.c Fri Nov 13 09:42:32 2020 (r367632) @@ -217,6 +217,8 @@ syscallret(struct thread *td) KASSERT((td->td_pflags & TDP_FORKING) == 0, ("fork() did not clear TDP_FORKING upon completion")); + KASSERT(td->td_errno != ERELOOKUP, + ("ERELOOKUP not consumed syscall %d", td->td_sa.code)); p = td->td_proc; sa = &td->td_sa; Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Fri Nov 13 09:31:57 2020 (r367631) +++ head/sys/kern/uipc_usrreq.c Fri Nov 13 09:42:32 2020 (r367632) @@ -671,6 +671,8 @@ restart: vput(nd.ni_dvp); if (error) { vn_finished_write(mp); + if (error == ERELOOKUP) + goto restart; goto error; } vp = nd.ni_vp; Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Fri Nov 13 09:31:57 2020 (r367631) +++ head/sys/kern/vfs_subr.c Fri Nov 13 09:42:32 2020 (r367632) @@ -1937,7 +1937,10 @@ bufobj_invalbuf(struct bufobj *bo, int flags, int slpf } if (bo->bo_dirty.bv_cnt > 0) { BO_UNLOCK(bo); - if ((error = BO_SYNC(bo, MNT_WAIT)) != 0) + do { + error = BO_SYNC(bo, MNT_WAIT); + } while (error == ERELOOKUP); + if (error != 0) return (error); /* * XXX We could save a lock/unlock if this was only @@ -3678,7 +3681,9 @@ loop: vm_object_page_clean(vp->v_object, 0, 0, 0); VM_OBJECT_WUNLOCK(vp->v_object); } - error = VOP_FSYNC(vp, MNT_WAIT, td); + do { + error = VOP_FSYNC(vp, MNT_WAIT, td); + } while (error == ERELOOKUP); if (error != 0) { VOP_UNLOCK(vp); vdrop(vp); Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Fri Nov 13 09:31:57 2020 (r367631) +++ head/sys/kern/vfs_syscalls.c Fri Nov 13 09:42:32 2020 (r367632) @@ -1384,6 +1384,8 @@ restart: NDFREE(&nd, NDF_ONLY_PNBUF); vput(nd.ni_dvp); vn_finished_write(mp); + if (error == ERELOOKUP) + goto restart; return (error); } @@ -1470,6 +1472,8 @@ out: vput(nd.ni_dvp); vn_finished_write(mp); NDFREE(&nd, NDF_ONLY_PNBUF); + if (error == ERELOOKUP) + goto restart; return (error); } @@ -1568,7 +1572,7 @@ kern_linkat(struct thread *td, int fd1, int fd2, const return (error); NDFREE(&nd, NDF_ONLY_PNBUF); error = kern_linkat_vp(td, nd.ni_vp, fd2, path2, segflag); - } while (error == EAGAIN); + } while (error == EAGAIN || error == ERELOOKUP); return (error); } @@ -1741,6 +1745,8 @@ out2: NDFREE(&nd, NDF_ONLY_PNBUF); vput(nd.ni_dvp); vn_finished_write(mp); + if (error == ERELOOKUP) + goto restart; out: if (segflg != UIO_SYSSPACE) uma_zfree(namei_zone, tmppath); @@ -1791,6 +1797,8 @@ restart: NDFREE(&nd, NDF_ONLY_PNBUF); vput(nd.ni_dvp); vn_finished_write(mp); + if (error == ERELOOKUP) + goto restart; return (error); } @@ -1937,6 +1945,8 @@ out: vrele(vp); else vput(vp); + if (error == ERELOOKUP) + goto restart; fdout: if (fp != NULL) fdrop(fp, td); @@ -3395,7 +3405,8 @@ kern_truncate(struct thread *td, const char *path, enu int error; if (length < 0) - return(EINVAL); + return (EINVAL); +retry: NDINIT(&nd, LOOKUP, FOLLOW | AUDITVNODE1, pathseg, path, td); if ((error = namei(&nd)) != 0) return (error); @@ -3424,6 +3435,8 @@ kern_truncate(struct thread *td, const char *path, enu vn_finished_write(mp); vn_rangelock_unlock(vp, rl_cookie); vrele(vp); + if (error == ERELOOKUP) + goto retry; return (error); } @@ -3479,6 +3492,7 @@ kern_fsync(struct thread *td, int fd, bool fullsync) if (!fullsync) /* XXXKIB: compete outstanding aio writes */; #endif +retry: error = vn_start_write(vp, &mp, V_WAIT | PCATCH); if (error != 0) goto drop; @@ -3498,6 +3512,8 @@ kern_fsync(struct thread *td, int fd, bool fullsync) error = fullsync ? VOP_FSYNC(vp, MNT_WAIT, td) : VOP_FDATASYNC(vp, td); VOP_UNLOCK(vp); vn_finished_write(mp); + if (error == ERELOOKUP) + goto retry; drop: fdrop(fp, td); return (error); @@ -3679,7 +3695,7 @@ again: * are links to the same vnode), then there is nothing to do. */ if (fvp == tvp) - error = -1; + error = ERESTART; #ifdef MAC else error = mac_vnode_check_rename_to(td->td_ucred, tdvp, @@ -3708,8 +3724,10 @@ out: out1: if (fromnd.ni_startdir) vrele(fromnd.ni_startdir); - if (error == -1) + if (error == ERESTART) return (0); + if (error == ERELOOKUP) + goto again; return (error); } @@ -3803,6 +3821,8 @@ out: if (error == 0) vput(nd.ni_vp); vn_finished_write(mp); + if (error == ERELOOKUP) + goto restart; return (error); } @@ -3903,6 +3923,8 @@ out: vrele(nd.ni_dvp); else vput(nd.ni_dvp); + if (error == ERELOOKUP) + goto restart; fdout: if (fp != NULL) fdrop(fp, td); @@ -4416,7 +4438,8 @@ kern_fhlinkat(struct thread *td, int fd, const char *p if (error != 0) return (error); VOP_UNLOCK(vp); - } while ((error = kern_linkat_vp(td, vp, fd, path, pathseg)) == EAGAIN); + error = kern_linkat_vp(td, vp, fd, path, pathseg); + } while (error == EAGAIN || error == ERELOOKUP); return (error); } From owner-svn-src-head@freebsd.org Fri Nov 13 10:35:05 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4BF5E2D62B3; Fri, 13 Nov 2020 10:35:05 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXZbr31pxz3kXB; Fri, 13 Nov 2020 10:35:04 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 0ADAYnTt003173 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 13 Nov 2020 12:34:52 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 0ADAYnTt003173 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 0ADAYncQ003172; Fri, 13 Nov 2020 12:34:49 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 13 Nov 2020 12:34:49 +0200 From: Konstantin Belousov To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r367631 - in head/sys: kern sys Message-ID: References: <202011130931.0AD9VwBL082843@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202011130931.0AD9VwBL082843@repo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4CXZbr31pxz3kXB X-Spamd-Bar: ++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com X-Spamd-Result: default: False [2.91 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; FREEMAIL_FROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; TO_DN_NONE(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; NEURAL_SPAM_MEDIUM(0.99)[0.992]; SPAMHAUS_ZRD(0.00)[2001:470:d5e7:1::1:from:127.0.2.255]; RBL_DBL_DONT_QUERY_IPS(0.00)[2001:470:d5e7:1::1:from]; NEURAL_SPAM_LONG(1.00)[0.997]; NEURAL_SPAM_SHORT(0.92)[0.919]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; MIME_TRACE(0.00)[0:+]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 13 Nov 2020 10:35:05 -0000 On Fri, Nov 13, 2020 at 09:31:58AM +0000, Konstantin Belousov wrote: > Author: kib > Date: Fri Nov 13 09:31:57 2020 > New Revision: 367631 > URL: https://svnweb.freebsd.org/changeset/base/367631 > > Log: > Implement vn_lock_pair(). > > In collaboration with: pho > Reviewed by: mckusick (previous version), markj (previous version) > Tested by: markj (syzkaller), pho > Sponsored by: The FreeBSD Foundation > Differential revision: https://reviews.freebsd.org/D26136 > > Modified: > head/sys/kern/vfs_vnops.c > head/sys/sys/vnode.h > > Modified: head/sys/kern/vfs_vnops.c > ============================================================================== > --- head/sys/kern/vfs_vnops.c Fri Nov 13 02:05:45 2020 (r367630) > +++ head/sys/kern/vfs_vnops.c Fri Nov 13 09:31:57 2020 (r367631) > @@ -275,6 +276,10 @@ restart: > vn_finished_write(mp); > if (error) { > NDFREE(ndp, NDF_ONLY_PNBUF); > + if (error == ERELOOKUP) { > + NDREINIT(ndp); > + goto restart; > + } > return (error); > } > fmode &= ~O_TRUNC; > @@ -1524,6 +1529,7 @@ vn_truncate(struct file *fp, off_t length, struct ucre > > vp = fp->f_vnode; > > +retry: > /* > * Lock the whole range for truncation. Otherwise split i/o > * might happen partly before and partly after the truncation. > @@ -1550,6 +1556,8 @@ out: > vn_finished_write(mp); > out1: > vn_rangelock_unlock(vp, rl_cookie); > + if (error == ERELOOKUP) > + goto retry; > return (error); > } These chunks really belong to r367632 and not r367631, they leaked there due to my mishandling of the split. I am sorry for that, but I do not think it is reasonable to revert and re-commit. From owner-svn-src-head@freebsd.org Fri Nov 13 13:07:45 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 479792E295E; Fri, 13 Nov 2020 13:07:45 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXf011cY0z3twK; Fri, 13 Nov 2020 13:07:45 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A4A8184F0; Fri, 13 Nov 2020 13:07:45 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ADD7j7e015301; Fri, 13 Nov 2020 13:07:45 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ADD7jTG015300; Fri, 13 Nov 2020 13:07:45 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <202011131307.0ADD7jTG015300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Fri, 13 Nov 2020 13:07:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367635 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: gnn X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 367635 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 13 Nov 2020 13:07:45 -0000 Author: gnn Date: Fri Nov 13 13:07:44 2020 New Revision: 367635 URL: https://svnweb.freebsd.org/changeset/base/367635 Log: Followup pointed out by ae@ Modified: head/sys/netinet/ip_fastfwd.c Modified: head/sys/netinet/ip_fastfwd.c ============================================================================== --- head/sys/netinet/ip_fastfwd.c Fri Nov 13 09:49:22 2020 (r367634) +++ head/sys/netinet/ip_fastfwd.c Fri Nov 13 13:07:44 2020 (r367635) @@ -118,7 +118,11 @@ ip_redir_alloc(struct mbuf *m, struct nhop_object *nh, struct ip *ip, in_addr_t *addr) { struct mbuf *mcopy = m_gethdr(M_NOWAIT, m->m_type); - if (mcopy != NULL && !m_dup_pkthdr(mcopy, m, M_NOWAIT)) { + + if (mcopy == NULL) + return (NULL); + + if (m_dup_pkthdr(mcopy, m, M_NOWAIT) == 0) { /* * It's probably ok if the pkthdr dup fails (because * the deep copy of the tag chain failed), but for now From owner-svn-src-head@freebsd.org Fri Nov 13 13:18:49 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 271082E2EBE; Fri, 13 Nov 2020 13:18:49 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXfDn0Z3Mz3v9j; Fri, 13 Nov 2020 13:18:49 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0199E18D95; Fri, 13 Nov 2020 13:18:49 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ADDIm6d021643; Fri, 13 Nov 2020 13:18:48 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ADDIm6k021642; Fri, 13 Nov 2020 13:18:48 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202011131318.0ADDIm6k021642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Fri, 13 Nov 2020 13:18:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367636 - head X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 367636 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 13 Nov 2020 13:18:49 -0000 Author: arichardson Date: Fri Nov 13 13:18:48 2020 New Revision: 367636 URL: https://svnweb.freebsd.org/changeset/base/367636 Log: Makefile.inc1: remove no-longer required variable This variable is unsed since r364760 but I forgot to delete it in that commit. Reported By: bdrewery Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Nov 13 13:07:44 2020 (r367635) +++ head/Makefile.inc1 Fri Nov 13 13:18:48 2020 (r367636) @@ -2117,11 +2117,6 @@ update: .PHONY # which don't have the APIs required by the targets built in bootstrap-tools, # build-tools or cross-tools. # - -# libnv and libsbuf are requirements for config(8), which is an unconditional -# bootstrap-tool. -_config_deps= lib/libnv lib/libsbuf - legacy: .PHONY .if ${BOOTSTRAPPING} < ${MINIMUM_SUPPORTED_OSREL} && ${BOOTSTRAPPING} != 0 @echo "ERROR: Source upgrades from versions prior to ${MINIMUM_SUPPORTED_REL} are not supported."; \ From owner-svn-src-head@freebsd.org Fri Nov 13 13:47:19 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 224412E3E05; Fri, 13 Nov 2020 13:47:19 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXfsg09Fpz4RSg; Fri, 13 Nov 2020 13:47:19 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB7681936E; Fri, 13 Nov 2020 13:47:18 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ADDlIZX040666; Fri, 13 Nov 2020 13:47:18 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ADDlINZ040665; Fri, 13 Nov 2020 13:47:18 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202011131347.0ADDlINZ040665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Fri, 13 Nov 2020 13:47:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367639 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 367639 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 13 Nov 2020 13:47:19 -0000 Author: 0mp (doc,ports committer) Date: Fri Nov 13 13:47:18 2020 New Revision: 367639 URL: https://svnweb.freebsd.org/changeset/base/367639 Log: Reference setprogname(3) in setproctitle(3) The reference to setproctitle(3) in the setprogname(3) manual is already in place. MFC after: 3 days Modified: head/lib/libc/gen/setproctitle.3 Modified: head/lib/libc/gen/setproctitle.3 ============================================================================== --- head/lib/libc/gen/setproctitle.3 Fri Nov 13 13:38:08 2020 (r367638) +++ head/lib/libc/gen/setproctitle.3 Fri Nov 13 13:47:18 2020 (r367639) @@ -20,7 +20,7 @@ .\" $FreeBSD$ .\" .\" The following requests are required for all man pages. -.Dd July 4, 2018 +.Dd November 13, 2020 .Dt SETPROCTITLE 3 .Os .Sh NAME @@ -69,6 +69,7 @@ setproctitle("talking to %s", inet_ntoa(addr)); .Sh SEE ALSO .Xr ps 1 , .Xr w 1 , +.Xr setprogname 3 , .Xr kvm 3 , .Xr kvm_getargv 3 , .Xr printf 3 From owner-svn-src-head@freebsd.org Fri Nov 13 14:48:37 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CF55C2E4E56; Fri, 13 Nov 2020 14:48:37 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXhDP5LNkz4V5C; Fri, 13 Nov 2020 14:48:37 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA86019C4C; Fri, 13 Nov 2020 14:48:37 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ADEmbTE076967; Fri, 13 Nov 2020 14:48:37 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ADEmbGf076966; Fri, 13 Nov 2020 14:48:37 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202011131448.0ADEmbGf076966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Fri, 13 Nov 2020 14:48:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367640 - head/usr.bin/uname X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/usr.bin/uname X-SVN-Commit-Revision: 367640 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 13 Nov 2020 14:48:37 -0000 Author: 0mp (doc,ports committer) Date: Fri Nov 13 14:48:37 2020 New Revision: 367640 URL: https://svnweb.freebsd.org/changeset/base/367640 Log: Explicitly note in the EXAMPLES section that uname(3) contains more details MFC after: 1 week Modified: head/usr.bin/uname/uname.1 Modified: head/usr.bin/uname/uname.1 ============================================================================== --- head/usr.bin/uname/uname.1 Fri Nov 13 13:47:18 2020 (r367639) +++ head/usr.bin/uname/uname.1 Fri Nov 13 14:48:37 2020 (r367640) @@ -28,7 +28,7 @@ .\" @(#)uname.1 8.3 (Berkeley) 4/8/94 .\" $FreeBSD$ .\" -.Dd August 10, 2020 +.Dd Novermber 13, 2020 .Dt UNAME 1 .Os .Sh NAME @@ -119,6 +119,9 @@ utility (except for .Fl a ) will allow the corresponding data to be set to the contents of the environment variable. +See +.Xr uname 3 +for more information. .Sh EXIT STATUS .Ex -std .Sh EXAMPLES From owner-svn-src-head@freebsd.org Fri Nov 13 14:56:34 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B59902E559B; Fri, 13 Nov 2020 14:56:34 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXhPZ4mDYz4VW5; Fri, 13 Nov 2020 14:56:34 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9639A19A6B; Fri, 13 Nov 2020 14:56:34 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ADEuYmW083256; Fri, 13 Nov 2020 14:56:34 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ADEuYwt083255; Fri, 13 Nov 2020 14:56:34 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202011131456.0ADEuYwt083255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Fri, 13 Nov 2020 14:56:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367641 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 367641 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 13 Nov 2020 14:56:34 -0000 Author: 0mp (doc,ports committer) Date: Fri Nov 13 14:56:34 2020 New Revision: 367641 URL: https://svnweb.freebsd.org/changeset/base/367641 Log: Add a missing Nm macro All functions documented in a manual page should be enumerated with the Nm macros. Modified: head/lib/libc/gen/setproctitle.3 Modified: head/lib/libc/gen/setproctitle.3 ============================================================================== --- head/lib/libc/gen/setproctitle.3 Fri Nov 13 14:48:37 2020 (r367640) +++ head/lib/libc/gen/setproctitle.3 Fri Nov 13 14:56:34 2020 (r367641) @@ -25,6 +25,7 @@ .Os .Sh NAME .Nm setproctitle +.Nm setproctitle_fast .Nd set process title .Sh SYNOPSIS .In sys/types.h From owner-svn-src-head@freebsd.org Fri Nov 13 16:24:54 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 385D42E6D5D; Fri, 13 Nov 2020 16:24:54 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-ot1-f51.google.com (mail-ot1-f51.google.com [209.85.210.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXkMV0M6vz4ZVx; Fri, 13 Nov 2020 16:24:53 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-ot1-f51.google.com with SMTP id n15so9411449otl.8; Fri, 13 Nov 2020 08:24:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=L9Wey0GtLOLu2tJ4CH/c0ALzCICtUfoImGYBuE/sRXA=; b=JoboaOPvzSJ4urvtRk6GsZnRBOJLuO9zeMu2U0CUJrqWKxURKfnb4g/ZZGZ1TdNE0Z k8b3wsAnySJvojEW4FttyyCiNPHwBleOfLFbAcs1PYxS8r7jr/RI8/yxF02w7bAPNM/0 vT/LuHFxUGTTF9PC2zcrXTX+hxS+g5Jv2EKE3jfN/09Jfo27S5JddCWGB4WTSaRfPtzs jFaKopSVkzleMKW1Sk+apGwS6AaC8xNiAj9rdfbRXaNmlYePRSlPEiOGesty8snoQQcW LXX4LwfM1JHFC7C3GDQs6mqwhXVGhLCiEo0vkB/KPiCKjdRg0Nwt8Tpg4WT5Y/Ie3tMo gDOA== X-Gm-Message-State: AOAM532ei33u7kXnt6FfnZlT2NWQhbuTGYkoleXi/ldRrp6NKlsqh8L4 qluQQ0lgFhqvnH3geUoWhhrJ5jOcFDc= X-Google-Smtp-Source: ABdhPJyeeTy3tgZpfrncTEpvz0LQ07o/CNEcArh4q85Sgvm7CEAwgFe9kkiJmuoQhpQ7cfxFosoOiQ== X-Received: by 2002:a05:6830:789:: with SMTP id w9mr2066052ots.243.1605284687507; Fri, 13 Nov 2020 08:24:47 -0800 (PST) Received: from mail-oo1-f52.google.com (mail-oo1-f52.google.com. [209.85.161.52]) by smtp.gmail.com with ESMTPSA id 64sm2043659otq.26.2020.11.13.08.24.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 13 Nov 2020 08:24:47 -0800 (PST) Received: by mail-oo1-f52.google.com with SMTP id c25so2276081ooe.13; Fri, 13 Nov 2020 08:24:47 -0800 (PST) X-Received: by 2002:a4a:9486:: with SMTP id k6mr2090362ooi.85.1605284682065; Fri, 13 Nov 2020 08:24:42 -0800 (PST) MIME-Version: 1.0 References: <202011130931.0AD9VwBL082843@repo.freebsd.org> In-Reply-To: <202011130931.0AD9VwBL082843@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Fri, 13 Nov 2020 08:24:30 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r367631 - in head/sys: kern sys To: Konstantin Belousov Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4CXkMV0M6vz4ZVx X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 13 Nov 2020 16:24:54 -0000 Hi Konstantin, On Fri, Nov 13, 2020 at 1:32 AM Konstantin Belousov wrote: > > Author: kib > Date: Fri Nov 13 09:31:57 2020 > New Revision: 367631 > URL: https://svnweb.freebsd.org/changeset/base/367631 > > Log: > Implement vn_lock_pair(). > > Modified: head/sys/kern/vfs_vnops.c > ============================================================================== > --- head/sys/kern/vfs_vnops.c Fri Nov 13 02:05:45 2020 (r367630) > +++ head/sys/kern/vfs_vnops.c Fri Nov 13 09:31:57 2020 (r367631) > @@ -3317,4 +3325,92 @@ vn_fallocate(struct file *fp, off_t offset, off_t len, > ... > + > +static void > +vn_lock_pair_pause(const char *wmesg) > +{ > + atomic_add_long(&vn_lock_pair_pause_cnt, 1); > + pause(wmesg, prng32_bounded(hz / 10)); > +} This function is called when the try-lock of the second lock in the pair (either order) fails. The back-off period is up to 100ms, expected average 50ms. That seems really high? Separately: prng32_bounded() may return 0, which is transparently converted to the equivalent of 1 by pause_sbt(9). This means a 1 tick pause is marginally more likely than any other possible duration. It probably doesn't matter. Thanks, Conrad > + > +/* > + * Lock pair of vnodes vp1, vp2, avoiding lock order reversal. > + * vp1_locked indicates whether vp1 is exclusively locked; if not, vp1 > + * must be unlocked. Same for vp2 and vp2_locked. One of the vnodes > + * can be NULL. > + * > + * The function returns with both vnodes exclusively locked, and > + * guarantees that it does not create lock order reversal with other > + * threads during its execution. Both vnodes could be unlocked > + * temporary (and reclaimed). > + */ > +void > +vn_lock_pair(struct vnode *vp1, bool vp1_locked, struct vnode *vp2, > + bool vp2_locked) > +{ > + int error; > + > + if (vp1 == NULL && vp2 == NULL) > + return; > + if (vp1 != NULL) { > + if (vp1_locked) > + ASSERT_VOP_ELOCKED(vp1, "vp1"); > + else > + ASSERT_VOP_UNLOCKED(vp1, "vp1"); > + } else { > + vp1_locked = true; > + } > + if (vp2 != NULL) { > + if (vp2_locked) > + ASSERT_VOP_ELOCKED(vp2, "vp2"); > + else > + ASSERT_VOP_UNLOCKED(vp2, "vp2"); > + } else { > + vp2_locked = true; > + } > + if (!vp1_locked && !vp2_locked) { > + vn_lock(vp1, LK_EXCLUSIVE | LK_RETRY); > + vp1_locked = true; > + } > + > + for (;;) { > + if (vp1_locked && vp2_locked) > + break; > + if (vp1_locked && vp2 != NULL) { > + if (vp1 != NULL) { > + error = VOP_LOCK1(vp2, LK_EXCLUSIVE | LK_NOWAIT, > + __FILE__, __LINE__); > + if (error == 0) > + break; > + VOP_UNLOCK(vp1); > + vp1_locked = false; > + vn_lock_pair_pause("vlp1"); (Pause called here and in similar elided case for vp2 -> vp1 below.) > + } > + vn_lock(vp2, LK_EXCLUSIVE | LK_RETRY); > + vp2_locked = true; > + } From owner-svn-src-head@freebsd.org Fri Nov 13 16:47:43 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 145482E75ED; Fri, 13 Nov 2020 16:47:43 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXksq03xQz4c1X; Fri, 13 Nov 2020 16:47:43 +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 E94EB1B258; Fri, 13 Nov 2020 16:47:42 +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 0ADGlgSc051703; Fri, 13 Nov 2020 16:47:42 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ADGlgg7051701; Fri, 13 Nov 2020 16:47:42 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202011131647.0ADGlgg7051701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 13 Nov 2020 16:47:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367642 - head/bin/df X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/bin/df X-SVN-Commit-Revision: 367642 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 13 Nov 2020 16:47:43 -0000 Author: markj Date: Fri Nov 13 16:47:42 2020 New Revision: 367642 URL: https://svnweb.freebsd.org/changeset/base/367642 Log: df: Remove support for mounting devices This was marked deprecated in r329092, over two and a half years ago. This functionality is also buggy per PR 237368. PR: 237368 Reviewed by: brooks, cem, emaste, imp Differential Revision: https://reviews.freebsd.org/D27197 Modified: head/bin/df/Makefile head/bin/df/df.1 head/bin/df/df.c Modified: head/bin/df/Makefile ============================================================================== --- head/bin/df/Makefile Fri Nov 13 14:56:34 2020 (r367641) +++ head/bin/df/Makefile Fri Nov 13 16:47:42 2020 (r367642) @@ -10,9 +10,6 @@ SRCS= df.c vfslist.c CFLAGS+= -I${MOUNT} -CFLAGS+= -DMOUNT_CHAR_DEVS -SRCS+= getmntopts.c - LIBADD= xo util .include Modified: head/bin/df/df.1 ============================================================================== --- head/bin/df/df.1 Fri Nov 13 14:56:34 2020 (r367641) +++ head/bin/df/df.1 Fri Nov 13 16:47:42 2020 (r367642) @@ -48,6 +48,7 @@ The .Nm utility displays statistics about the amount of free disk space on the specified +mounted .Ar file system or on the file system of which .Ar file Modified: head/bin/df/df.c ============================================================================== --- head/bin/df/df.c Fri Nov 13 14:56:34 2020 (r367641) +++ head/bin/df/df.c Fri Nov 13 16:47:42 2020 (r367642) @@ -52,16 +52,10 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef MOUNT_CHAR_DEVS -#include -#endif #include #include #include #include -#ifdef MOUNT_CHAR_DEVS -#include -#endif #include #include #include @@ -106,9 +100,6 @@ imax(int a, int b) static int aflag = 0, cflag, hflag, iflag, kflag, lflag = 0, nflag, Tflag; static int thousands; -#ifdef MOUNT_CHAR_DEVS -static struct ufs_args mdev; -#endif static const struct option long_options[] = { @@ -123,21 +114,11 @@ main(int argc, char *argv[]) struct statfs statfsbuf, totalbuf; struct maxwidths maxwidths; struct statfs *mntbuf; -#ifdef MOUNT_CHAR_DEVS - struct iovec *iov = NULL; -#endif const char *fstype; -#ifdef MOUNT_CHAR_DEVS - char *mntpath; - char errmsg[255] = {0}; -#endif char *mntpt; const char **vfslist; int i, mntsize; int ch, rv; -#ifdef MOUNT_CHAR_DEVS - int iovlen = 0; -#endif fstype = "ufs"; (void)setlocale(LC_ALL, ""); @@ -255,66 +236,15 @@ main(int argc, char *argv[]) continue; } } else if (S_ISCHR(stbuf.st_mode)) { - if ((mntpt = getmntpt(*argv)) == NULL) { -#ifdef MOUNT_CHAR_DEVS - xo_warnx( - "df on unmounted devices is deprecated"); - mdev.fspec = *argv; - mntpath = strdup("/tmp/df.XXXXXX"); - if (mntpath == NULL) { - xo_warn("strdup failed"); - rv = 1; - continue; - } - mntpt = mkdtemp(mntpath); - if (mntpt == NULL) { - xo_warn("mkdtemp(\"%s\") failed", mntpath); - rv = 1; - free(mntpath); - continue; - } - if (iov != NULL) - free_iovec(&iov, &iovlen); - build_iovec_argf(&iov, &iovlen, "fstype", "%s", - fstype); - build_iovec_argf(&iov, &iovlen, "fspath", "%s", - mntpath); - build_iovec_argf(&iov, &iovlen, "from", "%s", - *argv); - build_iovec(&iov, &iovlen, "errmsg", errmsg, - sizeof(errmsg)); - if (nmount(iov, iovlen, - MNT_RDONLY|MNT_NOEXEC) < 0) { - if (errmsg[0]) - xo_warn("%s: %s", *argv, - errmsg); - else - xo_warn("%s", *argv); - rv = 1; - (void)rmdir(mntpt); - free(mntpath); - continue; - } else if (statfs(mntpt, &statfsbuf) == 0) { - statfsbuf.f_mntonname[0] = '\0'; - prtstat(&statfsbuf, &maxwidths); - if (cflag) - addstat(&totalbuf, &statfsbuf); - } else { - xo_warn("%s", *argv); - rv = 1; - } - (void)unmount(mntpt, 0); - (void)rmdir(mntpt); - free(mntpath); - continue; -#else + mntpt = getmntpt(*argv); + if (mntpt == NULL) { xo_warnx("%s: not mounted", *argv); rv = 1; continue; -#endif } - } else + } else { mntpt = *argv; + } /* * Statfs does not take a `wait' flag, so we cannot From owner-svn-src-head@freebsd.org Fri Nov 13 16:49:42 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1A14B2E78C1; Fri, 13 Nov 2020 16:49:42 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXkw60CGdz4c2g; Fri, 13 Nov 2020 16:49:42 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE08D1B440; Fri, 13 Nov 2020 16:49:41 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ADGnf4a051852; Fri, 13 Nov 2020 16:49:41 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ADGnfMd051850; Fri, 13 Nov 2020 16:49:41 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202011131649.0ADGnfMd051850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Fri, 13 Nov 2020 16:49:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367643 - in head: sys/dev/ofw usr.sbin/ofwdump X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: in head: sys/dev/ofw usr.sbin/ofwdump X-SVN-Commit-Revision: 367643 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 13 Nov 2020 16:49:42 -0000 Author: bdragon Date: Fri Nov 13 16:49:41 2020 New Revision: 367643 URL: https://svnweb.freebsd.org/changeset/base/367643 Log: [PowerPC] Allow traversal of oversize OF properties. In standards such as LoPAPR, property names in excess of the usual 31 characters exist. This breaks property traversal. While in IEEE 1275-1994, nextprop is defined explicitly to work with a 32-byte region of memory, using a larger buffer should be fine. There is actually no way to pass a buffer length to the nextprop call in the OF client interface, so SLOF actually just blindly overflows the buffer. So we have to defensively make the buffer larger, to avoid memory corruption when reading out long properties on live OF systems. Note also that on real-mode OF, things are pretty tight because we are allocating against a static bounce buffer in low memory, so we can't just use a huge buffer to work around this without it being wasteful of our limited amount of 32-bit physical memory. This allows a patched ofwdump to operate properly on SLOF (i.e. pseries) systems, as well as any other PowerPC systems with overlength properties. Reviewed by: jhibbits MFC after: 2 weeks Sponsored by: Tag1 Consulting, Inc. Differential Revision: https://reviews.freebsd.org/D26669 Modified: head/sys/dev/ofw/openfirmio.c head/sys/dev/ofw/openfirmio.h head/usr.sbin/ofwdump/ofwdump.c Modified: head/sys/dev/ofw/openfirmio.c ============================================================================== --- head/sys/dev/ofw/openfirmio.c Fri Nov 13 16:47:42 2020 (r367642) +++ head/sys/dev/ofw/openfirmio.c Fri Nov 13 16:49:41 2020 (r367643) @@ -115,7 +115,7 @@ openfirm_ioctl(struct cdev *dev, u_long cmd, caddr_t d phandle_t node; int len, ok, error; char *name, *value; - char newname[32]; + char newname[OFIOCSUGGPROPNAMELEN]; if ((flags & FREAD) == 0) return (EBADF); @@ -222,8 +222,19 @@ openfirm_ioctl(struct cdev *dev, u_long cmd, caddr_t d break; } len = strlen(newname) + 1; - if (len > of->of_buflen) + if (len > of->of_buflen) { + /* + * Passed buffer was insufficient. + * + * Instead of returning an error here, truncate the + * property name to fit the buffer. + * + * This allows us to retain compatibility with old + * tools which always pass a 32 character buffer. + */ len = of->of_buflen; + newname[len - 1] = '\0'; + } else of->of_buflen = len; error = copyout(newname, of->of_buf, len); Modified: head/sys/dev/ofw/openfirmio.h ============================================================================== --- head/sys/dev/ofw/openfirmio.h Fri Nov 13 16:47:42 2020 (r367642) +++ head/sys/dev/ofw/openfirmio.h Fri Nov 13 16:49:41 2020 (r367643) @@ -76,4 +76,18 @@ struct ofiocdesc { /* Maximum accepted value length (maximum of nvramrc property). */ #define OFIOCMAXVALUE 8192 +/* + * While IEEE 1275-1994 states in 3.2.2.1.1 that property names are 1-31 + * printable characters, in practice, this limit has been ignored. + * Noncompliant properties have been codified in standards such as LoPAPR. + * + * This is a suggested buffer length that should be large enough to hold + * any property name currently seen in device trees, without being overly + * wasteful of memory. + * + * If a future version of the Devicetree specification updates the property + * names length requirement, this value will be updated to match. + */ +#define OFIOCSUGGPROPNAMELEN 64 + #endif /* _DEV_OFW_OPENFIRMIO_H_ */ Modified: head/usr.sbin/ofwdump/ofwdump.c ============================================================================== --- head/usr.sbin/ofwdump/ofwdump.c Fri Nov 13 16:47:42 2020 (r367642) +++ head/usr.sbin/ofwdump/ofwdump.c Fri Nov 13 16:49:41 2020 (r367643) @@ -144,7 +144,7 @@ static void ofw_dump_properties(int fd, phandle_t n, int level, int raw, int str) { int nlen; - char prop[32]; + char prop[OFIOCSUGGPROPNAMELEN]; for (nlen = ofw_firstprop(fd, n, prop, sizeof(prop)); nlen != 0; nlen = ofw_nextprop(fd, n, prop, prop, sizeof(prop))) From owner-svn-src-head@freebsd.org Fri Nov 13 16:56:04 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2BF682E7B85; Fri, 13 Nov 2020 16:56:04 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXl3S0Zvjz4cQj; Fri, 13 Nov 2020 16:56:04 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F020D1B0F3; Fri, 13 Nov 2020 16:56:03 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ADGu327057746; Fri, 13 Nov 2020 16:56:03 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ADGu3Vx057745; Fri, 13 Nov 2020 16:56:03 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202011131656.0ADGu3Vx057745@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Fri, 13 Nov 2020 16:56:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367644 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 367644 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 13 Nov 2020 16:56:04 -0000 Author: bdragon Date: Fri Nov 13 16:56:03 2020 New Revision: 367644 URL: https://svnweb.freebsd.org/changeset/base/367644 Log: [PowerPC64LE] Radix MMU fixes for LE. There were many, many endianness fixes needed for Radix MMU. The Radix pagetable is stored in BE (as it is read and written to by the MMU hw), so we need to convert back and forth every time we interact with it when running in LE. With these changes, I can successfully boot with radix enabled on POWER9 hw. Reviewed by: luporl, jhibbits Sponsored by: Tag1 Consulting, Inc. Differential Revision: https://reviews.freebsd.org/D27181 Modified: head/sys/powerpc/aim/mmu_radix.c Modified: head/sys/powerpc/aim/mmu_radix.c ============================================================================== --- head/sys/powerpc/aim/mmu_radix.c Fri Nov 13 16:49:41 2020 (r367643) +++ head/sys/powerpc/aim/mmu_radix.c Fri Nov 13 16:56:03 2020 (r367644) @@ -309,7 +309,7 @@ pmap_l3e_to_pte(pt_entry_t *l3e, vm_offset_t va) pt_entry_t *pte; vm_paddr_t ptepa; - ptepa = (*l3e & NLB_MASK); + ptepa = (be64toh(*l3e) & NLB_MASK); pte = (pt_entry_t *)PHYS_TO_DMAP(ptepa); return (&pte[pmap_pte_index(va)]); } @@ -321,7 +321,7 @@ pmap_l2e_to_l3e(pt_entry_t *l2e, vm_offset_t va) pt_entry_t *l3e; vm_paddr_t l3pa; - l3pa = (*l2e & NLB_MASK); + l3pa = (be64toh(*l2e) & NLB_MASK); l3e = (pml3_entry_t *)PHYS_TO_DMAP(l3pa); return (&l3e[pmap_pml3e_index(va)]); } @@ -333,7 +333,7 @@ pmap_l1e_to_l2e(pt_entry_t *l1e, vm_offset_t va) pt_entry_t *l2e; vm_paddr_t l2pa; - l2pa = (*l1e & NLB_MASK); + l2pa = (be64toh(*l1e) & NLB_MASK); l2e = (pml2_entry_t *)PHYS_TO_DMAP(l2pa); return (&l2e[pmap_pml2e_index(va)]); @@ -352,7 +352,7 @@ pmap_pml2e(pmap_t pmap, vm_offset_t va) pt_entry_t *l1e; l1e = pmap_pml1e(pmap, va); - if (l1e == NULL || (*l1e & RPTE_VALID) == 0) + if (l1e == NULL || (be64toh(*l1e) & RPTE_VALID) == 0) return (NULL); return (pmap_l1e_to_l2e(l1e, va)); } @@ -363,7 +363,7 @@ pmap_pml3e(pmap_t pmap, vm_offset_t va) pt_entry_t *l2e; l2e = pmap_pml2e(pmap, va); - if (l2e == NULL || (*l2e & RPTE_VALID) == 0) + if (l2e == NULL || (be64toh(*l2e) & RPTE_VALID) == 0) return (NULL); return (pmap_l2e_to_l3e(l2e, va)); } @@ -374,7 +374,7 @@ pmap_pte(pmap_t pmap, vm_offset_t va) pt_entry_t *l3e; l3e = pmap_pml3e(pmap, va); - if (l3e == NULL || (*l3e & RPTE_VALID) == 0) + if (l3e == NULL || (be64toh(*l3e) & RPTE_VALID) == 0) return (NULL); return (pmap_l3e_to_pte(l3e, va)); } @@ -819,13 +819,13 @@ pa_cmp(const void *a, const void *b) #define pte_load_clear(ptep) atomic_swap_long(ptep, 0) #define pte_store(ptep, pte) do { \ MPASS((pte) & (RPTE_EAA_R | RPTE_EAA_W | RPTE_EAA_X)); \ - *(u_long *)(ptep) = (u_long)((pte) | PG_V | RPTE_LEAF); \ + *(u_long *)(ptep) = htobe64((u_long)((pte) | PG_V | RPTE_LEAF)); \ } while (0) /* * NB: should only be used for adding directories - not for direct mappings */ #define pde_store(ptep, pa) do { \ - *(u_long *)(ptep) = (u_long)(pa|RPTE_VALID|RPTE_SHIFT); \ + *(u_long *)(ptep) = htobe64((u_long)(pa|RPTE_VALID|RPTE_SHIFT)); \ } while (0) #define pte_clear(ptep) do { \ @@ -885,7 +885,7 @@ kvtopte(vm_offset_t va) pt_entry_t *l3e; l3e = pmap_pml3e(kernel_pmap, va); - if ((*l3e & RPTE_VALID) == 0) + if ((be64toh(*l3e) & RPTE_VALID) == 0) return (NULL); return (pmap_l3e_to_pte(l3e, va)); } @@ -897,8 +897,8 @@ mmu_radix_kenter(vm_offset_t va, vm_paddr_t pa) pte = kvtopte(va); MPASS(pte != NULL); - *pte = pa | RPTE_VALID | RPTE_LEAF | RPTE_EAA_R | RPTE_EAA_W | \ - RPTE_EAA_P | PG_M | PG_A; + *pte = htobe64(pa | RPTE_VALID | RPTE_LEAF | RPTE_EAA_R | \ + RPTE_EAA_W | RPTE_EAA_P | PG_M | PG_A); } bool @@ -915,17 +915,17 @@ pmap_nofault_pte(pmap_t pmap, vm_offset_t va, int *is_ va &= PG_PS_FRAME; l3e = pmap_pml3e(pmap, va); - if (l3e == NULL || (*l3e & PG_V) == 0) + if (l3e == NULL || (be64toh(*l3e) & PG_V) == 0) return (NULL); - if (*l3e & RPTE_LEAF) { + if (be64toh(*l3e) & RPTE_LEAF) { *is_l3e = 1; return (l3e); } *is_l3e = 0; va &= PG_FRAME; pte = pmap_l3e_to_pte(l3e, va); - if (pte == NULL || (*pte & PG_V) == 0) + if (pte == NULL || (be64toh(*pte) & PG_V) == 0) return (NULL); return (pte); } @@ -942,7 +942,7 @@ pmap_nofault(pmap_t pmap, vm_offset_t va, vm_prot_t fl retry: if ((pte = pmap_nofault_pte(pmap, va, &is_l3e)) == NULL) return (KERN_INVALID_ADDRESS); - origpte = newpte = *pte; + origpte = newpte = be64toh(*pte); if (startpte == 0) { startpte = origpte; if (((flags & VM_PROT_WRITE) && (startpte & PG_M)) || @@ -963,7 +963,7 @@ pmap_nofault(pmap_t pmap, vm_offset_t va, vm_prot_t fl #endif PMAP_LOCK(pmap); if ((pte = pmap_nofault_pte(pmap, va, &is_l3e)) == NULL || - *pte != origpte) { + be64toh(*pte) != origpte) { PMAP_UNLOCK(pmap); return (KERN_FAILURE); } @@ -992,7 +992,7 @@ pmap_nofault(pmap_t pmap, vm_offset_t va, vm_prot_t fl break; } - if (!atomic_cmpset_long(pte, origpte, newpte)) + if (!atomic_cmpset_long(pte, htobe64(origpte), htobe64(newpte))) goto retry; ptesync(); PMAP_UNLOCK(pmap); @@ -1432,12 +1432,12 @@ reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **l pv = &pc->pc_pventry[field * 64 + bit]; va = pv->pv_va; l3e = pmap_pml3e(pmap, va); - if ((*l3e & RPTE_LEAF) != 0) + if ((be64toh(*l3e) & RPTE_LEAF) != 0) continue; pte = pmap_l3e_to_pte(l3e, va); - if ((*pte & PG_W) != 0) + if ((be64toh(*pte) & PG_W) != 0) continue; - tpte = pte_load_clear(pte); + tpte = be64toh(pte_load_clear(pte)); m = PHYS_TO_VM_PAGE(tpte & PG_FRAME); if ((tpte & (PG_M | PG_RW)) == (PG_M | PG_RW)) vm_page_dirty(m); @@ -1456,7 +1456,7 @@ reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **l } } pc->pc_map[field] |= 1UL << bit; - pmap_unuse_pt(pmap, va, *l3e, &free); + pmap_unuse_pt(pmap, va, be64toh(*l3e), &free); freed++; } } @@ -1764,7 +1764,7 @@ mmu_radix_dmap_range(vm_paddr_t start, vm_paddr_t end) while (start < end) { pteval = start | DMAP_PAGE_BITS; pte = pmap_pml1e(kernel_pmap, PHYS_TO_DMAP(start)); - if ((*pte & RPTE_VALID) == 0) { + if ((be64toh(*pte) & RPTE_VALID) == 0) { page = alloc_pt_page(); pde_store(pte, page); } @@ -1773,7 +1773,7 @@ mmu_radix_dmap_range(vm_paddr_t start, vm_paddr_t end) end - start >= L2_PAGE_SIZE) { start += L2_PAGE_SIZE; goto done; - } else if ((*pte & RPTE_VALID) == 0) { + } else if ((be64toh(*pte) & RPTE_VALID) == 0) { page = alloc_pt_page(); pde_store(pte, page); } @@ -1783,7 +1783,7 @@ mmu_radix_dmap_range(vm_paddr_t start, vm_paddr_t end) end - start >= L3_PAGE_SIZE) { start += L3_PAGE_SIZE; goto done; - } else if ((*pte & RPTE_VALID) == 0) { + } else if ((be64toh(*pte) & RPTE_VALID) == 0) { page = alloc_pt_page(); pde_store(pte, page); } @@ -1820,7 +1820,7 @@ mmu_radix_setup_pagetables(vm_size_t hwphyssz) bzero(kernel_pmap, sizeof(struct pmap)); PMAP_LOCK_INIT(kernel_pmap); - ptpages = allocpages(2); + ptpages = allocpages(3); l1phys = moea64_bootstrap_alloc(RADIX_PGD_SIZE, RADIX_PGD_SIZE); validate_addr(l1phys, RADIX_PGD_SIZE); if (bootverbose) @@ -1837,10 +1837,10 @@ mmu_radix_setup_pagetables(vm_size_t hwphyssz) */ pages = ptpages; pte = pmap_pml1e(kernel_pmap, VM_MIN_KERNEL_ADDRESS); - *pte = (pages | RPTE_VALID | RPTE_SHIFT); + *pte = htobe64(pages | RPTE_VALID | RPTE_SHIFT); pages += PAGE_SIZE; pte = pmap_l1e_to_l2e(pte, VM_MIN_KERNEL_ADDRESS); - *pte = (pages | RPTE_VALID | RPTE_SHIFT); + *pte = htobe64(pages | RPTE_VALID | RPTE_SHIFT); pages += PAGE_SIZE; pte = pmap_l2e_to_l3e(pte, VM_MIN_KERNEL_ADDRESS); /* @@ -1856,7 +1856,7 @@ mmu_radix_setup_pagetables(vm_size_t hwphyssz) } KPTphys = pages; for (int i = 0; i < nkpt; i++, pte++, pages += PAGE_SIZE) - *pte = (pages | RPTE_VALID | RPTE_SHIFT); + *pte = htobe64(pages | RPTE_VALID | RPTE_SHIFT); kernel_vm_end = VM_MIN_KERNEL_ADDRESS + nkpt * L3_PAGE_SIZE; if (bootverbose) printf("kernel_pmap pml1 %p\n", kernel_pmap->pm_pml1); @@ -2192,14 +2192,14 @@ mmu_radix_advise(pmap_t pmap, vm_offset_t sva, vm_offs PMAP_LOCK(pmap); for (; sva < eva; sva = va_next) { l1e = pmap_pml1e(pmap, sva); - if ((*l1e & PG_V) == 0) { + if ((be64toh(*l1e) & PG_V) == 0) { va_next = (sva + L1_PAGE_SIZE) & ~L1_PAGE_MASK; if (va_next < sva) va_next = eva; continue; } l2e = pmap_l1e_to_l2e(l1e, sva); - if ((*l2e & PG_V) == 0) { + if ((be64toh(*l2e) & PG_V) == 0) { va_next = (sva + L2_PAGE_SIZE) & ~L2_PAGE_MASK; if (va_next < sva) va_next = eva; @@ -2209,7 +2209,7 @@ mmu_radix_advise(pmap_t pmap, vm_offset_t sva, vm_offs if (va_next < sva) va_next = eva; l3e = pmap_l2e_to_l3e(l2e, sva); - oldl3e = *l3e; + oldl3e = be64toh(*l3e); if ((oldl3e & PG_V) == 0) continue; else if ((oldl3e & RPTE_LEAF) != 0) { @@ -2235,9 +2235,9 @@ mmu_radix_advise(pmap_t pmap, vm_offset_t sva, vm_offs */ if ((oldl3e & PG_W) == 0) { pte = pmap_l3e_to_pte(l3e, sva); - KASSERT((*pte & PG_V) != 0, + KASSERT((be64toh(*pte) & PG_V) != 0, ("pmap_advise: invalid PTE")); - pmap_remove_pte(pmap, pte, sva, *l3e, NULL, + pmap_remove_pte(pmap, pte, sva, be64toh(*l3e), NULL, &lock); anychanged = TRUE; } @@ -2251,21 +2251,21 @@ mmu_radix_advise(pmap_t pmap, vm_offset_t sva, vm_offs pte++, sva += PAGE_SIZE) { MPASS(pte == pmap_pte(pmap, sva)); - if ((*pte & (PG_MANAGED | PG_V)) != (PG_MANAGED | PG_V)) + if ((be64toh(*pte) & (PG_MANAGED | PG_V)) != (PG_MANAGED | PG_V)) goto maybe_invlrng; - else if ((*pte & (PG_M | PG_RW)) == (PG_M | PG_RW)) { + else if ((be64toh(*pte) & (PG_M | PG_RW)) == (PG_M | PG_RW)) { if (advice == MADV_DONTNEED) { /* * Future calls to pmap_is_modified() * can be avoided by making the page * dirty now. */ - m = PHYS_TO_VM_PAGE(*pte & PG_FRAME); + m = PHYS_TO_VM_PAGE(be64toh(*pte) & PG_FRAME); vm_page_dirty(m); } - atomic_clear_long(pte, PG_M | PG_A); - } else if ((*pte & PG_A) != 0) - atomic_clear_long(pte, PG_A); + atomic_clear_long(pte, htobe64(PG_M | PG_A)); + } else if ((be64toh(*pte) & PG_A) != 0) + atomic_clear_long(pte, htobe64(PG_A)); else goto maybe_invlrng; anychanged = TRUE; @@ -2409,7 +2409,7 @@ restart: } va = pv->pv_va; l3e = pmap_pml3e(pmap, va); - oldl3e = *l3e; + oldl3e = be64toh(*l3e); if ((oldl3e & PG_RW) != 0) { if (pmap_demote_l3e_locked(pmap, l3e, va, &lock)) { if ((oldl3e & PG_W) == 0) { @@ -2421,12 +2421,12 @@ restart: va += VM_PAGE_TO_PHYS(m) - (oldl3e & PG_PS_FRAME); pte = pmap_l3e_to_pte(l3e, va); - oldpte = *pte; + oldpte = be64toh(*pte); if ((oldpte & PG_V) != 0) { while (!atomic_cmpset_long(pte, - oldpte, - (oldpte | RPTE_EAA_R) & ~(PG_M | PG_RW))) - oldpte = *pte; + htobe64(oldpte), + htobe64((oldpte | RPTE_EAA_R) & ~(PG_M | PG_RW)))) + oldpte = be64toh(*pte); vm_page_dirty(m); pmap_invalidate_page(pmap, va); } @@ -2449,11 +2449,11 @@ restart: } } l3e = pmap_pml3e(pmap, pv->pv_va); - KASSERT((*l3e & RPTE_LEAF) == 0, ("pmap_clear_modify: found" + KASSERT((be64toh(*l3e) & RPTE_LEAF) == 0, ("pmap_clear_modify: found" " a 2mpage in page %p's pv list", m)); pte = pmap_l3e_to_pte(l3e, pv->pv_va); - if ((*pte & (PG_M | PG_RW)) == (PG_M | PG_RW)) { - atomic_clear_long(pte, PG_M); + if ((be64toh(*pte) & (PG_M | PG_RW)) == (PG_M | PG_RW)) { + atomic_clear_long(pte, htobe64(PG_M)); pmap_invalidate_page(pmap, pv->pv_va); } PMAP_UNLOCK(pmap); @@ -2496,7 +2496,7 @@ mmu_radix_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_of pt_entry_t *src_pte, *dst_pte; l1e = pmap_pml1e(src_pmap, addr); - if ((*l1e & PG_V) == 0) { + if ((be64toh(*l1e) & PG_V) == 0) { va_next = (addr + L1_PAGE_SIZE) & ~L1_PAGE_MASK; if (va_next < addr) va_next = end_addr; @@ -2504,7 +2504,7 @@ mmu_radix_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_of } l2e = pmap_l1e_to_l2e(l1e, addr); - if ((*l2e & PG_V) == 0) { + if ((be64toh(*l2e) & PG_V) == 0) { va_next = (addr + L2_PAGE_SIZE) & ~L2_PAGE_MASK; if (va_next < addr) va_next = end_addr; @@ -2516,7 +2516,7 @@ mmu_radix_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_of va_next = end_addr; l3e = pmap_l2e_to_l3e(l2e, addr); - srcptepaddr = *l3e; + srcptepaddr = be64toh(*l3e); if (srcptepaddr == 0) continue; @@ -2530,10 +2530,10 @@ mmu_radix_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_of l3e = (pml3_entry_t *) PHYS_TO_DMAP(VM_PAGE_TO_PHYS(dst_pdpg)); l3e = &l3e[pmap_pml3e_index(addr)]; - if (*l3e == 0 && ((srcptepaddr & PG_MANAGED) == 0 || + if (be64toh(*l3e) == 0 && ((srcptepaddr & PG_MANAGED) == 0 || pmap_pv_insert_l3e(dst_pmap, addr, srcptepaddr, PMAP_ENTER_NORECLAIM, &lock))) { - *l3e = srcptepaddr & ~PG_W; + *l3e = htobe64(srcptepaddr & ~PG_W); pmap_resident_count_inc(dst_pmap, L3_PAGE_SIZE / PAGE_SIZE); atomic_add_long(&pmap_l3e_mappings, 1); @@ -2555,7 +2555,7 @@ mmu_radix_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_of dstmpte = NULL; while (addr < va_next) { pt_entry_t ptetemp; - ptetemp = *src_pte; + ptetemp = be64toh(*src_pte); /* * we only virtual copy managed pages */ @@ -2569,7 +2569,7 @@ mmu_radix_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_of dst_pte = (pt_entry_t *) PHYS_TO_DMAP(VM_PAGE_TO_PHYS(dstmpte)); dst_pte = &dst_pte[pmap_pte_index(addr)]; - if (*dst_pte == 0 && + if (be64toh(*dst_pte) == 0 && pmap_try_insert_pv_entry(dst_pmap, addr, PHYS_TO_VM_PAGE(ptetemp & PG_FRAME), &lock)) { @@ -2578,8 +2578,8 @@ mmu_radix_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_of * accessed (referenced) bits * during the copy. */ - *dst_pte = ptetemp & ~(PG_W | PG_M | - PG_A); + *dst_pte = htobe64(ptetemp & ~(PG_W | PG_M | + PG_A)); pmap_resident_count_inc(dst_pmap, 1); } else { SLIST_INIT(&free); @@ -2635,10 +2635,29 @@ static void mmu_radix_copy_pages(vm_page_t ma[], vm_offset_t a_offset, vm_page_t mb[], vm_offset_t b_offset, int xfersize) { + void *a_cp, *b_cp; + vm_offset_t a_pg_offset, b_pg_offset; + int cnt; CTR6(KTR_PMAP, "%s(%p, %#x, %p, %#x, %#x)", __func__, ma, a_offset, mb, b_offset, xfersize); - UNIMPLEMENTED(); + + while (xfersize > 0) { + a_pg_offset = a_offset & PAGE_MASK; + cnt = min(xfersize, PAGE_SIZE - a_pg_offset); + a_cp = (char *)(uintptr_t)PHYS_TO_DMAP( + VM_PAGE_TO_PHYS(ma[a_offset >> PAGE_SHIFT])) + + a_pg_offset; + b_pg_offset = b_offset & PAGE_MASK; + cnt = min(cnt, PAGE_SIZE - b_pg_offset); + b_cp = (char *)(uintptr_t)PHYS_TO_DMAP( + VM_PAGE_TO_PHYS(mb[b_offset >> PAGE_SHIFT])) + + b_pg_offset; + bcopy(a_cp, b_cp, cnt); + a_offset += cnt; + b_offset += cnt; + xfersize -= cnt; + } } #if VM_NRESERVLEVEL > 0 @@ -2664,7 +2683,7 @@ pmap_promote_l3e(pmap_t pmap, pml3_entry_t *pde, vm_of * either invalid, unused, or does not map the first 4KB physical page * within a 2MB page. */ - firstpte = (pt_entry_t *)PHYS_TO_DMAP(*pde & PG_FRAME); + firstpte = (pt_entry_t *)PHYS_TO_DMAP(be64toh(*pde) & PG_FRAME); setpde: newpde = *firstpte; if ((newpde & ((PG_FRAME & L3_PAGE_MASK) | PG_A | PG_V)) != (PG_A | PG_V)) { @@ -2677,7 +2696,7 @@ setpde: * When PG_M is already clear, PG_RW can be cleared without * a TLB invalidation. */ - if (!atomic_cmpset_long(firstpte, newpde, (newpde | RPTE_EAA_R) & ~RPTE_EAA_W)) + if (!atomic_cmpset_long(firstpte, htobe64(newpde), htobe64((newpde | RPTE_EAA_R) & ~RPTE_EAA_W))) goto setpde; newpde &= ~RPTE_EAA_W; } @@ -2690,7 +2709,7 @@ setpde: pa = (newpde & (PG_PS_FRAME | PG_A | PG_V)) + L3_PAGE_SIZE - PAGE_SIZE; for (pte = firstpte + NPTEPG - 1; pte > firstpte; pte--) { setpte: - oldpte = *pte; + oldpte = be64toh(*pte); if ((oldpte & (PG_FRAME | PG_A | PG_V)) != pa) { CTR2(KTR_PMAP, "pmap_promote_l3e: failure for va %#lx" " in pmap %p", va, pmap); @@ -2701,7 +2720,7 @@ setpte: * When PG_M is already clear, PG_RW can be cleared * without a TLB invalidation. */ - if (!atomic_cmpset_long(pte, oldpte, (oldpte | RPTE_EAA_R) & ~RPTE_EAA_W)) + if (!atomic_cmpset_long(pte, htobe64(oldpte), htobe64((oldpte | RPTE_EAA_R) & ~RPTE_EAA_W))) goto setpte; oldpte &= ~RPTE_EAA_W; CTR2(KTR_PMAP, "pmap_promote_l3e: protect for va %#lx" @@ -2721,7 +2740,7 @@ setpte: * mapping the superpage is demoted by pmap_demote_pde() or * destroyed by pmap_remove_pde(). */ - mpte = PHYS_TO_VM_PAGE(*pde & PG_FRAME); + mpte = PHYS_TO_VM_PAGE(be64toh(*pde) & PG_FRAME); KASSERT(mpte >= vm_page_array && mpte < &vm_page_array[vm_page_array_size], ("pmap_promote_l3e: page table page is out of range")); @@ -2827,11 +2846,11 @@ mmu_radix_enter(pmap_t pmap, vm_offset_t va, vm_page_t */ retry: l3e = pmap_pml3e(pmap, va); - if (l3e != NULL && (*l3e & PG_V) != 0 && ((*l3e & RPTE_LEAF) == 0 || + if (l3e != NULL && (be64toh(*l3e) & PG_V) != 0 && ((be64toh(*l3e) & RPTE_LEAF) == 0 || pmap_demote_l3e_locked(pmap, l3e, va, &lock))) { pte = pmap_l3e_to_pte(l3e, va); if (va < VM_MAXUSER_ADDRESS && mpte == NULL) { - mpte = PHYS_TO_VM_PAGE(*l3e & PG_FRAME); + mpte = PHYS_TO_VM_PAGE(be64toh(*l3e) & PG_FRAME); mpte->ref_count++; } } else if (va < VM_MAXUSER_ADDRESS) { @@ -2853,7 +2872,7 @@ retry: } else panic("pmap_enter: invalid page directory va=%#lx", va); - origpte = *pte; + origpte = be64toh(*pte); pv = NULL; /* @@ -2903,7 +2922,7 @@ retry: vm_page_aflag_set(m, PGA_WRITEABLE); if (((origpte ^ newpte) & ~(PG_M | PG_A)) == 0) { if ((newpte & (PG_A|PG_M)) != (origpte & (PG_A|PG_M))) { - if (!atomic_cmpset_long(pte, origpte, newpte)) + if (!atomic_cmpset_long(pte, htobe64(origpte), htobe64(newpte))) goto retry; if ((newpte & PG_M) != (origpte & PG_M)) vm_page_dirty(m); @@ -2928,7 +2947,7 @@ retry: * * For consistency, handle unmanaged mappings the same way. */ - origpte = pte_load_clear(pte); + origpte = be64toh(pte_load_clear(pte)); KASSERT((origpte & PG_FRAME) == opa, ("pmap_enter: unexpected pa update for %#lx", va)); if ((origpte & PG_MANAGED) != 0) { @@ -3008,7 +3027,7 @@ retry: */ if ((origpte & PG_V) != 0) { validate: - origpte = pte_load_store(pte, newpte); + origpte = be64toh(pte_load_store(pte, htobe64(newpte))); KASSERT((origpte & PG_FRAME) == pa, ("pmap_enter: unexpected pa update for %#lx", va)); if ((newpte & PG_M) == 0 && (origpte & (PG_M | PG_RW)) == @@ -3123,7 +3142,7 @@ pmap_enter_l3e(pmap_t pmap, vm_offset_t va, pml3_entry } l3e = (pml3_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(pdpg)); l3e = &l3e[pmap_pml3e_index(va)]; - oldl3e = *l3e; + oldl3e = be64toh(*l3e); if ((oldl3e & PG_V) != 0) { KASSERT(pdpg->ref_count > 1, ("pmap_enter_pde: pdpg's wire count is too low")); @@ -3150,7 +3169,7 @@ pmap_enter_l3e(pmap_t pmap, vm_offset_t va, pml3_entry } vm_page_free_pages_toq(&free, true); if (va >= VM_MAXUSER_ADDRESS) { - mt = PHYS_TO_VM_PAGE(*l3e & PG_FRAME); + mt = PHYS_TO_VM_PAGE(be64toh(*l3e) & PG_FRAME); if (pmap_insert_pt_page(pmap, mt)) { /* * XXX Currently, this can't happen because @@ -3160,7 +3179,7 @@ pmap_enter_l3e(pmap_t pmap, vm_offset_t va, pml3_entry panic("pmap_enter_pde: trie insert failed"); } } else - KASSERT(*l3e == 0, ("pmap_enter_pde: non-zero pde %p", + KASSERT(be64toh(*l3e) == 0, ("pmap_enter_pde: non-zero pde %p", l3e)); } if ((newpde & PG_MANAGED) != 0) { @@ -3287,10 +3306,10 @@ mmu_radix_enter_quick_locked(pmap_t pmap, vm_offset_t * attempt to allocate a page table page. If this * attempt fails, we don't retry. Instead, we give up. */ - if (ptepa && (*ptepa & PG_V) != 0) { - if (*ptepa & RPTE_LEAF) + if (ptepa && (be64toh(*ptepa) & PG_V) != 0) { + if (be64toh(*ptepa) & RPTE_LEAF) return (NULL); - mpte = PHYS_TO_VM_PAGE(*ptepa & PG_FRAME); + mpte = PHYS_TO_VM_PAGE(be64toh(*ptepa) & PG_FRAME); mpte->ref_count++; } else { /* @@ -3308,7 +3327,7 @@ mmu_radix_enter_quick_locked(pmap_t pmap, vm_offset_t mpte = NULL; pte = pmap_pte(pmap, va); } - if (*pte) { + if (be64toh(*pte)) { if (mpte != NULL) { mpte->ref_count--; mpte = NULL; @@ -3385,8 +3404,8 @@ mmu_radix_extract(pmap_t pmap, vm_offset_t va) l3e = pmap_pml3e(pmap, va); if (__predict_false(l3e == NULL)) return (0); - if (*l3e & RPTE_LEAF) { - pa = (*l3e & PG_PS_FRAME) | (va & L3_PAGE_MASK); + if (be64toh(*l3e) & RPTE_LEAF) { + pa = (be64toh(*l3e) & PG_PS_FRAME) | (va & L3_PAGE_MASK); pa |= (va & L3_PAGE_MASK); } else { /* @@ -3400,7 +3419,7 @@ mmu_radix_extract(pmap_t pmap, vm_offset_t va) pte = pmap_l3e_to_pte(l3e, va); if (__predict_false(pte == NULL)) return (0); - pa = *pte; + pa = be64toh(*pte); pa = (pa & PG_FRAME) | (va & PAGE_MASK); pa |= (va & PAGE_MASK); } @@ -3420,13 +3439,14 @@ mmu_radix_extract_and_hold(pmap_t pmap, vm_offset_t va CTR4(KTR_PMAP, "%s(%p, %#x, %#x)", __func__, pmap, va, prot); PMAP_LOCK(pmap); l3ep = pmap_pml3e(pmap, va); - if (l3ep != NULL && (l3e = *l3ep)) { + if (l3ep != NULL && (l3e = be64toh(*l3ep))) { if (l3e & RPTE_LEAF) { if ((l3e & PG_RW) || (prot & VM_PROT_WRITE) == 0) m = PHYS_TO_VM_PAGE((l3e & PG_PS_FRAME) | (va & L3_PAGE_MASK)); } else { - pte = *pmap_l3e_to_pte(l3ep, va); + /* Native endian PTE, do not pass to pmap functions */ + pte = be64toh(*pmap_l3e_to_pte(l3ep, va)); if ((pte & PG_V) && ((pte & PG_RW) || (prot & VM_PROT_WRITE) == 0)) m = PHYS_TO_VM_PAGE(pte & PG_FRAME); @@ -3456,7 +3476,7 @@ mmu_radix_growkernel(vm_offset_t addr) addr = vm_map_max(kernel_map); while (kernel_vm_end < addr) { l2e = pmap_pml2e(kernel_pmap, kernel_vm_end); - if ((*l2e & PG_V) == 0) { + if ((be64toh(*l2e) & PG_V) == 0) { /* We need a new PDP entry */ nkpg = vm_page_alloc(NULL, kernel_vm_end >> L2_PAGE_SIZE_SHIFT, VM_ALLOC_INTERRUPT | VM_ALLOC_NOOBJ | @@ -3470,7 +3490,7 @@ mmu_radix_growkernel(vm_offset_t addr) continue; /* try again */ } l3e = pmap_l2e_to_l3e(l2e, kernel_vm_end); - if ((*l3e & PG_V) != 0) { + if ((be64toh(*l3e) & PG_V) != 0) { kernel_vm_end = (kernel_vm_end + L3_PAGE_SIZE) & ~L3_PAGE_MASK; if (kernel_vm_end - 1 >= vm_map_max(kernel_map)) { kernel_vm_end = vm_map_max(kernel_map); @@ -3549,6 +3569,7 @@ mmu_radix_init() vm_size_t s; int error, i, pv_npg; + /* XXX is this really needed for POWER? */ /* L1TF, reserve page @0 unconditionally */ vm_page_blacklist_add(0, bootverbose); @@ -3665,7 +3686,7 @@ restart: mask |= PG_RW | PG_M; if (accessed) mask |= PG_V | PG_A; - rv = (*pte & mask) == mask; + rv = (be64toh(*pte) & mask) == mask; PMAP_UNLOCK(pmap); if (rv) goto out; @@ -3692,7 +3713,7 @@ restart: mask |= PG_RW | PG_M; if (accessed) mask |= PG_V | PG_A; - rv = (*pte & mask) == mask; + rv = (be64toh(*pte) & mask) == mask; PMAP_UNLOCK(pmap); if (rv) goto out; @@ -3736,9 +3757,9 @@ mmu_radix_is_prefaultable(pmap_t pmap, vm_offset_t add rv = FALSE; PMAP_LOCK(pmap); l3e = pmap_pml3e(pmap, addr); - if (l3e != NULL && (*l3e & (RPTE_LEAF | PG_V)) == PG_V) { + if (l3e != NULL && (be64toh(*l3e) & (RPTE_LEAF | PG_V)) == PG_V) { pte = pmap_l3e_to_pte(l3e, addr); - rv = (*pte & PG_V) == 0; + rv = (be64toh(*pte) & PG_V) == 0; } PMAP_UNLOCK(pmap); return (rv); @@ -3815,7 +3836,7 @@ retry: } } l3e = pmap_pml3e(pmap, pv->pv_va); - oldl3e = *l3e; + oldl3e = be64toh(*l3e); if ((oldl3e & (PG_M | PG_RW)) == (PG_M | PG_RW)) { /* * Although "oldpde" is mapping a 2MB page, because @@ -3846,7 +3867,7 @@ retry: if ((((pa >> PAGE_SHIFT) ^ (pv->pv_va >> L3_PAGE_SIZE_SHIFT) ^ (uintptr_t)pmap) & (NPTEPG - 1)) == 0 && (oldl3e & PG_W) == 0) { - atomic_clear_long(l3e, PG_A); + atomic_clear_long(l3e, htobe64(PG_A)); pmap_invalidate_page(pmap, pv->pv_va); cleared++; KASSERT(lock == VM_PAGE_TO_PV_LIST_LOCK(m), @@ -3885,14 +3906,14 @@ small_mappings: } } l3e = pmap_pml3e(pmap, pv->pv_va); - KASSERT((*l3e & RPTE_LEAF) == 0, + KASSERT((be64toh(*l3e) & RPTE_LEAF) == 0, ("pmap_ts_referenced: found a 2mpage in page %p's pv list", m)); pte = pmap_l3e_to_pte(l3e, pv->pv_va); - if ((*pte & (PG_M | PG_RW)) == (PG_M | PG_RW)) + if ((be64toh(*pte) & (PG_M | PG_RW)) == (PG_M | PG_RW)) vm_page_dirty(m); - if ((*pte & PG_A) != 0) { - atomic_clear_long(pte, PG_A); + if ((be64toh(*pte) & PG_A) != 0) { + atomic_clear_long(pte, htobe64(PG_A)); pmap_invalidate_page(pmap, pv->pv_va); cleared++; } @@ -3987,7 +4008,7 @@ mmu_radix_object_init_pt(pmap_t pmap, vm_offset_t addr } l3e = (pml3_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(pdpg)); l3e = &l3e[pmap_pml3e_index(addr)]; - if ((*l3e & PG_V) == 0) { + if ((be64toh(*l3e) & PG_V) == 0) { pa |= PG_M | PG_A | PG_RW; pte_store(l3e, pa); pmap_resident_count_inc(pmap, L3_PAGE_SIZE / PAGE_SIZE); @@ -4085,7 +4106,7 @@ restart: } } pte = pmap_pte(pmap, pv->pv_va); - if ((*pte & PG_W) != 0) + if ((be64toh(*pte) & PG_W) != 0) count++; PMAP_UNLOCK(pmap); } @@ -4106,7 +4127,7 @@ restart: } } pte = pmap_pml3e(pmap, pv->pv_va); - if ((*pte & PG_W) != 0) + if ((be64toh(*pte) & PG_W) != 0) count++; PMAP_UNLOCK(pmap); } @@ -4213,7 +4234,7 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, str pml1index = pdpindex >> RPTE_SHIFT; l1e = &pmap->pm_pml1[pml1index]; - if ((*l1e & PG_V) == 0) { + if ((be64toh(*l1e) & PG_V) == 0) { /* Have to allocate a new pdp, recurse */ if (_pmap_allocpte(pmap, NUPDE + NUPDPE + pml1index, lockp) == NULL) { @@ -4223,10 +4244,10 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, str } } else { /* Add reference to l2e page */ - pdppg = PHYS_TO_VM_PAGE(*l1e & PG_FRAME); + pdppg = PHYS_TO_VM_PAGE(be64toh(*l1e) & PG_FRAME); pdppg->ref_count++; } - l2e = (pml2_entry_t *)PHYS_TO_DMAP(*l1e & PG_FRAME); + l2e = (pml2_entry_t *)PHYS_TO_DMAP(be64toh(*l1e) & PG_FRAME); /* Now find the pdp page */ l2e = &l2e[pdpindex & RPTE_MASK]; @@ -4245,7 +4266,7 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, str /* First, find the pdp and check that its valid. */ l1e = &pmap->pm_pml1[pml1index]; - if ((*l1e & PG_V) == 0) { + if ((be64toh(*l1e) & PG_V) == 0) { /* Have to allocate a new pd, recurse */ if (_pmap_allocpte(pmap, NUPDE + pdpindex, lockp) == NULL) { @@ -4253,12 +4274,12 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, str vm_page_free_zero(m); return (NULL); } - l2e = (pml2_entry_t *)PHYS_TO_DMAP(*l1e & PG_FRAME); + l2e = (pml2_entry_t *)PHYS_TO_DMAP(be64toh(*l1e) & PG_FRAME); l2e = &l2e[pdpindex & RPTE_MASK]; } else { - l2e = (pml2_entry_t *)PHYS_TO_DMAP(*l1e & PG_FRAME); + l2e = (pml2_entry_t *)PHYS_TO_DMAP(be64toh(*l1e) & PG_FRAME); l2e = &l2e[pdpindex & RPTE_MASK]; - if ((*l2e & PG_V) == 0) { + if ((be64toh(*l2e) & PG_V) == 0) { /* Have to allocate a new pd, recurse */ if (_pmap_allocpte(pmap, NUPDE + pdpindex, lockp) == NULL) { @@ -4268,11 +4289,11 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, str } } else { /* Add reference to the pd page */ - pdpg = PHYS_TO_VM_PAGE(*l2e & PG_FRAME); + pdpg = PHYS_TO_VM_PAGE(be64toh(*l2e) & PG_FRAME); pdpg->ref_count++; } } - l3e = (pml3_entry_t *)PHYS_TO_DMAP(*l2e & PG_FRAME); + l3e = (pml3_entry_t *)PHYS_TO_DMAP(be64toh(*l2e) & PG_FRAME); /* Now we know where the page directory page is */ l3e = &l3e[ptepindex & RPTE_MASK]; @@ -4291,9 +4312,9 @@ pmap_allocl3e(pmap_t pmap, vm_offset_t va, struct rwlo retry: pdpe = pmap_pml2e(pmap, va); - if (pdpe != NULL && (*pdpe & PG_V) != 0) { + if (pdpe != NULL && (be64toh(*pdpe) & PG_V) != 0) { /* Add a reference to the pd page. */ - pdpg = PHYS_TO_VM_PAGE(*pdpe & PG_FRAME); + pdpg = PHYS_TO_VM_PAGE(be64toh(*pdpe) & PG_FRAME); pdpg->ref_count++; } else { /* Allocate a pd page. */ @@ -4327,7 +4348,7 @@ retry: * This supports switching from a 2MB page to a * normal 4K page. */ - if (pd != NULL && (*pd & (RPTE_LEAF | PG_V)) == (RPTE_LEAF | PG_V)) { + if (pd != NULL && (be64toh(*pd) & (RPTE_LEAF | PG_V)) == (RPTE_LEAF | PG_V)) { if (!pmap_demote_l3e_locked(pmap, pd, va, lockp)) { /* * Invalidation of the 2MB page mapping may have caused @@ -4341,8 +4362,8 @@ retry: * If the page table page is mapped, we just increment the * hold count, and activate it. */ - if (pd != NULL && (*pd & PG_V) != 0) { - m = PHYS_TO_VM_PAGE(*pd & PG_FRAME); + if (pd != NULL && (be64toh(*pd) & PG_V) != 0) { + m = PHYS_TO_VM_PAGE(be64toh(*pd) & PG_FRAME); m->ref_count++; } else { /* @@ -4387,7 +4408,7 @@ pmap_protect_l3e(pmap_t pmap, pt_entry_t *l3e, vm_offs ("pmap_protect_l3e: sva is not 2mpage aligned")); anychanged = FALSE; retry: - oldpde = newpde = *l3e; + oldpde = newpde = be64toh(*l3e); if ((oldpde & (PG_MANAGED | PG_M | PG_RW)) == (PG_MANAGED | PG_M | PG_RW)) { eva = sva + L3_PAGE_SIZE; @@ -4407,7 +4428,7 @@ retry: * PG_PROMOTED. The impending invalidation will remove any * lingering 4KB page mappings from the TLB. */ - if (!atomic_cmpset_long(l3e, oldpde, newpde & ~PG_PROMOTED)) + if (!atomic_cmpset_long(l3e, htobe64(oldpde), htobe64(newpde & ~PG_PROMOTED))) goto retry; anychanged = TRUE; } @@ -4448,7 +4469,7 @@ mmu_radix_protect(pmap_t pmap, vm_offset_t sva, vm_off PMAP_LOCK(pmap); for (; sva < eva; sva = va_next) { l1e = pmap_pml1e(pmap, sva); - if ((*l1e & PG_V) == 0) { + if ((be64toh(*l1e) & PG_V) == 0) { va_next = (sva + L1_PAGE_SIZE) & ~L1_PAGE_MASK; if (va_next < sva) va_next = eva; @@ -4456,7 +4477,7 @@ mmu_radix_protect(pmap_t pmap, vm_offset_t sva, vm_off } l2e = pmap_l1e_to_l2e(l1e, sva); - if ((*l2e & PG_V) == 0) { + if ((be64toh(*l2e) & PG_V) == 0) { va_next = (sva + L2_PAGE_SIZE) & ~L2_PAGE_MASK; if (va_next < sva) va_next = eva; @@ -4468,7 +4489,7 @@ mmu_radix_protect(pmap_t pmap, vm_offset_t sva, vm_off va_next = eva; l3e = pmap_l2e_to_l3e(l2e, sva); - ptpaddr = *l3e; + ptpaddr = be64toh(*l3e); /* * Weed out invalid mappings. @@ -4506,7 +4527,7 @@ mmu_radix_protect(pmap_t pmap, vm_offset_t sva, vm_off retry: MPASS(pte == pmap_pte(pmap, sva)); - obits = pbits = *pte; + obits = pbits = be64toh(*pte); if ((pbits & PG_V) == 0) continue; @@ -4523,7 +4544,7 @@ retry: pbits |= PG_X; if (pbits != obits) { - if (!atomic_cmpset_long(pte, obits, pbits)) + if (!atomic_cmpset_long(pte, htobe64(obits), htobe64(pbits))) goto retry; if (obits & (PG_A|PG_M)) { anychanged = TRUE; @@ -4569,8 +4590,8 @@ mmu_radix_qenter(vm_offset_t sva, vm_page_t *ma, int c m = *ma++; cache_bits = pmap_cache_bits(m->md.mdpg_cache_attrs); pa = VM_PAGE_TO_PHYS(m) | cache_bits | attr_bits; - if (*pte != pa) { - oldpte |= *pte; + if (be64toh(*pte) != pa) { + oldpte |= be64toh(*pte); pte_store(pte, pa); } va += PAGE_SIZE; @@ -4699,14 +4720,14 @@ _pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_ /* We just released a PT, unhold the matching PD */ vm_page_t pdpg; - pdpg = PHYS_TO_VM_PAGE(*pmap_pml2e(pmap, va) & PG_FRAME); + pdpg = PHYS_TO_VM_PAGE(be64toh(*pmap_pml2e(pmap, va)) & PG_FRAME); pmap_unwire_ptp(pmap, va, pdpg, free); } if (m->pindex >= NUPDE && m->pindex < (NUPDE + NUPDPE)) { /* We just released a PD, unhold the matching PDP */ vm_page_t pdppg; - pdppg = PHYS_TO_VM_PAGE(*pmap_pml1e(pmap, va) & PG_FRAME); + pdppg = PHYS_TO_VM_PAGE(be64toh(*pmap_pml1e(pmap, va)) & PG_FRAME); pmap_unwire_ptp(pmap, va, pdppg, free); } @@ -4787,7 +4808,7 @@ pmap_fill_ptp(pt_entry_t *firstpte, pt_entry_t newpte) pt_entry_t *pte; for (pte = firstpte; pte < firstpte + NPTEPG; pte++) { - *pte = newpte; + *pte = htobe64(newpte); newpte += PAGE_SIZE; } } @@ -4817,7 +4838,7 @@ pmap_demote_l3e_locked(pmap_t pmap, pml3_entry_t *l3e, vm_offset_t sva; PMAP_LOCK_ASSERT(pmap, MA_OWNED); - oldpde = *l3e; + oldpde = be64toh(*l3e); KASSERT((oldpde & (RPTE_LEAF | PG_V)) == (RPTE_LEAF | PG_V), ("pmap_demote_l3e: oldpde is missing RPTE_LEAF and/or PG_V %lx", oldpde)); @@ -4870,7 +4891,7 @@ pmap_demote_l3e_locked(pmap_t pmap, pml3_entry_t *l3e, pmap_fill_ptp(firstpte, oldpde); } - KASSERT((*firstpte & PG_FRAME) == (oldpde & PG_FRAME), + KASSERT((be64toh(*firstpte) & PG_FRAME) == (oldpde & PG_FRAME), ("pmap_demote_l3e: firstpte and newpte map different physical" " addresses")); @@ -4878,7 +4899,7 @@ pmap_demote_l3e_locked(pmap_t pmap, pml3_entry_t *l3e, * If the mapping has changed attributes, update the page table * entries. */ - if ((*firstpte & PG_PTE_PROMOTE) != (oldpde & PG_PTE_PROMOTE)) + if ((be64toh(*firstpte) & PG_PTE_PROMOTE) != (oldpde & PG_PTE_PROMOTE)) pmap_fill_ptp(firstpte, oldpde); /* @@ -4957,7 +4978,7 @@ pmap_remove_l3e(pmap_t pmap, pml3_entry_t *pdq, vm_off PMAP_LOCK_ASSERT(pmap, MA_OWNED); KASSERT((sva & L3_PAGE_MASK) == 0, ("pmap_remove_l3e: sva is not 2mpage aligned")); - oldpde = pte_load_clear(pdq); + oldpde = be64toh(pte_load_clear(pdq)); if (oldpde & PG_W) pmap->pm_stats.wired_count -= (L3_PAGE_SIZE / PAGE_SIZE); pmap_resident_count_dec(pmap, L3_PAGE_SIZE / PAGE_SIZE); @@ -4989,7 +5010,7 @@ pmap_remove_l3e(pmap_t pmap, pml3_entry_t *pdq, vm_off pmap_add_delayed_free_list(mpte, free, FALSE); } } - return (pmap_unuse_pt(pmap, sva, *pmap_pml2e(pmap, sva), free)); + return (pmap_unuse_pt(pmap, sva, be64toh(*pmap_pml2e(pmap, sva)), free)); } /* @@ -5004,7 +5025,7 @@ pmap_remove_pte(pmap_t pmap, pt_entry_t *ptq, vm_offse vm_page_t m; PMAP_LOCK_ASSERT(pmap, MA_OWNED); - oldpte = pte_load_clear(ptq); + oldpte = be64toh(pte_load_clear(ptq)); if (oldpte & RPTE_WIRED) pmap->pm_stats.wired_count -= 1; pmap_resident_count_dec(pmap, 1); @@ -5038,16 +5059,16 @@ pmap_remove_page(pmap_t pmap, vm_offset_t va, pml3_ent bool invalidate_all; PMAP_LOCK_ASSERT(pmap, MA_OWNED); - if ((*l3e & RPTE_VALID) == 0) { + if ((be64toh(*l3e) & RPTE_VALID) == 0) { return (false); } pte = pmap_l3e_to_pte(l3e, va); - if ((*pte & RPTE_VALID) == 0) { + if ((be64toh(*pte) & RPTE_VALID) == 0) { return (false); } lock = NULL; - invalidate_all = pmap_remove_pte(pmap, pte, va, *l3e, free, &lock); + invalidate_all = pmap_remove_pte(pmap, pte, va, be64toh(*l3e), free, &lock); if (lock != NULL) rw_wunlock(lock); if (!invalidate_all) @@ -5081,7 +5102,7 @@ pmap_remove_ptes(pmap_t pmap, vm_offset_t sva, vm_offs *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Nov 13 18:25:07 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DD1CC2E9828; Fri, 13 Nov 2020 18:25:07 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXn2C5xF3z4hlg; Fri, 13 Nov 2020 18:25:07 +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 BE8CA1C5F1; Fri, 13 Nov 2020 18:25:07 +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 0ADIP7G6013485; Fri, 13 Nov 2020 18:25:07 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ADIP7Lg013484; Fri, 13 Nov 2020 18:25:07 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202011131825.0ADIP7Lg013484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 13 Nov 2020 18:25:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367645 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 367645 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 13 Nov 2020 18:25:07 -0000 Author: emaste Date: Fri Nov 13 18:25:07 2020 New Revision: 367645 URL: https://svnweb.freebsd.org/changeset/base/367645 Log: ip_fastfwd: style(9) tidy for r367628 Discussed with: gnn MFC with: r367628 Modified: head/sys/netinet/ip_fastfwd.c head/sys/netinet/ip_input.c Modified: head/sys/netinet/ip_fastfwd.c ============================================================================== --- head/sys/netinet/ip_fastfwd.c Fri Nov 13 16:56:03 2020 (r367644) +++ head/sys/netinet/ip_fastfwd.c Fri Nov 13 18:25:07 2020 (r367645) @@ -131,17 +131,18 @@ ip_redir_alloc(struct mbuf *m, struct nhop_object *nh, */ m_free(mcopy); return (NULL); - } + } mcopy->m_len = min(ntohs(ip->ip_len), M_TRAILINGSPACE(mcopy)); mcopy->m_pkthdr.len = mcopy->m_len; m_copydata(m, 0, mcopy->m_len, mtod(mcopy, caddr_t)); - + if (nh != NULL && ((nh->nh_flags & (NHF_REDIRECT|NHF_DEFAULT)) == 0)) { struct in_ifaddr *nh_ia = (struct in_ifaddr *)(nh->nh_ifa); u_long src = ntohl(ip->ip_src.s_addr); - - if (nh_ia != NULL && (src & nh_ia->ia_subnetmask) == nh_ia->ia_subnet) { + + if (nh_ia != NULL && + (src & nh_ia->ia_subnetmask) == nh_ia->ia_subnet) { if (nh->nh_flags & NHF_GATEWAY) *addr = nh->gw4_sa.sin_addr.s_addr; else Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Fri Nov 13 16:56:03 2020 (r367644) +++ head/sys/netinet/ip_input.c Fri Nov 13 18:25:07 2020 (r367645) @@ -111,7 +111,7 @@ SYSCTL_INT(_net_inet_ip, IPCTL_FORWARDING, forwarding, &VNET_NAME(ipforwarding), 0, "Enable IP forwarding between interfaces"); -/* +/* * Respond with an ICMP host redirect when we forward a packet out of * the same interface on which it was received. See RFC 792. */ From owner-svn-src-head@freebsd.org Fri Nov 13 18:30:51 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 886D72EA427; Fri, 13 Nov 2020 18:30:51 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXn8q3Km8z4jYS; Fri, 13 Nov 2020 18:30:51 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm1-x32e.google.com with SMTP id p22so9366080wmg.3; Fri, 13 Nov 2020 10:30:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=JgE1FTKBZcA2LepvqEZxb2reZVhRjgBv6ZO925sFyYM=; b=rLdB7bznx1/IbclTnBL4Brq7c4bQA+SuWYWvKsBKY6H5xcuX+5WshdOeUigh6uq07H xS8m5aWpSBapRi4oEI0xgD1ltFQhHL0iJ5hjM/zasnq0Mt18c0/wLP1WiQt5sFcRsUUN 8HSgQxuRDe62LrDFLurFTjm7T3VTrriKW2dVbT+Bp5ewyAeTu/lyZLk5/J7BDTy/FiCt Lbx100Li9IHcg2tp9UhVGJA0ZFMRjm2MYgt7cJOOEsMUH6VhFbfqclZKy+WYh5SQ5FrL nRZr8PFVX1Ccu2M2mqerU9J+ThhY3nNSABweB+gYJwA9RlE50ivPf4ZDNaYFvzVJJFRH mVYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=JgE1FTKBZcA2LepvqEZxb2reZVhRjgBv6ZO925sFyYM=; b=Y2a59ALIA9xbC2ZhnChI6RF9dIvowBqQUyMYNwTxuo8YwkyV9r3LTz85efaUNDyDOv /2KHQ59xyo/qDU8CTgsfNW4LY7rsu1czmQYn5PeUlb9Dm1t0pKZRk8NoBsWVJjbWA9wN cpGsIpaxmvtlajmtbpqeoCCmZsyxK+zOUtalt809FQqqyyYJWlMbLaXDjE4b9NVeB/in 56qRI+hlmJagEsz/wq+8yPnSQiJqHMRBoLf8tMnoTaEVvn7ivLx8xZZUxGU1uHzqZslQ qIa5cLVVzXQRTGAcByCcAYUAIQmF+8SsHZwbV7uOUNnOFSl4HpJbk+KFFEA2/v00wRuE WXdw== X-Gm-Message-State: AOAM5321+Sg3XbUIiobC/e8X5OTI0TJG3Vf5wCK5DOVJ/+ykzEJQQmF3 GXLDggxDVt3Hoh/lz5xBXw2NxtYmst9B7vATaYhHsH0KgMY= X-Google-Smtp-Source: ABdhPJx9ACTGMmx2csSJN1EGEYh8VxKdoVv9m69oQyJ9j5KRahbvCXHmv518TAOIGXxs1Q7lMA4x6vfsGefs84zn1tI= X-Received: by 2002:a1c:e442:: with SMTP id b63mr3969705wmh.10.1605292248731; Fri, 13 Nov 2020 10:30:48 -0800 (PST) MIME-Version: 1.0 Received: by 2002:adf:dec7:0:0:0:0:0 with HTTP; Fri, 13 Nov 2020 10:30:47 -0800 (PST) In-Reply-To: <202011130931.0AD9VwBL082843@repo.freebsd.org> References: <202011130931.0AD9VwBL082843@repo.freebsd.org> From: Mateusz Guzik Date: Fri, 13 Nov 2020 19:30:47 +0100 Message-ID: Subject: Re: svn commit: r367631 - in head/sys: kern sys To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4CXn8q3Km8z4jYS X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 13 Nov 2020 18:30:51 -0000 On 11/13/20, Konstantin Belousov wrote: > +static u_long vn_lock_pair_pause_cnt; > +SYSCTL_ULONG(_debug, OID_AUTO, vn_lock_pair_pause, CTLFLAG_RD, > + &vn_lock_pair_pause_cnt, 0, > + "Count of vn_lock_pair deadlocks"); > + > +static void > +vn_lock_pair_pause(const char *wmesg) > +{ > + atomic_add_long(&vn_lock_pair_pause_cnt, 1); > + pause(wmesg, prng32_bounded(hz / 10)); > +} > + > +/* > + * Lock pair of vnodes vp1, vp2, avoiding lock order reversal. > + * vp1_locked indicates whether vp1 is exclusively locked; if not, vp1 > + * must be unlocked. Same for vp2 and vp2_locked. One of the vnodes > + * can be NULL. > + * > + * The function returns with both vnodes exclusively locked, and > + * guarantees that it does not create lock order reversal with other > + * threads during its execution. Both vnodes could be unlocked > + * temporary (and reclaimed). > + */ > +void > +vn_lock_pair(struct vnode *vp1, bool vp1_locked, struct vnode *vp2, > + bool vp2_locked) > +{ > + int error; > + > + if (vp1 == NULL && vp2 == NULL) > + return; > + if (vp1 != NULL) { > + if (vp1_locked) > + ASSERT_VOP_ELOCKED(vp1, "vp1"); > + else > + ASSERT_VOP_UNLOCKED(vp1, "vp1"); > + } else { > + vp1_locked = true; > + } > + if (vp2 != NULL) { > + if (vp2_locked) > + ASSERT_VOP_ELOCKED(vp2, "vp2"); > + else > + ASSERT_VOP_UNLOCKED(vp2, "vp2"); > + } else { > + vp2_locked = true; > + } > + if (!vp1_locked && !vp2_locked) { > + vn_lock(vp1, LK_EXCLUSIVE | LK_RETRY); > + vp1_locked = true; > + } > + > + for (;;) { > + if (vp1_locked && vp2_locked) > + break; > + if (vp1_locked && vp2 != NULL) { > + if (vp1 != NULL) { > + error = VOP_LOCK1(vp2, LK_EXCLUSIVE | LK_NOWAIT, > + __FILE__, __LINE__); > + if (error == 0) > + break; > + VOP_UNLOCK(vp1); > + vp1_locked = false; > + vn_lock_pair_pause("vlp1"); > + } > + vn_lock(vp2, LK_EXCLUSIVE | LK_RETRY); > + vp2_locked = true; > + } > + if (vp2_locked && vp1 != NULL) { > + if (vp2 != NULL) { > + error = VOP_LOCK1(vp1, LK_EXCLUSIVE | LK_NOWAIT, > + __FILE__, __LINE__); > + if (error == 0) > + break; > + VOP_UNLOCK(vp2); > + vp2_locked = false; > + vn_lock_pair_pause("vlp2"); > + } > + vn_lock(vp1, LK_EXCLUSIVE | LK_RETRY); > + vp1_locked = true; > + } > + } > + if (vp1 != NULL) > + ASSERT_VOP_ELOCKED(vp1, "vp1 ret"); > + if (vp2 != NULL) > + ASSERT_VOP_ELOCKED(vp2, "vp2 ret"); > } > Multiple callers who get here with flipped addresses can end up failing against each other in an indefinite loop. Instead, after initial trylocking fails, the routine should establish ordering it will follow for itself, for example by sorting by address. Then pseudo-code would be: retry: vn_lock(lower, ...); if (!VOP_LOCK(higher, LK_NOWAIT ...)) { vn_unlock(lower); vn_lock(higher); vn_unlock(higher); goto retry; } Note this also eliminates the pause. -- Mateusz Guzik From owner-svn-src-head@freebsd.org Fri Nov 13 18:34:13 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8D9B32EA781; Fri, 13 Nov 2020 18:34:13 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXnDj3flNz4kGS; Fri, 13 Nov 2020 18:34:13 +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 6E4C61CB18; Fri, 13 Nov 2020 18:34:13 +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 0ADIYDTY020036; Fri, 13 Nov 2020 18:34:13 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ADIYDOo020035; Fri, 13 Nov 2020 18:34:13 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202011131834.0ADIYDOo020035@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 13 Nov 2020 18:34:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367646 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 367646 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 13 Nov 2020 18:34:13 -0000 Author: emaste Date: Fri Nov 13 18:34:13 2020 New Revision: 367646 URL: https://svnweb.freebsd.org/changeset/base/367646 Log: Disable kernel INIT_ALL_ZERO on amd64 It is currently incompatible with kernel ifunc memset. PR: 251083 MFC with: r367577 Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/kern.opts.mk Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Fri Nov 13 18:25:07 2020 (r367645) +++ head/sys/conf/kern.opts.mk Fri Nov 13 18:34:13 2020 (r367646) @@ -68,6 +68,11 @@ __DEFAULT_NO_OPTIONS = \ # affected by KERNEL_SYMBOLS, FORMAT_EXTENSIONS, CTF and SSP. # Things that don't work based on the CPU +.if ${MACHINE} == "amd64" +# PR251083 conflict between INIT_ALL_ZERO and ifunc memset +BROKEN_OPTIONS+= INIT_ALL_ZERO +.endif + .if ${MACHINE_CPUARCH} == "arm" . if ${MACHINE_ARCH:Marmv[67]*} == "" BROKEN_OPTIONS+= CDDL ZFS From owner-svn-src-head@freebsd.org Fri Nov 13 18:50:24 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC37C2EA6D6; Fri, 13 Nov 2020 18:50:24 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXnbN505wz4kyF; Fri, 13 Nov 2020 18:50:24 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9DF3D1C677; Fri, 13 Nov 2020 18:50:24 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ADIoO90026491; Fri, 13 Nov 2020 18:50:24 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ADIoOIe026490; Fri, 13 Nov 2020 18:50:24 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202011131850.0ADIoOIe026490@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 13 Nov 2020 18:50:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367647 - head/tests/sys/vm X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/tests/sys/vm X-SVN-Commit-Revision: 367647 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 13 Nov 2020 18:50:24 -0000 Author: adrian Date: Fri Nov 13 18:50:24 2020 New Revision: 367647 URL: https://svnweb.freebsd.org/changeset/base/367647 Log: [tests] Fix unused variable warning in gcc Reviewed by: markj, imp, cem, Approved by: markj Differential Revision: https://reviews.freebsd.org/D26792 Modified: head/tests/sys/vm/page_fault_signal.c Modified: head/tests/sys/vm/page_fault_signal.c ============================================================================== --- head/tests/sys/vm/page_fault_signal.c Fri Nov 13 18:34:13 2020 (r367646) +++ head/tests/sys/vm/page_fault_signal.c Fri Nov 13 18:50:24 2020 (r367647) @@ -107,7 +107,6 @@ ATF_TC_WITHOUT_HEAD(page_fault_signal__segv_accerr_2); ATF_TC_BODY(page_fault_signal__segv_accerr_2, tc) { int *p; - volatile int dummy; int sz; sz = getpagesize(); @@ -115,7 +114,7 @@ ATF_TC_BODY(page_fault_signal__segv_accerr_2, tc) ATF_REQUIRE(p != MAP_FAILED); if (sigsetjmp(sig_env, 1) == 0) { setup_signals(); - dummy = *p; + (void)*(volatile int *)p; } (void)munmap(p, sz); ATF_CHECK_EQ(SIGSEGV, last_sig); From owner-svn-src-head@freebsd.org Fri Nov 13 19:08:43 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1F3342EB01B; Fri, 13 Nov 2020 19:08:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXp0W06yFz4lvg; Fri, 13 Nov 2020 19:08:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E70361CFB8; Fri, 13 Nov 2020 19:08:42 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ADJ8gRB038840; Fri, 13 Nov 2020 19:08:42 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ADJ8goO038839; Fri, 13 Nov 2020 19:08:42 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202011131908.0ADJ8goO038839@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 13 Nov 2020 19:08:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367648 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 367648 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 13 Nov 2020 19:08:43 -0000 Author: emaste Date: Fri Nov 13 19:08:42 2020 New Revision: 367648 URL: https://svnweb.freebsd.org/changeset/base/367648 Log: Fix `make makeman` after r367577 WITH_INIT_ALL_ZERO and WITH_INIT_ALL_PATTERN are mutually exclusive. The .error when they were both set broke makeman so demote it to a warning (and presumably the compiler will fail on an error later on). We could improve this to make one take precedence but this is sufficient for now. MFC with: r367577 Sponsored by: The FreeBSD Foundation Modified: head/share/mk/bsd.opts.mk Modified: head/share/mk/bsd.opts.mk ============================================================================== --- head/share/mk/bsd.opts.mk Fri Nov 13 18:50:24 2020 (r367647) +++ head/share/mk/bsd.opts.mk Fri Nov 13 19:08:42 2020 (r367648) @@ -88,7 +88,7 @@ __DEFAULT_DEPENDENT_OPTIONS = \ .include .if ${MK_INIT_ALL_PATTERN} == "yes" && ${MK_INIT_ALL_ZERO} == "yes" -.error WITH_INIT_ALL_PATTERN and WITH_INIT_ALL_ZERO are mutually exclusive. +.warning WITH_INIT_ALL_PATTERN and WITH_INIT_ALL_ZERO are mutually exclusive. .endif # From owner-svn-src-head@freebsd.org Fri Nov 13 19:09:22 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1C4062EB030; Fri, 13 Nov 2020 19:09:22 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXp1G0LZDz4mH1; Fri, 13 Nov 2020 19:09:22 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F34D31D330; Fri, 13 Nov 2020 19:09:21 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ADJ9L9D038916; Fri, 13 Nov 2020 19:09:21 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ADJ9LrG038915; Fri, 13 Nov 2020 19:09:21 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202011131909.0ADJ9LrG038915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 13 Nov 2020 19:09:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367649 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 367649 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 13 Nov 2020 19:09:22 -0000 Author: emaste Date: Fri Nov 13 19:09:21 2020 New Revision: 367649 URL: https://svnweb.freebsd.org/changeset/base/367649 Log: src.conf.5: regenerate after r367577 INIT_ALL_ZERO / INIT_ALL_PATTERN Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Fri Nov 13 19:08:42 2020 (r367648) +++ head/share/man/man5/src.conf.5 Fri Nov 13 19:09:21 2020 (r367649) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd November 4, 2020 +.Dd November 13, 2020 .Dt SRC.CONF 5 .Os .Sh NAME @@ -757,6 +757,15 @@ Set to not build .Xr inetd 8 . .It Va WITHOUT_INET_SUPPORT Set to build libraries, programs, and kernel modules without IPv4 support. +.It Va WITH_INIT_ALL_PATTERN +Set to build the base system or kernel with stack variables initialized to +.Pq compiler defined +debugging patterns on function entry. +This option requires the clang compiler. +.It Va WITH_INIT_ALL_ZERO +Set to build the base system or kernel with stack variables initialized +to zero on function entry. +This option requires that the clang compiler be used. .It Va WITHOUT_INSTALLLIB Set this to not install optional libraries. For example, when creating a From owner-svn-src-head@freebsd.org Fri Nov 13 19:13:00 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B2CAD2EB1F8; Fri, 13 Nov 2020 19:13:00 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXp5S2PJdz4mvh; Fri, 13 Nov 2020 19:12:59 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 0ADJCqWQ026795 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 13 Nov 2020 21:12:55 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 0ADJCqWQ026795 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 0ADJCq8T026794; Fri, 13 Nov 2020 21:12:52 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 13 Nov 2020 21:12:52 +0200 From: Konstantin Belousov To: Conrad Meyer Cc: src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r367631 - in head/sys: kern sys Message-ID: References: <202011130931.0AD9VwBL082843@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4CXp5S2PJdz4mvh X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 13 Nov 2020 19:13:00 -0000 On Fri, Nov 13, 2020 at 08:24:30AM -0800, Conrad Meyer wrote: > Hi Konstantin, > > On Fri, Nov 13, 2020 at 1:32 AM Konstantin Belousov wrote: > > > > Author: kib > > Date: Fri Nov 13 09:31:57 2020 > > New Revision: 367631 > > URL: https://svnweb.freebsd.org/changeset/base/367631 > > > > Log: > > Implement vn_lock_pair(). > > > > Modified: head/sys/kern/vfs_vnops.c > > ============================================================================== > > --- head/sys/kern/vfs_vnops.c Fri Nov 13 02:05:45 2020 (r367630) > > +++ head/sys/kern/vfs_vnops.c Fri Nov 13 09:31:57 2020 (r367631) > > @@ -3317,4 +3325,92 @@ vn_fallocate(struct file *fp, off_t offset, off_t len, > > ... > > + > > +static void > > +vn_lock_pair_pause(const char *wmesg) > > +{ > > + atomic_add_long(&vn_lock_pair_pause_cnt, 1); > > + pause(wmesg, prng32_bounded(hz / 10)); > > +} > > This function is called when the try-lock of the second lock in the > pair (either order) fails. The back-off period is up to 100ms, > expected average 50ms. That seems really high? It is called only in deadlock avoidance case, where we already have to drop to slow path for other reasons (this is coming in the patch that I hope to commit today). My selection of numbers were driven by more or less realistic estimates of the vnode lock ownership time for sync io on very busy HDD, there was a short discussion of it with Mark in review. > > Separately: prng32_bounded() may return 0, which is transparently > converted to the equivalent of 1 by pause_sbt(9). This means a 1 tick > pause is marginally more likely than any other possible duration. It > probably doesn't matter. I do not quite understand the point. Do you want the 0->1 conversion be explicit there ? Or something else ? From owner-svn-src-head@freebsd.org Fri Nov 13 19:14:54 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1EA822EB268; Fri, 13 Nov 2020 19:14:54 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXp7d3yQDz4mtM; Fri, 13 Nov 2020 19:14:53 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 0ADJEjMW026842 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 13 Nov 2020 21:14:48 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 0ADJEjMW026842 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 0ADJEjDL026841; Fri, 13 Nov 2020 21:14:45 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 13 Nov 2020 21:14:45 +0200 From: Konstantin Belousov To: Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r367631 - in head/sys: kern sys Message-ID: References: <202011130931.0AD9VwBL082843@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4CXp7d3yQDz4mtM X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 13 Nov 2020 19:14:54 -0000 On Fri, Nov 13, 2020 at 07:30:47PM +0100, Mateusz Guzik wrote: > On 11/13/20, Konstantin Belousov wrote: > > +static u_long vn_lock_pair_pause_cnt; > > +SYSCTL_ULONG(_debug, OID_AUTO, vn_lock_pair_pause, CTLFLAG_RD, > > + &vn_lock_pair_pause_cnt, 0, > > + "Count of vn_lock_pair deadlocks"); > > + > > +static void > > +vn_lock_pair_pause(const char *wmesg) > > +{ > > + atomic_add_long(&vn_lock_pair_pause_cnt, 1); > > + pause(wmesg, prng32_bounded(hz / 10)); > > +} > > + > > +/* > > + * Lock pair of vnodes vp1, vp2, avoiding lock order reversal. > > + * vp1_locked indicates whether vp1 is exclusively locked; if not, vp1 > > + * must be unlocked. Same for vp2 and vp2_locked. One of the vnodes > > + * can be NULL. > > + * > > + * The function returns with both vnodes exclusively locked, and > > + * guarantees that it does not create lock order reversal with other > > + * threads during its execution. Both vnodes could be unlocked > > + * temporary (and reclaimed). > > + */ > > +void > > +vn_lock_pair(struct vnode *vp1, bool vp1_locked, struct vnode *vp2, > > + bool vp2_locked) > > +{ > > + int error; > > + > > + if (vp1 == NULL && vp2 == NULL) > > + return; > > + if (vp1 != NULL) { > > + if (vp1_locked) > > + ASSERT_VOP_ELOCKED(vp1, "vp1"); > > + else > > + ASSERT_VOP_UNLOCKED(vp1, "vp1"); > > + } else { > > + vp1_locked = true; > > + } > > + if (vp2 != NULL) { > > + if (vp2_locked) > > + ASSERT_VOP_ELOCKED(vp2, "vp2"); > > + else > > + ASSERT_VOP_UNLOCKED(vp2, "vp2"); > > + } else { > > + vp2_locked = true; > > + } > > + if (!vp1_locked && !vp2_locked) { > > + vn_lock(vp1, LK_EXCLUSIVE | LK_RETRY); > > + vp1_locked = true; > > + } > > + > > + for (;;) { > > + if (vp1_locked && vp2_locked) > > + break; > > + if (vp1_locked && vp2 != NULL) { > > + if (vp1 != NULL) { > > + error = VOP_LOCK1(vp2, LK_EXCLUSIVE | LK_NOWAIT, > > + __FILE__, __LINE__); > > + if (error == 0) > > + break; > > + VOP_UNLOCK(vp1); > > + vp1_locked = false; > > + vn_lock_pair_pause("vlp1"); > > + } > > + vn_lock(vp2, LK_EXCLUSIVE | LK_RETRY); > > + vp2_locked = true; > > + } > > + if (vp2_locked && vp1 != NULL) { > > + if (vp2 != NULL) { > > + error = VOP_LOCK1(vp1, LK_EXCLUSIVE | LK_NOWAIT, > > + __FILE__, __LINE__); > > + if (error == 0) > > + break; > > + VOP_UNLOCK(vp2); > > + vp2_locked = false; > > + vn_lock_pair_pause("vlp2"); > > + } > > + vn_lock(vp1, LK_EXCLUSIVE | LK_RETRY); > > + vp1_locked = true; > > + } > > + } > > + if (vp1 != NULL) > > + ASSERT_VOP_ELOCKED(vp1, "vp1 ret"); > > + if (vp2 != NULL) > > + ASSERT_VOP_ELOCKED(vp2, "vp2 ret"); > > } > > > > Multiple callers who get here with flipped addresses can end up > failing against each other in an indefinite loop. > > Instead, after initial trylocking fails, the routine should establish > ordering it will follow for itself, for example by sorting by address. > > Then pseudo-code would be: > retry: > vn_lock(lower, ...); > if (!VOP_LOCK(higher, LK_NOWAIT ...)) { > vn_unlock(lower); > vn_lock(higher); > vn_unlock(higher); > goto retry; > } > > Note this also eliminates the pause. I disagree. It will conflict with normal locking order with 50% probability. My code switches between two orders, eventually getting out of this situation. From owner-svn-src-head@freebsd.org Fri Nov 13 19:17:32 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 99FCC2EB2F7 for ; Fri, 13 Nov 2020 19:17:32 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXpBh3p4Zz4mvG for ; Fri, 13 Nov 2020 19:17:32 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wm1-f43.google.com with SMTP id 10so9854716wml.2 for ; Fri, 13 Nov 2020 11:17:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=JeOCoD9b2v9dQ0oaM79ClsfCysF0Vni1Xvvwpd3tcfE=; b=AjbxxHlTOUd38rS23EhmA3dRR/n6TbugAgg05azH5JFHbTZCBVkI+W9I1VQhkgGHrL usBw77dd1dZP9sgCPeeNnfqU9Dqp6FQPZvv8Im5VBgxIdpgua2wmxLinGEwVrC3dUZFT ju/keDdWa8Lcyyua4ePm6QD87BOoolctT63atUDr9Hc/aXas1Rhg5Zvgf8PHR9RRXdc4 gdEFywS38Icwlg5IjFeoYWwsayje6OW94YNqWCLsPL9/dfRh/Ye3u303/mHQ/G8AH8iM yTYrX4Y0AOVHBQfT0VBXfrO1GV7HK9HzDJAFYBKTPNwwWLmTnZ70MiUDArweLjcgu/pz tj4w== X-Gm-Message-State: AOAM533782kpr+6BLzn/zSjaSBlvUkpjlyNMIQvMtKXj2d4LSrFB5I7g UyGMdiNmCEYB8c3vMOPjOsjh4Q== X-Google-Smtp-Source: ABdhPJyKW/GemKGFeUS2CwuWoE/yb0/dVtlaa704r9G71YDNcj40b5k1BdzUavDcLgTHtrCIhAU18A== X-Received: by 2002:a1c:4c0a:: with SMTP id z10mr3966203wmf.96.1605295051046; Fri, 13 Nov 2020 11:17:31 -0800 (PST) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id v16sm11828220wml.33.2020.11.13.11.17.30 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Nov 2020 11:17:30 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: svn commit: r367648 - head/share/mk From: Jessica Clarke In-Reply-To: <202011131908.0ADJ8goO038839@repo.freebsd.org> Date: Fri, 13 Nov 2020 19:17:28 +0000 Cc: src-committers , svn-src-all , svn-src-head@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: <647236BA-1263-4ABA-B03F-3789592EB649@freebsd.org> References: <202011131908.0ADJ8goO038839@repo.freebsd.org> To: Ed Maste X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Rspamd-Queue-Id: 4CXpBh3p4Zz4mvG X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 13 Nov 2020 19:17:32 -0000 On 13 Nov 2020, at 19:08, Ed Maste wrote: > > Author: emaste > Date: Fri Nov 13 19:08:42 2020 > New Revision: 367648 > URL: https://svnweb.freebsd.org/changeset/base/367648 > > Log: > Fix `make makeman` after r367577 > > WITH_INIT_ALL_ZERO and WITH_INIT_ALL_PATTERN are mutually exclusive. > The .error when they were both set broke makeman so demote it to a > warning (and presumably the compiler will fail on an error later on). > > We could improve this to make one take precedence but this is sufficient > for now. You won't get an error. Currently bsd.{prog,lib}.mk and kern.mk check MK_INIT_ALL_ZERO then MK_INIT_ALL_PATTERN so the former takes precedence, but I suspect that if you were to pass the compiler flags for both the last flag would just override anything else, as is the case for most compiler flags. Jess From owner-svn-src-head@freebsd.org Fri Nov 13 19:22:54 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 04F6A2EB88C; Fri, 13 Nov 2020 19:22:54 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXpJs6hF0z4nLn; Fri, 13 Nov 2020 19:22:53 +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 D8DCA1D552; Fri, 13 Nov 2020 19:22:53 +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 0ADJMrjk051010; Fri, 13 Nov 2020 19:22:53 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ADJMrmC051009; Fri, 13 Nov 2020 19:22:53 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011131922.0ADJMrmC051009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 13 Nov 2020 19:22:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367650 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 367650 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 13 Nov 2020 19:22:54 -0000 Author: mjg Date: Fri Nov 13 19:22:53 2020 New Revision: 367650 URL: https://svnweb.freebsd.org/changeset/base/367650 Log: malloc: retire MALLOC_PROFILE The global array has prohibitive performance impact on multicore systems. The same data (and more) can be obtained with dtrace. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D27199 Modified: head/sys/kern/kern_malloc.c Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Fri Nov 13 19:09:21 2020 (r367649) +++ head/sys/kern/kern_malloc.c Fri Nov 13 19:22:53 2020 (r367650) @@ -223,12 +223,6 @@ SYSCTL_PROC(_vm_malloc, OID_AUTO, zone_sizes, */ struct mtx malloc_mtx; -#ifdef MALLOC_PROFILE -uint64_t krequests[KMEM_ZSIZE + 1]; - -static int sysctl_kern_mprof(SYSCTL_HANDLER_ARGS); -#endif - static int sysctl_kern_malloc_stats(SYSCTL_HANDLER_ARGS); #if defined(MALLOC_MAKE_FAILURES) || (MALLOC_DEBUG_MAXZONES > 1) @@ -635,9 +629,6 @@ void * size = (size & ~KMEM_ZMASK) + KMEM_ZBASE; indx = kmemsize[size >> KMEM_ZSHIFT]; zone = kmemzones[indx].kz_zone[mtp_get_subzone(mtp)]; -#ifdef MALLOC_PROFILE - krequests[size >> KMEM_ZSHIFT]++; -#endif va = uma_zalloc(zone, flags); if (va != NULL) size = zone->uz_size; @@ -673,9 +664,6 @@ malloc_domain(size_t *sizep, int *indxp, struct malloc size = (size & ~KMEM_ZMASK) + KMEM_ZBASE; indx = kmemsize[size >> KMEM_ZSHIFT]; zone = kmemzones[indx].kz_zone[mtp_get_subzone(mtp)]; -#ifdef MALLOC_PROFILE - krequests[size >> KMEM_ZSHIFT]++; -#endif va = uma_zalloc_domain(zone, NULL, domain, flags); if (va != NULL) *sizep = zone->uz_size; @@ -1495,52 +1483,3 @@ DB_SHOW_COMMAND(multizone_matches, db_show_multizone_m } #endif /* MALLOC_DEBUG_MAXZONES > 1 */ #endif /* DDB */ - -#ifdef MALLOC_PROFILE - -static int -sysctl_kern_mprof(SYSCTL_HANDLER_ARGS) -{ - struct sbuf sbuf; - uint64_t count; - uint64_t waste; - uint64_t mem; - int error; - int rsize; - int size; - int i; - - waste = 0; - mem = 0; - - error = sysctl_wire_old_buffer(req, 0); - if (error != 0) - return (error); - sbuf_new_for_sysctl(&sbuf, NULL, 128, req); - sbuf_printf(&sbuf, - "\n Size Requests Real Size\n"); - for (i = 0; i < KMEM_ZSIZE; i++) { - size = i << KMEM_ZSHIFT; - rsize = kmemzones[kmemsize[i]].kz_size; - count = (long long unsigned)krequests[i]; - - sbuf_printf(&sbuf, "%6d%28llu%11d\n", size, - (unsigned long long)count, rsize); - - if ((rsize * count) > (size * count)) - waste += (rsize * count) - (size * count); - mem += (rsize * count); - } - sbuf_printf(&sbuf, - "\nTotal memory used:\t%30llu\nTotal Memory wasted:\t%30llu\n", - (unsigned long long)mem, (unsigned long long)waste); - error = sbuf_finish(&sbuf); - sbuf_delete(&sbuf); - return (error); -} - -SYSCTL_OID(_kern, OID_AUTO, mprof, - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, NULL, 0, - sysctl_kern_mprof, "A", - "Malloc Profiling"); -#endif /* MALLOC_PROFILE */ From owner-svn-src-head@freebsd.org Fri Nov 13 19:47:17 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2A96C2EC128; Fri, 13 Nov 2020 19:47:17 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXps10jqlz4pp2; Fri, 13 Nov 2020 19:47:17 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0BF0E1D992; Fri, 13 Nov 2020 19:47:17 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ADJlGvq064617; Fri, 13 Nov 2020 19:47:16 GMT (envelope-from bcran@FreeBSD.org) Received: (from bcran@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ADJlGbr064616; Fri, 13 Nov 2020 19:47:16 GMT (envelope-from bcran@FreeBSD.org) Message-Id: <202011131947.0ADJlGbr064616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcran set sender to bcran@FreeBSD.org using -f From: Rebecca Cran Date: Fri, 13 Nov 2020 19:47:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367651 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: bcran X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 367651 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 13 Nov 2020 19:47:17 -0000 Author: bcran Date: Fri Nov 13 19:47:16 2020 New Revision: 367651 URL: https://svnweb.freebsd.org/changeset/base/367651 Log: bhyve: update smbiostbl.c to bump the version and release date Since lots of work has been done on bhyve since 2014, increase the version to 13.0 to match 13-CURRENT, and update the release date. Reviewed by: grehan Differential Revision: https://reviews.freebsd.org/D27147 Modified: head/usr.sbin/bhyve/smbiostbl.c Modified: head/usr.sbin/bhyve/smbiostbl.c ============================================================================== --- head/usr.sbin/bhyve/smbiostbl.c Fri Nov 13 19:22:53 2020 (r367650) +++ head/usr.sbin/bhyve/smbiostbl.c Fri Nov 13 19:47:16 2020 (r367651) @@ -51,6 +51,9 @@ __FBSDID("$FreeBSD$"); #define SMBIOS_BASE 0xF1000 +#define FIRMWARE_VERSION "13.0" +#define FIRMWARE_RELEASE_DATE "11/10/2020" + /* BHYVE_ACPI_BASE - SMBIOS_BASE) */ #define SMBIOS_MAX_LENGTH (0xF2400 - 0xF1000) @@ -323,9 +326,9 @@ struct smbios_table_type0 smbios_type0_template = { }; const char *smbios_type0_strings[] = { - "BHYVE", /* vendor string */ - "1.00", /* bios version string */ - "03/14/2014", /* bios release date string */ + "BHYVE", /* vendor string */ + FIRMWARE_VERSION, /* bios version string */ + FIRMWARE_RELEASE_DATE, /* bios release date string */ NULL }; From owner-svn-src-head@freebsd.org Fri Nov 13 19:55:24 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 64BA62EC580; Fri, 13 Nov 2020 19:55:24 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXq2N2L4Dz4qWb; Fri, 13 Nov 2020 19:55:24 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f172.google.com (mail-qt1-f172.google.com [209.85.160.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 3D5213D1B; Fri, 13 Nov 2020 19:55:24 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f172.google.com with SMTP id 3so7587225qtx.3; Fri, 13 Nov 2020 11:55:24 -0800 (PST) X-Gm-Message-State: AOAM533BnviqK/Ub+IMatZRPwmzX7KP/nP/NilOtaFjXPA1mnWCWt4ow au40mpf/vWwmhYX2wLsNHjGiFIcbIAmPR/7VWT4= X-Google-Smtp-Source: ABdhPJwq2JGaCiUBLCVIyybWevIULGNLJSALwe6MLPb11Z33OIFUIDhS3RNHlYWGTtUID5e7vK0ZMUYJSvhNvttD0D4= X-Received: by 2002:ac8:4e87:: with SMTP id 7mr3416242qtp.310.1605297323419; Fri, 13 Nov 2020 11:55:23 -0800 (PST) MIME-Version: 1.0 References: <202011131850.0ADIoOIe026490@repo.freebsd.org> In-Reply-To: <202011131850.0ADIoOIe026490@repo.freebsd.org> From: Kyle Evans Date: Fri, 13 Nov 2020 13:55:09 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r367647 - head/tests/sys/vm To: Adrian Chadd Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 13 Nov 2020 19:55:24 -0000 On Fri, Nov 13, 2020 at 12:50 PM Adrian Chadd wrote: > > Author: adrian > Date: Fri Nov 13 18:50:24 2020 > New Revision: 367647 > URL: https://svnweb.freebsd.org/changeset/base/367647 > > Log: > [tests] Fix unused variable warning in gcc > > Reviewed by: markj, imp, cem, > Approved by: markj > Differential Revision: https://reviews.freebsd.org/D26792 > > Modified: > head/tests/sys/vm/page_fault_signal.c > > Modified: head/tests/sys/vm/page_fault_signal.c > ============================================================================== > --- head/tests/sys/vm/page_fault_signal.c Fri Nov 13 18:34:13 2020 (r367646) > +++ head/tests/sys/vm/page_fault_signal.c Fri Nov 13 18:50:24 2020 (r367647) > @@ -115,7 +114,7 @@ ATF_TC_BODY(page_fault_signal__segv_accerr_2, tc) > ATF_REQUIRE(p != MAP_FAILED); > if (sigsetjmp(sig_env, 1) == 0) { > setup_signals(); > - dummy = *p; > + (void)*(volatile int *)p; > } > (void)munmap(p, sz); > ATF_CHECK_EQ(SIGSEGV, last_sig); A minor nit, we could/should probably add an explicit atf_tc_fail() after the access. While it seems unlikely that the compiler might elide it and it would still fail anyways because last_sig would certainly not be SIGSEGV, it'd be good to catch it earlier with an explicit fail. I don't recall how good atf-c's diagnostics are otherwise, if it'd be clear that last_sig == 0 or not without requiring further triage. Thanks, Kyle Evans From owner-svn-src-head@freebsd.org Fri Nov 13 20:03:19 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 133232EC33B for ; Fri, 13 Nov 2020 20:03:19 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXqCV5j4yz4qj1 for ; Fri, 13 Nov 2020 20:03:18 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qk1-x733.google.com with SMTP id y197so9974533qkb.7 for ; Fri, 13 Nov 2020 12:03:18 -0800 (PST) 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; bh=PhJ1AV869pj3vOC8tLB/cyOkeOKryxJuwkoxHkKl1Ik=; b=ASf9fiTB3lLQR7OXfaY1F1Cz7kHswMkfIfGq8SxtfaUfFDVjrwSR5IdNJzZCwW6Cwg yTjmZstcpgo40udqHcrgpJ5AdO6n8tdqxWzVAi8I9UlodjlHgEgbMEc816hqo1VQgxbZ d5vnBwoB9StyLdIibE5mDyY2qEZnv627hPCwwxS9H7E2inpV0rynabMAnHTJMOuchvr6 FWIn3U8E30y94jmFeAhjbEgZIRkrIXhoBVsqSyHNcdHAFyagPoubPRw1vdS9tbPX0VbU nlTnKKDYCRhVzpp0SFsxkiyocSNIsrThQcwqXhCyEIvBVdR9PystnCpPwDO+b6C4/HOH 7MZw== 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; bh=PhJ1AV869pj3vOC8tLB/cyOkeOKryxJuwkoxHkKl1Ik=; b=pvkolC8RsX1SG+siclL1OnR1MkL6wqkVN1C2gNXjLmelSAk1jzjbspJdF4MTXFVh3l yGf3TmwEi4ccPjueJlYLW8Ti9eqGtneC7XZMTIq3atAyBUbJsPRjlkWZj7ShyPajcVeP 0od1ZB/78bHTU3JIAlj4kgCgwHT0qMb/23yY+CMTfXxXMQzBMAPIp4hrbG11NGouVTWF XyDevndgu1AauHcSM1bZDZQQ6kG3BBYlvhmY8xE6VL1Z+FiWwDidQzaW4+E/sC26IYBw 9A61IVMN4Wl7amu+7CrFQBGzERlLhZ723AeoeeEGSpP0Uh1946rDe6yQ8Kjyfi+5bmMK FYwQ== X-Gm-Message-State: AOAM533EIkDyQx4xaD45YfpxSjw/7YuVMzDJLn6FHx/XA7lz/OJfp65s cYkXhm2HZ8kfmEZCYr4A/EGBPw== X-Google-Smtp-Source: ABdhPJy6y4Zj3rw6ufdgNNgnG/DZRDGodPOHia+y4IstZEtmlxeg8Va1pHLd28HOYC5D1DBkliW7gw== X-Received: by 2002:a37:7846:: with SMTP id t67mr3654501qkc.196.1605297797689; Fri, 13 Nov 2020 12:03:17 -0800 (PST) Received: from mutt-hbsd ([38.140.209.220]) by smtp.gmail.com with ESMTPSA id s68sm7418700qkc.43.2020.11.13.12.03.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Nov 2020 12:03:16 -0800 (PST) Date: Fri, 13 Nov 2020 15:03:16 -0500 From: Shawn Webb To: Rebecca Cran Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r367651 - head/usr.sbin/bhyve Message-ID: <20201113200316.3wa4xfdu6hohk4ny@mutt-hbsd> X-Operating-System: FreeBSD mutt-hbsd 13.0-CURRENT-HBSD FreeBSD 13.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0xFF2E67A277F8E1FA References: <202011131947.0ADJlGbr064616@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="uxhql5wmb3dysgfy" Content-Disposition: inline In-Reply-To: <202011131947.0ADJlGbr064616@repo.freebsd.org> X-Rspamd-Queue-Id: 4CXqCV5j4yz4qj1 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 13 Nov 2020 20:03:19 -0000 --uxhql5wmb3dysgfy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 13, 2020 at 07:47:16PM +0000, Rebecca Cran wrote: > Author: bcran > Date: Fri Nov 13 19:47:16 2020 > New Revision: 367651 > URL: https://svnweb.freebsd.org/changeset/base/367651 >=20 > Log: > bhyve: update smbiostbl.c to bump the version and release date > =20 > Since lots of work has been done on bhyve since 2014, increase the vers= ion > to 13.0 to match 13-CURRENT, and update the release date. > =20 > Reviewed by: grehan > Differential Revision: https://reviews.freebsd.org/D27147 >=20 > Modified: > head/usr.sbin/bhyve/smbiostbl.c >=20 > Modified: head/usr.sbin/bhyve/smbiostbl.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.sbin/bhyve/smbiostbl.c Fri Nov 13 19:22:53 2020 (r367650) > +++ head/usr.sbin/bhyve/smbiostbl.c Fri Nov 13 19:47:16 2020 (r367651) > @@ -51,6 +51,9 @@ __FBSDID("$FreeBSD$"); > =20 > #define SMBIOS_BASE 0xF1000 > =20 > +#define FIRMWARE_VERSION "13.0" > +#define FIRMWARE_RELEASE_DATE "11/10/2020" Style nit: shouldn't there be a tab between #define and the macro? Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD GPG Key ID: 0xFF2E67A277F8E1FA GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9 3633 C85B 0AF8 AB23 0FB2 https://git-01.md.hardenedbsd.org/HardenedBSD/pubkeys/src/branch/master/Sha= wn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --uxhql5wmb3dysgfy Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAl+u5oEACgkQ/y5nonf4 4froNw//XrQjOJkNUJo3JwCg/8pPd5XmFVOQLFIVtPT2RjcEOYv5i5gyy0dhOTqp C9GfEcK56/YYFvf5kX37mxVol4FOy2umM54RQNvXAujTDpCkoI5cPCOx8+JSlI5W hAwYx/eeK8mq+NPc1crvINIlHVeByQ1RLrAwbACcoGjWaJV0oFTqs6KBZtW9uP/B gNtb0dNHpEnNx2wXnA8PIKRgiLjduo1IlWxXjVSMu4eFRECAkbxmBr5Y8yg5Rg+N bx1hj1vfUzGzgwABEBzUZOP61KLJU0Jexks1wgITCcS3qh8hgX+D5Qc6eUDbDsdT DZ2udzsc7q5mLg2X03WY7X5QOog3jMesN+PaHOKUv1y9sl2MnysvkWkVqk4B4bWK xvi5s3Bh14XI7mEDwEN1gD8hELCexbYaN/0xHJGoVaADRsEpGWo5oDcrk2kFi6Bb Le8E3uHobhn6ykcmb/UIYKvWoog2OqDLV3Ibbjyun4xkMtRZ5Ca4Ip+AB2VxSAZd KOjk18z1xC7SArL+j3bsfoaY4tKHKRWk9tRL8qsLIEjPpODygHSA6G0WIPUJdnLJ IsFbBKpaby64BnXHFNYBIpP1QzFIobYYsxX0VUV14ZgjxTZ8t9Jz2/0fPRmTF0Hw 8stuTSryalyvrRQPTy9nT0ABjTeKw5XuI6sUD4YgIKLEx7DM6hw= =jdcg -----END PGP SIGNATURE----- --uxhql5wmb3dysgfy-- From owner-svn-src-head@freebsd.org Fri Nov 13 21:07:10 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 289102ED8B2; Fri, 13 Nov 2020 21:07:10 +0000 (UTC) (envelope-from rebecca@bsdio.com) Received: from out03.mta.xmission.com (out03.mta.xmission.com [166.70.13.233]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXrdB08PYz4vFf; Fri, 13 Nov 2020 21:07:09 +0000 (UTC) (envelope-from rebecca@bsdio.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=simple/simple; d=bsdio.com; s=xmission; h=Subject:Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:Cc:To:Sender:Reply-To:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe :List-Post:List-Owner:List-Archive; bh=HQTP27XK4mm3BJ6kc7WPQRedlDnfTfNybP7hjpQslsk=; b=mwuBJdag8mvV0bJ1g7ARmCgV4N muLxoob47dic1tcCpQJ+IZYEjJVUveA1cKzmsyFDljS19q58ek4a/Ar29DpaDhmUW8Zse+EIv95cJ 39SjpfOv6ZPSFhvnwqViXv/zQu6xHSqmhgmoQVHLmOv2/BaKqxQrsBKJIi9TQjT7n33U=; Received: from in01.mta.xmission.com ([166.70.13.51]) by out03.mta.xmission.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1kdgHj-00AOA0-L5; Fri, 13 Nov 2020 14:07:07 -0700 Received: from mta4.zcs.xmission.com ([166.70.13.68]) by in01.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.87) (envelope-from ) id 1kdgHj-0005kY-4B; Fri, 13 Nov 2020 14:07:07 -0700 Received: from localhost (localhost [127.0.0.1]) by mta4.zcs.xmission.com (Postfix) with ESMTP id D7798500203; Fri, 13 Nov 2020 14:07:06 -0700 (MST) X-Amavis-Modified: Mail body modified (using disclaimer) - mta4.zcs.xmission.com Received: from mta4.zcs.xmission.com ([127.0.0.1]) by localhost (mta4.zcs.xmission.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id jMRRXhs348xl; Fri, 13 Nov 2020 14:07:06 -0700 (MST) Received: from [10.0.10.142] (c-174-52-16-57.hsd1.ut.comcast.net [174.52.16.57]) by mta4.zcs.xmission.com (Postfix) with ESMTPSA id 9ECF35001C5; Fri, 13 Nov 2020 14:07:06 -0700 (MST) To: Shawn Webb , Rebecca Cran Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202011131947.0ADJlGbr064616@repo.freebsd.org> <20201113200316.3wa4xfdu6hohk4ny@mutt-hbsd> From: Rebecca Cran Message-ID: <57dc312b-2264-22cd-0ef1-31083d404d4c@bsdio.com> Date: Fri, 13 Nov 2020 14:07:05 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <20201113200316.3wa4xfdu6hohk4ny@mutt-hbsd> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-XM-SPF: eid=1kdgHj-0005kY-4B; ; ; mid=<57dc312b-2264-22cd-0ef1-31083d404d4c@bsdio.com>; ; ; hst=in01.mta.xmission.com; ; ; ip=166.70.13.68; ; ; frm=rebecca@bsdio.com; ; ; spf=none X-SA-Exim-Connect-IP: 166.70.13.68 X-SA-Exim-Mail-From: rebecca@bsdio.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on sa08.xmission.com X-Spam-Level: X-Spam-Status: No, score=0.1 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,NICE_REPLY_A,T_TM2_M_HEADER_IN_MSG,TooManyTo_001 autolearn=disabled version=3.4.2 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5001] * 0.3 TooManyTo_001 Multiple "To" Header Recipients 2x (uncommon) * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa08 1397; IP=ok Body=1 Fuz1=1] [Fuz2=1] * -0.0 NICE_REPLY_A Looks like a legit reply (A) X-Spam-DCC: XMission; sa08 1397; IP=ok Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Shawn Webb , Rebecca Cran X-Spam-Relay-Country: X-Spam-Timing: total 308 ms - load_scoreonly_sql: 0.05 (0.0%), signal_user_changed: 14 (4.4%), b_tie_ro: 11 (3.7%), parse: 1.46 (0.5%), extract_message_metadata: 5.0 (1.6%), get_uri_detail_list: 0.24 (0.1%), tests_pri_-1000: 3.0 (1.0%), tests_pri_-950: 1.78 (0.6%), tests_pri_-900: 1.46 (0.5%), tests_pri_-90: 105 (34.3%), check_bayes: 103 (33.5%), b_tokenize: 6 (2.0%), b_tok_get_all: 5.0 (1.6%), b_comp_prob: 2.2 (0.7%), b_tok_touch_all: 84 (27.4%), b_finish: 1.56 (0.5%), tests_pri_0: 160 (52.2%), check_dkim_signature: 0.47 (0.2%), check_dkim_adsp: 75 (24.3%), poll_dns_idle: 68 (22.2%), tests_pri_10: 3.9 (1.3%), tests_pri_500: 9 (2.8%), rewrite_mail: 0.00 (0.0%) Subject: Re: svn commit: r367651 - head/usr.sbin/bhyve X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) X-Rspamd-Queue-Id: 4CXrdB08PYz4vFf X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 13 Nov 2020 21:07:10 -0000 On 11/13/20 1:03 PM, Shawn Webb wrote: > > Style nit: shouldn't there be a tab between #define and the macro? Thanks, I'll try and remember that in future. -- Rebecca Cran From owner-svn-src-head@freebsd.org Fri Nov 13 22:45:31 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 504A92EF4B4; Fri, 13 Nov 2020 22:45:31 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXtpg1gPzz3GPH; Fri, 13 Nov 2020 22:45:31 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C25C1F573; Fri, 13 Nov 2020 22:45:31 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ADMjVpk076406; Fri, 13 Nov 2020 22:45:31 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ADMjRP1076384; Fri, 13 Nov 2020 22:45:27 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <202011132245.0ADMjRP1076384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 13 Nov 2020 22:45:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367654 - in head/sys/contrib/dev/acpica: . common compiler components/events components/namespace include X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in head/sys/contrib/dev/acpica: . common compiler components/events components/namespace include X-SVN-Commit-Revision: 367654 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 13 Nov 2020 22:45:31 -0000 Author: jkim Date: Fri Nov 13 22:45:26 2020 New Revision: 367654 URL: https://svnweb.freebsd.org/changeset/base/367654 Log: MFV: r367652 Merge ACPICA 20201113. Modified: head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/common/ahuuids.c head/sys/contrib/dev/acpica/compiler/aslbtypes.c head/sys/contrib/dev/acpica/compiler/aslcodegen.c head/sys/contrib/dev/acpica/compiler/aslmap.c head/sys/contrib/dev/acpica/compiler/aslmessages.c head/sys/contrib/dev/acpica/compiler/aslmessages.h head/sys/contrib/dev/acpica/compiler/aslnamesp.c head/sys/contrib/dev/acpica/compiler/aslopcodes.c head/sys/contrib/dev/acpica/compiler/aslprimaries.y head/sys/contrib/dev/acpica/compiler/aslrules.y head/sys/contrib/dev/acpica/compiler/asltypes.y head/sys/contrib/dev/acpica/components/events/evregion.c head/sys/contrib/dev/acpica/components/namespace/nspredef.c head/sys/contrib/dev/acpica/components/namespace/nsprepkg.c head/sys/contrib/dev/acpica/components/namespace/nsrepair2.c head/sys/contrib/dev/acpica/include/accommon.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/acuuid.h Directory Properties: head/sys/contrib/dev/acpica/ (props changed) Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Fri Nov 13 21:41:47 2020 (r367653) +++ head/sys/contrib/dev/acpica/changes.txt Fri Nov 13 22:45:26 2020 (r367654) @@ -1,6 +1,94 @@ ---------------------------------------- +13 November 2020. Summary of changes for version 20201113: + +This release is available at https://acpica.org/downloads + + +1) ACPICA kernel-resident subsystem: + +Interpreter: fixed a memory leak by using use existing buffer in _HID +repair. There was a memory leak that occurred when a _CID object is +defined as a package containing string objects. When _CID is checked for +any possible repairs, it calls a helper function to repair _HID (because +_CID basically contains multiple _HID entries). The _HID repair function +assumes that string objects are standalone objects that are not contained +inside of any packages. The _HID repair function replaced the string +object with a brand new object and attempted to delete the old object by +decrementing the reference count of the old object. Strings inside of +packages have a reference count of 2 so the _HID repair function leaves +this object in a dangling state and causes a memory leak. Instead of +allocating a brand new object and removing the old object, use the +existing object when repairing the _HID object. + +Added function trace macros to improve namespace debugging. The namespace +repair mechanism does not have function tracing macros. Add several trace +macros to improve debuggability. + +Handle "orphan" _REG methods for GPIO OpRegions. Before this change +AcpiEvExecuteRegMethods() had special handling to handle "orphan" (no +matching OpRegion declared) _REG methods for EC nodes. On Intel Cherry +Trail devices there are 2 possible ACPI OpRegions for accessing GPIOs. +The standard GeneralPurposeIo OpRegion and the Cherry Trail - specific +UserDefined 0x9X OpRegions. Having 2 different types of OpRegions leads +to potential issues with checks for OpRegion availability, or in other +words checks if _REG has been called for the OpRegion which the ACPI code +wants to use. Except for the "orphan" EC handling, ACPICA core does not +call _REG on an ACPI node which does not define an OpRegion matching the +type being registered; and the reference design DSDT, from which most +Cherry Trail DSDTs are derived, does not define GeneralPurposeIo, nor +UserDefined(0x93) OpRegions for the GPO2 (UID 3) device, because no pins +were assigned ACPI controlled functions in the reference design. Together +this leads to the perfect storm, at least on the Cherry Trail based +Medion Akayo E1239T. This design does use a GPO2 pin from its ACPI code +and has added the Cherry Trail specific UserDefined(0x93) opregion to its +GPO2 ACPI node to access this pin. But it uses a "has _REG been called" +availability check for the standard GeneralPurposeIo OpRegion. This +clearly is a bug in the DSDT, but this does work under Windows. This +issue leads to the intel vbtn driver reporting the device always being in +tablet-mode at boot, even if it is in laptop mode. Which in turn causes +userspace to ignore touchpad events. So in other words, this issue causes +the touchpad to not work at boot. This change fixes this by extending the +"orphan" _REG method handling to also apply to GPIO address-space +handlers. + + +2) iASL Compiler/Disassembler and ACPICA tools: + +iASL: Added more info to namespace dump file (-ln option). In a separate +section of the dump file (after the main namespace dump), emit the full +pathname for each namespace node, its type, and the ASL filename and line +number where it is declared. + +AcpiHelp: Added an option to display/decode iASL exceptions. Option is: - +x [Hex Value] where "Hex Value" is the iASL exception code. If Hex Value +is omitted, all iASL exceptions are displayed. + +iASL: Use StringLiteral instead of StringData for some ASL macros. The +use of the stringData rule allows for some "string" oriented opcodes +(Such as ToString, ToHexString, etc.) None of which make sense with the +macros in question. This change modifies the StringData part of the rule +for these macros to a simple string literal - thus disallowing the use +of ToString, ToHexString, etc. +The following ASL operators (macros) are affected: +EisaId +Fprintf +Printf +ToUuid +Unicode +Note: The MS compiler requires the use of string literals for these +operators also. + +iASL: Added a remark for an unknown UUID: ASL_MSG_UUID_NOT_FOUND. Search +the list of "known" UUIDs for the input to the ToUUID macro. + +Added 5 new UUIDs to the known UUID table. All related to NVDIMM and the +NFIT table. + + +---------------------------------------- + 25 September 2020. Summary of changes for version 20200925: This release is available at https://acpica.org/downloads @@ -41,7 +129,7 @@ names: _SBT _SBW -AML Disassembler: Added a new command, "All ". This command will evaluate all objects in the current namespace whose NameString contains the input NameSeg as the last element of the NameString. Useful for debugging. @@ -55,6 +143,11 @@ with lengths that exceed the initializer list. iASL: added more detail to external resolution error message when compiling multiple definition blocks. +iASL: added a remark for an attempt to create a nameseg or namestring +containing lower-case letters. This should prevent declaring multiple +namesegs or namestrings in an attempt to refer to different objects (with +different cases), but actually refer to the same object(s). + iASL: improve alias analysis by saving object type. If the alias is a method type, the parameter count is also recorded. @@ -3702,7 +3795,7 @@ iASL compiler, all ACPICA utilities, and the test suit Events: Introduce ACPI_GPE_DISPATCH_RAW_HANDLER to fix GPE storm issues. A raw gpe handling mechanism was created to allow better handling of GPE storms that aren't easily managed by the normal handler. The raw handler -allows disabling/renabling of the the GPE so that interrupt storms can be +allows disabling/renabling of the GPE so that interrupt storms can be avoided in cases where events cannot be timely serviced. In this scenario, handlers should use the AcpiSetGpe() API to disable/enable the GPE. This API will leave the reference counts undisturbed, thereby Modified: head/sys/contrib/dev/acpica/common/ahuuids.c ============================================================================== --- head/sys/contrib/dev/acpica/common/ahuuids.c Fri Nov 13 21:41:47 2020 (r367653) +++ head/sys/contrib/dev/acpica/common/ahuuids.c Fri Nov 13 22:45:26 2020 (r367654) @@ -181,6 +181,7 @@ const AH_UUID Gbl_AcpiUuids[] = {"Physical Presence Interface", UUID_PHYSICAL_PRESENCE}, {"[Non-volatile DIMM and NFIT table]", NULL}, + {"NVDIMM Device", UUID_NFIT_DIMM}, {"Volatile Memory Region", UUID_VOLATILE_MEMORY}, {"Persistent Memory Region", UUID_PERSISTENT_MEMORY}, {"NVDIMM Control Region", UUID_CONTROL_REGION}, @@ -189,6 +190,10 @@ const AH_UUID Gbl_AcpiUuids[] = {"Volatile Virtual CD", UUID_VOLATILE_VIRTUAL_CD}, {"Persistent Virtual Disk", UUID_PERSISTENT_VIRTUAL_DISK}, {"Persistent Virtual CD", UUID_PERSISTENT_VIRTUAL_CD}, + {"Microsoft NVDIMM Command set",UUID_NFIT_DIMM_N_MSFT}, + {"HP NDIMM HPE1", UUID_NFIT_DIMM_N_HPE1}, + {"HP NDIMM HPE2", UUID_NFIT_DIMM_N_HPE2}, + {"Virtual NVDIMM", UUID_NFIT_DIMM_N_HYPERV}, {"[Processor Properties]", NULL}, {"Cache Properties", UUID_CACHE_PROPERTIES}, Modified: head/sys/contrib/dev/acpica/compiler/aslbtypes.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslbtypes.c Fri Nov 13 21:41:47 2020 (r367653) +++ head/sys/contrib/dev/acpica/compiler/aslbtypes.c Fri Nov 13 22:45:26 2020 (r367654) @@ -672,7 +672,7 @@ AnMapObjTypeToBtype ( * * PARAMETERS: Btype - Bitfield of ACPI types * - * RETURN: The Etype corresponding the the Btype + * RETURN: The Etype corresponding the Btype * * DESCRIPTION: Convert a bitfield type to an encoded type * Modified: head/sys/contrib/dev/acpica/compiler/aslcodegen.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcodegen.c Fri Nov 13 21:41:47 2020 (r367653) +++ head/sys/contrib/dev/acpica/compiler/aslcodegen.c Fri Nov 13 22:45:26 2020 (r367654) @@ -700,7 +700,7 @@ CgUpdateHeader ( Checksum = (UINT8) (0 - Sum); - /* Re-write the the checksum byte */ + /* Re-write the checksum byte */ FlSeekFile (ASL_FILE_AML_OUTPUT, Op->Asl.FinalAmlOffset + ACPI_OFFSET (ACPI_TABLE_HEADER, Checksum)); Modified: head/sys/contrib/dev/acpica/compiler/aslmap.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmap.c Fri Nov 13 21:41:47 2020 (r367653) +++ head/sys/contrib/dev/acpica/compiler/aslmap.c Fri Nov 13 22:45:26 2020 (r367654) @@ -538,7 +538,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] = /* TYPE_TRANSLATION */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0), /* UART_SERIALBUS */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), /* UART_SERIALBUSV2 */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), -/* UNICODE */ OP_TABLE_ENTRY (AML_BUFFER_OP, 0, OP_AML_PACKAGE, 0), +/* UNICODE */ OP_TABLE_ENTRY (AML_BUFFER_OP, 0, OP_AML_PACKAGE, ACPI_BTYPE_BUFFER), /* UNLOAD */ OP_TABLE_ENTRY (AML_UNLOAD_OP, 0, 0, 0), /* UPDATERULE_ONES */ OP_TABLE_ENTRY (AML_BYTE_OP, AML_FIELD_UPDATE_WRITE_AS_ONES, 0, 0), /* UPDATERULE_PRESERVE */ OP_TABLE_ENTRY (AML_BYTE_OP, AML_FIELD_UPDATE_PRESERVE, 0, 0), Modified: head/sys/contrib/dev/acpica/compiler/aslmessages.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmessages.c Fri Nov 13 21:41:47 2020 (r367653) +++ head/sys/contrib/dev/acpica/compiler/aslmessages.c Fri Nov 13 22:45:26 2020 (r367654) @@ -384,6 +384,7 @@ const char *AslCompilerMsgs [] = /* ASL_MSG_EXTERNAL_FOUND_HERE */ "External declaration below ", /* ASL_MSG_LOWER_CASE_NAMESEG */ "At least one lower case letter found in NameSeg, ASL is case insensitive - converting to upper case", /* ASL_MSG_LOWER_CASE_NAMEPATH */ "At least one lower case letter found in NamePath, ASL is case insensitive - converting to upper case", +/* ASL_MSG_UUID_NOT_FOUND */ "Unknown UUID string" }; /* Table compiler */ @@ -457,7 +458,7 @@ AeDecodeMessageId ( if (Index >= ACPI_ARRAY_LENGTH (AslCompilerMsgs)) { - return ("[Unknown ASL Compiler exception ID]"); + return ("[Unknown iASL Compiler exception ID]"); } } @@ -470,7 +471,7 @@ AeDecodeMessageId ( if (Index >= ACPI_ARRAY_LENGTH (AslTableCompilerMsgs)) { - return ("[Unknown Table Compiler exception ID]"); + return ("[Unknown iASL Table Compiler exception ID]"); } } @@ -483,7 +484,7 @@ AeDecodeMessageId ( if (Index >= ACPI_ARRAY_LENGTH (AslPreprocessorMsgs)) { - return ("[Unknown Preprocessor exception ID]"); + return ("[Unknown iASL Preprocessor exception ID]"); } } @@ -491,7 +492,7 @@ AeDecodeMessageId ( else { - return ("[Unknown exception/component ID]"); + return ("[Unknown iASL exception ID]"); } return (MessageTable[Index]); @@ -559,3 +560,79 @@ AeBuildFullExceptionCode ( */ return (((Level + 1) * 1000) + MessageId); } + + +#ifdef ACPI_HELP_APP +/******************************************************************************* + * + * FUNCTION: AhDecodeAslException + * + * PARAMETERS: HexString - iASL status string from command line, in + * hex. If null, display all exceptions. + * + * RETURN: None + * + * DESCRIPTION: Decode and display an iASL exception code. Note1: a + * NULL string for HexString displays all known iASL exceptions. Note2: + * implements the -x option for AcpiHelp. + * + ******************************************************************************/ + +#define AH_DISPLAY_ASL_EXCEPTION_TEXT(Status, Exception) \ + printf ("%.4X: %s\n", Status, Exception) + +#define AH_DISPLAY_EXCEPTION(Status, Name) \ + printf ("%.4X: %s\n", Status, Name) + + +void +AhDecodeAslException ( + char *HexString) +{ + UINT32 i; + UINT32 MessageId; + const char *OneException; + UINT32 Index = 1; + + + /* + * A null input string means to decode and display all known + * exception codes. + */ + if (!HexString) + { + printf ("All defined iASL exception codes:\n\n"); + printf ("Main iASL exceptions:\n\n"); + AH_DISPLAY_EXCEPTION (0, + "AE_OK (No error occurred)"); + + /* Display codes in each block of exception types */ + + for (i = 1; Index < ACPI_ARRAY_LENGTH (AslCompilerMsgs); i++, Index++) + { + AH_DISPLAY_ASL_EXCEPTION_TEXT (Index, AslCompilerMsgs[i]); + } + + printf ("\niASL Table Compiler exceptions:\n\n"); + Index = ASL_MSG_TABLE_COMPILER; + for (i = 0; i < ACPI_ARRAY_LENGTH (AslTableCompilerMsgs); i++, Index++) + { + AH_DISPLAY_ASL_EXCEPTION_TEXT (Index, AslTableCompilerMsgs[i]); + } + + printf ("\niASL Preprocessor exceptions:\n\n"); + Index = ASL_MSG_PREPROCESSOR; + for (i = 0; i < ACPI_ARRAY_LENGTH (AslPreprocessorMsgs); i++, Index++) + { + AH_DISPLAY_ASL_EXCEPTION_TEXT (Index, AslPreprocessorMsgs[i]); + } + return; + } + + /* HexString is valid - convert it to a MessageId and decode it */ + + MessageId = strtol (HexString, NULL, 16); + OneException = AeDecodeMessageId ((UINT16) MessageId); + AH_DISPLAY_ASL_EXCEPTION_TEXT (MessageId, OneException); +} +#endif Modified: head/sys/contrib/dev/acpica/compiler/aslmessages.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmessages.h Fri Nov 13 21:41:47 2020 (r367653) +++ head/sys/contrib/dev/acpica/compiler/aslmessages.h Fri Nov 13 22:45:26 2020 (r367654) @@ -152,7 +152,6 @@ #ifndef __ASLMESSAGES_H #define __ASLMESSAGES_H - /* These values must match error type string tables in aslmessages.c */ typedef enum @@ -167,9 +166,12 @@ typedef enum } ASL_MESSAGE_TYPES; - #define ASL_ERROR_LEVEL_LENGTH 8 /* Length of strings for types above */ +void +AhDecodeAslException ( + char *HexString); + /* * Exception code blocks, 0 - 999 * Available for new exception blocks: 600 - 999 @@ -386,6 +388,7 @@ typedef enum ASL_MSG_EXTERNAL_FOUND_HERE, ASL_MSG_LOWER_CASE_NAMESEG, ASL_MSG_LOWER_CASE_NAMEPATH, + ASL_MSG_UUID_NOT_FOUND, /* These messages are used by the Data Table compiler only */ Modified: head/sys/contrib/dev/acpica/compiler/aslnamesp.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslnamesp.c Fri Nov 13 21:41:47 2020 (r367653) +++ head/sys/contrib/dev/acpica/compiler/aslnamesp.c Fri Nov 13 22:45:26 2020 (r367654) @@ -226,8 +226,8 @@ NsDisplayNamespace ( /* File header */ - FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "Contents of ACPI Namespace\n\n"); - FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "Count Depth Name - Type\n\n"); + FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "Contents of ACPI Namespace\n\n" + "Count Depth Name - Type\n\n"); /* Walk entire namespace from the root */ @@ -239,14 +239,21 @@ NsDisplayNamespace ( return (Status); } - /* Print the full pathname for each namespace node */ + /* Print the full pathname for each namespace node in the common namespace */ - FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "\nNamespace pathnames\n\n"); + FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, + "\nNamespace pathnames and where declared:\n" + "\n\n"); Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, FALSE, NsDoOnePathname, NULL, NULL, NULL); + /* + * We just dumped the entire common namespace, we don't want to do it + * again for other input files. + */ + AslGbl_NsOutputFlag = FALSE; return (Status); } @@ -512,7 +519,7 @@ NsDoOneNamespaceObject ( * * RETURN: Status * - * DESCRIPTION: Print the full pathname for a namespace node. + * DESCRIPTION: Print the full pathname and addtional info for a namespace node. * ******************************************************************************/ @@ -528,6 +535,13 @@ NsDoOnePathname ( ACPI_BUFFER TargetPath; + /* Ignore predefined namespace nodes and External declarations */ + + if (!Node->Op || (Node->Flags & ANOBJ_IS_EXTERNAL)) + { + return (AE_OK); + } + TargetPath.Length = ACPI_ALLOCATE_LOCAL_BUFFER; Status = AcpiNsHandleToPathname (Node, &TargetPath, FALSE); if (ACPI_FAILURE (Status)) @@ -535,8 +549,15 @@ NsDoOnePathname ( return (Status); } - FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "%s\n", - ACPI_CAST_PTR (char, TargetPath.Pointer)); + /* + * Print the full pathname (and other information) + * for each namespace node in the common namespace + */ + FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "%-41s %-12s %s, %u\n", + ACPI_CAST_PTR (char, TargetPath.Pointer), + AcpiUtGetTypeName (Node->Type), + Node->Op->Asl.Filename, Node->Op->Asl.LogicalLineNumber); + ACPI_FREE (TargetPath.Pointer); return (AE_OK); } Modified: head/sys/contrib/dev/acpica/compiler/aslopcodes.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslopcodes.c Fri Nov 13 21:41:47 2020 (r367653) +++ head/sys/contrib/dev/acpica/compiler/aslopcodes.c Fri Nov 13 22:45:26 2020 (r367654) @@ -798,7 +798,13 @@ OpcDoUuId ( } else { + /* Convert UUID string to a buffer, check for a known UUID */ + AcpiUtConvertStringToUuid (InString, Buffer); + if (!AcpiAhMatchUuid (Buffer)) + { + AslError (ASL_REMARK, ASL_MSG_UUID_NOT_FOUND, Op, NULL); + } } /* Change Op to a Buffer */ Modified: head/sys/contrib/dev/acpica/compiler/aslprimaries.y ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslprimaries.y Fri Nov 13 21:41:47 2020 (r367653) +++ head/sys/contrib/dev/acpica/compiler/aslprimaries.y Fri Nov 13 22:45:26 2020 (r367654) @@ -500,7 +500,7 @@ DivideTerm EISAIDTerm : PARSEOP_EISAID PARSEOP_OPEN_PAREN - StringData + StringLiteral PARSEOP_CLOSE_PAREN {$$ = TrSetOpIntegerValue (PARSEOP_EISAID, $3);} | PARSEOP_EISAID PARSEOP_OPEN_PAREN @@ -635,7 +635,7 @@ FprintfTerm : PARSEOP_FPRINTF PARSEOP_OPEN_PAREN {$$ = TrCreateLeafOp (PARSEOP_FPRINTF);} TermArg ',' - StringData + StringLiteral PrintfArgList PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($3,3,$4,$6,$7);} | PARSEOP_FPRINTF @@ -1091,7 +1091,7 @@ PowerResTerm PrintfTerm : PARSEOP_PRINTF PARSEOP_OPEN_PAREN {$$ = TrCreateLeafOp (PARSEOP_PRINTF);} - StringData + StringLiteral PrintfArgList PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($3,2,$4,$5);} | PARSEOP_PRINTF @@ -1412,7 +1412,7 @@ ToStringTerm ToUUIDTerm : PARSEOP_TOUUID PARSEOP_OPEN_PAREN - StringData + StringLiteral PARSEOP_CLOSE_PAREN {$$ = TrSetOpIntegerValue (PARSEOP_TOUUID, $3);} | PARSEOP_TOUUID PARSEOP_OPEN_PAREN @@ -1422,7 +1422,7 @@ ToUUIDTerm UnicodeTerm : PARSEOP_UNICODE PARSEOP_OPEN_PAREN {$$ = TrCreateLeafOp (PARSEOP_UNICODE);} - StringData + StringLiteral PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($3,2,0,$4);} | PARSEOP_UNICODE PARSEOP_OPEN_PAREN Modified: head/sys/contrib/dev/acpica/compiler/aslrules.y ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslrules.y Fri Nov 13 21:41:47 2020 (r367653) +++ head/sys/contrib/dev/acpica/compiler/aslrules.y Fri Nov 13 22:45:26 2020 (r367654) @@ -523,6 +523,10 @@ StringData | String {} ; +StringLiteral + : String {} + ; + ByteConst : Integer {$$ = TrSetOpIntegerValue (PARSEOP_BYTECONST, $1);} ; Modified: head/sys/contrib/dev/acpica/compiler/asltypes.y ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asltypes.y Fri Nov 13 21:41:47 2020 (r367653) +++ head/sys/contrib/dev/acpica/compiler/asltypes.y Fri Nov 13 22:45:26 2020 (r367654) @@ -178,6 +178,7 @@ NoEcho(' %type RequiredTarget %type SimpleName %type StringData +%type StringLiteral %type Target %type Term %type TermArg Modified: head/sys/contrib/dev/acpica/components/events/evregion.c ============================================================================== --- head/sys/contrib/dev/acpica/components/events/evregion.c Fri Nov 13 21:41:47 2020 (r367653) +++ head/sys/contrib/dev/acpica/components/events/evregion.c Fri Nov 13 22:45:26 2020 (r367654) @@ -164,9 +164,11 @@ extern UINT8 AcpiGbl_DefaultAddressSpaces[]; /* Local prototypes */ static void -AcpiEvOrphanEcRegMethod ( - ACPI_NAMESPACE_NODE *EcDeviceNode); +AcpiEvExecuteOrphanRegMethod ( + ACPI_NAMESPACE_NODE *DeviceNode, + ACPI_ADR_SPACE_TYPE SpaceId); + static ACPI_STATUS AcpiEvRegRun ( ACPI_HANDLE ObjHandle, @@ -869,11 +871,13 @@ AcpiEvExecuteRegMethods ( (void) AcpiNsWalkNamespace (ACPI_TYPE_ANY, Node, ACPI_UINT32_MAX, ACPI_NS_WALK_UNLOCK, AcpiEvRegRun, NULL, &Info, NULL); - /* Special case for EC: handle "orphan" _REG methods with no region */ - - if (SpaceId == ACPI_ADR_SPACE_EC) + /* + * Special case for EC and GPIO: handle "orphan" _REG methods with + * no region. + */ + if (SpaceId == ACPI_ADR_SPACE_EC || SpaceId == ACPI_ADR_SPACE_GPIO) { - AcpiEvOrphanEcRegMethod (Node); + AcpiEvExecuteOrphanRegMethod (Node, SpaceId); } ACPI_DEBUG_PRINT_RAW ((ACPI_DB_NAMES, @@ -954,32 +958,29 @@ AcpiEvRegRun ( /******************************************************************************* * - * FUNCTION: AcpiEvOrphanEcRegMethod + * FUNCTION: AcpiEvExecuteOrphanRegMethod * - * PARAMETERS: EcDeviceNode - Namespace node for an EC device + * PARAMETERS: DeviceNode - Namespace node for an ACPI device + * SpaceId - The address space ID * * RETURN: None * - * DESCRIPTION: Execute an "orphan" _REG method that appears under the EC + * DESCRIPTION: Execute an "orphan" _REG method that appears under an ACPI * device. This is a _REG method that has no corresponding region - * within the EC device scope. The orphan _REG method appears to - * have been enabled by the description of the ECDT in the ACPI - * specification: "The availability of the region space can be - * detected by providing a _REG method object underneath the - * Embedded Controller device." + * within the device's scope. ACPI tables depending on these + * "orphan" _REG methods have been seen for both EC and GPIO + * Operation Regions. Presumably the Windows ACPI implementation + * always calls the _REG method independent of the presence of + * an actual Operation Region with the correct address space ID. * - * To quickly access the EC device, we use the EcDeviceNode used - * during EC handler installation. Otherwise, we would need to - * perform a time consuming namespace walk, executing _HID - * methods to find the EC device. - * * MUTEX: Assumes the namespace is locked * ******************************************************************************/ static void -AcpiEvOrphanEcRegMethod ( - ACPI_NAMESPACE_NODE *EcDeviceNode) +AcpiEvExecuteOrphanRegMethod ( + ACPI_NAMESPACE_NODE *DeviceNode, + ACPI_ADR_SPACE_TYPE SpaceId) { ACPI_HANDLE RegMethod; ACPI_NAMESPACE_NODE *NextNode; @@ -988,10 +989,10 @@ AcpiEvOrphanEcRegMethod ( ACPI_OBJECT Objects[2]; - ACPI_FUNCTION_TRACE (EvOrphanEcRegMethod); + ACPI_FUNCTION_TRACE (EvExecuteOrphanRegMethod); - if (!EcDeviceNode) + if (!DeviceNode) { return_VOID; } @@ -1002,7 +1003,7 @@ AcpiEvOrphanEcRegMethod ( /* Get a handle to a _REG method immediately under the EC device */ - Status = AcpiGetHandle (EcDeviceNode, METHOD_NAME__REG, &RegMethod); + Status = AcpiGetHandle (DeviceNode, METHOD_NAME__REG, &RegMethod); if (ACPI_FAILURE (Status)) { goto Exit; /* There is no _REG method present */ @@ -1015,25 +1016,25 @@ AcpiEvOrphanEcRegMethod ( * with other space IDs to be present; but the code below will then * execute the _REG method with the EmbeddedControl SpaceID argument. */ - NextNode = AcpiNsGetNextNode (EcDeviceNode, NULL); + NextNode = AcpiNsGetNextNode (DeviceNode, NULL); while (NextNode) { if ((NextNode->Type == ACPI_TYPE_REGION) && (NextNode->Object) && - (NextNode->Object->Region.SpaceId == ACPI_ADR_SPACE_EC)) + (NextNode->Object->Region.SpaceId == SpaceId)) { goto Exit; /* Do not execute the _REG */ } - NextNode = AcpiNsGetNextNode (EcDeviceNode, NextNode); + NextNode = AcpiNsGetNextNode (DeviceNode, NextNode); } - /* Evaluate the _REG(EmbeddedControl,Connect) method */ + /* Evaluate the _REG(SpaceId,Connect) method */ Args.Count = 2; Args.Pointer = Objects; Objects[0].Type = ACPI_TYPE_INTEGER; - Objects[0].Integer.Value = ACPI_ADR_SPACE_EC; + Objects[0].Integer.Value = SpaceId; Objects[1].Type = ACPI_TYPE_INTEGER; Objects[1].Integer.Value = ACPI_REG_CONNECT; Modified: head/sys/contrib/dev/acpica/components/namespace/nspredef.c ============================================================================== --- head/sys/contrib/dev/acpica/components/namespace/nspredef.c Fri Nov 13 21:41:47 2020 (r367653) +++ head/sys/contrib/dev/acpica/components/namespace/nspredef.c Fri Nov 13 22:45:26 2020 (r367654) @@ -223,13 +223,14 @@ AcpiNsCheckReturnValue ( ACPI_STATUS Status; const ACPI_PREDEFINED_INFO *Predefined; + ACPI_FUNCTION_TRACE (NsCheckReturnValue); /* If not a predefined name, we cannot validate the return object */ Predefined = Info->Predefined; if (!Predefined) { - return (AE_OK); + return_ACPI_STATUS (AE_OK); } /* @@ -239,7 +240,7 @@ AcpiNsCheckReturnValue ( if ((ReturnStatus != AE_OK) && (ReturnStatus != AE_CTRL_RETURN_VALUE)) { - return (AE_OK); + return_ACPI_STATUS (AE_OK); } /* @@ -259,7 +260,7 @@ AcpiNsCheckReturnValue ( (!Predefined->Info.ExpectedBtypes) || (Predefined->Info.ExpectedBtypes == ACPI_RTYPE_ALL)) { - return (AE_OK); + return_ACPI_STATUS (AE_OK); } /* @@ -325,7 +326,7 @@ Exit: Node->Flags |= ANOBJ_EVALUATED; } - return (Status); + return_ACPI_STATUS (Status); } Modified: head/sys/contrib/dev/acpica/components/namespace/nsprepkg.c ============================================================================== --- head/sys/contrib/dev/acpica/components/namespace/nsprepkg.c Fri Nov 13 21:41:47 2020 (r367653) +++ head/sys/contrib/dev/acpica/components/namespace/nsprepkg.c Fri Nov 13 22:45:26 2020 (r367654) @@ -214,7 +214,7 @@ AcpiNsCheckPackage ( UINT32 i; - ACPI_FUNCTION_NAME (NsCheckPackage); + ACPI_FUNCTION_TRACE (NsCheckPackage); /* The package info for this name is in the next table entry */ @@ -245,13 +245,13 @@ AcpiNsCheckPackage ( { if (Package->RetInfo.Type == ACPI_PTYPE1_VAR) { - return (AE_OK); + return_ACPI_STATUS (AE_OK); } ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags, "Return Package has no elements (empty)")); - return (AE_AML_OPERAND_VALUE); + return_ACPI_STATUS (AE_AML_OPERAND_VALUE); } /* @@ -305,7 +305,7 @@ AcpiNsCheckPackage ( Package->RetInfo.ObjectType1, i); if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } Elements++; @@ -338,7 +338,7 @@ AcpiNsCheckPackage ( Package->RetInfo3.ObjectType[i], i); if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } } else @@ -349,7 +349,7 @@ AcpiNsCheckPackage ( Package->RetInfo3.TailObjectType, i); if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } } @@ -365,7 +365,7 @@ AcpiNsCheckPackage ( Info, Elements, ACPI_RTYPE_INTEGER, 0); if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } Elements++; @@ -384,7 +384,7 @@ AcpiNsCheckPackage ( Info, Elements, ACPI_RTYPE_INTEGER, 0); if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } /* @@ -428,7 +428,7 @@ AcpiNsCheckPackage ( Info, ReturnObject, ReturnObjectPtr); if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } /* Update locals to point to the new package (of 1 element) */ @@ -466,7 +466,7 @@ AcpiNsCheckPackage ( Package->RetInfo.ObjectType1, 0); if (ACPI_FAILURE(Status)) { - return (Status); + return_ACPI_STATUS (Status); } /* Validate length of the UUID buffer */ @@ -475,14 +475,14 @@ AcpiNsCheckPackage ( { ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags, "Invalid length for UUID Buffer")); - return (AE_AML_OPERAND_VALUE); + return_ACPI_STATUS (AE_AML_OPERAND_VALUE); } Status = AcpiNsCheckObjectType(Info, Elements + 1, Package->RetInfo.ObjectType2, 0); if (ACPI_FAILURE(Status)) { - return (Status); + return_ACPI_STATUS (Status); } Elements += 2; @@ -498,10 +498,10 @@ AcpiNsCheckPackage ( "Invalid internal return type in table entry: %X", Package->RetInfo.Type)); - return (AE_AML_INTERNAL); + return_ACPI_STATUS (AE_AML_INTERNAL); } - return (Status); + return_ACPI_STATUS (Status); PackageTooSmall: @@ -512,7 +512,7 @@ PackageTooSmall: "Return Package is too small - found %u elements, expected %u", Count, ExpectedCount)); - return (AE_AML_OPERAND_VALUE); + return_ACPI_STATUS (AE_AML_OPERAND_VALUE); } @@ -865,6 +865,8 @@ AcpiNsCheckPackageElements ( UINT32 i; + ACPI_FUNCTION_TRACE (NsCheckPackageElements); + /* * Up to two groups of package elements are supported by the data * structure. All elements in each group must be of the same type. @@ -876,7 +878,7 @@ AcpiNsCheckPackageElements ( Type1, i + StartIndex); if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } ThisElement++; @@ -888,11 +890,11 @@ AcpiNsCheckPackageElements ( Type2, (i + Count1 + StartIndex)); if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } ThisElement++; } - return (AE_OK); + return_ACPI_STATUS (AE_OK); } Modified: head/sys/contrib/dev/acpica/components/namespace/nsrepair2.c ============================================================================== --- head/sys/contrib/dev/acpica/components/namespace/nsrepair2.c Fri Nov 13 21:41:47 2020 (r367653) +++ head/sys/contrib/dev/acpica/components/namespace/nsrepair2.c Fri Nov 13 22:45:26 2020 (r367654) @@ -321,16 +321,18 @@ AcpiNsComplexRepairs ( ACPI_STATUS Status; + ACPI_FUNCTION_TRACE (NsComplexRepairs); + /* Check if this name is in the list of repairable names */ Predefined = AcpiNsMatchComplexRepair (Node); if (!Predefined) { - return (ValidateStatus); + return_ACPI_STATUS (ValidateStatus); } Status = Predefined->RepairFunction (Info, ReturnObjectPtr); - return (Status); + return_ACPI_STATUS (Status); } @@ -526,20 +528,21 @@ AcpiNsRepair_CID ( UINT16 OriginalRefCount; UINT32 i; + ACPI_FUNCTION_TRACE (NsRepair_CID); /* Check for _CID as a simple string */ if (ReturnObject->Common.Type == ACPI_TYPE_STRING) { Status = AcpiNsRepair_HID (Info, ReturnObjectPtr); - return (Status); + return_ACPI_STATUS (Status); } /* Exit if not a Package */ if (ReturnObject->Common.Type != ACPI_TYPE_PACKAGE) { - return (AE_OK); + return_ACPI_STATUS (AE_OK); } /* Examine each element of the _CID package */ @@ -553,7 +556,7 @@ AcpiNsRepair_CID ( Status = AcpiNsRepair_HID (Info, ElementPtr); if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } if (OriginalElement != *ElementPtr) @@ -567,7 +570,7 @@ AcpiNsRepair_CID ( ElementPtr++; } - return (AE_OK); + return_ACPI_STATUS (AE_OK); } @@ -687,9 +690,8 @@ AcpiNsRepair_HID ( ACPI_OPERAND_OBJECT **ReturnObjectPtr) { ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr; - ACPI_OPERAND_OBJECT *NewString; - char *Source; char *Dest; + char *Source; ACPI_FUNCTION_NAME (NsRepair_HID); @@ -699,7 +701,7 @@ AcpiNsRepair_HID ( if (ReturnObject->Common.Type != ACPI_TYPE_STRING) { - return (AE_OK); + return_ACPI_STATUS (AE_OK); } if (ReturnObject->String.Length == 0) @@ -711,17 +713,9 @@ AcpiNsRepair_HID ( /* Return AE_OK anyway, let driver handle it */ Info->ReturnFlags |= ACPI_OBJECT_REPAIRED; - return (AE_OK); + return_ACPI_STATUS (AE_OK); } - /* It is simplest to always create a new string object */ - - NewString = AcpiUtCreateStringObject (ReturnObject->String.Length); - if (!NewString) - { - return (AE_NO_MEMORY); - } - /* * Remove a leading asterisk if present. For some unknown reason, there * are many machines in the field that contains IDs like this. @@ -732,7 +726,7 @@ AcpiNsRepair_HID ( if (*Source == '*') { Source++; - NewString->String.Length--; + ReturnObject->String.Length--; ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, "%s: Removed invalid leading asterisk\n", Info->FullPathname)); @@ -746,14 +740,13 @@ AcpiNsRepair_HID ( * "NNNN####" where N is an uppercase letter or decimal digit, and * # is a hex digit. */ - for (Dest = NewString->String.Pointer; *Source; Dest++, Source++) + for (Dest = ReturnObject->String.Pointer; *Source; Dest++, Source++) { *Dest = (char) toupper ((int) *Source); } + ReturnObject->String.Pointer[ReturnObject->String.Length] = 0; - AcpiUtRemoveReference (ReturnObject); - *ReturnObjectPtr = NewString; - return (AE_OK); + return_ACPI_STATUS (AE_OK); } Modified: head/sys/contrib/dev/acpica/include/accommon.h ============================================================================== --- head/sys/contrib/dev/acpica/include/accommon.h Fri Nov 13 21:41:47 2020 (r367653) +++ head/sys/contrib/dev/acpica/include/accommon.h Fri Nov 13 22:45:26 2020 (r367654) @@ -155,7 +155,7 @@ /* * Common set of includes for all ACPICA source files. * We put them here because we don't want to duplicate them - * in the the source code again and again. + * in the source code again and again. * * Note: The order of these include files is important. */ Modified: head/sys/contrib/dev/acpica/include/acpixf.h ============================================================================== --- head/sys/contrib/dev/acpica/include/acpixf.h Fri Nov 13 21:41:47 2020 (r367653) +++ head/sys/contrib/dev/acpica/include/acpixf.h Fri Nov 13 22:45:26 2020 (r367654) @@ -154,7 +154,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20200925 +#define ACPI_CA_VERSION 0x20201113 #include #include Modified: head/sys/contrib/dev/acpica/include/acuuid.h ============================================================================== --- head/sys/contrib/dev/acpica/include/acuuid.h Fri Nov 13 21:41:47 2020 (r367653) +++ head/sys/contrib/dev/acpica/include/acuuid.h Fri Nov 13 22:45:26 2020 (r367654) @@ -181,6 +181,7 @@ /* NVDIMM - NFIT table */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Nov 13 23:18:05 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 88C01460C8C; Fri, 13 Nov 2020 23:18:05 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXvXF3T3Kz3JJb; Fri, 13 Nov 2020 23:18:05 +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 6A44820150; Fri, 13 Nov 2020 23:18:05 +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 0ADNI53F095272; Fri, 13 Nov 2020 23:18:05 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ADNI5Nt095271; Fri, 13 Nov 2020 23:18:05 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <202011132318.0ADNI5Nt095271@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 13 Nov 2020 23:18:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367655 - head/lib/libbsnmp X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/lib/libbsnmp X-SVN-Commit-Revision: 367655 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 13 Nov 2020 23:18:05 -0000 Author: brooks Date: Fri Nov 13 23:18:04 2020 New Revision: 367655 URL: https://svnweb.freebsd.org/changeset/base/367655 Log: Add missing src.opts.mk include This was missed in r364221 so tests were not built. Reviewed by: bdrewery Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D27210 Modified: head/lib/libbsnmp/Makefile Modified: head/lib/libbsnmp/Makefile ============================================================================== --- head/lib/libbsnmp/Makefile Fri Nov 13 22:45:26 2020 (r367654) +++ head/lib/libbsnmp/Makefile Fri Nov 13 23:18:04 2020 (r367655) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + SUBDIR= libbsnmp SUBDIR.${MK_TESTS}+= tests From owner-svn-src-head@freebsd.org Sat Nov 14 00:47:11 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8B7C246384C; Sat, 14 Nov 2020 00:47:11 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXxW33Ym1z3PCr; Sat, 14 Nov 2020 00:47:11 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [192.168.1.10] (c-98-207-126-143.hsd1.ca.comcast.net [98.207.126.143]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id DE4426762; Sat, 14 Nov 2020 00:47:10 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/16.43.20110804 Date: Fri, 13 Nov 2020 16:47:08 -0800 Subject: Re: svn commit: r367651 - head/usr.sbin/bhyve From: Ravi Pokala To: Rebecca Cran , , , Message-ID: <328D3129-4682-491B-A28F-D6739E52ABE8@panasas.com> Thread-Topic: svn commit: r367651 - head/usr.sbin/bhyve References: <202011131947.0ADJlGbr064616@repo.freebsd.org> In-Reply-To: <202011131947.0ADJlGbr064616@repo.freebsd.org> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 00:47:11 -0000 > +#define FIRMWARE_RELEASE_DATE "11/10/2020" Might I suggest "2020-11-10", as sorting, logic, ${DEITY}, and ISO-8601 dem= and? ;-) Thanks, Ravi (rpokala@) =EF=BB=BF-----Original Message----- From: on behalf of Rebecca Cran Date: 2020-11-13, Friday at 11:47 To: , , Subject: svn commit: r367651 - head/usr.sbin/bhyve Author: bcran Date: Fri Nov 13 19:47:16 2020 New Revision: 367651 URL: https://svnweb.freebsd.org/changeset/base/367651 Log: bhyve: update smbiostbl.c to bump the version and release date Since lots of work has been done on bhyve since 2014, increase the ve= rsion to 13.0 to match 13-CURRENT, and update the release date. Reviewed by: grehan Differential Revision: https://reviews.freebsd.org/D27147 Modified: head/usr.sbin/bhyve/smbiostbl.c Modified: head/usr.sbin/bhyve/smbiostbl.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/usr.sbin/bhyve/smbiostbl.c Fri Nov 13 19:22:53 2020 (r367650) +++ head/usr.sbin/bhyve/smbiostbl.c Fri Nov 13 19:47:16 2020 (r367651) @@ -51,6 +51,9 @@ __FBSDID("$FreeBSD$"); #define SMBIOS_BASE 0xF1000 +#define FIRMWARE_VERSION "13.0" +#define FIRMWARE_RELEASE_DATE "11/10/2020" + /* BHYVE_ACPI_BASE - SMBIOS_BASE) */ #define SMBIOS_MAX_LENGTH (0xF2400 - 0xF1000) @@ -323,9 +326,9 @@ struct smbios_table_type0 smbios_type0_template =3D { }; const char *smbios_type0_strings[] =3D { - "BHYVE", /* vendor string */ - "1.00", /* bios version string */ - "03/14/2014", /* bios release date string */ + "BHYVE", /* vendor string */ + FIRMWARE_VERSION, /* bios version string */ + FIRMWARE_RELEASE_DATE, /* bios release date string */ NULL }; From owner-svn-src-head@freebsd.org Sat Nov 14 00:53:11 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5FACC463CA6 for ; Sat, 14 Nov 2020 00:53:11 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXxdz25QJz3PYs for ; Sat, 14 Nov 2020 00:53:11 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f51.google.com with SMTP id r17so12190564wrw.1 for ; Fri, 13 Nov 2020 16:53:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ID4pCHw2fLBil52z+aTxuC4S5OF2rizsh1BQVx8ZHvs=; b=Et87qnIsoJT/Ixal6udIB3tBaS+VES8R0roScxvytCBdN6Rf1QassC6Eu+sY8SnvhF z68SG7LjXH8VdfhvQN4P5YWDENrF7FzeDdMutpu9sCMZfCYJ/PPQcnzRkQ1Jm61YbS42 LgZWOYKveyurHl4ec3rmQh2KtGPIfmEnIzBxTZDQPZ3weMcoIYXpJJPxHUcfmHdXdccr JQXTnVAuHxBodZMwBAV2VUz6xZ06gyqUjCSeUtiRcHv9RhnmUVNfWzJ8Hgg8zzcw4oRd rU2jqXw3+VPnHLEOY8EowAgWg44FZSh/NCyt8FJ+Nal8MgMVYG6dBQ4S55oXD7I4tmFy MjTA== X-Gm-Message-State: AOAM533AKAFlQLk3K1hYC/N28KSnLILjCs7FM3Q457M2QQrEkYGQF1rk nEn81nOf04qsQ/19HqpcXp9W5g== X-Google-Smtp-Source: ABdhPJw1xUwDKNz9KH1yJhHnXcrNfhPErWoQadNYQlFSJDT5nJXHz6NRqyaFAxUBMpKei3owBPZvTw== X-Received: by 2002:adf:f0c2:: with SMTP id x2mr6579305wro.184.1605315189900; Fri, 13 Nov 2020 16:53:09 -0800 (PST) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id m20sm15835762wrg.81.2020.11.13.16.53.09 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Nov 2020 16:53:09 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: svn commit: r367651 - head/usr.sbin/bhyve From: Jessica Clarke In-Reply-To: <328D3129-4682-491B-A28F-D6739E52ABE8@panasas.com> Date: Sat, 14 Nov 2020 00:53:07 +0000 Cc: Rebecca Cran , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <202011131947.0ADJlGbr064616@repo.freebsd.org> <328D3129-4682-491B-A28F-D6739E52ABE8@panasas.com> To: Ravi Pokala X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Rspamd-Queue-Id: 4CXxdz25QJz3PYs X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 00:53:11 -0000 On 14 Nov 2020, at 00:47, Ravi Pokala wrote: >=20 >> +#define FIRMWARE_RELEASE_DATE "11/10/2020" >=20 > Might I suggest "2020-11-10", as sorting, logic, ${DEITY}, and = ISO-8601 demand? ;-) Alas that is a "feature" of the specification: String number of the BIOS release date. The date string, if supplied, is in either mm/dd/yy or mm/dd/yyyy format. If the year portion of the string is two digits, the year is assumed to be 19yy. NOTE: The mm/dd/yyyy format is required for SMBIOS version 2.3 and later. (SMBIOS Specification version 3.4.0c) It might be worth putting a comment in so people don't accidentally change it to the wrong thing in future though, given it's currently ambiguous otherwise. Jess From owner-svn-src-head@freebsd.org Sat Nov 14 00:58:07 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A489D463CBF; Sat, 14 Nov 2020 00:58:07 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXxlg4BkPz3PtY; Sat, 14 Nov 2020 00:58:07 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [192.168.1.10] (c-98-207-126-143.hsd1.ca.comcast.net [98.207.126.143]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id DE0CE6769; Sat, 14 Nov 2020 00:58:06 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/16.43.20110804 Date: Fri, 13 Nov 2020 16:58:03 -0800 Subject: Re: svn commit: r367651 - head/usr.sbin/bhyve From: Ravi Pokala To: Jessica Clarke CC: Rebecca Cran , , , Message-ID: <26286559-64EA-4E5B-B5E6-3BD2C1C949FF@panasas.com> Thread-Topic: svn commit: r367651 - head/usr.sbin/bhyve References: <202011131947.0ADJlGbr064616@repo.freebsd.org> <328D3129-4682-491B-A28F-D6739E52ABE8@panasas.com> In-Reply-To: Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 00:58:07 -0000 -----Original Message----- From: on behalf of Jessica Clarke Date: 2020-11-13, Friday at 16:53 To: Ravi Pokala Cc: Rebecca Cran , , , Subject: Re: svn commit: r367651 - head/usr.sbin/bhyve On 14 Nov 2020, at 00:47, Ravi Pokala wrote: > >> +#define FIRMWARE_RELEASE_DATE "11/10/2020" > > Might I suggest "2020-11-10", as sorting, logic, ${DEITY}, and ISO-8601 demand? ;-) Alas that is a "feature" of the specification: String number of the BIOS release date. The date string, if supplied, is in either mm/dd/yy or mm/dd/yyyy format. If the year portion of the string is two digits, the year is assumed to be 19yy. NOTE: The mm/dd/yyyy format is required for SMBIOS version 2.3 and later. (SMBIOS Specification version 3.4.0c) Yeah, it occurred to me that it might be something like that shortly after I hit "send". :-p It might be worth putting a comment in so people don't accidentally change it to the wrong thing in future though, given it's currently ambiguous otherwise. That would be appreciated. Thanks, Ravi (rpokala@) Jess From owner-svn-src-head@freebsd.org Sat Nov 14 01:39:28 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 840A4466C50; Sat, 14 Nov 2020 01:39:28 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXygN3PKfz3kHp; Sat, 14 Nov 2020 01:39:28 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6797522087; Sat, 14 Nov 2020 01:39:28 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AE1dSFL082875; Sat, 14 Nov 2020 01:39:28 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AE1dSm5082874; Sat, 14 Nov 2020 01:39:28 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202011140139.0AE1dSm5082874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 14 Nov 2020 01:39:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367658 - head X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 367658 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 01:39:28 -0000 Author: rmacklem Date: Sat Nov 14 01:39:27 2020 New Revision: 367658 URL: https://svnweb.freebsd.org/changeset/base/367658 Log: Add an entry for r367026, r367423. Modified: head/RELNOTES Modified: head/RELNOTES ============================================================================== --- head/RELNOTES Sat Nov 14 01:28:04 2020 (r367657) +++ head/RELNOTES Sat Nov 14 01:39:27 2020 (r367658) @@ -10,6 +10,14 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +r367423: + This commit added a new startup scripts variable called + nfsv4_server_only which uses the -R option on mountd added by r367026. + When nfsv4_server_only is set to "YES" in /etc/rc.conf, the NFS server + only handles NFSv4 and does not register with rpcbind. As such, rpcbind + does not need to be running. Useful for sites which consider rpcbind a + security issue. + r366267: Kernel option ACPI_DMAR was renamed to IOMMU. amd64's IOMMU subsystem was split out from amd64 DMAR support and is now generic, i.e., it can From owner-svn-src-head@freebsd.org Sat Nov 14 01:45:35 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A389B46733E; Sat, 14 Nov 2020 01:45:35 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXypR4CPMz3kqg; Sat, 14 Nov 2020 01:45:35 +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 83B67221F5; Sat, 14 Nov 2020 01:45:35 +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 0AE1jZ1D088876; Sat, 14 Nov 2020 01:45:35 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AE1jZ2n088874; Sat, 14 Nov 2020 01:45:35 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202011140145.0AE1jZ2n088874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 14 Nov 2020 01:45:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367659 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 367659 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 01:45:35 -0000 Author: mav Date: Sat Nov 14 01:45:34 2020 New Revision: 367659 URL: https://svnweb.freebsd.org/changeset/base/367659 Log: Add PMRCAP printing and fix earlier CAP_HI. MFC after: 3 days Modified: head/sys/dev/nvme/nvme.h head/sys/dev/nvme/nvme_ctrlr.c Modified: head/sys/dev/nvme/nvme.h ============================================================================== --- head/sys/dev/nvme/nvme.h Sat Nov 14 01:39:27 2020 (r367658) +++ head/sys/dev/nvme/nvme.h Sat Nov 14 01:45:34 2020 (r367659) @@ -150,6 +150,36 @@ #define NVME_AQA_REG_ACQS_SHIFT (16) #define NVME_AQA_REG_ACQS_MASK (0xFFF) +#define NVME_PMRCAP_REG_RDS_SHIFT (3) +#define NVME_PMRCAP_REG_RDS_MASK (0x1) +#define NVME_PMRCAP_REG_WDS_SHIFT (4) +#define NVME_PMRCAP_REG_WDS_MASK (0x1) +#define NVME_PMRCAP_REG_BIR_SHIFT (5) +#define NVME_PMRCAP_REG_BIR_MASK (0x7) +#define NVME_PMRCAP_REG_PMRTU_SHIFT (8) +#define NVME_PMRCAP_REG_PMRTU_MASK (0x3) +#define NVME_PMRCAP_REG_PMRWBM_SHIFT (10) +#define NVME_PMRCAP_REG_PMRWBM_MASK (0xf) +#define NVME_PMRCAP_REG_PMRTO_SHIFT (16) +#define NVME_PMRCAP_REG_PMRTO_MASK (0xff) +#define NVME_PMRCAP_REG_CMSS_SHIFT (24) +#define NVME_PMRCAP_REG_CMSS_MASK (0x1) + +#define NVME_PMRCAP_RDS(x) \ + (((x) >> NVME_PMRCAP_REG_RDS_SHIFT) & NVME_PMRCAP_REG_RDS_MASK) +#define NVME_PMRCAP_WDS(x) \ + (((x) >> NVME_PMRCAP_REG_WDS_SHIFT) & NVME_PMRCAP_REG_WDS_MASK) +#define NVME_PMRCAP_BIR(x) \ + (((x) >> NVME_PMRCAP_REG_BIR_SHIFT) & NVME_PMRCAP_REG_BIR_MASK) +#define NVME_PMRCAP_PMRTU(x) \ + (((x) >> NVME_PMRCAP_REG_PMRTU_SHIFT) & NVME_PMRCAP_REG_PMRTU_MASK) +#define NVME_PMRCAP_PMRWBM(x) \ + (((x) >> NVME_PMRCAP_REG_PMRWBM_SHIFT) & NVME_PMRCAP_REG_PMRWBM_MASK) +#define NVME_PMRCAP_PMRTO(x) \ + (((x) >> NVME_PMRCAP_REG_PMRTO_SHIFT) & NVME_PMRCAP_REG_PMRTO_MASK) +#define NVME_PMRCAP_CMSS(x) \ + (((x) >> NVME_PMRCAP_REG_CMSS_SHIFT) & NVME_PMRCAP_REG_CMSS_MASK) + /* Command field definitions */ #define NVME_CMD_FUSE_SHIFT (8) Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Sat Nov 14 01:39:27 2020 (r367658) +++ head/sys/dev/nvme/nvme_ctrlr.c Sat Nov 14 01:45:34 2020 (r367659) @@ -1367,7 +1367,7 @@ nvme_ctrlr_construct(struct nvme_controller *ctrlr, de struct make_dev_args md_args; uint32_t cap_lo; uint32_t cap_hi; - uint32_t to, vs; + uint32_t to, vs, pmrcap; uint8_t mpsmin; int status, timeout_period; @@ -1390,20 +1390,32 @@ nvme_ctrlr_construct(struct nvme_controller *ctrlr, de cap_hi = nvme_mmio_read_4(ctrlr, cap_hi); if (bootverbose) { device_printf(dev, "CapHi: 0x%08x: DSTRD %u%s, CSS %x%s, " - "MPSMIN %u, MPSMAX %u %s%s\n", cap_hi, + "MPSMIN %u, MPSMAX %u%s%s\n", cap_hi, NVME_CAP_HI_DSTRD(cap_hi), - NVME_CAP_HI_NSSRS(cap_lo) ? ", NSSRS" : "", + NVME_CAP_HI_NSSRS(cap_hi) ? ", NSSRS" : "", NVME_CAP_HI_CSS(cap_hi), - NVME_CAP_HI_BPS(cap_lo) ? ", BPS" : "", + NVME_CAP_HI_BPS(cap_hi) ? ", BPS" : "", NVME_CAP_HI_MPSMIN(cap_hi), NVME_CAP_HI_MPSMAX(cap_hi), - NVME_CAP_HI_PMRS(cap_lo) ? ", PMRS" : "", - NVME_CAP_HI_CMBS(cap_lo) ? ", CMBS" : ""); + NVME_CAP_HI_PMRS(cap_hi) ? ", PMRS" : "", + NVME_CAP_HI_CMBS(cap_hi) ? ", CMBS" : ""); } if (bootverbose) { vs = nvme_mmio_read_4(ctrlr, vs); device_printf(dev, "Version: 0x%08x: %d.%d\n", vs, NVME_MAJOR(vs), NVME_MINOR(vs)); + } + if (bootverbose && NVME_CAP_HI_PMRS(cap_hi)) { + pmrcap = nvme_mmio_read_4(ctrlr, pmrcap); + device_printf(dev, "PMRCap: 0x%08x: BIR %u%s%s, PMRTU %u, " + "PMRWBM %x, PMRTO %u%s\n", pmrcap, + NVME_PMRCAP_BIR(pmrcap), + NVME_PMRCAP_RDS(pmrcap) ? ", RDS" : "", + NVME_PMRCAP_WDS(pmrcap) ? ", WDS" : "", + NVME_PMRCAP_PMRTU(pmrcap), + NVME_PMRCAP_PMRWBM(pmrcap), + NVME_PMRCAP_PMRTO(pmrcap), + NVME_PMRCAP_CMSS(pmrcap) ? ", CMSS" : ""); } ctrlr->dstrd = NVME_CAP_HI_DSTRD(cap_hi) + 2; From owner-svn-src-head@freebsd.org Sat Nov 14 01:49:49 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 983E34678C3; Sat, 14 Nov 2020 01:49:49 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXyvK3sFSz3lGS; Sat, 14 Nov 2020 01:49:49 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 772F2221FB; Sat, 14 Nov 2020 01:49:49 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AE1nnIb089105; Sat, 14 Nov 2020 01:49:49 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AE1nnBc089104; Sat, 14 Nov 2020 01:49:49 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202011140149.0AE1nnBc089104@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 14 Nov 2020 01:49:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367660 - head/libexec/rc/rc.d X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/libexec/rc/rc.d X-SVN-Commit-Revision: 367660 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 01:49:49 -0000 Author: rmacklem Date: Sat Nov 14 01:49:49 2020 New Revision: 367660 URL: https://svnweb.freebsd.org/changeset/base/367660 Log: Fix startup of gssd when /usr is a separately mounted local file system. meowthink@gmail.com reported that the gssd daemon was not starting, because /etc/rc.d/gssd was executed before his local /usr file system was mounted. He fixed the problem by adding mountcritlocal to the REQUIRED line. This fix seems safe and works for a separately mounted /usr file system on a local disk. The case of a separately mounted remote /usr file system (such as NFS) is still broken, but there is no obvious solution for that. Adding mountcritremote would fix the problem, but it would cause a POLA violation, because all kerberized NFS mounts in /etc/fstab would need the "late" option specified to work. Submitted by: meowthink@gmail.com Reported by: meowthink@gmail.com Reviewed by: 0mp MFC after: 2 weeks Relnotes: yes Differential Revision: https://reviews.freebsd.org/D27203 Modified: head/libexec/rc/rc.d/gssd Modified: head/libexec/rc/rc.d/gssd ============================================================================== --- head/libexec/rc/rc.d/gssd Sat Nov 14 01:45:34 2020 (r367659) +++ head/libexec/rc/rc.d/gssd Sat Nov 14 01:49:49 2020 (r367660) @@ -4,7 +4,7 @@ # # PROVIDE: gssd -# REQUIRE: root +# REQUIRE: root mountcritlocal # KEYWORD: nojail shutdown . /etc/rc.subr From owner-svn-src-head@freebsd.org Sat Nov 14 01:55:03 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6E91A467CCA; Sat, 14 Nov 2020 01:55:03 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXz1M20Mpz3lnC; Sat, 14 Nov 2020 01:55:03 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 37639222AA; Sat, 14 Nov 2020 01:55:03 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AE1t3Wx095032; Sat, 14 Nov 2020 01:55:03 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AE1t33N095031; Sat, 14 Nov 2020 01:55:03 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202011140155.0AE1t33N095031@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 14 Nov 2020 01:55:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367661 - head X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 367661 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 01:55:03 -0000 Author: rmacklem Date: Sat Nov 14 01:55:02 2020 New Revision: 367661 URL: https://svnweb.freebsd.org/changeset/base/367661 Log: Add a entry for r367660. Modified: head/RELNOTES Modified: head/RELNOTES ============================================================================== --- head/RELNOTES Sat Nov 14 01:49:49 2020 (r367660) +++ head/RELNOTES Sat Nov 14 01:55:02 2020 (r367661) @@ -10,6 +10,16 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +r367660: + Fixes the case where gssd will not startup because /usr is a separate + local file system that is not yet mounted. It does not fix the case + where /usr is a separately mounted remote file system (such as NFS). + This latter case can be fixed by adding mountcritremote to the + REQUIRED line. Unfortunately doing so implies that all Kerberized + NFS mounts in /etc/fstab will need the "late" mount option. + This was not done, since the requirement for "late" would introduce + a POLA violation. + r367423: This commit added a new startup scripts variable called nfsv4_server_only which uses the -R option on mountd added by r367026. From owner-svn-src-head@freebsd.org Sat Nov 14 02:32:50 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 921992D1C18; Sat, 14 Nov 2020 02:32:50 +0000 (UTC) (envelope-from rebecca@bsdio.com) Received: from out01.mta.xmission.com (out01.mta.xmission.com [166.70.13.231]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXzry32kFz3pZZ; Sat, 14 Nov 2020 02:32:50 +0000 (UTC) (envelope-from rebecca@bsdio.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=simple/simple; d=bsdio.com; s=xmission; h=Subject:Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:To:Sender:Reply-To:Cc:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe :List-Post:List-Owner:List-Archive; bh=w0Chb3pSK6sndz9QSdWCtfAcwRCWpPUQ1pRiGay5lX0=; b=rfd/nw2xYTm9XY+0z6Wi9ubm0t Erp9uNR/gdswnTVKeVctii8VlOsZwYzVzWpecnaqUfsjnnuQ4wJ7yG6WW4x6iDJN1MNm1cmkgz9rl HHxyQlTXfdsGY18sAvTJ/hYPqMrKktF9FLq55KvLYWbHhThuQRrvIIgEYexkZZIeJIac=; Received: from in01.mta.xmission.com ([166.70.13.51]) by out01.mta.xmission.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1kdlMs-008nQQ-SC; Fri, 13 Nov 2020 19:32:46 -0700 Received: from mta4.zcs.xmission.com ([166.70.13.68]) by in01.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.87) (envelope-from ) id 1kdlMs-0006Ul-B8; Fri, 13 Nov 2020 19:32:46 -0700 Received: from localhost (localhost [127.0.0.1]) by mta4.zcs.xmission.com (Postfix) with ESMTP id 29A6B500402; Fri, 13 Nov 2020 19:32:46 -0700 (MST) X-Amavis-Modified: Mail body modified (using disclaimer) - mta4.zcs.xmission.com Received: from mta4.zcs.xmission.com ([127.0.0.1]) by localhost (mta4.zcs.xmission.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id luSk1_erWOaN; Fri, 13 Nov 2020 19:32:46 -0700 (MST) Received: from [10.0.10.142] (c-174-52-16-57.hsd1.ut.comcast.net [174.52.16.57]) by mta4.zcs.xmission.com (Postfix) with ESMTPSA id C2D0450039F; Fri, 13 Nov 2020 19:32:45 -0700 (MST) To: Ravi Pokala , Rebecca Cran , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202011131947.0ADJlGbr064616@repo.freebsd.org> <328D3129-4682-491B-A28F-D6739E52ABE8@panasas.com> From: Rebecca Cran Message-ID: <054dbbb6-7b7e-03d5-5599-0d62ea82b59e@bsdio.com> Date: Fri, 13 Nov 2020 19:32:45 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <328D3129-4682-491B-A28F-D6739E52ABE8@panasas.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-XM-SPF: eid=1kdlMs-0006Ul-B8; ; ; mid=<054dbbb6-7b7e-03d5-5599-0d62ea82b59e@bsdio.com>; ; ; hst=in01.mta.xmission.com; ; ; ip=166.70.13.68; ; ; frm=rebecca@bsdio.com; ; ; spf=none X-SA-Exim-Connect-IP: 166.70.13.68 X-SA-Exim-Mail-From: rebecca@bsdio.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on sa03.xmission.com X-Spam-Level: * X-Spam-Status: No, score=1.7 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,NICE_REPLY_A,T_TM2_M_HEADER_IN_MSG,TooManyTo_001, TooManyTo_002,TooManyTo_003,TooManyTo_004 autolearn=disabled version=3.4.2 X-Spam-Virus: No X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5006] * 0.5 TooManyTo_004 Multiple "To" Header Recipients 5x (uncommon) * 0.6 TooManyTo_003 Multiple "To" Header Recipients 4x (uncommon) * 0.3 TooManyTo_001 Multiple "To" Header Recipients 2x (uncommon) * 0.5 TooManyTo_002 Multiple "To" Header Recipients 3x (uncommon) * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa03 1397; IP=ok Body=1 Fuz1=1] [Fuz2=1] * -0.0 NICE_REPLY_A Looks like a legit reply (A) X-Spam-DCC: XMission; sa03 1397; IP=ok Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: *;Ravi Pokala , Rebecca Cran , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Spam-Relay-Country: X-Spam-Timing: total 299 ms - load_scoreonly_sql: 0.03 (0.0%), signal_user_changed: 4.4 (1.5%), b_tie_ro: 3.2 (1.1%), parse: 1.18 (0.4%), extract_message_metadata: 4.3 (1.4%), get_uri_detail_list: 0.38 (0.1%), tests_pri_-1000: 2.1 (0.7%), tests_pri_-950: 1.16 (0.4%), tests_pri_-900: 0.90 (0.3%), tests_pri_-90: 69 (23.1%), check_bayes: 68 (22.6%), b_tokenize: 3.8 (1.3%), b_tok_get_all: 4.1 (1.4%), b_comp_prob: 1.08 (0.4%), b_tok_touch_all: 56 (18.7%), b_finish: 0.84 (0.3%), tests_pri_0: 203 (67.9%), check_dkim_signature: 0.58 (0.2%), check_dkim_adsp: 105 (35.2%), poll_dns_idle: 100 (33.5%), tests_pri_10: 2.6 (0.9%), tests_pri_500: 7 (2.4%), rewrite_mail: 0.00 (0.0%) Subject: Re: svn commit: r367651 - head/usr.sbin/bhyve X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) X-Rspamd-Queue-Id: 4CXzry32kFz3pZZ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 02:32:50 -0000 On 11/13/20 5:47 PM, Ravi Pokala wrote: >> +#define FIRMWARE_RELEASE_DATE "11/10/2020" > Might I suggest "2020-11-10", as sorting, logic, ${DEITY}, and ISO-8601 demand? ;-) I wish! I'll add a comment clarifying that the specification mandates mm/dd/yyyy. -- Rebecca Cran From owner-svn-src-head@freebsd.org Sat Nov 14 05:10:41 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AF3BC2D6500; Sat, 14 Nov 2020 05:10:41 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CY3M54PyRz4T6X; Sat, 14 Nov 2020 05:10:41 +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 89F5A24AA9; Sat, 14 Nov 2020 05:10:41 +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 0AE5AfE2014700; Sat, 14 Nov 2020 05:10:41 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AE5AeXT014693; Sat, 14 Nov 2020 05:10:40 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011140510.0AE5AeXT014693@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 14 Nov 2020 05:10:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367668 - in head/sys/ufs: ffs ufs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/ufs: ffs ufs X-SVN-Commit-Revision: 367668 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 05:10:41 -0000 Author: kib Date: Sat Nov 14 05:10:39 2020 New Revision: 367668 URL: https://svnweb.freebsd.org/changeset/base/367668 Log: Add a framework that tracks exclusive vnode lock generation count for UFS. This count is memoized together with the lookup metadata in directory inode, and we assert that accesses to lookup metadata are done under the same lock generation as they were stored. Enabled under DIAGNOSTICS. UFS saves additional data for parent dirent when doing lookup (i_offset, i_count, i_endoff), and this data is used later by VOPs operating on dirents. If parent vnode exclusive lock is dropped and re-acquired between lookup and the VOP call, we corrupt directories. Framework asserts that corruption cannot occur that way, by tracking vnode lock generation counter. Updates to inode dirent members also save the counter, while users compare current and saved counters values. Also, fix a case in ufs_lookup_ino() where i_offset and i_count could be updated under shared lock. It is not a bug on its own since dvp i_offset results from such lookup cannot be used, but it causes false positive in the checker. In collaboration with: pho Reviewed by: mckusick (previous version), markj Tested by: markj (syzkaller), pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D26136 Modified: head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/ffs_vfsops.c head/sys/ufs/ffs/ffs_vnops.c head/sys/ufs/ufs/inode.h head/sys/ufs/ufs/ufs_lookup.c head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Sat Nov 14 02:11:56 2020 (r367667) +++ head/sys/ufs/ffs/ffs_alloc.c Sat Nov 14 05:10:39 2020 (r367668) @@ -3468,7 +3468,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) break; } dp = VTOI(dvp); - dp->i_offset = 12; /* XXX mastertemplate.dot_reclen */ + SET_I_OFFSET(dp, 12); /* XXX mastertemplate.dot_reclen */ error = ufs_dirrewrite(dp, VTOI(fdvp), (ino_t)cmd.size, DT_DIR, 0); cache_purge(fdvp); Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Sat Nov 14 02:11:56 2020 (r367667) +++ head/sys/ufs/ffs/ffs_softdep.c Sat Nov 14 05:10:39 2020 (r367668) @@ -8764,11 +8764,11 @@ softdep_change_directoryentry_offset(bp, dp, base, old if (MOUNTEDSUJ(mp)) { flags = DEPALLOC; jmvref = newjmvref(dp, de->d_ino, - dp->i_offset + (oldloc - base), - dp->i_offset + (newloc - base)); + I_OFFSET(dp) + (oldloc - base), + I_OFFSET(dp) + (newloc - base)); } - lbn = lblkno(ump->um_fs, dp->i_offset); - offset = blkoff(ump->um_fs, dp->i_offset); + lbn = lblkno(ump->um_fs, I_OFFSET(dp)); + offset = blkoff(ump->um_fs, I_OFFSET(dp)); oldoffset = offset + (oldloc - base); newoffset = offset + (newloc - base); ACQUIRE_LOCK(ump); @@ -9280,7 +9280,7 @@ newdirrem(bp, dp, ip, isrmdir, prevdirremp) jremref = dotremref = dotdotremref = NULL; if (DOINGSUJ(dvp)) { if (isrmdir) { - jremref = newjremref(dirrem, dp, ip, dp->i_offset, + jremref = newjremref(dirrem, dp, ip, I_OFFSET(dp), ip->i_effnlink + 2); dotremref = newjremref(dirrem, ip, ip, DOT_OFFSET, ip->i_effnlink + 1); @@ -9288,12 +9288,12 @@ newdirrem(bp, dp, ip, isrmdir, prevdirremp) dp->i_effnlink + 1); dotdotremref->jr_state |= MKDIR_PARENT; } else - jremref = newjremref(dirrem, dp, ip, dp->i_offset, + jremref = newjremref(dirrem, dp, ip, I_OFFSET(dp), ip->i_effnlink + 1); } ACQUIRE_LOCK(ump); - lbn = lblkno(ump->um_fs, dp->i_offset); - offset = blkoff(ump->um_fs, dp->i_offset); + lbn = lblkno(ump->um_fs, I_OFFSET(dp)); + offset = blkoff(ump->um_fs, I_OFFSET(dp)); pagedep_lookup(UFSTOVFS(ump), bp, dp->i_number, lbn, DEPALLOC, &pagedep); dirrem->dm_pagedep = pagedep; @@ -9304,7 +9304,7 @@ newdirrem(bp, dp, ip, isrmdir, prevdirremp) * the jremref is preserved for any potential diradd in this * location. This can not coincide with a rmdir. */ - if (dp->i_offset == DOTDOT_OFFSET) { + if (I_OFFSET(dp) == DOTDOT_OFFSET) { if (isrmdir) panic("newdirrem: .. directory change during remove?"); jremref = cancel_mkdir_dotdot(dp, dirrem, jremref); @@ -9405,7 +9405,7 @@ softdep_setup_directory_change(bp, dp, ip, newinum, is mp = ITOVFS(dp); ump = VFSTOUFS(mp); - offset = blkoff(ump->um_fs, dp->i_offset); + offset = blkoff(ump->um_fs, I_OFFSET(dp)); KASSERT(MOUNTEDSOFTDEP(mp) != 0, ("softdep_setup_directory_change called on non-softdep filesystem")); @@ -9508,7 +9508,7 @@ softdep_setup_directory_change(bp, dp, ip, newinum, is KASSERT(jaddref != NULL && jaddref->ja_parent == dp->i_number, ("softdep_setup_directory_change: bad jaddref %p", jaddref)); - jaddref->ja_diroff = dp->i_offset; + jaddref->ja_diroff = I_OFFSET(dp); jaddref->ja_diradd = dap; LIST_INSERT_HEAD(&pagedep->pd_diraddhd[DIRADDHASH(offset)], dap, da_pdlist); @@ -9527,7 +9527,7 @@ softdep_setup_directory_change(bp, dp, ip, newinum, is * committed when need to move the dot and dotdot references to * this new name. */ - if (inodedep->id_mkdiradd && dp->i_offset != DOTDOT_OFFSET) + if (inodedep->id_mkdiradd && I_OFFSET(dp) != DOTDOT_OFFSET) merge_diradd(inodedep, dap); FREE_LOCK(ump); } Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Sat Nov 14 02:11:56 2020 (r367667) +++ head/sys/ufs/ffs/ffs_vfsops.c Sat Nov 14 05:10:39 2020 (r367668) @@ -2001,6 +2001,9 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags) ip->i_nextclustercg = -1; ip->i_flag = fs->fs_magic == FS_UFS1_MAGIC ? 0 : IN_UFS2; ip->i_mode = 0; /* ensure error cases below throw away vnode */ +#ifdef DIAGNOSTIC + ufs_init_trackers(ip); +#endif #ifdef QUOTA { int i; Modified: head/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vnops.c Sat Nov 14 02:11:56 2020 (r367667) +++ head/sys/ufs/ffs/ffs_vnops.c Sat Nov 14 05:10:39 2020 (r367668) @@ -434,16 +434,20 @@ ffs_lock(ap) struct vop_lock1_args /* { struct vnode *a_vp; int a_flags; - struct thread *a_td; char *file; int line; } */ *ap; { +#if !defined(NO_FFS_SNAPSHOT) || defined(DIAGNOSTIC) + struct vnode *vp = ap->a_vp; +#endif /* !NO_FFS_SNAPSHOT || DIAGNOSTIC */ +#ifdef DIAGNOSTIC + struct inode *ip; +#endif /* DIAGNOSTIC */ + int result; #ifndef NO_FFS_SNAPSHOT - struct vnode *vp; int flags; struct lock *lkp; - int result; /* * Adaptive spinning mixed with SU leads to trouble. use a giant hammer @@ -456,12 +460,11 @@ ffs_lock(ap) case LK_SHARED: case LK_UPGRADE: case LK_EXCLUSIVE: - vp = ap->a_vp; flags = ap->a_flags; for (;;) { #ifdef DEBUG_VFS_LOCKS VNPASS(vp->v_holdcnt != 0, vp); -#endif +#endif /* DEBUG_VFS_LOCKS */ lkp = vp->v_vnlock; result = lockmgr_lock_flags(lkp, flags, &VI_MTX(vp)->lock_object, ap->a_file, ap->a_line); @@ -483,28 +486,67 @@ ffs_lock(ap) flags = (flags & ~LK_TYPE_MASK) | LK_EXCLUSIVE; flags &= ~LK_INTERLOCK; } +#ifdef DIAGNOSTIC + switch (ap->a_flags & LK_TYPE_MASK) { + case LK_UPGRADE: + case LK_EXCLUSIVE: + if (result == 0 && vp->v_vnlock->lk_recurse == 0) { + ip = VTOI(vp); + if (ip != NULL) + ip->i_lock_gen++; + } + } +#endif /* DIAGNOSTIC */ break; default: +#ifdef DIAGNOSTIC + if ((ap->a_flags & LK_TYPE_MASK) == LK_DOWNGRADE) { + ip = VTOI(vp); + if (ip != NULL) + ufs_unlock_tracker(ip); + } +#endif /* DIAGNOSTIC */ result = VOP_LOCK1_APV(&ufs_vnodeops, ap); + break; } - return (result); -#else +#else /* NO_FFS_SNAPSHOT */ /* * See above for an explanation. */ if ((ap->a_flags & LK_NODDLKTREAT) != 0) ap->a_flags |= LK_ADAPTIVE; - return (VOP_LOCK1_APV(&ufs_vnodeops, ap)); -#endif +#ifdef DIAGNOSTIC + if ((ap->a_flags & LK_TYPE_MASK) == LK_DOWNGRADE) { + ip = VTOI(vp); + if (ip != NULL) + ufs_unlock_tracker(ip); + } +#endif /* DIAGNOSTIC */ + result = VOP_LOCK1_APV(&ufs_vnodeops, ap); +#endif /* NO_FFS_SNAPSHOT */ +#ifdef DIAGNOSTIC + switch (ap->a_flags & LK_TYPE_MASK) { + case LK_UPGRADE: + case LK_EXCLUSIVE: + if (result == 0 && vp->v_vnlock->lk_recurse == 0) { + ip = VTOI(vp); + if (ip != NULL) + ip->i_lock_gen++; + } + } +#endif /* DIAGNOSTIC */ + return (result); } #ifdef INVARIANTS static int ffs_unlock_debug(struct vop_unlock_args *ap) { - struct vnode *vp = ap->a_vp; - struct inode *ip = VTOI(vp); + struct vnode *vp; + struct inode *ip; + vp = ap->a_vp; + ip = VTOI(vp); if (ip->i_flag & UFS_INODE_FLAG_LAZY_MASK_ASSERTABLE) { if ((vp->v_mflag & VMP_LAZYLIST) == 0) { VI_LOCK(vp); @@ -514,6 +556,11 @@ ffs_unlock_debug(struct vop_unlock_args *ap) VI_UNLOCK(vp); } } +#ifdef DIAGNOSTIC + if (VOP_ISLOCKED(vp) == LK_EXCLUSIVE && ip != NULL && + vp->v_vnlock->lk_recurse == 0) + ufs_unlock_tracker(ip); +#endif return (VOP_UNLOCK_APV(&ufs_vnodeops, ap)); } #endif Modified: head/sys/ufs/ufs/inode.h ============================================================================== --- head/sys/ufs/ufs/inode.h Sat Nov 14 02:11:56 2020 (r367667) +++ head/sys/ufs/ufs/inode.h Sat Nov 14 05:10:39 2020 (r367668) @@ -44,12 +44,24 @@ #include #include #include +#ifdef DIAGNOSTIC +#include +#endif /* * This must agree with the definition in . */ #define doff_t int32_t +#ifdef DIAGNOSTIC +struct iown_tracker { + struct thread *tr_owner; + struct stack tr_st; + struct stack tr_unlock; + int tr_gen; +}; +#endif + /* * The inode is used to describe each active (or recently active) file in the * UFS filesystem. It is composed of two types of information. The first part @@ -94,6 +106,12 @@ struct inode { doff_t i_endoff; /* End of useful stuff in directory. */ doff_t i_diroff; /* Offset in dir, where we found last entry. */ doff_t i_offset; /* Offset of free space in directory. */ +#ifdef DIAGNOSTIC + int i_lock_gen; + struct iown_tracker i_count_tracker; + struct iown_tracker i_endoff_tracker; + struct iown_tracker i_offset_tracker; +#endif int i_nextclustercg; /* last cg searched for cluster */ @@ -254,6 +272,35 @@ struct ufid { uint32_t ufid_ino; /* File number (ino). */ uint32_t ufid_gen; /* Generation number. */ }; + +#ifdef DIAGNOSTIC +void ufs_init_trackers(struct inode *ip); +void ufs_unlock_tracker(struct inode *ip); + +doff_t ufs_get_i_offset(struct inode *ip, const char *file, int line); +void ufs_set_i_offset(struct inode *ip, doff_t off, const char *file, int line); +#define I_OFFSET(ip) ufs_get_i_offset(ip, __FILE__, __LINE__) +#define SET_I_OFFSET(ip, off) ufs_set_i_offset(ip, off, __FILE__, __LINE__) + +int32_t ufs_get_i_count(struct inode *ip, const char *file, int line); +void ufs_set_i_count(struct inode *ip, int32_t cnt, const char *file, int line); +#define I_COUNT(ip) ufs_get_i_count(ip, __FILE__, __LINE__) +#define SET_I_COUNT(ip, cnt) ufs_set_i_count(ip, cnt, __FILE__, __LINE__) + +doff_t ufs_get_i_endoff(struct inode *ip, const char *file, int line); +void ufs_set_i_endoff(struct inode *ip, doff_t off, const char *file, int line); +#define I_ENDOFF(ip) ufs_get_i_endoff(ip, __FILE__, __LINE__) +#define SET_I_ENDOFF(ip, off) ufs_set_i_endoff(ip, off, __FILE__, __LINE__) + +#else +#define I_OFFSET(ip) ((ip)->i_offset) +#define SET_I_OFFSET(ip, off) ((ip)->i_offset = (off)) +#define I_COUNT(ip) ((ip)->i_count) +#define SET_I_COUNT(ip, cnt) ((ip)->i_count = cnt) +#define I_ENDOFF(ip) ((ip)->i_endoff) +#define SET_I_ENDOFF(ip, off) ((ip)->i_endoff = off) +#endif + #endif /* _KERNEL */ #endif /* !_UFS_UFS_INODE_H_ */ Modified: head/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- head/sys/ufs/ufs/ufs_lookup.c Sat Nov 14 02:11:56 2020 (r367667) +++ head/sys/ufs/ufs/ufs_lookup.c Sat Nov 14 05:10:39 2020 (r367668) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #endif #include #include +#include #ifdef DIAGNOSTIC static int dirchk = 1; @@ -504,22 +505,22 @@ notfound: * dp->i_offset + dp->i_count. */ if (slotstatus == NONE) { - dp->i_offset = roundup2(dp->i_size, DIRBLKSIZ); - dp->i_count = 0; - enduseful = dp->i_offset; + SET_I_OFFSET(dp, roundup2(dp->i_size, DIRBLKSIZ)); + SET_I_COUNT(dp, 0); + enduseful = I_OFFSET(dp); } else if (nameiop == DELETE) { - dp->i_offset = slotoffset; - if ((dp->i_offset & (DIRBLKSIZ - 1)) == 0) - dp->i_count = 0; + SET_I_OFFSET(dp, slotoffset); + if ((I_OFFSET(dp) & (DIRBLKSIZ - 1)) == 0) + SET_I_COUNT(dp, 0); else - dp->i_count = dp->i_offset - prevoff; + SET_I_COUNT(dp, I_OFFSET(dp) - prevoff); } else { - dp->i_offset = slotoffset; - dp->i_count = slotsize; + SET_I_OFFSET(dp, slotoffset); + SET_I_COUNT(dp, slotsize); if (enduseful < slotoffset + slotsize) enduseful = slotoffset + slotsize; } - dp->i_endoff = roundup2(enduseful, DIRBLKSIZ); + SET_I_ENDOFF(dp, roundup2(enduseful, DIRBLKSIZ)); /* * We return with the directory locked, so that * the parameters we set up above will still be @@ -575,24 +576,32 @@ found: if (nameiop == DELETE && (flags & ISLASTCN)) { if (flags & LOCKPARENT) ASSERT_VOP_ELOCKED(vdp, __FUNCTION__); - /* - * Return pointer to current entry in dp->i_offset, - * and distance past previous entry (if there - * is a previous entry in this block) in dp->i_count. - * Save directory inode pointer in ndp->ni_dvp for dirremove(). - * - * Technically we shouldn't be setting these in the - * WANTPARENT case (first lookup in rename()), but any - * lookups that will result in directory changes will - * overwrite these. - */ - dp->i_offset = i_offset; - if ((dp->i_offset & (DIRBLKSIZ - 1)) == 0) - dp->i_count = 0; - else - dp->i_count = dp->i_offset - prevoff; + + if (VOP_ISLOCKED(vdp) == LK_EXCLUSIVE) { + /* + * Return pointer to current entry in + * dp->i_offset, and distance past previous + * entry (if there is a previous entry in this + * block) in dp->i_count. + * + * We shouldn't be setting these in the + * WANTPARENT case (first lookup in rename()), but any + * lookups that will result in directory changes will + * overwrite these. + */ + SET_I_OFFSET(dp, i_offset); + if ((I_OFFSET(dp) & (DIRBLKSIZ - 1)) == 0) + SET_I_COUNT(dp, 0); + else + SET_I_COUNT(dp, I_OFFSET(dp) - prevoff); + } if (dd_ino != NULL) return (0); + + /* + * Save directory inode pointer in ndp->ni_dvp for + * dirremove(). + */ if ((error = VFS_VGET(vdp->v_mount, ino, LK_EXCLUSIVE, &tdp)) != 0) return (error); @@ -629,7 +638,7 @@ found: * Careful about locking second inode. * This can only occur if the target is ".". */ - dp->i_offset = i_offset; + SET_I_OFFSET(dp, i_offset); if (dp->i_number == ino) return (EISDIR); if (dd_ino != NULL) @@ -887,14 +896,14 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp, isrename) dp = VTOI(dvp); newentrysize = DIRSIZ(OFSFMT(dvp), dirp); - if (dp->i_count == 0) { + if (I_COUNT(dp) == 0) { /* * If dp->i_count is 0, then namei could find no * space in the directory. Here, dp->i_offset will * be on a directory block boundary and we will write the * new entry into a fresh block. */ - if (dp->i_offset & (DIRBLKSIZ - 1)) + if (I_OFFSET(dp) & (DIRBLKSIZ - 1)) panic("ufs_direnter: newblk"); flags = BA_CLRBUF; if (!DOINGSOFTDEP(dvp) && !DOINGASYNC(dvp)) @@ -907,28 +916,28 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp, isrename) } #endif old_isize = dp->i_size; - vnode_pager_setsize(dvp, (u_long)dp->i_offset + DIRBLKSIZ); - if ((error = UFS_BALLOC(dvp, (off_t)dp->i_offset, DIRBLKSIZ, + vnode_pager_setsize(dvp, (u_long)I_OFFSET(dp) + DIRBLKSIZ); + if ((error = UFS_BALLOC(dvp, (off_t)I_OFFSET(dp), DIRBLKSIZ, cr, flags, &bp)) != 0) { if (DOINGSOFTDEP(dvp) && newdirbp != NULL) bdwrite(newdirbp); vnode_pager_setsize(dvp, (u_long)old_isize); return (error); } - dp->i_size = dp->i_offset + DIRBLKSIZ; + dp->i_size = I_OFFSET(dp) + DIRBLKSIZ; DIP_SET(dp, i_size, dp->i_size); - dp->i_endoff = dp->i_size; + SET_I_ENDOFF(dp, dp->i_size); UFS_INODE_SET_FLAG(dp, IN_SIZEMOD | IN_CHANGE | IN_UPDATE); dirp->d_reclen = DIRBLKSIZ; - blkoff = dp->i_offset & + blkoff = I_OFFSET(dp) & (VFSTOUFS(dvp->v_mount)->um_mountp->mnt_stat.f_iosize - 1); bcopy((caddr_t)dirp, (caddr_t)bp->b_data + blkoff,newentrysize); #ifdef UFS_DIRHASH if (dp->i_dirhash != NULL) { - ufsdirhash_newblk(dp, dp->i_offset); - ufsdirhash_add(dp, dirp, dp->i_offset); + ufsdirhash_newblk(dp, I_OFFSET(dp)); + ufsdirhash_add(dp, dirp, I_OFFSET(dp)); ufsdirhash_checkblock(dp, (char *)bp->b_data + blkoff, - dp->i_offset); + I_OFFSET(dp)); } #endif if (DOINGSOFTDEP(dvp)) { @@ -944,7 +953,7 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp, isrename) (bp->b_data + blkoff))->d_reclen = DIRBLKSIZ; blkoff += DIRBLKSIZ; } - if (softdep_setup_directory_add(bp, dp, dp->i_offset, + if (softdep_setup_directory_add(bp, dp, I_OFFSET(dp), dirp->d_ino, newdirbp, 1)) UFS_INODE_SET_FLAG(dp, IN_NEEDSYNC); if (newdirbp) @@ -1001,15 +1010,15 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp, isrename) * * N.B. - THIS IS AN ARTIFACT OF 4.2 AND SHOULD NEVER HAPPEN. */ - if (dp->i_offset + dp->i_count > dp->i_size) { - dp->i_size = dp->i_offset + dp->i_count; + if (I_OFFSET(dp) + I_COUNT(dp) > dp->i_size) { + dp->i_size = I_OFFSET(dp) + I_COUNT(dp); DIP_SET(dp, i_size, dp->i_size); UFS_INODE_SET_FLAG(dp, IN_SIZEMOD | IN_MODIFIED); } /* * Get the block containing the space for the new directory entry. */ - error = UFS_BLKATOFF(dvp, (off_t)dp->i_offset, &dirbuf, &bp); + error = UFS_BLKATOFF(dvp, (off_t)I_OFFSET(dp), &dirbuf, &bp); if (error) { if (DOINGSOFTDEP(dvp) && newdirbp != NULL) bdwrite(newdirbp); @@ -1024,7 +1033,7 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp, isrename) ep = (struct direct *)dirbuf; dsize = ep->d_ino ? DIRSIZ(OFSFMT(dvp), ep) : 0; spacefree = ep->d_reclen - dsize; - for (loc = ep->d_reclen; loc < dp->i_count; ) { + for (loc = ep->d_reclen; loc < I_COUNT(dp); ) { nep = (struct direct *)(dirbuf + loc); /* Trim the existing slot (NB: dsize may be zero). */ @@ -1052,8 +1061,8 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp, isrename) #ifdef UFS_DIRHASH if (dp->i_dirhash != NULL) ufsdirhash_move(dp, nep, - dp->i_offset + ((char *)nep - dirbuf), - dp->i_offset + ((char *)ep - dirbuf)); + I_OFFSET(dp) + ((char *)nep - dirbuf), + I_OFFSET(dp) + ((char *)ep - dirbuf)); #endif if (DOINGSOFTDEP(dvp)) softdep_change_directoryentry_offset(bp, dp, dirbuf, @@ -1094,19 +1103,19 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp, isrename) #ifdef UFS_DIRHASH if (dp->i_dirhash != NULL && (ep->d_ino == 0 || dirp->d_reclen == spacefree)) - ufsdirhash_add(dp, dirp, dp->i_offset + ((char *)ep - dirbuf)); + ufsdirhash_add(dp, dirp, I_OFFSET(dp) + ((char *)ep - dirbuf)); #endif bcopy((caddr_t)dirp, (caddr_t)ep, (u_int)newentrysize); #ifdef UFS_DIRHASH if (dp->i_dirhash != NULL) ufsdirhash_checkblock(dp, dirbuf - - (dp->i_offset & (DIRBLKSIZ - 1)), - rounddown2(dp->i_offset, DIRBLKSIZ)); + (I_OFFSET(dp) & (DIRBLKSIZ - 1)), + rounddown2(I_OFFSET(dp), DIRBLKSIZ)); #endif if (DOINGSOFTDEP(dvp)) { (void) softdep_setup_directory_add(bp, dp, - dp->i_offset + (caddr_t)ep - dirbuf, + I_OFFSET(dp) + (caddr_t)ep - dirbuf, dirp->d_ino, newdirbp, 0); if (newdirbp != NULL) bdwrite(newdirbp); @@ -1128,10 +1137,10 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp, isrename) * lock on the newly entered node. */ if (isrename == 0 && error == 0 && - dp->i_endoff && dp->i_endoff < dp->i_size) { + I_ENDOFF(dp) != 0 && I_ENDOFF(dp) < dp->i_size) { if (tvp != NULL) VOP_UNLOCK(tvp); - error = UFS_TRUNCATE(dvp, (off_t)dp->i_endoff, + error = UFS_TRUNCATE(dvp, (off_t)I_ENDOFF(dp), IO_NORMAL | (DOINGASYNC(dvp) ? 0 : IO_SYNC), cr); if (error != 0) vn_printf(dvp, @@ -1139,7 +1148,7 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp, isrename) error); #ifdef UFS_DIRHASH if (error == 0 && dp->i_dirhash != NULL) - ufsdirhash_dirtrunc(dp, dp->i_endoff); + ufsdirhash_dirtrunc(dp, I_ENDOFF(dp)); #endif error = 0; if (tvp != NULL) @@ -1190,9 +1199,9 @@ ufs_dirremove(dvp, ip, flags, isrmdir) } } if (flags & DOWHITEOUT) - offset = dp->i_offset; + offset = I_OFFSET(dp); else - offset = dp->i_offset - dp->i_count; + offset = I_OFFSET(dp) - I_COUNT(dp); if ((error = UFS_BLKATOFF(dvp, offset, (char **)&ep, &bp)) != 0) { if (ip) { ip->i_effnlink++; @@ -1216,7 +1225,7 @@ ufs_dirremove(dvp, ip, flags, isrmdir) goto out; } /* Set 'rep' to the entry being removed. */ - if (dp->i_count == 0) + if (I_COUNT(dp) == 0) rep = ep; else rep = (struct direct *)((char *)ep + ep->d_reclen); @@ -1226,7 +1235,7 @@ ufs_dirremove(dvp, ip, flags, isrmdir) * that `ep' is the previous entry when dp->i_count != 0. */ if (dp->i_dirhash != NULL) - ufsdirhash_remove(dp, rep, dp->i_offset); + ufsdirhash_remove(dp, rep, I_OFFSET(dp)); #endif if (ip && rep->d_ino != ip->i_number) panic("ufs_dirremove: ip %ju does not match dirent ino %ju\n", @@ -1240,7 +1249,7 @@ ufs_dirremove(dvp, ip, flags, isrmdir) rep->d_type = 0; rep->d_ino = 0; - if (dp->i_count != 0) { + if (I_COUNT(dp) != 0) { /* * Collapse new free space into previous entry. */ @@ -1250,8 +1259,8 @@ ufs_dirremove(dvp, ip, flags, isrmdir) #ifdef UFS_DIRHASH if (dp->i_dirhash != NULL) ufsdirhash_checkblock(dp, (char *)ep - - ((dp->i_offset - dp->i_count) & (DIRBLKSIZ - 1)), - rounddown2(dp->i_offset, DIRBLKSIZ)); + ((I_OFFSET(dp) - I_COUNT(dp)) & (DIRBLKSIZ - 1)), + rounddown2(I_OFFSET(dp), DIRBLKSIZ)); #endif out: error = 0; @@ -1313,7 +1322,7 @@ ufs_dirrewrite(dp, oip, newinum, newtype, isrmdir) UFS_INODE_SET_FLAG(oip, IN_CHANGE); } - error = UFS_BLKATOFF(vdp, (off_t)dp->i_offset, (char **)&ep, &bp); + error = UFS_BLKATOFF(vdp, (off_t)I_OFFSET(dp), (char **)&ep, &bp); if (error == 0 && ep->d_namlen == 2 && ep->d_name[1] == '.' && ep->d_name[0] == '.' && ep->d_ino != oip->i_number) { brelse(bp); @@ -1522,3 +1531,115 @@ ufs_checkpath(ino_t source_ino, ino_t parent_ino, stru vput(vp); return (error); } + +#ifdef DIAGNOSTIC +static void +ufs_assert_inode_offset_owner(struct inode *ip, struct iown_tracker *tr, + const char *name, const char *file, int line) +{ + char msg[128]; + + snprintf(msg, sizeof(msg), "at %s@%d", file, line); + ASSERT_VOP_ELOCKED(ITOV(ip), msg); + MPASS((ip->i_mode & IFMT) == IFDIR); + if (curthread == tr->tr_owner && ip->i_lock_gen == tr->tr_gen) + return; + printf("locked at\n"); + stack_print(&tr->tr_st); + printf("unlocked at\n"); + stack_print(&tr->tr_unlock); + panic("%s ip %p %jd offset owner %p %d gen %d " + "curthread %p %d gen %d at %s@%d\n", + name, ip, (uintmax_t)ip->i_number, tr->tr_owner, + tr->tr_owner->td_tid, tr->tr_gen, + curthread, curthread->td_tid, ip->i_lock_gen, + file, line); +} + +static void +ufs_set_inode_offset_owner(struct inode *ip, struct iown_tracker *tr, + const char *file, int line) +{ + char msg[128]; + + snprintf(msg, sizeof(msg), "at %s@%d", file, line); + ASSERT_VOP_ELOCKED(ITOV(ip), msg); + MPASS((ip->i_mode & IFMT) == IFDIR); + tr->tr_owner = curthread; + tr->tr_gen = ip->i_lock_gen; + stack_save(&tr->tr_st); +} + +static void +ufs_init_one_tracker(struct iown_tracker *tr) +{ + tr->tr_owner = NULL; + stack_zero(&tr->tr_st); +} + +void +ufs_init_trackers(struct inode *ip) +{ + ufs_init_one_tracker(&ip->i_offset_tracker); + ufs_init_one_tracker(&ip->i_count_tracker); + ufs_init_one_tracker(&ip->i_endoff_tracker); +} + +void +ufs_unlock_tracker(struct inode *ip) +{ + if (ip->i_count_tracker.tr_gen == ip->i_lock_gen) + stack_save(&ip->i_count_tracker.tr_unlock); + if (ip->i_offset_tracker.tr_gen == ip->i_lock_gen) + stack_save(&ip->i_offset_tracker.tr_unlock); + if (ip->i_endoff_tracker.tr_gen == ip->i_lock_gen) + stack_save(&ip->i_endoff_tracker.tr_unlock); + ip->i_lock_gen++; +} + +doff_t +ufs_get_i_offset(struct inode *ip, const char *file, int line) +{ + ufs_assert_inode_offset_owner(ip, &ip->i_offset_tracker, "i_offset", + file, line); + return (ip->i_offset); +} + +void +ufs_set_i_offset(struct inode *ip, doff_t off, const char *file, int line) +{ + ufs_set_inode_offset_owner(ip, &ip->i_offset_tracker, file, line); + ip->i_offset = off; +} + +int32_t +ufs_get_i_count(struct inode *ip, const char *file, int line) +{ + ufs_assert_inode_offset_owner(ip, &ip->i_count_tracker, "i_count", + file, line); + return (ip->i_count); +} + +void +ufs_set_i_count(struct inode *ip, int32_t cnt, const char *file, int line) +{ + ufs_set_inode_offset_owner(ip, &ip->i_count_tracker, file, line); + ip->i_count = cnt; +} + +doff_t +ufs_get_i_endoff(struct inode *ip, const char *file, int line) +{ + ufs_assert_inode_offset_owner(ip, &ip->i_endoff_tracker, "i_endoff", + file, line); + return (ip->i_endoff); +} + +void +ufs_set_i_endoff(struct inode *ip, doff_t off, const char *file, int line) +{ + ufs_set_inode_offset_owner(ip, &ip->i_endoff_tracker, file, line); + ip->i_endoff = off; +} + +#endif Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Sat Nov 14 02:11:56 2020 (r367667) +++ head/sys/ufs/ufs/ufs_vnops.c Sat Nov 14 05:10:39 2020 (r367668) @@ -1481,9 +1481,9 @@ relock: if (error) goto bad; /* Setup tdvp for directory compaction if needed. */ - if (tdp->i_count && tdp->i_endoff && - tdp->i_endoff < tdp->i_size) - endoff = tdp->i_endoff; + if (I_COUNT(tdp) != 0 && I_ENDOFF(tdp) != 0 && + I_ENDOFF(tdp) < tdp->i_size) + endoff = I_ENDOFF(tdp); } else { if (ITODEV(tip) != ITODEV(tdp) || ITODEV(tip) != ITODEV(fip)) panic("ufs_rename: EXDEV"); @@ -1611,7 +1611,7 @@ relock: } else if (DOINGSUJ(tdvp)) /* Journal must account for each new link. */ softdep_setup_dotdot_link(tdp, fip); - fip->i_offset = mastertemplate.dot_reclen; + SET_I_OFFSET(fip, mastertemplate.dot_reclen); ufs_dirrewrite(fip, fdp, newparent, DT_DIR, 0); cache_purge(fdvp); } From owner-svn-src-head@freebsd.org Sat Nov 14 05:17:05 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 05EC42D66F0; Sat, 14 Nov 2020 05:17:05 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CY3VS6bLxz4Tlp; Sat, 14 Nov 2020 05:17:04 +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 D0F1B24A49; Sat, 14 Nov 2020 05:17:04 +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 0AE5H4gx020954; Sat, 14 Nov 2020 05:17:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AE5H4iW020953; Sat, 14 Nov 2020 05:17:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011140517.0AE5H4iW020953@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 14 Nov 2020 05:17:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367669 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 367669 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 05:17:05 -0000 Author: kib Date: Sat Nov 14 05:17:04 2020 New Revision: 367669 URL: https://svnweb.freebsd.org/changeset/base/367669 Log: Add a framework that tracks exclusive vnode lock generation count for UFS. This count is memoized together with the lookup metadata in directory inode, and we assert that accesses to lookup metadata are done under the same lock generation as they were stored. Enabled under DIAGNOSTICS. UFS saves additional data for parent dirent when doing lookup (i_offset, i_count, i_endoff), and this data is used later by VOPs operating on dirents. If parent vnode exclusive lock is dropped and re-acquired between lookup and the VOP call, we corrupt directories. Framework asserts that corruption cannot occur that way, by tracking vnode lock generation counter. Updates to inode dirent members also save the counter, while users compare current and saved counters values. Also, fix a case in ufs_lookup_ino() where i_offset and i_count could be updated under shared lock. It is not a bug on its own since dvp i_offset results from such lookup cannot be used, but it causes false positive in the checker. In collaboration with: pho Reviewed by: mckusick (previous version), markj Tested by: markj (syzkaller), pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D26136 Modified: head/sys/ufs/ffs/ffs_inode.c Modified: head/sys/ufs/ffs/ffs_inode.c ============================================================================== --- head/sys/ufs/ffs/ffs_inode.c Sat Nov 14 05:10:39 2020 (r367668) +++ head/sys/ufs/ffs/ffs_inode.c Sat Nov 14 05:17:04 2020 (r367669) @@ -67,6 +67,17 @@ __FBSDID("$FreeBSD$"); static int ffs_indirtrunc(struct inode *, ufs2_daddr_t, ufs2_daddr_t, ufs2_daddr_t, int, ufs2_daddr_t *); +static void +ffs_inode_bwrite(struct vnode *vp, struct buf *bp, int flags) +{ + if ((flags & IO_SYNC) != 0) + bwrite(bp); + else if (DOINGASYNC(vp)) + bdwrite(bp); + else + bawrite(bp); +} + /* * Update the access, modified, and inode change times as specified by the * IN_ACCESS, IN_UPDATE, and IN_CHANGE flags respectively. Write the inode @@ -357,12 +368,7 @@ ffs_truncate(vp, length, flags, cred) DIP_SET(ip, i_size, length); if (bp->b_bufsize == fs->fs_bsize) bp->b_flags |= B_CLUSTEROK; - if (flags & IO_SYNC) - bwrite(bp); - else if (DOINGASYNC(vp)) - bdwrite(bp); - else - bawrite(bp); + ffs_inode_bwrite(vp, bp, flags); UFS_INODE_SET_FLAG(ip, IN_SIZEMOD | IN_CHANGE | IN_UPDATE); return (ffs_update(vp, waitforupdate)); } @@ -478,12 +484,7 @@ ffs_truncate(vp, length, flags, cred) allocbuf(bp, size); if (bp->b_bufsize == fs->fs_bsize) bp->b_flags |= B_CLUSTEROK; - if (flags & IO_SYNC) - bwrite(bp); - else if (DOINGASYNC(vp)) - bdwrite(bp); - else - bawrite(bp); + ffs_inode_bwrite(vp, bp, flags); UFS_INODE_SET_FLAG(ip, IN_SIZEMOD | IN_CHANGE | IN_UPDATE); } /* From owner-svn-src-head@freebsd.org Sat Nov 14 05:19:44 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F01032D654D; Sat, 14 Nov 2020 05:19: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CY3YX6Pw8z4V3N; Sat, 14 Nov 2020 05:19: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 CEBDE24A4A; Sat, 14 Nov 2020 05:19: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 0AE5JiJw021148; Sat, 14 Nov 2020 05:19:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AE5Jikq021147; Sat, 14 Nov 2020 05:19:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011140519.0AE5Jikq021147@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 14 Nov 2020 05:19:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367670 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 367670 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 05:19:45 -0000 Author: kib Date: Sat Nov 14 05:19:44 2020 New Revision: 367670 URL: https://svnweb.freebsd.org/changeset/base/367670 Log: Revert r367669 to re-commit with proper message Modified: head/sys/ufs/ffs/ffs_inode.c Modified: head/sys/ufs/ffs/ffs_inode.c ============================================================================== --- head/sys/ufs/ffs/ffs_inode.c Sat Nov 14 05:17:04 2020 (r367669) +++ head/sys/ufs/ffs/ffs_inode.c Sat Nov 14 05:19:44 2020 (r367670) @@ -67,17 +67,6 @@ __FBSDID("$FreeBSD$"); static int ffs_indirtrunc(struct inode *, ufs2_daddr_t, ufs2_daddr_t, ufs2_daddr_t, int, ufs2_daddr_t *); -static void -ffs_inode_bwrite(struct vnode *vp, struct buf *bp, int flags) -{ - if ((flags & IO_SYNC) != 0) - bwrite(bp); - else if (DOINGASYNC(vp)) - bdwrite(bp); - else - bawrite(bp); -} - /* * Update the access, modified, and inode change times as specified by the * IN_ACCESS, IN_UPDATE, and IN_CHANGE flags respectively. Write the inode @@ -368,7 +357,12 @@ ffs_truncate(vp, length, flags, cred) DIP_SET(ip, i_size, length); if (bp->b_bufsize == fs->fs_bsize) bp->b_flags |= B_CLUSTEROK; - ffs_inode_bwrite(vp, bp, flags); + if (flags & IO_SYNC) + bwrite(bp); + else if (DOINGASYNC(vp)) + bdwrite(bp); + else + bawrite(bp); UFS_INODE_SET_FLAG(ip, IN_SIZEMOD | IN_CHANGE | IN_UPDATE); return (ffs_update(vp, waitforupdate)); } @@ -484,7 +478,12 @@ ffs_truncate(vp, length, flags, cred) allocbuf(bp, size); if (bp->b_bufsize == fs->fs_bsize) bp->b_flags |= B_CLUSTEROK; - ffs_inode_bwrite(vp, bp, flags); + if (flags & IO_SYNC) + bwrite(bp); + else if (DOINGASYNC(vp)) + bdwrite(bp); + else + bawrite(bp); UFS_INODE_SET_FLAG(ip, IN_SIZEMOD | IN_CHANGE | IN_UPDATE); } /* From owner-svn-src-head@freebsd.org Sat Nov 14 05:20:00 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8AAB22D6556; Sat, 14 Nov 2020 05:20:00 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CY3Yr3Rjkz4TyJ; Sat, 14 Nov 2020 05:20:00 +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 694032477E; Sat, 14 Nov 2020 05:20:00 +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 0AE5K0Zl021249; Sat, 14 Nov 2020 05:20:00 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AE5K0JG021248; Sat, 14 Nov 2020 05:20:00 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011140520.0AE5K0JG021248@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 14 Nov 2020 05:20:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367671 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 367671 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 05:20:00 -0000 Author: kib Date: Sat Nov 14 05:19:59 2020 New Revision: 367671 URL: https://svnweb.freebsd.org/changeset/base/367671 Log: Add ffs_inode_bwrite() helper. In collaboration with: pho Reviewed by: mckusick (previous version), markj Tested by: markj (syzkaller), pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D26136 Modified: head/sys/ufs/ffs/ffs_inode.c Modified: head/sys/ufs/ffs/ffs_inode.c ============================================================================== --- head/sys/ufs/ffs/ffs_inode.c Sat Nov 14 05:19:44 2020 (r367670) +++ head/sys/ufs/ffs/ffs_inode.c Sat Nov 14 05:19:59 2020 (r367671) @@ -67,6 +67,17 @@ __FBSDID("$FreeBSD$"); static int ffs_indirtrunc(struct inode *, ufs2_daddr_t, ufs2_daddr_t, ufs2_daddr_t, int, ufs2_daddr_t *); +static void +ffs_inode_bwrite(struct vnode *vp, struct buf *bp, int flags) +{ + if ((flags & IO_SYNC) != 0) + bwrite(bp); + else if (DOINGASYNC(vp)) + bdwrite(bp); + else + bawrite(bp); +} + /* * Update the access, modified, and inode change times as specified by the * IN_ACCESS, IN_UPDATE, and IN_CHANGE flags respectively. Write the inode @@ -357,12 +368,7 @@ ffs_truncate(vp, length, flags, cred) DIP_SET(ip, i_size, length); if (bp->b_bufsize == fs->fs_bsize) bp->b_flags |= B_CLUSTEROK; - if (flags & IO_SYNC) - bwrite(bp); - else if (DOINGASYNC(vp)) - bdwrite(bp); - else - bawrite(bp); + ffs_inode_bwrite(vp, bp, flags); UFS_INODE_SET_FLAG(ip, IN_SIZEMOD | IN_CHANGE | IN_UPDATE); return (ffs_update(vp, waitforupdate)); } @@ -478,12 +484,7 @@ ffs_truncate(vp, length, flags, cred) allocbuf(bp, size); if (bp->b_bufsize == fs->fs_bsize) bp->b_flags |= B_CLUSTEROK; - if (flags & IO_SYNC) - bwrite(bp); - else if (DOINGASYNC(vp)) - bdwrite(bp); - else - bawrite(bp); + ffs_inode_bwrite(vp, bp, flags); UFS_INODE_SET_FLAG(ip, IN_SIZEMOD | IN_CHANGE | IN_UPDATE); } /* From owner-svn-src-head@freebsd.org Sat Nov 14 05:30:13 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 192282D6C58; Sat, 14 Nov 2020 05:30:13 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CY3nd02jQz4VTd; Sat, 14 Nov 2020 05:30:13 +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 DE70A24F4B; Sat, 14 Nov 2020 05:30:12 +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 0AE5UCkQ027852; Sat, 14 Nov 2020 05:30:12 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AE5UBC4027844; Sat, 14 Nov 2020 05:30:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011140530.0AE5UBC4027844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 14 Nov 2020 05:30:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367672 - in head/sys/ufs: ffs ufs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/ufs: ffs ufs X-SVN-Commit-Revision: 367672 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 05:30:13 -0000 Author: kib Date: Sat Nov 14 05:30:10 2020 New Revision: 367672 URL: https://svnweb.freebsd.org/changeset/base/367672 Log: Handle LoR in flush_pagedep_deps(). When operating in SU or SU+J mode, ffs_syncvnode() might need to instantiate other vnode by inode number while owning syncing vnode lock. Typically this other vnode is the parent of our vnode, but due to renames occuring right before fsync (or during fsync when we drop the syncing vnode lock, see below) it might be no longer parent. More, the called function flush_pagedep_deps() needs to lock other vnode while owning the lock for vnode which owns the buffer, for which the dependencies are flushed. This creates another instance of the same LoR as was fixed in softdep_sync(). Put the generic code for safe relocking into new SU helper get_parent_vp() and use it in flush_pagedep_deps(). The case for safe relocking of two vnodes with undefined lock order was extracted into vn helper vn_lock_pair(). Due to call sequence ffs_syncvnode()->softdep_sync_buf()->flush_pagedep_deps(), ffs_syncvnode() indicates with ERELOOKUP that passed vnode was unlocked in process, and can return ENOENT if the passed vnode reclaimed. All callers of the function were inspected. Because UFS namei lookups store auxiliary information about directory entry in in-memory directory inode, and this information is then used by UFS code that creates/removed directory entry in the actual mutating VOPs, it is critical that directory vnode lock is not dropped between lookup and VOP. For softdep_prelink(), which ensures that later link/unlink operation can proceed without overflowing the journal, calls were moved to the place where it is safe to drop processing VOP because mutations are not yet applied. Then, ERELOOKUP causes restart of the whole VFS operation (typically VFS syscall) at top level, including the re-lookup of the involved pathes. [Note that we already do the same restart for failing calls to vn_start_write(), so formally this patch does not introduce new behavior.] Similarly, unsafe calls to fsync in snapshot creation code were plugged. A possible view on these failures is that it does not make sense to continue creating snapshot if the snapshot vnode was reclaimed due to forced unmount. It is possible that relock/ERELOOKUP situation occurs in ffs_truncate() called from ufs_inactive(). In this case, dropping the vnode lock is not safe. Detect the situation with VI_DOINGINACT and reschedule inactivation by setting VI_OWEINACT. ufs_inactive() rechecks VI_OWEINACT and avoids reclaiming vnode is truncation failed this way. In ffs_truncate(), allocation of the EOF block for partial truncation is re-done after vnode is synced, since we cannot leave the buffer locked through ffs_syncvnode(). In collaboration with: pho Reviewed by: mckusick (previous version), markj Tested by: markj (syzkaller), pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D26136 Modified: head/sys/ufs/ffs/ffs_extern.h head/sys/ufs/ffs/ffs_inode.c head/sys/ufs/ffs/ffs_snapshot.c head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/ffs_vfsops.c head/sys/ufs/ffs/ffs_vnops.c head/sys/ufs/ufs/ufs_inode.c head/sys/ufs/ufs/ufs_lookup.c head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/ufs/ffs/ffs_extern.h ============================================================================== --- head/sys/ufs/ffs/ffs_extern.h Sat Nov 14 05:19:59 2020 (r367671) +++ head/sys/ufs/ffs/ffs_extern.h Sat Nov 14 05:30:10 2020 (r367672) @@ -173,6 +173,9 @@ void softdep_load_inodeblock(struct inode *); void softdep_freefile(struct vnode *, ino_t, int); int softdep_request_cleanup(struct fs *, struct vnode *, struct ucred *, int); +int softdep_prerename(struct vnode *, struct vnode *, struct vnode *, + struct vnode *); +int softdep_prelink(struct vnode *, struct vnode *, int); void softdep_setup_freeblocks(struct inode *, off_t, int); void softdep_setup_inomapdep(struct buf *, struct inode *, ino_t, int); void softdep_setup_blkmapdep(struct buf *, struct mount *, ufs2_daddr_t, Modified: head/sys/ufs/ffs/ffs_inode.c ============================================================================== --- head/sys/ufs/ffs/ffs_inode.c Sat Nov 14 05:19:59 2020 (r367671) +++ head/sys/ufs/ffs/ffs_inode.c Sat Nov 14 05:30:10 2020 (r367672) @@ -462,6 +462,8 @@ ffs_truncate(vp, length, flags, cred) error = UFS_BALLOC(vp, length - 1, 1, cred, flags, &bp); if (error) return (error); + ffs_inode_bwrite(vp, bp, flags); + /* * When we are doing soft updates and the UFS_BALLOC * above fills in a direct block hole with a full sized @@ -473,6 +475,10 @@ ffs_truncate(vp, length, flags, cred) if (DOINGSOFTDEP(vp) && lbn < UFS_NDADDR && fragroundup(fs, blkoff(fs, length)) < fs->fs_bsize && (error = ffs_syncvnode(vp, MNT_WAIT, 0)) != 0) + return (error); + + error = UFS_BALLOC(vp, length - 1, 1, cred, flags, &bp); + if (error) return (error); ip->i_size = length; DIP_SET(ip, i_size, length); Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Sat Nov 14 05:19:59 2020 (r367671) +++ head/sys/ufs/ffs/ffs_snapshot.c Sat Nov 14 05:30:10 2020 (r367672) @@ -301,6 +301,8 @@ restart: NDFREE(&nd, NDF_ONLY_PNBUF); vn_finished_write(wrtmp); vrele(nd.ni_dvp); + if (error == ERELOOKUP) + goto restart; return (error); } vp = nd.ni_vp; @@ -368,8 +370,12 @@ restart: if (error) goto out; bawrite(nbp); - if (cg % 10 == 0) - ffs_syncvnode(vp, MNT_WAIT, 0); + if (cg % 10 == 0) { + error = ffs_syncvnode(vp, MNT_WAIT, 0); + /* vp possibly reclaimed if unlocked */ + if (error != 0) + goto out; + } } /* * Copy all the cylinder group maps. Although the @@ -391,8 +397,8 @@ restart: goto out; error = cgaccount(cg, vp, nbp, 1); bawrite(nbp); - if (cg % 10 == 0) - ffs_syncvnode(vp, MNT_WAIT, 0); + if (cg % 10 == 0 && error == 0) + error = ffs_syncvnode(vp, MNT_WAIT, 0); if (error) goto out; } Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Sat Nov 14 05:19:59 2020 (r367671) +++ head/sys/ufs/ffs/ffs_softdep.c Sat Nov 14 05:30:10 2020 (r367672) @@ -609,6 +609,27 @@ softdep_freework(wkhd) panic("softdep_freework called"); } +int +softdep_prerename(fdvp, fvp, tdvp, tvp) + struct vnode *fdvp; + struct vnode *fvp; + struct vnode *tdvp; + struct vnode *tvp; +{ + + panic("softdep_prerename called"); +} + +int +softdep_prelink(dvp, vp, will_direnter) + struct vnode *dvp; + struct vnode *vp; + int will_direnter; +{ + + panic("softdep_prelink called"); +} + #else FEATURE(softupdates, "FFS soft-updates support"); @@ -748,7 +769,7 @@ static void unlinked_inodedep(struct mount *, struct i static void clear_unlinked_inodedep(struct inodedep *); static struct inodedep *first_unlinked_inodedep(struct ufsmount *); static int flush_pagedep_deps(struct vnode *, struct mount *, - struct diraddhd *); + struct diraddhd *, struct buf *); static int free_pagedep(struct pagedep *); static int flush_newblk_dep(struct vnode *, struct mount *, ufs_lbn_t); static int flush_inodedep_deps(struct vnode *, struct mount *, ino_t); @@ -925,7 +946,6 @@ static void journal_unmount(struct ufsmount *); static int journal_space(struct ufsmount *, int); static void journal_suspend(struct ufsmount *); static int journal_unsuspend(struct ufsmount *ump); -static void softdep_prelink(struct vnode *, struct vnode *); static void add_to_journal(struct worklist *); static void remove_from_journal(struct worklist *); static bool softdep_excess_items(struct ufsmount *, int); @@ -1390,6 +1410,136 @@ SYSCTL_INT(_debug_softdep, OID_AUTO, print_threads, CT static TAILQ_HEAD(, mount_softdeps) softdepmounts; /* + * This function fetches inode inum on mount point mp. We already + * hold a locked vnode vp, and might have a locked buffer bp belonging + * to vp. + + * We must not block on acquiring the new inode lock as we will get + * into a lock-order reversal with the buffer lock and possibly get a + * deadlock. Thus if we cannot instantiate the requested vnode + * without sleeping on its lock, we must unlock the vnode and the + * buffer before doing a blocking on the vnode lock. We return + * ERELOOKUP if we have had to unlock either the vnode or the buffer so + * that the caller can reassess its state. + * + * Top-level VFS code (for syscalls and other consumers, e.g. callers + * of VOP_FSYNC() in syncer) check for ERELOOKUP and restart at safe + * point. + * + * Since callers expect to operate on fully constructed vnode, we also + * recheck v_data after relock, and return ENOENT if NULL. + * + * If unlocking bp, we must unroll dequeueing its unfinished + * dependencies, and clear scan flag, before unlocking. If unlocking + * vp while it is under deactivation, we re-queue deactivation. + */ +static int +get_parent_vp(struct vnode *vp, struct mount *mp, ino_t inum, struct buf *bp, + struct diraddhd *diraddhdp, struct diraddhd *unfinishedp, + struct vnode **rvp) +{ + struct vnode *pvp; + struct diradd *dap; + int error; + bool bplocked; + + ASSERT_VOP_ELOCKED(vp, "child vnode must be locked"); + for (bplocked = true, pvp = NULL;;) { + error = ffs_vgetf(mp, inum, LK_EXCLUSIVE | LK_NOWAIT, &pvp, + FFSV_FORCEINSMQ); + if (error == 0) { + /* + * Since we could have unlocked vp, the inode + * number could no longer indicate a + * constructed node. In this case, we must + * restart the syscall. + */ + if (VTOI(pvp)->i_mode == 0 || !bplocked) { + if (VTOI(pvp)->i_mode == 0) + vgone(pvp); + vput(pvp); + error = ERELOOKUP; + goto out; + } + + error = 0; + goto out1; + } + if (bp != NULL && bplocked) { + /* + * Requeue unfinished dependencies before + * unlocking buffer, which could make + * diraddhdp invalid. + */ + ACQUIRE_LOCK(VFSTOUFS(mp)); + while ((dap = LIST_FIRST(unfinishedp)) != NULL) { + LIST_REMOVE(dap, da_pdlist); + LIST_INSERT_HEAD(diraddhdp, dap, da_pdlist); + } + FREE_LOCK(VFSTOUFS(mp)); + bp->b_vflags &= ~BV_SCANNED; + BUF_NOREC(bp); + BUF_UNLOCK(bp); + bplocked = false; + } + + /* + * Do not drop vnode lock while inactivating. This + * would result in leaks of the VI flags and + * reclaiming of non-truncated vnode. Instead, + * re-schedule inactivation hoping that we would be + * able to sync inode later. + */ + if ((vp->v_iflag & VI_DOINGINACT) != 0) { + VI_LOCK(vp); + vp->v_iflag |= VI_OWEINACT; + VI_UNLOCK(vp); + return (ERELOOKUP); + } + + VOP_UNLOCK(vp); + error = ffs_vgetf(mp, inum, LK_EXCLUSIVE, &pvp, + FFSV_FORCEINSMQ); + if (error != 0) { + MPASS(error != ERELOOKUP); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + break; + } + if (VTOI(pvp)->i_mode == 0) { + vgone(pvp); + vput(pvp); + pvp = NULL; + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + error = ERELOOKUP; + break; + } + error = vn_lock(vp, LK_EXCLUSIVE | LK_NOWAIT); + if (error == 0) + break; + vput(pvp); + pvp = NULL; + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + if (vp->v_data == NULL) { + error = ENOENT; + break; + } + } + if (bp != NULL) { + MPASS(!bplocked); + error = ERELOOKUP; + } + if (error != 0 && pvp != NULL) { + vput(pvp); + pvp = NULL; + } +out1: + *rvp = pvp; +out: + ASSERT_VOP_ELOCKED(vp, "child vnode must be locked on return"); + return (error); +} + +/* * This function cleans the worklist for a filesystem. * Each filesystem running with soft dependencies gets its own * thread to run in this function. The thread is started up in @@ -3096,47 +3246,206 @@ softdep_prealloc(vp, waitok) } /* + * Try hard to sync all data and metadata for the vnode, and workitems + * flushing which might conflict with the vnode lock. This is a + * helper for softdep_prerename(). + */ +static int +softdep_prerename_vnode(ump, vp) + struct ufsmount *ump; + struct vnode *vp; +{ + int error; + + ASSERT_VOP_ELOCKED(vp, "prehandle"); + if (vp->v_data == NULL) + return (0); + error = VOP_FSYNC(vp, MNT_WAIT, curthread); + if (error != 0) + return (error); + ACQUIRE_LOCK(ump); + process_removes(vp); + process_truncates(vp); + FREE_LOCK(ump); + return (0); +} + +/* + * Must be called from VOP_RENAME() after all vnodes are locked. + * Ensures that there is enough journal space for rename. It is + * sufficiently different from softdep_prelink() by having to handle + * four vnodes. + */ +int +softdep_prerename(fdvp, fvp, tdvp, tvp) + struct vnode *fdvp; + struct vnode *fvp; + struct vnode *tdvp; + struct vnode *tvp; +{ + struct ufsmount *ump; + int error; + + ump = VFSTOUFS(fdvp->v_mount); + + if (journal_space(ump, 0)) + return (0); + + VOP_UNLOCK(tdvp); + VOP_UNLOCK(fvp); + if (tvp != NULL && tvp != tdvp) + VOP_UNLOCK(tvp); + + error = softdep_prerename_vnode(ump, fdvp); + VOP_UNLOCK(fdvp); + if (error != 0) + return (error); + + VOP_LOCK(fvp, LK_EXCLUSIVE | LK_RETRY); + error = softdep_prerename_vnode(ump, fvp); + VOP_UNLOCK(fvp); + if (error != 0) + return (error); + + if (tdvp != fdvp) { + VOP_LOCK(tdvp, LK_EXCLUSIVE | LK_RETRY); + error = softdep_prerename_vnode(ump, tdvp); + VOP_UNLOCK(tdvp); + if (error != 0) + return (error); + } + + if (tvp != fvp && tvp != NULL) { + VOP_LOCK(tvp, LK_EXCLUSIVE | LK_RETRY); + error = softdep_prerename_vnode(ump, tvp); + VOP_UNLOCK(tvp); + if (error != 0) + return (error); + } + + ACQUIRE_LOCK(ump); + softdep_speedup(ump); + process_worklist_item(UFSTOVFS(ump), 2, LK_NOWAIT); + if (journal_space(ump, 0) == 0) { + softdep_speedup(ump); + if (journal_space(ump, 1) == 0) + journal_suspend(ump); + } + FREE_LOCK(ump); + return (ERELOOKUP); +} + +/* * Before adjusting a link count on a vnode verify that we have sufficient * journal space. If not, process operations that depend on the currently * locked pair of vnodes to try to flush space as the syncer, buf daemon, * and softdep flush threads can not acquire these locks to reclaim space. + * + * Returns 0 if all owned locks are still valid and were not dropped + * in the process, in other case it returns either an error from sync, + * or ERELOOKUP if any of the locks were re-acquired. In the later + * case, the state of the vnodes cannot be relied upon and our VFS + * syscall must be restarted at top level from the lookup. */ -static void -softdep_prelink(dvp, vp) +int +softdep_prelink(dvp, vp, will_direnter) struct vnode *dvp; struct vnode *vp; + int will_direnter; { struct ufsmount *ump; + int error, error1; + ASSERT_VOP_ELOCKED(dvp, "prelink dvp"); + if (vp != NULL) + ASSERT_VOP_ELOCKED(vp, "prelink vp"); ump = VFSTOUFS(dvp->v_mount); - LOCK_OWNED(ump); + /* * Nothing to do if we have sufficient journal space. * If we currently hold the snapshot lock, we must avoid * handling other resources that could cause deadlock. + * + * will_direnter == 1: In case allocated a directory block in + * an indirect block, we must prevent holes in the directory + * created if directory entries are written out of order. To + * accomplish this we fsync when we extend a directory into + * indirects. During rename it's not safe to drop the tvp + * lock so sync must be delayed until it is. + * + * This synchronous step could be removed if fsck and the + * kernel were taught to fill in sparse directories rather + * than panic. */ - if (journal_space(ump, 0) || (vp && IS_SNAPSHOT(VTOI(vp)))) - return; + if (journal_space(ump, 0) || (vp != NULL && IS_SNAPSHOT(VTOI(vp)))) { + error = 0; + if (will_direnter && (vp == NULL || !IS_SNAPSHOT(VTOI(vp)))) { + if (vp != NULL) + VOP_UNLOCK(vp); + error = ffs_syncvnode(dvp, MNT_WAIT, 0); + if (vp != NULL) { + error1 = vn_lock(vp, LK_EXCLUSIVE | LK_NOWAIT); + if (error1 != 0) { + vn_lock_pair(dvp, true, vp, false); + if (error == 0) + error = ERELOOKUP; + } else if (vp->v_data == NULL) { + error = ERELOOKUP; + } + } + } + return (error); + } + stat_journal_low++; - FREE_LOCK(ump); - if (vp) + if (vp != NULL) { + VOP_UNLOCK(dvp); ffs_syncvnode(vp, MNT_NOWAIT, 0); + vn_lock_pair(dvp, false, vp, true); + if (dvp->v_data == NULL) + return (ERELOOKUP); + } + if (vp != NULL) + VOP_UNLOCK(vp); ffs_syncvnode(dvp, MNT_WAIT, 0); - ACQUIRE_LOCK(ump); + VOP_UNLOCK(dvp); + /* Process vp before dvp as it may create .. removes. */ - if (vp) { + if (vp != NULL) { + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + if (vp->v_data == NULL) { + vn_lock_pair(dvp, false, vp, true); + return (ERELOOKUP); + } + ACQUIRE_LOCK(ump); process_removes(vp); process_truncates(vp); + FREE_LOCK(ump); + VOP_UNLOCK(vp); } + + vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY); + if (dvp->v_data == NULL) { + vn_lock_pair(dvp, true, vp, false); + return (ERELOOKUP); + } + + ACQUIRE_LOCK(ump); process_removes(dvp); process_truncates(dvp); + VOP_UNLOCK(dvp); softdep_speedup(ump); + process_worklist_item(UFSTOVFS(ump), 2, LK_NOWAIT); if (journal_space(ump, 0) == 0) { softdep_speedup(ump); if (journal_space(ump, 1) == 0) journal_suspend(ump); } + FREE_LOCK(ump); + + vn_lock_pair(dvp, false, vp, false); + return (ERELOOKUP); } static void @@ -4742,7 +5051,6 @@ softdep_setup_create(dp, ip) KASSERT(jaddref != NULL && jaddref->ja_parent == dp->i_number, ("softdep_setup_create: No addref structure present.")); } - softdep_prelink(dvp, NULL); FREE_LOCK(ITOUMP(dp)); } @@ -4777,7 +5085,6 @@ softdep_setup_dotdot_link(dp, ip) if (jaddref) TAILQ_INSERT_TAIL(&inodedep->id_inoreflst, &jaddref->ja_ref, if_deps); - softdep_prelink(dvp, ITOV(ip)); FREE_LOCK(ITOUMP(dp)); } @@ -4808,7 +5115,6 @@ softdep_setup_link(dp, ip) if (jaddref) TAILQ_INSERT_TAIL(&inodedep->id_inoreflst, &jaddref->ja_ref, if_deps); - softdep_prelink(dvp, ITOV(ip)); FREE_LOCK(ITOUMP(dp)); } @@ -4858,7 +5164,6 @@ softdep_setup_mkdir(dp, ip) if (DOINGSUJ(dvp)) TAILQ_INSERT_TAIL(&inodedep->id_inoreflst, &dotdotaddref->ja_ref, if_deps); - softdep_prelink(ITOV(dp), NULL); FREE_LOCK(ITOUMP(dp)); } @@ -4879,7 +5184,6 @@ softdep_setup_rmdir(dp, ip) ACQUIRE_LOCK(ITOUMP(dp)); (void) inodedep_lookup_ip(ip); (void) inodedep_lookup_ip(dp); - softdep_prelink(dvp, ITOV(ip)); FREE_LOCK(ITOUMP(dp)); } @@ -4900,7 +5204,6 @@ softdep_setup_unlink(dp, ip) ACQUIRE_LOCK(ITOUMP(dp)); (void) inodedep_lookup_ip(ip); (void) inodedep_lookup_ip(dp); - softdep_prelink(dvp, ITOV(ip)); FREE_LOCK(ITOUMP(dp)); } @@ -12622,25 +12925,12 @@ restart: * for details on possible races. */ FREE_LOCK(ump); - if (ffs_vgetf(mp, parentino, LK_NOWAIT | LK_EXCLUSIVE, &pvp, - FFSV_FORCEINSMQ)) { - /* - * Unmount cannot proceed after unlock because - * caller must have called vn_start_write(). - */ - VOP_UNLOCK(vp); - error = ffs_vgetf(mp, parentino, LK_EXCLUSIVE, - &pvp, FFSV_FORCEINSMQ); - MPASS(VTOI(pvp)->i_mode != 0); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); - if (VN_IS_DOOMED(vp)) { - if (error == 0) - vput(pvp); - error = ENOENT; - } - if (error != 0) - return (error); - } + error = get_parent_vp(vp, mp, parentino, NULL, NULL, NULL, + &pvp); + if (error == ERELOOKUP) + error = 0; + if (error != 0) + return (error); /* * All MKDIR_PARENT dependencies and all the NEWBLOCK pagedeps * that are contained in direct blocks will be resolved by @@ -12964,9 +13254,11 @@ top: for (i = 0; i < DAHASHSZ; i++) { if (LIST_FIRST(&pagedep->pd_diraddhd[i]) == 0) continue; - if ((error = flush_pagedep_deps(vp, wk->wk_mp, - &pagedep->pd_diraddhd[i]))) { - BUF_NOREC(bp); + error = flush_pagedep_deps(vp, wk->wk_mp, + &pagedep->pd_diraddhd[i], bp); + if (error != 0) { + if (error != ERELOOKUP) + BUF_NOREC(bp); goto out_unlock; } } @@ -13200,10 +13492,11 @@ flush_newblk_dep(vp, mp, lbn) * Eliminate a pagedep dependency by flushing out all its diradd dependencies. */ static int -flush_pagedep_deps(pvp, mp, diraddhdp) +flush_pagedep_deps(pvp, mp, diraddhdp, locked_bp) struct vnode *pvp; struct mount *mp; struct diraddhd *diraddhdp; + struct buf *locked_bp; { struct inodedep *inodedep; struct inoref *inoref; @@ -13270,10 +13563,10 @@ restart: } if (dap->da_state & MKDIR_BODY) { FREE_LOCK(ump); - if ((error = ffs_vgetf(mp, inum, LK_EXCLUSIVE, &vp, - FFSV_FORCEINSMQ))) + error = get_parent_vp(pvp, mp, inum, locked_bp, + diraddhdp, &unfinished, &vp); + if (error != 0) break; - MPASS(VTOI(vp)->i_mode != 0); error = flush_newblk_dep(vp, mp, 0); /* * If we still have the dependency we might need to @@ -13335,10 +13628,10 @@ retry: */ if (dap == LIST_FIRST(diraddhdp)) { FREE_LOCK(ump); - if ((error = ffs_vgetf(mp, inum, LK_EXCLUSIVE, &vp, - FFSV_FORCEINSMQ))) + error = get_parent_vp(pvp, mp, inum, locked_bp, + diraddhdp, &unfinished, &vp); + if (error != 0) break; - MPASS(VTOI(vp)->i_mode != 0); error = ffs_update(vp, 1); vput(vp); if (error) Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Sat Nov 14 05:19:59 2020 (r367671) +++ head/sys/ufs/ffs/ffs_vfsops.c Sat Nov 14 05:30:10 2020 (r367672) @@ -1861,8 +1861,14 @@ loop: #ifdef QUOTA qsyncvp(vp); #endif - if ((error = ffs_syncvnode(vp, waitfor, 0)) != 0) - allerror = error; + for (;;) { + error = ffs_syncvnode(vp, waitfor, 0); + if (error == ERELOOKUP) + continue; + if (error != 0) + allerror = error; + break; + } vput(vp); } /* Modified: head/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vnops.c Sat Nov 14 05:19:59 2020 (r367671) +++ head/sys/ufs/ffs/ffs_vnops.c Sat Nov 14 05:30:10 2020 (r367672) @@ -253,7 +253,7 @@ ffs_syncvnode(struct vnode *vp, int waitfor, int flags struct buf *bp, *nbp; ufs_lbn_t lbn; int error, passes; - bool still_dirty, wait; + bool still_dirty, unlocked, wait; ip = VTOI(vp); ip->i_flag &= ~IN_NEEDSYNC; @@ -277,6 +277,7 @@ ffs_syncvnode(struct vnode *vp, int waitfor, int flags error = 0; passes = 0; wait = false; /* Always do an async pass first. */ + unlocked = false; lbn = lblkno(ITOFS(ip), (ip->i_size + ITOFS(ip)->fs_bsize - 1)); BO_LOCK(bo); loop: @@ -325,6 +326,26 @@ loop: if (!LIST_EMPTY(&bp->b_dep) && (error = softdep_sync_buf(vp, bp, wait ? MNT_WAIT : MNT_NOWAIT)) != 0) { + /* + * Lock order conflict, buffer was already unlocked, + * and vnode possibly unlocked. + */ + if (error == ERELOOKUP) { + if (vp->v_data == NULL) + return (EBADF); + unlocked = true; + if (DOINGSOFTDEP(vp) && waitfor == MNT_WAIT && + (error = softdep_sync_metadata(vp)) != 0) { + if (ffs_fsfail_cleanup(ump, error)) + error = 0; + return (unlocked && error == 0 ? + ERELOOKUP : error); + } + /* Re-evaluate inode size */ + lbn = lblkno(ITOFS(ip), (ip->i_size + + ITOFS(ip)->fs_bsize - 1)); + goto next; + } /* I/O error. */ if (error != EBUSY) { BUF_UNLOCK(bp); @@ -361,9 +382,11 @@ next: if (waitfor != MNT_WAIT) { BO_UNLOCK(bo); if ((flags & NO_INO_UPDT) != 0) - return (0); - else - return (ffs_update(vp, 0)); + return (unlocked ? ERELOOKUP : 0); + error = ffs_update(vp, 0); + if (error == 0 && unlocked) + error = ERELOOKUP; + return (error); } /* Drain IO to see if we're done. */ bufobj_wwait(bo, 0, 0); @@ -419,6 +442,8 @@ next: } else if ((ip->i_flags & (IN_SIZEMOD | IN_IBLKDATA)) != 0) { error = ffs_update(vp, 1); } + if (error == 0 && unlocked) + error = ERELOOKUP; return (error); } Modified: head/sys/ufs/ufs/ufs_inode.c ============================================================================== --- head/sys/ufs/ufs/ufs_inode.c Sat Nov 14 05:19:59 2020 (r367671) +++ head/sys/ufs/ufs/ufs_inode.c Sat Nov 14 05:30:10 2020 (r367672) @@ -166,7 +166,8 @@ ufs_inactive(ap) isize += ip->i_din2->di_extsize; if (ip->i_effnlink <= 0 && isize && !UFS_RDONLY(ip)) error = UFS_TRUNCATE(vp, (off_t)0, IO_EXT | IO_NORMAL, NOCRED); - if (ip->i_nlink <= 0 && ip->i_mode && !UFS_RDONLY(ip)) { + if (ip->i_nlink <= 0 && ip->i_mode != 0 && !UFS_RDONLY(ip) && + (vp->v_iflag & VI_OWEINACT) == 0) { #ifdef QUOTA if (!getinoquota(ip)) (void)chkiq(ip, -1, NOCRED, FORCE); @@ -207,10 +208,12 @@ out: * If we are done with the inode, reclaim it * so that it can be reused immediately. */ - if (ip->i_mode == 0) + if (ip->i_mode == 0 && (vp->v_iflag & VI_OWEINACT) == 0) vrecycle(vp); if (mp != NULL) vn_finished_secondary_write(mp); + if (error == ERELOOKUP) + error = 0; return (error); } Modified: head/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- head/sys/ufs/ufs/ufs_lookup.c Sat Nov 14 05:19:59 2020 (r367671) +++ head/sys/ufs/ufs/ufs_lookup.c Sat Nov 14 05:30:10 2020 (r367672) @@ -961,27 +961,7 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp, isrename) bdwrite(bp); if ((dp->i_flag & IN_NEEDSYNC) == 0) return (UFS_UPDATE(dvp, 0)); - /* - * We have just allocated a directory block in an - * indirect block. We must prevent holes in the - * directory created if directory entries are - * written out of order. To accomplish this we - * fsync when we extend a directory into indirects. - * During rename it's not safe to drop the tvp lock - * so sync must be delayed until it is. - * - * This synchronous step could be removed if fsck and - * the kernel were taught to fill in sparse - * directories rather than panic. - */ - if (isrename) - return (0); - if (tvp != NULL) - VOP_UNLOCK(tvp); - (void) VOP_FSYNC(dvp, MNT_WAIT, td); - if (tvp != NULL) - vn_lock(tvp, LK_EXCLUSIVE | LK_RETRY); - return (error); + return (0); } if (DOINGASYNC(dvp)) { bdwrite(bp); Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Sat Nov 14 05:19:59 2020 (r367671) +++ head/sys/ufs/ufs/ufs_vnops.c Sat Nov 14 05:30:10 2020 (r367672) @@ -1006,10 +1006,16 @@ ufs_remove(ap) td = curthread; ip = VTOI(vp); if ((ip->i_flags & (NOUNLINK | IMMUTABLE | APPEND)) || - (VTOI(dvp)->i_flags & APPEND)) { - error = EPERM; - goto out; + (VTOI(dvp)->i_flags & APPEND)) + return (EPERM); + if (DOINGSOFTDEP(dvp)) { + error = softdep_prelink(dvp, vp, true); + if (error != 0) { + MPASS(error == ERELOOKUP); + return (error); + } } + #ifdef UFS_GJOURNAL ufs_gjournal_orphan(vp); #endif @@ -1030,7 +1036,6 @@ ufs_remove(ap) (void) VOP_FSYNC(dvp, MNT_WAIT, td); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); } -out: return (error); } @@ -1067,6 +1072,15 @@ ufs_link(ap) if ((cnp->cn_flags & HASBUF) == 0) panic("ufs_link: no name"); #endif + + if (DOINGSOFTDEP(tdvp)) { + error = softdep_prelink(tdvp, vp, true); + if (error != 0) { + MPASS(error == ERELOOKUP); + return (error); + } + } + if (VTOI(tdvp)->i_effnlink < 2) { print_bad_link_count("ufs_link", tdvp); error = EINVAL; @@ -1089,6 +1103,7 @@ ufs_link(ap) error = EPERM; goto out; } + ip->i_effnlink++; ip->i_nlink++; DIP_SET(ip, i_nlink, ip->i_nlink); @@ -1129,6 +1144,15 @@ ufs_whiteout(ap) struct direct newdir; int error = 0; + if (DOINGSOFTDEP(dvp) && (ap->a_flags == CREATE || + ap->a_flags == DELETE)) { + error = softdep_prelink(dvp, NULL, true); + if (error != 0) { + MPASS(error == ERELOOKUP); + return (error); + } + } + switch (ap->a_flags) { case LOOKUP: /* 4.4 format directories support whiteout operations */ @@ -1338,6 +1362,18 @@ relock: goto relock; } } + + if (DOINGSOFTDEP(fdvp)) { + error = softdep_prerename(fdvp, fvp, tdvp, tvp); + if (error != 0) { + if (error == ERELOOKUP) { + atomic_add_int(&rename_restarts, 1); + goto relock; + } + goto releout; + } + } + fdp = VTOI(fdvp); fip = VTOI(fvp); tdp = VTOI(tdvp); @@ -1649,8 +1685,10 @@ unlockout: * are no longer needed. */ if (error == 0 && endoff != 0) { - error = UFS_TRUNCATE(tdvp, endoff, IO_NORMAL | - (DOINGASYNC(tdvp) ? 0 : IO_SYNC), tcnp->cn_cred); + do { + error = UFS_TRUNCATE(tdvp, endoff, IO_NORMAL | + (DOINGASYNC(tdvp) ? 0 : IO_SYNC), tcnp->cn_cred); + } while (error == ERELOOKUP); if (error != 0 && !ffs_fsfail_cleanup(VFSTOUFS(mp), error)) vn_printf(tdvp, "ufs_rename: failed to truncate, error %d\n", @@ -1668,8 +1706,11 @@ unlockout: */ error = 0; } - if (error == 0 && tdp->i_flag & IN_NEEDSYNC) - error = VOP_FSYNC(tdvp, MNT_WAIT, td); + if (error == 0 && tdp->i_flag & IN_NEEDSYNC) { + do { + error = VOP_FSYNC(tdvp, MNT_WAIT, td); + } while (error == ERELOOKUP); + } vput(tdvp); return (error); @@ -1918,6 +1959,7 @@ ufs_mkdir(ap) } dmode = vap->va_mode & 0777; dmode |= IFDIR; + /* * Must simulate part of ufs_makeinode here to acquire the inode, * but not have it entered in the parent directory. The entry is @@ -1928,6 +1970,15 @@ ufs_mkdir(ap) error = EINVAL; goto out; } + + if (DOINGSOFTDEP(dvp)) { + error = softdep_prelink(dvp, NULL, true); + if (error != 0) { + MPASS(error == ERELOOKUP); + return (error); + } + } + error = UFS_VALLOC(dvp, dmode, cnp->cn_cred, &tvp); if (error) goto out; @@ -2184,6 +2235,14 @@ ufs_rmdir(ap) error = EINVAL; goto out; } + if (DOINGSOFTDEP(dvp)) { + error = softdep_prelink(dvp, vp, false); + if (error != 0) { + MPASS(error == ERELOOKUP); + return (error); + } + } + #ifdef UFS_GJOURNAL ufs_gjournal_orphan(vp); #endif @@ -2702,6 +2761,13 @@ ufs_makeinode(mode, dvp, vpp, cnp, callfunc) if (pdir->i_effnlink < 2) { print_bad_link_count(callfunc, dvp); return (EINVAL); + } + if (DOINGSOFTDEP(dvp)) { + error = softdep_prelink(dvp, NULL, true); + if (error != 0) { + MPASS(error == ERELOOKUP); + return (error); + } } error = UFS_VALLOC(dvp, mode, cnp->cn_cred, &tvp); if (error) From owner-svn-src-head@freebsd.org Sat Nov 14 10:34:19 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 62B2D2E57FA; Sat, 14 Nov 2020 10:34:19 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CYBXW24pvz4mQs; Sat, 14 Nov 2020 10:34:19 +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 3A4429C6; Sat, 14 Nov 2020 10:34:19 +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 0AEAYJ4g021362; Sat, 14 Nov 2020 10:34:19 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AEAYJsm021361; Sat, 14 Nov 2020 10:34:19 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <202011141034.0AEAYJsm021361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sat, 14 Nov 2020 10:34:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367673 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 367673 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 10:34:19 -0000 Author: wulf Date: Sat Nov 14 10:34:18 2020 New Revision: 367673 URL: https://svnweb.freebsd.org/changeset/base/367673 Log: LinuxKPI: Exclude linux/acpi.h content on non-ACPI archs. LinuxKPI ACPI support is based on FreeBSD import of ACPICA which can be compiled only on aarch64, amd64 and i386. Ifdef-out broken parts on our side to avoid patching of vendor code. This fixes drm-devel-kmod build on powerpc64(le). Reported by: pkubaj Modified: head/sys/compat/linuxkpi/common/include/linux/acpi.h Modified: head/sys/compat/linuxkpi/common/include/linux/acpi.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/acpi.h Sat Nov 14 05:30:10 2020 (r367672) +++ head/sys/compat/linuxkpi/common/include/linux/acpi.h Sat Nov 14 10:34:18 2020 (r367673) @@ -33,10 +33,14 @@ #include +#if defined(__aarch64__) || defined(__amd64__) || defined(__i386__) + #include #include #define ACPI_HANDLE(dev) \ ((dev)->bsddev != NULL ? bsd_acpi_get_handle((dev)->bsddev) : NULL) + +#endif #endif /* _LINUX_ACPI_H_ */ From owner-svn-src-head@freebsd.org Sat Nov 14 10:56:41 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 357BC2E65EF; Sat, 14 Nov 2020 10:56:41 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CYC2K12mnz4nL8; Sat, 14 Nov 2020 10:56:41 +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 16186D65; Sat, 14 Nov 2020 10:56:41 +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 0AEAuebs034029; Sat, 14 Nov 2020 10:56:40 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AEAue8P034028; Sat, 14 Nov 2020 10:56:40 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202011141056.0AEAue8P034028@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sat, 14 Nov 2020 10:56:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367674 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 367674 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 10:56:41 -0000 Author: tsoome Date: Sat Nov 14 10:56:40 2020 New Revision: 367674 URL: https://svnweb.freebsd.org/changeset/base/367674 Log: loader: cstyle cleanup of console.c cstyle cleanup only, no functional changes intended. Modified: head/stand/common/console.c Modified: head/stand/common/console.c ============================================================================== --- head/stand/common/console.c Sat Nov 14 10:34:18 2020 (r367673) +++ head/stand/common/console.c Sat Nov 14 10:56:40 2020 (r367674) @@ -49,97 +49,102 @@ static int twiddle_set(struct env_var *ev, int flags, void cons_probe(void) { - int cons; - int active; - char *prefconsole; + int cons; + int active; + char *prefconsole; - /* We want a callback to install the new value when this var changes. */ - env_setenv("twiddle_divisor", EV_VOLATILE, "1", twiddle_set, env_nounset); + /* We want a callback to install the new value when this var changes. */ + env_setenv("twiddle_divisor", EV_VOLATILE, "1", twiddle_set, + env_nounset); - /* Do all console probes */ - for (cons = 0; consoles[cons] != NULL; cons++) { - consoles[cons]->c_flags = 0; - consoles[cons]->c_probe(consoles[cons]); - } - /* Now find the first working one */ - active = -1; - for (cons = 0; consoles[cons] != NULL && active == -1; cons++) { - consoles[cons]->c_flags = 0; - consoles[cons]->c_probe(consoles[cons]); - if (consoles[cons]->c_flags == (C_PRESENTIN | C_PRESENTOUT)) - active = cons; - } - /* Force a console even if all probes failed */ - if (active == -1) - active = 0; + /* Do all console probes */ + for (cons = 0; consoles[cons] != NULL; cons++) { + consoles[cons]->c_flags = 0; + consoles[cons]->c_probe(consoles[cons]); + } + /* Now find the first working one */ + active = -1; + for (cons = 0; consoles[cons] != NULL && active == -1; cons++) { + consoles[cons]->c_flags = 0; + consoles[cons]->c_probe(consoles[cons]); + if (consoles[cons]->c_flags == (C_PRESENTIN | C_PRESENTOUT)) + active = cons; + } + /* Force a console even if all probes failed */ + if (active == -1) + active = 0; - /* Check to see if a console preference has already been registered */ - prefconsole = getenv("console"); - if (prefconsole != NULL) - prefconsole = strdup(prefconsole); - if (prefconsole != NULL) { - unsetenv("console"); /* we want to replace this */ - cons_change(prefconsole); - } else { - consoles[active]->c_flags |= C_ACTIVEIN | C_ACTIVEOUT; - consoles[active]->c_init(0); - prefconsole = strdup(consoles[active]->c_name); - } + /* Check to see if a console preference has already been registered */ + prefconsole = getenv("console"); + if (prefconsole != NULL) + prefconsole = strdup(prefconsole); + if (prefconsole != NULL) { + unsetenv("console"); /* we want to replace this */ + cons_change(prefconsole); + } else { + consoles[active]->c_flags |= C_ACTIVEIN | C_ACTIVEOUT; + consoles[active]->c_init(0); + prefconsole = strdup(consoles[active]->c_name); + } - printf("Consoles: "); - for (cons = 0; consoles[cons] != NULL; cons++) - if (consoles[cons]->c_flags & (C_ACTIVEIN | C_ACTIVEOUT)) - printf("%s ", consoles[cons]->c_desc); - printf("\n"); + printf("Consoles: "); + for (cons = 0; consoles[cons] != NULL; cons++) + if (consoles[cons]->c_flags & (C_ACTIVEIN | C_ACTIVEOUT)) + printf("%s ", consoles[cons]->c_desc); + printf("\n"); - if (prefconsole != NULL) { - env_setenv("console", EV_VOLATILE, prefconsole, cons_set, - env_nounset); - free(prefconsole); - } + if (prefconsole != NULL) { + env_setenv("console", EV_VOLATILE, prefconsole, cons_set, + env_nounset); + free(prefconsole); + } } int getchar(void) { - int cons; - int rv; + int cons; + int rv; - /* Loop forever polling all active consoles */ - for(;;) - for (cons = 0; consoles[cons] != NULL; cons++) - if ((consoles[cons]->c_flags & (C_PRESENTIN | C_ACTIVEIN)) == - (C_PRESENTIN | C_ACTIVEIN) && - ((rv = consoles[cons]->c_in()) != -1)) - return(rv); + /* Loop forever polling all active consoles */ + for (;;) { + for (cons = 0; consoles[cons] != NULL; cons++) { + if ((consoles[cons]->c_flags & + (C_PRESENTIN | C_ACTIVEIN)) == + (C_PRESENTIN | C_ACTIVEIN) && + ((rv = consoles[cons]->c_in()) != -1)) + return (rv); + } + } } int ischar(void) { - int cons; + int cons; - for (cons = 0; consoles[cons] != NULL; cons++) - if ((consoles[cons]->c_flags & (C_PRESENTIN | C_ACTIVEIN)) == - (C_PRESENTIN | C_ACTIVEIN) && - (consoles[cons]->c_ready() != 0)) - return(1); - return(0); + for (cons = 0; consoles[cons] != NULL; cons++) + if ((consoles[cons]->c_flags & (C_PRESENTIN | C_ACTIVEIN)) == + (C_PRESENTIN | C_ACTIVEIN) && + (consoles[cons]->c_ready() != 0)) + return (1); + return (0); } void putchar(int c) { - int cons; + int cons; - /* Expand newlines */ - if (c == '\n') - putchar('\r'); + /* Expand newlines */ + if (c == '\n') + putchar('\r'); - for (cons = 0; consoles[cons] != NULL; cons++) - if ((consoles[cons]->c_flags & (C_PRESENTOUT | C_ACTIVEOUT)) == - (C_PRESENTOUT | C_ACTIVEOUT)) - consoles[cons]->c_out(c); + for (cons = 0; consoles[cons] != NULL; cons++) { + if ((consoles[cons]->c_flags & (C_PRESENTOUT | C_ACTIVEOUT)) == + (C_PRESENTOUT | C_ACTIVEOUT)) + consoles[cons]->c_out(c); + } } /* @@ -148,12 +153,12 @@ putchar(int c) static int cons_find(const char *name) { - int cons; + int cons; - for (cons = 0; consoles[cons] != NULL; cons++) - if (!strcmp(consoles[cons]->c_name, name)) - return (cons); - return (-1); + for (cons = 0; consoles[cons] != NULL; cons++) + if (strcmp(consoles[cons]->c_name, name) == 0) + return (cons); + return (-1); } /* @@ -162,22 +167,23 @@ cons_find(const char *name) static int cons_set(struct env_var *ev, int flags, const void *value) { - int ret; + int ret; - if ((value == NULL) || (cons_check(value) == 0)) { - /* - * Return CMD_OK instead of CMD_ERROR to prevent forth syntax error, - * which would prevent it processing any further loader.conf entries. - */ - return (CMD_OK); - } + if ((value == NULL) || (cons_check(value) == 0)) { + /* + * Return CMD_OK instead of CMD_ERROR to prevent forth syntax + * error, which would prevent it processing any further + * loader.conf entries. + */ + return (CMD_OK); + } - ret = cons_change(value); - if (ret != CMD_OK) - return (ret); + ret = cons_change(value); + if (ret != CMD_OK) + return (ret); - env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); - return (CMD_OK); + env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); + return (CMD_OK); } /* @@ -186,36 +192,36 @@ cons_set(struct env_var *ev, int flags, const void *va static int cons_check(const char *string) { - int cons, found, failed; - char *curpos, *dup, *next; + int cons, found, failed; + char *curpos, *dup, *next; - dup = next = strdup(string); - found = failed = 0; - while (next != NULL) { - curpos = strsep(&next, " ,"); - if (*curpos != '\0') { - cons = cons_find(curpos); - if (cons == -1) { - printf("console %s is invalid!\n", curpos); - failed++; - } else { - found++; - } + dup = next = strdup(string); + found = failed = 0; + while (next != NULL) { + curpos = strsep(&next, " ,"); + if (*curpos != '\0') { + cons = cons_find(curpos); + if (cons == -1) { + printf("console %s is invalid!\n", curpos); + failed++; + } else { + found++; + } + } } - } - free(dup); + free(dup); - if (found == 0) - printf("no valid consoles!\n"); + if (found == 0) + printf("no valid consoles!\n"); - if (found == 0 || failed != 0) { - printf("Available consoles:\n"); - for (cons = 0; consoles[cons] != NULL; cons++) - printf(" %s\n", consoles[cons]->c_name); - } + if (found == 0 || failed != 0) { + printf("Available consoles:\n"); + for (cons = 0; consoles[cons] != NULL; cons++) + printf(" %s\n", consoles[cons]->c_name); + } - return (found); + return (found); } /* @@ -224,56 +230,64 @@ cons_check(const char *string) static int cons_change(const char *string) { - int cons, active; - char *curpos, *dup, *next; + int cons, active; + char *curpos, *dup, *next; - /* Disable all consoles */ - for (cons = 0; consoles[cons] != NULL; cons++) { - consoles[cons]->c_flags &= ~(C_ACTIVEIN | C_ACTIVEOUT); - } + /* Disable all consoles */ + for (cons = 0; consoles[cons] != NULL; cons++) { + consoles[cons]->c_flags &= ~(C_ACTIVEIN | C_ACTIVEOUT); + } - /* Enable selected consoles */ - dup = next = strdup(string); - active = 0; - while (next != NULL) { - curpos = strsep(&next, " ,"); - if (*curpos == '\0') - continue; - cons = cons_find(curpos); - if (cons >= 0) { - consoles[cons]->c_flags |= C_ACTIVEIN | C_ACTIVEOUT; - consoles[cons]->c_init(0); - if ((consoles[cons]->c_flags & (C_PRESENTIN | C_PRESENTOUT)) == - (C_PRESENTIN | C_PRESENTOUT)) { - active++; - continue; - } + /* Enable selected consoles */ + dup = next = strdup(string); + active = 0; + while (next != NULL) { + curpos = strsep(&next, " ,"); + if (*curpos == '\0') + continue; + cons = cons_find(curpos); + if (cons >= 0) { + consoles[cons]->c_flags |= C_ACTIVEIN | C_ACTIVEOUT; + consoles[cons]->c_init(0); + if ((consoles[cons]->c_flags & + (C_PRESENTIN | C_PRESENTOUT)) == + (C_PRESENTIN | C_PRESENTOUT)) { + active++; + continue; + } - if (active != 0) { - /* If no consoles have initialised we wouldn't see this. */ - printf("console %s failed to initialize\n", consoles[cons]->c_name); - } + if (active != 0) { + /* + * If no consoles have initialised we + * wouldn't see this. + */ + printf("console %s failed to initialize\n", + consoles[cons]->c_name); + } + } } - } - free(dup); + free(dup); - if (active == 0) { - /* All requested consoles failed to initialise, try to recover. */ - for (cons = 0; consoles[cons] != NULL; cons++) { - consoles[cons]->c_flags |= C_ACTIVEIN | C_ACTIVEOUT; - consoles[cons]->c_init(0); - if ((consoles[cons]->c_flags & - (C_PRESENTIN | C_PRESENTOUT)) == - (C_PRESENTIN | C_PRESENTOUT)) - active++; + if (active == 0) { + /* + * All requested consoles failed to initialise, + * try to recover. + */ + for (cons = 0; consoles[cons] != NULL; cons++) { + consoles[cons]->c_flags |= C_ACTIVEIN | C_ACTIVEOUT; + consoles[cons]->c_init(0); + if ((consoles[cons]->c_flags & + (C_PRESENTIN | C_PRESENTOUT)) == + (C_PRESENTIN | C_PRESENTOUT)) + active++; + } + + if (active == 0) + return (CMD_ERROR); /* Recovery failed. */ } - if (active == 0) - return (CMD_ERROR); /* Recovery failed. */ - } - - return (CMD_OK); + return (CMD_OK); } /* @@ -287,16 +301,16 @@ cons_change(const char *string) static int twiddle_set(struct env_var *ev, int flags, const void *value) { - u_long tdiv; - char * eptr; + u_long tdiv; + char *eptr; - tdiv = strtoul(value, &eptr, 0); - if (*(const char *)value == 0 || *eptr != 0) { - printf("invalid twiddle_divisor '%s'\n", (const char *)value); - return (CMD_ERROR); - } - twiddle_divisor((u_int)tdiv); - env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); + tdiv = strtoul(value, &eptr, 0); + if (*(const char *)value == 0 || *eptr != 0) { + printf("invalid twiddle_divisor '%s'\n", (const char *)value); + return (CMD_ERROR); + } + twiddle_divisor((u_int)tdiv); + env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); - return(CMD_OK); + return (CMD_OK); } From owner-svn-src-head@freebsd.org Sat Nov 14 13:07:42 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 071A42EA10E; Sat, 14 Nov 2020 13:07:42 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CYFxT6t0zz4vXM; Sat, 14 Nov 2020 13:07:41 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DADE324FB; Sat, 14 Nov 2020 13:07:41 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AED7fT3017642; Sat, 14 Nov 2020 13:07:41 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AED7fuL017641; Sat, 14 Nov 2020 13:07:41 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202011141307.0AED7fuL017641@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Sat, 14 Nov 2020 13:07:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367678 - head/usr.sbin/freebsd-update X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/usr.sbin/freebsd-update X-SVN-Commit-Revision: 367678 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 13:07:42 -0000 Author: 0mp (doc,ports committer) Date: Sat Nov 14 13:07:41 2020 New Revision: 367678 URL: https://svnweb.freebsd.org/changeset/base/367678 Log: Document the PAGER environment variable Sometimes users want to use freebsd-update(8) in a non-interactive way and what they often miss is that they have to set PAGER to cat(1) in order to avoid interactive prompts from less(1). MFC after: 4 weeks Modified: head/usr.sbin/freebsd-update/freebsd-update.8 Modified: head/usr.sbin/freebsd-update/freebsd-update.8 ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.8 Sat Nov 14 12:02:50 2020 (r367677) +++ head/usr.sbin/freebsd-update/freebsd-update.8 Sat Nov 14 13:07:41 2020 (r367678) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 24, 2019 +.Dd November 14, 2020 .Dt FREEBSD-UPDATE 8 .Os .Sh NAME @@ -193,6 +193,20 @@ System", since if the system has been tampered with it cannot be trusted to operate correctly. If you intend to use this command for intrusion-detection purposes, make sure you boot from a secure disk (e.g., a CD). +.El +.Sh ENVIRONMENT +.Bl -tag -width "PAGER" +.It Ev PAGER +The pager program used to present various reports during the execution. +.Po +Default: +.Dq Pa /usr/bin/less . +.Pc +.Pp +.Ev PAGER +can be set to +.Dq cat +when a non-interactive pager is desired. .El .Sh FILES .Bl -tag -width "/etc/freebsd-update.conf" From owner-svn-src-head@freebsd.org Sat Nov 14 14:50:35 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0AF242EC373; Sat, 14 Nov 2020 14:50:35 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CYJDB6vSQz3HVV; Sat, 14 Nov 2020 14:50:34 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DFE943E06; Sat, 14 Nov 2020 14:50:34 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AEEoYZr079088; Sat, 14 Nov 2020 14:50:34 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AEEoYWL079087; Sat, 14 Nov 2020 14:50:34 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <202011141450.0AEEoYWL079087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Sat, 14 Nov 2020 14:50:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367680 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 367680 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 14:50:35 -0000 Author: jtl Date: Sat Nov 14 14:50:34 2020 New Revision: 367680 URL: https://svnweb.freebsd.org/changeset/base/367680 Log: Fix implicit automatic local port selection for IPv6 during connect calls. When a user creates a TCP socket and tries to connect to the socket without explicitly binding the socket to a local address, the connect call implicitly chooses an appropriate local port. When evaluating candidate local ports, the algorithm checks for conflicts with existing ports by doing a lookup in the connection hash table. In this circumstance, both the IPv4 and IPv6 code look for exact matches in the hash table. However, the IPv4 code goes a step further and checks whether the proposed 4-tuple will match wildcard (e.g. TCP "listen") entries. The IPv6 code has no such check. The missing wildcard check can cause problems when connecting to a local server. It is possible that the algorithm will choose the same value for the local port as the foreign port uses. This results in a connection with identical source and destination addresses and ports. Changing the IPv6 code to align with the IPv4 code's behavior fixes this problem. Reviewed by: tuexen Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D27164 Modified: head/sys/netinet6/in6_pcb.c Modified: head/sys/netinet6/in6_pcb.c ============================================================================== --- head/sys/netinet6/in6_pcb.c Sat Nov 14 14:15:49 2020 (r367679) +++ head/sys/netinet6/in6_pcb.c Sat Nov 14 14:50:34 2020 (r367680) @@ -464,7 +464,8 @@ in6_pcbconnect_mbuf(struct inpcb *inp, struct sockaddr rehash = false; error = in_pcb_lport_dest(inp, (struct sockaddr *) &laddr6, &inp->inp_lport, - (struct sockaddr *) sin6, sin6->sin6_port, cred, 0); + (struct sockaddr *) sin6, sin6->sin6_port, cred, + INPLOOKUP_WILDCARD); if (error) return (error); } From owner-svn-src-head@freebsd.org Sat Nov 14 15:44:29 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 13D0A2ED45B; Sat, 14 Nov 2020 15:44:29 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CYKQN6yltz3LMZ; Sat, 14 Nov 2020 15:44:28 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E204E4993; Sat, 14 Nov 2020 15:44:28 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AEFiShD016256; Sat, 14 Nov 2020 15:44:28 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AEFiScm016255; Sat, 14 Nov 2020 15:44:28 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <202011141544.0AEFiScm016255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Sat, 14 Nov 2020 15:44:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367685 - head/tests/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/tests/sys/netinet X-SVN-Commit-Revision: 367685 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 15:44:29 -0000 Author: jtl Date: Sat Nov 14 15:44:28 2020 New Revision: 367685 URL: https://svnweb.freebsd.org/changeset/base/367685 Log: Add a regression test for the port-selection behavior fixed in r367680. Reviewed by: markj, olivier, tuexen Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D27173 Added: head/tests/sys/netinet/tcp_connect_port_test.c (contents, props changed) Modified: head/tests/sys/netinet/Makefile Modified: head/tests/sys/netinet/Makefile ============================================================================== --- head/tests/sys/netinet/Makefile Sat Nov 14 15:33:39 2020 (r367684) +++ head/tests/sys/netinet/Makefile Sat Nov 14 15:44:28 2020 (r367685) @@ -7,7 +7,8 @@ BINDIR= ${TESTSDIR} ATF_TESTS_C= ip_reass_test \ so_reuseport_lb_test \ - socket_afinet + socket_afinet \ + tcp_connect_port_test ATF_TESTS_SH= carp fibs fibs_test redirect divert forward output lpm TEST_METADATA.output+= required_programs="python" Added: head/tests/sys/netinet/tcp_connect_port_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netinet/tcp_connect_port_test.c Sat Nov 14 15:44:28 2020 (r367685) @@ -0,0 +1,334 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2020 Netflix, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include + +#define SYSCTLBAKFILE "tmp.net.inet.ip.portrange.randomized" + +/* + * Check if port allocation is randomized. If so, update it. Save the old + * value of the sysctl so it can be updated later. + */ +static void +disable_random_ports(void) +{ + int error, fd, random_new, random_save; + size_t sysctlsz; + + /* + * Pre-emptively unlink our restoration file, so we will do no + * restoration on error. + */ + unlink(SYSCTLBAKFILE); + + /* + * Disable the net.inet.ip.portrange.randomized sysctl. Save the + * old value so we can restore it, if necessary. + */ + random_new = 0; + sysctlsz = sizeof(random_save); + error = sysctlbyname("net.inet.ip.portrange.randomized", &random_save, + &sysctlsz, &random_new, sizeof(random_new)); + if (error) { + warn("sysctlbyname(\"net.inet.ip.portrange.randomized\") " + "failed"); + atf_tc_skip("Unable to set sysctl"); + } + if (sysctlsz != sizeof(random_save)) { + fprintf(stderr, "Error: unexpected sysctl value size " + "(expected %zu, actual %zu)\n", sizeof(random_save), + sysctlsz); + goto restore_sysctl; + } + + /* Open the backup file, write the contents, and close it. */ + fd = open(SYSCTLBAKFILE, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL, + S_IRUSR|S_IWUSR); + if (fd < 0) { + warn("error opening sysctl backup file"); + goto restore_sysctl; + } + error = write(fd, &random_save, sizeof(random_save)); + if (error < 0) { + warn("error writing saved value to sysctl backup file"); + goto cleanup_and_restore; + } + if (error != (int)sizeof(random_save)) { + fprintf(stderr, + "Error writing saved value to sysctl backup file: " + "(expected %zu, actual %d)\n", sizeof(random_save), error); + goto cleanup_and_restore; + } + error = close(fd); + if (error) { + warn("error closing sysctl backup file"); +cleanup_and_restore: + (void)close(fd); + (void)unlink(SYSCTLBAKFILE); +restore_sysctl: + (void)sysctlbyname("net.inet.ip.portrange.randomized", NULL, + NULL, &random_save, sysctlsz); + atf_tc_skip("Error setting sysctl"); + } +} + +/* + * Restore the sysctl value from the backup file and delete the backup file. + */ +static void +restore_random_ports(void) +{ + int error, fd, random_save; + + /* Open the backup file, read the contents, close it, and delete it. */ + fd = open(SYSCTLBAKFILE, O_RDONLY); + if (fd < 0) { + warn("error opening sysctl backup file"); + return; + } + error = read(fd, &random_save, sizeof(random_save)); + if (error < 0) { + warn("error reading saved value from sysctl backup file"); + return; + } + if (error != (int)sizeof(random_save)) { + fprintf(stderr, + "Error reading saved value from sysctl backup file: " + "(expected %zu, actual %d)\n", sizeof(random_save), error); + return; + } + error = close(fd); + if (error) + warn("error closing sysctl backup file"); + error = unlink(SYSCTLBAKFILE); + if (error) + warn("error removing sysctl backup file"); + + /* Restore the saved sysctl value. */ + error = sysctlbyname("net.inet.ip.portrange.randomized", NULL, NULL, + &random_save, sizeof(random_save)); + if (error) + warn("sysctlbyname(\"net.inet.ip.portrange.randomized\") " + "failed while restoring value"); +} + +/* + * Given a domain and sockaddr, open a listening socket with automatic port + * selection. Then, try to connect 64K times. Ensure the connected socket never + * uses an overlapping port. + */ +static void +connect_loop(int domain, const struct sockaddr *addr) +{ + union { + struct sockaddr saddr; + struct sockaddr_in saddr4; + struct sockaddr_in6 saddr6; + } su_clnt, su_srvr; + socklen_t salen; + int asock, csock, error, i, lsock; + const struct linger lopt = { 1, 0 }; + + /* + * Disable the net.inet.ip.portrange.randomized sysctl. Assuming an + * otherwise idle system, this makes the kernel try all possible + * ports sequentially and makes it more likely it will try the + * port on which we have a listening socket. + */ + disable_random_ports(); + + /* Setup the listen socket. */ + lsock = socket(domain, SOCK_STREAM, 0); + ATF_REQUIRE_MSG(lsock >= 0, "socket() for listen socket failed: %s", + strerror(errno)); + error = bind(lsock, addr, addr->sa_len); + ATF_REQUIRE_MSG(error == 0, "bind() failed: %s", strerror(errno)); + error = listen(lsock, 1); + ATF_REQUIRE_MSG(error == 0, "listen() failed: %s", strerror(errno)); + + /* + * Get the address of the listen socket, which will be the destination + * address for our connection attempts. + */ + salen = sizeof(su_srvr); + error = getsockname(lsock, &su_srvr.saddr, &salen); + ATF_REQUIRE_MSG(error == 0, + "getsockname() for listen socket failed: %s", + strerror(errno)); + ATF_REQUIRE_MSG(salen == (domain == PF_INET ? + sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6)), + "unexpected sockaddr size"); + ATF_REQUIRE_MSG(su_srvr.saddr.sa_len == (domain == PF_INET ? + sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6)), + "unexpected sa_len size"); + + /* Open 64K connections in a loop. */ + for (i = 0; i < 65536; i++) { + csock = socket(domain, SOCK_STREAM, 0); + ATF_REQUIRE_MSG(csock >= 0, + "socket() for client socket %d failed: %s", + i, strerror(errno)); + + error = connect(csock, &su_srvr.saddr, su_srvr.saddr.sa_len); + ATF_REQUIRE_MSG(error == 0, + "connect() for client socket %d failed: %s", + i, strerror(errno)); + + error = setsockopt(csock, SOL_SOCKET, SO_LINGER, &lopt, + sizeof(lopt)); + ATF_REQUIRE_MSG(error == 0, + "Setting linger for client socket %d failed: %s", + i, strerror(errno)); + + /* Ascertain the client socket address. */ + salen = sizeof(su_clnt); + error = getsockname(csock, &su_clnt.saddr, &salen); + ATF_REQUIRE_MSG(error == 0, + "getsockname() for client socket %d failed: %s", + i, strerror(errno)); + ATF_REQUIRE_MSG(salen == (domain == PF_INET ? + sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6)), + "unexpected sockaddr size for client socket %d", i); + + /* Ensure the ports do not match. */ + switch (domain) { + case PF_INET: + ATF_REQUIRE_MSG(su_clnt.saddr4.sin_port != + su_srvr.saddr4.sin_port, + "client socket %d using the same port as server", + i); + break; + case PF_INET6: + ATF_REQUIRE_MSG(su_clnt.saddr6.sin6_port != + su_srvr.saddr6.sin6_port, + "client socket %d using the same port as server", + i); + break; + } + + /* Accept the socket and close both ends. */ + asock = accept(lsock, NULL, NULL); + ATF_REQUIRE_MSG(asock >= 0, + "accept() failed for client socket %d: %s", + i, strerror(errno)); + + error = close(asock); + ATF_REQUIRE_MSG(error == 0, + "close() failed for accepted socket %d: %s", + i, strerror(errno)); + + error = close(csock); + ATF_REQUIRE_MSG(error == 0, + "close() failed for client socket %d: %s", + i, strerror(errno)); + } +} + +ATF_TC_WITH_CLEANUP(basic_ipv4); +ATF_TC_HEAD(basic_ipv4, tc) +{ + + atf_tc_set_md_var(tc, "require.user", "root"); + atf_tc_set_md_var(tc, "require.config", "allow_sysctl_side_effects"); + atf_tc_set_md_var(tc, "descr", + "Check automatic local port assignment during TCP connect calls"); +} + +ATF_TC_BODY(basic_ipv4, tc) +{ + struct sockaddr_in saddr4; + + memset(&saddr4, 0, sizeof(saddr4)); + saddr4.sin_len = sizeof(saddr4); + saddr4.sin_family = AF_INET; + saddr4.sin_port = htons(0); + saddr4.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + + connect_loop(PF_INET, (const struct sockaddr *)&saddr4); +} + +ATF_TC_CLEANUP(basic_ipv4, tc) +{ + + restore_random_ports(); +} + +ATF_TC_WITH_CLEANUP(basic_ipv6); +ATF_TC_HEAD(basic_ipv6, tc) +{ + + atf_tc_set_md_var(tc, "require.user", "root"); + atf_tc_set_md_var(tc, "require.config", "allow_sysctl_side_effects"); + atf_tc_set_md_var(tc, "descr", + "Check automatic local port assignment during TCP connect calls"); +} + +ATF_TC_BODY(basic_ipv6, tc) +{ + struct sockaddr_in6 saddr6; + + memset(&saddr6, 0, sizeof(saddr6)); + saddr6.sin6_len = sizeof(saddr6); + saddr6.sin6_family = AF_INET6; + saddr6.sin6_port = htons(0); + saddr6.sin6_addr = in6addr_loopback; + + connect_loop(PF_INET6, (const struct sockaddr *)&saddr6); +} + +ATF_TC_CLEANUP(basic_ipv6, tc) +{ + + restore_random_ports(); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, basic_ipv4); + ATF_TP_ADD_TC(tp, basic_ipv6); + + return (atf_no_error()); +} + From owner-svn-src-head@freebsd.org Sat Nov 14 15:59:09 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2B43C2ED87F; Sat, 14 Nov 2020 15:59:09 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CYKlJ6TJrz3MBm; Sat, 14 Nov 2020 15:59:08 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 0AEFx1lT071547; Sat, 14 Nov 2020 07:59:01 -0800 (PST) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 0AEFx1j0071546; Sat, 14 Nov 2020 07:59:01 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202011141559.0AEFx1j0071546@gndrsh.dnsmgr.net> Subject: Re: svn commit: r367678 - head/usr.sbin/freebsd-update In-Reply-To: <202011141307.0AED7fuL017641@repo.freebsd.org> To: Mateusz Piotrowski <0mp@freebsd.org> Date: Sat, 14 Nov 2020 07:59:01 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4CYKlJ6TJrz3MBm X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 15:59:09 -0000 > Author: 0mp (doc,ports committer) > Date: Sat Nov 14 13:07:41 2020 > New Revision: 367678 > URL: https://svnweb.freebsd.org/changeset/base/367678 > > Log: > Document the PAGER environment variable > > Sometimes users want to use freebsd-update(8) in a non-interactive way and > what they often miss is that they have to set PAGER to cat(1) in order to > avoid interactive prompts from less(1). Which was caused by the change of invoking more(1) as less(1) causing this regression, as when invoked as more(1) it falls off the end of empty input and causes no such interactive prompt. Setting PAGER to more(1) also fixes this. > > MFC after: 4 weeks > > Modified: > head/usr.sbin/freebsd-update/freebsd-update.8 > > Modified: head/usr.sbin/freebsd-update/freebsd-update.8 > ============================================================================== > --- head/usr.sbin/freebsd-update/freebsd-update.8 Sat Nov 14 12:02:50 2020 (r367677) > +++ head/usr.sbin/freebsd-update/freebsd-update.8 Sat Nov 14 13:07:41 2020 (r367678) > @@ -25,7 +25,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd September 24, 2019 > +.Dd November 14, 2020 > .Dt FREEBSD-UPDATE 8 > .Os > .Sh NAME > @@ -193,6 +193,20 @@ System", since if the system has been tampered with > it cannot be trusted to operate correctly. > If you intend to use this command for intrusion-detection > purposes, make sure you boot from a secure disk (e.g., a CD). > +.El > +.Sh ENVIRONMENT > +.Bl -tag -width "PAGER" > +.It Ev PAGER > +The pager program used to present various reports during the execution. > +.Po > +Default: > +.Dq Pa /usr/bin/less . > +.Pc > +.Pp > +.Ev PAGER > +can be set to > +.Dq cat > +when a non-interactive pager is desired. > .El > .Sh FILES > .Bl -tag -width "/etc/freebsd-update.conf" > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sat Nov 14 17:20:17 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D8FFD2EF5B8; Sat, 14 Nov 2020 17:20:17 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CYMXx5h2gz3Qkb; Sat, 14 Nov 2020 17:20:17 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: by mail-ej1-f47.google.com with SMTP id o9so18418990ejg.1; Sat, 14 Nov 2020 09:20:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=a9HfmkRuWN4ALXjejuh0c4dQzjUTUQYzulgSERPPtmY=; b=G6R16ECNCMbJ86QV8G1giu2T/J3Ebgf2dIiZJBczDPEsxCRwRnebp0fIpO+cwwcYxA UWQ9YipNzVEONNsNtjWtPWtztXK4IF0HyYRJ0QsQ2uSAfIOKEYG1vgtMjvdBBJ/qYS04 eVjmI1JFP8SF4uLbfL7Fy5MENj7hqLaeLSgj+DBOmQLZYs4t/FYrMukFr2kiBwvB8Pjm iZtJ2N1gy+PxK4/NXcLJgYu4Kh+mLUXjGeBUhd17V1v5ZFvspJEsZ52T21B8xWjP7TF+ rQXz7G5XgMm+tBA0lDrV4sp3h+uGXiCb7i9srGoMmVcE8Cc5SfaOiWK+swMwGcYQ9wWh lLag== X-Gm-Message-State: AOAM5302DyowqC5REmi58VrXmRgXHQ+/j9vCin8HKWh6sKdhVo4W5633 ONPUk/cT5YjKwh/J7WE9GFeJTODSAGM= X-Google-Smtp-Source: ABdhPJx+ikwiAIXfxqRVYxbNyuxIam+KU9gNr1Gs5Ueru276DgOw4uBprNQAtUM1PfjL0ksCnvrcvQ== X-Received: by 2002:a17:906:d20a:: with SMTP id w10mr7519403ejz.3.1605374415839; Sat, 14 Nov 2020 09:20:15 -0800 (PST) Received: from ?IPv6:2a02:8109:98c0:1bc0:5e5f:67ff:fef4:ffd8? ([2a02:8109:98c0:1bc0:5e5f:67ff:fef4:ffd8]) by smtp.gmail.com with ESMTPSA id m26sm6963049ejb.45.2020.11.14.09.20.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 14 Nov 2020 09:20:15 -0800 (PST) Subject: Re: svn commit: r367678 - head/usr.sbin/freebsd-update To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202011141559.0AEFx1j0071546@gndrsh.dnsmgr.net> From: Mateusz Piotrowski <0mp@FreeBSD.org> Message-ID: Date: Sat, 14 Nov 2020 18:20:19 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <202011141559.0AEFx1j0071546@gndrsh.dnsmgr.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Rspamd-Queue-Id: 4CYMXx5h2gz3Qkb X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 17:20:17 -0000 Hello Rodney, On 11/14/20 4:59 PM, Rodney W. Grimes wrote: >> Author: 0mp (doc,ports committer) >> Date: Sat Nov 14 13:07:41 2020 >> New Revision: 367678 >> URL: https://svnweb.freebsd.org/changeset/base/367678 >> >> Log: >> Document the PAGER environment variable >> >> Sometimes users want to use freebsd-update(8) in a non-interactive way and >> what they often miss is that they have to set PAGER to cat(1) in order to >> avoid interactive prompts from less(1). > Which was caused by the change of invoking more(1) as less(1) causing > this regression, as when invoked as more(1) it falls off the end of > empty input and causes no such interactive prompt. > > Setting PAGER to more(1) also fixes this. Mmm, I'm not sure if that would work. If I run "jot 1000 | more" in my terminal I still get an interactive prompt. Could it be that you are referring to a different more(1) implementation? I'm clearly missing something. From owner-svn-src-head@freebsd.org Sat Nov 14 17:49:31 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8328B460CD7; Sat, 14 Nov 2020 17:49:31 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CYNBg3Gb0z3jTl; Sat, 14 Nov 2020 17:49:31 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qv1-f41.google.com (mail-qv1-f41.google.com [209.85.219.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 5DFB0DBD9; Sat, 14 Nov 2020 17:49:31 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qv1-f41.google.com with SMTP id e5so6639404qvs.1; Sat, 14 Nov 2020 09:49:31 -0800 (PST) X-Gm-Message-State: AOAM532MQDNKAk6qPAhhbaRvpks2lM4ZX0U30T0tLU7EWqfE0R3Og3A5 ZGhntgHY3BUfwTpYdKzXxRCVtiv7+k8/frzJuwg= X-Google-Smtp-Source: ABdhPJxiQUG6KluASavAyNmdAnueVemt7Z6CnQM2W2Rme7w6vm37clML5HCU8u5Jv6iZMviAtDSshWmUo3ctl31JTw0= X-Received: by 2002:a05:6214:2e1:: with SMTP id h1mr7885273qvu.60.1605376170905; Sat, 14 Nov 2020 09:49:30 -0800 (PST) MIME-Version: 1.0 References: <202011141559.0AEFx1j0071546@gndrsh.dnsmgr.net> In-Reply-To: From: Kyle Evans Date: Sat, 14 Nov 2020 11:49:19 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r367678 - head/usr.sbin/freebsd-update To: Mateusz Piotrowski <0mp@freebsd.org> Cc: "Rodney W. Grimes" , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 17:49:31 -0000 On Sat, Nov 14, 2020 at 11:20 AM Mateusz Piotrowski <0mp@freebsd.org> wrote: > > Hello Rodney, > > On 11/14/20 4:59 PM, Rodney W. Grimes wrote: > >> Author: 0mp (doc,ports committer) > >> Date: Sat Nov 14 13:07:41 2020 > >> New Revision: 367678 > >> URL: https://svnweb.freebsd.org/changeset/base/367678 > >> > >> Log: > >> Document the PAGER environment variable > >> > >> Sometimes users want to use freebsd-update(8) in a non-interactive way and > >> what they often miss is that they have to set PAGER to cat(1) in order to > >> avoid interactive prompts from less(1). > > Which was caused by the change of invoking more(1) as less(1) causing > > this regression, as when invoked as more(1) it falls off the end of > > empty input and causes no such interactive prompt. > > > > Setting PAGER to more(1) also fixes this. > > Mmm, I'm not sure if that would work. If I run "jot 1000 | more" in my terminal I still get an > interactive prompt. Could it be that you are referring to a different more(1) implementation? I'm > clearly missing something. > more(1) is more or less like `less -E`, which is a default PAGER I had advocated for back when it changed. It can be mostly non-interactive as long as your diffs are small, but it's definitely much less painful. From owner-svn-src-head@freebsd.org Sat Nov 14 17:57:51 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 967C9461188; Sat, 14 Nov 2020 17:57:51 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CYNNH3tNWz3kKs; Sat, 14 Nov 2020 17:57:51 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 783A76290; Sat, 14 Nov 2020 17:57:51 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AEHvpMU098204; Sat, 14 Nov 2020 17:57:51 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AEHvo1m098201; Sat, 14 Nov 2020 17:57:50 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <202011141757.0AEHvo1m098201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Sat, 14 Nov 2020 17:57:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367686 - head/lib/libutil X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/lib/libutil X-SVN-Commit-Revision: 367686 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 17:57:51 -0000 Author: scottl Date: Sat Nov 14 17:57:50 2020 New Revision: 367686 URL: https://svnweb.freebsd.org/changeset/base/367686 Log: Add the library function getlocalbase and its manual page. This helps to unify the retrieval of the various ways that the local software base directory, typically "/usr/local", is expressed in the system. Reviewed by: se Differential Revision: https://reviews.freebsd.org/D27022 Added: head/lib/libutil/getlocalbase.3 (contents, props changed) head/lib/libutil/getlocalbase.c (contents, props changed) Modified: head/lib/libutil/Makefile head/lib/libutil/libutil.h Modified: head/lib/libutil/Makefile ============================================================================== --- head/lib/libutil/Makefile Sat Nov 14 15:44:28 2020 (r367685) +++ head/lib/libutil/Makefile Sat Nov 14 17:57:50 2020 (r367686) @@ -12,7 +12,8 @@ PACKAGE= runtime LIB= util SHLIB_MAJOR= 9 -SRCS= _secure_path.c auth.c expand_number.c flopen.c fparseln.c gr_util.c \ +SRCS= _secure_path.c auth.c expand_number.c flopen.c fparseln.c \ + getlocalbase.c gr_util.c \ hexdump.c humanize_number.c kinfo_getfile.c \ kinfo_getallproc.c kinfo_getproc.c kinfo_getvmmap.c \ kinfo_getvmobject.c kld.c \ @@ -30,7 +31,7 @@ CFLAGS+= -DINET6 CFLAGS+= -I${.CURDIR} -I${SRCTOP}/lib/libc/gen/ -MAN+= expand_number.3 flopen.3 fparseln.3 hexdump.3 \ +MAN+= expand_number.3 flopen.3 fparseln.3 getlocalbase.3 hexdump.3 \ humanize_number.3 kinfo_getallproc.3 kinfo_getfile.3 \ kinfo_getproc.3 kinfo_getvmmap.3 kinfo_getvmobject.3 kld.3 \ login_auth.3 login_cap.3 \ Added: head/lib/libutil/getlocalbase.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libutil/getlocalbase.3 Sat Nov 14 17:57:50 2020 (r367686) @@ -0,0 +1,110 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright 2020 Scott Long +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd Oct 28, 2020 +.Dt GETLOCALBASE 3 +.Os +.Sh NAME +.Nm getlocalbase +.Nd "return the path to the local software directory" +.Sh LIBRARY +.Lb libutil +.Sh SYNOPSIS +.In libutil.h +.Ft ssize_t +.Fn getlocalbase "char *path" "size_t len" +.Sh DESCRIPTION +The +.Fn getlocalbase +function returns the path to the local software base directory. +Normally this is the +.Pa /usr/local +directory. +First the +.Ev LOCALBASE +environment variable is checked. +If that doesn't exist then the +.Va user.localbase +sysctl is checked. +If that also doesn't exist then the value of the +.Dv _PATH_LOCALBASE +compile-time variable is used. +If that is undefined then the default of +.Pa /usr/local +is used. +.Pp +The +.Fa path +argument points to a caller-supplied buffer to hold the resulting pathname. +The +.Fa len +argument is the length of the caller-supplied buffer. +.Sh IMPLEMENTATION NOTES +Calls to +.Fn getlocalpath +will perform a setugid check on the running binary before checking the +environment. +.Sh RETURN VALUES +If the request completes without error, the size of the string copied into the +buffer, including the terminating NUL, is returned. +If an error occurred or the buffer was too small to hold the string, +.Fn getlocalbase +returns -1 and sets +.Em errno +to indicate the error condition. +.Sh ENVIRONMENT +The +.Fn getlocalbase +library function retrieves the +.Ev LOCALBASE +environment variable. +.Sh ERRORS +The +.Fn getlocalbase +function will fail and set +.Va errno +for the following conditions: +.Bl -tag -width Er +.It Bq Er EINVAL +One of the passed in parameters is NULL or zero. +.It Bq Er ENOMEM +There isn't enough space in the passed in buffer to hold the pathname string. +.El +.Sh SEE ALSO +.Xr env 1 , +.Xr src.conf 5 , +.Xr sysctl 8 +.Sh HISTORY +The +.Nm +library function first appeared in +.Fx 13.0 . +.Sh AUTHORS +This +manual page was written by +.An Scott Long Aq Mt scottl@FreeBSD.org . Added: head/lib/libutil/getlocalbase.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libutil/getlocalbase.c Sat Nov 14 17:57:50 2020 (r367686) @@ -0,0 +1,75 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright 2020 Scott Long + * + * 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 REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +ssize_t +getlocalbase(char *path, size_t pathlen) +{ + size_t tmplen; + const char *tmppath; + + if ((pathlen == 0) || (path == NULL)) { + errno = EINVAL; + return (-1); + } + + tmppath = NULL; + tmplen = pathlen; + if (issetugid() == 0) + tmppath = getenv("LOCALBASE"); + + if ((tmppath == NULL) && + (sysctlbyname("user.localbase", path, &tmplen, NULL, 0) == 0)) { + return (tmplen); + } + + if (tmppath == NULL) +#ifdef _PATH_LOCALBASE + tmppath = _PATH_LOCALBASE; +#else + tmppath = "/usr/local"; +#endif + + tmplen = strlcpy(path, tmppath, pathlen); + if ((tmplen < 0) || (tmplen >= (ssize_t)pathlen)) { + errno = ENOMEM; + tmplen = -1; + } + + return (tmplen); +} Modified: head/lib/libutil/libutil.h ============================================================================== --- head/lib/libutil/libutil.h Sat Nov 14 15:44:28 2020 (r367685) +++ head/lib/libutil/libutil.h Sat Nov 14 17:57:50 2020 (r367686) @@ -98,6 +98,7 @@ int flopen(const char *_path, int _flags, ...); int flopenat(int _dirfd, const char *_path, int _flags, ...); int forkpty(int *_amaster, char *_name, struct termios *_termp, struct winsize *_winp); +ssize_t getlocalbase(char *path, size_t pathlen); void hexdump(const void *_ptr, int _length, const char *_hdr, int _flags); int humanize_number(char *_buf, size_t _len, int64_t _number, const char *_suffix, int _scale, int _flags); From owner-svn-src-head@freebsd.org Sat Nov 14 18:01:16 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 92C6546128D; Sat, 14 Nov 2020 18:01:16 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CYNSD3pftz3kNq; Sat, 14 Nov 2020 18:01:16 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 75A59605C; Sat, 14 Nov 2020 18:01:16 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AEI1GX2000293; Sat, 14 Nov 2020 18:01:16 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AEI1FCM000287; Sat, 14 Nov 2020 18:01:15 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <202011141801.0AEI1FCM000287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Sat, 14 Nov 2020 18:01:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367687 - in head: sbin/nvmecontrol usr.sbin/mailwrapper usr.sbin/pkg X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: in head: sbin/nvmecontrol usr.sbin/mailwrapper usr.sbin/pkg X-SVN-Commit-Revision: 367687 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 18:01:16 -0000 Author: scottl Date: Sat Nov 14 18:01:14 2020 New Revision: 367687 URL: https://svnweb.freebsd.org/changeset/base/367687 Log: Replace hardcoded references to _PATH_LOCALBASE with calls to getlocalbase.3 Reviewed by: imp, se Modified: head/sbin/nvmecontrol/comnd.c head/sbin/nvmecontrol/comnd.h head/sbin/nvmecontrol/nvmecontrol.c head/usr.sbin/mailwrapper/mailwrapper.c head/usr.sbin/pkg/Makefile head/usr.sbin/pkg/pkg.c Modified: head/sbin/nvmecontrol/comnd.c ============================================================================== --- head/sbin/nvmecontrol/comnd.c Sat Nov 14 17:57:50 2020 (r367686) +++ head/sbin/nvmecontrol/comnd.c Sat Nov 14 18:01:14 2020 (r367687) @@ -287,7 +287,7 @@ bad_arg: * Loads all the .so's from the specified directory. */ void -cmd_load_dir(const char *dir __unused, cmd_load_cb_t cb __unused, void *argp __unused) +cmd_load_dir(char *dir, cmd_load_cb_t cb, void *argp) { DIR *d; struct dirent *dent; Modified: head/sbin/nvmecontrol/comnd.h ============================================================================== --- head/sbin/nvmecontrol/comnd.h Sat Nov 14 17:57:50 2020 (r367686) +++ head/sbin/nvmecontrol/comnd.h Sat Nov 14 18:01:14 2020 (r367687) @@ -96,7 +96,7 @@ void cmd_register(struct cmd *, struct cmd *); int arg_parse(int argc, char * const *argv, const struct cmd *f); void arg_help(int argc, char * const *argv, const struct cmd *f); void cmd_init(void); -void cmd_load_dir(const char *dir, cmd_load_cb_t *cb, void *argp); +void cmd_load_dir(char *dir, cmd_load_cb_t *cb, void *argp); int cmd_dispatch(int argc, char *argv[], const struct cmd *); #endif /* COMND_H */ Modified: head/sbin/nvmecontrol/nvmecontrol.c ============================================================================== --- head/sbin/nvmecontrol/nvmecontrol.c Sat Nov 14 17:57:50 2020 (r367686) +++ head/sbin/nvmecontrol/nvmecontrol.c Sat Nov 14 18:01:14 2020 (r367687) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -178,11 +179,17 @@ get_nsid(int fd, char **ctrlr_str, uint32_t *nsid) int main(int argc, char *argv[]) { + char locallib[MAXPATHLEN]; + size_t len; cmd_init(); - cmd_load_dir("/lib/nvmecontrol", NULL, NULL); - cmd_load_dir(_PATH_LOCALBASE "/lib/nvmecontrol", NULL, NULL); + snprintf(locallib, MAXPATHLEN, "/lib/nvmecontrol"); + cmd_load_dir(locallib, NULL, NULL); + if ((len = getlocalbase(locallib, MAXPATHLEN)) > 0) { + strlcat(locallib, "/lib/nvmecontrol", MAXPATHLEN - len); + cmd_load_dir(locallib, NULL, NULL); + } cmd_dispatch(argc, argv, NULL); Modified: head/usr.sbin/mailwrapper/mailwrapper.c ============================================================================== --- head/usr.sbin/mailwrapper/mailwrapper.c Sat Nov 14 17:57:50 2020 (r367686) +++ head/usr.sbin/mailwrapper/mailwrapper.c Sat Nov 14 18:01:14 2020 (r367687) @@ -105,8 +105,10 @@ main(int argc, char *argv[], char *envp[]) initarg(&al); addarg(&al, argv[0]); - snprintf(localmailerconf, MAXPATHLEN, "%s/etc/mail/mailer.conf", - getenv("LOCALBASE") ? getenv("LOCALBASE") : _PATH_LOCALBASE); + if ((len = getlocalbase(localmailerconf, MAXPATHLEN)) != 0) + err(EX_OSERR, "cannot determine local path"); + + strlcat(localmailerconf, "/etc/mail/mailer.conf", MAXPATHLEN - len); mailerconf = localmailerconf; if ((config = fopen(localmailerconf, "r")) == NULL) Modified: head/usr.sbin/pkg/Makefile ============================================================================== --- head/usr.sbin/pkg/Makefile Sat Nov 14 17:57:50 2020 (r367686) +++ head/usr.sbin/pkg/Makefile Sat Nov 14 18:01:14 2020 (r367687) @@ -25,6 +25,6 @@ MAN= pkg.7 CFLAGS+=-I${SRCTOP}/contrib/libucl/include .PATH: ${SRCTOP}/contrib/libucl/include -LIBADD= archive fetch ucl sbuf crypto ssl +LIBADD= archive fetch ucl sbuf crypto ssl util .include Modified: head/usr.sbin/pkg/pkg.c ============================================================================== --- head/usr.sbin/pkg/pkg.c Sat Nov 14 17:57:50 2020 (r367686) +++ head/usr.sbin/pkg/pkg.c Sat Nov 14 18:01:14 2020 (r367687) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1037,6 +1038,7 @@ main(int argc, char *argv[]) { char pkgpath[MAXPATHLEN]; const char *pkgarg; + size_t len; int i; bool bootstrap_only, force, yes; @@ -1045,8 +1047,11 @@ main(int argc, char *argv[]) pkgarg = NULL; yes = false; - snprintf(pkgpath, MAXPATHLEN, "%s/sbin/pkg", - getenv("LOCALBASE") ? getenv("LOCALBASE") : _PATH_LOCALBASE); + if ((len = getlocalbase(pkgpath, MAXPATHLEN)) != 0) { + fprintf(stderr, "Cannot determine local path\n"); + exit(EXIT_FAILURE); + } + strlcat(pkgpath, "/sbin/pkg", MAXPATHLEN - len); if (argc > 1 && strcmp(argv[1], "bootstrap") == 0) { bootstrap_only = true; From owner-svn-src-head@freebsd.org Sat Nov 14 18:06:36 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 489084612B2; Sat, 14 Nov 2020 18:06:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CYNZN1bHFz3kkY; Sat, 14 Nov 2020 18:06:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 29EA46262; Sat, 14 Nov 2020 18:06:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AEI6Zi1006838; Sat, 14 Nov 2020 18:06:35 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AEI6ZhB006837; Sat, 14 Nov 2020 18:06:35 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202011141806.0AEI6ZhB006837@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 14 Nov 2020 18:06:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367688 - head X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 367688 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 18:06:36 -0000 Author: kevans Date: Sat Nov 14 18:06:35 2020 New Revision: 367688 URL: https://svnweb.freebsd.org/changeset/base/367688 Log: Makefile: re-wordsmith the blurb about xtoolchain ports The new version only includes a specific version once, and uses the one that's currently advised by tinderbox: -gcc6. It also advises just installing the pkg, but mentions in a side-note at the end where to find the source in the ports tree. Reviewed by: jrtc27 Suggested by: jhb (use default from tinderbox) Differential Revision: https://reviews.freebsd.org/D26820 Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Sat Nov 14 18:01:14 2020 (r367687) +++ head/Makefile Sat Nov 14 18:06:35 2020 (r367688) @@ -89,14 +89,16 @@ # 10. `reboot' # 11. `make delete-old-libs' (in case no 3rd party program uses them anymore) # -# For individuals wanting to build from source with GCC from ports, first build -# or install an appropriate flavor of devel/freebsd-gcc9. The packages produced -# by this port are named "${TARGET_ARCH}-gcc9" -- note that not all -# architectures supported by FreeBSD have an external gcc toolchain available. +# For individuals wanting to build from source with GCC from ports, first +# install the appropriate GCC cross toolchain package: +# `pkg install ${TARGET_ARCH}-gccN` # -# Once the appropriate freebsd-gcc package is installed, simply pass -# CROSS_TOOLCHAIN=${TARGET_ARCH}-gcc9 while building with the above steps, -# e.g., `make buildworld CROSS_TOOLCHAIN=amd64-gcc9`. +# Once you have installed the necessary cross toolchain, simply pass +# CROSS_TOOLCHAIN=${TARGET_ARCH}-gccN while building with the above steps, +# e.g., `make buildworld CROSS_TOOLCHAIN=amd64-gcc6`. +# +# The ${TARGET_ARCH}-gccN packages are provided as flavors of the +# devel/freebsd-gccN ports. # # See src/UPDATING `COMMON ITEMS' for more complete information. # From owner-svn-src-head@freebsd.org Sat Nov 14 18:43:39 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 22A5846239C; Sat, 14 Nov 2020 18:43:39 +0000 (UTC) (envelope-from gbe@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CYPP70YCXz3mYx; Sat, 14 Nov 2020 18:43:39 +0000 (UTC) (envelope-from gbe@freebsd.org) Received: from localhost (p4fd3a1f5.dip0.t-ipconnect.de [79.211.161.245]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gbe) by smtp.freebsd.org (Postfix) with ESMTPSA id 729D6ED81; Sat, 14 Nov 2020 18:43:38 +0000 (UTC) (envelope-from gbe@freebsd.org) Date: Sat, 14 Nov 2020 19:43:38 +0100 From: Gordon Bergling To: Scott Long Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r367686 - head/lib/libutil Message-ID: References: <202011141757.0AEHvo1m098201@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202011141757.0AEHvo1m098201@repo.freebsd.org> X-Url: X-Operating-System: FreeBSD 12.2-STABLE amd64 X-Host-Uptime: 7:40PM up 3 days, 1:46, 4 users, load averages: 0.29, 0.34, 0.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 18:43:39 -0000 Hi Scott, this somehow breaks the build. --------------------------------------------------------------------- ===> lib/msun (obj,all,install) /tank/nfs_public/tiny/src/lib/libutil/getlocalbase.c:69:30: error: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'ssize_t' (aka 'long') [-Werror,-Wsign-compare] if ((tmplen < 0) || (tmplen >= (ssize_t)pathlen)) { ~~~~~~ ^ ~~~~~~~~~~~~~~~~ 1 error generated. --- getlocalbase.o --- *** [getlocalbase.o] Error code 1 ..................................................................... Got this on arm64 with the following src.conf: WITH_MALLOC_PRODUCTION=1 WITH_EXTRA_TCP_STACKS=1 WITH_BEARSSL=1 WITH_PIE=1 WITH_RETPOLINE=1 --Gordon On Sat, Nov 14, 2020 at 05:57:50PM +0000, Scott Long wrote: > Author: scottl > Date: Sat Nov 14 17:57:50 2020 > New Revision: 367686 > URL: https://svnweb.freebsd.org/changeset/base/367686 > > Log: > Add the library function getlocalbase and its manual page. This helps to > unify the retrieval of the various ways that the local software base directory, > typically "/usr/local", is expressed in the system. > > Reviewed by: se > Differential Revision: https://reviews.freebsd.org/D27022 > > Added: > head/lib/libutil/getlocalbase.3 (contents, props changed) > head/lib/libutil/getlocalbase.c (contents, props changed) > Modified: > head/lib/libutil/Makefile > head/lib/libutil/libutil.h > > Modified: head/lib/libutil/Makefile > ============================================================================== > --- head/lib/libutil/Makefile Sat Nov 14 15:44:28 2020 (r367685) > +++ head/lib/libutil/Makefile Sat Nov 14 17:57:50 2020 (r367686) > @@ -12,7 +12,8 @@ PACKAGE= runtime > LIB= util > SHLIB_MAJOR= 9 > > -SRCS= _secure_path.c auth.c expand_number.c flopen.c fparseln.c gr_util.c \ > +SRCS= _secure_path.c auth.c expand_number.c flopen.c fparseln.c \ > + getlocalbase.c gr_util.c \ > hexdump.c humanize_number.c kinfo_getfile.c \ > kinfo_getallproc.c kinfo_getproc.c kinfo_getvmmap.c \ > kinfo_getvmobject.c kld.c \ > @@ -30,7 +31,7 @@ CFLAGS+= -DINET6 > > CFLAGS+= -I${.CURDIR} -I${SRCTOP}/lib/libc/gen/ > > -MAN+= expand_number.3 flopen.3 fparseln.3 hexdump.3 \ > +MAN+= expand_number.3 flopen.3 fparseln.3 getlocalbase.3 hexdump.3 \ > humanize_number.3 kinfo_getallproc.3 kinfo_getfile.3 \ > kinfo_getproc.3 kinfo_getvmmap.3 kinfo_getvmobject.3 kld.3 \ > login_auth.3 login_cap.3 \ > > Added: head/lib/libutil/getlocalbase.3 > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/lib/libutil/getlocalbase.3 Sat Nov 14 17:57:50 2020 (r367686) > @@ -0,0 +1,110 @@ > +.\" > +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD > +.\" > +.\" Copyright 2020 Scott Long > +.\" > +.\" Redistribution and use in source and binary forms, with or without > +.\" modification, are permitted provided that the following conditions > +.\" are met: > +.\" 1. Redistributions of source code must retain the above copyright > +.\" notice, this list of conditions and the following disclaimer. > +.\" 2. Redistributions in binary form must reproduce the above copyright > +.\" notice, this list of conditions and the following disclaimer in the > +.\" documentation and/or other materials provided with the distribution. > +.\" > +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > +.\" SUCH DAMAGE. > +.\" > +.\" $FreeBSD$ > +.\" > +.Dd Oct 28, 2020 > +.Dt GETLOCALBASE 3 > +.Os > +.Sh NAME > +.Nm getlocalbase > +.Nd "return the path to the local software directory" > +.Sh LIBRARY > +.Lb libutil > +.Sh SYNOPSIS > +.In libutil.h > +.Ft ssize_t > +.Fn getlocalbase "char *path" "size_t len" > +.Sh DESCRIPTION > +The > +.Fn getlocalbase > +function returns the path to the local software base directory. > +Normally this is the > +.Pa /usr/local > +directory. > +First the > +.Ev LOCALBASE > +environment variable is checked. > +If that doesn't exist then the > +.Va user.localbase > +sysctl is checked. > +If that also doesn't exist then the value of the > +.Dv _PATH_LOCALBASE > +compile-time variable is used. > +If that is undefined then the default of > +.Pa /usr/local > +is used. > +.Pp > +The > +.Fa path > +argument points to a caller-supplied buffer to hold the resulting pathname. > +The > +.Fa len > +argument is the length of the caller-supplied buffer. > +.Sh IMPLEMENTATION NOTES > +Calls to > +.Fn getlocalpath > +will perform a setugid check on the running binary before checking the > +environment. > +.Sh RETURN VALUES > +If the request completes without error, the size of the string copied into the > +buffer, including the terminating NUL, is returned. > +If an error occurred or the buffer was too small to hold the string, > +.Fn getlocalbase > +returns -1 and sets > +.Em errno > +to indicate the error condition. > +.Sh ENVIRONMENT > +The > +.Fn getlocalbase > +library function retrieves the > +.Ev LOCALBASE > +environment variable. > +.Sh ERRORS > +The > +.Fn getlocalbase > +function will fail and set > +.Va errno > +for the following conditions: > +.Bl -tag -width Er > +.It Bq Er EINVAL > +One of the passed in parameters is NULL or zero. > +.It Bq Er ENOMEM > +There isn't enough space in the passed in buffer to hold the pathname string. > +.El > +.Sh SEE ALSO > +.Xr env 1 , > +.Xr src.conf 5 , > +.Xr sysctl 8 > +.Sh HISTORY > +The > +.Nm > +library function first appeared in > +.Fx 13.0 . > +.Sh AUTHORS > +This > +manual page was written by > +.An Scott Long Aq Mt scottl@FreeBSD.org . > > Added: head/lib/libutil/getlocalbase.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/lib/libutil/getlocalbase.c Sat Nov 14 17:57:50 2020 (r367686) > @@ -0,0 +1,75 @@ > +/*- > + * SPDX-License-Identifier: BSD-2-Clause > + * > + * Copyright 2020 Scott Long > + * > + * 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 REGENTS AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +ssize_t > +getlocalbase(char *path, size_t pathlen) > +{ > + size_t tmplen; > + const char *tmppath; > + > + if ((pathlen == 0) || (path == NULL)) { > + errno = EINVAL; > + return (-1); > + } > + > + tmppath = NULL; > + tmplen = pathlen; > + if (issetugid() == 0) > + tmppath = getenv("LOCALBASE"); > + > + if ((tmppath == NULL) && > + (sysctlbyname("user.localbase", path, &tmplen, NULL, 0) == 0)) { > + return (tmplen); > + } > + > + if (tmppath == NULL) > +#ifdef _PATH_LOCALBASE > + tmppath = _PATH_LOCALBASE; > +#else > + tmppath = "/usr/local"; > +#endif > + > + tmplen = strlcpy(path, tmppath, pathlen); > + if ((tmplen < 0) || (tmplen >= (ssize_t)pathlen)) { > + errno = ENOMEM; > + tmplen = -1; > + } > + > + return (tmplen); > +} > > Modified: head/lib/libutil/libutil.h > ============================================================================== > --- head/lib/libutil/libutil.h Sat Nov 14 15:44:28 2020 (r367685) > +++ head/lib/libutil/libutil.h Sat Nov 14 17:57:50 2020 (r367686) > @@ -98,6 +98,7 @@ int flopen(const char *_path, int _flags, ...); > int flopenat(int _dirfd, const char *_path, int _flags, ...); > int forkpty(int *_amaster, char *_name, > struct termios *_termp, struct winsize *_winp); > +ssize_t getlocalbase(char *path, size_t pathlen); > void hexdump(const void *_ptr, int _length, const char *_hdr, int _flags); > int humanize_number(char *_buf, size_t _len, int64_t _number, > const char *_suffix, int _scale, int _flags); > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" -- From owner-svn-src-head@freebsd.org Sat Nov 14 18:44:32 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1B6214624D7; Sat, 14 Nov 2020 18:44:32 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (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 4CYPQ772TSz3n52; Sat, 14 Nov 2020 18:44:31 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 1D6F65C007C; Sat, 14 Nov 2020 13:44:31 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sat, 14 Nov 2020 13:44:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsco.org; h= content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=fm1; bh=u OSBZkwg6n90URinrQFe4mhxcvXoccMmEvK1o8n7VEc=; b=WM0u5i5JnuytGM14j 57EIwcCNHEupn6PzTpZ8l/hAFdHJ+ViyIT914vPHCzL4ujHDnQ8Md0qqPvqTh8HP T4yVgLGxYWznW/1OOhGCfD9jvwb2o7P7hPwoD8DszEit5cqJVyACEb6dk469GCN1 xdLPtTD0/Gdy3y1T/Bor/sghJjyxEqx//yzfM7Z+bDwFcJqlhdsyivWGuIFYNOwG VtoXNqjHAOZVYjKryRZW2dKLIMnh+1/b4XYhqzg93vrYCibZ6CVeU3YCqyOxms9w ErROWZQD4Hv4LOjhil5B10xojXb5kFgCDG+jNBoFF4ccwEX+UYBLLCWg8m2uDFDO w5VSg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=uOSBZkwg6n90URinrQFe4mhxcvXoccMmEvK1o8n7V Ec=; b=LzStyPMw25aixPTgpwPIZi2xm9AKswE4v1779JenCX/lcKR8MlsFB0NK4 m0awvxODOwBOk/aWddoDSLtpiv8V4I1icZRs1l/PcHufFH2RnuPZIdE8QhSaaUi9 7Ks7ULgaNa42gJgrjiE1fh5G0Ijr56qWInGWc8ZBhvhW+3wj0neBn98qnzsJgwkF BY2ySP2NLOFTOyGfWDA8gUJuIVMUgq9hx8DZGydCqHoHgxC50K/tFOA5w8U13XJT htJdpqNAHa9QkLnfUVSYGlqgyW7d9U0bGkpv782OH8ySBah/wW8+iHALwg9BTIXc +Au5BfFuddRkgT1Fc5WOzjOQVYJ2g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedruddvjedguddujecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enufhorhhtvgguuchrvggtihhpshculdegtddmnecujfgurheptggguffhjgffgffkfhfv ofesthhqmhdthhdtjeenucfhrhhomhepufgtohhtthcunfhonhhguceoshgtohhtthhlse hsrghmshgtohdrohhrgheqnecuggftrfgrthhtvghrnhepuefggfdtheduueduteeluddt tdfgffegjeejtedtfffgteeugeegudffvedvtefgnecuffhomhgrihhnpehfrhgvvggssh gurdhorhhgpdhthhgvrdhprgdpohhfrdhprgenucfkphepkedrgeeirdekledrvddufeen ucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehstghoth htlhesshgrmhhstghordhorhhg X-ME-Proxy: Received: from [192.168.0.114] (unknown [8.46.89.213]) by mail.messagingengine.com (Postfix) with ESMTPA id 570AD3280065; Sat, 14 Nov 2020 13:44:30 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: svn commit: r367686 - head/lib/libutil From: Scott Long In-Reply-To: Date: Sat, 14 Nov 2020 11:44:29 -0700 Cc: Scott Long , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <2236AF89-1624-46B1-A170-7C7B5B4BB5E6@samsco.org> References: <202011141757.0AEHvo1m098201@repo.freebsd.org> To: Gordon Bergling X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Rspamd-Queue-Id: 4CYPQ772TSz3n52 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 18:44:32 -0000 Hi, Yeah, I=E2=80=99m working on a fix, sorry. I made a last minute change = that I thought I had tested, but apparently hadn=E2=80=99t. Scott > On Nov 14, 2020, at 11:43 AM, Gordon Bergling wrote: >=20 > Hi Scott, >=20 > this somehow breaks the build. >=20 > --------------------------------------------------------------------- > =3D=3D=3D> lib/msun (obj,all,install) > /tank/nfs_public/tiny/src/lib/libutil/getlocalbase.c:69:30: error: = comparison of integers of different signs: 'size_t' (aka 'unsigned = long') and 'ssize_t' (aka 'long') [-Werror,-Wsign-compare] > if ((tmplen < 0) || (tmplen >=3D (ssize_t)pathlen)) { > ~~~~~~ ^ ~~~~~~~~~~~~~~~~ > 1 error generated. > --- getlocalbase.o --- > *** [getlocalbase.o] Error code 1 > ..................................................................... >=20 > Got this on arm64 with the following src.conf: >=20 > WITH_MALLOC_PRODUCTION=3D1 > WITH_EXTRA_TCP_STACKS=3D1 > WITH_BEARSSL=3D1 > WITH_PIE=3D1 > WITH_RETPOLINE=3D1 >=20 > --Gordon >=20 > On Sat, Nov 14, 2020 at 05:57:50PM +0000, Scott Long wrote: >> Author: scottl >> Date: Sat Nov 14 17:57:50 2020 >> New Revision: 367686 >> URL: https://svnweb.freebsd.org/changeset/base/367686 >>=20 >> Log: >> Add the library function getlocalbase and its manual page. This = helps to >> unify the retrieval of the various ways that the local software base = directory, >> typically "/usr/local", is expressed in the system. >>=20 >> Reviewed by: se >> Differential Revision: https://reviews.freebsd.org/D27022 >>=20 >> Added: >> head/lib/libutil/getlocalbase.3 (contents, props changed) >> head/lib/libutil/getlocalbase.c (contents, props changed) >> Modified: >> head/lib/libutil/Makefile >> head/lib/libutil/libutil.h >>=20 >> Modified: head/lib/libutil/Makefile >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/lib/libutil/Makefile Sat Nov 14 15:44:28 2020 = (r367685) >> +++ head/lib/libutil/Makefile Sat Nov 14 17:57:50 2020 = (r367686) >> @@ -12,7 +12,8 @@ PACKAGE=3D runtime >> LIB=3D util >> SHLIB_MAJOR=3D 9 >>=20 >> -SRCS=3D _secure_path.c auth.c expand_number.c flopen.c = fparseln.c gr_util.c \ >> +SRCS=3D _secure_path.c auth.c expand_number.c flopen.c = fparseln.c \ >> + getlocalbase.c gr_util.c \ >> hexdump.c humanize_number.c kinfo_getfile.c \ >> kinfo_getallproc.c kinfo_getproc.c kinfo_getvmmap.c \ >> kinfo_getvmobject.c kld.c \ >> @@ -30,7 +31,7 @@ CFLAGS+=3D -DINET6 >>=20 >> CFLAGS+=3D -I${.CURDIR} -I${SRCTOP}/lib/libc/gen/ >>=20 >> -MAN+=3D expand_number.3 flopen.3 fparseln.3 hexdump.3 \ >> +MAN+=3D expand_number.3 flopen.3 fparseln.3 getlocalbase.3 = hexdump.3 \ >> humanize_number.3 kinfo_getallproc.3 kinfo_getfile.3 \ >> kinfo_getproc.3 kinfo_getvmmap.3 kinfo_getvmobject.3 kld.3 \ >> login_auth.3 login_cap.3 \ >>=20 >> Added: head/lib/libutil/getlocalbase.3 >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- /dev/null 00:00:00 1970 (empty, because file is newly = added) >> +++ head/lib/libutil/getlocalbase.3 Sat Nov 14 17:57:50 2020 = (r367686) >> @@ -0,0 +1,110 @@ >> +.\" >> +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD >> +.\" >> +.\" Copyright 2020 Scott Long >> +.\" >> +.\" Redistribution and use in source and binary forms, with or = without >> +.\" modification, are permitted provided that the following = conditions >> +.\" are met: >> +.\" 1. Redistributions of source code must retain the above = copyright >> +.\" notice, this list of conditions and the following disclaimer. >> +.\" 2. Redistributions in binary form must reproduce the above = copyright >> +.\" notice, this list of conditions and the following disclaimer = in the >> +.\" documentation and/or other materials provided with the = distribution. >> +.\" >> +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS = IS'' AND >> +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED = TO, THE >> +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A = PARTICULAR PURPOSE >> +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE = LIABLE >> +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR = CONSEQUENTIAL >> +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF = SUBSTITUTE GOODS >> +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS = INTERRUPTION) >> +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN = CONTRACT, STRICT >> +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING = IN ANY WAY >> +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE = POSSIBILITY OF >> +.\" SUCH DAMAGE. >> +.\" >> +.\" $FreeBSD$ >> +.\" >> +.Dd Oct 28, 2020 >> +.Dt GETLOCALBASE 3 >> +.Os >> +.Sh NAME >> +.Nm getlocalbase >> +.Nd "return the path to the local software directory" >> +.Sh LIBRARY >> +.Lb libutil >> +.Sh SYNOPSIS >> +.In libutil.h >> +.Ft ssize_t >> +.Fn getlocalbase "char *path" "size_t len" >> +.Sh DESCRIPTION >> +The >> +.Fn getlocalbase >> +function returns the path to the local software base directory. >> +Normally this is the >> +.Pa /usr/local >> +directory. >> +First the >> +.Ev LOCALBASE >> +environment variable is checked. >> +If that doesn't exist then the >> +.Va user.localbase >> +sysctl is checked. >> +If that also doesn't exist then the value of the >> +.Dv _PATH_LOCALBASE >> +compile-time variable is used. >> +If that is undefined then the default of >> +.Pa /usr/local >> +is used. >> +.Pp >> +The >> +.Fa path >> +argument points to a caller-supplied buffer to hold the resulting = pathname. >> +The >> +.Fa len >> +argument is the length of the caller-supplied buffer. >> +.Sh IMPLEMENTATION NOTES >> +Calls to >> +.Fn getlocalpath >> +will perform a setugid check on the running binary before checking = the >> +environment. >> +.Sh RETURN VALUES >> +If the request completes without error, the size of the string = copied into the >> +buffer, including the terminating NUL, is returned. >> +If an error occurred or the buffer was too small to hold the string, >> +.Fn getlocalbase >> +returns -1 and sets >> +.Em errno >> +to indicate the error condition. >> +.Sh ENVIRONMENT >> +The >> +.Fn getlocalbase >> +library function retrieves the >> +.Ev LOCALBASE >> +environment variable. >> +.Sh ERRORS >> +The >> +.Fn getlocalbase >> +function will fail and set >> +.Va errno >> +for the following conditions: >> +.Bl -tag -width Er >> +.It Bq Er EINVAL >> +One of the passed in parameters is NULL or zero. >> +.It Bq Er ENOMEM >> +There isn't enough space in the passed in buffer to hold the = pathname string. >> +.El >> +.Sh SEE ALSO >> +.Xr env 1 , >> +.Xr src.conf 5 , >> +.Xr sysctl 8 >> +.Sh HISTORY >> +The >> +.Nm >> +library function first appeared in >> +.Fx 13.0 . >> +.Sh AUTHORS >> +This >> +manual page was written by >> +.An Scott Long Aq Mt scottl@FreeBSD.org . >>=20 >> Added: head/lib/libutil/getlocalbase.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 >> --- /dev/null 00:00:00 1970 (empty, because file is newly = added) >> +++ head/lib/libutil/getlocalbase.c Sat Nov 14 17:57:50 2020 = (r367686) >> @@ -0,0 +1,75 @@ >> +/*- >> + * SPDX-License-Identifier: BSD-2-Clause >> + * >> + * Copyright 2020 Scott Long >> + * >> + * 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 REGENTS AND CONTRIBUTORS ``AS = IS'' AND >> + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, = THE >> + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A = PARTICULAR PURPOSE >> + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE = LIABLE >> + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR = CONSEQUENTIAL >> + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE = GOODS >> + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS = INTERRUPTION) >> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN = CONTRACT, STRICT >> + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN = ANY WAY >> + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE = POSSIBILITY OF >> + * SUCH DAMAGE. >> + */ >> + >> +#include >> +__FBSDID("$FreeBSD$"); >> + >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> + >> +ssize_t >> +getlocalbase(char *path, size_t pathlen) >> +{ >> + size_t tmplen; >> + const char *tmppath; >> + >> + if ((pathlen =3D=3D 0) || (path =3D=3D NULL)) { >> + errno =3D EINVAL; >> + return (-1); >> + } >> + >> + tmppath =3D NULL; >> + tmplen =3D pathlen; >> + if (issetugid() =3D=3D 0) >> + tmppath =3D getenv("LOCALBASE"); >> + >> + if ((tmppath =3D=3D NULL) && >> + (sysctlbyname("user.localbase", path, &tmplen, NULL, 0) =3D=3D= 0)) { >> + return (tmplen); >> + } >> + >> + if (tmppath =3D=3D NULL) >> +#ifdef _PATH_LOCALBASE >> + tmppath =3D _PATH_LOCALBASE; >> +#else >> + tmppath =3D "/usr/local"; >> +#endif >> + >> + tmplen =3D strlcpy(path, tmppath, pathlen); >> + if ((tmplen < 0) || (tmplen >=3D (ssize_t)pathlen)) { >> + errno =3D ENOMEM; >> + tmplen =3D -1; >> + } >> + >> + return (tmplen); >> +} >>=20 >> Modified: head/lib/libutil/libutil.h >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/lib/libutil/libutil.h Sat Nov 14 15:44:28 2020 = (r367685) >> +++ head/lib/libutil/libutil.h Sat Nov 14 17:57:50 2020 = (r367686) >> @@ -98,6 +98,7 @@ int flopen(const char *_path, int _flags, = ...); >> int flopenat(int _dirfd, const char *_path, int _flags, ...); >> int forkpty(int *_amaster, char *_name, >> struct termios *_termp, struct winsize *_winp); >> +ssize_t getlocalbase(char *path, size_t pathlen); >> void hexdump(const void *_ptr, int _length, const char *_hdr, int = _flags); >> int humanize_number(char *_buf, size_t _len, int64_t _number, >> const char *_suffix, int _scale, int _flags); >> _______________________________________________ >> svn-src-head@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/svn-src-head >> To unsubscribe, send any mail to = "svn-src-head-unsubscribe@freebsd.org" >=20 > --=20 From owner-svn-src-head@freebsd.org Sat Nov 14 19:04:37 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 928EF462E9C; Sat, 14 Nov 2020 19:04:37 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CYPsK3qLJz3p7p; Sat, 14 Nov 2020 19:04:37 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 73AA66B7D; Sat, 14 Nov 2020 19:04:37 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AEJ4bCE044002; Sat, 14 Nov 2020 19:04:37 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AEJ4bXA043999; Sat, 14 Nov 2020 19:04:37 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <202011141904.0AEJ4bXA043999@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Sat, 14 Nov 2020 19:04:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367689 - head/lib/libutil X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/lib/libutil X-SVN-Commit-Revision: 367689 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 19:04:37 -0000 Author: scottl Date: Sat Nov 14 19:04:36 2020 New Revision: 367689 URL: https://svnweb.freebsd.org/changeset/base/367689 Log: Fix a problem with r367686 related to the use of ssize_t. Not sure how this escaped prior testing, but it should be better now. Reported by: lots Modified: head/lib/libutil/getlocalbase.c head/lib/libutil/libutil.h Modified: head/lib/libutil/getlocalbase.c ============================================================================== --- head/lib/libutil/getlocalbase.c Sat Nov 14 18:06:35 2020 (r367688) +++ head/lib/libutil/getlocalbase.c Sat Nov 14 19:04:36 2020 (r367689) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -66,10 +67,16 @@ getlocalbase(char *path, size_t pathlen) #endif tmplen = strlcpy(path, tmppath, pathlen); - if ((tmplen < 0) || (tmplen >= (ssize_t)pathlen)) { + if ((tmplen < 0) || (tmplen >= pathlen)) { errno = ENOMEM; - tmplen = -1; + return (-1); } - return (tmplen); + /* It's unlikely that the buffer would be this big */ + if (tmplen >= SSIZE_MAX) { + errno = ENOMEM; + return (-1); + } + + return ((ssize_t)tmplen); } Modified: head/lib/libutil/libutil.h ============================================================================== --- head/lib/libutil/libutil.h Sat Nov 14 18:06:35 2020 (r367688) +++ head/lib/libutil/libutil.h Sat Nov 14 19:04:36 2020 (r367689) @@ -65,6 +65,11 @@ typedef __size_t size_t; #define _SIZE_T_DECLARED #endif +#ifndef _SSIZE_T_DECLARED +typedef __ssize_t ssize_t; +#define _SSIZE_T_DECLARED +#endif + #ifndef _UID_T_DECLARED typedef __uid_t uid_t; #define _UID_T_DECLARED From owner-svn-src-head@freebsd.org Sat Nov 14 19:16:40 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2B6754630C6; Sat, 14 Nov 2020 19:16:40 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CYQ7D0pK8z3pxF; Sat, 14 Nov 2020 19:16:40 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E7F57128; Sat, 14 Nov 2020 19:16:40 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AEJGdw6050064; Sat, 14 Nov 2020 19:16:39 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AEJGdth050063; Sat, 14 Nov 2020 19:16:39 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <202011141916.0AEJGdth050063@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 14 Nov 2020 19:16:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367690 - head/usr.bin/login X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/usr.bin/login X-SVN-Commit-Revision: 367690 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 19:16:40 -0000 Author: bapt Date: Sat Nov 14 19:16:39 2020 New Revision: 367690 URL: https://svnweb.freebsd.org/changeset/base/367690 Log: Change the default locale to C.UTF-8 The C.UTF-8 locales is the same as the actual C locale except it does support the unicode character set. But the collation etc are still the same as the C locale one. Reviewed by: many Approved by: many Differential Revision: https://reviews.freebsd.org/D26973 Modified: head/usr.bin/login/login.conf Modified: head/usr.bin/login/login.conf ============================================================================== --- head/usr.bin/login/login.conf Sat Nov 14 19:04:36 2020 (r367689) +++ head/usr.bin/login/login.conf Sat Nov 14 19:16:39 2020 (r367690) @@ -47,8 +47,9 @@ default:\ :umtxp=unlimited:\ :priority=0:\ :ignoretime@:\ - :umask=022: - + :umask=022:\ + :charset=UTF-8:\ + :lang=C.UTF-8: # # A collection of common class names - forward them all to 'default' From owner-svn-src-head@freebsd.org Sat Nov 14 19:19:27 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A18C14630B7; Sat, 14 Nov 2020 19:19:27 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CYQBR4BG6z3pdl; Sat, 14 Nov 2020 19:19:27 +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 7E3E971AD; Sat, 14 Nov 2020 19:19:27 +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 0AEJJRM5050257; Sat, 14 Nov 2020 19:19:27 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AEJJR72050256; Sat, 14 Nov 2020 19:19:27 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011141919.0AEJJR72050256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 14 Nov 2020 19:19:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367691 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 367691 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 19:19:27 -0000 Author: mjg Date: Sat Nov 14 19:19:27 2020 New Revision: 367691 URL: https://svnweb.freebsd.org/changeset/base/367691 Log: thread: pad tid lock On a kernel with other changes this bumps 104-way thread creation/destruction from 0.96 mln ops/s to 1.1 mln ops/s. Modified: head/sys/kern/kern_thread.c Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Sat Nov 14 19:16:39 2020 (r367690) +++ head/sys/kern/kern_thread.c Sat Nov 14 19:19:27 2020 (r367691) @@ -135,7 +135,7 @@ static int thread_unsuspend_one(struct thread *td, str bool boundary); static void thread_free_batched(struct thread *td); -static struct mtx tid_lock; +static __exclusive_cache_line struct mtx tid_lock; static bitstr_t *tid_bitmap; static MALLOC_DEFINE(M_TIDHASH, "tidhash", "thread hash"); From owner-svn-src-head@freebsd.org Sat Nov 14 19:20:38 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 47A2946325F; Sat, 14 Nov 2020 19:20:38 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CYQCp1cNQz3pqt; Sat, 14 Nov 2020 19:20:38 +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 2A2B27227; Sat, 14 Nov 2020 19:20:38 +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 0AEJKbqm050397; Sat, 14 Nov 2020 19:20:37 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AEJKbpO050396; Sat, 14 Nov 2020 19:20:37 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011141920.0AEJKbpO050396@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 14 Nov 2020 19:20:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367692 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 367692 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 19:20:38 -0000 Author: mjg Date: Sat Nov 14 19:20:37 2020 New Revision: 367692 URL: https://svnweb.freebsd.org/changeset/base/367692 Log: cred: reorder cr_audit to be closer to the lock This makes cr_uid avoid sharing. Modified: head/sys/sys/ucred.h Modified: head/sys/sys/ucred.h ============================================================================== --- head/sys/sys/ucred.h Sat Nov 14 19:19:27 2020 (r367691) +++ head/sys/sys/ucred.h Sat Nov 14 19:20:37 2020 (r367692) @@ -63,6 +63,7 @@ struct ucred { struct mtx cr_mtx; u_int cr_ref; /* (c) reference count */ u_int cr_users; /* (c) proc + thread using this cred */ + struct auditinfo_addr cr_audit; /* Audit properties. */ #define cr_startcopy cr_uid uid_t cr_uid; /* effective user id */ uid_t cr_ruid; /* real user id */ @@ -78,7 +79,6 @@ struct ucred { void *cr_pspare2[2]; /* general use 2 */ #define cr_endcopy cr_label struct label *cr_label; /* MAC label */ - struct auditinfo_addr cr_audit; /* Audit properties. */ gid_t *cr_groups; /* groups */ int cr_agroups; /* Available groups */ gid_t cr_smallgroups[XU_NGROUPS]; /* storage for small groups */ From owner-svn-src-head@freebsd.org Sat Nov 14 19:20:58 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EFD204630E0; Sat, 14 Nov 2020 19:20:58 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CYQDB6YJgz3qGM; Sat, 14 Nov 2020 19:20:58 +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 D3F8A70D7; Sat, 14 Nov 2020 19:20:58 +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 0AEJKwKZ052067; Sat, 14 Nov 2020 19:20:58 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AEJKwjD052066; Sat, 14 Nov 2020 19:20:58 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011141920.0AEJKwjD052066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 14 Nov 2020 19:20:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367693 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 367693 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 19:20:59 -0000 Author: mjg Date: Sat Nov 14 19:20:58 2020 New Revision: 367693 URL: https://svnweb.freebsd.org/changeset/base/367693 Log: thread: rework tid batch to use helpers Modified: head/sys/kern/kern_thread.c Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Sat Nov 14 19:20:37 2020 (r367692) +++ head/sys/kern/kern_thread.c Sat Nov 14 19:20:58 2020 (r367693) @@ -259,6 +259,54 @@ tid_free_batch(lwpid_t *batch, int n) } /* + * Batching for thread reapping. + */ +struct tidbatch { + lwpid_t tab[16]; + int n; +}; + +static void +tidbatch_prep(struct tidbatch *tb) +{ + + tb->n = 0; +} + +static void +tidbatch_add(struct tidbatch *tb, struct thread *td) +{ + + KASSERT(tb->n < nitems(tb->tab), + ("%s: count too high %d", __func__, tb->n)); + tb->tab[tb->n] = td->td_tid; + tb->n++; +} + +static void +tidbatch_process(struct tidbatch *tb) +{ + + KASSERT(tb->n <= nitems(tb->tab), + ("%s: count too high %d", __func__, tb->n)); + if (tb->n == nitems(tb->tab)) { + tid_free_batch(tb->tab, tb->n); + tb->n = 0; + } +} + +static void +tidbatch_final(struct tidbatch *tb) +{ + + KASSERT(tb->n <= nitems(tb->tab), + ("%s: count too high %d", __func__, tb->n)); + if (tb->n != 0) { + tid_free_batch(tb->tab, tb->n); + } +} + +/* * Prepare a thread for use. */ static int @@ -487,8 +535,8 @@ void thread_reap(void) { struct thread *itd, *ntd; - lwpid_t tidbatch[16]; - int tidbatchn; + struct tidbatch tidbatch; + int tdcount; /* * Reading upfront is pessimal if followed by concurrent atomic_swap, @@ -499,24 +547,29 @@ thread_reap(void) itd = (struct thread *)atomic_swap_ptr((uintptr_t *)&thread_zombies, (uintptr_t)NULL); - tidbatchn = 0; + if (itd == NULL) + return; + + tidbatch_prep(&tidbatch); + tdcount = 0; while (itd != NULL) { ntd = itd->td_zombie; - tidbatch[tidbatchn] = itd->td_tid; - tidbatchn++; + EVENTHANDLER_DIRECT_INVOKE(thread_dtor, itd); + tidbatch_add(&tidbatch, itd); thread_cow_free(itd); thread_free_batched(itd); - if (tidbatchn == nitems(tidbatch)) { - tid_free_batch(tidbatch, tidbatchn); - thread_count_sub(tidbatchn); - tidbatchn = 0; + tidbatch_process(&tidbatch); + tdcount++; + if (tdcount == 32) { + thread_count_sub(tdcount); + tdcount = 0; } itd = ntd; } - if (tidbatchn != 0) { - tid_free_batch(tidbatch, tidbatchn); - thread_count_sub(tidbatchn); + tidbatch_final(&tidbatch); + if (tdcount != 0) { + thread_count_sub(tdcount); } } @@ -567,7 +620,6 @@ static void thread_free_batched(struct thread *td) { - EVENTHANDLER_DIRECT_INVOKE(thread_dtor, td); lock_profile_thread_exit(td); if (td->td_cpuset) cpuset_rel(td->td_cpuset); @@ -588,6 +640,7 @@ thread_free(struct thread *td) { lwpid_t tid; + EVENTHANDLER_DIRECT_INVOKE(thread_dtor, td); tid = td->td_tid; thread_free_batched(td); tid_free(tid); From owner-svn-src-head@freebsd.org Sat Nov 14 19:21:47 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4F5F5463680; Sat, 14 Nov 2020 19:21:47 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CYQF71rDTz3qbQ; Sat, 14 Nov 2020 19:21:47 +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 3245671BD; Sat, 14 Nov 2020 19:21:47 +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 0AEJLlbL055912; Sat, 14 Nov 2020 19:21:47 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AEJLkAu055910; Sat, 14 Nov 2020 19:21:46 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011141921.0AEJLkAu055910@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 14 Nov 2020 19:21:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367694 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 367694 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 19:21:47 -0000 Author: mjg Date: Sat Nov 14 19:21:46 2020 New Revision: 367694 URL: https://svnweb.freebsd.org/changeset/base/367694 Log: thread: batch resource limit free calls Modified: head/sys/kern/kern_resource.c head/sys/kern/kern_thread.c head/sys/sys/resourcevar.h Modified: head/sys/kern/kern_resource.c ============================================================================== --- head/sys/kern/kern_resource.c Sat Nov 14 19:20:58 2020 (r367693) +++ head/sys/kern/kern_resource.c Sat Nov 14 19:21:46 2020 (r367694) @@ -1236,6 +1236,14 @@ lim_free(struct plimit *limp) free((void *)limp, M_PLIMIT); } +void +lim_freen(struct plimit *limp, int n) +{ + + if (refcount_releasen(&limp->pl_refcnt, n)) + free((void *)limp, M_PLIMIT); +} + /* * Make a copy of the plimit structure. * We share these structures copy-on-write after fork. Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Sat Nov 14 19:20:58 2020 (r367693) +++ head/sys/kern/kern_thread.c Sat Nov 14 19:21:46 2020 (r367694) @@ -537,6 +537,8 @@ thread_reap(void) struct thread *itd, *ntd; struct tidbatch tidbatch; int tdcount; + struct plimit *lim; + int limcount; /* * Reading upfront is pessimal if followed by concurrent atomic_swap, @@ -552,11 +554,23 @@ thread_reap(void) tidbatch_prep(&tidbatch); tdcount = 0; + lim = NULL; + limcount = 0; while (itd != NULL) { ntd = itd->td_zombie; EVENTHANDLER_DIRECT_INVOKE(thread_dtor, itd); tidbatch_add(&tidbatch, itd); - thread_cow_free(itd); + MPASS(itd->td_realucred != NULL); + crcowfree(itd); + MPASS(itd->td_limit != NULL); + if (lim != itd->td_limit) { + if (limcount != 0) { + lim_freen(lim, limcount); + limcount = 0; + } + } + lim = itd->td_limit; + limcount++; thread_free_batched(itd); tidbatch_process(&tidbatch); tdcount++; @@ -571,6 +585,8 @@ thread_reap(void) if (tdcount != 0) { thread_count_sub(tdcount); } + MPASS(limcount != 0); + lim_freen(lim, limcount); } /* Modified: head/sys/sys/resourcevar.h ============================================================================== --- head/sys/sys/resourcevar.h Sat Nov 14 19:20:58 2020 (r367693) +++ head/sys/sys/resourcevar.h Sat Nov 14 19:21:46 2020 (r367694) @@ -145,6 +145,7 @@ rlim_t lim_cur(struct thread *td, int which); rlim_t lim_cur_proc(struct proc *p, int which); void lim_fork(struct proc *p1, struct proc *p2); void lim_free(struct plimit *limp); +void lim_freen(struct plimit *limp, int n); struct plimit *lim_hold(struct plimit *limp); rlim_t lim_max(struct thread *td, int which); From owner-svn-src-head@freebsd.org Sat Nov 14 19:22:03 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 691454635BE; Sat, 14 Nov 2020 19:22:03 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CYQFR0kBvz3qhw; Sat, 14 Nov 2020 19:22:03 +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 08A9571BF; Sat, 14 Nov 2020 19:22:03 +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 0AEJM2be055998; Sat, 14 Nov 2020 19:22:02 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AEJM2ld055995; Sat, 14 Nov 2020 19:22:02 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011141922.0AEJM2ld055995@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 14 Nov 2020 19:22:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367695 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 367695 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 19:22:03 -0000 Author: mjg Date: Sat Nov 14 19:22:02 2020 New Revision: 367695 URL: https://svnweb.freebsd.org/changeset/base/367695 Log: thread: batch credential freeing Modified: head/sys/kern/kern_prot.c head/sys/kern/kern_thread.c head/sys/sys/ucred.h Modified: head/sys/kern/kern_prot.c ============================================================================== --- head/sys/kern/kern_prot.c Sat Nov 14 19:21:46 2020 (r367694) +++ head/sys/kern/kern_prot.c Sat Nov 14 19:22:02 2020 (r367695) @@ -86,6 +86,7 @@ static MALLOC_DEFINE(M_CRED, "cred", "credentials"); SYSCTL_NODE(_security, OID_AUTO, bsd, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "BSD security policy"); +static void crfree_final(struct ucred *cr); static void crsetgroups_locked(struct ucred *cr, int ngrp, gid_t *groups); @@ -1902,6 +1903,31 @@ crunuse(struct thread *td) return (crold); } +static void +crunusebatch(struct ucred *cr, int users, int ref) +{ + + KASSERT(users > 0, ("%s: passed users %d not > 0 ; cred %p", + __func__, users, cr)); + mtx_lock(&cr->cr_mtx); + KASSERT(cr->cr_users >= users, ("%s: users %d not > %d on cred %p", + __func__, cr->cr_users, users, cr)); + cr->cr_users -= users; + cr->cr_ref += ref; + cr->cr_ref -= users; + if (cr->cr_users > 0) { + mtx_unlock(&cr->cr_mtx); + return; + } + KASSERT(cr->cr_ref >= 0, ("%s: ref %d not >= 0 on cred %p", + __func__, cr->cr_ref, cr)); + if (cr->cr_ref > 0) { + mtx_unlock(&cr->cr_mtx); + return; + } + crfree_final(cr); +} + void crcowfree(struct thread *td) { @@ -1935,6 +1961,44 @@ crcowsync(void) } /* + * Batching. + */ +void +credbatch_add(struct credbatch *crb, struct thread *td) +{ + struct ucred *cr; + + MPASS(td->td_realucred != NULL); + MPASS(td->td_realucred == td->td_ucred); + MPASS(td->td_state == TDS_INACTIVE); + cr = td->td_realucred; + KASSERT(cr->cr_users > 0, ("%s: users %d not > 0 on cred %p", + __func__, cr->cr_users, cr)); + if (crb->cred != cr) { + if (crb->users > 0) { + MPASS(crb->cred != NULL); + crunusebatch(crb->cred, crb->users, crb->ref); + crb->users = 0; + crb->ref = 0; + } + } + crb->cred = cr; + crb->users++; + crb->ref += td->td_ucredref; + td->td_ucredref = 0; + td->td_realucred = NULL; +} + +void +credbatch_final(struct credbatch *crb) +{ + + MPASS(crb->cred != NULL); + MPASS(crb->users > 0); + crunusebatch(crb->cred, crb->users, crb->ref); +} + +/* * Allocate a zeroed cred structure. */ struct ucred * @@ -2007,6 +2071,17 @@ crfree(struct ucred *cr) mtx_unlock(&cr->cr_mtx); return; } + crfree_final(cr); +} + +static void +crfree_final(struct ucred *cr) +{ + + KASSERT(cr->cr_users == 0, ("%s: users %d not == 0 on cred %p", + __func__, cr->cr_users, cr)); + KASSERT(cr->cr_ref == 0, ("%s: ref %d not == 0 on cred %p", + __func__, cr->cr_ref, cr)); /* * Some callers of crget(), such as nfs_statfs(), allocate a temporary * credential, but don't allocate a uidinfo structure. Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Sat Nov 14 19:21:46 2020 (r367694) +++ head/sys/kern/kern_thread.c Sat Nov 14 19:22:02 2020 (r367695) @@ -536,6 +536,7 @@ thread_reap(void) { struct thread *itd, *ntd; struct tidbatch tidbatch; + struct credbatch credbatch; int tdcount; struct plimit *lim; int limcount; @@ -553,6 +554,7 @@ thread_reap(void) return; tidbatch_prep(&tidbatch); + credbatch_prep(&credbatch); tdcount = 0; lim = NULL; limcount = 0; @@ -560,8 +562,7 @@ thread_reap(void) ntd = itd->td_zombie; EVENTHANDLER_DIRECT_INVOKE(thread_dtor, itd); tidbatch_add(&tidbatch, itd); - MPASS(itd->td_realucred != NULL); - crcowfree(itd); + credbatch_add(&credbatch, itd); MPASS(itd->td_limit != NULL); if (lim != itd->td_limit) { if (limcount != 0) { @@ -573,6 +574,7 @@ thread_reap(void) limcount++; thread_free_batched(itd); tidbatch_process(&tidbatch); + credbatch_process(&credbatch); tdcount++; if (tdcount == 32) { thread_count_sub(tdcount); @@ -582,6 +584,7 @@ thread_reap(void) } tidbatch_final(&tidbatch); + credbatch_final(&credbatch); if (tdcount != 0) { thread_count_sub(tdcount); } Modified: head/sys/sys/ucred.h ============================================================================== --- head/sys/sys/ucred.h Sat Nov 14 19:21:46 2020 (r367694) +++ head/sys/sys/ucred.h Sat Nov 14 19:22:02 2020 (r367695) @@ -114,6 +114,28 @@ struct xucred { struct proc; struct thread; +struct credbatch { + struct ucred *cred; + int users; + int ref; +}; + +static inline void +credbatch_prep(struct credbatch *crb) +{ + crb->cred = NULL; + crb->users = 0; + crb->ref = 0; +} +void credbatch_add(struct credbatch *crb, struct thread *td); +static inline void +credbatch_process(struct credbatch *crb) +{ + +} +void credbatch_add(struct credbatch *crb, struct thread *td); +void credbatch_final(struct credbatch *crb); + void change_egid(struct ucred *newcred, gid_t egid); void change_euid(struct ucred *newcred, struct uidinfo *euip); void change_rgid(struct ucred *newcred, gid_t rgid); From owner-svn-src-head@freebsd.org Sat Nov 14 19:23:08 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2EB7D463949; Sat, 14 Nov 2020 19:23:08 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CYQGh05blz3rB1; Sat, 14 Nov 2020 19:23:08 +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 EA62F6FC6; Sat, 14 Nov 2020 19:23:07 +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 0AEJN7Po056086; Sat, 14 Nov 2020 19:23:07 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AEJN7cR056085; Sat, 14 Nov 2020 19:23:07 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011141923.0AEJN7cR056085@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 14 Nov 2020 19:23:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367696 - head/sys/contrib/openzfs/module/zfs X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/contrib/openzfs/module/zfs X-SVN-Commit-Revision: 367696 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 19:23:08 -0000 Author: mjg Date: Sat Nov 14 19:23:07 2020 New Revision: 367696 URL: https://svnweb.freebsd.org/changeset/base/367696 Log: zfs: disable periodic arc updates They are only there to provide less innacurate statistics for debuggers. However, this is quite heavy-weight and instead it would be better to teach debuggers how to obtain the necessary information. Modified: head/sys/contrib/openzfs/module/zfs/arc.c Modified: head/sys/contrib/openzfs/module/zfs/arc.c ============================================================================== --- head/sys/contrib/openzfs/module/zfs/arc.c Sat Nov 14 19:22:02 2020 (r367695) +++ head/sys/contrib/openzfs/module/zfs/arc.c Sat Nov 14 19:23:07 2020 (r367696) @@ -4791,8 +4791,10 @@ arc_evict_cb_check(void *arg, zthr_t *zthr) * arc_state_t structures can be queried directly if more * accurate information is needed. */ +#ifndef __FreeBSD__ if (arc_ksp != NULL) arc_ksp->ks_update(arc_ksp, KSTAT_READ); +#endif /* * We have to rely on arc_wait_for_eviction() to tell us when to From owner-svn-src-head@freebsd.org Sat Nov 14 19:46:49 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 94A3F46450A for ; Sat, 14 Nov 2020 19:46:49 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CYQp13kH9z3sWQ for ; Sat, 14 Nov 2020 19:46:49 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f46.google.com with SMTP id p1so14041560wrf.12 for ; Sat, 14 Nov 2020 11:46:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=TeNoyh/2104eFInfXfDmq5j3kbbfh06nP0nExtIvrwg=; b=dg6sKvECutpVaZvBAAk0LwHwQf8rsO0JKdugUG7EIr1x1slp/r7tUuwcf/wFfqQ/YY RTI59WJK9lzPcvUFN3gP/Q5S6S0VXQeKJ7FfiHaUYq2FFloKIy+i1lgyDRQaIbwkplXL xhY0kWQ1VClRs28gY17e/8XVGD87v0U2TOl9zcARtWXZ7BzJYVHrjRhEyaCcof24mkl2 8hqRCqtObKq+csjZOAem/vAZdmeYOgu/ixuhYII4dbITCWOEwrud6uP3Y+fik0j4JREH zKdsjW/+Ip1lSg7LqbSGXFqY+fxVGcJQ1JFFbdKUtqx539EQGT+5+o4zBQVTi2EUyMy0 D9YA== X-Gm-Message-State: AOAM531bXrNH/gcW/23GNNJiHIdSxLD8NnFjitjbZe/LEIXAjWw/eE3c UwaYYNFHUkHx+RBPv4Fp7nOT+g== X-Google-Smtp-Source: ABdhPJyfboKt6QBFzs88UzFxB0M0QfvSX8gFjnDjClf0gfUlhQ7e1fFYIyB9UPYKw31ART8C0wgvrQ== X-Received: by 2002:adf:bb92:: with SMTP id q18mr10667756wrg.315.1605383207848; Sat, 14 Nov 2020 11:46:47 -0800 (PST) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id q16sm15992287wrn.13.2020.11.14.11.46.46 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 14 Nov 2020 11:46:46 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: svn commit: r367689 - head/lib/libutil From: Jessica Clarke In-Reply-To: <202011141904.0AEJ4bXA043999@repo.freebsd.org> Date: Sat, 14 Nov 2020 19:46:45 +0000 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: References: <202011141904.0AEJ4bXA043999@repo.freebsd.org> To: Scott Long X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Rspamd-Queue-Id: 4CYQp13kH9z3sWQ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 19:46:49 -0000 On 14 Nov 2020, at 19:04, Scott Long wrote: > @@ -66,10 +67,16 @@ getlocalbase(char *path, size_t pathlen) > #endif > > tmplen = strlcpy(path, tmppath, pathlen); > - if ((tmplen < 0) || (tmplen >= (ssize_t)pathlen)) { > + if ((tmplen < 0) || (tmplen >= pathlen)) { I'd expect the LHS to give a compiler warning still. Jess From owner-svn-src-head@freebsd.org Sat Nov 14 19:56:12 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6A05A4647E6; Sat, 14 Nov 2020 19:56:12 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CYR0r2ZnRz3smp; Sat, 14 Nov 2020 19:56:12 +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 4BD577577; Sat, 14 Nov 2020 19:56:12 +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 0AEJuCbA075944; Sat, 14 Nov 2020 19:56:12 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AEJuCqe075943; Sat, 14 Nov 2020 19:56:12 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011141956.0AEJuCqe075943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 14 Nov 2020 19:56:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367697 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 367697 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 19:56:12 -0000 Author: mjg Date: Sat Nov 14 19:56:11 2020 New Revision: 367697 URL: https://svnweb.freebsd.org/changeset/base/367697 Log: cred: annotate credbatch_process argument as unused Fixes libprocstat compilation as zfs defines _KERNEL. Modified: head/sys/sys/ucred.h Modified: head/sys/sys/ucred.h ============================================================================== --- head/sys/sys/ucred.h Sat Nov 14 19:23:07 2020 (r367696) +++ head/sys/sys/ucred.h Sat Nov 14 19:56:11 2020 (r367697) @@ -129,7 +129,7 @@ credbatch_prep(struct credbatch *crb) } void credbatch_add(struct credbatch *crb, struct thread *td); static inline void -credbatch_process(struct credbatch *crb) +credbatch_process(struct credbatch *crb __unused) { } From owner-svn-src-head@freebsd.org Sat Nov 14 20:50:39 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3047246554D for ; Sat, 14 Nov 2020 20:50:39 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CYSCf6jwPz3wPn for ; Sat, 14 Nov 2020 20:50:38 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt1-x82e.google.com with SMTP id z3so6323476qtw.9 for ; Sat, 14 Nov 2020 12:50:38 -0800 (PST) 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; bh=Kkcn/Hpq9tGhRPJZx/mASkhxRH/Q+4wQ2Ut0a7dH6TY=; b=QvJu5QFD7fTBHl1yT1gaxEERid2ElXzIO9dVYYC1ftYiXr0w2HOTI0+Vmo/kZgpPKq rppsRPf8KKWT+lpu5r9OV9Uq7sF8Sn4o1J14o6oUxMRvp/xFkqYH/ExnZmZqvopR7K6Y vuHnE+RmiSLulRyi5xusglUkc/Kz7dDMGm0/wKUDspLBWfP6VfDzXx8UO4h35wfD1ebp +5lSkFWK71eBB1073RxqiqpdXa2DlJuPN9zX8JWUrmLCL81LZuZFEqxJfn8Z5ZoxJVtc ufvRI6pHZWm5o8yOKqXkkpXwjwnhW5o+fOYGFKkHhDofbbxFlWlezgUvWVkfw5Mj+QAm HdMQ== 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; bh=Kkcn/Hpq9tGhRPJZx/mASkhxRH/Q+4wQ2Ut0a7dH6TY=; b=lU5Woj9e7Taw4BdC5IhL0mE8e1hQv8IDJjg59J92rYcy33vhNaXlsASulyD7lCtM3m CWGKOVc/Jo0AFuMR1/U8Yf34ih2XLzyZ+TyW2CNEN4lDF4UVyDU8uNFgm9y3dpngd+b4 UKqxkGY18f5J/jHgsP/oYZPgj81dZC2S8dwnuAGdfKDruzruGjGG+rWULy4IJIB4cuso pNcKEvYvHNHicwwGOeR2jNfkg4nMrWkZugu0zBhZqIW3O//LJ4VbtvvT3V4D79laf0Q1 g87i0UXArOso2qic04Mxuohpq6hwbI1iPizvLa7nZO/yeYhK+jtJxtl4bpTZz3N8WuO8 YXTQ== X-Gm-Message-State: AOAM533DmmNIGMN4dvs3h7HuIePWIIUxFPnfjlNQveFvPvwXfbch3R3f PDsijZ2MQwG5t8JQ2tq+uhktxzdVmbgR37Vr X-Google-Smtp-Source: ABdhPJzwotN/Qllc6Prb6VsblnK0Z7pb4CtaZRL1eJnbuSHbExCkgj2xdCMk4r5xxYK9I0n38VPTWA== X-Received: by 2002:a05:622a:50:: with SMTP id y16mr7899007qtw.119.1605387037919; Sat, 14 Nov 2020 12:50:37 -0800 (PST) Received: from mutt-hbsd (pool-100-16-222-53.bltmmd.fios.verizon.net. [100.16.222.53]) by smtp.gmail.com with ESMTPSA id z16sm9988581qka.18.2020.11.14.12.50.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Nov 2020 12:50:37 -0800 (PST) Date: Sat, 14 Nov 2020 15:50:36 -0500 From: Shawn Webb To: Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r367692 - head/sys/sys Message-ID: <20201114205036.tnxvwarsddmu4shz@mutt-hbsd> X-Operating-System: FreeBSD mutt-hbsd 13.0-CURRENT-HBSD FreeBSD 13.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0xFF2E67A277F8E1FA References: <202011141920.0AEJKbpO050396@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6hglt7f3pnphonso" Content-Disposition: inline In-Reply-To: <202011141920.0AEJKbpO050396@repo.freebsd.org> X-Rspamd-Queue-Id: 4CYSCf6jwPz3wPn X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 20:50:39 -0000 --6hglt7f3pnphonso Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Nov 14, 2020 at 07:20:37PM +0000, Mateusz Guzik wrote: > Author: mjg > Date: Sat Nov 14 19:20:37 2020 > New Revision: 367692 > URL: https://svnweb.freebsd.org/changeset/base/367692 >=20 > Log: > cred: reorder cr_audit to be closer to the lock > =20 > This makes cr_uid avoid sharing. >=20 > Modified: > head/sys/sys/ucred.h >=20 > Modified: head/sys/sys/ucred.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/sys/ucred.h Sat Nov 14 19:19:27 2020 (r367691) > +++ head/sys/sys/ucred.h Sat Nov 14 19:20:37 2020 (r367692) > @@ -63,6 +63,7 @@ struct ucred { > struct mtx cr_mtx; > u_int cr_ref; /* (c) reference count */ > u_int cr_users; /* (c) proc + thread using this cred */ > + struct auditinfo_addr cr_audit; /* Audit properties. */ > #define cr_startcopy cr_uid > uid_t cr_uid; /* effective user id */ > uid_t cr_ruid; /* real user id */ > @@ -78,7 +79,6 @@ struct ucred { > void *cr_pspare2[2]; /* general use 2 */ > #define cr_endcopy cr_label > struct label *cr_label; /* MAC label */ > - struct auditinfo_addr cr_audit; /* Audit properties. */ > gid_t *cr_groups; /* groups */ > int cr_agroups; /* Available groups */ > gid_t cr_smallgroups[XU_NGROUPS]; /* storage for small groups */ Hey Mateusz, Since this changes KBI, does __FreeBSD_version need bumping? Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD GPG Key ID: 0xFF2E67A277F8E1FA GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9 3633 C85B 0AF8 AB23 0FB2 https://git-01.md.hardenedbsd.org/HardenedBSD/pubkeys/src/branch/master/Sha= wn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --6hglt7f3pnphonso Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAl+wQxkACgkQ/y5nonf4 4fqmvw/+LqkXst4/4+Gu+hoTF4T05ao+JGmx/RG6xHteFNhIYR2Y63VSscIv+kHT 8tSus5N6WrSgdaN2nwxpv/dYxR6Z8CEM+5OjFEwoEqaWugu6rWxLAyhDrPkNkKvT bka4vAvZPiHxfQqwWuE7aMoWd+4O9LFl8WSLc7zLIe9rQsjr2E5woHldG8u/mheF tw1kle1JK8hIzy5Qfi62FUvEtIhpI4Vo60wXeUV8iXnUHUEC6L4umeY447blLkKp kqyvP7BUjMB5bgZVvNpzgKQ+Lx3zDpl1SVcJznN069OQm1xzGs+Ob5gam75eG5at BqzJRB0cD0snH5dQBqhiij3cd4L8/B5p/OK+klqEgOWfIryDVH0C1uiH0eXzZPZR 9Zawk5hIV2LevbHzuWiM/Fg98dpyOEjvRPc5bs7L1w5mqC5l7X3lzZEXOeaUa/HW ZJoje5ocYEST1wlDkrJ8JFw/rTrNxDA7Rm/5kPTZv8sBzhXNC+1ZELUf129BUktc jNcmxwdqlt/CAU2vuz49A+R0yOESEY50gy6K3GDai/gF+jKNJ0DLUlvdLsWUT4zm Zmn98N3cNVPSPkHKXJbJVxr3bamYRK23w2S/NFuxMWug1R4oYNs4oimSFxL69bXF /Y2XdCX92S7N8EiepAGG0j3QdMCJZUhKi/fXU6CdMtkzJhyMv2I= =zV3q -----END PGP SIGNATURE----- --6hglt7f3pnphonso-- From owner-svn-src-head@freebsd.org Sat Nov 14 20:51:49 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CC02346555A; Sat, 14 Nov 2020 20:51:49 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CYSF13xpzz3wTf; Sat, 14 Nov 2020 20:51:49 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm1-x32b.google.com with SMTP id c9so19886430wml.5; Sat, 14 Nov 2020 12:51:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=aGS5h+muelvCzVcowv/2gUEgz4sdzZAKtEBYcdHxDxc=; b=XKbF0t8OLHfsjTwvo/fJ6eVDdarAYJvbIOxVnT2U0oHBEgS5f2hi3ChKqhR/vExoMm iSpYAmEopGlDcsA6PC1GhmU6heM4uFrmTgRgBj3z10K4IVljUUDtHoUACM7EIl0LDocJ 6YD/MT9IeKqrlrZ9O9D4knxdyZEjee3R/ODGkzghRwt0lC0vf5QMYRHVZ6mCvnHYFlQG kcCvdke+Na8CzX41JezVxqGxIdpj3UoGZegxa9ySwJfdgiVkkoeF0tKdmJ14lADItAga 4F6oOfsuQRAFXxOpPn9voB6AT3u+UICvNTfnPlfIgN+2kqF7tLreLqfXDfBjlLm8Hugd yGqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=aGS5h+muelvCzVcowv/2gUEgz4sdzZAKtEBYcdHxDxc=; b=HCvPONQmLgj4VSRlrvQ9YDGRu/i1gGhWbEXbCMCQnxLroU725XoC375yErm8yM8NCE hVScgDv7xbbkr1udka/BG5K11yu0a+Jnb5VtZYAErzkhu2eVJa2TQHaKFtPSlx+RxKxg TKdZVFQ21D6JQJAcjr+9C0rILuyyKfBgqCeM9ftmiIvS0vVaOqcYLAoLniP4W8Hsu5+n P6/Hv9Ob5XNuEyCytkeXfcr1IDCed3XhgHsJUZYfteydbVZ8O0os2adc4Raux8ol6n9d PGjsEnIWfQw63zfgduAXYDDLFHWUz8p/EeiGGW9EYWEx+IvmWiCD7TXF4jcYGebBR0Qy +N+A== X-Gm-Message-State: AOAM533h8sU0mEeFXYSblHIn26y6Cg2VoKUOV3m9TWOtuOm9JRbwbzLQ HeSufp9VH6eRjhk0LQpxeSIjVE2ycgxkbqZzEZb6TCMxC08= X-Google-Smtp-Source: ABdhPJwDpOhnmmd6YTKhSDzh7G9YHSFzqROdfKJ6zpN/yiEVn4EXmOIhyJ7olGoyCuxoSmVmMayATtgScCw/oMthZZ0= X-Received: by 2002:a05:600c:290a:: with SMTP id i10mr8274302wmd.187.1605387107840; Sat, 14 Nov 2020 12:51:47 -0800 (PST) MIME-Version: 1.0 Received: by 2002:adf:dec7:0:0:0:0:0 with HTTP; Sat, 14 Nov 2020 12:51:47 -0800 (PST) In-Reply-To: <20201114205036.tnxvwarsddmu4shz@mutt-hbsd> References: <202011141920.0AEJKbpO050396@repo.freebsd.org> <20201114205036.tnxvwarsddmu4shz@mutt-hbsd> From: Mateusz Guzik Date: Sat, 14 Nov 2020 21:51:47 +0100 Message-ID: Subject: Re: svn commit: r367692 - head/sys/sys To: Shawn Webb Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4CYSF13xpzz3wTf X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 20:51:49 -0000 I don't think so, it does not change any APIs On 11/14/20, Shawn Webb wrote: > On Sat, Nov 14, 2020 at 07:20:37PM +0000, Mateusz Guzik wrote: >> Author: mjg >> Date: Sat Nov 14 19:20:37 2020 >> New Revision: 367692 >> URL: https://svnweb.freebsd.org/changeset/base/367692 >> >> Log: >> cred: reorder cr_audit to be closer to the lock >> >> This makes cr_uid avoid sharing. >> >> Modified: >> head/sys/sys/ucred.h >> >> Modified: head/sys/sys/ucred.h >> ============================================================================== >> --- head/sys/sys/ucred.h Sat Nov 14 19:19:27 2020 (r367691) >> +++ head/sys/sys/ucred.h Sat Nov 14 19:20:37 2020 (r367692) >> @@ -63,6 +63,7 @@ struct ucred { >> struct mtx cr_mtx; >> u_int cr_ref; /* (c) reference count */ >> u_int cr_users; /* (c) proc + thread using this cred */ >> + struct auditinfo_addr cr_audit; /* Audit properties. */ >> #define cr_startcopy cr_uid >> uid_t cr_uid; /* effective user id */ >> uid_t cr_ruid; /* real user id */ >> @@ -78,7 +79,6 @@ struct ucred { >> void *cr_pspare2[2]; /* general use 2 */ >> #define cr_endcopy cr_label >> struct label *cr_label; /* MAC label */ >> - struct auditinfo_addr cr_audit; /* Audit properties. */ >> gid_t *cr_groups; /* groups */ >> int cr_agroups; /* Available groups */ >> gid_t cr_smallgroups[XU_NGROUPS]; /* storage for small groups */ > > Hey Mateusz, > > Since this changes KBI, does __FreeBSD_version need bumping? > > Thanks, > > -- > Shawn Webb > Cofounder / Security Engineer > HardenedBSD > > GPG Key ID: 0xFF2E67A277F8E1FA > GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9 3633 C85B 0AF8 AB23 0FB2 > https://git-01.md.hardenedbsd.org/HardenedBSD/pubkeys/src/branch/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc > -- Mateusz Guzik From owner-svn-src-head@freebsd.org Sat Nov 14 20:53:57 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CADE34657D3 for ; Sat, 14 Nov 2020 20:53:57 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt1-x835.google.com (mail-qt1-x835.google.com [IPv6:2607:f8b0:4864:20::835]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CYSHT58pWz3wM3 for ; Sat, 14 Nov 2020 20:53:57 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt1-x835.google.com with SMTP id 7so9947145qtp.1 for ; Sat, 14 Nov 2020 12:53:57 -0800 (PST) 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; bh=MI3KjUtXdLjBSnhZZnvEFEiFny91tgEvL+ju4y03RQY=; b=JmIOOf4Skwx+x7oZVJ+8H0TB6049GhITcFfGDpIaN54lpFLPB3HeTuYSm57lT6OEvd 4Zl3SzH6hJu27TmqKfk8J6lGlkJKSYWNXpf4A4TPqe6e6YMYnSNB12HdksjBGBcfuLB0 NoJSRcik+JimidCYBFucubTtitREHoZQGoqVnm7vACcXrdRicwn2HOcCqiff8Q2C3ZGz 7V5WjTrnG+BUb93WZVPdM4f0Tf0D+UDP6pWyOr2A0kv8JYjeZjdTZVVF35F9puwl7KOi xw7byn7pZbA2KJr28kXWsgUNImO+cOBU6xfXNLEuYjmAnelCIIs9B3QIvvkIIRa4y63z U59Q== 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; bh=MI3KjUtXdLjBSnhZZnvEFEiFny91tgEvL+ju4y03RQY=; b=kGg3n0KPHZTOKAw23w4UAxcS6zOqV/aglW+qByfLiVAWOcpqwng0mIEKHQtgUQNwJ6 Hekz12HvPhkA897EN5CSFHOYR0CV3YG7d6mXSNoFBDVUAJ5ovIO3Hi6HiVW/V/806fzV J7gvKU//txF4li1A7ZAA/D/GgK1+8Dhq+GKYVeNZ67AiCl0EJWQle3Ja7m2YaXPtI1Qa xcjixoacIlokRgVcANlk0Z29v9k2nhf9RPTCMI/BKroHzl9xfj/Stw/Dm4ol9qghB6L0 1nl33zTthS+MKpjO+zwglGGHEGNL3E7jO+zQvA/xZRIuR80tDn2v0t16r8TzRDM4O6fR ze8Q== X-Gm-Message-State: AOAM531ztD0VWLvcjKfxZpHXD+R6dPitZBwot2efn0pzn+vrUmUgjXyI Lj/PxtUZvZzPjdcK1u4PeNKeePzJCaR3y4bs X-Google-Smtp-Source: ABdhPJxgfxmetiuOdIj4uNRoyKHR3TVSTiQ7dAahrDzACjUn484upfT3hZXku9+RxBeg94YMICFViA== X-Received: by 2002:ac8:2fa2:: with SMTP id l31mr7793082qta.86.1605387236883; Sat, 14 Nov 2020 12:53:56 -0800 (PST) Received: from mutt-hbsd (pool-100-16-222-53.bltmmd.fios.verizon.net. [100.16.222.53]) by smtp.gmail.com with ESMTPSA id x71sm3696108qka.71.2020.11.14.12.53.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Nov 2020 12:53:56 -0800 (PST) Date: Sat, 14 Nov 2020 15:53:55 -0500 From: Shawn Webb To: Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r367692 - head/sys/sys Message-ID: <20201114205355.j2ejnhouipjr6yhk@mutt-hbsd> X-Operating-System: FreeBSD mutt-hbsd 13.0-CURRENT-HBSD FreeBSD 13.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0xFF2E67A277F8E1FA References: <202011141920.0AEJKbpO050396@repo.freebsd.org> <20201114205036.tnxvwarsddmu4shz@mutt-hbsd> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="hlgimau7p42bbikt" Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4CYSHT58pWz3wM3 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 20:53:57 -0000 --hlgimau7p42bbikt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Are there any kernel modules (in base, in ports, or out-of-both-trees) that access struct ucred? On Sat, Nov 14, 2020 at 09:51:47PM +0100, Mateusz Guzik wrote: > I don't think so, it does not change any APIs >=20 > On 11/14/20, Shawn Webb wrote: > > On Sat, Nov 14, 2020 at 07:20:37PM +0000, Mateusz Guzik wrote: > >> Author: mjg > >> Date: Sat Nov 14 19:20:37 2020 > >> New Revision: 367692 > >> URL: https://svnweb.freebsd.org/changeset/base/367692 > >> > >> Log: > >> cred: reorder cr_audit to be closer to the lock > >> > >> This makes cr_uid avoid sharing. > >> > >> Modified: > >> head/sys/sys/ucred.h > >> > >> Modified: head/sys/sys/ucred.h > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/sys/ucred.h Sat Nov 14 19:19:27 2020 (r367691) > >> +++ head/sys/sys/ucred.h Sat Nov 14 19:20:37 2020 (r367692) > >> @@ -63,6 +63,7 @@ struct ucred { > >> struct mtx cr_mtx; > >> u_int cr_ref; /* (c) reference count */ > >> u_int cr_users; /* (c) proc + thread using this cred */ > >> + struct auditinfo_addr cr_audit; /* Audit properties. */ > >> #define cr_startcopy cr_uid > >> uid_t cr_uid; /* effective user id */ > >> uid_t cr_ruid; /* real user id */ > >> @@ -78,7 +79,6 @@ struct ucred { > >> void *cr_pspare2[2]; /* general use 2 */ > >> #define cr_endcopy cr_label > >> struct label *cr_label; /* MAC label */ > >> - struct auditinfo_addr cr_audit; /* Audit properties. */ > >> gid_t *cr_groups; /* groups */ > >> int cr_agroups; /* Available groups */ > >> gid_t cr_smallgroups[XU_NGROUPS]; /* storage for small groups */ > > > > Hey Mateusz, > > > > Since this changes KBI, does __FreeBSD_version need bumping? > > > > Thanks, > > > > -- > > Shawn Webb > > Cofounder / Security Engineer > > HardenedBSD > > > > GPG Key ID: 0xFF2E67A277F8E1FA > > GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9 3633 C85B 0AF8 AB23 0FB2 > > https://git-01.md.hardenedbsd.org/HardenedBSD/pubkeys/src/branch/master= /Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc > > >=20 >=20 > --=20 > Mateusz Guzik --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD GPG Key ID: 0xFF2E67A277F8E1FA GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9 3633 C85B 0AF8 AB23 0FB2 https://git-01.md.hardenedbsd.org/HardenedBSD/pubkeys/src/branch/master/Sha= wn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --hlgimau7p42bbikt Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAl+wQ+MACgkQ/y5nonf4 4foLOA//XUBGhKNLIdGAL8WAKKSqXimkpbehN+hL9yh5GbERMvnSiCBiumb+nFvL GrAw5Fmea4soSW4eZcZc4goRy9md5vy0e6BnMEt6MjM534RlWNDDDiwmN3gMlmFh Gw8MveFNqXwDaebeV5b3PCPCqKeMGV6aRjg8Vz4TGPBP+ClcN/FW99MAEsniERGV pJ3u1aGtoOPBgB5PaRLrUqylAFU8ol5aLi+rCk2buAZlKvjxHTMFS2C2Fskq+KeD LsHJmX9cWjktWCXjK8rhpbUGAbQxcviYy7627pNIzh1gXO6sM60Tw7wNDZpAgYF7 cZxgt1om69dLWjZCu9RULhFeNqkEAK6GNNI7VvVt3WMWfvjy3wOXTegmHXnwCfx1 eESkqJ+ufH86ZPs2tWPpso8mpf3tgN0b1uWa5p3JnTH4JWg19X8NNeSJQsh56SYD 986hFsNdrBdmDonwK0oDYbJUMShS2yUtfWNTuq/NBcjHiUPAObLyeNlC0LbD64YR vcfJBtpbsf26B2vqyBpqxqX6xJ2GFVItRWFSwRAGGoMKSIe1vkn8YbYyTKOvsPI4 ygYpfyDe9K5CXwkmyXbK8DivsmYiPDYzckSipekG3l58ikAs+aZTUtVpR6/NYRUU UlQVs4NmQNXeS/72GO9o8BNcZHQ5UkUKUyyo82m2XK81aA7691s= =pcKy -----END PGP SIGNATURE----- --hlgimau7p42bbikt-- From owner-svn-src-head@freebsd.org Sat Nov 14 20:57:50 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3DA46465AA0; Sat, 14 Nov 2020 20:57:50 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CYSMy11pwz4R4d; Sat, 14 Nov 2020 20:57:49 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wr1-x42a.google.com with SMTP id s8so14153282wrw.10; Sat, 14 Nov 2020 12:57:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=EM0MlLnv8yS0eqfznu3lZlFuTOinfp7AJWw/I7B6IM4=; b=ZHcKuXSOkMuSb6L6vm/9bulOkV1ryPKrwhRFqBj5JChfDLGol3s7Itciz0xESZeU0X OYn2RIaReQVUMcZbYvJqnltw2S+4UFDWRBPZvqbjzGxCkl2tPM86WGSy+Uf9SUo9B1mE 4lOYWoV3IZRXo4Czs4M21F7wbI4rBAFbg/T66xBxZLdfNd/q79eDIgeIBcY56Ef4A1i2 Zue2SWykNtHEyidCabWtAq0aQTVkDylvvRayaQHSeu/xTs54m4TnrQT+nWbH7t7E7KeI FpFvJuonNUWg4+DV12yw55MXqvkpTFifhfHF9nlZ2Pi6HQCapWrJYJiFeS1wZIUT0TxT VMsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=EM0MlLnv8yS0eqfznu3lZlFuTOinfp7AJWw/I7B6IM4=; b=Lk4gnVMOuALTRhZ2+zMGIWixV2VW0fzdm9+ZwR3ZemT7aF6kJ2ZMhjcqjMTpIHkDvQ dNsD+JU1zCom9g38/nw03TBwScmvIk1N5viWregazAk3Shf0zJcGjTbtbcWmhRKlJGtJ +bFwCRp6vAGvAaLkSVsZWVClhDV7tSN+h7SmkiKNcNxZxjpsEIh/Ic0MCnuNi4Ax9/zW RnbtGoC92TcgKTgU6jkbaazXodke3eQ4K8CWRTwPa2Y7o4WwHl2qHKb6QKErb0Ejn8la morZP0Jz/KrtTxZzRsTQm1Anvds1AnSzmyoT249Swe7VPuO0Pw2OFwg9M5Y9mEqj4ds/ gx/A== X-Gm-Message-State: AOAM531Lq81IDLrAjq4mNhAsm7EMMvIbuCbFRx6R8I5Y3AE+5UudpR13 UTkpZJEHIGItT/46x2azeK1w/uY9BfPbsfDVa5qkxM6rnuA= X-Google-Smtp-Source: ABdhPJwAKu8XMFrirXoTP6P7QvQb9fwl15Yfdp7ffeccdj2il2cYlTqoV60pCg1tGbGjixWhnZVyuQtXG2HH5a2hHuU= X-Received: by 2002:adf:9b98:: with SMTP id d24mr10923504wrc.17.1605387468725; Sat, 14 Nov 2020 12:57:48 -0800 (PST) MIME-Version: 1.0 Received: by 2002:adf:dec7:0:0:0:0:0 with HTTP; Sat, 14 Nov 2020 12:57:48 -0800 (PST) In-Reply-To: <20201114205355.j2ejnhouipjr6yhk@mutt-hbsd> References: <202011141920.0AEJKbpO050396@repo.freebsd.org> <20201114205036.tnxvwarsddmu4shz@mutt-hbsd> <20201114205355.j2ejnhouipjr6yhk@mutt-hbsd> From: Mateusz Guzik Date: Sat, 14 Nov 2020 21:57:48 +0100 Message-ID: Subject: Re: svn commit: r367692 - head/sys/sys To: Shawn Webb Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4CYSMy11pwz4R4d X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 20:57:50 -0000 you are expected to recompile all your kernel modules every time you update head On 11/14/20, Shawn Webb wrote: > Are there any kernel modules (in base, in ports, or out-of-both-trees) > that access struct ucred? > > On Sat, Nov 14, 2020 at 09:51:47PM +0100, Mateusz Guzik wrote: >> I don't think so, it does not change any APIs >> >> On 11/14/20, Shawn Webb wrote: >> > On Sat, Nov 14, 2020 at 07:20:37PM +0000, Mateusz Guzik wrote: >> >> Author: mjg >> >> Date: Sat Nov 14 19:20:37 2020 >> >> New Revision: 367692 >> >> URL: https://svnweb.freebsd.org/changeset/base/367692 >> >> >> >> Log: >> >> cred: reorder cr_audit to be closer to the lock >> >> >> >> This makes cr_uid avoid sharing. >> >> >> >> Modified: >> >> head/sys/sys/ucred.h >> >> >> >> Modified: head/sys/sys/ucred.h >> >> ============================================================================== >> >> --- head/sys/sys/ucred.h Sat Nov 14 19:19:27 2020 (r367691) >> >> +++ head/sys/sys/ucred.h Sat Nov 14 19:20:37 2020 (r367692) >> >> @@ -63,6 +63,7 @@ struct ucred { >> >> struct mtx cr_mtx; >> >> u_int cr_ref; /* (c) reference count */ >> >> u_int cr_users; /* (c) proc + thread using this cred */ >> >> + struct auditinfo_addr cr_audit; /* Audit properties. */ >> >> #define cr_startcopy cr_uid >> >> uid_t cr_uid; /* effective user id */ >> >> uid_t cr_ruid; /* real user id */ >> >> @@ -78,7 +79,6 @@ struct ucred { >> >> void *cr_pspare2[2]; /* general use 2 */ >> >> #define cr_endcopy cr_label >> >> struct label *cr_label; /* MAC label */ >> >> - struct auditinfo_addr cr_audit; /* Audit properties. */ >> >> gid_t *cr_groups; /* groups */ >> >> int cr_agroups; /* Available groups */ >> >> gid_t cr_smallgroups[XU_NGROUPS]; /* storage for small groups */ >> > >> > Hey Mateusz, >> > >> > Since this changes KBI, does __FreeBSD_version need bumping? >> > >> > Thanks, >> > >> > -- >> > Shawn Webb >> > Cofounder / Security Engineer >> > HardenedBSD >> > >> > GPG Key ID: 0xFF2E67A277F8E1FA >> > GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9 3633 C85B 0AF8 AB23 0FB2 >> > https://git-01.md.hardenedbsd.org/HardenedBSD/pubkeys/src/branch/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc >> > >> >> >> -- >> Mateusz Guzik > > -- > Shawn Webb > Cofounder / Security Engineer > HardenedBSD > > GPG Key ID: 0xFF2E67A277F8E1FA > GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9 3633 C85B 0AF8 AB23 0FB2 > https://git-01.md.hardenedbsd.org/HardenedBSD/pubkeys/src/branch/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc > -- Mateusz Guzik From owner-svn-src-head@freebsd.org Sat Nov 14 22:34:37 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9CE75467776 for ; Sat, 14 Nov 2020 22:34:37 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com [IPv6:2607:f8b0:4864:20::82a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CYVWd3rjmz4W6d for ; Sat, 14 Nov 2020 22:34:37 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82a.google.com with SMTP id 3so10075280qtx.3 for ; Sat, 14 Nov 2020 14:34:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kFlydka7vJ9MGC2Wd/WHDVHNr6lHFmzKL9lcNfPzrec=; b=Kn1vqWd7qPiiTNpgcMaci3Hh2DFed+dK6oFISrIPDU8iBJSQTlFAUqwrnbOhFLz1yW 564v66kSDJ8tjd6NTn4YYq8dLiQCbm1gVCPHEnYyo0SuqE1jXIjTD7215EMX+sNNPOxu XmShhsJUUywlBxvacS2trR4xkkKwKLdusjlaEXFHdhDY0FlNUF4jf5ZenJt+T65SFO43 nadK7yMPjLHXXiQhqx72A9q4VwbxuuaIpgCBHiOxP2xlx3zmNM3CDO7jUFaAfNzwkzaz ++Ti1pCLUaLmq2+6ptBSjwJs+8+B3b4W0H2lGGtzDyKJctu7qRlGGjIwLyjhfu+GS3Hf 96SQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kFlydka7vJ9MGC2Wd/WHDVHNr6lHFmzKL9lcNfPzrec=; b=m2ma7OnDQ/loqvk5POhIhjKpYy5Q//XUAScterwiFYSnw3C2NP9AP7wiI+gqA/ov/8 NClmxiSEOuUPJl0PHVy/2EWOY+VHuWTUWILLBqCQ9UugwVTX1Phe88gkLL+CsG4AwXQf je9phgaRXmfG6pgj0Wj/xRbsm6h9DVLXVfDmwMv1Mbsjv5Vg490g+uYc98+kXjj+tZOI N5bat/Glf3mHexvmHAaNDb1n/PtjdDSME7q+E45L6lA2AHipVWS2b/W4BN9Fu+km9SZB Kq0FB+sNZlLP8+H3yGY713MckZ/CPE93L6Fpl2HROuN3BHGVISmIE7pCODwcHVeI/3yS D3NA== X-Gm-Message-State: AOAM531iFOOQfL8ulv48LhOHdyuTYqNBdyhfvu4vHiugyXyqvjN1y54F pQuR0Rjq5uGc6l441monh8TqmT9MGBrWUGBG0cx4JQ== X-Google-Smtp-Source: ABdhPJyDlfbLqHGNqiwTcY+Z0XNYKrJUkmIywp6xCEb2Uu4YSDpX5zvFPeAc1m9y6c1wo++ee2twL23X8p1DuRjTZvA= X-Received: by 2002:ac8:5351:: with SMTP id d17mr8174761qto.235.1605393276390; Sat, 14 Nov 2020 14:34:36 -0800 (PST) MIME-Version: 1.0 References: <202011141920.0AEJKbpO050396@repo.freebsd.org> <20201114205036.tnxvwarsddmu4shz@mutt-hbsd> <20201114205355.j2ejnhouipjr6yhk@mutt-hbsd> In-Reply-To: From: Warner Losh Date: Sat, 14 Nov 2020 15:34:25 -0700 Message-ID: Subject: Re: svn commit: r367692 - head/sys/sys To: Mateusz Guzik Cc: Shawn Webb , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4CYVWd3rjmz4W6d X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 22:34:37 -0000 true, but a version bump forces that and versions are cheap enough... Warner On Sat, Nov 14, 2020 at 1:58 PM Mateusz Guzik wrote: > you are expected to recompile all your kernel modules every time you > update head > > On 11/14/20, Shawn Webb wrote: > > Are there any kernel modules (in base, in ports, or out-of-both-trees) > > that access struct ucred? > > > > On Sat, Nov 14, 2020 at 09:51:47PM +0100, Mateusz Guzik wrote: > >> I don't think so, it does not change any APIs > >> > >> On 11/14/20, Shawn Webb wrote: > >> > On Sat, Nov 14, 2020 at 07:20:37PM +0000, Mateusz Guzik wrote: > >> >> Author: mjg > >> >> Date: Sat Nov 14 19:20:37 2020 > >> >> New Revision: 367692 > >> >> URL: https://svnweb.freebsd.org/changeset/base/367692 > >> >> > >> >> Log: > >> >> cred: reorder cr_audit to be closer to the lock > >> >> > >> >> This makes cr_uid avoid sharing. > >> >> > >> >> Modified: > >> >> head/sys/sys/ucred.h > >> >> > >> >> Modified: head/sys/sys/ucred.h > >> >> > ============================================================================== > >> >> --- head/sys/sys/ucred.h Sat Nov 14 19:19:27 2020 (r367691) > >> >> +++ head/sys/sys/ucred.h Sat Nov 14 19:20:37 2020 (r367692) > >> >> @@ -63,6 +63,7 @@ struct ucred { > >> >> struct mtx cr_mtx; > >> >> u_int cr_ref; /* (c) reference count */ > >> >> u_int cr_users; /* (c) proc + thread using this > cred */ > >> >> + struct auditinfo_addr cr_audit; /* Audit properties. */ > >> >> #define cr_startcopy cr_uid > >> >> uid_t cr_uid; /* effective user id */ > >> >> uid_t cr_ruid; /* real user id */ > >> >> @@ -78,7 +79,6 @@ struct ucred { > >> >> void *cr_pspare2[2]; /* general use 2 */ > >> >> #define cr_endcopy cr_label > >> >> struct label *cr_label; /* MAC label */ > >> >> - struct auditinfo_addr cr_audit; /* Audit properties. */ > >> >> gid_t *cr_groups; /* groups */ > >> >> int cr_agroups; /* Available groups */ > >> >> gid_t cr_smallgroups[XU_NGROUPS]; /* storage for small > groups */ > >> > > >> > Hey Mateusz, > >> > > >> > Since this changes KBI, does __FreeBSD_version need bumping? > >> > > >> > Thanks, > >> > > >> > -- > >> > Shawn Webb > >> > Cofounder / Security Engineer > >> > HardenedBSD > >> > > >> > GPG Key ID: 0xFF2E67A277F8E1FA > >> > GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9 3633 C85B 0AF8 AB23 > 0FB2 > >> > > https://git-01.md.hardenedbsd.org/HardenedBSD/pubkeys/src/branch/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc > >> > > >> > >> > >> -- > >> Mateusz Guzik > > > > -- > > Shawn Webb > > Cofounder / Security Engineer > > HardenedBSD > > > > GPG Key ID: 0xFF2E67A277F8E1FA > > GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9 3633 C85B 0AF8 AB23 0FB2 > > > https://git-01.md.hardenedbsd.org/HardenedBSD/pubkeys/src/branch/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc > > > > > -- > Mateusz Guzik > From owner-svn-src-head@freebsd.org Sat Nov 14 22:56:32 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 69D15467C4B; Sat, 14 Nov 2020 22:56:32 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CYW0w1060z4WpM; Sat, 14 Nov 2020 22:56:31 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wr1-x430.google.com with SMTP id 23so14306477wrc.8; Sat, 14 Nov 2020 14:56:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=kq82tm4Cu/WFJRZAdJCWhKhYDoZC68rqP8F/eDv2CQU=; b=gnXgfsrVgoQQGW6OIfoE8OSZ+OhEuTMrXjLaHne+Esui/rrR5FOSgEYK7whAUX+4iA pGI1v/AbKuh9lIDakjKP3UhGY7G8UG5DqQG/aAX+20sTTmkKfzXF4ftTNtfMaiMsuzEG 3rERnEXV6RbkVwqS0LwGqLz+tyHos4HfwvY+IfxkCilFWcauwoAHFvMJD4q8SBuB14bw lXv3boeNyhgfkaZOCVg+pnrgeb+gWlVQk0kvlXyJ1JBi8rUmJFJ/N5TvcWGzygJDbQcY vCY2Fqovv5xuA5WGtjvUTJTkt4OBaEgbMS2qA7hDGSmS8t3ATCoMt/JoLwk1+6UMh27x Uc4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=kq82tm4Cu/WFJRZAdJCWhKhYDoZC68rqP8F/eDv2CQU=; b=hao+HMiKQ1Vj0EX0mKOQyk3n/+5m9ShNEjoooB8dGDNfmSSGa8Cmik1DTlSSrZG+KI xHHQbeBqkByo0tkymYaH3NPE9iHJ9CmBO4YB/yC55506pzQG7BN/D4h/ALK9Dq2firI6 R3Wsk0ZkDZcwZ3uH03qTvgTVM3qYS5KbzYSArupNqVZGOCaPr8uYuS3yQcDUmcqM73Sk ajowR4Rm14lmA7/4cqtP17Wn5c/uzfeQ8E74WkanGr6R4CoTO9j1B7wEPG6VfEtQjV8w 5kEjzVDgS98j7Hj32kMhpkNUbfg6KTa3zt03oY/It2P0b4XVuJ2V5rEviUWdniRGRKVE 4R6w== X-Gm-Message-State: AOAM530KQ3Y0URB14It4PzOhLWXOy42WHzD/AlSvUrEUSOGxo08GHmoh K4R21Yw0fApOOe4WldoukquazhETFV+ycRvkD1lzXEeHirM= X-Google-Smtp-Source: ABdhPJwOumJVKCsVe4rax6nQT+WCOuUX/2c2b5cjP9NPtkbqtKRuhBmfLc9e4g+TNvrq8UKzkyBWLv8gKsviuDxi/hc= X-Received: by 2002:a5d:5146:: with SMTP id u6mr11921017wrt.66.1605394590776; Sat, 14 Nov 2020 14:56:30 -0800 (PST) MIME-Version: 1.0 Received: by 2002:adf:dec7:0:0:0:0:0 with HTTP; Sat, 14 Nov 2020 14:56:29 -0800 (PST) In-Reply-To: References: <202011141920.0AEJKbpO050396@repo.freebsd.org> <20201114205036.tnxvwarsddmu4shz@mutt-hbsd> <20201114205355.j2ejnhouipjr6yhk@mutt-hbsd> From: Mateusz Guzik Date: Sat, 14 Nov 2020 23:56:29 +0100 Message-ID: Subject: Re: svn commit: r367692 - head/sys/sys To: Warner Losh Cc: Shawn Webb , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4CYW0w1060z4WpM X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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, 14 Nov 2020 22:56:32 -0000 There are "KBI" breaking changes happening all the time and version bumps only sometimes happen. The build process already has infrastructure to rebuild all port kmods as well -- see PORTS_MODULES in make.conf(5) Perhaps it would be beneficial to add checking that the kernel is older than the to-be-loaded module and refuse otherwise. Can be overwritten by a loader.conf knob, then people who run into problems explicitly asked for it. But it's not clear to me if "older" should mean build date or revision or something else. Still, I suspect it will be mostly annoying to developers. Regardless, I have no intention to working on any of this. Maybe PORTS_MODULES is just not advertised enough. On 11/14/20, Warner Losh wrote: > true, but a version bump forces that and versions are cheap enough... > > Warner > > On Sat, Nov 14, 2020 at 1:58 PM Mateusz Guzik wrote: > >> you are expected to recompile all your kernel modules every time you >> update head >> >> On 11/14/20, Shawn Webb wrote: >> > Are there any kernel modules (in base, in ports, or out-of-both-trees) >> > that access struct ucred? >> > >> > On Sat, Nov 14, 2020 at 09:51:47PM +0100, Mateusz Guzik wrote: >> >> I don't think so, it does not change any APIs >> >> >> >> On 11/14/20, Shawn Webb wrote: >> >> > On Sat, Nov 14, 2020 at 07:20:37PM +0000, Mateusz Guzik wrote: >> >> >> Author: mjg >> >> >> Date: Sat Nov 14 19:20:37 2020 >> >> >> New Revision: 367692 >> >> >> URL: https://svnweb.freebsd.org/changeset/base/367692 >> >> >> >> >> >> Log: >> >> >> cred: reorder cr_audit to be closer to the lock >> >> >> >> >> >> This makes cr_uid avoid sharing. >> >> >> >> >> >> Modified: >> >> >> head/sys/sys/ucred.h >> >> >> >> >> >> Modified: head/sys/sys/ucred.h >> >> >> >> ============================================================================== >> >> >> --- head/sys/sys/ucred.h Sat Nov 14 19:19:27 2020 (r367691) >> >> >> +++ head/sys/sys/ucred.h Sat Nov 14 19:20:37 2020 (r367692) >> >> >> @@ -63,6 +63,7 @@ struct ucred { >> >> >> struct mtx cr_mtx; >> >> >> u_int cr_ref; /* (c) reference count */ >> >> >> u_int cr_users; /* (c) proc + thread using this >> cred */ >> >> >> + struct auditinfo_addr cr_audit; /* Audit properties. */ >> >> >> #define cr_startcopy cr_uid >> >> >> uid_t cr_uid; /* effective user id */ >> >> >> uid_t cr_ruid; /* real user id */ >> >> >> @@ -78,7 +79,6 @@ struct ucred { >> >> >> void *cr_pspare2[2]; /* general use 2 */ >> >> >> #define cr_endcopy cr_label >> >> >> struct label *cr_label; /* MAC label */ >> >> >> - struct auditinfo_addr cr_audit; /* Audit properties. */ >> >> >> gid_t *cr_groups; /* groups */ >> >> >> int cr_agroups; /* Available groups */ >> >> >> gid_t cr_smallgroups[XU_NGROUPS]; /* storage for small >> groups */ >> >> > >> >> > Hey Mateusz, >> >> > >> >> > Since this changes KBI, does __FreeBSD_version need bumping? >> >> > >> >> > Thanks, >> >> > >> >> > -- >> >> > Shawn Webb >> >> > Cofounder / Security Engineer >> >> > HardenedBSD >> >> > >> >> > GPG Key ID: 0xFF2E67A277F8E1FA >> >> > GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9 3633 C85B 0AF8 AB23 >> 0FB2 >> >> > >> https://git-01.md.hardenedbsd.org/HardenedBSD/pubkeys/src/branch/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc >> >> > >> >> >> >> >> >> -- >> >> Mateusz Guzik >> > >> > -- >> > Shawn Webb >> > Cofounder / Security Engineer >> > HardenedBSD >> > >> > GPG Key ID: 0xFF2E67A277F8E1FA >> > GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9 3633 C85B 0AF8 AB23 0FB2 >> > >> https://git-01.md.hardenedbsd.org/HardenedBSD/pubkeys/src/branch/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc >> > >> >> >> -- >> Mateusz Guzik >> > -- Mateusz Guzik